/* ═══════════════════════════════════════════════════════════════
   FirmenPortal — Premium Employee Portal CSS
   German Construction Company · Stundenerfassung
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. CUSTOM PROPERTIES ──────────────────────────────────── */
:root {
  /* Primary — elegant deep navy space blue */
  --c-primary-h: 220;
  --c-primary-s: 65%;
  --c-primary-l: 16%;
  --c-primary: hsl(var(--c-primary-h) var(--c-primary-s) var(--c-primary-l));
  --c-primary-light: hsl(220 50% 30%);
  --c-primary-vivid: hsl(220 75% 45%);
  --c-primary-gradient: linear-gradient(135deg, hsl(220 65% 14%), hsl(215 50% 28%));

  /* Secondary — steel blue / slate */
  --c-secondary-h: 210;
  --c-secondary-s: 35%;
  --c-secondary-l: 45%;
  --c-secondary: hsl(var(--c-secondary-h) var(--c-secondary-s) var(--c-secondary-l));
  --c-secondary-light: hsl(210 40% 60%);

  /* Accent — warm construction amber */
  --c-accent-h: 36;
  --c-accent-s: 85%;
  --c-accent-l: 48%;
  --c-accent: hsl(var(--c-accent-h) var(--c-accent-s) var(--c-accent-l));
  --c-accent-light: hsl(36 90% 56%);

  /* Danger — coral red */
  --c-danger-h: 3;
  --c-danger-s: 70%;
  --c-danger-l: 50%;
  --c-danger: hsl(var(--c-danger-h) var(--c-danger-s) var(--c-danger-l));
  --c-danger-light: hsl(3 75% 62%);

  /* Success — emerald green */
  --c-success: hsl(145 65% 38%);
  --c-success-light: hsl(145 55% 48%);

  /* Info — vibrant sky blue */
  --c-info: hsl(205 75% 45%);
  --c-info-light: hsl(205 65% 58%);

  /* Neutrals — cool modern gray palette */
  --c-bg: hsl(220 20% 97%);
  --c-bg-warm: hsl(220 15% 94%);
  --c-surface: hsl(0 0% 100%);
  --c-surface-glass: hsla(220 30% 99% / .78);
  --c-surface-hover: hsl(220 25% 95%);
  --c-border: hsl(220 15% 88%);
  --c-border-subtle: hsl(220 12% 92%);
  --c-text: hsl(220 35% 13%);
  --c-text-secondary: hsl(220 15% 40%);
  --c-text-muted: hsl(220 12% 58%);
  --c-text-inverse: hsl(0 0% 100%);

  /* Shadows — soft multi-layered and floating */
  --shadow-xs: 0 1px 2px hsla(220 30% 10% / .03);
  --shadow-sm: 0 2px 4px hsla(220 30% 10% / .04), 0 1px 2px hsla(220 30% 10% / .02);
  --shadow-md: 0 6px 12px -2px hsla(220 30% 10% / .06), 0 3px 6px -3px hsla(220 30% 10% / .03);
  --shadow-lg: 0 14px 28px -5px hsla(220 30% 10% / .08), 0 8px 16px -6px hsla(220 30% 10% / .04);
  --shadow-xl: 0 25px 45px -8px hsla(220 40% 10% / .09), 0 12px 24px -8px hsla(220 40% 10% / .04);
  --shadow-glow: 0 0 22px hsla(220 65% 30% / .12);
  --shadow-float: 0 16px 45px -10px hsla(220 45% 10% / .16);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 100px;

  /* Spacing */
  --sp-xs: .375rem;
  --sp-sm: .625rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-base: .9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.25;
  --lh-normal: 1.55;

  /* Transitions */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-smooth: cubic-bezier(.4, 0, .2, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;

  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 500;
  --z-modal: 1000;

  /* Topbar */
  --topbar-h: 64px;
  --topbar-inset: 12px;

  /* Glass */
  --glass-blur: 16px;
  --glass-border: 1px solid hsla(220 20% 90% / .5);
}


/* ─── 2. RESET & BASE ───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, hsla(220 50% 40% / .04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, hsla(36 80% 40% / .03) 0%, transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-smooth);
}

body.is-loaded {
  opacity: 1;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--c-primary-light); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--c-primary-vivid); }
strong, b { font-weight: var(--fw-semibold); }
::selection { background: hsla(220 65% 30% / .14); color: var(--c-text); }
:focus-visible { outline: 2px solid var(--c-primary-vivid); outline-offset: 2px; border-radius: var(--r-sm); }


/* ─── 3. KEYFRAME ANIMATIONS ───────────────────────────────── */

/* Fade up — generic reveal */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Gradient flow for page-head */
@keyframes head-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* New entry highlight */
@keyframes new-entry {
  0%   { opacity: 0; transform: translateY(-8px) scale(.98); background-color: hsla(220 50% 40% / .1); }
  50%  { background-color: hsla(220 50% 40% / .05); }
  100% { opacity: 1; transform: translateY(0) scale(1); background-color: transparent; }
}

/* Shimmer sweep for buttons */
@keyframes shimmer {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(200%) skewX(-15deg); }
}

