/* ==========================================================================
   iSite — Design System
   A precision-built UI kit for the iSite visual feedback platform.
   Single source of truth for tokens, base styles, and shared components.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-50:  #eef1ff;
  --brand-100: #e0e5ff;
  --brand-200: #c7cfff;
  --brand-300: #a3aeff;
  --brand-400: #7c83ff;
  --brand-500: #5b58f5;  /* primary accent */
  --brand-600: #4a3fe0;  /* primary hover */
  --brand-700: #3e33bd;
  --brand-800: #342c99;
  --brand-900: #2e2a79;

  /* Neutral ink scale (warm slate) */
  --ink-0:   #ffffff;
  --ink-25:  #fbfbfd;
  --ink-50:  #f6f7f9;
  --ink-100: #eceef2;
  --ink-150: #e1e4ea;
  --ink-200: #d4d8e0;
  --ink-300: #b3b9c6;
  --ink-400: #8b93a5;
  --ink-500: #69718599;
  --ink-500s:#697185;
  --ink-600: #525a6b;
  --ink-700: #3d4453;
  --ink-800: #2a2f3a;
  --ink-900: #1a1d26;
  --ink-950: #11131a;

  /* Semantic */
  --success-50:  #e9f9f0;
  --success-500: #16a34a;
  --success-600: #15803d;
  --warning-50:  #fff5e6;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --danger-50:   #fdecec;
  --danger-500:  #e5484d;
  --danger-600:  #cc3a3f;
  --info-50:     #e8f1fd;
  --info-500:    #2f7ce5;

  /* Status accents (kanban) */
  --status-new:      #5b58f5;
  --status-progress: #f59e0b;
  --status-review:   #2f7ce5;
  --status-done:     #16a34a;
  --status-default:  #8b93a5;

  /* Surfaces */
  --bg-app:      var(--ink-50);
  --bg-surface:  var(--ink-0);
  --bg-subtle:   var(--ink-25);
  --bg-muted:    var(--ink-100);
  --bg-inset:    var(--ink-50);
  --bg-overlay:  rgba(17, 19, 26, 0.55);

  /* Text */
  --text-primary:   var(--ink-900);
  --text-secondary: var(--ink-600);
  --text-tertiary:  var(--ink-400);
  --text-inverse:   var(--ink-0);
  --text-brand:     var(--brand-600);
  --text-link:      var(--brand-600);

  /* Borders */
  --border-subtle: var(--ink-100);
  --border-default: var(--ink-150);
  --border-strong: var(--ink-200);
  --border-focus:  var(--brand-500);

  /* Radii */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 15px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 999px;

  /* Shadows — layered for genuine depth */
  --shadow-xs: 0 1px 2px rgba(17,19,26,.05);
  --shadow-sm: 0 1px 2px rgba(17,19,26,.06), 0 1px 1px rgba(17,19,26,.04);
  --shadow-md: 0 4px 6px -1px rgba(17,19,26,.07), 0 2px 4px -2px rgba(17,19,26,.06);
  --shadow-lg: 0 12px 20px -6px rgba(17,19,26,.10), 0 4px 8px -4px rgba(17,19,26,.06);
  --shadow-xl: 0 24px 40px -12px rgba(17,19,26,.16), 0 8px 16px -8px rgba(17,19,26,.08);
  --shadow-2xl: 0 40px 72px -16px rgba(17,19,26,.24), 0 16px 32px -16px rgba(17,19,26,.10);
  --shadow-focus: 0 0 0 3px rgba(91,88,245,.18);
  --shadow-focus-danger: 0 0 0 3px rgba(229,72,77,.18);
  --shadow-inner: inset 0 1px 2px rgba(17,19,26,.06);

  /* Typography */
  --font-display: 'Bricolage Grotesque', 'Public Sans', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-2xs: 0.6875rem;  /* 11px */
  --text-xs:  0.75rem;    /* 12px */
  --text-sm:  0.8125rem;  /* 13px */
  --text-base:0.875rem;   /* 14px */
  --text-md:  0.9375rem;  /* 15px */
  --text-lg:  1.0625rem;  /* 17px */
  --text-xl:  1.25rem;    /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.5rem;     /* 40px */
  --text-5xl: 3.25rem;    /* 52px */

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  --tracking-tight: -0.02em;
  --tracking-snug: -0.011em;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Motion */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* Layout */
  --nav-height: 64px;
  --container-max: 1320px;

  color-scheme: light;
}

