/* ═══════════════════════════════════════════════════════════════
   ytrok v6 — css/app.css
   Complete design system · 10 modules · Professional standards
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════════════════════════
   1. TOKENS — LIGHT
   ══════════════════════════════════════════════════════════════ */
:root {
  --font:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Scale */
  --fs-xs:10px; --fs-sm:12px; --fs-base:13px; --fs-md:14px;
  --fs-lg:16px; --fs-xl:20px; --fs-2xl:24px; --fs-3xl:32px;

  /* Radius */
  --r-xs:4px; --r-sm:6px; --r:8px; --r-md:10px;
  --r-lg:12px; --r-xl:16px; --r-2xl:20px; --r-3xl:28px; --r-full:9999px;

  /* Transitions */
  --t-fast:100ms cubic-bezier(.4,0,.2,1);
  --t-base:180ms cubic-bezier(.4,0,.2,1);
  --t-slow:300ms cubic-bezier(.4,0,.2,1);
  --t-spring:360ms cubic-bezier(.34,1.56,.64,1);

  /* Layout */
  --nav-w:220px; --nav-w-icon:52px; --topbar-h:calc(48px + env(safe-area-inset-top, 0px)); --topbar-base:48px; --fab-size:48px;
  --header-h:80px;

  /* Brand — never changes */
  --logo-light:#C8BDA4; --logo-accent:#A8956E;

  /* Surfaces — light */
  --bg:#F4F4F6;
  --surface:#FFFFFF;
  --surface-2:#F4F4F6;
  --surface-3:#EBEBEE;
  --surface-4:#DDDDE0;
  --sidebar-bg:#FAFAFA;
  --topbar-bg:rgba(255,255,255,.92);
  --scrim:rgba(0,0,0,.32);

  /* Text — light */
  --t1:#111114; --t2:#38383F; --t3:#68686F; --t4:#9898A0;

  /* Border — light */
  --b1:rgba(0,0,0,.07); --b2:rgba(0,0,0,.11); --b3:rgba(0,0,0,.16);

  /* Elevation — light */
  --e0:none;
  --e1:0 1px 2px rgba(0,0,0,.05),0 0 0 1px rgba(0,0,0,.04);
  --e2:0 2px 8px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);
  --e3:0 4px 16px rgba(0,0,0,.10),0 2px 4px rgba(0,0,0,.06);
  --e4:0 8px 32px rgba(0,0,0,.13),0 4px 8px rgba(0,0,0,.07);
  --e5:0 20px 60px rgba(0,0,0,.16),0 8px 20px rgba(0,0,0,.10);

  /* Semantic */
  --success:#1A9E52; --success-bg:rgba(26,158,82,.09);
  --warning:#C47C00; --warning-bg:rgba(196,124,0,.10);
  --danger :#D93025; --danger-bg :rgba(217,48,37,.09);
  --info   :#0066CC; --info-bg   :rgba(0,102,204,.09);
}

/* ══════════════════════════════════════════════════════════════
   2. ACCENT SYSTEM — 12 options
   ══════════════════════════════════════════════════════════════ */
