/* ═══════════════════════════════════════════════════════════════════
   THE GEORGE LEGACY — App Design System
   Brand colours extracted from thegeorgelegacy.com.au
   Warm ivory (#EBE2CC nav) + near-black (#1C1814 buttons/hero)
   Typography: DM Serif Display (headings) + Inter (body)
═══════════════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Design Tokens ──────────────────────────────────────────────── */
:root {
  /* Brand — pulled from thegeorgelegacy.com.au */
  --cream:       #EBE2CC;   /* nav bar cream from website */
  --cream-light: #F5F0E6;   /* lighter cream for app bg */
  --dark:        #1C1814;   /* near-black from website (buttons, hero) */
  --dark-2:      #2E261C;   /* hover state for dark elements */

  /* App backgrounds */
  --bg:          #F5F0E6;   /* page background */
  --surface:     #FFFFFF;   /* cards, modals */
  --surface-alt: #F0EAD8;   /* subtle alt surface */

  /* Borders */
  --border:      #E4D9C4;
  --border-2:    #D4C8A8;   /* stronger border */

  /* Text */
  --text-1:      #1C1814;   /* primary */
  --text-2:      #6B5E50;   /* secondary */
  --text-3:      #A89880;   /* tertiary / placeholder */
  --text-inv:    #FFFFFF;   /* on dark backgrounds */

  /* Accent (uses brand dark) */
  --accent:      #1C1814;
  --accent-h:    #2E261C;
  --accent-sub:  #EBE2CC;   /* light accent for chips */

  /* Status */
  --ok:          #2D5A3D;
  --ok-bg:       #E6F0EA;
  --warn:        #A06A10;
  --warn-bg:     #FDF3E0;
  --err:         #8B3530;
  --err-bg:      #FAEBE9;
  --info:        #24486B;
  --info-bg:     #E8EEF8;

  /* Typography */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type scale */
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-md:    17px;
  --text-lg:    20px;
  --text-xl:    24px;
  --text-2xl:   30px;
  --text-3xl:   38px;

  /* Spacing */
  --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
  --s5: 20px;  --s6: 24px;  --s7: 32px;  --s8: 40px;
  --s9: 48px;  --s10: 64px;

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(28,24,20,.06);
  --sh-sm: 0 2px 6px rgba(28,24,20,.08);
  --sh-md: 0 4px 14px rgba(28,24,20,.10);
  --sh-lg: 0 8px 28px rgba(28,24,20,.12);

  /* Layout */
  --topbar-h:  56px;
  --nav-h:     68px;
  --content-max: 600px;

  /* Transition */
  --t: 150ms ease;
  --t-slow: 280ms ease;
}

/* ── App Shell ──────────────────────────────────────────────────── */
#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--dark);
  display: flex;
  align-items: center;
  padding: 0 var(--s4);
  z-index: 100;
  gap: var(--s3);
}
.topbar-brand {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  color: var(--text-inv);
  flex: 1;
  letter-spacing: 0.01em;
}
.topbar-brand span {
  font-size: var(--text-sm);
  opacity: 0.6;
  font-family: var(--font-body);
  font-weight: 400;
  display: block;
  line-height: 1;
  margin-top: 1px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: background var(--t), color var(--t);
}
.topbar-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.topbar-btn svg { width: 20px; height: 20px; }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--cream);
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* Content area */
.content {
  flex: 1;
  padding-top: var(--topbar-h);
  padding-bottom: var(--nav-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.content-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s4);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: var(--s2);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(28,24,20,.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--s1);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--t);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { stroke: var(--accent); }

/* ── Typography ─────────────────────────────────────────────────── */
.h1 { font-family: var(--font-heading); font-size: var(--text-2xl); line-height: 1.2; }
.h2 { font-family: var(--font-heading); font-size: var(--text-xl);  line-height: 1.25; }
.h3 { font-family: var(--font-heading); font-size: var(--text-lg);  line-height: 1.3; }
.h4 { font-size: var(--text-md); font-weight: 600; line-height: 1.35; }
.body { font-size: var(--text-base); line-height: 1.6; }
.caption { font-size: var(--text-sm); color: var(--text-2); }
.label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }

/* Section header */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
}
.section-hd h2 { font-size: var(--text-base); font-weight: 600; color: var(--text-1); }
.section-hd a, .section-hd button { font-size: var(--text-sm); color: var(--text-2); }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.card-body { padding: var(--s4); }
.card-foot {
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  gap: var(--s2);
  align-items: center;
}

/* Clickable card */
.card-link {
  cursor: pointer;
  transition: box-shadow var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.card-link:active { transform: scale(0.99); box-shadow: var(--sh-sm); }

/* ── KPI / Stat Cards ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  box-shadow: var(--sh-xs);
}
.kpi-card.dark {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--text-inv);
}
.kpi-card.dark .kpi-label { color: rgba(255,255,255,0.6); }
.kpi-val { font-size: var(--text-xl); font-weight: 700; line-height: 1; margin-bottom: var(--s1); }
.kpi-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.kpi-sub { font-size: var(--text-sm); color: var(--text-2); margin-top: var(--s1); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0 var(--s5);
  height: 44px;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background var(--t), opacity var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: var(--text-inv); }
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border-2);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text-1); }

.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.88; }

.btn-sm { height: 34px; padding: 0 var(--s4); font-size: var(--text-xs); }
.btn-lg { height: 52px; padding: 0 var(--s7); font-size: var(--text-base); }
.btn-full { width: 100%; }

/* Icon button */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text-1); }
.icon-btn svg { width: 18px; height: 18px; }