/* ----------------------------------------------------------------------------
   2. Dark Theme
   ---------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-app:      #0c0e14;
  --bg-surface:  #15181f;
  --bg-subtle:   #11141b;
  --bg-muted:    #1c2029;
  --bg-inset:    #0f1218;
  --bg-overlay:  rgba(4, 5, 8, 0.7);

  --text-primary:   #eef0f5;
  --text-secondary: #a7adbb;
  --text-tertiary:  #6c7385;
  --text-inverse:   #11131a;
  --text-brand:     #a3aeff;
  --text-link:      #a3aeff;

  --border-subtle: #20242e;
  --border-default: #282d39;
  --border-strong: #353b49;

  --brand-500: #6f6cf7;
  --brand-600: #5b58f5;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.25);
  --shadow-md: 0 4px 8px -2px rgba(0,0,0,.45), 0 2px 4px -2px rgba(0,0,0,.35);
  --shadow-lg: 0 14px 24px -8px rgba(0,0,0,.55), 0 4px 8px -4px rgba(0,0,0,.4);
  --shadow-xl: 0 28px 48px -14px rgba(0,0,0,.65), 0 8px 16px -8px rgba(0,0,0,.45);
  --shadow-2xl: 0 48px 80px -20px rgba(0,0,0,.7);
  --shadow-focus: 0 0 0 3px rgba(111,108,247,.32);

  --success-50: rgba(22,163,74,.14);
  --warning-50: rgba(245,158,11,.14);
  --danger-50:  rgba(229,72,77,.14);
  --info-50:    rgba(47,124,229,.14);
  --brand-50:   rgba(111,108,247,.14);

  color-scheme: dark;
}

/* ----------------------------------------------------------------------------
   3. Reset & Base
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

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

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "cv08" 1, "ss01" 1;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}

/* Ambient background texture for the app shell */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 88% -8%, color-mix(in srgb, var(--brand-500) 8%, transparent), transparent 70%),
    radial-gradient(700px 600px at -6% 12%, color-mix(in srgb, var(--info-500) 6%, transparent), transparent 70%);
  pointer-events: none;
}

img, svg, video { display: block; max-width: 100%; }

a { color: var(--text-link); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--brand-700); }
[data-theme="dark"] a:hover { color: #c7cfff; }

button { font-family: inherit; cursor: pointer; }

::selection { background: color-mix(in srgb, var(--brand-500) 24%, transparent); }

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); background-clip: padding-box; }

/* ----------------------------------------------------------------------------
   4. Layout primitives
   ---------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (max-width: 640px) { .container { padding-inline: var(--space-4); } }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-6 { gap: var(--space-6); }
.muted { color: var(--text-secondary); }
.subtle { color: var(--text-tertiary); }
.text-center { text-align: center; }
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-brand);
}

/* ----------------------------------------------------------------------------
   5. Top navigation
   ---------------------------------------------------------------------------- */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg-surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}
.app-nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}
.brand:hover { color: var(--text-primary); }
.brand__mark {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-400), var(--brand-600));
  color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
  overflow: hidden;
}
.brand__mark svg { width: 19px; height: 19px; }
.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-tertiary);
  line-height: 1;
  margin-top: 3px;
}
.brand__name { line-height: 1; }

.nav-actions { display: flex; align-items: center; gap: var(--space-2); }
.nav-links { display: flex; align-items: center; gap: var(--space-1); }
.nav-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-link:hover { background: var(--bg-muted); color: var(--text-primary); }
.nav-link.is-active { background: var(--brand-50); color: var(--text-brand); }
.nav-link i { font-size: 0.9em; opacity: .85; }

/* Icon button */
.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.95); }

.notif-dot {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--danger-500);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--bg-surface);
  line-height: 1;
}
.notif-dot:empty, .notif-dot[data-count="0"] { display: none; }

/* ----------------------------------------------------------------------------
   6. Buttons
   ---------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: var(--tracking-snug);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.btn i { font-size: 0.95em; }

.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn-primary:hover { background: var(--brand-700); color: #fff; box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.16); }
[data-theme="dark"] .btn-primary { background: var(--brand-600); }
[data-theme="dark"] .btn-primary:hover { background: var(--brand-500); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-muted); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text-primary); }

.btn-danger { background: var(--danger-500); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: var(--danger-600); color: #fff; }

.btn-lg { height: 48px; padding: 0 var(--space-6); font-size: var(--text-md); border-radius: var(--radius-md); }
.btn-sm { height: 34px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Button with sheen on hover (primary CTAs) */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform var(--dur-slow) var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(100%); }