/* Soft pulse for saving indicator */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* Mobile nav slide */
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-12px); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); }
}

/* Counter pop-in */
@keyframes counter-pop {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

/* Subtle glow pulse */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 6px hsla(220 65% 30% / .15); }
  50%      { box-shadow: 0 0 18px hsla(220 65% 30% / .3); }
}

/* Button ripple */
@keyframes ripple-effect {
  0%   { transform: scale(0); opacity: .45; }
  100% { transform: scale(4); opacity: 0; }
}


/* ─── 4. TOPBAR / NAVIGATION ───────────────────────────────── */
.topbar {
  position: sticky;
  top: var(--topbar-inset);
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-md);
  max-width: 1280px;
  margin: var(--topbar-inset) auto 0;
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--c-surface-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px hsla(220 20% 80% / .12);
  transition: box-shadow var(--t-base) var(--ease-out),
              background var(--t-base) var(--ease-out),
              top var(--t-base) var(--ease-out),
              padding var(--t-base) var(--ease-out);
}

.topbar:hover {
  box-shadow: var(--shadow-xl), 0 0 0 1px hsla(220 20% 80% / .18);
}

.topbar.is-scrolled {
  top: 6px;
  padding: var(--sp-xs) var(--sp-lg);
  background: hsla(220 40% 99% / .88);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  text-decoration: none;
  color: var(--c-text);
  transition: opacity var(--t-fast) var(--ease-out);
}

.brand:hover { opacity: .82; color: var(--c-text); }

.brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-primary-gradient);
  box-shadow: var(--shadow-sm);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
  color: var(--c-text);
}

.brand small {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  letter-spacing: .02em;
}

/* Nav links */
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .45em 1em;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
  white-space: nowrap;
}

.nav a:hover {
  color: var(--c-primary);
  background: hsla(220 50% 40% / .08);
  transform: translateY(-1px);
}

.nav a.active {
  color: var(--c-text-inverse);
  background: var(--c-primary-gradient);
  box-shadow: var(--shadow-sm), 0 2px 8px hsla(220 50% 20% / .2);
  font-weight: var(--fw-semibold);
}

.nav a.active:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 4px 12px hsla(220 50% 20% / .25);
}

/* User menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  white-space: nowrap;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-primary-gradient);
  color: var(--c-text-inverse);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
}

.user-profile-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  text-decoration: none;
  color: var(--c-text-secondary);
  transition: color var(--t-fast) var(--ease-out);
}

.user-profile-link:hover {
  color: var(--c-primary);
}

.user-profile-link:hover .user-avatar {
  transform: scale(1.08);
  box-shadow: var(--shadow-md), 0 0 0 2px hsla(220 50% 30% / .1);
}

.user-menu .button {
  font-size: var(--fs-xs);
  padding: .4em .9em;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease-out);
}

.nav-toggle:hover { background: hsla(220 30% 40% / .08); }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text-secondary);
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease-out),
              opacity var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
  transform-origin: center;
}

/* Hamburger → X animation */
.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* App shell */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-lg) var(--sp-3xl);
  animation: fade-up .5s var(--ease-out) both;
}