[data-accent="blue"]   {--ac:#0066CC;--ac-bg:rgba(0,102,204,.09);--ac-d:#004999;--ac-rgb:0,102,204;}
[data-accent="indigo"] {--ac:#4F46E5;--ac-bg:rgba(79,70,229,.09);--ac-d:#3730A3;--ac-rgb:79,70,229;}
[data-accent="violet"] {--ac:#7C3AED;--ac-bg:rgba(124,58,237,.09);--ac-d:#5B21B6;--ac-rgb:124,58,237;}
[data-accent="teal"]   {--ac:#0D9488;--ac-bg:rgba(13,148,136,.09);--ac-d:#0F766E;--ac-rgb:13,148,136;}
[data-accent="green"]  {--ac:#16A34A;--ac-bg:rgba(22,163,74,.09);--ac-d:#15803D;--ac-rgb:22,163,74;}
[data-accent="amber"]  {--ac:#B45309;--ac-bg:rgba(180,83,9,.09);--ac-d:#92400E;--ac-rgb:180,83,9;}
[data-accent="orange"] {--ac:#EA580C;--ac-bg:rgba(234,88,12,.09);--ac-d:#C2410C;--ac-rgb:234,88,12;}
[data-accent="rose"]   {--ac:#E11D48;--ac-bg:rgba(225,29,72,.09);--ac-d:#BE123C;--ac-rgb:225,29,72;}
[data-accent="pink"]   {--ac:#DB2777;--ac-bg:rgba(219,39,119,.09);--ac-d:#9D174D;--ac-rgb:219,39,119;}
[data-accent="slate"]  {--ac:#475569;--ac-bg:rgba(71,85,105,.09);--ac-d:#334155;--ac-rgb:71,85,105;}
[data-accent="gold"]   {--ac:#A16207;--ac-bg:rgba(161,98,7,.10);--ac-d:#854D0E;--ac-rgb:161,98,7;}
[data-accent="sky"]    {--ac:#0284C7;--ac-bg:rgba(2,132,199,.09);--ac-d:#0369A1;--ac-rgb:2,132,199;}

/* ── Module-specific colours (used for headers, borders) ── */
:root {
  --mod-pipeline: #0066CC; --mod-pipeline-bg: rgba(0,102,204,.08);
  --mod-contacts: #0D9488; --mod-contacts-bg: rgba(13,148,136,.08);
  --mod-calendar: #16A34A; --mod-calendar-bg: rgba(22,163,74,.08);
  --mod-finance:  #B45309; --mod-finance-bg:  rgba(180,83,9,.08);
  --mod-ai:       #7C3AED; --mod-ai-bg:       rgba(124,58,237,.08);
  --mod-library:  #4F46E5; --mod-library-bg:  rgba(79,70,229,.08);
  --mod-faith:    #A16207; --mod-faith-bg:    rgba(161,98,7,.08);
  --mod-tables:   #475569; --mod-tables-bg:   rgba(71,85,105,.08);
  --mod-products: #EA580C; --mod-products-bg: rgba(234,88,12,.08);
  --mod-files:    #0284C7; --mod-files-bg:    rgba(2,132,199,.08);
  --mod-listings:     #2563EB; --mod-listings-bg:     rgba(37,99,235,.08);
  --mod-deals:        #9333EA; --mod-deals-bg:        rgba(147,51,234,.08);
  --mod-requirements: #DB2777; --mod-requirements-bg: rgba(219,39,119,.08);
  --mod-forms:        #0891B2; --mod-forms-bg:        rgba(8,145,178,.08);
  --mod-news:         #BB1919; --mod-news-bg:         rgba(187,25,25,.08);
  --mod-places:       #15803D; --mod-places-bg:       rgba(21,128,61,.08);
  --mod-intelligence: #D97706; --mod-intelligence-bg: rgba(217,119,6,.08);
}

/* ══════════════════════════════════════════════════════════════
   3. THEMES — Light / Cream (soft light) / Dark / Charcoal (soft dark)
   :root above provides the Light defaults as a pre-JS fallback;
   [data-theme="light"] restates them explicitly for clarity.
   ══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:#F4F4F6; --surface:#FFFFFF; --surface-2:#F4F4F6;
  --surface-3:#EBEBEE; --surface-4:#DDDDE0;
  --sidebar-bg:#FAFAFA; --topbar-bg:rgba(255,255,255,.92); --scrim:rgba(0,0,0,.32);
  --t1:#111114; --t2:#38383F; --t3:#68686F; --t4:#9898A0;
  --b1:rgba(0,0,0,.07); --b2:rgba(0,0,0,.11); --b3:rgba(0,0,0,.16);
  --e1:0 1px 2px rgba(0,0,0,.05),0 0 0 1px rgba(0,0,0,.04);
  --e2:0 2px 8px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);
  --e3:0 4px 16px rgba(0,0,0,.10),0 2px 4px rgba(0,0,0,.06);
  --e4:0 8px 32px rgba(0,0,0,.13),0 4px 8px rgba(0,0,0,.07);
  --e5:0 20px 60px rgba(0,0,0,.16),0 8px 20px rgba(0,0,0,.10);
}

/* Cream — soft light: warm paper tones instead of cool gray */
[data-theme="cream"] {
  --bg:#F7F3EC; --surface:#FFFDF9; --surface-2:#F1EAE0;
  --surface-3:#E8DFD2; --surface-4:#DBCFBE;
  --sidebar-bg:#F2EBE1; --topbar-bg:rgba(247,243,236,.92); --scrim:rgba(0,0,0,.32);
  --t1:#1F1B16; --t2:#473F35; --t3:#7A6F5F; --t4:#A89C8A;
  --b1:rgba(60,40,10,.07); --b2:rgba(60,40,10,.11); --b3:rgba(60,40,10,.17);
  --e1:0 1px 2px rgba(40,25,5,.06),0 0 0 1px rgba(40,25,5,.04);
  --e2:0 2px 8px rgba(40,25,5,.09),0 1px 2px rgba(40,25,5,.05);
  --e3:0 4px 16px rgba(40,25,5,.11),0 2px 4px rgba(40,25,5,.06);
  --e4:0 8px 32px rgba(40,25,5,.14),0 4px 8px rgba(40,25,5,.08);
  --e5:0 20px 60px rgba(40,25,5,.18),0 8px 20px rgba(40,25,5,.11);
}

/* Dark — deep dark (existing) */
[data-theme="dark"] {
  --bg:#0A0A0C; --surface:#18181B; --surface-2:#222226;
  --surface-3:#2C2C32; --surface-4:#38383F;
  --sidebar-bg:#111115; --topbar-bg:rgba(16,16,20,.92); --scrim:rgba(0,0,0,.60);
  --t1:#F4F4F6; --t2:#C8C8D0; --t3:#888890; --t4:#555560;
  --b1:rgba(255,255,255,.07); --b2:rgba(255,255,255,.11); --b3:rgba(255,255,255,.16);
  --e1:0 1px 2px rgba(0,0,0,.40); --e2:0 2px 8px rgba(0,0,0,.50);
  --e3:0 4px 16px rgba(0,0,0,.60); --e4:0 8px 32px rgba(0,0,0,.70);
  --e5:0 20px 60px rgba(0,0,0,.80);
}

/* Charcoal — soft dark: lighter near-black gray, Supabase-style */
[data-theme="charcoal"] {
  --bg:#1C1C1E; --surface:#242427; --surface-2:#2A2A2E;
  --surface-3:#323237; --surface-4:#3D3D43;
  --sidebar-bg:#1F1F22; --topbar-bg:rgba(28,28,30,.92); --scrim:rgba(0,0,0,.55);
  --t1:#EDEDEF; --t2:#C4C4C8; --t3:#8E8E93; --t4:#5E5E64;
  --b1:rgba(255,255,255,.06); --b2:rgba(255,255,255,.10); --b3:rgba(255,255,255,.15);
  --e1:0 1px 2px rgba(0,0,0,.30); --e2:0 2px 8px rgba(0,0,0,.38);
  --e3:0 4px 16px rgba(0,0,0,.46); --e4:0 8px 32px rgba(0,0,0,.55);
  --e5:0 20px 60px rgba(0,0,0,.65);
}


/* ══════════════════════════════════════════════════════════════
   4. RESET & BASE
   ══════════════════════════════════════════════════════════════ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{-webkit-text-size-adjust:100%;}
body{font-family:var(--font);font-size:var(--fs-base);color:var(--t1);background:var(--bg);line-height:1.5;-webkit-font-smoothing:antialiased;overflow:hidden;height:100vh;}
a{color:var(--ac);text-decoration:none;}
button,input,select,textarea{font-family:var(--font);font-size:var(--fs-base);}
button{cursor:pointer;border:none;background:none;color:inherit;}
input:focus,select:focus,textarea:focus{outline:none;}
img{max-width:100%;}
svg{display:block;flex-shrink:0;}
::-webkit-scrollbar{width:3px;height:3px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--b3);border-radius:99px;}

/* ══════════════════════════════════════════════════════════════
   5. LAYOUT — SHELL
   Outer .shell is a column: topbar (full width, always on top),
   then .shell-body (row: sidebar + main).
   ══════════════════════════════════════════════════════════════ */
.shell{display:flex;flex-direction:column;height:100vh;overflow:hidden;}
.shell-body{display:flex;flex:1;min-height:0;overflow:hidden;}

/* ── Sidebar — three modes, controlled by .sb-mode-toggle:
   .mode-collapsed (default): icon-only, hover shows a tooltip.
   .mode-expanded: fixed wide rail with inline labels.
   .mode-hover: icon-only at rest; hovering the rail overlays an
   expanded panel with labels (content underneath doesn't reflow). ── */
.sidebar{
  width:var(--nav-w-icon);background:var(--sidebar-bg);
  border-right:1px solid var(--b1);display:flex;flex-direction:column;
  flex-shrink:0;overflow:hidden;z-index:100;position:relative;
}
.sidebar.mode-expanded{width:var(--nav-w);}
.sidebar.mode-expanded .nav-item{justify-content:flex-start;padding:9px 11px;}
.sidebar.mode-expanded .nav-icon{margin-right:8px;}
.sidebar.mode-expanded .nav-label{display:block;}

.sidebar.mode-hover{overflow:visible;}
/* While .nav-body becomes an absolute overlay below, it's removed
   from the flex flow, leaving .sb-mode-toggle as the sidebar's only
   flex child. flex-end pushes that lone item to the bottom — relying
   on .sidebar's normal (proven-working) stretched height, not on any
   absolute-positioning math. */
.sidebar.mode-hover:hover{justify-content:flex-end;}
.sidebar.mode-hover:hover .nav-body{
  position:absolute;top:0;left:0;width:var(--nav-w);height:100%;
  background:var(--sidebar-bg);border-right:1px solid var(--b1);
  box-shadow:var(--e4);z-index:250;
}
.sidebar.mode-hover:hover .nav-item{justify-content:flex-start;padding:9px 11px;}
.sidebar.mode-hover:hover .nav-icon{margin-right:8px;}
.sidebar.mode-hover:hover .nav-label{display:block;}

/* Nav body — normal flex child; flex:1 fills the space above the
   fixed-size mode toggle (see .sb-mode-toggle below). Only becomes an
   absolute overlay while actively hovering in hover-mode (rule above). */
.nav-body{flex:1;overflow-y:auto;padding:10px 0;}
.nav-cat{margin-bottom:1px;}
.cat-hd{display:flex;align-items:center;gap:5px;padding:5px 11px 3px;cursor:pointer;user-select:none;}
.cat-label{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.7px;color:var(--t4);flex:1;}
.cat-arrow{font-size:8px;color:var(--t4);transition:transform var(--t-fast);}
.nav-cat.collapsed .cat-arrow{transform:rotate(-90deg);}
.nav-cat.collapsed .cat-items{display:none;}

.nav-item{
  display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;
  border-radius:var(--r-md);margin:2px 6px;cursor:pointer;
  transition:background var(--t-fast),color var(--t-fast);
  color:var(--t3);font-size:var(--fs-sm);font-weight:500;
  position:relative;
}
.nav-item:hover{background:var(--surface-2);color:var(--t1);}
.nav-item.active{background:var(--ac-bg);color:var(--ac);}
.nav-item.active .nav-icon svg{stroke:var(--ac);}
.nav-item[data-hidden="true"]{display:none;}

.nav-icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:0;}
.nav-icon svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.nav-badge{font-size:9.5px;font-weight:700;min-width:16px;height:16px;padding:0 4px;border-radius:var(--r-full);background:var(--danger);color:#fff;display:flex;align-items:center;justify-content:center;}

/* Label — hidden in collapsed/hover-at-rest modes (text still read by
   the shared tooltip via .textContent); shown inline in expanded
   mode and inside the hover-expanded overlay (rules above). */
.nav-label{display:none;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* Sidebar bottom control — cycles collapsed / expanded / expand-on-hover.
   Fixed small square button, bottom-left, identical in all three modes.
   In-flow flex child: .nav-body{flex:1} naturally leaves room above it
   in collapsed/expanded/hover-at-rest. align-self:flex-start stops it
   stretching to the sidebar's full width (the default for column-flex
   children) — without it, this was full-width in expanded mode and
   square in collapsed mode, i.e. "different shape in each mode". While
   actively hovering in hover-mode, .nav-body leaves the flex flow
   (becomes an overlay) and justify-content:flex-end (above) keeps this
   pinned to the bottom; position:relative + z-index keeps it above the
   overlay. */
.sb-mode-toggle{
  align-self:flex-start;flex-shrink:0;
  width:36px;height:36px;margin:6px;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--r-md);border:1px solid var(--b1);cursor:pointer;
  color:var(--t3);background:var(--sidebar-bg);
  transition:background var(--t-fast),color var(--t-fast);
  position:relative;z-index:251;
}
.sb-mode-toggle:hover{background:var(--surface-2);color:var(--t1);}
.sb-mode-toggle svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}

/* ── Shared tooltip — single element appended to <body>, positioned
   via JS on mouseenter, shown instantly (no native delay), never
   clipped by ancestor overflow. ── */
.shared-tooltip{
  position:fixed;pointer-events:none;z-index:1000;
  background:var(--t1);color:var(--surface);
  padding:5px 10px;border-radius:var(--r-md);
  font-size:var(--fs-xs);font-weight:600;white-space:nowrap;
  box-shadow:var(--e2);opacity:0;transition:opacity 60ms linear;
}
.shared-tooltip.show{opacity:1;}

/* Sidebar overlay (mobile) */
.sb-overlay{display:none;position:fixed;top:var(--topbar-h);left:0;right:0;bottom:0;background:var(--scrim);z-index:150;opacity:0;transition:opacity var(--t-base);}
.sb-overlay.open{opacity:1;}

/* ── Main ── */
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;}

/* ── Topbar — full width, spans above sidebar+main, always on top.
   Left: YTROK logo (only element that opens Home) → mobile menu /
   back → breadcrumb (company is clickable, opens workspace switcher;
   module is a static label). Right: search chip, AI, Modules, Help,
   Account. ── */
.topbar{
  width:100%;height:var(--topbar-h);display:flex;align-items:center;gap:8px;padding:0 14px;
  background:var(--topbar-bg);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border-bottom:1px solid var(--b1);flex-shrink:0;z-index:700;position:relative;
}
.tb-menu{width:30px;height:30px;display:none;align-items:center;justify-content:center;border-radius:var(--r);cursor:pointer;color:var(--t3);flex-shrink:0;}
.tb-menu:hover{background:var(--surface-2);}
.tb-menu svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}
.tb-back{width:30px;height:30px;display:none;align-items:center;justify-content:center;border-radius:var(--r);cursor:pointer;color:var(--ac);flex-shrink:0;}
.tb-back.show{display:flex;}
.tb-back:hover{background:var(--ac-bg);}

/* Logo — extreme left, only element that navigates Home */
.tb-crumb-logo{display:flex;align-items:center;cursor:pointer;flex-shrink:0;line-height:1;height:26px;}

/* Breadcrumb — company (clickable, opens switcher) / module (static) */
.tb-breadcrumb{display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden;position:relative;}
.tb-crumb-sep{color:var(--t4);font-size:13px;flex-shrink:0;user-select:none;}
.tb-crumb-company{
  font-size:var(--fs-md);font-weight:700;color:var(--t2);white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;max-width:180px;cursor:pointer;padding:3px 7px;margin:-3px -7px;
  border-radius:var(--r-sm);transition:background var(--t-fast);
}
.tb-crumb-company:hover{background:var(--surface-2);color:var(--t1);}
.tb-crumb-module{font-size:var(--fs-md);font-weight:700;color:var(--t1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* Workspace/company switcher dropdown */
.tb-dropdown{
  display:none;position:absolute;top:calc(100% + 6px);left:0;min-width:220px;
  background:var(--surface);border:1px solid var(--b2);border-radius:var(--r-xl);
  box-shadow:var(--e3);padding:6px;z-index:710;
}
.tb-dropdown.open{display:block;}
.tb-dd-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:var(--r-lg);font-size:var(--fs-sm);color:var(--t2);cursor:pointer;transition:background var(--t-fast);}
.tb-dd-item:hover{background:var(--surface-2);}
.tb-dd-item.on{font-weight:700;color:var(--t1);}
.tb-dd-item svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;flex-shrink:0;}
.tb-dd-sep{height:1px;background:var(--b1);margin:4px 2px;}

.tb-spacer{flex:1;min-width:8px;}

/* Mode toggle */
.mode-toggle{display:flex;align-items:center;gap:2px;background:var(--surface-2);border-radius:var(--r-full);padding:2px;flex-shrink:0;}
.mode-btn{padding:3px 10px;border-radius:var(--r-full);font-size:10.5px;font-weight:700;color:var(--t3);cursor:pointer;transition:var(--t-fast);white-space:nowrap;}
.mode-btn.on{background:var(--surface);color:var(--t1);box-shadow:var(--e1);}
.mode-btn.on[data-mode="work"]{color:var(--mod-pipeline);}
.mode-btn.on[data-mode="personal"]{color:var(--mod-calendar);}

.add-btn{display:flex;align-items:center;gap:5px;padding:6px 13px;background:var(--ac);color:#fff;border-radius:var(--r-full);font-size:var(--fs-sm);font-weight:700;cursor:pointer;flex-shrink:0;transition:var(--t-fast);white-space:nowrap;border:none;}
.add-btn:hover{opacity:.88;transform:translateY(-1px);}
.add-btn:active{transform:translateY(0);}
.add-btn svg{width:13px;height:13px;stroke:#fff;fill:none;stroke-width:2.5;stroke-linecap:round;}

/* Search chip — pill showing a placeholder + ⌘K shortcut, Supabase-style */
.tb-search-chip{
  display:flex;align-items:center;gap:7px;padding:6px 10px 6px 9px;
  background:var(--surface-2);border:1px solid var(--b2);border-radius:var(--r-full);
  cursor:pointer;color:var(--t3);flex-shrink:0;transition:var(--t-fast);
}
.tb-search-chip:hover{background:var(--surface-3);color:var(--t1);border-color:var(--b3);}
.tb-search-chip svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;flex-shrink:0;}
.tb-search-label{font-size:var(--fs-sm);font-weight:500;white-space:nowrap;}
.tb-kbd{
  font-size:9.5px;font-weight:700;font-family:var(--font-mono);color:var(--t3);
  background:var(--surface);border:1px solid var(--b2);border-radius:var(--r-sm);
  padding:1px 5px;line-height:1.5;white-space:nowrap;
}

/* Right-side icon cluster: Search / AI / Modules / Help / Account */
.tb-actions{display:flex;align-items:center;gap:2px;flex-shrink:0;}
.tb-icon-btn{
  width:32px;height:32px;display:flex;align-items:center;justify-content:center;
  border-radius:var(--r);cursor:pointer;color:var(--t3);background:none;border:none;
  flex-shrink:0;padding:0;
}
.tb-icon-btn:hover{background:var(--surface-2);color:var(--t1);}
.tb-icon-btn svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

.tb-account-btn{
  width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  cursor:pointer;border:none;background:none;padding:0;margin-left:4px;flex-shrink:0;
}
.tb-account-btn .sb-av{width:28px;height:28px;}
.tb-account-btn:hover .sb-av{box-shadow:0 0 0 2px var(--ac-bg);}

/* Avatar circle — humanoid silhouette; also used in the profile panel */
.sb-av{width:30px;height:30px;border-radius:50%;background:var(--ac-bg);color:var(--ac);display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;transition:box-shadow var(--t-fast);}
.sb-av img{width:100%;height:100%;object-fit:cover;}

/* ── Content ── */
.content{flex:1;overflow-y:auto;overflow-x:hidden;position:relative;}
.view{display:none;animation:vFadeIn var(--t-base) ease;}
.view.active{display:block;}
@keyframes vFadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}

/* ══════════════════════════════════════════════════════════════
   6. MODULE HEADER (universal summary bar)
   ══════════════════════════════════════════════════════════════ */
.mod-header{
  display:flex;align-items:stretch;gap:0;
  background:var(--surface);border-bottom:1px solid var(--b1);
  flex-shrink:0;overflow-x:auto;
}
.mod-header::-webkit-scrollbar{display:none;}
.mh-stat{
  flex:1;min-width:100px;padding:14px 18px;
  border-right:1px solid var(--b1);cursor:default;
  transition:background var(--t-fast);
}
.mh-stat:last-child{border-right:none;}
.mh-stat:hover{background:var(--surface-2);}
.mh-val{font-size:22px;font-weight:800;letter-spacing:-.6px;line-height:1.1;color:var(--t1);}
.mh-val.accent{color:var(--ac);}
.mh-val.up{color:var(--success);}
.mh-val.down{color:var(--danger);}
.mh-val.warn{color:var(--warning);}
.mh-label{font-size:var(--fs-xs);font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--t4);margin-top:3px;}
.mh-sub{font-size:var(--fs-xs);color:var(--t3);margin-top:1px;}
.mh-change{font-size:var(--fs-xs);font-weight:700;margin-top:3px;}
.mh-change.up{color:var(--success);}
.mh-change.down{color:var(--danger);}

/* Module view body */
.mod-body{padding:16px;height:calc(100vh - var(--topbar-h) - var(--header-h));overflow-y:auto;}
.mod-body.no-header{height:calc(100vh - var(--topbar-h));padding:16px;}

/* ══════════════════════════════════════════════════════════════
   7. FORMS
   ══════════════════════════════════════════════════════════════ */
.fg{display:flex;flex-direction:column;gap:4px;margin-bottom:10px;}
.fg label{font-size:var(--fs-xs);font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--t3);display:flex;align-items:center;gap:4px;}
.fg-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.fg-hint{font-size:var(--fs-xs);color:var(--t4);line-height:1.5;margin-top:2px;}

input[type="text"],input[type="email"],input[type="password"],input[type="number"],
input[type="date"],input[type="time"],input[type="datetime-local"],input[type="tel"],
input[type="url"],input[type="search"],select,textarea{
  width:100%;padding:9px 11px;background:var(--surface-2);
  border:1.5px solid var(--b2);border-radius:var(--r-lg);
  color:var(--t1);font-size:var(--fs-sm);transition:var(--t-fast);font-family:var(--font);
}
input:focus,select:focus,textarea:focus{
  border-color:var(--ac);background:var(--surface);
  box-shadow:0 0 0 3px rgba(var(--ac-rgb),.10);
}
input::placeholder,textarea::placeholder{color:var(--t4);}
select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%2368686F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 11px center;padding-right:30px;}
textarea{resize:vertical;min-height:76px;line-height:1.6;}
input[type="checkbox"]{width:16px;height:16px;cursor:pointer;accent-color:var(--ac);}

/* Field info tooltip */
.field-tip{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;background:var(--surface-3);color:var(--t3);font-size:9px;font-weight:700;cursor:help;position:relative;}
.field-tip::after{content:attr(data-tip);position:absolute;left:18px;top:-2px;background:var(--t1);color:var(--bg);border-radius:var(--r);padding:5px 9px;font-size:var(--fs-xs);font-weight:400;z-index:99;pointer-events:none;opacity:0;white-space:normal;min-width:160px;max-width:220px;line-height:1.5;box-shadow:var(--e3);transition:opacity var(--t-fast);}
.field-tip:hover::after{opacity:1;}

/* ══════════════════════════════════════════════════════════════
   8. BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;border-radius:var(--r-full);font-weight:600;cursor:pointer;transition:var(--t-fast);border:none;white-space:nowrap;font-family:var(--font);}
.btn svg{stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.btn-primary{background:var(--ac);color:#fff;}
.btn-primary:hover{opacity:.88;}
.btn-secondary{background:var(--surface-2);color:var(--t2);border:1px solid var(--b2);}
.btn-secondary:hover{background:var(--surface-3);color:var(--t1);}
.btn-ghost{background:transparent;color:var(--t3);}
.btn-ghost:hover{background:var(--surface-2);color:var(--t1);}
.btn-danger{background:var(--danger-bg);color:var(--danger);}
.btn-danger:hover{background:var(--danger);color:#fff;}
.btn-success{background:var(--success-bg);color:var(--success);}
.btn-xs{padding:4px 10px;font-size:var(--fs-xs);}
.btn-sm{padding:6px 12px;font-size:var(--fs-xs);}
.btn-md{padding:9px 16px;font-size:var(--fs-sm);}
.btn-lg{padding:12px 22px;font-size:var(--fs-base);}
.btn:active{transform:scale(.97);}
.btn:disabled{opacity:.4;pointer-events:none;}

/* Icon button */
.icon-btn{width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--r);cursor:pointer;color:var(--t3);transition:var(--t-fast);border:none;background:none;}
.icon-btn:hover{background:var(--surface-2);color:var(--t1);}
.icon-btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}

/* Toggle switch */
.toggle{width:40px;height:22px;border-radius:var(--r-full);background:var(--surface-3);border:none;cursor:pointer;position:relative;transition:background var(--t-fast);flex-shrink:0;}
.toggle::after{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform var(--t-fast);box-shadow:0 1px 3px rgba(0,0,0,.25);}
.toggle.on{background:var(--ac);}
.toggle.on::after{transform:translateX(18px);}

/* ══════════════════════════════════════════════════════════════
   9. BADGES & CHIPS
   ══════════════════════════════════════════════════════════════ */
.badge{display:inline-flex;align-items:center;padding:2px 7px;border-radius:var(--r-full);font-size:10.5px;font-weight:600;white-space:nowrap;}
.b-gray   {background:var(--surface-3);color:var(--t3);}
.b-blue   {background:var(--info-bg);color:var(--info);}
.b-green  {background:var(--success-bg);color:var(--success);}
.b-red    {background:var(--danger-bg);color:var(--danger);}
.b-amber  {background:var(--warning-bg);color:var(--warning);}
.b-violet {background:rgba(124,58,237,.09);color:#7C3AED;}
.b-teal   {background:rgba(13,148,136,.09);color:#0D9488;}
.b-orange {background:rgba(234,88,12,.09);color:#EA580C;}
.b-gold   {background:rgba(161,98,7,.09);color:#A16207;}
.b-sky    {background:rgba(2,132,199,.09);color:#0284C7;}

.chip{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:600;border:1.5px solid transparent;cursor:pointer;transition:var(--t-fast);}
.chip:hover,.chip.on{border-color:var(--ac);background:var(--ac-bg);color:var(--ac);}

/* ══════════════════════════════════════════════════════════════
   10. CARDS
   ══════════════════════════════════════════════════════════════ */
.card{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);box-shadow:var(--e1);}
.card-p{padding:14px;}
.card-p-sm{padding:10px 12px;}

/* ══════════════════════════════════════════════════════════════
   11. MODAL
   ══════════════════════════════════════════════════════════════ */
.overlay{position:fixed;inset:0;background:var(--scrim);z-index:800;display:none;align-items:flex-end;justify-content:center;backdrop-filter:blur(4px);}
.overlay.open{display:flex;}
@media(min-width:600px){.overlay{align-items:center;padding:20px;}}
.modal{background:var(--surface);border-radius:var(--r-2xl) var(--r-2xl) 0 0;width:100%;max-height:93vh;overflow-y:auto;box-shadow:var(--e5);}
@media(min-width:600px){.modal{max-width:520px;border-radius:var(--r-2xl);animation:modalIn var(--t-spring);}}
@keyframes modalIn{from{opacity:0;transform:scale(.93)}to{opacity:1;transform:scale(1)}}
.modal-hd{display:flex;align-items:center;padding:15px 18px 12px;border-bottom:1px solid var(--b1);position:sticky;top:0;background:var(--surface);z-index:1;border-radius:var(--r-2xl) var(--r-2xl) 0 0;}
.modal-title{font-size:var(--fs-md);font-weight:700;flex:1;}
.modal-close{width:26px;height:26px;border-radius:50%;background:var(--surface-3);display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--t3);flex-shrink:0;transition:var(--t-fast);}
.modal-close:hover{background:var(--danger-bg);color:var(--danger);}
.modal-close svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2.5;stroke-linecap:round;}
.modal-body{padding:16px 18px;}
.modal-ft{display:flex;justify-content:flex-end;gap:7px;padding-top:12px;margin-top:4px;border-top:1px solid var(--b1);}

/* Right panel */
.panel{position:fixed;top:var(--topbar-h);right:0;bottom:0;width:340px;background:var(--surface);border-left:1px solid var(--b1);z-index:600;transform:translateX(100%);transition:transform var(--t-slow);overflow-y:auto;box-shadow:var(--e5);}
.panel.open{transform:translateX(0);}
.panel-hd{padding:16px;border-bottom:1px solid var(--b1);display:flex;align-items:center;gap:10px;position:sticky;top:0;background:var(--surface);z-index:1;}
.panel-title{font-size:var(--fs-md);font-weight:700;flex:1;}
.panel-close{width:26px;height:26px;border-radius:50%;background:var(--surface-3);display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--t3);}
.panel-body{padding:16px;}

/* ══════════════════════════════════════════════════════════════
   12. FILTER BAR
   ══════════════════════════════════════════════════════════════ */
.filter-bar{display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin-bottom:12px;}
.filter-pill{display:flex;align-items:center;gap:4px;padding:4px 10px;background:var(--surface-2);border:1px solid var(--b2);border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:600;color:var(--t2);cursor:pointer;transition:var(--t-fast);white-space:nowrap;}
.filter-pill:hover,.filter-pill.on{background:var(--ac-bg);border-color:var(--ac);color:var(--ac);}
.filter-search{flex:1;min-width:140px;padding:5px 11px;background:var(--surface-2);border:1px solid var(--b2);border-radius:var(--r-full);font-size:var(--fs-sm);color:var(--t1);}
.filter-search:focus{border-color:var(--ac);background:var(--surface);}

/* Section header */
.sec-hd{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;}
.sec-title{font-size:var(--fs-sm);font-weight:700;color:var(--t1);}
.sec-action{font-size:var(--fs-xs);font-weight:700;color:var(--ac);cursor:pointer;}
.sec-action:hover{opacity:.7;}

/* ══════════════════════════════════════════════════════════════
   13. TABLE
   ══════════════════════════════════════════════════════════════ */
.tbl-wrap{overflow-x:auto;border-radius:var(--r-xl);border:1px solid var(--b1);margin-bottom:12px;}
table{width:100%;border-collapse:collapse;font-size:var(--fs-sm);}
thead th{background:var(--surface-2);padding:9px 12px;text-align:left;font-size:var(--fs-xs);font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--t3);white-space:nowrap;border-bottom:1px solid var(--b1);cursor:pointer;user-select:none;}
thead th:hover{color:var(--t1);}
tbody tr{border-bottom:1px solid var(--b1);transition:background var(--t-fast);}
tbody tr:last-child{border-bottom:none;}
tbody tr:hover{background:var(--surface-2);}
tbody td{padding:9px 12px;color:var(--t2);vertical-align:middle;}
.row-actions{display:flex;gap:3px;opacity:0;transition:opacity var(--t-fast);}
tbody tr:hover .row-actions{opacity:1;}
.row-btn{padding:3px 8px;border-radius:var(--r-sm);font-size:var(--fs-xs);font-weight:600;color:var(--t3);background:var(--surface-2);border:1px solid var(--b2);cursor:pointer;transition:var(--t-fast);}
.row-btn:hover{background:var(--surface-3);color:var(--t1);}
.row-btn.act:hover{background:var(--ac-bg);color:var(--ac);border-color:var(--ac);}
.row-btn.del:hover{background:var(--danger-bg);color:var(--danger);border-color:transparent;}

/* ══════════════════════════════════════════════════════════════
   14. PIPELINE — KANBAN
   ══════════════════════════════════════════════════════════════ */
.kanban-wrap{overflow-x:auto;padding-bottom:8px;}
.kanban{display:flex;gap:9px;min-width:max-content;}
.k-col{width:220px;min-width:220px;background:var(--surface-2);border-radius:var(--r-xl);padding:10px;flex-shrink:0;transition:background var(--t-fast);}
.k-col.drop-over{background:var(--ac-bg);border:2px dashed var(--ac);}
.k-col-hd{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:0 2px;}
.k-col-name{font-size:var(--fs-xs);font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--t3);}
.k-col-meta{display:flex;align-items:center;gap:5px;}
.k-col-count{font-size:var(--fs-xs);font-weight:700;background:var(--surface-3);color:var(--t3);padding:2px 6px;border-radius:var(--r-full);}

/* Pipeline card — thin left border, no bg colour */
.k-card{
  background:var(--surface);border-radius:var(--r-lg);
  padding:10px 12px;margin-bottom:5px;
  border:1px solid var(--b1);border-left:3px solid;
  cursor:grab;transition:box-shadow var(--t-fast),transform var(--t-fast);
}
.k-card:hover{box-shadow:var(--e3);transform:translateY(-2px);}
.k-card.dragging{opacity:.45;cursor:grabbing;}
.k-card-name{font-size:var(--fs-sm);font-weight:700;color:var(--t1);margin-bottom:2px;}
.k-card-co{font-size:var(--fs-xs);color:var(--t3);margin-bottom:5px;}
.k-card-val{font-size:var(--fs-sm);font-weight:800;color:inherit;letter-spacing:-.3px;}
.k-card-next{font-size:var(--fs-xs);color:var(--t3);margin-top:5px;padding-top:5px;border-top:1px solid var(--b1);}
.k-card-actions{display:flex;gap:3px;margin-top:7px;opacity:0;transition:opacity var(--t-fast);}
.k-card:hover .k-card-actions{opacity:1;}
.k-add{width:100%;background:none;border:1.5px dashed var(--b2);border-radius:var(--r-lg);padding:7px;font-size:var(--fs-xs);color:var(--t3);cursor:pointer;margin-top:4px;transition:var(--t-fast);}
.k-add:hover{border-color:var(--ac);color:var(--ac);}

/* Stage colours for card left border */
.stage-new        {border-left-color:var(--t4);}
.stage-contacted  {border-left-color:var(--info);}
.stage-qualified  {border-left-color:var(--mod-contacts);}
.stage-proposal   {border-left-color:#7C3AED;}
.stage-negotiation{border-left-color:var(--warning);}
.stage-won        {border-left-color:var(--success);}
.stage-lost       {border-left-color:var(--danger);}

/* ══════════════════════════════════════════════════════════════
   15. CONTACTS
   ══════════════════════════════════════════════════════════════ */
.contacts-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(188px,1fr));gap:9px;}
.contact-card{background:var(--surface);border-radius:var(--r-xl);padding:14px;border:1px solid var(--b1);position:relative;transition:box-shadow var(--t-fast),transform var(--t-fast);cursor:pointer;}
.contact-card:hover{box-shadow:var(--e2);transform:translateY(-2px);}
.cc-menu{position:absolute;top:9px;right:9px;width:24px;height:24px;border-radius:var(--r-sm);background:var(--surface-2);display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--t-fast);cursor:pointer;color:var(--t3);}
.contact-card:hover .cc-menu{opacity:1;}
.cc-menu:hover{background:var(--ac-bg);color:var(--ac);}
.cc-av{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;margin-bottom:9px;}
.cc-name{font-size:var(--fs-sm);font-weight:700;color:var(--t1);margin-bottom:1px;}
.cc-co{font-size:var(--fs-xs);color:var(--t3);margin-bottom:6px;}
.cc-row{font-size:var(--fs-xs);color:var(--t3);margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* Last interaction indicator */
.last-interaction{font-size:10px;font-weight:600;margin-top:7px;padding-top:7px;border-top:1px solid var(--b1);}
.li-ok    {color:var(--t4);}
.li-warn  {color:var(--warning);}
.li-stale {color:var(--danger);}

.cc-actions{display:flex;gap:4px;margin-top:8px;}
.cc-action{flex:1;padding:5px;background:var(--surface-2);border-radius:var(--r-sm);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background var(--t-fast);}
.cc-action:hover{background:var(--ac-bg);}
.cc-action svg{width:13px;height:13px;stroke:var(--t3);fill:none;stroke-width:2;stroke-linecap:round;}
.cc-action:hover svg{stroke:var(--ac);}

/* ══════════════════════════════════════════════════════════════
   16. CALENDAR
   ══════════════════════════════════════════════════════════════ */
/* Agenda strip — persistent, always shows today */
.agenda-strip{
  background:var(--surface);border-bottom:1px solid var(--b1);
  padding:10px 14px;overflow-x:auto;display:flex;align-items:stretch;gap:6px;flex-shrink:0;
}
.agenda-strip::-webkit-scrollbar{display:none;}
.agenda-empty{font-size:var(--fs-xs);color:var(--t4);display:flex;align-items:center;padding:0 4px;}
.agenda-event{
  display:flex;align-items:center;gap:6px;padding:5px 10px;
  border-radius:var(--r-lg);border-left:3px solid;background:var(--surface-2);
  cursor:pointer;transition:var(--t-fast);white-space:nowrap;flex-shrink:0;
}
.agenda-event:hover{box-shadow:var(--e1);}
.agenda-evt-time{font-size:10px;font-weight:700;font-family:var(--font-mono);color:var(--t3);}
.agenda-evt-name{font-size:var(--fs-xs);font-weight:600;color:var(--t1);}

/* Cal grid */
.cal-view-tabs{display:flex;gap:3px;background:var(--surface-2);border-radius:var(--r-full);padding:3px;margin-bottom:12px;}
.cvt{flex:1;padding:5px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:700;text-align:center;cursor:pointer;transition:var(--t-fast);color:var(--t3);}
.cvt.on{background:var(--surface);color:var(--t1);box-shadow:var(--e1);}
.cal-nav{display:flex;align-items:center;gap:7px;margin-bottom:11px;}
.cal-nav-label{font-size:var(--fs-md);font-weight:700;flex:1;}

.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;}
.cal-dn{text-align:center;font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--t4);padding:5px 0;}
.cal-day{height:80px;overflow:hidden;background:var(--surface);border-radius:var(--r-sm);padding:4px;cursor:pointer;transition:background var(--t-fast);border:1px solid transparent;display:flex;flex-direction:column;}
.cal-day:hover{background:var(--surface-2);border-color:var(--b2);}
.cal-day.today{border-color:var(--ac);background:var(--ac-bg);}
.cal-day.other-month{background:transparent;opacity:.4;cursor:default;}
.cal-day-num{font-size:var(--fs-xs);font-weight:600;color:var(--t3);margin-bottom:2px;padding:0 2px;flex-shrink:0;}
.cal-day.today .cal-day-num{color:var(--ac);font-weight:800;}
.cal-day .cal-evt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;}
.cal-evt{font-size:9px;font-weight:600;border-radius:3px;padding:1px 4px;margin-bottom:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;}
/* Calendar category colours */
.cat-work     {background:rgba(0,102,204,.12);color:var(--mod-pipeline);}
.cat-personal {background:rgba(22,163,74,.12);color:var(--mod-calendar);}
.cat-health   {background:rgba(217,48,37,.12);color:var(--danger);}
.cat-faith    {background:rgba(161,98,7,.12);color:var(--mod-faith);}
.cat-family   {background:rgba(180,83,9,.12);color:var(--mod-finance);}

