/* ═══════════════════════════════════════════════════════
   CREATIVEFLOW — DESIGN SYSTEM & STYLES
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables (Light Mode) ── */
:root {
  --bg:           #f4f6fb;
  --bg2:          #eef1f8;
  --surface:      #ffffff;
  --surface2:     #f8faff;
  --border:       #e5e9f2;
  --border2:      #dde2ee;

  --text:         #0f172a;
  --text2:        #475569;
  --text3:        #94a3b8;
  --text-inv:     #ffffff;

  --brand:        #D70040;
  --brand-h:      #b8003a;
  --brand-light:  #fff0f4;
  --brand-mid:    rgba(215,0,64,0.12);

  --sidebar-bg:   #0f0f23;
  --sidebar-b:    rgba(255,255,255,0.06);
  --sidebar-text: #64748b;
  --sidebar-th:   #cbd5e1;
  --sidebar-act:  #D70040;
  --sidebar-actb: rgba(215,0,64,0.15);
  --sidebar-w:    240px;

  --green:    #22c55e;  --green-l:  #dcfce7;
  --blue:     #3b82f6;  --blue-l:   #dbeafe;
  --purple:   #8b5cf6;  --purple-l: #ede9fe;
  --amber:    #f59e0b;  --amber-l:  #fef3c7;
  --orange:   #f97316;  --orange-l: #ffedd5;
  --red:      #ef4444;  --red-l:    #fee2e2;
  --gray:     #6b7280;  --gray-l:   #f3f4f6;
  --indigo:   #6366f1;  --indigo-l: #eef2ff;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 2px 6px rgba(15,23,42,0.06);
  --shadow:    0 4px 12px rgba(15,23,42,0.08), 0 1px 3px rgba(15,23,42,0.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 40px rgba(15,23,42,0.14), 0 4px 12px rgba(15,23,42,0.08);

  --r-sm:  6px;
  --r:     10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-f:   9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.18s var(--ease);
  --t2:   0.28s var(--ease);

  /* Aliases used across tools, moodboard & more */
  --text1:      #0f172a;
  --hover:      rgba(15,23,42,0.05);
  --brand-soft: rgba(215,0,64,0.08);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg:       #0b0f1a;
  --bg2:      #111827;
  --surface:  #1a2235;
  --surface2: #1e2842;
  --border:   #2d3a52;
  --border2:  #374357;

  --text:  #f1f5f9;
  --text2: #94a3b8;
  --text3: #4b6080;

  --brand-light: rgba(215,0,64,0.15);
  --brand-mid:   rgba(215,0,64,0.10);

  --sidebar-bg:   #080c16;
  --sidebar-b:    rgba(255,255,255,0.04);
  --sidebar-text: #4b6080;
  --sidebar-th:   #94a3b8;

  --green-l:  rgba(34,197,94,0.12);
  --blue-l:   rgba(59,130,246,0.12);
  --purple-l: rgba(139,92,246,0.12);
  --amber-l:  rgba(245,158,11,0.12);
  --orange-l: rgba(249,115,22,0.12);
  --red-l:    rgba(239,68,68,0.12);
  --gray-l:   rgba(107,114,128,0.12);
  --indigo-l: rgba(99,102,241,0.12);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow:    0 4px 12px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.35);

  --text1:      #f1f5f9;
  --hover:      rgba(255,255,255,0.07);
  --brand-soft: rgba(215,0,64,0.14);
}

/* ── Additional Colour Themes ── */
[data-theme="ocean"] {
  --bg:#f0f9ff;--bg2:#e0f2fe;--surface:#ffffff;--surface2:#f8fcff;
  --border:#bae6fd;--border2:#7dd3fc;
  --text:#0c4a6e;--text2:#0369a1;--text3:#7dd3fc;
  --brand:#0ea5e9;--brand-h:#0284c7;--brand-light:rgba(14,165,233,.1);--brand-mid:rgba(14,165,233,.18);
  --sidebar-bg:#0c4a6e;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#7dd3fc;--sidebar-th:#bae6fd;--sidebar-act:#0ea5e9;--sidebar-actb:rgba(14,165,233,.2);
}
[data-theme="sunset"] {
  --bg:#fff7ed;--bg2:#fed7aa;--surface:#ffffff;--surface2:#fff8f2;
  --border:#fed7aa;--border2:#fdba74;
  --text:#431407;--text2:#9a3412;--text3:#fb923c;
  --brand:#f97316;--brand-h:#ea6c09;--brand-light:rgba(249,115,22,.1);--brand-mid:rgba(249,115,22,.18);
  --sidebar-bg:#431407;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#fb923c;--sidebar-th:#fed7aa;--sidebar-act:#f97316;--sidebar-actb:rgba(249,115,22,.2);
}
[data-theme="forest"] {
  --bg:#f0fdf4;--bg2:#dcfce7;--surface:#ffffff;--surface2:#f6fef9;
  --border:#bbf7d0;--border2:#86efac;
  --text:#14532d;--text2:#166534;--text3:#86efac;
  --brand:#16a34a;--brand-h:#15803d;--brand-light:rgba(22,163,74,.1);--brand-mid:rgba(22,163,74,.18);
  --sidebar-bg:#14532d;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#86efac;--sidebar-th:#bbf7d0;--sidebar-act:#16a34a;--sidebar-actb:rgba(22,163,74,.2);
}
[data-theme="rose"] {
  --bg:#fff1f2;--bg2:#ffe4e6;--surface:#ffffff;--surface2:#fff5f6;
  --border:#fecdd3;--border2:#fda4af;
  --text:#4c0519;--text2:#9f1239;--text3:#fda4af;
  --brand:#f43f5e;--brand-h:#e11d48;--brand-light:rgba(244,63,94,.1);--brand-mid:rgba(244,63,94,.18);
  --sidebar-bg:#4c0519;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#fda4af;--sidebar-th:#fecdd3;--sidebar-act:#f43f5e;--sidebar-actb:rgba(244,63,94,.2);
}
[data-theme="midnight"] {
  --bg:#0a0f1e;--bg2:#111827;--surface:#111827;--surface2:#1a2235;
  --border:#1e293b;--border2:#2d3a52;
  --text:#dbeafe;--text2:#93c5fd;--text3:#3b5a8a;
  --brand:#3b82f6;--brand-h:#2563eb;--brand-light:rgba(59,130,246,.15);--brand-mid:rgba(59,130,246,.12);
  --sidebar-bg:#060a14;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#3b5a8a;--sidebar-th:#93c5fd;--sidebar-act:#3b82f6;--sidebar-actb:rgba(59,130,246,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="amber"] {
  --bg:#fffbeb;--bg2:#fef3c7;--surface:#ffffff;--surface2:#fffdf5;
  --border:#fde68a;--border2:#fcd34d;
  --text:#451a03;--text2:#92400e;--text3:#fcd34d;
  --brand:#d97706;--brand-h:#b45309;--brand-light:rgba(217,119,6,.1);--brand-mid:rgba(217,119,6,.18);
  --sidebar-bg:#451a03;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#fcd34d;--sidebar-th:#fde68a;--sidebar-act:#d97706;--sidebar-actb:rgba(217,119,6,.2);
}
[data-theme="aurora"] {
  --bg:#0c0a1a;--bg2:#130f28;--surface:#1a1040;--surface2:#1f1550;
  --border:#2d1f6e;--border2:#3d2a8a;
  --text:#ede9fe;--text2:#c4b5fd;--text3:#6644c0;
  --brand:#a855f7;--brand-h:#9333ea;--brand-light:rgba(168,85,247,.15);--brand-mid:rgba(168,85,247,.12);
  --sidebar-bg:#07050f;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#6644c0;--sidebar-th:#c4b5fd;--sidebar-act:#a855f7;--sidebar-actb:rgba(168,85,247,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.4);--shadow-sm:0 2px 6px rgba(0,0,0,.4);--shadow:0 4px 12px rgba(0,0,0,.45),0 1px 3px rgba(0,0,0,.3);--shadow-md:0 8px 24px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.35);--shadow-lg:0 20px 40px rgba(0,0,0,.6),0 4px 12px rgba(0,0,0,.4);
}
[data-theme="coral"] {
  --bg:#fff5f0;--bg2:#ffe4d6;--surface:#ffffff;--surface2:#fff8f5;
  --border:#fecaca;--border2:#fca5a5;
  --text:#450a0a;--text2:#991b1b;--text3:#fca5a5;
  --brand:#f87171;--brand-h:#ef4444;--brand-light:rgba(248,113,113,.1);--brand-mid:rgba(248,113,113,.18);
  --sidebar-bg:#450a0a;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#fca5a5;--sidebar-th:#fecaca;--sidebar-act:#f87171;--sidebar-actb:rgba(248,113,113,.2);
}
[data-theme="slate"] {
  --bg:#f8fafc;--bg2:#f1f5f9;--surface:#ffffff;--surface2:#f8fafc;
  --border:#e2e8f0;--border2:#cbd5e1;
  --text:#0f172a;--text2:#475569;--text3:#94a3b8;
  --brand:#64748b;--brand-h:#475569;--brand-light:rgba(100,116,139,.1);--brand-mid:rgba(100,116,139,.18);
  --sidebar-bg:#1e293b;--sidebar-b:rgba(255,255,255,.06);--sidebar-text:#64748b;--sidebar-th:#94a3b8;--sidebar-act:#64748b;--sidebar-actb:rgba(100,116,139,.2);
}
[data-theme="mint"] {
  --bg:#f0fdfa;--bg2:#ccfbf1;--surface:#ffffff;--surface2:#f5fffe;
  --border:#99f6e4;--border2:#5eead4;
  --text:#042f2e;--text2:#0f766e;--text3:#5eead4;
  --brand:#14b8a6;--brand-h:#0d9488;--brand-light:rgba(20,184,166,.1);--brand-mid:rgba(20,184,166,.18);
  --sidebar-bg:#042f2e;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#5eead4;--sidebar-th:#99f6e4;--sidebar-act:#14b8a6;--sidebar-actb:rgba(20,184,166,.2);
}
[data-theme="crimson"] {
  --bg:#1a0808;--bg2:#2d0a0a;--surface:#2d0a0a;--surface2:#3d0d0d;
  --border:#5c1a1a;--border2:#7c2020;
  --text:#fef2f2;--text2:#fca5a5;--text3:#7c2020;
  --brand:#dc2626;--brand-h:#b91c1c;--brand-light:rgba(220,38,38,.15);--brand-mid:rgba(220,38,38,.12);
  --sidebar-bg:#0f0404;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#7c2020;--sidebar-th:#fca5a5;--sidebar-act:#dc2626;--sidebar-actb:rgba(220,38,38,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.4);--shadow-sm:0 2px 6px rgba(0,0,0,.4);--shadow:0 4px 12px rgba(0,0,0,.45),0 1px 3px rgba(0,0,0,.3);--shadow-md:0 8px 24px rgba(0,0,0,.5),0 2px 6px rgba(0,0,0,.35);--shadow-lg:0 20px 40px rgba(0,0,0,.6),0 4px 12px rgba(0,0,0,.4);
}
[data-theme="arctic"] {
  --bg:#f0f8ff;--bg2:#dbeafe;--surface:#ffffff;--surface2:#f5faff;
  --border:#bfdbfe;--border2:#93c5fd;
  --text:#0c4a6e;--text2:#1d4ed8;--text3:#93c5fd;
  --brand:#38bdf8;--brand-h:#0ea5e9;--brand-light:rgba(56,189,248,.1);--brand-mid:rgba(56,189,248,.18);
  --sidebar-bg:#0c2a4e;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#93c5fd;--sidebar-th:#bfdbfe;--sidebar-act:#38bdf8;--sidebar-actb:rgba(56,189,248,.2);
}
[data-theme="lavender"] {
  --bg:#f5f3ff;--bg2:#ede9fe;--surface:#ffffff;--surface2:#faf9ff;
  --border:#ddd6fe;--border2:#c4b5fd;
  --text:#2e1065;--text2:#5b21b6;--text3:#c4b5fd;
  --brand:#8b5cf6;--brand-h:#7c3aed;--brand-light:rgba(139,92,246,.1);--brand-mid:rgba(139,92,246,.18);
  --sidebar-bg:#2e1065;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#c4b5fd;--sidebar-th:#ddd6fe;--sidebar-act:#8b5cf6;--sidebar-actb:rgba(139,92,246,.2);
}
[data-theme="carbon"] {
  --bg:#000000;--bg2:#0a0a0a;--surface:#111111;--surface2:#1a1a1a;
  --border:#222222;--border2:#333333;
  --text:#f1f5f9;--text2:#a3e635;--text3:#3d5a1a;
  --brand:#a3e635;--brand-h:#84cc16;--brand-light:rgba(163,230,53,.12);--brand-mid:rgba(163,230,53,.1);
  --sidebar-bg:#000000;--sidebar-b:rgba(255,255,255,.06);--sidebar-text:#3d5a1a;--sidebar-th:#a3e635;--sidebar-act:#a3e635;--sidebar-actb:rgba(163,230,53,.15);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.5);--shadow-sm:0 2px 6px rgba(0,0,0,.5);--shadow:0 4px 12px rgba(0,0,0,.55),0 1px 3px rgba(0,0,0,.4);--shadow-md:0 8px 24px rgba(0,0,0,.6),0 2px 6px rgba(0,0,0,.45);--shadow-lg:0 20px 40px rgba(0,0,0,.7),0 4px 12px rgba(0,0,0,.5);
}
[data-theme="peach"] {
  --bg:#fff8f0;--bg2:#ffedd5;--surface:#ffffff;--surface2:#fffaf5;
  --border:#fed7aa;--border2:#fb923c;
  --text:#431407;--text2:#9a3412;--text3:#fb923c;
  --brand:#fb923c;--brand-h:#f97316;--brand-light:rgba(251,146,60,.1);--brand-mid:rgba(251,146,60,.18);
  --sidebar-bg:#431407;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#fb923c;--sidebar-th:#fed7aa;--sidebar-act:#fb923c;--sidebar-actb:rgba(251,146,60,.2);
}
[data-theme="neon"] {
  --bg:#030712;--bg2:#0d1117;--surface:#0d1117;--surface2:#161b22;
  --border:#1c2333;--border2:#2d3748;
  --text:#d1fae5;--text2:#00ff88;--text3:#0a4028;
  --brand:#00ff88;--brand-h:#00cc6a;--brand-light:rgba(0,255,136,.1);--brand-mid:rgba(0,255,136,.08);
  --sidebar-bg:#000000;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#0a4028;--sidebar-th:#00ff88;--sidebar-act:#00ff88;--sidebar-actb:rgba(0,255,136,.15);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.5);--shadow-sm:0 2px 6px rgba(0,0,0,.5);--shadow:0 4px 12px rgba(0,0,0,.55),0 1px 3px rgba(0,0,0,.4);--shadow-md:0 8px 24px rgba(0,0,0,.6),0 2px 6px rgba(0,0,0,.45);--shadow-lg:0 20px 40px rgba(0,0,0,.7),0 4px 12px rgba(0,0,0,.5);
}
[data-theme="copper"] {
  --bg:#fdf8f1;--bg2:#faecd8;--surface:#ffffff;--surface2:#fefcf8;
  --border:#e7d5b5;--border2:#d4b483;
  --text:#292524;--text2:#78350f;--text3:#d4b483;
  --brand:#b45309;--brand-h:#92400e;--brand-light:rgba(180,83,9,.1);--brand-mid:rgba(180,83,9,.18);
  --sidebar-bg:#292524;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#d4b483;--sidebar-th:#e7d5b5;--sidebar-act:#b45309;--sidebar-actb:rgba(180,83,9,.2);
}
[data-theme="sakura"] {
  --bg:#fff0f5;--bg2:#fce7f3;--surface:#ffffff;--surface2:#fff5f9;
  --border:#fbcfe8;--border2:#f9a8d4;
  --text:#500724;--text2:#9d174d;--text3:#f9a8d4;
  --brand:#ec4899;--brand-h:#db2777;--brand-light:rgba(236,72,153,.1);--brand-mid:rgba(236,72,153,.18);
  --sidebar-bg:#500724;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#f9a8d4;--sidebar-th:#fbcfe8;--sidebar-act:#ec4899;--sidebar-actb:rgba(236,72,153,.2);
}