/* ─── 5. AUTH / LOGIN PAGE ──────────────────────────────────── */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-xl);
  background:
    radial-gradient(ellipse 70% 60% at 30% 20%, hsla(220 55% 25% / .14) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 75% 80%, hsla(36 85% 45% / .08) 0%, transparent 65%),
    linear-gradient(160deg, hsl(220 30% 10%) 0%, hsl(215 35% 15%) 40%, hsl(220 25% 12%) 100%);
  background-attachment: fixed;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--sp-2xl);
  background: var(--c-surface-glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float), 0 0 0 1px hsla(220 30% 80% / .08);
  animation: fade-up .6s var(--ease-out) both;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
  text-align: center;
}

.auth-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.auth-brand h1 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  letter-spacing: -.02em;
}

body.auth-page .auth-card label {
  color: var(--c-text-secondary);
}


/* ─── 6. PAGE HEADERS ───────────────────────────────────────── */
.page-head {
  position: relative;
  padding: var(--sp-2xl) var(--sp-xl);
  margin-bottom: var(--sp-xl);
  background:
    linear-gradient(135deg, hsl(220 65% 14%) 0%, hsl(215 45% 24%) 50%, hsl(220 50% 18%) 100%);
  background-size: 200% 200%;
  animation: head-flow 12s ease-in-out infinite;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), inset 0 1px 0 hsla(0 0% 100% / .06);
}

.page-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 300px at 80% 30%, hsla(220 55% 60% / .12), transparent),
    radial-gradient(circle 200px at 20% 80%, hsla(36 85% 50% / .06), transparent);
  pointer-events: none;
}

.page-head h1 {
  position: relative;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text-inverse);
  letter-spacing: -.02em;
  line-height: var(--lh-tight);
  text-shadow: 0 1px 3px hsla(220 60% 10% / .3);
}

.page-head p {
  position: relative;
  font-size: var(--fs-base);
  color: hsla(0 0% 100% / .72);
  margin-top: var(--sp-xs);
  font-weight: var(--fw-normal);
}


/* ─── 7. PANELS / CARDS ────────────────────────────────────── */
.panel {
  position: relative;
  background: var(--c-surface-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  border: var(--glass-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out);
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--sp-lg);
  right: var(--sp-lg);
  height: 3px;
  background: var(--c-primary-gradient);
  border-radius: 0 0 3px 3px;
  opacity: .7;
  transition: opacity var(--t-base) var(--ease-out);
}

.panel:hover::before { opacity: 1; }

.panel h2 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  margin-bottom: var(--sp-md);
  letter-spacing: -.01em;
}

.panel h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-sm);
}

/* Archive panels */
.archive-panel {
  border: var(--glass-border);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-md);
  background: var(--c-surface-glass);
  overflow: hidden;
}

.archive-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  cursor: pointer;
  list-style: none;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
  user-select: none;
}

.archive-summary:hover {
  background: hsla(220 20% 50% / .05);
  color: var(--c-text);
}

.archive-summary::-webkit-details-marker { display: none; }

.archive-summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: .15em .55em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-primary-light);
  background: hsla(220 40% 40% / .1);
  border-radius: var(--r-pill);
}


/* ─── 8. BUTTONS ────────────────────────────────────────────── */
.button,
button.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .65em 1.4em;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  color: var(--c-text-inverse);
  background: linear-gradient(135deg, hsl(220 55% 36%) 0%, hsl(215 50% 26%) 100%);
  border: 1px solid hsla(0 0% 100% / .1);
  border-radius: var(--r-pill);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm), inset 0 1px 0 hsla(0 0% 100% / .1);
  transition: transform var(--t-fast) var(--ease-spring),
              box-shadow var(--t-base) var(--ease-out),
              filter var(--t-fast) var(--ease-out),
              background var(--t-base) var(--ease-out);
}