/* ══════════════════════════════════════════════════════════════
   17. FINANCE
   ══════════════════════════════════════════════════════════════ */
/* Summary bar — always visible */
.fin-summary{
  display:flex;align-items:stretch;background:var(--surface);
  border-bottom:1px solid var(--b1);flex-shrink:0;
}
.fin-stat{flex:1;padding:13px 16px;border-right:1px solid var(--b1);}
.fin-stat:last-child{border-right:none;}
.fin-stat-val{font-size:20px;font-weight:800;letter-spacing:-.5px;}
.fin-stat-label{font-size:var(--fs-xs);font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--t4);margin-top:2px;}
.fin-stat.income .fin-stat-val{color:var(--success);}
.fin-stat.expense .fin-stat-val{color:var(--danger);}
.fin-stat.net .fin-stat-val{color:var(--t1);}

/* Finance bar chart */
.fin-chart{display:flex;align-items:flex-end;gap:5px;height:60px;margin-top:4px;}
.fin-bar-group{flex:1;display:flex;align-items:flex-end;gap:2px;}
.fin-bar{border-radius:3px 3px 0 0;min-height:2px;transition:height .5s ease;}
.fin-bar.inc{background:var(--success);}
.fin-bar.exp{background:var(--danger);}
.fin-chart-labels{display:flex;gap:5px;margin-top:4px;}
.fin-chart-label{flex:1;font-size:9px;text-align:center;color:var(--t4);}