/* ----------------------------------------------------------------------------
   7. Cards & surfaces
   ---------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--space-6); }

.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* ----------------------------------------------------------------------------
   8. Forms
   ---------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: var(--tracking-snug);
}
.label .req { color: var(--danger-500); margin-left: 2px; }
.hint { font-size: var(--text-xs); color: var(--text-tertiary); }

.input, .textarea, .select, .form-control, .form-select {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  appearance: none;
}
.textarea, textarea.form-control {
  height: auto;
  min-height: 104px;
  padding: var(--space-3) var(--space-4);
  line-height: var(--leading-normal);
  resize: vertical;
}
.input::placeholder, .textarea::placeholder, .form-control::placeholder { color: var(--text-tertiary); }
.input:hover, .textarea:hover, .select:hover, .form-control:hover, .form-select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus, .form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--shadow-focus);
  background: var(--bg-surface);
}

.select, .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
  cursor: pointer;
}

.input-affix { position: relative; display: flex; align-items: center; }
.input-affix > i { position: absolute; left: var(--space-4); color: var(--text-tertiary); pointer-events: none; font-size: var(--text-base); }
.input-affix > .input { padding-left: var(--space-10); }

/* ----------------------------------------------------------------------------
   9. Alerts
   ---------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: var(--success-50); color: var(--success-600); border-color: color-mix(in srgb, var(--success-500) 25%, transparent); }
.alert-danger  { background: var(--danger-50);  color: var(--danger-600);  border-color: color-mix(in srgb, var(--danger-500) 25%, transparent); }
.alert-info    { background: var(--info-50);    color: var(--info-500);    border-color: color-mix(in srgb, var(--info-500) 25%, transparent); }
.alert-warning { background: var(--warning-50); color: var(--warning-600); border-color: color-mix(in srgb, var(--warning-500) 25%, transparent); }
[data-theme="dark"] .alert-success { color: #5dd99a; }
[data-theme="dark"] .alert-danger { color: #ff8b8e; }
[data-theme="dark"] .alert-warning { color: #fbbf5c; }

/* ----------------------------------------------------------------------------
   10. Badges & pills
   ---------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-xs);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--bg-muted); color: var(--text-secondary); }
.badge-brand { background: var(--brand-50); color: var(--text-brand); }
.badge-success { background: var(--success-50); color: var(--success-600); }
.badge-warning { background: var(--warning-50); color: var(--warning-600); }
.badge-info { background: var(--info-50); color: var(--info-500); }

/* ----------------------------------------------------------------------------
   11. Avatars
   ---------------------------------------------------------------------------- */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.initials-circle, .avatar-initials {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.avatar-group { display: flex; align-items: center; }
.avatar-group .avatar,
.avatar-group .initials-circle { box-shadow: 0 0 0 2px var(--bg-surface); margin-left: -8px; }
.avatar-group .avatar:first-child,
.avatar-group .initials-circle:first-child { margin-left: 0; }

/* ----------------------------------------------------------------------------
   12. Tables
   ---------------------------------------------------------------------------- */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.table tbody td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--bg-subtle); }

/* ----------------------------------------------------------------------------
   13. Empty states
   ---------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-tertiary);
}
.empty__icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--bg-muted);
  color: var(--text-tertiary);
  font-size: var(--text-xl);
}
.empty h3 { font-size: var(--text-lg); color: var(--text-secondary); margin-bottom: var(--space-2); }
.empty p { font-size: var(--text-base); max-width: 380px; margin-inline: auto; }

/* ----------------------------------------------------------------------------
   14. Page header
   ---------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-8) 0 var(--space-6);
}
.page-title { font-size: var(--text-3xl); letter-spacing: var(--tracking-tight); }
.page-sub { color: var(--text-secondary); font-size: var(--text-md); margin-top: var(--space-1); }

/* ----------------------------------------------------------------------------
   15. Footer
   ---------------------------------------------------------------------------- */
.app-footer {
  margin-top: var(--space-20);
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 60%, transparent);
}
.app-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  flex-wrap: wrap;
}
.app-footer p { color: var(--text-tertiary); font-size: var(--text-sm); }
.footer-links { display: flex; gap: var(--space-5); }
.footer-links a { color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500; }
.footer-links a:hover { color: var(--text-primary); }

/* ----------------------------------------------------------------------------
   16. Modal (custom, for task modal & edit modal)
   ---------------------------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: var(--space-8) var(--space-4);
  overflow-y: auto;
}
.modal.is-open { display: block; animation: overlayIn var(--dur-base) var(--ease-out); }
.modal .modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: var(--shadow-2xl);
  position: relative;
  overflow: hidden;
  animation: modalIn var(--dur-slow) var(--ease-out);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal .close, .editModalClose {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: all var(--dur-fast) var(--ease-out);
}
.modal .close:hover, .editModalClose:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ----------------------------------------------------------------------------
   17. Utilities
   ---------------------------------------------------------------------------- */
.mt-1{margin-top:var(--space-1)} .mt-2{margin-top:var(--space-2)} .mt-3{margin-top:var(--space-3)}
.mt-4{margin-top:var(--space-4)} .mt-5{margin-top:var(--space-5)} .mt-6{margin-top:var(--space-6)}
.mb-2{margin-bottom:var(--space-2)} .mb-3{margin-bottom:var(--space-3)} .mb-4{margin-bottom:var(--space-4)}
.w-100{width:100%}
.divider { height: 1px; background: var(--border-subtle); border: none; margin: var(--space-5) 0; }
.vertical-line { width: 1px; background: var(--border-default); align-self: stretch; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-inset) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