.button::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(
    circle 100px at var(--glow-x, 50%) var(--glow-y, 50%),
    hsla(36 90% 65% / .3),
    transparent 60%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.button:hover::before {
  opacity: 1;
}

.button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    hsla(0 0% 100% / .15) 45%,
    hsla(0 0% 100% / .2) 50%,
    hsla(0 0% 100% / .15) 55%,
    transparent 65%
  );
  transform: translateX(-100%) skewX(-15deg);
  transition: none;
  pointer-events: none;
  z-index: 1;
}

.button:hover::after {
  animation: shimmer .65s var(--ease-out);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 4px 14px hsla(220 50% 25% / .25);
  filter: brightness(1.06);
}

.button:active {
  transform: translateY(0) scale(.97);
  box-shadow: var(--shadow-xs);
  filter: brightness(.96);
}

/* Secondary */
.button.secondary {
  color: var(--c-primary-light);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-primary-vivid);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm), 0 0 0 3px hsla(220 50% 40% / .08);
}

.button.secondary::after { display: none; }

/* Subtle */
.button.subtle {
  color: var(--c-text-secondary);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.button.subtle:hover {
  color: var(--c-primary);
  background: hsla(220 40% 40% / .08);
  box-shadow: none;
  transform: translateY(-1px);
}

.button.subtle::after { display: none; }

/* Danger */
.button.danger {
  color: var(--c-text-inverse);
  background: linear-gradient(135deg, hsl(3 65% 48%), hsl(3 55% 42%));
  border-color: hsla(0 0% 100% / .08);
}

.button.danger:hover {
  box-shadow: var(--shadow-md), 0 4px 14px hsla(3 65% 40% / .25);
  filter: brightness(1.06);
}

/* Compact */
.button.compact {
  padding: .4em .85em;
  font-size: var(--fs-xs);
}

/* Disabled */
.button:disabled {
  opacity: .45;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(.3);
}

/* Ripple overlay */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: hsla(0 0% 100% / .3);
  transform: scale(0);
  animation: ripple-effect .6s ease-out forwards;
  pointer-events: none;
  z-index: 2;
}


/* ─── 9. METRIC GRID ───────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.metric {
  position: relative;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-lg) calc(var(--sp-lg) + 6px);
  background: var(--c-surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.metric:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.metric::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c-primary-vivid);
  border-radius: 0 4px 4px 0;
}

.metric:nth-child(2)::before {
  background: var(--c-secondary-light);
}

.metric:nth-child(3)::before {
  background: var(--c-accent-light);
}

.metric span {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-xs);
}

.metric strong {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  line-height: var(--lh-tight);
  letter-spacing: -.02em;
  animation: counter-pop .4s var(--ease-spring) both;
}


/* ─── 10. NOTICES / ALERTS ──────────────────────────────────── */
.notice {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-lg);
  border-left: 4px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-secondary);
  animation: fade-up .35s var(--ease-out) both;
}

.notice.success {
  border-left-color: var(--c-success);
  background: hsla(145 50% 40% / .06);
  color: hsl(145 40% 28%);
}

.notice.error {
  border-left-color: var(--c-danger);
  background: hsla(3 50% 50% / .06);
  color: hsl(3 40% 35%);
}

.notice.info {
  border-left-color: var(--c-info);
  background: hsla(205 55% 50% / .06);
  color: hsl(205 40% 32%);
}