/* Invoice */
.invoice-card{
  background:var(--surface);border-radius:var(--r-xl);
  border:1px solid var(--b1);border-left:3px solid;
  padding:13px 15px;margin-bottom:7px;transition:box-shadow var(--t-fast);
}
.invoice-card:hover{box-shadow:var(--e2);}
.invoice-card.paid     {border-left-color:var(--success);}
.invoice-card.sent     {border-left-color:var(--info);}
.invoice-card.draft    {border-left-color:var(--t4);}
.invoice-card.overdue  {border-left-color:var(--danger);}
.invoice-hd{display:flex;align-items:center;gap:10px;}
.invoice-num{font-size:var(--fs-xs);font-weight:700;color:var(--t3);}
.invoice-client{font-size:var(--fs-sm);font-weight:700;color:var(--t1);flex:1;}
.invoice-amount{font-size:var(--fs-md);font-weight:800;letter-spacing:-.3px;}
.invoice-meta{font-size:var(--fs-xs);color:var(--t3);margin-top:5px;display:flex;gap:12px;}

/* ══════════════════════════════════════════════════════════════
   18. LIBRARY (Notes + Knowledge)
   ══════════════════════════════════════════════════════════════ */
.lib-tabs{display:flex;gap:3px;background:var(--surface-2);border-radius:var(--r-full);padding:3px;margin-bottom:12px;}
.lib-tab{flex:1;padding:5px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:700;text-align:center;cursor:pointer;transition:var(--t-fast);color:var(--t3);}
.lib-tab.on{background:var(--surface);color:var(--t1);box-shadow:var(--e1);}