/* ── Light variants of dark themes ── */
[data-theme="midnight-light"] {
  --bg:#eff6ff;--bg2:#dbeafe;--surface:#ffffff;--surface2:#f5f9ff;
  --border:#bfdbfe;--border2:#93c5fd;
  --text:#1e3a5f;--text2:#1d4ed8;--text3:#93c5fd;
  --brand:#3b82f6;--brand-h:#2563eb;--brand-light:rgba(59,130,246,.1);--brand-mid:rgba(59,130,246,.18);
  --sidebar-bg:#1e3a5f;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#93c5fd;--sidebar-th:#bfdbfe;--sidebar-act:#3b82f6;--sidebar-actb:rgba(59,130,246,.2);
}
[data-theme="aurora-light"] {
  --bg:#faf5ff;--bg2:#ede9fe;--surface:#ffffff;--surface2:#f7f4ff;
  --border:#ddd6fe;--border2:#c4b5fd;
  --text:#3b0764;--text2:#6d28d9;--text3:#c4b5fd;
  --brand:#a855f7;--brand-h:#9333ea;--brand-light:rgba(168,85,247,.1);--brand-mid:rgba(168,85,247,.18);
  --sidebar-bg:#3b0764;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#c4b5fd;--sidebar-th:#ddd6fe;--sidebar-act:#a855f7;--sidebar-actb:rgba(168,85,247,.2);
}
[data-theme="crimson-light"] {
  --bg:#fff5f5;--bg2:#fee2e2;--surface:#ffffff;--surface2:#fff8f8;
  --border:#fecaca;--border2:#fca5a5;
  --text:#7f1d1d;--text2:#991b1b;--text3:#fca5a5;
  --brand:#dc2626;--brand-h:#b91c1c;--brand-light:rgba(220,38,38,.1);--brand-mid:rgba(220,38,38,.18);
  --sidebar-bg:#7f1d1d;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#fca5a5;--sidebar-th:#fecaca;--sidebar-act:#dc2626;--sidebar-actb:rgba(220,38,38,.2);
}
[data-theme="carbon-light"] {
  --bg:#f8f9fa;--bg2:#e9ecef;--surface:#ffffff;--surface2:#f4f5f6;
  --border:#dee2e6;--border2:#ced4da;
  --text:#1a1a1a;--text2:#495057;--text3:#adb5bd;
  --brand:#65a30d;--brand-h:#4d7c0f;--brand-light:rgba(101,163,13,.1);--brand-mid:rgba(101,163,13,.18);
  --sidebar-bg:#1a1a1a;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#adb5bd;--sidebar-th:#dee2e6;--sidebar-act:#65a30d;--sidebar-actb:rgba(101,163,13,.2);
}
[data-theme="neon-light"] {
  --bg:#f0fdf4;--bg2:#dcfce7;--surface:#ffffff;--surface2:#f5fef8;
  --border:#bbf7d0;--border2:#86efac;
  --text:#052e16;--text2:#166534;--text3:#86efac;
  --brand:#00c968;--brand-h:#00a855;--brand-light:rgba(0,201,104,.1);--brand-mid:rgba(0,201,104,.18);
  --sidebar-bg:#052e16;--sidebar-b:rgba(255,255,255,.08);--sidebar-text:#86efac;--sidebar-th:#bbf7d0;--sidebar-act:#00c968;--sidebar-actb:rgba(0,201,104,.2);
}

/* ── Dark variants of light themes ── */
[data-theme="ocean-dark"] {
  --bg:#04151e;--bg2:#071e2c;--surface:#0a2436;--surface2:#0e2c42;
  --border:#1a3d56;--border2:#205070;
  --text:#bae6fd;--text2:#7dd3fc;--text3:#2d6a8a;
  --brand:#0ea5e9;--brand-h:#0284c7;--brand-light:rgba(14,165,233,.15);--brand-mid:rgba(14,165,233,.12);
  --sidebar-bg:#020d14;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#2d6a8a;--sidebar-th:#7dd3fc;--sidebar-act:#0ea5e9;--sidebar-actb:rgba(14,165,233,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="sunset-dark"] {
  --bg:#180800;--bg2:#201200;--surface:#2a1600;--surface2:#341c00;
  --border:#4d2800;--border2:#6b3800;
  --text:#fed7aa;--text2:#fb923c;--text3:#8a4010;
  --brand:#f97316;--brand-h:#ea6c09;--brand-light:rgba(249,115,22,.15);--brand-mid:rgba(249,115,22,.12);
  --sidebar-bg:#0c0400;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#8a4010;--sidebar-th:#fb923c;--sidebar-act:#f97316;--sidebar-actb:rgba(249,115,22,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="forest-dark"] {
  --bg:#041408;--bg2:#071e0c;--surface:#0a2810;--surface2:#0e3014;
  --border:#1a4520;--border2:#1e5a28;
  --text:#bbf7d0;--text2:#86efac;--text3:#2a7a40;
  --brand:#16a34a;--brand-h:#15803d;--brand-light:rgba(22,163,74,.15);--brand-mid:rgba(22,163,74,.12);
  --sidebar-bg:#020c04;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#2a7a40;--sidebar-th:#86efac;--sidebar-act:#16a34a;--sidebar-actb:rgba(22,163,74,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="rose-dark"] {
  --bg:#180006;--bg2:#20000c;--surface:#2a0012;--surface2:#320018;
  --border:#4d0020;--border2:#6b002c;
  --text:#fecdd3;--text2:#fda4af;--text3:#8a0030;
  --brand:#f43f5e;--brand-h:#e11d48;--brand-light:rgba(244,63,94,.15);--brand-mid:rgba(244,63,94,.12);
  --sidebar-bg:#0c0004;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#8a0030;--sidebar-th:#fda4af;--sidebar-act:#f43f5e;--sidebar-actb:rgba(244,63,94,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="amber-dark"] {
  --bg:#180e00;--bg2:#201400;--surface:#2a1c00;--surface2:#342200;
  --border:#4d3400;--border2:#6b4800;
  --text:#fef3c7;--text2:#fcd34d;--text3:#8a5a00;
  --brand:#d97706;--brand-h:#b45309;--brand-light:rgba(217,119,6,.15);--brand-mid:rgba(217,119,6,.12);
  --sidebar-bg:#0c0700;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#8a5a00;--sidebar-th:#fcd34d;--sidebar-act:#d97706;--sidebar-actb:rgba(217,119,6,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="coral-dark"] {
  --bg:#180806;--bg2:#200e0c;--surface:#2a1410;--surface2:#321a14;
  --border:#4d2820;--border2:#6b3428;
  --text:#fecaca;--text2:#fca5a5;--text3:#8a2828;
  --brand:#f87171;--brand-h:#ef4444;--brand-light:rgba(248,113,113,.15);--brand-mid:rgba(248,113,113,.12);
  --sidebar-bg:#0c0403;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#8a2828;--sidebar-th:#fca5a5;--sidebar-act:#f87171;--sidebar-actb:rgba(248,113,113,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="slate-dark"] {
  --bg:#0a1020;--bg2:#10182e;--surface:#16203c;--surface2:#1a2844;
  --border:#243350;--border2:#2e3f60;
  --text:#cbd5e1;--text2:#94a3b8;--text3:#3a4f6a;
  --brand:#64748b;--brand-h:#475569;--brand-light:rgba(100,116,139,.15);--brand-mid:rgba(100,116,139,.12);
  --sidebar-bg:#060a14;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#3a4f6a;--sidebar-th:#94a3b8;--sidebar-act:#64748b;--sidebar-actb:rgba(100,116,139,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="mint-dark"] {
  --bg:#041612;--bg2:#071e18;--surface:#0a2c24;--surface2:#0e342c;
  --border:#1a4a40;--border2:#1e5a4e;
  --text:#99f6e4;--text2:#5eead4;--text3:#2a8070;
  --brand:#14b8a6;--brand-h:#0d9488;--brand-light:rgba(20,184,166,.15);--brand-mid:rgba(20,184,166,.12);
  --sidebar-bg:#020c08;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#2a8070;--sidebar-th:#5eead4;--sidebar-act:#14b8a6;--sidebar-actb:rgba(20,184,166,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="arctic-dark"] {
  --bg:#051422;--bg2:#082038;--surface:#0a2440;--surface2:#0e2c4c;
  --border:#1a3d60;--border2:#204e78;
  --text:#bae6fd;--text2:#7dd3fc;--text3:#2a608a;
  --brand:#38bdf8;--brand-h:#0ea5e9;--brand-light:rgba(56,189,248,.15);--brand-mid:rgba(56,189,248,.12);
  --sidebar-bg:#030c14;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#2a608a;--sidebar-th:#7dd3fc;--sidebar-act:#38bdf8;--sidebar-actb:rgba(56,189,248,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="lavender-dark"] {
  --bg:#0c0818;--bg2:#140e28;--surface:#1c1438;--surface2:#221a44;
  --border:#30245a;--border2:#3c2e70;
  --text:#ddd6fe;--text2:#c4b5fd;--text3:#6040b0;
  --brand:#8b5cf6;--brand-h:#7c3aed;--brand-light:rgba(139,92,246,.15);--brand-mid:rgba(139,92,246,.12);
  --sidebar-bg:#06040e;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#6040b0;--sidebar-th:#c4b5fd;--sidebar-act:#8b5cf6;--sidebar-actb:rgba(139,92,246,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="peach-dark"] {
  --bg:#180e04;--bg2:#201408;--surface:#2a1c0c;--surface2:#342210;
  --border:#4d3018;--border2:#6b4220;
  --text:#fed7aa;--text2:#fdba74;--text3:#8a4a14;
  --brand:#fb923c;--brand-h:#f97316;--brand-light:rgba(251,146,60,.15);--brand-mid:rgba(251,146,60,.12);
  --sidebar-bg:#0c0702;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#8a4a14;--sidebar-th:#fdba74;--sidebar-act:#fb923c;--sidebar-actb:rgba(251,146,60,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="copper-dark"] {
  --bg:#120e06;--bg2:#1c1608;--surface:#221c08;--surface2:#2a220c;
  --border:#3a2e10;--border2:#4e3e18;
  --text:#fef3c7;--text2:#fde68a;--text3:#6a4a10;
  --brand:#b45309;--brand-h:#92400e;--brand-light:rgba(180,83,9,.15);--brand-mid:rgba(180,83,9,.12);
  --sidebar-bg:#080602;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#6a4a10;--sidebar-th:#fde68a;--sidebar-act:#b45309;--sidebar-actb:rgba(180,83,9,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}
[data-theme="sakura-dark"] {
  --bg:#160010;--bg2:#1e0018;--surface:#280020;--surface2:#320028;
  --border:#4a0038;--border2:#640050;
  --text:#fce7f3;--text2:#f9a8d4;--text3:#8a0060;
  --brand:#ec4899;--brand-h:#db2777;--brand-light:rgba(236,72,153,.15);--brand-mid:rgba(236,72,153,.12);
  --sidebar-bg:#0a0008;--sidebar-b:rgba(255,255,255,.05);--sidebar-text:#8a0060;--sidebar-th:#f9a8d4;--sidebar-act:#ec4899;--sidebar-actb:rgba(236,72,153,.2);
  --green-l:rgba(34,197,94,.12);--blue-l:rgba(59,130,246,.12);--purple-l:rgba(139,92,246,.12);--amber-l:rgba(245,158,11,.12);--orange-l:rgba(249,115,22,.12);--red-l:rgba(239,68,68,.12);--gray-l:rgba(107,114,128,.12);--indigo-l:rgba(99,102,241,.12);
  --shadow-xs:0 1px 2px rgba(0,0,0,.3);--shadow-sm:0 2px 6px rgba(0,0,0,.3);--shadow:0 4px 12px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.25);--shadow-md:0 8px 24px rgba(0,0,0,.4),0 2px 6px rgba(0,0,0,.3);--shadow-lg:0 20px 40px rgba(0,0,0,.5),0 4px 12px rgba(0,0,0,.35);
}

/* ═══════════════════════════════════════════════════════
   PAGE LOADER — full-screen blur overlay during navigation
   ═══════════════════════════════════════════════════════ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: rgba(244, 246, 251, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
}
[data-theme="dark"] #page-loader {
  background: rgba(11, 15, 26, 0.6);
}
#page-loader.pl-out {
  opacity: 0;
  pointer-events: none;
}

/* Spinner ring */
.pl-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--brand);
  border-right-color: rgba(215, 0, 64, 0.3);
  animation: pl-spin 0.7s linear infinite;
  position: relative;
}
.pl-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(215, 0, 64, 0.4);
  animation: pl-spin 1.2s linear infinite reverse;
}
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  /* Prevent double-tap zoom on interactive elements across the whole app */
  touch-action: manipulation;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport — accounts for browser chrome on mobile */
  line-height: 1.5;
  transition: background var(--t2), color var(--t2);
  /* Prevent iOS rubber-band scroll at top level */
  overscroll-behavior: none;
}

/* All interactive controls get snappy tap response */
button, a, input, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Global scrollbar polish */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* Global focus ring */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

a { color: var(--brand); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1040 50%, #0d1b3e 100%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: #D70040; top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: #a80032; bottom: -80px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 250px; height: 250px; background: #ff2060; top: 50%; left: 60%; animation-delay: -6s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-15px, 15px) scale(0.95); }
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05) inset;
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.brand-icon-wrap {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #D70040, #a80032);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(215,0,64,0.4);
  flex-shrink: 0;
}
.brand-icon-wrap.sm { width: 32px; height: 32px; border-radius: var(--r-sm); }
.brand-icon-wrap .material-symbols-outlined { color: white; font-size: 22px; }
.brand-icon-wrap.sm .material-symbols-outlined { font-size: 17px; }

.brand-name  { font-size: 1.1rem; font-weight: 700; color: white; line-height: 1.1; }
.brand-tagline { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 2px; }

.login-title { margin-bottom: 28px; }
.login-title h1 { font-size: 1.6rem; font-weight: 700; color: white; margin-bottom: 6px; }
.login-title p  { font-size: 0.88rem; color: rgba(255,255,255,0.5); }

/* Login Form */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.7); margin-bottom: 8px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon-left {
  position: absolute; left: 13px;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}
.input-icon-right-btn {
  position: absolute; right: 10px;
  background: none; border: none; padding: 4px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex; align-items: center;
  transition: color var(--t);
}
.input-icon-right-btn:hover { color: rgba(255,255,255,0.7); }

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  padding: 11px 40px 11px 42px;
  font-size: 0.9rem;
  color: white;
  outline: none;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.form-input::placeholder { color: rgba(255,255,255,0.28); }
.form-input:focus {
  border-color: rgba(215,0,64,0.6);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(215,0,64,0.2);
}

/* Modal form inputs — override dark login styles */
.modal-body .form-input {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border);
  padding: 10px 12px;
}
.modal-body .form-input::placeholder { color: var(--text3); }
.modal-body .form-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-mid);
}

/* App form inputs (inside app shell) */
.app-form .form-label { color: var(--text2); }
.app-form .input-wrap .input-icon-left { color: var(--text3); }
.app-form .form-input {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  padding: 10px 12px 10px 42px;
}
.app-form .form-input::placeholder { color: var(--text3); }
.app-form .form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-mid);
}
.app-form .form-input.no-icon { padding-left: 12px; }
.app-form select.form-input { padding-left: 12px; cursor: pointer; appearance: none; }
.app-form textarea.form-input { resize: vertical; min-height: 80px; padding: 10px 12px; }

/* Alert */
.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 0.84rem; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 550;
  border: none;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.01em;
}
.btn .material-symbols-outlined { font-size: 17px; }
.btn-primary {
  background: linear-gradient(135deg, #D70040 0%, #b8003a 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(215,0,64,0.38), 0 1px 3px rgba(215,0,64,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #e0003f 0%, #96002f 100%);
  box-shadow: 0 6px 20px rgba(215,0,64,0.48), 0 2px 6px rgba(215,0,64,0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(215,0,64,0.3); }
.btn-secondary {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text2);
}
.btn-secondary:hover { background: var(--bg2); border-color: var(--border2); color: var(--text); transform: translateY(-1px); }
.btn-danger { background: var(--red); color: white; box-shadow: 0 3px 10px rgba(239,68,68,0.3); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 14px rgba(239,68,68,0.4); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg2); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-sm .material-symbols-outlined { font-size: 15px; }
.btn-lg { padding: 12px 26px; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }

/* Login-specific buttons */
.login-screen .btn-primary {
  background: linear-gradient(135deg, #D70040, #b8003a);
  color: white;
}
.login-screen .btn-full { margin-top: 4px; }

.login-demo { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.login-demo-label { font-size: 0.75rem; color: rgba(255,255,255,0.35); text-align: center; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 9px 12px;
  transition: all var(--t);
  font-family: inherit;
  cursor: pointer;
}
.demo-btn .material-symbols-outlined { font-size: 15px; }
.demo-btn:hover { background: rgba(215,0,64,0.2); border-color: rgba(215,0,64,0.4); color: white; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100dvh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--t2), transform var(--t2);
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  height: 100dvh;
  border-right: 1px solid var(--sidebar-b);
}

.sidebar.collapsed { width: 64px; }

.sidebar-header {
  /* Same safe-area treatment as app-header — sidebar is fixed at top:0 */
  height: calc(60px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sidebar-b);
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.brand-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  transition: opacity var(--t), width var(--t);
}
.sidebar.collapsed .brand-text { opacity: 0; width: 0; overflow: hidden; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-b); border-radius: 2px; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-text);
  padding: 10px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-radius: var(--r);
  color: var(--sidebar-text);
  font-size: 0.855rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  position: relative;
}
.nav-item .material-symbols-outlined {
  font-size: 19px;
  flex-shrink: 0;
  transition: color var(--t);
}
.nav-item-label { transition: opacity var(--t); }
.sidebar.collapsed .nav-item-label { opacity: 0; width: 0; overflow: hidden; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: var(--sidebar-th); }
.nav-item.active {
  background: var(--sidebar-actb);
  color: white;
  font-weight: 600;
}
.nav-item.active .material-symbols-outlined { color: var(--sidebar-act); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--sidebar-act);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-f);
  flex-shrink: 0;
  transition: opacity var(--t);
}
.sidebar.collapsed .nav-badge { opacity: 0; }