/* ─── 11. FORMS ─────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md) var(--sp-lg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.field.full {
  grid-column: 1 / -1;
}

label,
.label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  letter-spacing: .01em;
}

input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  color: var(--c-text);
  padding: .6em .85em;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out);
  outline: none;
  width: 100%;
}

input:hover,
select:hover,
textarea:hover {
  border-color: hsla(220 30% 50% / .4);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-primary-vivid);
  box-shadow: 0 0 0 3px hsla(220 50% 40% / .12), var(--shadow-xs);
  background: var(--c-surface);
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: var(--lh-normal);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23667' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8em center;
  padding-right: 2.2em;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  cursor: pointer;
}

.check-line {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
}

.check-line input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--c-primary-vivid);
  border-radius: var(--r-sm);
  cursor: pointer;
}


/* ─── 12. TABLES ────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: var(--glass-border);
  background: var(--c-surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

th {
  padding: var(--sp-md) var(--sp-lg);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  background: hsla(220 15% 50% / .05);
  border-bottom: 1px solid var(--c-border-subtle);
  white-space: nowrap;
}

td {
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--c-border-subtle);
  color: var(--c-text);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--t-fast) var(--ease-out);
}

tbody tr:hover td {
  background: hsla(220 25% 50% / .04);
}

tbody tr:last-child td {
  border-bottom: none;
}

.empty-row {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg) !important;
  color: var(--c-text-muted);
  font-style: italic;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  justify-content: flex-end;
}


/* ─── 13. STATUS PILLS & BADGES ─────────────────────────────── */
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: .25em .75em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: all var(--t-base) var(--ease-out);
}

.status-pill {
  background: hsla(220 10% 50% / .1);
  color: var(--c-text-muted);
}

.status-pill[data-type="saving"] {
  background: hsla(212 50% 50% / .12);
  color: var(--c-secondary);
  animation: pulse-soft 1.5s ease-in-out infinite;
}

.status-pill[data-type="saved"] {
  background: hsla(145 50% 40% / .12);
  color: var(--c-success);
}

.status-pill[data-type="error"] {
  background: hsla(3 50% 50% / .12);
  color: var(--c-danger);
}

.status-pill.is-transitioning {
  transition: background var(--t-slow) var(--ease-out),
              color var(--t-slow) var(--ease-out),
              transform var(--t-fast) var(--ease-spring);
  transform: scale(.95);
}

.badge {
  background: hsla(220 30% 40% / .1);
  color: var(--c-primary-light);
}

.badge.amber {
  background: hsla(34 60% 50% / .12);
  color: var(--c-accent);
}

.badge.red {
  background: hsla(3 50% 50% / .12);
  color: var(--c-danger);
}

.badge.blue {
  background: hsla(212 50% 50% / .12);
  color: var(--c-secondary);
}

.muted-pill {
  display: inline-flex;
  align-items: center;
  padding: .2em .65em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  background: hsla(220 10% 50% / .08);
  border-radius: var(--r-pill);
}