/* Note cards */
.notes-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;}
.note-card{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);border-left:3px solid var(--mod-library);padding:13px;cursor:pointer;transition:box-shadow var(--t-fast),transform var(--t-fast);position:relative;}
.note-card:hover{box-shadow:var(--e2);transform:translateY(-2px);}
.note-card-pin{position:absolute;top:9px;right:9px;cursor:pointer;color:var(--t4);transition:var(--t-fast);}
.note-card-pin:hover,.note-card-pin.on{color:var(--ac);}
.note-card-pin svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}
.note-card-title{font-size:var(--fs-sm);font-weight:700;color:var(--t1);margin-bottom:5px;}
.note-card-body{font-size:var(--fs-xs);color:var(--t3);line-height:1.6;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;}
.note-card-meta{font-size:10px;color:var(--t4);margin-top:8px;display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.note-reminder{display:inline-flex;align-items:center;gap:3px;font-size:9.5px;font-weight:700;color:var(--warning);}

/* Note editor */
.note-editor-wrap{max-width:720px;margin:0 auto;}
.note-editor-title{width:100%;font-size:22px;font-weight:800;letter-spacing:-.5px;background:none;border:none;color:var(--t1);padding:0 0 10px;border-bottom:1px solid var(--b1);margin-bottom:10px;}
.note-editor-body{width:100%;background:none;border:none;color:var(--t1);font-size:var(--fs-base);line-height:1.8;resize:none;min-height:280px;padding:0;font-family:var(--font);}
.note-editor-body:focus,.note-editor-title:focus{outline:none;}
.note-toolbar{display:flex;align-items:center;gap:4px;padding:6px 0;margin-bottom:8px;flex-wrap:wrap;border-bottom:1px solid var(--b1);}
.note-tool{padding:4px 9px;border-radius:var(--r-sm);font-size:var(--fs-xs);font-weight:600;background:var(--surface-2);border:1px solid var(--b2);color:var(--t2);cursor:pointer;transition:var(--t-fast);}
.note-tool:hover{background:var(--ac-bg);color:var(--ac);border-color:var(--ac);}
.note-colour-dot{width:16px;height:16px;border-radius:50%;cursor:pointer;transition:transform var(--t-fast);}
.note-colour-dot:hover{transform:scale(1.2);}
.note-colour-dot.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px currentColor;}

/* Library items */
.lib-item{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--b1);cursor:pointer;transition:background var(--t-fast);}
.lib-item:last-child{border-bottom:none;}
.lib-item:hover .lib-item-title{color:var(--ac);}
.lib-item-icon{width:34px;height:34px;border-radius:var(--r-lg);background:var(--surface-2);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.lib-item-icon svg{width:16px;height:16px;stroke:var(--t3);fill:none;stroke-width:1.8;stroke-linecap:round;}
.lib-item-body{flex:1;min-width:0;}
.lib-item-title{font-size:var(--fs-sm);font-weight:600;color:var(--t1);transition:color var(--t-fast);}
.lib-item-sub{font-size:var(--fs-xs);color:var(--t3);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* ══════════════════════════════════════════════════════════════
   19. FAITH — multi-faith
   ══════════════════════════════════════════════════════════════ */
.faith-selector{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px;margin-bottom:16px;}
.faith-opt{background:var(--surface);border-radius:var(--r-xl);border:2px solid var(--b2);padding:14px 10px;cursor:pointer;transition:var(--t-fast);text-align:center;}
.faith-opt:hover,.faith-opt.on{border-color:var(--mod-faith);background:var(--mod-faith-bg);}
.faith-opt-icon{font-size:24px;margin-bottom:6px;}
.faith-opt-name{font-size:var(--fs-xs);font-weight:700;color:var(--t1);}

/* Prayer times grid */
.prayer-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-bottom:12px;}
.prayer-card{background:var(--surface-2);border-radius:var(--r-lg);padding:10px 6px;text-align:center;border:1.5px solid transparent;transition:var(--t-fast);}
.prayer-card.next{background:var(--mod-faith-bg);border-color:var(--mod-faith);}
.prayer-name{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.3px;color:var(--t3);margin-bottom:4px;}
.prayer-card.next .prayer-name{color:var(--mod-faith);}
.prayer-time{font-size:var(--fs-sm);font-weight:800;font-family:var(--font-mono);}
.prayer-done-btn{margin-top:5px;cursor:pointer;font-size:13px;}
.prayer-countdown{font-size:9px;color:var(--mod-faith);font-weight:700;margin-top:3px;}

/* Dhikr counter */
.dhikr-counter{display:flex;align-items:center;gap:16px;padding:14px;}
.dhikr-btn{width:76px;height:76px;border-radius:50%;background:var(--mod-faith-bg);border:2px solid var(--mod-faith);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:24px;font-weight:800;color:var(--mod-faith);user-select:none;transition:transform var(--t-fast),background var(--t-fast);}
.dhikr-btn:active{transform:scale(.92);background:var(--mod-faith);color:#fff;}
.dhikr-total{font-size:32px;font-weight:800;letter-spacing:-1px;}
.dhikr-label{font-size:var(--fs-xs);color:var(--t3);}

/* Holy text */
.holy-text{font-size:18px;line-height:2;color:var(--t1);text-align:right;direction:rtl;padding:14px;background:var(--surface-2);border-radius:var(--r-xl);margin-bottom:10px;font-family:serif;}
.holy-transliteration{font-size:var(--fs-sm);font-style:italic;color:var(--t3);margin-bottom:6px;}
.holy-translation{font-size:var(--fs-sm);color:var(--t2);line-height:1.7;}

/* ══════════════════════════════════════════════════════════════
   20. CUSTOM TABLES
   ══════════════════════════════════════════════════════════════ */
.tables-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:9px;margin-bottom:14px;}
.table-list-card{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);padding:14px;cursor:pointer;transition:box-shadow var(--t-fast),transform var(--t-fast);}
.table-list-card:hover{box-shadow:var(--e2);transform:translateY(-2px);}
.tlc-icon{width:36px;height:36px;border-radius:var(--r-lg);background:var(--mod-tables-bg);display:flex;align-items:center;justify-content:center;margin-bottom:9px;}
.tlc-icon svg{width:17px;height:17px;stroke:var(--mod-tables);fill:none;stroke-width:1.8;stroke-linecap:round;}
.tlc-name{font-size:var(--fs-sm);font-weight:700;color:var(--t1);margin-bottom:3px;}
.tlc-meta{font-size:var(--fs-xs);color:var(--t3);}
.tlc-cols{display:flex;gap:4px;margin-top:8px;flex-wrap:wrap;}
.tlc-col{font-size:9.5px;background:var(--surface-3);color:var(--t3);padding:2px 6px;border-radius:var(--r-full);}

/* Column type icons in table header */
.col-type-icon{display:inline-flex;align-items:center;margin-right:4px;opacity:.6;}
.col-type-icon svg{width:11px;height:11px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}

/* Table builder */
.tb-field{display:flex;align-items:center;gap:7px;padding:9px;background:var(--surface-2);border-radius:var(--r-lg);margin-bottom:5px;border:1px solid var(--b1);}
.tbf-grip{color:var(--t4);cursor:grab;flex-shrink:0;}
.tbf-grip svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.8;}
.tbf-name{flex:1;min-width:0;}
.tbf-type{width:110px;flex-shrink:0;}
.tbf-del{cursor:pointer;color:var(--danger);padding:3px;flex-shrink:0;}
.tbf-del svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}
.add-col-btn{width:100%;padding:9px;border:1.5px dashed var(--b2);border-radius:var(--r-lg);background:none;font-size:var(--fs-xs);color:var(--t3);cursor:pointer;transition:var(--t-fast);margin-bottom:12px;}
.add-col-btn:hover{border-color:var(--ac);color:var(--ac);}

/* ══════════════════════════════════════════════════════════════
   21. PRODUCTS
   ══════════════════════════════════════════════════════════════ */
.products-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:9px;}
.product-card{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);overflow:hidden;cursor:pointer;transition:box-shadow var(--t-fast),transform var(--t-fast);}
.product-card:hover{box-shadow:var(--e2);transform:translateY(-2px);}
.product-img{height:72px;background:var(--surface-2);display:flex;align-items:center;justify-content:center;border-bottom:1px solid var(--b1);}
.product-img svg{width:28px;height:28px;stroke:var(--t4);fill:none;stroke-width:1.5;stroke-linecap:round;}
.product-body{padding:10px 12px;}
.product-name{font-size:var(--fs-sm);font-weight:700;color:var(--t1);margin-bottom:2px;}
.product-price{font-size:var(--fs-sm);font-weight:800;color:var(--mod-products);}
.product-unit{font-size:var(--fs-xs);font-weight:400;color:var(--t3);}
.product-sku{font-size:var(--fs-xs);color:var(--t4);margin-top:3px;}

/* Product detail tabs */
.prod-tabs{display:flex;gap:0;border-bottom:1px solid var(--b1);margin-bottom:14px;}
.prod-tab{padding:8px 14px;font-size:var(--fs-xs);font-weight:700;color:var(--t3);cursor:pointer;border-bottom:2px solid transparent;transition:var(--t-fast);}
.prod-tab.on{color:var(--ac);border-bottom-color:var(--ac);}

/* ══════════════════════════════════════════════════════════════
   22. FILES
   ══════════════════════════════════════════════════════════════ */
.files-layout{display:grid;grid-template-columns:180px 1fr;gap:10px;height:calc(100vh - var(--topbar-h) - var(--header-h) - 32px);}
.files-tree{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);overflow-y:auto;padding:8px;}
.tree-folder{display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:var(--r-md);cursor:pointer;transition:background var(--t-fast);font-size:var(--fs-sm);color:var(--t2);}
.tree-folder:hover{background:var(--surface-2);}
.tree-folder.on{background:var(--ac-bg);color:var(--ac);font-weight:600;}
.tree-folder svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;flex-shrink:0;}
.tree-add{width:100%;padding:6px 8px;border:1.5px dashed var(--b2);border-radius:var(--r-md);background:none;font-size:var(--fs-xs);color:var(--t3);cursor:pointer;text-align:left;margin-top:4px;transition:var(--t-fast);}
.tree-add:hover{border-color:var(--ac);color:var(--ac);}

.files-main{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);overflow:hidden;display:flex;flex-direction:column;}
.files-toolbar{padding:10px 12px;border-bottom:1px solid var(--b1);display:flex;align-items:center;gap:8px;}

/* Drop zone */
.drop-zone{border:2px dashed var(--b2);border-radius:var(--r-xl);padding:24px;text-align:center;cursor:pointer;transition:var(--t-fast);margin-bottom:10px;}
.drop-zone:hover,.drop-zone.over{border-color:var(--ac);background:var(--ac-bg);}
.dz-icon{width:40px;height:40px;border-radius:var(--r-xl);background:var(--surface-2);display:flex;align-items:center;justify-content:center;margin:0 auto 10px;}
.dz-icon svg{width:20px;height:20px;stroke:var(--t3);fill:none;stroke-width:1.8;stroke-linecap:round;}
.dz-title{font-size:var(--fs-sm);font-weight:700;color:var(--t2);margin-bottom:3px;}
.dz-sub{font-size:var(--fs-xs);color:var(--t3);}

/* File items */
.file-row{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--b1);transition:background var(--t-fast);}
.file-row:last-child{border-bottom:none;}
.file-row:hover{background:var(--surface-2);}
.file-type-icon{width:32px;height:32px;border-radius:var(--r-lg);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.file-type-icon svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;}
.file-info{flex:1;min-width:0;}
.file-name{font-size:var(--fs-sm);font-weight:600;color:var(--t1);}
.file-meta{font-size:var(--fs-xs);color:var(--t3);margin-top:1px;}
/* Contextual attach tags */
.file-contexts{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;}
.file-ctx-tag{font-size:9.5px;font-weight:600;color:var(--t3);background:var(--surface-3);padding:1px 7px;border-radius:var(--r-full);}
.file-actions{display:flex;gap:4px;flex-shrink:0;}

/* ══════════════════════════════════════════════════════════════
   23. AI AGENT
   ══════════════════════════════════════════════════════════════ */
/* Context chips */
.ai-conv-sidebar{width:200px;flex-shrink:0;border-right:1px solid var(--b1);background:var(--surface-2);display:flex;flex-direction:column;overflow:hidden;}
.ai-conv-sidebar @media(max-width:680px){position:absolute;z-index:100;top:0;left:0;bottom:0;width:80%;max-width:260px;box-shadow:var(--e3);}
.ai-context-bar{display:flex;gap:5px;flex-wrap:wrap;padding:9px 14px;background:var(--surface);border-bottom:1px solid var(--b1);flex-shrink:0;align-items:center;}
.ai-ctx-chip{display:flex;align-items:center;gap:4px;padding:3px 9px;border-radius:var(--r-full);background:var(--surface-2);border:1px solid var(--b2);font-size:var(--fs-xs);font-weight:600;color:var(--t2);cursor:default;}
.ai-ctx-chip svg{width:11px;height:11px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}