/* ── Nav divider ── */
.nav-divider {
  height: 1px;
  background: var(--sidebar-b);
  margin: 5px 12px;
  flex-shrink: 0;
}

/* ── Badge dot — visible only in collapsed mode ── */
.nav-badge-dot {
  display: none;
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
  flex-shrink: 0;
}
.sidebar.collapsed .nav-badge-dot { display: block; }

/* ── Tooltip on collapsed nav items ── */
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  color: var(--sidebar-th);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 300;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  pointer-events: none;
}

/* ── Hover: subtle left border indicator ── */
.nav-item:not(.active):hover::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--sidebar-text);
  border-radius: 0 2px 2px 0;
  opacity: 0.5;
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-b);
  padding: 12px 8px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
  overflow: hidden;
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.sidebar-user-info { overflow: hidden; transition: opacity var(--t); }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 500; color: var(--sidebar-th); white-space: nowrap; }
.sidebar-user-role { font-size: 0.7rem; color: var(--sidebar-text); white-space: nowrap; margin-top: 1px; }

.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 0.855rem;
  cursor: pointer;
  transition: all var(--t);
  margin-top: 2px;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.1); color: #fca5a5; }
.sidebar-logout .material-symbols-outlined { font-size: 19px; flex-shrink: 0; }
.sidebar-logout-label { transition: opacity var(--t); }
.sidebar.collapsed .sidebar-logout-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-logout { justify-content: center; }

/* ── New Request quick-action button ── */
.sidebar-new-req {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-h) 100%);
  color: #fff;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--t);
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(215,0,64,0.4);
}
.sidebar-new-req:hover {
  background: linear-gradient(135deg, var(--brand-h) 0%, #96002f 100%);
  box-shadow: 0 4px 14px rgba(215,0,64,0.55);
  transform: translateY(-1px);
}
.sidebar-new-req .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.sidebar-new-req-label { transition: opacity var(--t); white-space: nowrap; }
.sidebar.collapsed .sidebar-new-req { justify-content: center; padding: 9px; }
.sidebar.collapsed .sidebar-new-req-label { opacity: 0; width: 0; overflow: hidden; }

/* ── MAIN WRAPPER ── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  transition: margin-left var(--t2);
  min-width: 0;
}
.sidebar.collapsed ~ .main-wrapper,
.main-wrapper.expanded { margin-left: 64px; }

/* ── HEADER ── */
.app-header {
  /* Base height + iOS safe-area-inset-top (notch / Dynamic Island / status bar).
     With border-box sizing, height includes padding, so the visible content strip
     stays exactly 62 px while the header expands upward under the status bar.    */
  height: calc(62px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(var(--surface-rgb, 255,255,255), 0.92);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 0;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--border), var(--shadow-xs);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.84rem; color: var(--text2);
}
.breadcrumb .material-symbols-outlined { font-size: 13px; color: var(--text3); }
.breadcrumb-home { color: var(--text3); cursor: pointer; }
.breadcrumb-home:hover { color: var(--text2); }
.breadcrumb-current { color: var(--text); font-weight: 550; }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 14px;
  width: 280px;
  transition: all var(--t);
}
.search-bar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-mid);
  background: var(--surface);
  width: 320px;
}
.search-bar .material-symbols-outlined { color: var(--text3); font-size: 17px; flex-shrink: 0; }
.search-bar input { background: none; border: none; outline: none; font-size: 0.84rem; color: var(--text); width: 100%; }
.search-bar input::placeholder { color: var(--text3); }

.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r);
  color: var(--text2);
  transition: all var(--t);
  position: relative;
}
.icon-btn:hover { background: var(--bg2); color: var(--text); transform: translateY(-1px); }
.icon-btn .material-symbols-outlined { font-size: 20px; }

.sidebar-collapse-btn { color: var(--text2); }

.badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 17px; height: 17px;
  background: var(--red);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: var(--r-f);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

.header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--border);
  transition: transform var(--t), box-shadow var(--t);
}
.header-avatar:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--brand); }

/* ── NOTIFICATION PANEL — Feature 2 enhanced ── */
.notif-wrap { position: relative; }
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.notif-filter-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.notif-filter-tab {
  font-size: .74rem; font-weight: 600;
  padding: 3px 12px; border-radius: 20px;
  border: none; cursor: pointer; font-family: inherit;
  transition: background var(--t), color var(--t);
  color: var(--text3); background: transparent;
}
.notif-filter-tab.active { background: var(--brand); color: #fff; }
.link-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; color: var(--brand); font-family: inherit;
  transition: opacity var(--t);
}
.link-btn:hover { opacity: 0.75; }
.notif-header-actions {
  display: flex; align-items: center; gap: 10px;
}
.notif-clear-btn {
  font-size: 0.72rem !important;
  color: var(--text3) !important;
  opacity: 0.85;
}
.notif-clear-btn:hover { color: var(--red) !important; opacity: 1; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-group-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text3);
  padding: 10px 16px 4px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--brand-light); }
[data-theme="dark"] .notif-item.unread { background: var(--brand-mid); }
.notif-item:last-child { border-bottom: none; }
.notif-icon-wrap {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.notif-icon-wrap .material-symbols-outlined { font-size: 16px; }
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0;
  margin-top: 7px; margin-right: -4px;
}
/* keep old dot class working for any legacy code */
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; margin-top: 5px; }
.notif-dot.read { background: transparent; border: 1.5px solid var(--border2); }
.notif-text { font-size: 0.82rem; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--text3); margin-top: 3px; }
.notif-empty { padding: 40px 16px; text-align: center; color: var(--text3); font-size: 0.84rem; }
.notif-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── MONTHLY REPORT — Feature 5 ── */
.report-month-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.report-month-tab {
  font-size: .76rem; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer; font-family: inherit;
  color: var(--text2); background: var(--bg2);
  transition: background var(--t), color var(--t), border-color var(--t);
}
.report-month-tab.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.report-chart-wrap { height: 180px; padding: 0 4px; }
.report-breakdown-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px;
}
.report-breakdown-section { }
.report-breakdown-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text3); margin-bottom: 8px;
}
.report-breakdown-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
.report-breakdown-row:last-child { border-bottom: none; }
.report-breakdown-name { flex: 1; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-breakdown-bar-wrap { width: 60px; background: var(--bg2); border-radius: 4px; height: 5px; overflow: hidden; }
.report-breakdown-bar { height: 100%; border-radius: 4px; background: var(--brand); }
.report-breakdown-count { font-weight: 700; color: var(--text); min-width: 20px; text-align: right; font-size: .78rem; }

/* ── PAGE CONTENT ── */
.page-content { flex: 1; padding: 32px; overflow-x: hidden; }

/* ═══════════════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════════════ */

/* Page Header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
  padding-bottom: 22px; border-bottom: 1px solid var(--border);
}
.page-header-info {}
.page-title {
  font-size: 1.55rem; font-weight: 750; color: var(--text);
  margin-bottom: 5px; letter-spacing: -0.01em; line-height: 1.2;
}
.page-subtitle { font-size: 0.875rem; color: var(--text3); line-height: 1.5; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.card:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.card-sm { padding: 14px 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.card-title { font-size: 0.95rem; font-weight: 650; color: var(--text); }
.card-subtitle { font-size: 0.77rem; color: var(--text3); margin-top: 3px; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  display: flex; align-items: flex-start; gap: 16px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0; top: auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-mid), transparent);
  opacity: 0;
  transition: opacity var(--t);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border2); }
.stat-card:hover::after { opacity: 1; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon .material-symbols-outlined { font-size: 23px; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; letter-spacing: -0.02em; }
.stat-label { font-size: 0.78rem; color: var(--text2); font-weight: 500; }
.stat-change { font-size: 0.72rem; color: var(--green); margin-top: 4px; display: flex; align-items: center; gap: 2px; }
.stat-change.down { color: var(--red); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Avatar */
.avatar {
  border-radius: var(--r-f);
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-md { width: 36px; height: 36px; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.68rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.4rem; font-weight: 800; }

/* Brand Picker */
.brand-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
}
.brand-pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: var(--r);
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  transition: all var(--t);
  min-width: 60px;
  user-select: none;
}
.brand-pick-item img {
  width: 40px;
  height: 28px;
  object-fit: contain;
}
.brand-pick-item span {
  font-size: .67rem;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
  letter-spacing: .01em;
}
.brand-pick-item:hover { border-color: var(--brand); background: var(--bg2); }
.brand-pick-item:hover span { color: var(--text2); }
.brand-pick-item.selected { border-color: var(--brand); background: rgba(215,0,64,.07); }
.brand-pick-item.selected span { color: var(--brand); }

/* Avatar Upload */
.avatar-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.avatar-upload-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}
.avatar-upload-wrap .avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 1.6rem;
  border: 3px solid var(--border);
  transition: filter 0.2s;
}
.avatar-upload-wrap:hover .avatar-xl { filter: brightness(0.85); }
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
  color: #fff;
  pointer-events: none;
}
.avatar-upload-overlay .material-symbols-outlined { font-size: 22px; }
.avatar-upload-wrap:hover .avatar-upload-overlay { opacity: 1; }
.avatar-upload-hint {
  font-size: 0.75rem;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 4px;
}
@keyframes avatar-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Badges / Tags */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-f);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.tag .material-symbols-outlined { font-size: 12px; }

/* Priority tags */
.tag-low      { background: var(--green-l);  color: var(--green); }
.tag-medium   { background: var(--amber-l);  color: var(--amber); }
.tag-high     { background: var(--orange-l); color: var(--orange); }
.tag-urgent   { background: var(--red-l);    color: var(--red); }

/* Status tags */
.tag-new      { background: var(--indigo-l); color: var(--indigo); }
.tag-assigned { background: var(--purple-l); color: var(--purple); }
.tag-wip      { background: var(--blue-l);   color: var(--blue); }
.tag-review   { background: var(--amber-l);  color: var(--amber); }
.tag-revision { background: var(--orange-l); color: var(--orange); }
.tag-completed{ background: var(--green-l);  color: var(--green); }
.tag-published,
.tag-archived { background: var(--purple-l); color: var(--purple); }

/* Role tags */
.tag-role-admin    { background: var(--indigo-l); color: var(--indigo); }
.tag-role-director { background: #fce7f3;         color: #be185d; }
.tag-role-manager  { background: var(--purple-l); color: var(--purple); }
.tag-role-writer   { background: var(--blue-l);   color: var(--blue); }
.tag-role-creative { background: var(--orange-l); color: var(--orange); }

/* Filters bar */
.filters-bar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 8px 30px 8px 12px;
  font-size: 0.82rem;
  color: var(--text2);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: all var(--t);
}
.filter-select:hover { border-color: var(--border2); color: var(--text); }
.filter-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-mid); }

/* Table */
.table-wrap { overflow-x: auto; margin: -1px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 0.71rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text3);
  padding: 11px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: var(--bg2);
}
th:first-child { border-radius: var(--r-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
td {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }

/* Mobile card meta — hidden on desktop, shown on mobile via media query */
.mobile-card-meta { display: none; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 72px 32px;
}
.empty-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--brand-light), var(--bg2));
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  box-shadow: var(--shadow-xs);
}
.empty-icon .material-symbols-outlined { font-size: 32px; color: var(--brand); opacity: 0.7; }
.empty-title { font-size: 1.05rem; font-weight: 650; color: var(--text); margin-bottom: 10px; }
.empty-desc { font-size: 0.84rem; color: var(--text3); max-width: 320px; margin: 0 auto 24px; line-height: 1.6; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════ */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-wrap { position: relative; height: 240px; }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.activity-text { font-size: 0.83rem; color: var(--text); line-height: 1.5; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.72rem; color: var(--text3); margin-top: 3px; }

/* Team workload row */
.team-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-row:last-child { margin-bottom: 0; }
.team-row-info { display: flex; align-items: center; gap: 10px; width: 140px; flex-shrink: 0; }
.team-row-name { font-size: 0.83rem; font-weight: 500; color: var(--text); }
.progress-bar-wrap { flex: 1; }
.progress-bar {
  height: 8px;
  background: var(--bg2);
  border-radius: var(--r-f);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #ff2060);
  border-radius: var(--r-f);
  transition: width 0.5s ease;
}
.team-row-count { font-size: 0.78rem; color: var(--text2); width: 40px; text-align: right; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   REQUESTS LIST
   ═══════════════════════════════════════════════════════ */
.request-row { cursor: pointer; }
.request-title-cell { display: flex; flex-direction: column; }
.request-title-main { font-weight: 500; color: var(--text); margin-bottom: 2px; }
.request-title-sub { font-size: 0.75rem; color: var(--text3); }
.deadline-cell { font-size: 0.83rem; }
.deadline-overdue { color: var(--red); font-weight: 500; }
.deadline-soon { color: var(--amber); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   REQUEST DETAIL
   ═══════════════════════════════════════════════════════ */
.request-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.detail-section { margin-bottom: 24px; }
.detail-section-title {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text3); margin-bottom: 14px;
}
.detail-field { margin-bottom: 16px; }
.detail-field-label { font-size: 0.78rem; color: var(--text3); margin-bottom: 4px; }
.detail-field-value { font-size: 0.9rem; color: var(--text); font-weight: 450; }

.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding-bottom: 20px;
  position: relative;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute;
  left: 11px; top: 24px;
  width: 2px; height: calc(100% - 24px);
  background: var(--border);
}
.timeline-step:last-child::before { display: none; }
.timeline-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}
.timeline-dot .material-symbols-outlined { font-size: 13px; color: var(--text3); }
.timeline-dot.done { border-color: var(--green); background: var(--green); }
.timeline-dot.done .material-symbols-outlined { color: white; }
.timeline-dot.active { border-color: var(--brand); background: var(--brand); }
.timeline-dot.active .material-symbols-outlined { color: white; }
.timeline-info {}
.timeline-label { font-size: 0.84rem; font-weight: 500; color: var(--text); }
.timeline-date { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment-item { display: flex; gap: 10px; }
.comment-body { background: var(--bg); border-radius: var(--r); padding: 12px 14px; flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-author { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.comment-time { font-size: 0.72rem; color: var(--text3); }
.comment-text { font-size: 0.84rem; color: var(--text2); line-height: 1.5; }
.comment-input-row { display: flex; gap: 10px; align-items: flex-end; }
.comment-textarea { flex: 1; }

/* Attachment chips */
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 0.8rem; color: var(--text2);
  cursor: pointer;
  transition: all var(--t);
}
.attachment-chip:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.attachment-chip .material-symbols-outlined { font-size: 16px; }

/* File upload zone */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.file-drop-zone .material-symbols-outlined { font-size: 32px; color: var(--text3); margin-bottom: 8px; }
.file-drop-zone p { font-size: 0.83rem; color: var(--text3); }
.file-drop-zone span { color: var(--brand); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   KANBAN BOARD
   ═══════════════════════════════════════════════════════ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-bottom: 16px;
  min-height: calc(100vh - 200px);
  width: 100%;
}

.kanban-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md) var(--r-md) 0 0;
  margin-bottom: 0;
}
.kanban-col-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text);
}
.kanban-col-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kanban-col-count {
  font-size: 0.7rem; font-weight: 700;
  background: var(--bg2);
  color: var(--text2);
  padding: 2px 8px;
  border-radius: var(--r-f);
  border: 1px solid var(--border);
}