/* ─── 14. SPLIT COUNTER ─────────────────────────────────────── */
.split-counter {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.split-counter span,
.split-counter a {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
}

.split-counter a:hover {
  color: var(--c-primary);
}


/* ─── 15. TOOLBAR / ACTIONS ─────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}


/* ─── 16. MONTH NAVIGATION ──────────────────────────────────── */
.month-strip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: .3em;
  background: var(--c-surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: var(--glass-border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
}

.month-strip .button {
  padding: .35em .75em;
  font-size: var(--fs-sm);
}

.month-strip strong {
  padding: 0 var(--sp-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  min-width: 130px;
  text-align: center;
}

.panel .month-strip {
  background: hsla(220 15% 50% / .06);
  border-color: var(--c-border-subtle);
}


/* ─── 17. HOME PAGE GRID ────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-xl);
  align-items: start;
}

/* News */
.news-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.news-card {
  position: relative;
  background: var(--c-surface-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.news-card h2 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-xs);
}

.news-meta {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.news-body {
  font-size: var(--fs-base);
  color: var(--c-text-secondary);
  line-height: var(--lh-normal);
  white-space: pre-wrap;
}

.news-image {
  border-radius: var(--r-md);
  margin-top: var(--sp-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.news-image img {
  width: 100%;
  display: block;
  transition: transform var(--t-slow) var(--ease-out);
}

.news-card:hover .news-image img {
  transform: scale(1.02);
}


/* ─── 18. HOURS EDITOR ──────────────────────────────────────── */
.hours-app {
  display: grid;
  gap: var(--sp-lg);
}

/* Day panel */
.day-panel {
  background: var(--c-surface-glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}

.day-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Day head */
.day-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: linear-gradient(135deg, hsl(220 65% 14%) 0%, hsl(215 50% 22%) 100%);
  color: var(--c-text-inverse);
}

.day-date {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
}

.day-date small {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.day-sum {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: hsla(0 0% 100% / .9);
  padding: .3em .8em;
  background: hsla(0 0% 100% / .12);
  border-radius: var(--r-pill);
}

.day-head .button.secondary {
  color: hsla(0 0% 100% / .9);
  background: hsla(0 0% 100% / .1);
  border-color: hsla(0 0% 100% / .2);
  font-size: var(--fs-xs);
  padding: .4em .8em;
}

.day-head .button.secondary:hover {
  background: hsla(0 0% 100% / .2);
  color: #fff;
  border-color: hsla(0 0% 100% / .35);
  box-shadow: none;
}

/* Entry list */
.entry-list {
  display: flex;
  flex-direction: column;
}

/* Entry row */
.entry-row {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr 1fr auto;
  grid-template-areas:
    "hours site note status"
    "hours site note remove";
  gap: var(--sp-sm) var(--sp-md);
  padding: var(--sp-md) var(--sp-lg) var(--sp-md) calc(var(--sp-lg) + 6px);
  border-bottom: 1px solid var(--c-border-subtle);
  transition: background var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out);
  align-items: start;
}

.entry-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--sp-sm);
  bottom: var(--sp-sm);
  width: 3px;
  background: var(--c-primary-vivid);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}

.entry-row:hover::before,
.entry-row:focus-within::before {
  opacity: 1;
}

.entry-row:hover {
  background: hsla(220 25% 50% / .03);
}

.entry-row:focus-within {
  background: hsla(220 30% 50% / .05);
}

.entry-row:last-child { border-bottom: none; }

/* Entry states */
.entry-row.is-placeholder {
  opacity: .5;
  background: hsla(220 10% 50% / .02);
}

.entry-row.is-new {
  animation: new-entry .5s var(--ease-out) both;
}

/* Grid areas */
.hours-field { grid-area: hours; }
.site-field  { grid-area: site; }
.note-field  { grid-area: note; }
.status-field { grid-area: status; }
.entry-remove { grid-area: remove; }

/* Entry labels */
.entry-row label,
.entry-row .label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  margin-bottom: 2px;
}

/* Entry inputs — slightly smaller */
.entry-row input,
.entry-row select,
.entry-row textarea {
  font-size: var(--fs-sm);
  padding: .5em .7em;
}

/* Flag chips */
.flag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flag-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: .25em .65em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  background: hsla(220 10% 50% / .06);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-pill);
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast) var(--ease-out);
}

.flag-chip:hover {
  background: hsla(220 20% 50% / .1);
  border-color: hsla(220 30% 50% / .3);
  color: var(--c-text-secondary);
  transform: translateY(-1px);
}

/* Flag color variants */
.flag-chip:nth-child(1) { border-color: hsla(220 40% 40% / .3); }
.flag-chip:nth-child(2) { border-color: hsla(210 40% 50% / .3); }
.flag-chip:nth-child(3) { border-color: hsla(36 70% 50% / .3); }
.flag-chip:nth-child(4) { border-color: hsla(280 35% 50% / .3); }
.flag-chip:nth-child(5) { border-color: hsla(3 40% 50% / .3); }

/* Checked states */
.flag-chip:has(input:checked) {
  color: var(--c-text-inverse);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm);
}

.flag-chip:nth-child(1):has(input:checked) {
  background: var(--c-primary-light);
  border-color: var(--c-primary-light);
}

.flag-chip:nth-child(2):has(input:checked) {
  background: var(--c-secondary);
  border-color: var(--c-secondary);
}