/* Provider bar */
.ai-provider-bar{display:flex;align-items:center;gap:5px;padding:7px 14px;background:var(--surface-2);border-bottom:1px solid var(--b1);flex-shrink:0;overflow-x:auto;}
.ai-provider-bar::-webkit-scrollbar{display:none;}
.ai-prov-btn{display:flex;align-items:center;gap:5px;padding:4px 11px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:700;color:var(--t3);cursor:pointer;transition:var(--t-fast);background:none;border:1px solid transparent;}
.ai-prov-btn.on{background:var(--surface);color:var(--t1);border-color:var(--b2);box-shadow:var(--e1);}
.ai-prov-logo{width:14px;height:14px;border-radius:3px;overflow:hidden;flex-shrink:0;}

/* Chat area */
.ai-messages{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;}
.ai-msg{max-width:82%;}
.ai-msg-user{align-self:flex-end;background:var(--ac);color:#fff;border-radius:var(--r-xl) var(--r-xl) var(--r-sm) var(--r-xl);padding:10px 14px;font-size:var(--fs-sm);}
.ai-msg-ai{align-self:flex-start;background:var(--surface-2);color:var(--t1);border-radius:var(--r-xl) var(--r-xl) var(--r-xl) var(--r-sm);padding:10px 14px;font-size:var(--fs-sm);border:1px solid var(--b1);max-width:88%;line-height:1.7;}
.ai-msg-ai p{margin-bottom:6px;}
.ai-msg-ai p:last-child{margin-bottom:0;}
.ai-msg-ai strong{font-weight:700;}

/* Suggestions */
.ai-suggestions{display:flex;flex-wrap:wrap;gap:5px;padding:0 14px 10px;flex-shrink:0;}
.ai-sug{padding:5px 11px;background:var(--surface);border:1px solid var(--b2);border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:500;color:var(--t2);cursor:pointer;transition:var(--t-fast);}
.ai-sug:hover{border-color:var(--ac);color:var(--ac);background:var(--ac-bg);}

/* Input bar */
.ai-input-bar{display:flex;gap:5px;align-items:flex-end;padding:10px 14px;border-top:1px solid var(--b1);background:var(--surface);flex-shrink:0;}
.ai-textarea{flex:1;background:var(--surface-2);border:1.5px solid var(--b2);border-radius:var(--r-xl);padding:8px 11px;font-size:var(--fs-sm);color:var(--t1);resize:none;max-height:120px;line-height:1.5;font-family:var(--font);}
.ai-textarea:focus{border-color:var(--ac);background:var(--surface);box-shadow:0 0 0 3px rgba(var(--ac-rgb),.08);}
.ai-send{width:34px;height:34px;border-radius:var(--r-lg);background:var(--ac);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;border:none;}
.ai-send svg{width:14px;height:14px;stroke:#fff;fill:none;stroke-width:2.5;stroke-linecap:round;}

/* ══════════════════════════════════════════════════════════════
   24. HOME CANVAS
   ══════════════════════════════════════════════════════════════ */
.home-fixed{flex-shrink:0;padding:12px 14px 10px;border-bottom:1px solid var(--b1);background:var(--topbar-bg);backdrop-filter:blur(20px);}
.home-scroll{flex:1;overflow-y:auto;padding:10px 14px 80px;}
.home-greeting{font-size:var(--fs-xl);font-weight:800;letter-spacing:-.4px;color:var(--t1);margin-bottom:2px;}
.home-date{font-size:var(--fs-xs);font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--t4);margin-bottom:4px;}
.ai-brief-compact{display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:var(--r-lg);background:color-mix(in srgb,var(--ac) 7%,transparent);border:1px solid color-mix(in srgb,var(--ac) 15%,transparent);cursor:pointer;transition:var(--t-fast);margin-bottom:10px;}
.ai-brief-compact:hover{border-color:color-mix(in srgb,var(--ac) 30%,transparent);}
.ai-brief-compact-text{flex:1;font-size:var(--fs-xs);color:var(--t2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.ai-brief{background:linear-gradient(135deg,var(--ac-bg),transparent);border-radius:var(--r-lg);padding:11px 13px;cursor:pointer;border:1px solid rgba(var(--ac-rgb),.14);transition:var(--t-fast);margin-top:10px;}
.ai-brief:hover{border-color:rgba(var(--ac-rgb),.28);}
.ai-brief-label{display:flex;align-items:center;gap:5px;font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--ac);margin-bottom:5px;}
.home-quick-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;}
.home-qa-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px 4px;border-radius:var(--r-lg);border:1px solid var(--b1);background:var(--surface);cursor:pointer;transition:var(--t-fast);color:var(--t2);}
.home-qa-btn:hover{border-color:var(--ac);color:var(--ac);background:var(--ac-bg);}
.home-qa-btn:active{transform:scale(.95);}
.home-qa-btn svg{stroke:currentColor;}
.home-qa-btn span{font-size:9px;font-weight:700;text-align:center;line-height:1.2;}
.ai-pulse{width:6px;height:6px;border-radius:50%;background:var(--ac);animation:aip 1.6s ease-in-out infinite;}
@keyframes aip{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}}
.ai-brief-text{font-size:var(--fs-sm);color:var(--t2);line-height:1.6;}
.ai-brief-cta{font-size:var(--fs-xs);color:var(--ac);font-weight:600;margin-top:7px;display:block;}

/* Widget canvas */
.w-canvas{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;}
@media(max-width:640px){.w-canvas{grid-template-columns:repeat(2,1fr);}}
@media(max-width:400px){.w-canvas{grid-template-columns:1fr;}}

.w-card{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);box-shadow:var(--e1);overflow:hidden;transition:var(--t-base);position:relative;min-height:90px;}
.w-cols-1{grid-column:span 1;}
.w-cols-2{grid-column:span 2;}
.w-cols-3{grid-column:span 3;}
@media(max-width:640px){.w-cols-3{grid-column:span 2;}}
.w-card-hd{display:flex;align-items:center;justify-content:space-between;padding:10px 12px 0;}
.w-card-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--t4);}
.w-view-all{font-size:10px;font-weight:700;color:var(--ac);cursor:pointer;}
.w-card-body{padding:9px 12px 12px;}
.w-canvas.edit .w-card{cursor:grab;border-style:dashed;border-color:var(--b2);}
.w-canvas.edit .w-card:hover{border-color:var(--ac);}
.w-size-btns{display:flex;gap:2px;}
.w-size-btn{width:20px;height:20px;border-radius:4px;background:var(--surface-2);border:1px solid var(--b2);font-size:9.5px;font-weight:700;color:var(--t3);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:var(--t-fast);}
.w-size-btn.on{background:var(--ac-bg);border-color:var(--ac);color:var(--ac);}
.w-remove-btn{width:20px;height:20px;border-radius:4px;background:var(--danger-bg);display:flex;align-items:center;justify-content:center;cursor:pointer;margin-left:3px;}
.w-remove-btn svg{width:10px;height:10px;stroke:var(--danger);fill:none;stroke-width:2.5;stroke-linecap:round;}
.w-card.dragging{opacity:.4;cursor:grabbing;}
.w-card.drag-over{border-color:var(--ac);background:var(--ac-bg);}
.edit-layout-btn{display:flex;align-items:center;gap:4px;font-size:var(--fs-xs);font-weight:700;color:var(--t3);padding:5px 7px;border-radius:var(--r-full);background:var(--surface-2);border:1px solid var(--b2);cursor:pointer;transition:var(--t-fast);}
.edit-layout-btn:hover,.edit-layout-btn.on{color:var(--ac);border-color:var(--ac);background:var(--ac-bg);}
.edit-layout-btn svg{width:11px;height:11px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}

/* ══════════════════════════════════════════════════════════════
   25. FAB
   ══════════════════════════════════════════════════════════════ */