.kanban-col-body {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 10px;
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--t);
}
.kanban-col-body.drag-over { background: var(--brand-light); border-color: var(--brand); }
[data-theme="dark"] .kanban-col-body.drag-over { background: var(--brand-mid); }
.kanban-empty-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 12px;
  color: var(--text3);
  font-size: .75rem;
  opacity: .5;
  pointer-events: none;
  border: 2px dashed var(--border);
  border-radius: var(--r);
}
.kanban-empty-col .material-symbols-outlined { font-size: 1.4rem; }

.kanban-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
  position: relative;
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border2); }
.kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
.kanban-card.removing { opacity: 0; transform: scale(0.92); transition: all 0.28s ease; }

/* Highlight cards assigned to the current viewer */
/* Highlight cards assigned to current viewer (all-tasks scope only) */
.kanban-card--mine { background: var(--brand-light); }
.kanban-card--mine:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .kanban-card--mine { background: var(--brand-mid); }

/* "You" pill badge */
.kanban-mine-badge {
  flex-shrink: 0;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 20px;
  padding: 1px 7px;
  line-height: 1.6;
}
[data-theme="dark"] .kanban-mine-badge { background: var(--brand-mid); }

/* "Assigned by me" card highlight */
.kanban-card--i-assigned { background: #ecfeff; }
.kanban-card--i-assigned:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .kanban-card--i-assigned { background: rgba(6,182,212,.1); }

/* "Assigned" pill badge */
.kanban-assigned-badge {
  flex-shrink: 0;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0891b2;
  background: #cffafe;
  border-radius: 20px;
  padding: 1px 7px;
  line-height: 1.6;
}
[data-theme="dark"] .kanban-assigned-badge { background: rgba(6,182,212,.18); color: #22d3ee; }

/* "Assigned by me" inline tag in requests table */
.tag-assigned-by-me {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  background: #cffafe;
  color: #0891b2;
  white-space: nowrap;
  vertical-align: middle;
}
[data-theme="dark"] .tag-assigned-by-me { background: rgba(6,182,212,.18); color: #22d3ee; }

/* Personal todo list */
#ma-todo-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
#ma-todo-input::placeholder { color: var(--text3); }
#ma-todo-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-mid);
}
.ma-todo-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.ma-todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  transition: background .15s;
}
.ma-todo-item:hover { background: var(--bg2); }
.ma-todo-check {
  background: none; border: none; cursor: pointer; padding: 0; line-height: 1;
  color: var(--text3); flex-shrink: 0; display: flex; align-items: center;
  transition: color .15s;
}
.ma-todo-check:hover { color: #0891b2; }
.ma-todo-item--done .ma-todo-check { color: #22c55e; }
.ma-todo-text { flex: 1; font-size: .88rem; color: var(--text); word-break: break-word; }
.ma-todo-item--done .ma-todo-text { text-decoration: line-through; color: var(--text3); }
.ma-todo-del {
  background: none; border: none; cursor: pointer; padding: 0; line-height: 1;
  color: transparent; flex-shrink: 0; display: flex; align-items: center;
  transition: color .15s;
}
.ma-todo-del .material-symbols-outlined { font-size: 16px; }
.ma-todo-item:hover .ma-todo-del { color: var(--text3); }
.ma-todo-item:hover .ma-todo-del:hover { color: var(--red); }

.kanban-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.kanban-card-title { font-size: 0.84rem; font-weight: 500; color: var(--text); line-height: 1.4; }
.kanban-card:hover .kanban-card-title { color: var(--brand); }
.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: flex-end;
  overflow: hidden;
}
.kanban-publish-btn {
  display: flex; align-items: center; gap: 3px;
  height: 22px;
  border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  color: var(--green, #22c55e);
  cursor: pointer;
  font-size: .65rem; font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-right: 0;
  transition: max-width 0.28s ease, opacity 0.22s ease,
              padding 0.28s ease, margin-right 0.28s ease,
              background var(--t), border-color var(--t);
}
.kanban-publish-btn .material-symbols-outlined { font-size: 13px; flex-shrink: 0; }
.kanban-publish-btn:hover { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); }
.kanban-card:hover .kanban-publish-btn {
  max-width: 90px;
  opacity: 1;
  padding: 0 6px;
  margin-right: 6px;
}

.kanban-delete-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  color: var(--red, #ef4444);
  cursor: pointer;
  flex-shrink: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-right: 0;
  transition: max-width 0.28s ease, opacity 0.22s ease,
              padding 0.28s ease, margin-right 0.28s ease,
              background var(--t), border-color var(--t);
}
.kanban-delete-btn .material-symbols-outlined { font-size: 13px; flex-shrink: 0; }
.kanban-delete-btn:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); }
.kanban-card:hover .kanban-delete-btn {
  max-width: 26px;
  opacity: 1;
  padding: 0 4px;
  margin-right: 4px;
}

/* btn-success */
.btn-success {
  background: var(--green, #22c55e); color: #fff;
  border: none; cursor: pointer;
}
.btn-success:hover { opacity: .88; }

/* Published widget blur + show more */
.pub-widget-wrap { position: relative; overflow: hidden; }
.pub-blur-row { opacity: 0.35; filter: blur(2.5px); pointer-events: none; user-select: none; }
.pub-widget-more {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; align-items: flex-end;
  padding: 32px 0 16px;
  background: linear-gradient(to bottom, transparent 0%, var(--surface, #fff) 55%);
  pointer-events: none;
}
.pub-widget-more button { pointer-events: all; }
[data-theme="dark"] .pub-widget-more {
  background: linear-gradient(to bottom, transparent 0%, var(--surface, #1e1e2e) 55%);
}

/* ══════════════════════════════════════════════════════
   CALENDAR
   ══════════════════════════════════════════════════════ */
.cal-header {
  display: flex;
  align-items: center;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
}
.cal-month-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  min-width: 200px;
  text-align: center;
  flex: 1;
}
.cal-grid { border-top: 1px solid var(--border); }
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg2);
}
.cal-dow {
  padding: 8px 0;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-right: 1px solid var(--border);
}
.cal-dow:last-child { border-right: none; }
.cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-row:last-child { border-bottom: none; }
.cal-cell {
  min-height: 108px;
  padding: 7px 6px 6px;
  border-right: 1px solid var(--border);
  vertical-align: top;
  overflow: hidden;
  transition: background .12s;
  display: flex;
  flex-direction: column;
}
.cal-cell:last-child { border-right: none; }
.cal-cell:hover:not(.cal-cell-empty) { background: var(--bg2); }
.cal-cell-empty { background: var(--bg2); opacity: .4; min-height: 108px; }
.cal-past .cal-cell-num { color: var(--text3); }
.cal-weekend { background: rgba(0,0,0,.015); }
[data-theme="dark"] .cal-weekend { background: rgba(255,255,255,.015); }
.cal-today { background: rgba(99,102,241,.06) !important; }
.cal-cell-num {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text2);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.cal-today-num {
  background: var(--brand, #6366f1);
  color: #fff !important;
  font-weight: 700;
}
.cal-special-days-wrap {
  margin-top: auto;
  padding-top: 3px;
}
.cal-special-day {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  font-size: .67rem;
  font-weight: 600;
  color: #e53935;
  background: rgba(229,57,53,.1);
  border: 1px solid rgba(229,57,53,.25);
  border-radius: 4px;
  padding: 2px 5px;
  margin-top: 2px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  cursor: pointer;
  transition: background .12s;
}
.cal-special-day .cal-sd-icon { flex-shrink: 0; margin-top: 1px; }
.cal-special-day:hover { background: rgba(229,57,53,.2); }
.cal-poya-day { color: #a5b4fc; background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.28); }
.cal-poya-day:hover { background: rgba(99,102,241,.22); }
.cal-task {
  display: block;
  font-size: .67rem;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--text);
  transition: filter .12s;
  text-decoration: none;
}
.cal-task:hover { filter: brightness(1.12); }
.cal-task-more {
  font-size: .64rem;
  color: var(--text3);
  padding: 1px 5px;
  cursor: default;
}

/* Responsive: shrink cells on small screens */
@media (max-width: 700px) {
  .cal-cell { min-height: 60px; padding: 4px 3px; }
  .cal-cell-empty { min-height: 60px; }
  .cal-dow { font-size: .62rem; }
  .cal-task { display: none; }
  .cal-task-more { display: none; }
  .cal-special-day { font-size: .6rem; padding: 1px 3px; }
  .cal-cell-num { font-size: .72rem; width: 20px; height: 20px; }
}

/* ── Day-detail popup ── */
.day-detail-special {
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.18);
  margin-bottom: 10px;
}
.day-detail-summary {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.55;
}
.day-detail-loading {
  font-size: .78rem;
  color: var(--text3);
  font-style: italic;
}
.day-detail-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: .83rem;
}
.day-detail-task-row:last-child { border-bottom: none; }

/* ── Sidebar upcoming special days ── */
.sidebar-upcoming {
  margin: 12px 8px 0;
  border-radius: var(--r);
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.18);
  padding: 8px 10px 6px;
  overflow: hidden;
  transition: opacity var(--t);
}
.sidebar.collapsed .sidebar-upcoming { opacity: 0; pointer-events: none; }
.sidebar-upcoming-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--amber, #f59e0b);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}
.sidebar-upcoming-chevron { transition: transform .22s ease; }
.sd-collapsed .sidebar-upcoming-chevron { transform: rotate(180deg); }
.sidebar-upcoming-body { overflow: hidden; max-height: 300px; opacity: 1; transition: max-height .25s ease, opacity .2s; }
.sd-collapsed .sidebar-upcoming-body { max-height: 0; opacity: 0; }
.sidebar-upcoming-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(245,158,11,.12);
  cursor: pointer;
}
.sidebar-upcoming-row:last-of-type { border-bottom: none; }
.sidebar-upcoming-row:hover .sidebar-upcoming-name { color: var(--amber, #f59e0b); }
.sidebar-upcoming-name {
  font-size: .73rem;
  font-weight: 500;
  color: var(--sidebar-th, #fff);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  min-width: 0;
}
.sidebar-upcoming-days {
  font-size: .68rem;
  font-weight: 700;
  color: var(--amber, #f59e0b);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}
.sidebar-upcoming-more {
  display: block;
  text-align: center;
  font-size: .7rem;
  color: var(--amber, #f59e0b);
  margin-top: 6px;
  cursor: pointer;
  opacity: .8;
}
.sidebar-upcoming-more:hover { opacity: 1; }

/* Sidebar upcoming row urgency highlights */
.sidebar-upcoming-row--today {
  background: rgba(239,68,68,.12);
  border-radius: 5px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-bottom: none !important;
}
.sidebar-upcoming-row--today .sidebar-upcoming-name { color: #fca5a5; font-weight: 600; }
.sidebar-upcoming-row--today .sidebar-upcoming-days { color: #f87171; }
.sidebar-upcoming-row--soon {
  background: rgba(245,158,11,.14);
  border-radius: 4px;
  padding: 3px 5px;
  margin: 0 -5px;
}
.sidebar-upcoming-row--soon .sidebar-upcoming-days { color: #fbbf24; }
.sidebar-upcoming-row--near .sidebar-upcoming-days { color: var(--amber, #f59e0b); opacity: .85; }
.sidebar-upcoming-row--poya .sidebar-upcoming-name { color: #a5b4fc; display: flex; align-items: center; gap: 3px; }
.sidebar-upcoming-row--poya .sidebar-upcoming-days { color: #818cf8; }
.sidebar-upcoming-row--poya:hover .sidebar-upcoming-name { color: #818cf8; }

/* ── Login special day note ── */
.login-sd-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 18px;
}
.login-sd-text { display: flex; flex-direction: column; gap: 2px; }
.login-sd-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.65);
}
.login-sd-names {
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.9);
}
@keyframes sd-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(1.15); }
}

/* ── Login Page Position Variants ── */
.login-screen.login-pos-left  { justify-content: flex-start; }
.login-screen.login-pos-right { justify-content: flex-end; }

/* ── Login Quote Bar ── */
.login-quote-bar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  animation: fadeInUp .5s ease both;
  animation-delay: .3s;
}
.login-quote-icon {
  font-size: 22px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
  transform: scaleX(-1);
}
.login-quote-text {
  flex: 1;
  font-size: .8rem;
  color: rgba(255,255,255,0.75);
  font-style: italic;
  line-height: 1.45;
}
.login-quote-author {
  font-size: .72rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  flex-shrink: 0;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

/* ── Dashboard Quote of the Day Widget ── */
.qotd-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-left: 3px solid var(--brand);
  border-radius: 0;
  padding: 6px 14px;
  margin-bottom: 12px;
  transition: opacity .3s;
  opacity: .5;
}
.qotd-widget.loaded { opacity: 1; }
.qotd-icon {
  font-size: 22px;
  color: var(--brand);
  opacity: .5;
  flex-shrink: 0;
  transform: scaleX(-1);
}
.qotd-body { flex: 1; min-width: 0; }
.qotd-text {
  font-size: .82rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qotd-author {
  font-size: .72rem;
  color: var(--text3);
  margin-top: 2px;
}
.qotd-loading {
  font-size: .8rem;
  color: var(--text3);
  font-style: italic;
}
.qotd-widget.loaded { cursor: pointer; }
.qotd-widget.loaded:hover { background: rgba(var(--brand-rgb, 99,102,241),.06); border-left-color: var(--brand); }
.qotd-expand-hint {
  font-size: 13px;
  color: var(--text3);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--t);
}
.qotd-widget.loaded:hover .qotd-expand-hint { opacity: .5; }

/* ── Quote Modal ── */
.qotd-modal-box { max-width: 480px; }
.qotd-modal-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.qotd-modal-author-row { display: flex; align-items: flex-start; gap: 16px; }
.qotd-modal-photo-wrap {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.qotd-modal-photo { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.qotd-modal-initials { font-size: 1.3rem; font-weight: 700; color: var(--brand); }
.qotd-modal-author-info { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.qotd-modal-author-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.qotd-modal-author-bio { font-size: .78rem; color: var(--text2); line-height: 1.5; }
.qotd-modal-quote-block {
  background: var(--bg2);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 16px 18px;
  display: flex; gap: 10px; align-items: flex-start;
}
.qotd-modal-quote-icon {
  font-size: 20px;
  color: var(--brand);
  opacity: .5;
  transform: scaleX(-1);
  flex-shrink: 0;
  margin-top: 2px;
}
.qotd-modal-quote-text {
  font-size: .95rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* ── Login Page Customization: Position Picker ── */
.login-pos-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--text2);
  font-size: .75rem;
  transition: border-color .15s, background .15s;
}
.login-pos-btn:hover { border-color: var(--brand); }
.login-pos-btn.active {
  border-color: var(--brand);
  background: rgba(215,0,64,.07);
  color: var(--brand);
}
.login-pos-preview {
  width: 64px;
  height: 36px;
  background: var(--bg2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.login-pos-card {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 22px;
  border-radius: 3px;
  background: var(--brand);
  opacity: .7;
}
.login-pos-card.left   { left: 4px; }
.login-pos-card.center { left: 50%; transform: translateX(-50%); }
.login-pos-card.right  { right: 4px; }

/* ── Dashboard today special day banner ── */
.today-special-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--brand);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(215,0,64,.3);
}
.today-special-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.today-special-body { flex: 1; min-width: 0; }
.today-special-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.75);
  margin-bottom: 3px;
}
.today-special-names {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-special-star {
  font-size: 22px;
  color: rgba(255,255,255,.3);
  flex-shrink: 0;
}

/* ── Calendar icon box (dashboard banner + login note) ── */
.sd-cal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.sd-cal-month {
  width: 100%;
  text-align: center;
  background: rgba(0,0,0,.35);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: rgba(255,255,255,.9);
  padding: 3px 0 2px;
  text-transform: uppercase;
}
.sd-cal-day {
  width: 100%;
  text-align: center;
  background: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  padding: 5px 0 6px;
}

/* Login note cal box — slightly smaller */
.login-sd-note .sd-cal-box {
  width: 38px;
}
.login-sd-note .sd-cal-month {
  font-size: .52rem;
  padding: 2px 0 2px;
}
.login-sd-note .sd-cal-day {
  font-size: 1.1rem;
  padding: 4px 0 5px;
  color: var(--brand, #D70040);
}

.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.kanban-card-deadline { font-size: 0.72rem; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.kanban-card-deadline .material-symbols-outlined { font-size: 13px; }
.kanban-card-people { display: flex; align-items: center; gap: -4px; }
.kanban-card-people .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.kanban-card-people .avatar:first-child { margin-left: 0; }
.priority-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--r) 0 0 var(--r);
}

/* ═══════════════════════════════════════════════════════
   USERS PAGE
   ═══════════════════════════════════════════════════════ */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.user-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-h));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t2);
}
.user-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--border2); }
.user-card:hover::before { transform: scaleX(1); }
.user-card-avatar { margin: 0 auto 16px; }
.user-card-name { font-size: 0.95rem; font-weight: 650; color: var(--text); margin-bottom: 4px; }
.user-card-email { font-size: 0.77rem; color: var(--text3); margin-bottom: 14px; }
.user-card-stats {
  display: flex; gap: 0; justify-content: center;
  border-top: 1px solid var(--border);
  padding-top: 14px; margin-top: 14px;
}
.user-stat { flex: 1; text-align: center; }
.user-stat-val { font-size: 1.15rem; font-weight: 750; color: var(--text); }
.user-stat-label { font-size: 0.67rem; color: var(--text3); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.user-card-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.user-status-dot {
  position: absolute; top: 14px; right: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}
.user-status-dot.active { background: var(--green); }
.user-status-dot.disabled { background: var(--gray); }

/* ═══════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════ */
.profile-header-card {
  background: linear-gradient(135deg, #D70040 0%, #b8003a 40%, #8c0030 100%);
  border-radius: var(--r-lg);
  padding: 32px;
  color: white;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(215,0,64,0.35);
}
.profile-avatar { border: 4px solid rgba(255,255,255,0.25); }
.profile-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.profile-role { font-size: 0.88rem; opacity: 0.75; }
.profile-info-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; opacity: 0.8; font-size: 0.84rem; }
.profile-info-row .material-symbols-outlined { font-size: 16px; }

/* ═══════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: modal-in 0.22s var(--ease);
  border: 1px solid var(--border);
  overflow: hidden;
}
.modal-box.modal-lg { max-width: 740px; }
.modal-box.modal-sm { max-width: 420px; }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(-12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg2);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  transition: all var(--t);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close .material-symbols-outlined { font-size: 18px; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

/* App Form (inside modal or page) */
.app-form { display: flex; flex-direction: column; gap: 18px; }
.app-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.app-form .form-group { display: flex; flex-direction: column; gap: 7px; }
.app-form .form-label { font-size: 0.8rem; font-weight: 600; color: var(--text2); }
.app-form .form-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  width: 100%;
}
.app-form .form-input:hover { border-color: var(--border2); }
.app-form .form-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-mid);
}
.app-form textarea.form-input { resize: vertical; min-height: 90px; }