.flag-chip:nth-child(3):has(input:checked) {
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.flag-chip:nth-child(4):has(input:checked) {
  background: hsl(280 35% 50%);
  border-color: hsl(280 35% 50%);
}

.flag-chip:nth-child(5):has(input:checked) {
  background: var(--c-danger);
  border-color: var(--c-danger);
}

.flag-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Entry remove button */
.entry-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: var(--fs-md);
  transition: all var(--t-fast) var(--ease-out);
  justify-self: end;
  align-self: start;
}

.entry-remove:hover {
  color: var(--c-danger);
  background: hsla(3 50% 50% / .08);
  border-color: hsla(3 50% 50% / .2);
  transform: scale(1.08);
}


/* ─── 19. LOCKED NOTE ───────────────────────────────────────── */
.locked-note {
  padding: var(--sp-md) var(--sp-lg);
  border-left: 4px solid var(--c-accent);
  background: hsla(36 60% 50% / .06);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--fs-sm);
  color: hsl(36 40% 32%);
  margin-bottom: var(--sp-lg);
}


/* ─── 20. EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--sp-3xl) var(--sp-xl);
  color: var(--c-text-muted);
  font-size: var(--fs-base);
}


/* ─── 21. UTILITIES ─────────────────────────────────────────── */
.muted { color: var(--c-text-muted); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }


/* ─── 22. SCROLL-TRIGGERED ANIMATIONS ───────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms var(--ease-out),
              transform 280ms var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════
   23. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════ */

/* ── ≤ 1080px ────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .home-grid {
    grid-template-columns: 1fr 300px;
  }

  .metric-grid {
    gap: var(--sp-sm);
  }

  .entry-row {
    grid-template-columns: 140px 1fr 1fr auto;
  }
}

/* ── ≤ 980px — Mobile nav trigger ────────────────────────────── */
@media (max-width: 980px) {
  .nav-toggle {
    display: flex;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    position: relative;
    flex-wrap: wrap;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--sp-sm);
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-md);
    background: var(--c-surface-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: var(--glass-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-dropdown);
  }

  .nav.open {
    display: flex;
    animation: slide-down .3s var(--ease-out) both;
  }

  .nav a {
    padding: .7em 1em;
    border-radius: var(--r-md);
    font-size: var(--fs-base);
    justify-content: flex-start;
  }

  .nav a.active {
    border-radius: var(--r-md);
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .entry-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hours site"
      "note note"
      "status remove";
  }
}