.fab{display:none;}
.fab:hover{transform:scale(1.08);}
.fab:active{transform:scale(.95);}
.fab svg{width:20px;height:20px;stroke:#fff;fill:none;stroke-width:2;stroke-linecap:round;}
.fab-ring{display:none;}/* ring removed — caused oval flash on mobile */
@keyframes fabr{0%,100%{opacity:0;transform:scale(1)}55%{opacity:.28;transform:scale(1.1)}}

.fab-card{position:fixed;top:calc(var(--topbar-h) + 8px);right:14px;bottom:auto;left:auto;width:300px;max-height:calc(100vh - var(--topbar-h) - 24px);background:var(--surface);border-radius:var(--r-2xl);box-shadow:var(--e5);border:1px solid var(--b2);z-index:499;display:none;overflow:hidden;}
.fab-card.open{display:block;animation:fabIn var(--t-spring);}
@keyframes fabIn{from{opacity:0;transform:scale(.84) translateY(18px)}to{opacity:1;transform:scale(1) translateY(0)}}
.fab-card-hd{padding:11px 14px 8px;display:flex;align-items:center;gap:7px;border-bottom:1px solid var(--b1);}
.fab-card-title{font-size:var(--fs-sm);font-weight:700;flex:1;}
.fab-import-btn{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:var(--r-md);color:var(--t3);cursor:pointer;transition:var(--t-fast);}
.fab-import-btn:hover{background:var(--surface-2);color:var(--ac);}
.fab-expand{font-size:11px;color:var(--ac);cursor:pointer;font-weight:600;}
.fab-close-btn{font-size:15px;color:var(--t3);cursor:pointer;}
.fab-sugs{padding:7px;display:flex;flex-direction:column;gap:2px;}
.fab-sug{padding:6px 9px;border-radius:var(--r);font-size:var(--fs-xs);color:var(--t2);cursor:pointer;transition:background var(--t-fast);}
.fab-sug:hover{background:var(--ac-bg);color:var(--ac);}
.fab-input-row{padding:7px;border-top:1px solid var(--b1);display:flex;gap:5px;align-items:center;}
.fab-input{flex:1;padding:7px 10px;background:var(--surface-2);border:1px solid var(--b2);border-radius:var(--r-full);font-size:var(--fs-sm);color:var(--t1);}
.fab-send{width:28px;height:28px;border-radius:50%;background:var(--ac);display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;}
.fab-send svg{width:12px;height:12px;stroke:#fff;fill:none;stroke-width:2.5;stroke-linecap:round;}

/* ══════════════════════════════════════════════════════════════
   26. SEARCH OVERLAY
   ══════════════════════════════════════════════════════════════ */
.search-overlay{position:fixed;inset:0;background:var(--scrim);z-index:600;display:none;align-items:flex-start;justify-content:center;padding:8vh 16px;backdrop-filter:blur(8px);}
.search-overlay.open{display:flex;}
.search-box{width:100%;max-width:min(720px,92vw);max-height:80vh;display:flex;flex-direction:column;background:var(--surface);border-radius:var(--r-2xl);box-shadow:var(--e5);overflow:hidden;animation:modalIn var(--t-spring);}
.search-top{display:flex;align-items:center;gap:9px;padding:13px 14px;border-bottom:1px solid var(--b1);flex-shrink:0;}
.search-icon svg{width:16px;height:16px;stroke:var(--t3);fill:none;stroke-width:2;stroke-linecap:round;}
.search-input{flex:1;background:none;border:none;font-size:var(--fs-md);color:var(--t1);font-weight:500;}
.search-input::placeholder{color:var(--t4);}
.search-sources{display:flex;gap:4px;padding:7px 14px;border-bottom:1px solid var(--b1);overflow-x:auto;flex-shrink:0;}
.search-sources::-webkit-scrollbar{display:none;}
.s-source{display:flex;align-items:center;gap:4px;padding:3px 9px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:700;color:var(--t3);cursor:pointer;transition:var(--t-fast);background:var(--surface-2);border:1.5px solid transparent;white-space:nowrap;}
.s-source.on{border-color:var(--ac);background:var(--ac-bg);color:var(--ac);}
.search-results{flex:1;overflow-y:auto;min-height:240px;}
.sr-group-label{padding:5px 14px;font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--t4);}
.sr-item{display:flex;align-items:center;gap:9px;padding:9px 14px;cursor:pointer;transition:background var(--t-fast);}
.sr-item:hover{background:var(--surface-2);}
.sr-icon{width:30px;height:30px;border-radius:var(--r-lg);background:var(--surface-2);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.sr-icon svg{width:14px;height:14px;stroke:var(--t3);fill:none;stroke-width:2;stroke-linecap:round;}
.sr-title{font-size:var(--fs-sm);font-weight:600;color:var(--t1);}
.sr-sub{font-size:var(--fs-xs);color:var(--t3);}

/* ══════════════════════════════════════════════════════════════
   27. AUTH
   ══════════════════════════════════════════════════════════════ */
.auth-screen{position:fixed;inset:0;background:var(--bg);z-index:9999;display:flex;align-items:flex-start;justify-content:center;padding:20px;overflow-y:auto;-webkit-overflow-scrolling:touch;}
.auth-card{background:var(--surface);border-radius:var(--r-2xl);padding:36px 30px;width:100%;max-width:348px;box-shadow:var(--e5);border:1px solid var(--b1);margin:auto;}
.auth-logo{font-size:26px;font-weight:800;letter-spacing:-1px;color:var(--logo-light) !important;text-align:center;margin-bottom:3px;}
.auth-logo em{color:var(--logo-accent) !important;font-style:normal;}
.auth-tagline{font-size:var(--fs-xs);color:var(--t3);text-align:center;margin-bottom:24px;letter-spacing:.3px;}
.auth-tabs{display:flex;background:var(--surface-2);border-radius:var(--r-lg);padding:3px;margin-bottom:18px;}
.auth-tab{flex:1;padding:7px;border-radius:var(--r);font-size:var(--fs-sm);font-weight:600;color:var(--t3);text-align:center;cursor:pointer;transition:var(--t-fast);}
.auth-tab.on{background:var(--surface);color:var(--t1);box-shadow:var(--e1);}
.auth-divider{display:flex;align-items:center;gap:9px;margin:14px 0;color:var(--t4);font-size:var(--fs-xs);}
.auth-divider::before,.auth-divider::after{content:'';flex:1;height:1px;background:var(--b1);}
.auth-demo{width:100%;padding:11px;background:var(--surface-2);border:1px solid var(--b2);border-radius:var(--r-lg);font-size:var(--fs-sm);font-weight:600;color:var(--t2);cursor:pointer;transition:var(--t-fast);text-align:center;}
.auth-demo:hover{background:var(--surface-3);color:var(--t1);}
.auth-err{background:var(--danger-bg);color:var(--danger);border-radius:var(--r);padding:9px 11px;font-size:var(--fs-sm);display:none;margin-bottom:11px;}
.auth-err.show{display:block;}
.auth-theme-btn{position:absolute;top:18px;right:18px;width:34px;height:34px;border-radius:50%;background:var(--surface);border:1px solid var(--b2);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:var(--e1);}
.auth-submit{width:100%;padding:12px;background:var(--ac);color:#fff;border-radius:var(--r-xl);font-size:var(--fs-base);font-weight:700;cursor:pointer;transition:var(--t-fast);border:none;}
.auth-submit:hover{opacity:.88;transform:translateY(-1px);}
.auth-link{display:block;text-align:center;margin-top:10px;color:var(--t3);font-size:var(--fs-xs);cursor:pointer;}
.auth-link:hover{color:var(--t1);}

/* ══════════════════════════════════════════════════════════════
   28. ONBOARDING
   ══════════════════════════════════════════════════════════════ */
.ob-screen{position:fixed;inset:0;background:var(--bg);z-index:9998;display:none;overflow-y:auto;}
.ob-skip:hover{color:var(--t1);}
.ob-faith-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px;margin-bottom:24px;}
.ob-faith-opt{background:var(--surface);border:2px solid var(--b2);border-radius:var(--r-xl);padding:14px 10px;cursor:pointer;transition:var(--t-fast);text-align:center;}
.ob-faith-opt:hover,.ob-faith-opt.on{border-color:var(--mod-faith);background:var(--mod-faith-bg);}
.ob-faith-icon{font-size:24px;margin-bottom:7px;}
.ob-faith-name{font-size:var(--fs-xs);font-weight:700;color:var(--t1);}

/* ══════════════════════════════════════════════════════════════
   29. TOUR
   ══════════════════════════════════════════════════════════════ */
.tour-overlay{position:fixed;inset:0;background:transparent;z-index:2000;display:none;pointer-events:none;}
.tour-overlay.open{display:block;}
.tour-spot{position:absolute;border-radius:var(--r-xl);box-shadow:0 0 0 9999px rgba(0,0,0,.58),0 0 0 1px var(--ac),0 0 0 5px var(--ac-bg);pointer-events:none;transition:all var(--t-slow);}
.tour-tip{position:fixed;background:var(--surface);border-radius:var(--r-2xl);box-shadow:var(--e5);border:1px solid var(--b2);padding:18px 20px 15px;max-width:320px;z-index:2001;pointer-events:all;animation:modalIn var(--t-spring);}
.tour-tag{display:inline-flex;align-items:center;font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.7px;color:var(--ac);background:var(--ac-bg);border-radius:var(--r-full);padding:3px 9px;margin-bottom:9px;}
.tour-title{font-size:var(--fs-lg);font-weight:800;letter-spacing:-.2px;margin-bottom:6px;color:var(--t1);}
.tour-text{font-size:var(--fs-sm);color:var(--t2);line-height:1.65;margin-bottom:15px;}
.tour-ft{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.tour-skip{font-size:var(--fs-xs);color:var(--t4);cursor:pointer;font-weight:600;transition:color var(--t-fast);}
.tour-skip:hover{color:var(--t1);}
.tour-dots{display:flex;gap:4px;}
.tour-dot{width:5px;height:5px;border-radius:50%;background:var(--surface-3);transition:var(--t-fast);}
.tour-dot.on{background:var(--ac);width:16px;border-radius:var(--r-full);}

/* ══════════════════════════════════════════════════════════════
   30. MODULE STORE
   ══════════════════════════════════════════════════════════════ */
.mod-store-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:9px;margin-bottom:16px;}
.mod-card{background:var(--surface);border-radius:var(--r-xl);border:1.5px solid var(--b1);padding:14px;transition:var(--t-fast);}
.mod-card.enabled{border-color:var(--ac);background:var(--ac-bg);}

/* Compact module row — used in the right-panel Modules quick list */
.mod-mini-row{display:flex;align-items:center;gap:10px;padding:8px 4px;border-bottom:1px solid var(--b1);}
.mod-mini-row:last-child{border-bottom:none;}
.mod-mini-icon{width:30px;height:30px;border-radius:var(--r-lg);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.mod-mini-icon svg{width:15px;height:15px;}
.mod-mini-name{flex:1;font-size:var(--fs-sm);font-weight:600;color:var(--t1);}
.mod-card-hd{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:9px;}
.mod-card-icon{width:34px;height:34px;border-radius:var(--r-lg);display:flex;align-items:center;justify-content:center;}
.mod-card-icon svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.mod-card-name{font-size:var(--fs-sm);font-weight:700;color:var(--t1);margin-bottom:2px;}
.mod-card-desc{font-size:var(--fs-xs);color:var(--t3);line-height:1.5;}
.mod-card-foot{margin-top:9px;display:flex;align-items:center;justify-content:space-between;}
.mod-mode-badge{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;padding:2px 6px;border-radius:var(--r-full);}
.mmb-work    {background:var(--info-bg);color:var(--info);}
.mmb-personal{background:var(--success-bg);color:var(--success);}
.mmb-both    {background:var(--surface-3);color:var(--t3);}

/* ══════════════════════════════════════════════════════════════
   31. SETTINGS
   ══════════════════════════════════════════════════════════════ */
.settings-group{background:var(--surface);border-radius:var(--r-xl);border:1px solid var(--b1);overflow:hidden;margin-bottom:10px;}
.settings-group-label{padding:10px 14px 7px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--t4);border-bottom:1px solid var(--b1);}

/* ── Documentation prose ── */
.docs-body{font-size:var(--fs-md);color:var(--t2);line-height:1.7;}
.docs-body p{margin-bottom:12px;}
.docs-body ul{margin:0 0 14px;padding-left:22px;}
.docs-body li{margin-bottom:7px;}
.docs-body strong{color:var(--t1);font-weight:700;}
.docs-body em{color:var(--t3);}
.docs-body code,.docs-body kbd{background:var(--surface-2);border:1px solid var(--b2);border-radius:var(--r-sm);padding:1px 6px;font-size:0.9em;font-family:var(--font-mono);color:var(--t2);}
.settings-row{display:flex;align-items:center;padding:12px 14px;border-bottom:1px solid var(--b1);cursor:pointer;transition:background var(--t-fast);}
.settings-row:last-child{border-bottom:none;}
.settings-row:hover{background:var(--surface-2);}
.settings-row .sr-icon{width:32px;height:32px;border-radius:var(--r-lg);display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:11px;}
.settings-row .sr-icon svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;}
.sr-body{flex:1;min-width:0;}
.sr-label{font-size:var(--fs-sm);font-weight:600;color:var(--t1);}
.sr-sub{font-size:var(--fs-xs);color:var(--t3);margin-top:1px;}
.sr-arrow{color:var(--t3);font-size:16px;margin-left:8px;flex-shrink:0;}

/* ══════════════════════════════════════════════════════════════
   32. EMPTY STATES
   ══════════════════════════════════════════════════════════════ */
.empty{text-align:center;padding:40px 20px;}
.empty-icon{width:52px;height:52px;border-radius:var(--r-xl);background:var(--surface-2);display:flex;align-items:center;justify-content:center;margin:0 auto 12px;}
.empty-icon svg{width:24px;height:24px;stroke:var(--t4);fill:none;stroke-width:1.5;stroke-linecap:round;}
.empty-title{font-size:var(--fs-md);font-weight:700;color:var(--t2);margin-bottom:5px;}
.empty-sub{font-size:var(--fs-sm);color:var(--t3);line-height:1.6;max-width:240px;margin:0 auto 16px;}

/* ══════════════════════════════════════════════════════════════
   33. TOAST
   ══════════════════════════════════════════════════════════════ */
.toast{position:fixed;bottom:82px;left:50%;transform:translateX(-50%) translateY(16px);background:var(--t1);color:var(--bg);padding:9px 16px;border-radius:var(--r-full);font-size:var(--fs-sm);font-weight:600;z-index:2000;opacity:0;transition:all var(--t-base);pointer-events:none;white-space:nowrap;max-width:calc(100vw - 32px);box-shadow:var(--e4);}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}

/* ══════════════════════════════════════════════════════════════
   34. UTILITIES
   ══════════════════════════════════════════════════════════════ */