/* ── Flash animations ── */
@keyframes status-flash-anim {
  0%   { box-shadow: 0 0 0 0 rgba(215,0,64,0.6); background: var(--brand-light); }
  70%  { box-shadow: 0 0 0 8px rgba(215,0,64,0); }
  100% { box-shadow: none; background: inherit; }
}
.status-flash { animation: status-flash-anim 0.6s ease-out forwards; }

/* Live update: external change arrived via SSE */
@keyframes live-update-anim {
  0%   { outline: 2px solid rgba(34,197,94,0.8); outline-offset: 0px; background: rgba(34,197,94,.08); }
  60%  { outline: 2px solid rgba(34,197,94,0.1); outline-offset: 3px; }
  100% { outline: none; background: inherit; }
}
.card-live-update {
  animation: live-update-anim 0.8s ease-out forwards;
  border-radius: var(--r-f);
}
.cell-live-update {
  animation: live-update-anim 0.8s ease-out forwards;
  border-radius: 4px;
}

/* Live remove: card deleted by someone else */
@keyframes live-remove-anim {
  0%   { opacity: 1; transform: scaleY(1); max-height: 200px; }
  40%  { opacity: 0.2; background: rgba(239,68,68,.1); }
  100% { opacity: 0; transform: scaleY(0); max-height: 0; margin: 0; padding: 0; }
}
.card-live-remove {
  animation: live-remove-anim 0.35s ease-in forwards;
  overflow: hidden;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   FEATURE 1 — DEADLINE ALERT WIDGET
   ═══════════════════════════════════════════════════════ */
.deadline-alert-card { border-color: var(--red) !important; }

@keyframes deadline-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.deadline-pulse-icon {
  font-size: 18px;
  animation: deadline-pulse 1.6s ease-in-out infinite;
}

.deadline-alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--bg2);
  cursor: pointer;
  transition: background 0.15s;
}
.deadline-alert-item:hover { background: var(--bg3); }
.deadline-alert-icon { font-size: 20px; flex-shrink: 0; }

.deadline-alert-countdown {
  flex-shrink: 0;
  font-size: .74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .03em;
}
.deadline-alert-countdown.deadline-overdue {
  background: rgba(239,68,68,.12);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.25);
}
.deadline-alert-countdown.deadline-soon {
  background: rgba(245,158,11,.12);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,.25);
}

/* ═══════════════════════════════════════════════════════
   FEATURE 7 — QUICK STATUS CHANGE DROPDOWN
   ═══════════════════════════════════════════════════════ */
.quick-status-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  font: inherit;
  padding: 3px 8px;
  border-radius: 20px;
  transition: opacity 0.15s, transform 0.1s;
}
.quick-status-btn:hover { opacity: 0.82; transform: scale(1.03); }

.quick-status-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  min-width: 170px;
  overflow: hidden;
  animation: fadeIn 0.1s ease-out;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

.quick-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text);
  transition: background 0.1s;
}
.quick-status-option:hover  { background: var(--bg2); }
.quick-status-option.active { background: var(--brand-light); font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   FEATURE 6 — STATUS TIMELINE TIMESTAMPS
   ═══════════════════════════════════════════════════════ */
.timeline-duration {
  font-size: .7rem;
  color: var(--text3);
  margin-top: 1px;
}
.timeline-date-exact {
  font-size: .72rem;
  color: var(--text3);
  margin-top: 1px;
}
.timeline-dot.done  { background: var(--green); border-color: var(--green); }
.timeline-dot.active { border-color: var(--brand); }

/* ── Settings save row ── */
.settings-save-row {
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.app-form select.form-input { cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 2000;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 390px;
  pointer-events: all;
  animation: toast-in 0.28s var(--ease);
  transition: opacity 0.28s, transform 0.28s;
  border-left: 3px solid transparent;
}
.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-info    { border-left-color: var(--blue); }
.toast-warn    { border-left-color: var(--amber); }
.toast.removing { opacity: 0; transform: translateX(110%); }
@keyframes toast-in { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
.toast-icon { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon .material-symbols-outlined { font-size: 17px; }
.toast-success .toast-icon { background: var(--green-l); color: var(--green); }
.toast-error   .toast-icon { background: var(--red-l);   color: var(--red); }
.toast-info    .toast-icon { background: var(--blue-l);  color: var(--blue); }
.toast-warn    .toast-icon { background: var(--amber-l); color: var(--amber); }
.toast-body { flex: 1; }
.toast-title { font-size: 0.84rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.toast-msg   { font-size: 0.78rem; color: var(--text2); line-height: 1.4; }

/* ═══════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: 210px 1fr; gap: 28px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  padding: 9px 14px;
  border-radius: var(--r);
  font-size: 0.845rem;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--t);
  display: flex; align-items: center; gap: 10px;
  position: relative;
}
.settings-nav-item .material-symbols-outlined { font-size: 17px; flex-shrink: 0; }
.settings-nav-item:hover { background: var(--bg2); color: var(--text); }
.settings-nav-item.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}
.settings-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
[data-theme="dark"] .settings-nav-item.active { background: var(--brand-mid); }
.settings-section { display: flex; flex-direction: column; gap: 0; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info {}
.settings-row-label { font-size: 0.9rem; font-weight: 550; color: var(--text); margin-bottom: 4px; }
.settings-row-desc { font-size: 0.78rem; color: var(--text3); line-height: 1.5; }

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border2);
  border-radius: var(--r-f);
  cursor: pointer;
  transition: background var(--t);
}
.toggle-track::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track { background: var(--brand); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }

/* ═══════════════════════════════════════════════════════
   SEARCH RESULTS — Feature 8 enhanced
   ═══════════════════════════════════════════════════════ */
.search-results-overlay {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.search-results-list { overflow-y: auto; flex: 1; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--t);
  border-bottom: 1px solid var(--border);
}
.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }
.search-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text3);
  font-size: .85rem;
}

/* Filter bar inside search overlay */
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.search-filter-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.search-filter-select {
  font-size: .78rem;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  outline: none;
  max-width: 130px;
}
.search-filter-select:focus { border-color: var(--brand); }
.search-filter-select.active { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* Footer */
.search-overlay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.search-overlay-footer-hint { font-size: .72rem; color: var(--text3); }
.search-go-btn {
  font-size: .78rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border: none;
  border-radius: var(--r);
  padding: 5px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background var(--t);
}
.search-go-btn:hover { background: var(--brand-mid); }

/* ═══════════════════════════════════════════════════════
   WORKLOAD PAGE — Feature 4
   ═══════════════════════════════════════════════════════ */
.workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.workload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  transition: all var(--t);
  cursor: default;
  box-shadow: var(--shadow-xs);
}
.workload-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border2); }
.workload-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.workload-card-info { flex: 1; min-width: 0; }
.workload-card-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.workload-card-role { font-size: .74rem; color: var(--text3); margin-top: 2px; }
.workload-bar-wrap {
  margin-bottom: 14px;
}
.workload-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--text3);
  margin-bottom: 5px;
}
.workload-bar-track {
  height: 8px;
  background: var(--bg2);
  border-radius: 8px;
  overflow: hidden;
}
.workload-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}
.workload-stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.workload-stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.workload-tasks-list { display: flex; flex-direction: column; gap: 6px; }
.workload-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg2);
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--t);
  font-size: .8rem;
}
.workload-task-row:hover { background: var(--bg3); }
.workload-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.workload-overdue-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 7px; border-radius: 20px;
  background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.2);
}

/* ═══════════════════════════════════════════════════════
   STATUS SELECTOR
   ═══════════════════════════════════════════════════════ */
.status-select {
  display: flex; flex-direction: column; gap: 6px;
}
.status-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
  font-size: 0.85rem;
  color: var(--text2);
}
.status-option:hover { background: var(--bg2); }
.status-option.selected { background: var(--brand-light); color: var(--brand); font-weight: 500; }
[data-theme="dark"] .status-option.selected { background: var(--brand-mid); }
.status-option-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
   ═══════════════════════════════════════════════════════ */

/* ── Sidebar Mobile Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--t2);
}
.sidebar-overlay.visible { opacity: 1; }

@media (max-width: 900px) {
  /* Sidebar becomes a drawer */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay { display: block; }
  .main-wrapper { margin-left: 0 !important; }

  /* Layouts */
  .grid-2 { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .request-detail-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }

  /* Dashboard activity/quick section stacking */
  .dash-bottom-grid { grid-template-columns: 1fr; }

  /* Request detail — stack sidebar below content */
  .request-detail-sidebar { order: 2; }
  .request-detail-main    { order: 1; }

  /* Hide inline search bar — replaced by icon toggle */
  .search-bar { display: none; }
  .search-bar.mobile-visible {
    display: flex;
    position: fixed;
    top: 60px; left: 0; right: 0;
    margin: 8px 16px;
    z-index: 60;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--r);
    width: calc(100% - 32px);
  }
  /* Show mobile search toggle button on all sub-900px sizes */
  #mobile-search-btn { display: flex !important; }

  .search-results-overlay { width: calc(100vw - 32px); left: 16px; transform: none; top: 116px; }
  .profile-header-card { flex-direction: column; text-align: center; }
  .profile-header-card > div:last-child { margin-left: 0; margin-top: 12px; }
}

/* ── Tablet-specific (641–900px) ── */
@media (min-width: 641px) and (max-width: 900px) {
  .page-content { padding: 20px 24px 24px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .users-grid { grid-template-columns: repeat(3, 1fr); }
  .kanban-board { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  /* Layout */
  .page-content { padding: 14px; }
  .page-header { margin-bottom: 18px; gap: 12px; }
  .page-title { font-size: 1.2rem; }
  .page-actions .btn span.material-symbols-outlined + * { display: none; } /* icon-only btns in header */
  .page-actions .btn { padding: 9px; border-radius: var(--r-sm); }
  .page-actions .btn .material-symbols-outlined { font-size: 19px; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-icon .material-symbols-outlined { font-size: 19px; }
  .stat-value { font-size: 1.45rem; }
  .stat-label { font-size: 0.72rem; }
  .stat-change { display: none; }

  /* Cards */
  .card { padding: 16px; }
  .card-header { margin-bottom: 14px; }
  .card-title { font-size: 0.9rem; }
  .charts-grid { gap: 14px; }
  .chart-wrap { height: 200px; }
  .grid-2 { gap: 14px; }

  /* Header */
  .app-header { padding-top: env(safe-area-inset-top, 0px); padding-left: 14px; padding-right: 14px; padding-bottom: 0; gap: 8px; }
  .breadcrumb .breadcrumb-home { display: none; }
  .breadcrumb .material-symbols-outlined { display: none; }
  .breadcrumb-current { font-size: 0.92rem; }
  .header-right { gap: 4px; }
  .icon-btn { width: 38px; height: 38px; }

  /* Request table → mobile cards */
  .table-wrap { overflow-x: visible; }
  table { display: block; }
  thead { display: none; }
  tbody { display: flex; flex-direction: column; gap: 10px; }
  tr {
    display: flex; flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px 14px 14px 16px;
    cursor: pointer;
    transition: background var(--t), box-shadow var(--t);
    background: var(--surface);
  }
  tr:hover { background: var(--bg); box-shadow: var(--shadow-sm); }
  tr:hover td { background: transparent; }
  td { display: block; padding: 0; border-bottom: none; font-size: 0.85rem; }
  td:empty { display: none; }

  /* Show only the first title cell on mobile — others hidden */
  tr td:nth-child(n+2) { display: none; }
  tr td:first-child { display: block; }
  .mobile-card-meta { display: flex !important; }

  /* Mobile card cell layout */
  .request-title-main { font-size: 0.88rem; font-weight: 600; color: var(--text); }
  .request-title-sub { font-size: 0.73rem; color: var(--text3); margin-top: 3px; }

  /* Table in non-request contexts (like profile) */
  .profile-page tbody tr td:nth-child(n+2) { display: table-cell; }

  /* Filters */
  .filters-bar { gap: 8px; }
  .filters-bar .search-bar { display: flex !important; position: static; width: 100%; margin: 0; box-shadow: none; border-radius: var(--r); }
  .filter-select { font-size: 0.78rem; padding: 7px 26px 7px 10px; }

  /* Users grid */
  .users-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .user-card { padding: 16px 12px; }
  .user-card-name { font-size: 0.85rem; }
  .user-card-email { font-size: 0.7rem; margin-bottom: 8px; }
  .user-card-actions { gap: 6px; }

  /* Kanban */
  .kanban-board { grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 20px; }
  .kanban-col { min-width: 0; }
  .kanban-card { padding: 12px; }

  /* Modals — bottom-sheet style on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100%;
    /* dvh accounts for browser chrome; safe-area clears the home indicator */
    max-height: calc(92dvh - env(safe-area-inset-bottom, 0px));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: modal-slide-up 0.28s var(--ease);
  }
  .modal-box.modal-sm { max-width: 100%; }
  .modal-box.modal-lg { max-width: 100%; }
  @keyframes modal-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .modal-body { padding: 18px; }
  .modal-header { padding: 16px 18px; }
  .modal-footer { padding: 14px 18px; }
  .app-form .form-row { grid-template-columns: 1fr; }

  /* Request detail */
  .request-detail-grid { gap: 16px; }
  .profile-header-card { padding: 24px 18px; gap: 16px; }
  .profile-name { font-size: 1.2rem; }

  /* Settings */
  .settings-grid { gap: 14px; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .settings-nav-item { padding: 7px 12px; font-size: 0.78rem; }
  .settings-nav-item .material-symbols-outlined { font-size: 15px; }

  /* Activity feed */
  .team-row-info { width: 100px; }
  .team-row-name { font-size: 0.78rem; }

  /* Comments */
  .comment-input-row { gap: 8px; }
  .comment-input-row .avatar { display: none; }

  /* Request detail sidebar fields */
  .detail-meta-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Kanban — snap-scroll on mobile */
  .kanban-board {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
  }
  .kanban-col { scroll-snap-align: start; }

  /* Profile — stack action buttons */
  .profile-actions { flex-wrap: wrap; gap: 8px; }
  .profile-actions .btn { flex: 1 1 auto; }

  /* Page header — stack title + actions on very small content */
  .page-header { flex-wrap: wrap; }
  .page-header .page-title { min-width: 0; flex: 1 1 100%; }

  /* Theater — larger thumbs on touch */
  .theater-thumb { width: 88px; height: 66px; }

  /* Moodboard list */
  .mb-page { padding: 16px; }
  .mb-list-header { margin-bottom: 16px; }
  .mb-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mb-card-cover { height: 110px; }

  /* Moodboard editor — toolbar moves to bottom for thumb reach */
  .mb-board-shell { height: calc(100dvh - 64px); }
  .mb-body { flex-direction: column-reverse; }
  .mb-left-toolbar {
    width: 100%; height: 50px; flex-direction: row;
    padding: 0 6px; border-right: none; border-top: 1px solid var(--border);
    overflow-x: auto; flex-wrap: nowrap;
    justify-content: flex-start; align-items: center; gap: 0;
    scrollbar-width: none;
  }
  .mb-left-toolbar::-webkit-scrollbar { display: none; }
  .mb-lt-btn { min-height: 42px; width: 44px; font-size: 0; padding: 0; border-radius: 8px; }
  .mb-lt-btn span:last-child { display: none; }
  .mb-lt-btn .material-symbols-outlined { font-size: 20px; }
  .mb-lt-divider { width: 1px; height: 24px; margin: 0 4px; flex-shrink: 0; }
  .mb-lt-spacer { display: none; }
  .mb-topbar { padding: 0 10px; height: 44px; gap: 6px; }
  .mb-name-input { max-width: 140px; font-size: .82rem; min-width: 100px; }
  .mb-topbar-spacer { flex: 1; min-width: 0; }
  .mb-item-count { display: none; }

  /* Toast — render above the bottom nav bar */
  .toast-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 12px; left: 12px;
  }
  .toast { min-width: unset; max-width: 100%; }

  /* Login */
  .login-card { padding: 28px 22px; }
  .login-brand { margin-bottom: 24px; }
  .demo-btns { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Search results */
  .search-results-overlay { top: 68px; left: 8px; right: 8px; width: auto; }

  /* Notification panel — switch to fixed positioning so it can't be clipped */
  .notif-panel {
    position: fixed;
    top: 64px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100dvh - 148px - env(safe-area-inset-bottom, 0px));
    border-radius: var(--r-lg);
    transform: none;
  }

  /* Modals — leave room for safe area at bottom */
  .modal-box { padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* Bottom nav spacing — accounts for nav height + safe-area + breathing room */
  .page-content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  /* Back-to-top — raise above bottom nav */
  #back-to-top {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 36px;
    height: 36px;
  }

  /* Filters bar — full-width on mobile */
  .filters-bar { flex-wrap: wrap; }
  .filter-row { flex-wrap: wrap; gap: 8px; }

  /* App header — hide dividers / extra text */
  .header-divider { display: none; }

  /* Breadcrumb — keep only the current page name */
  .breadcrumb { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Forms — single column in all contexts */
  .form-row-2 { grid-template-columns: 1fr !important; }
  .form-row-3 { grid-template-columns: 1fr !important; }
  .form-inline { flex-direction: column; align-items: stretch; }

  /* Detail page — full-width meta chips */
  .meta-chip-row { flex-wrap: wrap; }

  /* Attachment chips — wrap */
  .attachments-list { flex-wrap: wrap; }

  /* Deadline time row */
  #deadline-time-row { width: 100%; }
}

/* ── Very small screens ── */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .users-grid { grid-template-columns: 1fr; }
  .demo-btns { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: repeat(4, minmax(150px, 1fr)); overflow-x: auto; }
  /* Single-column moodboard list on tiny phones */
  .mb-grid { grid-template-columns: 1fr; }
}

/* ── Mobile Bottom Navigation Bar ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  /* Total height = 64px nav strip + safe-area for iPhone home indicator */
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0;
  /* z-index above sidebar overlay (99) so it never gets buried */
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  /* Fixed 64px — safe-area space lives below this inner strip */
  height: 64px;
  padding: 0 4px;
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--r);
  color: var(--text3);
  transition: color var(--t), background var(--t);
  /* flex:1 lets buttons evenly fill the bar regardless of count */
  flex: 1;
  min-width: 0;
  max-width: 80px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mobile-nav-btn .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }
.mobile-nav-btn span.label { font-size: 0.62rem; font-weight: 500; white-space: nowrap; }
.mobile-nav-btn.active { color: var(--brand); }
.mobile-nav-btn.active .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.mobile-nav-btn:active { background: var(--hover); }
.mobile-nav-badge {
  position: absolute;
  top: 4px; right: calc(50% - 22px);
  min-width: 15px; height: 15px;
  background: var(--red);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  border-radius: var(--r-f);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--surface);
}

@media (max-width: 640px) {
  .mobile-bottom-nav { display: flex; flex-direction: column; }
  /* Show hamburger on mobile for sidebar drawer */
  .sidebar-collapse-btn { display: flex !important; }
}
/* Tighten buttons further on very narrow screens */
@media (max-width: 360px) {
  .mobile-nav-btn { padding: 5px 6px; gap: 2px; }
  .mobile-nav-btn .material-symbols-outlined { font-size: 20px; }
  .mobile-nav-btn span.label { font-size: 0.57rem; }
}

/* ── Database loading indicator ── */
.db-loading-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r); font-size: .85rem; color: var(--text2);
}
.db-loading-wrap code {
  display: inline-block; margin-top: 4px; padding: 2px 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; font-family: monospace; font-size: .8rem; color: var(--brand);
}
.db-loading-error { border-color: var(--red); color: var(--red); background: var(--red-l); }
.db-loading-icon {
  font-size: 20px; color: var(--brand);
  animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Attachment chip hover (detail page) ── */
a.attachment-chip:hover, .attachment-chip-click:hover {
  background: var(--bg2);
  border-color: var(--brand);
}

/* ── Upload status label ── */
#upload-status { color: var(--text3); font-size: .82rem; }

/* ════════════════════════════════════════
   FILE PREVIEW LIGHTBOX
   ════════════════════════════════════════ */
#file-preview-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: fp-fade-in .15s ease;
}
@keyframes fp-fade-in { from { opacity: 0; } to { opacity: 1; } }

.fp-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(4px);
}
.fp-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: min(92vw, 1080px);
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: fp-slide-in .18s ease;
}
@keyframes fp-slide-in { from { transform: scale(.97) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.fp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0; gap: 12px;
}
.fp-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .88rem; font-weight: 600; color: var(--text);
  min-width: 0; overflow: hidden;
}
.fp-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-title .material-symbols-outlined { color: var(--brand); flex-shrink: 0; }
.fp-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.fp-body {
  flex: 1; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2);
  min-height: 0;
}
.fp-image {
  max-width: 100%; max-height: 80vh;
  object-fit: contain;
  display: block;
  padding: 16px;
  box-sizing: border-box;
}
.fp-pdf {
  width: 100%; height: 80vh;
  border: none;
  display: block;
}

/* ═══════════════════════════════════════════════════════
   WELCOME BANNER POPUP
   ═══════════════════════════════════════════════════════ */
.wb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .28s ease;
  backdrop-filter: blur(2px);
}
.wb-overlay.wb-visible { opacity: 1; }

.wb-popup {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.12);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(18px) scale(.97);
  transition: transform .28s cubic-bezier(.34,1.3,.64,1);
}
.wb-overlay.wb-visible .wb-popup {
  transform: translateY(0) scale(1);
}

.wb-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.12);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: background var(--t);
}
.wb-close:hover { background: rgba(0,0,0,.28); }
.wb-close .material-symbols-outlined { font-size: 16px; }

/* When there's NO image, close button adapts to surface colour */
.wb-body-no-image ~ .wb-close,
.wb-popup:not(:has(.wb-image-wrap)) .wb-close {
  background: var(--bg2);
  color: var(--text2);
}

.wb-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
}
.wb-image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.wb-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow-y: auto;
  text-align: center;
}
.wb-body-no-image {
  padding-top: 32px;
}

.wb-desc {
  font-size: .85rem;
  color: var(--text2);
  margin: 0;
  line-height: 1.65;
  max-width: 320px;
}

.wb-actions { display: flex; justify-content: center; width: 100%; }
.wb-cta-btn {
  font-size: .9rem;
  padding: 10px 28px;
  border-radius: var(--r);
  justify-content: center;
}

/* ── Banner Settings UI ── */
.banner-img-placeholder {
  width: 130px; height: 130px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.banner-img-placeholder:hover { border-color: var(--brand); background: var(--bg2); }

.banner-radio-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: border-color var(--t), background var(--t);
  font-size: .88rem;
  color: var(--text2);
}
.banner-radio-label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-alpha, rgba(99,102,241,.08));
  color: var(--text);
}

.banner-user-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
  background: var(--bg);
}
.banner-user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
}
.banner-user-row:hover { background: var(--bg2); }
.banner-user-row label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; width: 100%;
  font-size: .85rem; color: var(--text2);
}
.banner-user-row label input[type="checkbox"] { flex-shrink: 0; }

/* Responsive — small screens */
@media (max-width: 480px) {
  .wb-popup { max-width: 100%; border-radius: 14px 14px 0 0; }
  .wb-overlay { align-items: flex-end; padding: 0; }
}

/* ═══════════════════════════════════════════════════════
   THEATER
   ═══════════════════════════════════════════════════════ */

/* Main viewer */
.theater-main {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  cursor: pointer;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theater-main-img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  background: var(--bg);
}
.theater-pdf-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  gap: 8px;
}
.theater-pdf-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theater-main-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  gap: 10px;
}
.theater-live-badge {
  position: absolute;
  top: 12px; right: 14px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  background: var(--red,#ef4444);
  border-radius: 5px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(239,68,68,.45);
  animation: theater-live-pulse 2s ease-in-out infinite;
}
@keyframes theater-live-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(239,68,68,.45); }
  50%       { box-shadow: 0 2px 16px rgba(239,68,68,.75); }
}
.theater-main-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: rgba(255,255,255,.95);
  overflow: hidden;
  min-width: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.theater-main-meta .avatar {
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.35);
}
.theater-main-meta-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theater-main-meta-time {
  opacity: .7;
  font-size: .72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Delete button — main viewer (top-left) */
.theater-delete-btn {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s, background .18s;
  backdrop-filter: blur(4px);
}
.theater-delete-btn .material-symbols-outlined { font-size: 17px; }
.theater-main:hover .theater-delete-btn { opacity: 1; }
.theater-delete-btn:hover { background: rgba(220,38,38,.8); }

/* Delete button — queue thumb */
.theater-thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  padding: 0;
  line-height: 1;
}
.theater-thumb:hover .theater-thumb-delete { opacity: 1; }
.theater-thumb-delete:hover { background: rgba(220,38,38,.85); }

/* Empty state */
.theater-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  margin-bottom: 16px;
}

/* Queue */
.theater-queue-section {
  margin-top: 8px;
}
.theater-queue-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.theater-queue {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.theater-queue::-webkit-scrollbar { height: 4px; }
.theater-queue::-webkit-scrollbar-track { background: transparent; }
.theater-queue::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.theater-thumb {
  flex-shrink: 0;
  position: relative;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  background: var(--bg2);
  transition: border-color var(--t), transform var(--t);
}
.theater-thumb:hover { border-color: var(--brand); transform: translateY(-2px); }
.theater-thumb.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.theater-thumb-pdf {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
}
.theater-thumb-live-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red, #ef4444);
  box-shadow: 0 0 0 2px rgba(239,68,68,.3);
  animation: theater-pulse 1.6s ease-in-out infinite;
}
@keyframes theater-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(.85); }
}

/* ── Theater drag-drop zone ── */
.theater-drop-zone { position: relative; }
.theater-drop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(99,102,241,.1);
  border: 3px dashed var(--brand);
  border-radius: var(--r);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--brand);
  pointer-events: none;
  gap: 4px;
  backdrop-filter: blur(2px);
}
.theater-drop-overlay.visible { display: flex; }

/* ── Back to top ── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
#back-to-top .material-symbols-outlined { font-size: 18px; }

/* ═══════════════════════════════════════════════════════════════
   TOOLS PAGE
═══════════════════════════════════════════════════════════════ */
.tools-shell {
  display: flex;
  height: 100%;
  gap: 0;
  min-height: calc(100vh - 60px);
}

/* Left sidebar */
.tools-sidebar {
  width: 228px;
  min-width: 228px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
}
.tools-sidebar-title {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 16px 12px;
}
.tools-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.tools-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: .855rem;
  font-weight: 500;
  color: var(--text2);
  transition: background var(--t), color var(--t);
}
.tools-nav-item .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.tools-nav-item:hover { background: var(--hover); color: var(--text); }
.tools-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* Right main area */
.tools-main {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  background: var(--bg);
}

/* Tool card */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  max-width: 860px;
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tool-card-header .material-symbols-outlined { font-size: 22px; color: var(--brand); }
.tool-card-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text1); margin: 0; }
.tool-card-body { display: flex; flex-direction: column; gap: 14px; }