/* ── ≤ 760px ─────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root {
    --topbar-inset: 8px;
  }

  .app-shell {
    padding: var(--sp-lg) var(--sp-md) var(--sp-2xl);
  }

  .page-head {
    padding: var(--sp-xl) var(--sp-lg);
    border-radius: var(--r-lg);
  }

  .page-head h1 { font-size: var(--fs-xl); }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-sm);
  }

  .toolbar .actions {
    justify-content: flex-end;
  }

  .day-head {
    grid-template-columns: 1fr auto;
    gap: var(--sp-sm);
  }

  .day-head .button.secondary {
    grid-column: 1 / -1;
    justify-self: start;
  }

  th, td {
    padding: var(--sp-sm) var(--sp-md);
  }

  .user-menu span {
    display: none;
  }
}

/* ── ≤ 640px ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar {
    padding: var(--sp-xs) var(--sp-md);
    border-radius: var(--r-lg);
    gap: var(--sp-sm);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong { font-size: var(--fs-sm); }
  .brand small { display: none; }

  .page-head { margin-bottom: var(--sp-lg); }
  .page-head h1 { font-size: var(--fs-lg); }
  .page-head p { font-size: var(--fs-sm); }

  .panel {
    padding: var(--sp-md);
    border-radius: var(--r-md);
  }

  .panel::before {
    left: var(--sp-md);
    right: var(--sp-md);
  }

  .entry-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hours"
      "site"
      "note"
      "status"
      "remove";
    padding: var(--sp-md);
    gap: var(--sp-sm);
  }

  .entry-remove {
    justify-self: start;
  }

  .month-strip {
    width: 100%;
    justify-content: space-between;
  }

  .news-card { padding: var(--sp-md); }

  .auth-card {
    padding: var(--sp-lg);
    border-radius: var(--r-lg);
  }
}

/* ── ≤ 420px ─────────────────────────────────────────────────── */
@media (max-width: 420px) {
  :root {
    --topbar-inset: 6px;
  }

  .app-shell {
    padding: var(--sp-md) var(--sp-sm) var(--sp-xl);
  }

  .page-head {
    padding: var(--sp-lg) var(--sp-md);
    border-radius: var(--r-md);
  }

  .button {
    padding: .55em 1em;
    font-size: var(--fs-xs);
  }

  .metric strong {
    font-size: var(--fs-xl);
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actions .button {
    flex: 1;
  }

  .day-head {
    padding: var(--sp-sm) var(--sp-md);
  }
}

/* ── ≤ 380px ─────────────────────────────────────────────────── */
@media (max-width: 380px) {
  body {
    font-size: var(--fs-sm);
  }

  .topbar {
    margin-left: 4px;
    margin-right: 4px;
    padding: var(--sp-xs) var(--sp-sm);
  }

  .page-head h1 { font-size: var(--fs-md); }

  .panel {
    padding: var(--sp-sm);
    margin-bottom: var(--sp-md);
  }

  .panel h2 { font-size: var(--fs-md); }

  .auth-card {
    padding: var(--sp-md);
  }
}


/* ═══════════════════════════════════════════════════════════════
   24. PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    transition: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
    padding: 0;
    margin: 0;
  }

  .topbar,
  .nav-toggle,
  .user-menu,
  .button,
  button,
  .actions,
  .toolbar,
  .entry-remove,
  .month-strip,
  .flag-chip {
    display: none !important;
  }

  .app-shell {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .page-head {
    border-radius: 0;
    padding: 10pt 0;
    margin-bottom: 15pt;
    border-bottom: 2pt solid #000;
  }

  .page-head h1 { font-size: 18pt; }
  .page-head p { font-size: 10pt; }

  .panel,
  .news-card,
  .day-panel {
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 10pt;
    page-break-inside: avoid;
    margin-bottom: 10pt;
  }

  .panel::before { display: none; }

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric {
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 8pt;
  }

  .metric::before { display: none; }

  .home-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 9pt;
  }

  th, td {
    padding: 4pt 6pt;
    border: 1px solid #ccc;
  }

  th {
    font-weight: bold;
    text-transform: none;
    letter-spacing: 0;
  }

  .entry-row {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas: "hours site note";
    border-bottom: 1px solid #ccc;
    padding: 6pt 0;
  }

  .entry-row::before { display: none; }

  .status-field { display: none; }

  .notice {
    border: 1px solid #000;
    border-radius: 0;
    padding: 6pt 10pt;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666 !important;
  }

  .nav a[href]::after,
  .brand a[href]::after {
    content: none;
  }

  img {
    max-width: 100% !important;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }
}


/* ═══════════════════════════════════════════════════════════════
   25. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .page-head {
    animation: none;
    background-size: 100% 100%;
  }

  .button::after { display: none; }

  [data-animate] {
    opacity: 1;
    transform: none;
  }

  .entry-row.is-new {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: var(--z-overlay);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-primary-gradient);
  color: var(--c-text-inverse);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  cursor: pointer;
  box-shadow: var(--shadow-md), 0 0 0 1px hsla(220, 30%, 80%, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--t-base) var(--ease-out),
              transform var(--t-base) var(--ease-out),
              visibility var(--t-base),
              background var(--t-base) var(--ease-out);
  outline: none;
}

.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, hsl(220 65% 18%), hsl(215 50% 32%));
  box-shadow: var(--shadow-lg), 0 0 0 3px hsla(220, 50%, 40%, 0.18);
}

.scroll-to-top:active {
  transform: translateY(0) scale(0.96);
}

@media print {
  .scroll-to-top {
    display: none !important;
  }
}

/* ─── End of FirmenPortal CSS ───────────────────────────────── */