/* FAB — floating action button */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--s4));
  right: var(--s4);
  width: 52px; height: 52px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--text-inv);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-md);
  z-index: 50;
  transition: transform var(--t), box-shadow var(--t);
}
.fab:active { transform: scale(0.94); box-shadow: var(--sh-sm); }
.fab svg { width: 22px; height: 22px; }

/* ── Form Elements ──────────────────────────────────────────────── */
.form-group { margin-bottom: var(--s4); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--s2);
}
.form-hint { font-size: var(--text-xs); color: var(--text-3); margin-top: var(--s1); }
.form-error { font-size: var(--text-xs); color: var(--err); margin-top: var(--s1); }

.input {
  width: 100%;
  height: 46px;
  padding: 0 var(--s4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-base);
  color: var(--text-1);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28,24,20,0.08);
}
.input.error { border-color: var(--err); }
.input:disabled { background: var(--surface-alt); color: var(--text-3); cursor: not-allowed; }

textarea.input {
  height: auto;
  min-height: 100px;
  padding: var(--s3) var(--s4);
  resize: vertical;
  line-height: 1.6;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B5E50'%3E%3Cpath d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s3) center;
  background-size: 16px;
  padding-right: var(--s8);
}

/* ── Badges / Pills ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--s2);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-bg);   color: var(--ok);   }
.badge-warn   { background: var(--warn-bg); color: var(--warn); }
.badge-err    { background: var(--err-bg);  color: var(--err);  }
.badge-info   { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-alt); color: var(--text-2); }
.badge-dark   { background: var(--dark); color: var(--text-inv); }

/* Status-specific badges */
.badge-lead    { background: #EEF0F8; color: #3A4A8B; }
.badge-quoting { background: var(--info-bg); color: var(--info); }
.badge-active  { background: var(--ok-bg);  color: var(--ok);   }
.badge-on-hold { background: var(--warn-bg); color: var(--warn); }
.badge-complete  { background: var(--surface-alt); color: var(--text-2); }
.badge-invoiced  { background: #EDF8F0; color: #1E6B40; }
.badge-draft     { background: var(--surface-alt); color: var(--text-2); }
.badge-sent      { background: var(--warn-bg); color: var(--warn); }
.badge-approved  { background: var(--ok-bg); color: var(--ok); }
.badge-rejected  { background: var(--err-bg); color: var(--err); }
.badge-simple    { background: var(--accent-sub); color: var(--text-1); }
.badge-proposal  { background: var(--info-bg); color: var(--info); }

/* ── List Items ─────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: var(--s2); }

.list-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: box-shadow var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.list-item:active { transform: scale(0.99); box-shadow: var(--sh-sm); }

.list-item-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
}
.list-item-icon svg { width: 20px; height: 20px; }

.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: var(--text-base); font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: var(--text-sm); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list-item-right { flex-shrink: 0; text-align: right; }
.chevron-icon { color: var(--text-3); }
.chevron-icon svg { width: 16px; height: 16px; }

/* ── Divider ────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--s5) 0; }
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: var(--s5) 0;
}
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Modals ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,24,20,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  width: 100%;
  max-width: var(--content-max);
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--t-slow);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-2);
  border-radius: var(--r-full);
  margin: var(--s3) auto var(--s2);
  flex-shrink: 0;
}
.modal-hd {
  padding: var(--s2) var(--s5) var(--s4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: var(--font-heading); font-size: var(--text-xl); }
.modal-body {
  padding: 0 var(--s5) var(--s5);
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  gap: var(--s3);
}

/* ── Slide Panels ───────────────────────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,24,20,0.5);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
}
.panel-overlay.open { opacity: 1; pointer-events: all; }

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(90vw, 420px);
  background: var(--surface);
  z-index: 151;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  box-shadow: var(--sh-lg);
}
.panel.open { transform: translateX(0); }

.panel-hd {
  padding: calc(var(--topbar-h) + var(--s4)) var(--s5) var(--s4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title { font-family: var(--font-heading); font-size: var(--text-xl); }
.panel-body { flex: 1; overflow-y: auto; padding: var(--s5); }
.panel-foot {
  padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--s3);
}

/* ── Toast ──────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--s4));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  pointer-events: none;
}
.toast-item {
  background: var(--dark);
  color: var(--text-inv);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--sh-md);
  opacity: 0;
  transition: opacity 200ms ease;
  max-width: calc(var(--content-max) - var(--s8));
  text-align: center;
}
.toast-item.show { opacity: 1; }

/* ── Loading States ─────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(28,24,20,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  flex-shrink: 0;
}
.spinner-inv {
  border-color: rgba(255,255,255,0.25);
  border-top-color: #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--s3);
  color: var(--text-3);
  font-size: var(--text-sm);
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-alt) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--s10) var(--s6);
}
.empty-state-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--s4);
  color: var(--border-2);
}
.empty-state-icon svg { width: 100%; height: 100%; }
.empty-state h3 { font-size: var(--text-lg); color: var(--text-1); margin-bottom: var(--s2); }
.empty-state p  { font-size: var(--text-sm); color: var(--text-3); max-width: 240px; margin: 0 auto var(--s5); line-height: 1.6; }

/* ── Login Screen ───────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s6);
}
.login-brand {
  text-align: center;
  margin-bottom: var(--s8);
}
.login-logo {
  width: 80px; height: 80px;
  background: var(--cream);
  border-radius: var(--r-xl);
  margin: 0 auto var(--s4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 36px;
  color: var(--dark);
  box-shadow: var(--sh-lg);
}
.login-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--text-inv);
  margin-bottom: var(--s1);
}
.login-subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.login-form .input {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: var(--text-inv);
}
.login-form .input::placeholder { color: rgba(255,255,255,0.35); }
.login-form .input:focus {
  background: rgba(255,255,255,0.12);
  border-color: var(--cream);
  box-shadow: 0 0 0 3px rgba(235,226,204,0.15);
}
.login-form .btn-primary {
  background: var(--cream);
  color: var(--dark);
  margin-top: var(--s2);
  height: 50px;
  font-size: var(--text-base);
}
.login-form .btn-primary:hover { background: #fff; }
.login-error {
  background: rgba(139,53,48,0.25);
  border: 1px solid rgba(139,53,48,0.4);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  font-size: var(--text-sm);
  color: #FCA5A5;
  display: none;
}
.login-error.show { display: block; }
.login-footer {
  margin-top: var(--s8);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.2);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── Dashboard Screen ───────────────────────────────────────────── */
.dash-welcome {
  margin-bottom: var(--s5);
}
.dash-welcome .greeting { font-size: var(--text-sm); color: var(--text-3); margin-bottom: 2px; }
.dash-welcome .name { font-family: var(--font-heading); font-size: var(--text-2xl); color: var(--text-1); }

/* ── Job Screen ─────────────────────────────────────────────────── */
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.job-card:active { transform: scale(0.99); box-shadow: var(--sh-sm); }
.job-card-hd { padding: var(--s4); display: flex; align-items: flex-start; gap: var(--s3); }
.job-card-info { flex: 1; min-width: 0; }
.job-card-name { font-size: var(--text-base); font-weight: 600; color: var(--text-1); margin-bottom: 3px; }
.job-card-meta { font-size: var(--text-sm); color: var(--text-2); }
.job-card-actions {
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  gap: var(--s2);
}

/* ── Detail View ────────────────────────────────────────────────── */
.detail-hd {
  background: var(--dark);
  padding: calc(var(--topbar-h) + var(--s4)) var(--s5) var(--s6);
  margin: calc(-1 * var(--topbar-h)) calc(-1 * var(--s4)) var(--s5);
}
.detail-hd h1 { font-family: var(--font-heading); font-size: var(--text-2xl); color: var(--text-inv); margin-bottom: var(--s2); }
.detail-hd .meta { font-size: var(--text-sm); color: rgba(255,255,255,0.55); }

/* ── Timesheet Screen ───────────────────────────────────────────── */
.timer-card {
  background: var(--dark);
  border-radius: var(--r-xl);
  padding: var(--s6);
  text-align: center;
  margin-bottom: var(--s5);
}
.timer-display {
  font-family: var(--font-heading);
  font-size: 48px;
  color: var(--text-inv);
  letter-spacing: 0.04em;
  margin: var(--s4) 0;
}
.timer-status { font-size: var(--text-sm); color: rgba(255,255,255,0.55); }
.timer-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s6);
  border-radius: var(--r-full);
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: var(--s4);
  background: var(--cream);
  color: var(--dark);
  transition: background var(--t), transform var(--t);
}
.timer-btn:active { transform: scale(0.96); }
.timer-btn.running { background: var(--err-bg); color: var(--err); }

/* ── Utility Classes ────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--s1); } .gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); } .gap-5 { gap: var(--s5); }

.mt-1 { margin-top: var(--s1); } .mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); } .mt-6 { margin-top: var(--s6); }

.mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); }
.mb-4 { margin-bottom: var(--s4); } .mb-5 { margin-bottom: var(--s5); }

.text-sm  { font-size: var(--text-sm); }
.text-xs  { font-size: var(--text-xs); }
.text-lg  { font-size: var(--text-lg); }
.text-2   { color: var(--text-2); }
.text-3   { color: var(--text-3); }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* Scroll snapping for horizontal lists */
.scroll-x {
  display: flex;
  overflow-x: auto;
  gap: var(--s3);
  padding-bottom: var(--s2);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; flex-shrink: 0; }

/* Section spacing */
.section { margin-bottom: var(--s6); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
}
@media (min-width: 600px) {
  .content-inner { padding: var(--s5) var(--s6); }
  .modal { border-radius: var(--r-xl); max-height: 85vh; }
}