/* Common inputs */
.tool-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: .875rem;
  color: var(--text1);
  resize: vertical;
  transition: border-color .2s;
  outline: none;
}
.tool-textarea:focus { border-color: var(--brand); }
.tool-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: .875rem;
  color: var(--text1);
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color .2s;
}
.tool-input:focus { border-color: var(--brand); }
.tool-select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: .875rem;
  color: var(--text1);
  width: 100%;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
}
.tool-field { display: flex; flex-direction: column; gap: 5px; }
.tool-field label, .tool-field-label { font-size: .78rem; font-weight: 600; color: var(--text2); }
.tool-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.tool-btn:hover { opacity: .88; }
.tool-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tool-btn-ghost:hover { background: var(--brand); color: #fff; }
.tool-btn-icon {
  display: inline-flex;
  align-items: center;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px;
  cursor: pointer;
  color: var(--text2);
  transition: background .15s;
}
.tool-btn-icon:hover { background: var(--brand-soft); color: var(--brand); }
.tool-btn-icon .material-symbols-outlined { font-size: 16px; }

/* ── Word Counter ─── */
.wc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.wc-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wc-stat span { font-size: 1.4rem; font-weight: 700; color: var(--brand); }
.wc-stat label { font-size: .72rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }

/* ── Color Palette ─── */
.tool-color-picker {
  width: 56px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: none;
  padding: 2px;
  cursor: pointer;
}
/* ── Color Palette Generator (creative) ── */
.cp-top-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cp-input-group { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 180px; }
.cp-color-picker {
  width: 48px; height: 42px; border: none; border-radius: 10px;
  padding: 2px; cursor: pointer; background: none; flex-shrink: 0;
}
.cp-hex-input { font-family: monospace; letter-spacing: .06em; }
.cp-random-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 20px;
  border: 2px dashed var(--border); background: none;
  color: var(--text2); font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.cp-random-btn:hover { border-color: var(--brand); color: var(--brand); background: rgba(99,102,241,.07); }

.cp-gradient-strip {
  height: 44px; border-radius: 14px; margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
}

.cp-fmt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.cp-fmt-tabs { display: flex; background: var(--bg2); border-radius: 8px; padding: 3px; gap: 2px; }
.cp-fmt-tab {
  padding: 4px 13px; border-radius: 6px; border: none; background: none;
  font-size: .75rem; font-weight: 700; color: var(--text3);
  cursor: pointer; transition: all .15s; letter-spacing: .05em;
}
.cp-fmt-tab.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

.cp-section { margin-top: 20px; }
.cp-section-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text3); margin-bottom: 10px;
  display: flex; align-items: center; gap: 5px;
}
.cp-swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.cp-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: transform .15s;
}
.cp-swatch:hover { transform: translateY(-5px); }
.cp-swatch:hover .cp-swatch-color { box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.cp-swatch-color {
  width: 58px; height: 90px; border-radius: 16px;
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
  transition: box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
}
.cp-swatch-base .cp-swatch-color {
  box-shadow: 0 0 0 3px var(--brand), 0 6px 16px rgba(0,0,0,.18) !important;
  transform: scale(1.07);
}
.cp-swatch-val {
  font-size: .62rem; font-family: monospace; font-weight: 600;
  color: var(--text2); text-align: center; max-width: 64px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Image Resizer ─── */
.tool-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px 20px;
  cursor: pointer;
  color: var(--text2);
  transition: border-color .2s, background .2s;
  text-align: center;
}
.tool-upload-area:hover, .tool-upload-area.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.tool-upload-area p { margin: 0; font-weight: 500; }
.ir-preview-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.ir-preview-box { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.ir-preview-label { font-size: .78rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.ir-preview-img { width: 100%; height: 180px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.ir-info { font-size: .78rem; color: var(--text2); text-align: center; }
.tool-range { width: 100%; accent-color: var(--brand); }
.tool-toggle-label { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; color: var(--text2); cursor: pointer; }

/* ── Social Guide ─── */
.sm-guide { display: flex; flex-direction: column; gap: 20px; }
.sm-platform-name { font-size: .9rem; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.sm-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sm-table th { text-align: left; padding: 7px 12px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); border-bottom: 1px solid var(--border); }
.sm-table td { padding: 7px 12px; color: var(--text1); border-bottom: 1px solid var(--border); }
.sm-table tr:last-child td { border-bottom: none; }
.sm-table code { font-family: monospace; background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: .82rem; }

/* ── Deadline Calc ─── */
.dl-result {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.dl-stat {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.dl-stat span { display: block; font-size: 2rem; font-weight: 800; color: var(--brand); }
.dl-stat label { font-size: .72rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.dl-stat.ok   { border-color: var(--green, #22c55e); }
.dl-stat.ok span { color: var(--green, #22c55e); }
.dl-stat.urgent { border-color: #f59e0b; }
.dl-stat.urgent span { color: #f59e0b; }
.dl-stat.overdue { border-color: #ef4444; }
.dl-stat.overdue span { color: #ef4444; }

/* ── Brief Generator ─── */
.brief-form { display: flex; flex-direction: column; gap: 12px; }
.brief-divider { height: 1px; background: var(--border); margin: 12px 0; }
.brief-result { font-family: monospace; font-size: .82rem; line-height: 1.6; }

/* ── Slug Generator ─── */
.slug-output-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}
.slug-output {
  flex: 1;
  font-family: monospace;
  font-size: .875rem;
  color: var(--brand);
  word-break: break-all;
}

/* ── Text Case ─── */
.tc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Aspect Ratio ─── */
.ar-result {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.ar-quick { display: flex; flex-direction: column; gap: 6px; }
.ar-quick-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .83rem;
}
.ar-quick-item strong { color: var(--brand); min-width: 44px; }
.ar-quick-item span { color: var(--text2); font-family: monospace; }

/* ─────────────────────────────────────────────────────────
   MOBILE TOOLS — iOS Home Screen Layout
───────────────────────────────────────────────────────── */

/* These elements only exist on mobile — always invisible on desktop */
.tools-mobile-home { display: none; }
.tools-mobile-back  { display: none; }
.tools-content-wrap { /* invisible wrapper, inherits parent layout */ }

@media (max-width: 767px) {

  /* Shell: single column, no gap */
  .tools-shell {
    flex-direction: column;
    gap: 0;
  }

  /* Desktop sidebar: completely hidden */
  .tools-sidebar { display: none !important; }

  /* tools-main: hidden until a tool is opened */
  .tools-main {
    display: none;
    padding: 0;
    flex: 1;
  }
  .tools-main--hidden { display: none !important; }
  .tools-main--active { display: block !important; }

  /* ── Mobile home grid ───────────────────────────────── */
  .tools-mobile-home {
    display: block;
    padding: 8px 20px 40px;
    flex: 1;
  }
  .tools-mobile-home--hidden { display: none !important; }

  .tools-home-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text3);
    margin: 12px 4px 10px;
    grid-column: 1 / -1;
  }

  /* 4-column icon grid */
  .tools-home-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 4px;
  }

  /* Single app tile */
  .tools-home-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }

  /* iOS-style rounded square icon */
  .tools-home-tile-icon {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
      0 4px 14px rgba(0,0,0,0.20),
      0 1px 3px  rgba(0,0,0,0.10);
    transition: transform .12s ease, box-shadow .12s ease;
    position: relative;
    overflow: hidden;
  }

  /* Subtle inner highlight — iOS glass effect */
  .tools-home-tile-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg,rgba(255,255,255,0.22) 0%,transparent 55%);
    pointer-events: none;
  }

  /* Press feedback */
  .tools-home-tile:active .tools-home-tile-icon {
    transform: scale(0.88);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }

  .tools-home-tile-icon .material-symbols-outlined {
    font-size: 28px;
    color: #fff;
    position: relative;
    z-index: 1;
  }

  /* Image icons (default: white on coloured bg) */
  .tools-home-tile-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    position: relative;
    z-index: 1;
  }

  /* Esana logo — keep natural brand colours, just scale slightly */
  .tools-home-tile-img--esana {
    filter: none;
    width: 46px;
    height: 46px;
  }

  /* Label below icon */
  .tools-home-tile-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
    max-width: 70px;
    word-break: break-word;
  }

  /* ── Back button ────────────────────────────────────── */
  .tools-mobile-back {
    display: flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--brand);
    font-size: 17px;
    font-weight: 500;
    padding: 14px 16px 6px;
    cursor: pointer;
    width: 100%;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }
  .tools-mobile-back .material-symbols-outlined {
    font-size: 22px;
    margin-left: -4px;
  }
  .tools-mobile-back:active { opacity: .6; }

  /* ── Tool content wrapper — edge-to-edge native app style */
  .tools-content-wrap {
    padding: 0 0 40px;
  }

  /* Remove card container: flat, full-width */
  .tools-content-wrap .tool-card {
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
  .tools-content-wrap .tool-card-header {
    padding: 12px 16px;
  }
  .tools-content-wrap .tool-card-body {
    padding: 0;
  }
  .tools-content-wrap .tool-row {
    flex-wrap: wrap;
  }
  .tools-content-wrap .tool-field {
    width: 100%;
  }
  .tools-content-wrap .tool-input,
  .tools-content-wrap .tool-select {
    width: 100%;
    font-size: 16px; /* prevent iOS zoom on focus */
  }
  .tools-content-wrap .tool-textarea {
    font-size: 16px;
  }


  /* Esana header — logo + title on one line, badge drops to second line */
  .tool-card-header { flex-wrap: wrap; }
  .esana-header-badge {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
    order: 3;
  }

}

/* ══════════════════════════════════════════════════════
   ESANA THUMB MAKER
══════════════════════════════════════════════════════ */

/* Nav item with image icon */
.tools-nav-img-icon {
  width: 22px; height: 22px; object-fit: contain; border-radius: 4px; flex-shrink: 0;
}
.tools-nav-item-esana { }
.tools-nav-group-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3); padding: 14px 10px 4px; user-select: none;
}
.tools-nav-group-label:first-child { padding-top: 4px; }
.pdf-lvl-btn { padding: 6px 18px; font-size: .82rem; }
.pdf-lvl-active { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }

/* Header logo — same height as material icon in tool-card-header */
.esana-header-logo { height: 22px; width: auto; object-fit: contain; flex-shrink: 0; }
.esana-header-badge {
  font-size: .72rem; font-weight: 600; color: var(--text3);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 9px; margin-left: 2px;
}

/* Canvas area */
.esana-canvas-outer {
  position: relative; width: 100%; max-width: 800px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.esana-canvas-outer canvas { width: 100%; height: auto; display: block; }
.esana-canvas-badge {
  position: absolute; bottom: 8px; right: 10px;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: .7rem; padding: 3px 8px; border-radius: 20px;
  pointer-events: none; backdrop-filter: blur(4px);
}

/* Zoom row */
.esana-zoom-row {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.esana-zoom-slider { flex: 1; }
.esana-zoom-label {
  font-size: .8rem; font-weight: 700; color: var(--text2);
  min-width: 42px; text-align: right;
}

/* Download button — full-width on top of .tool-btn */
.esana-dl-btn { width: 100%; justify-content: center; padding: 12px 20px; margin-top: 4px; }
.esana-dl-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Download result note */
.esana-dl-note { text-align: center; font-size: .8rem; font-weight: 600; margin-top: 6px; min-height: 18px; }

/* ── QR Code Generator ────────────────────────────── */
#qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 16px;
}
#qr-canvas {
  border-radius: var(--r-sm);
  display: block;
}
#qr-actions {
  gap: 8px;
  flex-wrap: wrap;
}


/* ══════════════════════════════════════════════════════
   ESANA POST MAKER
══════════════════════════════════════════════════════ */

/* UN-Sandhyanee Sinhala font */
@font-face {
  font-family: 'UN-Sandhyanee';
  src: url('../fonts/UN-Sandhyanee.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

.tool-card--wide { max-width: none; }

/* ── Two-column layout ── */
.ep-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}

/* ── Left controls column ── */
.ep-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Each logical section */
.ep-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.ep-section:first-child { padding-top: 2px; }
.ep-section:last-child { border-bottom: none; padding-bottom: 6px; }

/* Legacy divider — sections now handle spacing */
.ep-divider { display: none; }

/* Title textarea — multiline, auto-grows slightly */
.ep-title-input {
  resize: none;
  min-height: 62px;
  line-height: 1.55;
  font-family: 'UN-Sandhyanee', 'Poppins', sans-serif;
}

/* ── Section labels ── */
.ep-sec-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 2px;
}
.ep-sec-label .material-symbols-outlined { font-size: 14px; opacity: .7; }

/* ── Drop zone ── */
.ep-drop {
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.ep-drop:hover {
  border-color: #007AFF;
  background: rgba(0,122,255,.04);
}

/* ── Thumbnail card ── */
.ep-thumb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg2, var(--surface2));
  border-radius: 10px;
  border: 1px solid var(--border);
}
.ep-thumb-img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.ep-thumb-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.ep-thumb-lbl {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text2);
}
.ep-change-btn {
  font-size: .78rem;
  padding: 5px 10px;
  align-self: flex-start;
}

/* ── Image fit + zoom ── */
.ep-img-controls { display: flex; flex-direction: column; gap: 8px; }
.ep-fit-btns { display: flex; gap: 6px; }
.ep-fit-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg, var(--surface));
  color: var(--text2);
  cursor: pointer;
  font-size: .72rem;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.ep-fit-btn .material-symbols-outlined { font-size: 18px; }
.ep-fit-btn:hover { background: var(--bg2, var(--surface2)); color: var(--text1); }
.ep-fit-btn.ep-fit-active {
  background: rgba(0,122,255,.1);
  border-color: rgba(0,122,255,.5);
  color: #007AFF;
  font-weight: 600;
}

/* Zoom row */
.esana-zoom-row { display: flex; align-items: center; gap: 6px; }
.esana-zoom-slider { flex: 1; }
.esana-zoom-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text2);
  min-width: 40px;
  text-align: right;
}

/* Darken row */
.ep-darken-row { display: flex; align-items: center; gap: 8px; }
.ep-darken-icon { font-size: 16px; color: var(--text3); flex-shrink: 0; }
.ep-darken-row .tool-range { flex: 1; }
.ep-darken-val {
  font-size: .72rem;
  color: var(--text3);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

/* ── Color swatches ── */
.ep-bg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ep-color-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.ep-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,0.25);
  transition: transform .12s, box-shadow .12s;
}
.ep-color-swatch:hover {
  transform: scale(1.12);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.4);
}
.ep-color-swatch.ep-tc-active,
.ep-color-swatch.ep-bg-active {
  transform: scale(1.18);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,0.5);
}
.ep-color-picker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  padding: 0;
  cursor: pointer;
  background: none;
  overflow: hidden;
  flex-shrink: 0;
}
.ep-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.ep-color-picker::-webkit-color-swatch { border: none; border-radius: 50%; }