.divider{height:1px;background:var(--b1);margin:10px 0;}
.progress-bar{height:4px;background:var(--surface-3);border-radius:var(--r-full);overflow:hidden;}
.progress-fill{height:100%;border-radius:var(--r-full);background:var(--ac);transition:width .5s ease;}
@keyframes spin{to{transform:rotate(360deg)}}
.spin{animation:spin 1s linear infinite;}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.pulse{animation:pulse 1.5s ease-in-out infinite;}
.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ══════════════════════════════════════════════════════════════
   35. RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media(max-width:680px){
  :root{--nav-w:260px;}
  .sidebar{position:fixed;left:calc(-1 * var(--nav-w));top:var(--topbar-h);bottom:0;z-index:200;
    width:var(--nav-w);transition:left var(--t-slow);}
  .sidebar.open{left:0;}
  .sb-overlay{display:block;pointer-events:none;}
  .sb-overlay.open{pointer-events:all;}
  .tb-menu{display:flex;}

  /* Mobile sidebar overlay: full-width with inline labels, no hover tooltips */
  .sidebar .nav-item{justify-content:flex-start;padding:9px 12px;}
  .sidebar .nav-icon{margin-right:10px;}
  .sidebar .nav-label{display:block;}

  /* Breadcrumb: shrink company name, tighten icon cluster */
  .tb-crumb-company{max-width:70px;}
  .tb-actions{gap:0;}
  .tb-icon-btn{width:28px;height:28px;}

  /* Search chip collapses to icon-only on narrow screens */
  .tb-search-chip{padding:6px;}
  .tb-search-label,.tb-kbd{display:none;}

  .mode-toggle .mode-btn{padding:3px 7px;font-size:9.5px;}
  .files-layout{grid-template-columns:1fr;}
  .files-tree{display:none;}
  .fg-row{grid-template-columns:1fr;}
  .ob-personas{grid-template-columns:repeat(2,1fr);}
  .fab{display:none;}
  .fab-card{left:0;right:0;bottom:0;width:100%;border-radius:var(--r-2xl) var(--r-2xl) 0 0;border-left:1px solid var(--b2);}
  .prayer-grid{grid-template-columns:repeat(3,1fr);}
}

/* ══════════════════════════════════════════════════════════════
   v6.1 PATCH — View-specific flex layouts (CSS, not inline)
   Prevents blank screen issues when navigate() clears cssText
   ══════════════════════════════════════════════════════════════ */
#view-home.active,
#view-ai.active,
#view-news.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   v6.1 PATCH — Map view
   ══════════════════════════════════════════════════════════════ */
.map-container { width:100%; height:100%; min-height:400px; border-radius:var(--r-xl); overflow:hidden; position:relative; }
.map-view-wrap { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.map-toolbar { display:flex; align-items:center; gap:8px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--b1); flex-shrink:0; flex-wrap:wrap; }
.map-pin-popup { min-width:160px; font-family:var(--font); }
.map-pin-popup .mp-name { font-size:13px; font-weight:700; margin-bottom:3px; }
.map-pin-popup .mp-sub  { font-size:11px; color:#555; margin-bottom:7px; }
.map-pin-popup .mp-btn  { display:inline-block; padding:4px 10px; background:#0066CC; color:#fff; border-radius:99px; font-size:11px; font-weight:600; cursor:pointer; text-decoration:none; }

/* Location search dropdown */
.loc-results { position:absolute; left:0; right:0; top:100%; background:var(--surface); border:1px solid var(--b2); border-radius:var(--r-lg); box-shadow:var(--e3); z-index:999; max-height:200px; overflow-y:auto; margin-top:2px; }
.loc-result  { padding:8px 12px; cursor:pointer; font-size:var(--fs-sm); border-bottom:1px solid var(--b1); }
.loc-result:last-child { border-bottom:none; }
.loc-result:hover { background:var(--ac-bg); color:var(--ac); }

/* ══════════════════════════════════════════════════════════════
   v6.1 PATCH — Tables kanban + filter
   ══════════════════════════════════════════════════════════════ */
.tbl-filter-bar { display:flex; gap:6px; flex-wrap:wrap; padding:8px 14px; background:var(--surface-2); border-bottom:1px solid var(--b1); }
.tbl-kanban { display:flex; gap:9px; overflow-x:auto; padding:12px 14px 80px; min-height:300px; }
.tbl-k-col  { min-width:200px; background:var(--surface-2); border-radius:var(--r-xl); padding:9px; flex-shrink:0; }
.tbl-k-col-hd { font-size:var(--fs-xs); font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--t3); padding:2px 4px; margin-bottom:7px; }
.tbl-k-card { background:var(--surface); border-radius:var(--r-lg); border:1px solid var(--b1); padding:10px 11px; margin-bottom:6px; cursor:pointer; transition:box-shadow var(--t-fast); }
.tbl-k-card:hover { box-shadow:var(--e2); }
.tbl-k-add  { width:100%; padding:6px; border:1.5px dashed var(--b2); border-radius:var(--r-lg); background:none; font-size:var(--fs-xs); color:var(--t3); cursor:pointer; margin-top:4px; transition:var(--t-fast); }
.tbl-k-add:hover { border-color:var(--ac); color:var(--ac); }

/* ══ WORKSPACE CARD ══ */
.ws-card{display:flex;align-items:center;gap:9px;padding:10px 11px;background:var(--surface);border:1px solid var(--b1);border-radius:var(--r-xl);cursor:pointer;transition:var(--t-fast);user-select:none;}
.ws-card:hover{border-color:var(--ac);background:var(--ac-bg);}
.ws-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;}
.ws-card-body{flex:1;min-width:0;}
.ws-card-name{font-size:var(--fs-sm);font-weight:700;color:var(--t1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ws-card-sub{font-size:9.5px;color:var(--t4);}
.ws-card-arrow{flex-shrink:0;transition:transform .2s;}
.ws-dropdown{position:absolute;top:calc(100% + 4px);left:10px;right:10px;background:var(--surface);border:1px solid var(--b2);border-radius:var(--r-xl);box-shadow:var(--e2);z-index:500;padding:4px;}
.ws-dd-item{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:var(--r-lg);font-size:var(--fs-sm);cursor:pointer;color:var(--t2);transition:var(--t-fast);}
.ws-dd-item:hover{background:var(--surface-2);}
.ws-dd-item.on{font-weight:700;color:var(--t1);}
.ws-dd-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}

/* ══ WORKSPACE MODULE CHIPS ══ */
.ws-mod-chip{padding:4px 10px;font-size:11px;font-weight:600;border:1.5px solid var(--b2);border-radius:var(--r-full);background:var(--surface);color:var(--t3);cursor:pointer;transition:var(--t-fast);}
.ws-mod-chip.on{border-color:var(--ac);background:var(--ac-bg);color:var(--ac);}
.ws-accent-opt.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px currentColor;}

/* ══ UNIVERSAL LINKS ENGINE STYLES ══ */
.lm-item{transition:var(--t-fast);}
.lm-item:hover{background:var(--surface-2);}
.lm-item.on{background:var(--ac-bg);}
.ct-tab{border-bottom:2px solid transparent;white-space:nowrap;}

/* ══ CALENDAR DRAG & DROP ══ */
.cal-day.cal-drag-target { background: var(--ac-bg) !important; outline: 2px dashed var(--ac); outline-offset: -2px; }
.cal-day.cal-drag-target * { pointer-events: none; }
.cal-evt { cursor: grab; }
.cal-evt:active { cursor: grabbing; }

/* ══ LEAFLET MAP — MINIMIZED ATTRIBUTION ══
   Attribution text can't be removed entirely (required by CARTO's free
   tile usage terms) but it's shrunk to the smallest practical size —
   it's a compliance footnote, not something users need to read. ══ */
.leaflet-control-attribution {
  font-size: 7px !important;
  line-height: 1 !important;
  padding: 0 3px !important;
  background: rgba(255,255,255,.55) !important;
  opacity: .65;
}
.leaflet-control-attribution a { color: inherit !important; }
.leaflet-control-attribution svg { display: none !important; }

/* Leaflet's internal layers (tile/marker/popup panes, zoom controls)
   use z-index values up to ~1000 by default — high enough to render
   above the sidebar's hover-expand overlay, the topbar, and other app
   chrome when a map is open. Rather than raising those elements to
   compete (which would then conflict with modals/panels/dropdowns,
   several of which already sit below 1000 in this app's z-index
   scale), this traps Leaflet's whole stacking context AT THE MAP'S
   OWN BOUNDARY: .leaflet-container becomes its own stacking context,
   so everything inside it — no matter what z-index Leaflet assigns
   internally — can never escape above sibling page elements. */
.leaflet-container {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE UX PASS — 2026-06-24
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Topbar: increase BASE height on mobile, show FAB ── */
@media(max-width:680px){
  /* Override the base height so icons get 54px + the safe area on top */
  :root{ --topbar-base: 54px; --topbar-h: calc(54px + env(safe-area-inset-top, 0px)); }
  .topbar{ padding: 0 10px; gap: 4px; }
  .tb-icon-btn{ width: 36px; height: 36px; }
  .tb-icon-btn svg{ width: 18px; height: 18px; }
  .tb-account-btn{ width: 36px; height: 36px; }
  .tb-menu{ width: 36px; height: 36px; }
  .tb-actions{ gap: 1px; }
  .tb-crumb-logo{ height: 24px; }
  .tb-crumb-sep{ font-size: 11px; }
  .tb-crumb-company{ max-width: 60px; font-size: 11px; }
  .tb-crumb-module{ font-size: 12px; }
  /* Always hide topbar add button — module headers handle it */
  #addBtn{ display: none !important; }
  /* Show FAB as mobile add action */
  .fab{
    display: flex !important;
    width: var(--fab-size) !important;
    height: var(--fab-size) !important;
    min-width: var(--fab-size) !important;
    min-height: var(--fab-size) !important;
    border-radius: 50% !important;
  }
}

/* ── 2. Pipeline stats: 2×2 grid, no label overflow ── */
@media(max-width:680px){
  .mod-header{
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow-x: visible;
  }
  .mh-stat{
    min-width: 0;
    padding: 11px 12px;
    border-right: 1px solid var(--b1);
    border-bottom: 1px solid var(--b1);
  }
  .mh-stat:nth-child(2n){ border-right: none; }
  .mh-stat:nth-last-child(-n+2){ border-bottom: none; }
  .mh-stat:last-child{ border-right: none; }
  .mh-val{ font-size: 18px; }
  .mh-label{ font-size: 9px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ── 3. Kanban: reliable touch scroll ── */
@media(max-width:680px){
  .kanban-wrap{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 12px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .k-col{ width: 200px; min-width: 200px; }
}

/* ── 4. Listings filter bar: button cluster wraps ── */
@media(max-width:680px){
  .filter-bar{ gap: 6px; }
  .filter-bar > div[style*="margin-left:auto"],
  .filter-bar > div[style*="margin-left: auto"]{
    margin-left: 0 !important;
    width: 100%;
    flex-wrap: wrap;
    gap: 5px;
  }
  .filter-bar .btn-sm{ font-size: 10px; padding: 4px 8px; }
}

/* ── 5. Calendar month: fixed cell height, truncate events ── */
@media(max-width:680px){
  .cal-day{ height: 70px; }
  .cal-dn{ font-size: 8px; padding: 3px 0; }
  .cal-day-num{ font-size: 9px; }
  .cal-evt{ font-size: 8px !important; padding: 1px 3px !important; }
  .cal-day-slot{ min-height: 44px; height: 44px; overflow: hidden; }
  .cal-week-slot{ min-height: 38px; height: 38px; overflow: hidden; }
}

/* ── 6. Settings: horizontal tab strip on mobile ── */
@media(max-width:680px){
  .settings-layout{
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    min-height: calc(100vh - var(--topbar-h));
  }
  .settings-nav-sidebar{
    width: 100% !important;
    flex-shrink: 0 !important;
    padding: 8px 10px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--b1) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    -webkit-overflow-scrolling: touch;
  }
  .settings-nav-sidebar > div{
    flex-shrink: 0 !important;
    padding: 5px 12px !important;
    border-radius: var(--r-full) !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    margin-bottom: 0 !important;
  }
  #settingsContent{
    padding: 14px 14px 80px !important;
    overflow-y: auto;
    flex: 1;
  }
}

/* ── 7. Home: tighter spacing, quick actions responsive ── */
@media(max-width:680px){
  .home-fixed{ padding: 10px 14px 8px; }
  .w-canvas{ gap: 7px; }
  .home-quick-actions{ gap: 5px; }
  .home-qa-btn{ padding: 7px 3px; }
  .home-qa-btn span{ font-size: 8px; }
}