/* ── News fetch row ── */
.ep-fetch-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.ep-fetch-row .tool-input { flex: 1; margin: 0; }
.ep-fetch-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  height: 40px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 10px;
}
.ep-fetch-btn .material-symbols-outlined { font-size: 16px; }
.ep-fetch-status {
  font-size: .74rem;
  min-height: 1.1em;
  color: var(--text3);
  margin-top: -4px;
}
.ep-fetch-status.ep-fetch-ok  { color: #34C759; }
.ep-fetch-status.ep-fetch-err { color: #FF3B30; }

/* ── Inputs ── */
.ep-para-ta {
  font-family: 'UN-Sandhyanee', 'Poppins', sans-serif;
  font-size: .9rem;
  resize: vertical;
}
.tool-input { font-family: 'UN-Sandhyanee', 'Poppins', sans-serif; }

/* ── Sub-labels ── */
.ep-sub-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text3);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* ── Style grid: label | slider | align ── */
.ep-style-grid {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 6px 8px;
  align-items: center;
}
.ep-style-col-hd {
  font-size: .67rem;
  color: var(--text3);
  text-align: center;
}
.ep-style-lbl {
  font-size: .78rem;
  color: var(--text2);
  font-weight: 500;
}
.ep-style-ctl { display: flex; align-items: center; gap: 6px; }
.ep-style-ctl .tool-range { flex: 1; min-width: 0; }
.ep-style-ctl span {
  font-size: .72rem;
  color: var(--text3);
  width: 34px;
  text-align: right;
  flex-shrink: 0;
}
.ep-style-sep {
  border-top: 1px solid var(--border);
  margin: 2px 0;
}

/* ── Alignment buttons ── */
.ep-align-grp { display: flex; gap: 1px; }
.ep-align-grp .tool-btn-icon {
  width: 30px;
  height: 30px;
  opacity: .4;
  transition: opacity .12s, background .12s, color .12s;
}
.ep-align-grp .tool-btn-icon .material-symbols-outlined { font-size: 16px; }
.ep-align-grp .tool-btn-icon:hover { opacity: .8; }
.ep-align-grp .tool-btn-icon.ep-active {
  opacity: 1;
  background: rgba(0,122,255,.13);
  color: #007AFF;
  border-radius: 6px;
}

/* ── Spacing rows ── */
.ep-sp-row { display: flex; flex-direction: column; gap: 4px; }
.ep-sp-lbl { font-size: .74rem; color: var(--text2); font-weight: 500; }
.ep-sp-ctl { display: flex; align-items: center; gap: 6px; }
.ep-sp-ctl .tool-range { flex: 1; min-width: 0; }
.ep-sp-ctl span {
  font-size: .72rem;
  color: var(--text3);
  width: 34px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Action row ── */
.ep-action-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: nowrap; }
.ep-dl-btn { height: 52px; padding: 0 22px; border-radius: 12px; font-size: .95rem; gap: 8px; }
.ep-dl-btn:disabled { opacity: .6; cursor: not-allowed; }
.esana-dl-btn:disabled { opacity: .6; cursor: not-allowed; }
.esana-dl-note { text-align: center; font-size: .8rem; font-weight: 600; min-height: 18px; }
.ep-icon-btn {
  width: 52px !important;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
  border-radius: 12px;
}
.ep-icon-btn .material-symbols-outlined { font-size: 22px; }

/* ── Right column: sticky preview ── */
.ep-preview-wrap { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.ep-canvas-outer {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
}
/* Canvas always scales to container width — critical for mobile */
.ep-canvas-outer canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 704 / 880; /* iOS Safari: height:auto ignored on <canvas>, force correct ratio */
}

/* ── Tablet (≤ 900px): stack, preview on top ── */
@media (max-width: 900px) {
  .ep-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .ep-preview-wrap {
    position: static;
    order: -1;
  }
  .ep-canvas-outer {
    max-width: 460px;
    margin: 0 auto;
  }
}

/* ── Mobile (≤ 600px): full-width, touch-friendly ── */
@media (max-width: 600px) {
  /* Edge-to-edge: card already has no padding from 767px rule */
  .tools-content-wrap .tool-card { padding: 0; }

  .ep-layout { gap: 14px; overflow-x: hidden; }

  /* Ensure controls column never exceeds viewport width */
  .ep-controls { width: 100%; min-width: 0; overflow: hidden; }

  /* Canvas: full bleed, no border-radius or side borders */
  .ep-canvas-outer {
    max-width: none;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: 0;
    margin-right: 0;
  }

  /* Sections get horizontal padding so text/inputs sit off the edge */
  .ep-section { padding: 14px 16px; gap: 8px; }
  .ep-section:last-child { padding-bottom: 6px; }

  /* Action row and download note get same horizontal breathing room */
  .ep-action-row { padding: 0 16px; flex-wrap: wrap; gap: 8px; }
  .ep-dl-btn { flex: 1; min-width: 140px; justify-content: center; }
  .esana-dl-note { padding: 0 16px; }
  .ep-fetch-btn .ep-fetch-text { display: none; } /* icon only on tiny screens */
  .ep-fit-btn { padding: 8px 2px; font-size: .68rem; }
  .ep-align-grp .tool-btn-icon { width: 34px; height: 34px; }
  .ep-style-grid { grid-template-columns: 36px 1fr auto; }

  /* Prevent long fetch-status text from overflowing */
  .ep-fetch-status { word-break: break-word; overflow-wrap: break-word; }

  /* Paragraph trigger button — keep label from overflowing */
  .ep-para-trigger { min-width: 0; overflow: hidden; }
}

/* ══════════════════════════════════════════════════════
   MOOD BOARDS
══════════════════════════════════════════════════════ */

/* List page */
.mb-page { padding: 28px 32px; }
.mb-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.mb-list-title { font-size: 1.5rem; font-weight: 800; color: var(--text1); margin: 0 0 4px; }
.mb-list-sub   { color: var(--text3); margin: 0; font-size: .875rem; }

/* Board grid */
.mb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.mb-card {
  border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--surface); overflow: visible; cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative; box-shadow: var(--shadow-xs);
}
.mb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border2); }
.mb-card-cover {
  height: 148px; border-radius: calc(var(--r-md) - 2px) calc(var(--r-md) - 2px) 0 0;
  background-size: cover; background-position: center; background-color: var(--bg2);
  overflow: hidden;
}
.mb-card-cover-empty {
  display: flex; align-items: center; justify-content: center; color: var(--text3);
}
.mb-card-cover-empty .material-symbols-outlined { font-size: 40px; }
.mb-card-info  { padding: 14px 16px; }
.mb-card-name  { font-weight: 700; font-size: .9rem; color: var(--text); }
.mb-card-meta  { font-size: .74rem; color: var(--text3); margin-top: 3px; }
.mb-card-del {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.5); border: none; border-radius: var(--r-sm);
  color: #fff; cursor: pointer; padding: 4px; width: 28px; height: 28px;
  display: none; align-items: center; justify-content: center; line-height: 1;
  backdrop-filter: blur(4px);
}
.mb-card-del .material-symbols-outlined { font-size: 15px; }
.mb-card:hover .mb-card-del { display: flex; }
.mb-card-del:hover { background: #ef4444; }

/* New Board card */
.mb-card-new {
  border: 2px dashed var(--border2); background: var(--bg2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 210px; color: var(--text3);
  cursor: pointer; transition: all var(--t); border-radius: var(--r-md);
}
.mb-card-new:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.mb-card-new .material-symbols-outlined { font-size: 36px; }
.mb-card-new > span:last-child { font-size: .875rem; font-weight: 600; }

/* Empty state */
.mb-empty { text-align: center; padding: 80px 20px; color: var(--text3); }
.mb-empty .material-symbols-outlined { font-size: 56px; display: block; margin-bottom: 12px; }
.mb-empty p    { font-size: 1.1rem; font-weight: 600; color: var(--text2); margin: 0 0 4px; }
.mb-empty span { font-size: .875rem; }

/* Board shell */
.mb-board-shell { display: flex; flex-direction: column; height: calc(100vh - 64px); }

/* Top bar */
.mb-topbar {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 0 16px; height: 46px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.mb-topbar-back {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; border-radius: 7px;
  background: transparent; color: var(--text2); cursor: pointer;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.mb-topbar-back:hover { background: var(--hover); color: var(--text1); }
.mb-topbar-back .material-symbols-outlined { font-size: 20px; }
.mb-topbar-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; border-radius: 7px;
  background: transparent; color: var(--text2); cursor: pointer;
  transition: background .12s, color .12s;
}
.mb-topbar-icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text1); }
.mb-topbar-icon-btn:disabled { opacity: .35; cursor: default; }
.mb-topbar-icon-btn .material-symbols-outlined { font-size: 18px; }

.mb-name-input {
  background: transparent; border: 1.5px solid transparent;
  border-radius: 7px; font-family: inherit; font-size: .95rem;
  font-weight: 700; color: var(--text1); padding: 4px 8px;
  min-width: 140px; max-width: 320px; outline: none; transition: border-color .15s;
}
.mb-name-input:hover { border-color: var(--border); }
.mb-name-input:focus { border-color: var(--brand); }
.mb-topbar-spacer { flex: 1; }
.mb-item-count {
  font-size: .75rem; color: var(--text3); font-weight: 500;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px; white-space: nowrap;
}

/* Body = left toolbar + canvas */
.mb-body { display: flex; flex: 1; overflow: hidden; position: relative; }

/* Left icon toolbar (Milanote style) */
.mb-left-toolbar {
  width: 58px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 10px 0;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: visible;
}
.mb-lt-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 46px; min-height: 46px; border: none; border-radius: 8px;
  background: transparent; color: var(--text2); cursor: pointer;
  font-family: inherit; font-size: .6rem; font-weight: 600; letter-spacing: .01em;
  transition: background .15s, color .15s; padding: 6px 4px;
}
.mb-lt-btn:hover { background: var(--hover); color: var(--text1); }
.mb-lt-btn.active { background: var(--brand-soft); color: var(--brand); }
.mb-lt-btn .material-symbols-outlined { font-size: 20px; }
.mb-lt-btn span:last-child { line-height: 1; }
.mb-lt-divider { width: 30px; height: 1px; background: var(--border); margin: 4px 0; flex-shrink: 0; }
.mb-lt-spacer  { flex: 1; }
.mb-lt-trash   { color: var(--text3); }
.mb-lt-trash:hover { background: #fef2f2; color: #ef4444; }
.mb-lt-paste-hint { cursor: default; opacity: .55; }
.mb-lt-paste-hint:hover { background: transparent; color: var(--text2); }

/* Canvas wrapper */
.mb-canvas-wrap { flex: 1; overflow: auto; position: relative; background: var(--bg); }

/* Infinite canvas */
.mb-canvas {
  position: relative; width: 3200px; height: 2200px;
  transform-origin: 0 0; transition: transform .1s ease-out;
  background-image: radial-gradient(circle, var(--border) 1.2px, transparent 1.2px);
  background-size: 28px 28px;
}

/* ── Items ── */
.mb-item {
  position: absolute; cursor: grab; user-select: none;
  border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.10);
  border: 2px solid transparent; transition: border-color .1s, box-shadow .1s;
  box-sizing: border-box;
}
.mb-item:hover      { border-color: var(--border); }
.mb-item:active     { cursor: grabbing; }
.mb-selected {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px var(--brand-soft), 0 4px 16px rgba(0,0,0,.14) !important;
}

/* Image */
.mb-item-image { overflow: hidden; background: var(--bg); }
.mb-img-el { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; border-radius: 8px; }

/* Text box */
.mb-item-text  { background: var(--surface); border-radius: 8px; overflow: hidden; }
.mb-text-body  {
  flex: 1; width: 100%; box-sizing: border-box;
  padding: 10px 13px; outline: none; font-family: inherit;
  font-size: .9rem; color: var(--text1); cursor: text;
  word-break: break-word; line-height: 1.55; overflow: auto;
  background: transparent;
}
.mb-text-body:empty::before {
  content: attr(data-placeholder); color: var(--text3); pointer-events: none;
}

/* Sticky note */
.mb-item-note  { border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.mb-note-body  {
  flex: 1; width: 100%; box-sizing: border-box;
  padding: 12px 14px; outline: none; font-family: inherit;
  font-size: .875rem; color: #374151; cursor: text;
  word-break: break-word; line-height: 1.55; overflow: auto;
}
.mb-note-body:empty::before {
  content: attr(data-placeholder); color: rgba(55,65,81,.45); pointer-events: none;
}

/* Delete button (top-right of item) */
.mb-del-btn {
  position: absolute; top: 7px; right: 7px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; width: 26px; height: 26px;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; color: var(--text2);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: background .12s, color .12s, transform .15s, opacity .15s;
  opacity: 0; transform: translateY(4px);
}
.mb-del-btn .material-symbols-outlined { font-size: 15px; }
.mb-item:hover .mb-del-btn,
.mb-selected .mb-del-btn { display: flex; opacity: 1; transform: translateY(0); }
.mb-del-btn:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* Resize handle (bottom-right corner) */
.mb-resize-handle {
  position: absolute; bottom: 0; right: 0;
  width: 18px; height: 18px; cursor: se-resize;
  background: var(--brand); border-radius: 3px 0 8px 0;
  opacity: 0; transition: opacity .15s;
}
.mb-item:hover .mb-resize-handle,
.mb-selected .mb-resize-handle { opacity: 1; }

/* ── Mood Board: editing state ── */
.mb-editing { cursor: text !important; }
.mb-editing .mb-text-body,
.mb-editing .mb-note-body,
.mb-editing .mb-heading-body { cursor: text; user-select: text; }

/* ── Heading card ── */
.mb-item-heading { background: transparent; box-shadow: none; border-color: transparent !important; }
.mb-item-heading:hover { border-color: var(--border) !important; }
.mb-heading-body {
  flex: 1; width: 100%; box-sizing: border-box;
  padding: 8px 12px; outline: none; font-family: inherit;
  font-weight: 700; color: var(--text1); cursor: text;
  word-break: break-word; line-height: 1.3; overflow: auto;
  background: transparent;
}
.mb-heading-body:empty::before { content: attr(data-placeholder); color: var(--text3); pointer-events: none; }
.mb-heading-levels {
  position: absolute; top: -32px; left: 0; display: none;
  gap: 3px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.mb-selected .mb-heading-levels,
.mb-item-heading:hover .mb-heading-levels { display: flex; }
.mb-hl-btn {
  border: none; background: transparent; border-radius: 5px;
  padding: 2px 7px; font-family: inherit; font-size: .75rem; font-weight: 700;
  color: var(--text2); cursor: pointer; transition: background .12s, color .12s;
}
.mb-hl-btn:hover { background: var(--hover); color: var(--text1); }
.mb-hl-btn.active { background: var(--brand-soft); color: var(--brand); }

/* ── Sticky note topbar ── */
.mb-note-topbar {
  display: none; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: 8px 8px 0 0;
}
.mb-note-colors { display: flex; align-items: center; gap: 3px; flex: 1; }
.mb-nc {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s, border-color .12s;
  flex-shrink: 0;
}
.mb-nc:hover { transform: scale(1.25); border-color: rgba(0,0,0,.2); }
.mb-selected .mb-note-topbar { display: flex; }

/* ── To-do card ── */
.mb-item-todo { background: var(--surface); overflow: hidden; }
.mb-todo-header {
  display: flex; align-items: center; padding: 10px 12px 6px;
  border-bottom: 1px solid var(--border);
}
.mb-todo-title {
  flex: 1; outline: none; font-family: inherit; font-size: .875rem;
  font-weight: 600; color: var(--text1); background: transparent;
  border: none; padding: 0; min-width: 0;
}
.mb-todo-title:empty::before { content: 'To-do list'; color: var(--text3); pointer-events: none; }
.mb-todo-list { padding: 6px 10px; overflow-y: auto; max-height: 260px; }
.mb-todo-row {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 2px; border-radius: 5px; cursor: default;
}
.mb-todo-row input[type=checkbox] { flex-shrink: 0; width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
.mb-todo-text {
  flex: 1; outline: none; font-family: inherit; font-size: .84rem;
  color: var(--text1); word-break: break-word; line-height: 1.45;
  background: transparent; border: none; padding: 0;
}
.mb-done .mb-todo-text { text-decoration: line-through; color: var(--text3); }
.mb-todo-del {
  opacity: 0; background: none; border: none; padding: 0 2px; cursor: pointer;
  color: var(--text3); font-size: 14px; transition: opacity .12s, color .12s;
  display: flex; align-items: center;
}
.mb-todo-row:hover .mb-todo-del { opacity: 1; }
.mb-todo-del:hover { color: #ef4444; }
.mb-todo-add {
  width: 100%; background: none; border: none; border-top: 1px solid var(--border);
  padding: 7px 12px; text-align: left; font-family: inherit; font-size: .82rem;
  color: var(--text3); cursor: pointer; border-radius: 0 0 8px 8px;
  transition: background .12s, color .12s;
}
.mb-todo-add:hover { background: var(--hover); color: var(--brand); }

/* ── Link preview card ── */
.mb-item-link { background: var(--surface); overflow: hidden; cursor: pointer; }
.mb-link-card {
  display: flex; flex-direction: column; height: 100%;
  padding: 12px 14px; gap: 5px; box-sizing: border-box;
  text-decoration: none; color: inherit;
}
.mb-link-card:hover { text-decoration: none; }
.mb-link-favicon {
  width: 20px; height: 20px; border-radius: 4px; object-fit: contain;
  flex-shrink: 0;
}
.mb-link-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; overflow: hidden; }
.mb-link-title { font-size: .88rem; font-weight: 600; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-link-desc  { font-size: .78rem; color: var(--text2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mb-link-host  { font-size: .72rem; color: var(--brand); margin-top: auto; }
.mb-link-top   { display: flex; align-items: center; gap: 8px; }

/* ── SVG canvas overlay ── */
#mb-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.mb-svg-line { stroke: var(--text2); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.mb-svg-drawing { stroke: var(--text1); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mb-svg-ep, .mb-svg-del-btn { display: none; }
.mb-svg-selected .mb-svg-ep,
.mb-svg-selected .mb-svg-del-btn { display: block !important; }
.mb-svg-ep {
  fill: var(--brand); stroke: #fff; stroke-width: 2;
  pointer-events: all; cursor: pointer;
  r: 5; transition: r .1s;
}
.mb-svg-ep:hover { r: 7; }

/* ── Draw submenu ── */
.mb-lt-submenu-wrap { position: relative; }
.mb-lt-submenu {
  position: fixed; left: 66px; top: auto;
  transform: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 100;
  display: flex; flex-direction: column; gap: 2px; min-width: 90px;
}
.mb-lt-submenu.hidden { display: none; }
.mb-lt-sub-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: none; border-radius: 7px;
  background: transparent; color: var(--text2); cursor: pointer;
  font-family: inherit; font-size: .82rem; font-weight: 600;
  transition: background .12s, color .12s; white-space: nowrap;
}
.mb-lt-sub-btn:hover { background: var(--hover); color: var(--text1); }
.mb-lt-sub-btn.active { background: var(--brand-soft); color: var(--brand); }
.mb-lt-sub-btn .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }

/* ── Floating zoom bar ── */
.mb-zoom-float {
  position: absolute; bottom: 20px; left: 78px; z-index: 50;
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  overflow: hidden;
}
.mb-zoom-float-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; background: transparent;
  color: var(--text2); cursor: pointer; transition: background .12s, color .12s;
}
.mb-zoom-float-btn:hover { background: var(--hover); color: var(--text1); }
.mb-zoom-float-btn .material-symbols-outlined { font-size: 18px; }
.mb-zoom-float-pct {
  border: none; background: transparent; cursor: pointer;
  padding: 0 6px; height: 36px; display: flex; align-items: center;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  font-family: inherit; font-size: .78rem; font-weight: 700;
  color: var(--text1); min-width: 46px; justify-content: center;
  transition: background .12s;
}
.mb-zoom-float-pct:hover { background: var(--hover); }

/* ── Mood Board share button ── */
.mb-topbar-share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: 1.5px solid var(--brand); border-radius: 8px;
  background: transparent; color: var(--brand); cursor: pointer;
  font-family: inherit; font-size: .82rem; font-weight: 700;
  transition: background .12s, color .12s;
}
.mb-topbar-share-btn:hover { background: var(--brand); color: #fff; }
.mb-topbar-share-btn .material-symbols-outlined { font-size: 16px; }

/* ══════════════════════════════════════════════════════
   GLOBAL MOBILE POLISH
   Additional responsive rules that complement the main
   @media blocks above.
══════════════════════════════════════════════════════ */

/* ── Moodboard zoom float — move above bottom nav on mobile ── */
@media (max-width: 640px) {
  .mb-zoom-float {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 12px;
  }
  /* Share button — icon-only on mobile */
  .mb-topbar-share-btn span:not(.material-symbols-outlined) { display: none; }
  .mb-topbar-share-btn { padding: 6px 10px; gap: 0; }
}

/* ── Theater page mobile improvements ── */
@media (max-width: 640px) {
  .theater-main { min-height: 220px; }
  .theater-main-img { max-height: 50vh; }
  .theater-thumb { width: 80px; height: 60px; }
  .theater-queue { gap: 8px; }
  /* Larger tap target for delete buttons */
  .theater-delete-btn { width: 32px; height: 32px; }
  .theater-thumb-delete { opacity: 1; } /* always show on touch */
}

/* ── Calendar mobile improvements ── */
@media (max-width: 640px) {
  .cal-grid { font-size: .72rem; }
  .cal-day-num { font-size: .78rem; }
  .cal-event { font-size: .65rem; padding: 1px 4px; }
}

/* ── Workload / assigned-work pages ── */
@media (max-width: 640px) {
  .workload-grid { grid-template-columns: 1fr; gap: 12px; }
  .wl-bar-row { gap: 6px; }
  .wl-name { min-width: 70px; font-size: .78rem; }
}

/* ── File preview lightbox — full screen on mobile ── */
@media (max-width: 640px) {
  .fp-box {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
}

/* ── Prevent horizontal page overflow on mobile ── */
@media (max-width: 640px) {
  .page-content, .app-shell, .main-wrapper {
    max-width: 100vw;
    overflow-x: hidden;
  }
}
