﻿/* ═══════════════════════════════════════════════════════════════
   Project Brain Design System - Global Token File
   Single source of truth for all CSS custom properties.
   Load this FIRST before any page-specific stylesheet.
   ═══════════════════════════════════════════════════════════════ */

/*
Global CSS cleanup notes:
- Midnight blue (#191970) remains the primary brand color.
- Shared layout primitives live here first; page CSS should only add feature-specific overrides.
- Sidebar styles are intentionally left untouched in this cleanup pass.
*/

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === TOKENS === */
:root {
    /* ── Brand / Primary (Midnight Blue - #191970) ── */
    --color-primary:       #191970;
    --color-primary-dark:  #0f0f4d;
    --color-primary-light: #3535a8;
    --color-accent:        #191970;
    --color-accent-dark:   #0f0f4d;

    /* ── Dark surfaces (sidebar, dark sections) ── */
    --color-dark-900: #0d0e1f;
    --color-dark-800: #14152b;
    --color-dark-700: #1c1d38;
    --color-dark-600: #2b2c52;

    /* ── Light surfaces ── */
    --color-surface:  #ffffff;
    --color-page-bg:  #f4f4f9;
    --color-card:     #ffffff;
    --color-surface-secondary: #f9f9fc;

    /* ── Text ── */
    --color-text:       rgba(13, 14, 31, 0.95);
    --color-text-sec:   #4a4a72;
    --color-text-muted: #9898b8;
    --color-text-inv:   #ffffff;

    /* ── Borders ── */
    --color-border:    rgba(25, 25, 112, 0.14);
    --color-border-lt: rgba(25, 25, 112, 0.08);

    /* ── Feedback ── */
    --color-success: #1aae39;
    --color-error:   #cf202f;
    --color-warning: #dd5b00;

    /* ── Group colors ── */
    --color-group-red:    #cf202f;
    --color-group-green:  #00d395;
    --color-group-blue:   #191970;
    --color-group-purple: #6b45c2;
    --color-group-gold:   #f0ad4e;
    --color-group-aqua:   #0591c2;

    /* ── AI Features ── */
    --color-ai:           #3535a8;
    --color-ai-light:     rgba(25, 25, 112, 0.12);
    --gradient-ai:        linear-gradient(135deg, #191970 0%, #3535a8 100%);

    /* ── Dashboard palette ── */
    --color-dashboard-ink-900: #0d0e1f;
    --color-dashboard-ink-700: #14152b;
    --color-dashboard-ink: #191970;
    --color-dashboard-bg-top: #f4f4f9;
    --color-dashboard-bg-bottom: #eeeef6;
    --color-dashboard-warm: #191970;
    --color-dashboard-hero-start: #0f0f4d;
    --color-dashboard-hero-mid: #191970;
    --color-dashboard-hero-end: #5555cc;
    --color-dashboard-hero-highlight: #e0e0f5;
    --color-dashboard-hero-glow: #c8c8eb;
    --color-dashboard-hero-button-hover: #f4f4fb;
    --gradient-dashboard-hero: linear-gradient(135deg, var(--color-dashboard-hero-start) 0%, var(--color-dashboard-hero-mid) 52%, var(--color-dashboard-hero-end) 100%);

    /* ── Spacing Scale (4px base) ── */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-6:  24px;
    --space-8:  32px;
    --space-12: 48px;
    --space-16: 64px;

    /* ── Shadows ── */
    --shadow-xs:   0 1px 2px rgba(15, 15, 77, 0.05);
    --shadow-sm:   0 1px 3px rgba(15, 15, 77, 0.08), 0 1px 2px rgba(15, 15, 77, 0.04);
    --shadow-md:   0 8px 18px rgba(15, 15, 77, 0.08), 0 2px 6px rgba(15, 15, 77, 0.04);
    --shadow-lg:   0 18px 40px rgba(15, 15, 77, 0.1), 0 6px 16px rgba(15, 15, 77, 0.06);
    --shadow-xl:   0 24px 60px rgba(15, 15, 77, 0.14), 0 10px 24px rgba(15, 15, 77, 0.08);
    --shadow-glow: 0 0 0 2px rgba(25, 25, 112, 0.22);

    /* ── Border Radii (Coinbase scale) ── */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-2xl:  24px;
    --radius-pill: 9999px;
    --radius-full: 100000px;

    /* ── Typography (Inter - closest to Coinbase Sans/Text) ── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* ── Transitions ── */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
    --transition: 0.2s ease;

    /* ── Sidebar widths ── */
    --sidebar-w:           240px;
    --sidebar-w-collapsed: 64px;

    /* ── Responsive breakpoints ── */
    --bp-xl: 1200px;
    --bp-lg: 1024px;
    --bp-md: 768px;
    --bp-sm: 480px;
    --bp-xs: 375px;

    /* ── Sidebar light tokens ── */
    --sb-bg:            #ffffff;
    --sb-bg-hover:      rgba(25, 25, 112, 0.06);
    --sb-bg-active:     rgba(25, 25, 112, 0.10);
    --sb-border:        rgba(0, 0, 0, 0.08);
    --sb-text:          #64748b;
    --sb-text-active:   #191970;
    --sb-text-hover:    #1e293b;
    --sb-accent:        #191970;
    --sb-accent-glow:   rgba(25, 25, 112, 0.25);
    --sb-section-label: #94a3b8;
    --sb-logo-grad:     linear-gradient(135deg, #191970 0%, #3535a8 100%);

    /* ── Primary alpha variants ── */
    --color-primary-alpha-30: rgba(25, 25, 112, 0.30);
    --color-primary-alpha-20: rgba(25, 25, 112, 0.20);
    --color-primary-alpha-12: rgba(25, 25, 112, 0.12);
    --color-primary-alpha-10: rgba(25, 25, 112, 0.10);
    --color-primary-alpha-08: rgba(25, 25, 112, 0.08);
    --color-primary-alpha-07: rgba(25, 25, 112, 0.07);
    --color-primary-alpha-06: rgba(25, 25, 112, 0.06);
    --color-primary-alpha-05: rgba(25, 25, 112, 0.05);
    --color-primary-alpha-04: rgba(25, 25, 112, 0.04);

    /* ── Error (ef4444 - Tailwind red-500 variant used in many components) ── */
    --color-danger:          #ef4444;
    --color-danger-alpha-70: rgba(239, 68, 68, 0.70);
    --color-danger-alpha-50: rgba(239, 68, 68, 0.50);
    --color-danger-alpha-25: rgba(239, 68, 68, 0.25);
    --color-danger-alpha-20: rgba(239, 68, 68, 0.20);
    --color-danger-alpha-15: rgba(239, 68, 68, 0.15);
    --color-danger-alpha-12: rgba(239, 68, 68, 0.12);
    --color-danger-alpha-10: rgba(239, 68, 68, 0.10);
    --color-danger-alpha-08: rgba(239, 68, 68, 0.08);
    --color-danger-alpha-06: rgba(239, 68, 68, 0.06);
    --color-danger-alpha-05: rgba(239, 68, 68, 0.05);
    --color-danger-hover:    #b91c1c;

    /* ── Error (cf202f - brand error) alpha variants ── */
    --color-error-alpha-18:  rgba(207, 32, 47, 0.18);    --color-error-alpha-10:  rgba(207, 32, 47, 0.10);
    --color-error-alpha-08:  rgba(207, 32, 47, 0.08);
    --color-error-alpha-04:  rgba(207, 32, 47, 0.04);
    --color-error-bg:        #fee2e2;
    --color-error-dark:      #b91c1c;
    --color-error-deep:      #991b1b;

    /* ── Success extended ── */
    --color-success-alpha-18: rgba(16, 185, 129, 0.18);
    --color-success-alpha-10: rgba(16, 185, 129, 0.10);
    --color-success-alpha-08: rgba(16, 185, 129, 0.08);
    --color-success-bg:       #d1fae5;
    --color-success-dark:     #059669;
    --color-success-darker:   #047857;
    --color-success-deep:     #065f46;

    /* ── Warning extended ── */
    --color-warning-alpha-08: rgba(221, 91, 0, 0.08);
    --color-warning-dark:     #b45309;
    --color-warning-bg:       #fef3c7;
    /* ── Flat page backgrounds ── */
    --color-page-bg-flat:     #f7f7fb;

    /* ── Neutral (gray) palette ── */
    --color-neutral-50:  #f9fafb;
    --color-neutral-100: #f3f4f6;
    --color-neutral-200: #e5e7eb;
    --color-neutral-300: #d1d5db;
    --color-neutral-400: #9ca3af;
    --color-neutral-500: #6b7280;
    --color-neutral-600: #4b5563;
    --color-neutral-700: #374151;
    --color-neutral-900: #111827;

    /* ── Slate palette (used in meetings/board UI) ── */
    --color-slate-50:  #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    /* ── Ink (near-black palette for home/auth dark sections) ── */
    --color-ink-900:       #0a0b0d;
    --color-ink-800:       #1a1b1f;
    --color-ink-500:       #5b616e;
    --color-ink-400:       #8a919e;
    --color-ink-surface:   #eef0f3;
    --color-ink-alpha-30:  rgba(91,97,110,0.30);
    --color-ink-alpha-20:  rgba(91,97,110,0.20);
    --color-ink-alpha-14:  rgba(91,97,110,0.14);
    --color-ink-alpha-12:  rgba(91,97,110,0.12);
    --color-ink-alpha-10:  rgba(91,97,110,0.10);

    /* ── Blue (meetings accent, document icons) ── */
    --color-blue:            #0052ff;
    --color-blue-600:        #1d4ed8;
    --color-blue-700:        #1e3a8a;
    --color-blue-light:      #eef4ff;
    --color-blue-50:         #eff6ff;
    --color-blue-border:     rgba(25, 25, 112, 0.25);
    --color-blue-alpha-22:   rgba(59,130,246,0.22);
    --color-blue-alpha-13:   rgba(59,130,246,0.13);
    --color-blue-alpha-08:   rgba(59, 130, 246, 0.08);

    /* ── Teal / Cyan palette (entry type badges, feature gradients) ── */
    --color-cyan:              #06b6d4;
    --color-teal-bg-blue:      #e7f1fb;
    --color-teal-text-blue:    #0057ab;
    --color-teal-entry-bg:     #e6f5f8;
    --color-teal-entry-text:   #0f5f75;
    --color-teal-entry-bg-2:   #e5f2f5;
    --color-teal-entry-text-2: #155e75;
    --color-teal-500-alpha-20: rgba(8,145,178,0.20);
    --color-teal-700-alpha-18: rgba(14,116,144,0.18);
    --color-teal-700-alpha-11: rgba(14,116,144,0.11);
    --color-avatar-teal-bg:    #ccfbf1;
    --color-avatar-teal-text:  #0f766e;

    /* ── Violet (memory AI section accents) ── */
    --color-violet-alpha-20:   rgba(139,92,246,0.20);
    --color-violet-alpha-18:   rgba(139,92,246,0.18);
    --color-violet-alpha-16:   rgba(139,92,246,0.16);
    --color-violet-alpha-10:   rgba(139,92,246,0.10);

    /* ── Rose (overdue / deleted entry status) ── */
    --color-rose-500:          #f43f5e;
    --color-rose-800:          #9f1239;
    --color-rose-50:           #fff1f2;
    --color-rose-alpha-24:     rgba(244,63,94,0.24);
    --color-rose-alpha-14:     rgba(244,63,94,0.14);

    /* ── Orange status badge ── */
    --color-orange-800:        #9a3412;
    --color-orange-alpha-24:   rgba(249,115,22,0.24);
    --color-orange-alpha-14:   rgba(249,115,22,0.14);

    /* ── Amber / Yellow extended ── */
    --color-amber-700:         #854d0e;
    --color-yellow-alpha-25:   rgba(234,179,8,0.25);
    --color-yellow-alpha-16:   rgba(234,179,8,0.16);

    /* ── Pink (insight badge text) ── */
    --color-pink-700:          #be185d;

    /* ── Primary extended ── */
    --color-primary-alpha-15:  rgba(25,25,112,0.15);
    --color-primary-hover:     #141478;

    /* ── Purple entry badge bg ── */
    --color-purple-entry-bg:   #eee7fb;

    /* ── Purple (AI badge, highlights) ── */
    --color-purple-500:       #a855f7;
    --color-purple-alpha-08:  rgba(162, 93, 220, 0.08);
    --color-purple-light-bg:  #e0e7ff;
    --color-purple-text:      #3535a8;
    --color-purple-deep:      #5b21b6;

    /* ── Warm neutral (memory/studio parchment surfaces) ── */
    --color-warm-100: #f3f1ee;
    --color-warm-200: #e8e5e0;
    --color-warm-muted: #615d59;

    /* ── Role badge colors ── */
    --color-role-owner:     #059669;
    --color-role-owner-bg:  rgba(16, 185, 129, 0.10);
    --color-role-admin:     #191970;
    --color-role-admin-bg:  rgba(25, 25, 112, 0.10);
    --color-role-member:    #6b7280;
    --color-role-member-bg: rgba(156, 163, 175, 0.08);

    /* ── Document type accent colors ── */
    --color-doc-pdf:      #cf202f;
    --color-doc-docx:     #578bfa;
    --color-doc-txt:      #00d395;
    --color-doc-markdown: #a25edc;
    --color-doc-audio:    #f0ad4e;
    --color-doc-folder:   #4285f4;
    --color-doc-unknown:  #8a919e;

    /* ── Integration brand colors ── */
    --color-gdrive:          #4285f4;
    --color-gdrive-dark:     #3367d6;
    --color-gdrive-light:    #e8f0fe;
    --color-gdrive-alpha-25: rgba(66, 133, 244, 0.25);
    --color-gdrive-alpha-15: rgba(66, 133, 244, 0.15);
    --color-gdrive-alpha-12: rgba(66, 133, 244, 0.12);
    --color-gdrive-alpha-10: rgba(66, 133, 244, 0.10);
    --color-gdrive-alpha-06: rgba(66, 133, 244, 0.06);
    --gradient-gdrive:       linear-gradient(135deg, #4285f4 0%, #2d6fe8 100%);
    --color-github:         #24292e;
    --color-github-light:   rgba(36, 41, 46, 0.08);
    --color-notion:         #37352f;
    --color-notion-light:   #f7f6f3;
    --color-jira:           #0052CC;
    --color-jira-alpha-10:  rgba(0, 82, 204, 0.10);
    --color-jira-light:     #e6edff;
    --color-whatsapp:       #25D366;
    --color-whatsapp-light: #e9f9ed;

    /* ── Decision / Entry type colors (memory timeline) ── */
    --color-decision:          #ec4899;
    --color-decision-alpha-15: rgba(236,72,153,0.15);
    --color-decision-alpha-10: rgba(236, 72, 153, 0.10);
    --color-decision-bg:       #ffe4e6;
    --color-decision-text:     #be123c;

    /* ── Orange accent (home feature icon backgrounds) ── */
    --color-orange-alpha-15:   rgba(251,146,60,0.15);

    /* ── Cyan / Lime / Emerald-300 (home feature icon gradients) ── */
    --color-cyan:              #06b6d4;
    --color-lime:              #84cc16;
    --color-emerald-300:       #34d399;

    /* ── Emerald (standalone green variant) ── */
    --color-emerald:          #009966;
    --color-emerald-alpha-10: rgba(0, 153, 102, 0.10);

    /* ── Group-green alpha variants ── */
    --color-group-green-alpha-15: rgba(0, 211, 149, 0.15);
    --color-group-green-alpha-10: rgba(0, 211, 149, 0.10);
    --color-group-green-alpha-08: rgba(0, 211, 149, 0.08);

    /* ── Board status colors (board.css semantic palette) ── */
    --color-board-status-todo:          #787e91;
    --color-board-status-in-progress:   #fdab3d;
    --color-board-status-in-review:     #e2445c;
    --color-board-status-done:          #00c875;
    --color-board-status-in-progress-alpha-08: rgba(253,171,61,0.08);
    --color-board-status-in-review-alpha-08:   rgba(226,68,92,0.08);
    --color-board-done-bg:              #e3fcef;
    --color-board-done-text:            #006644;
    --color-board-progress-bg:          #fffae6;
    --color-board-progress-text:        #ff8b00;
    --color-board-stuck-bg:             #ffebe6;
    --color-board-page-light:           #f6f7fb;
    --color-board-success-dot:          #00a86b;
    --color-board-warning-dot:          #ff8b00;
    --color-board-error-dot:            #de350b;
    --color-board-amber-bg:             rgba(255,171,0,0.12);
    --color-board-amber-text:           #946200;
    --color-board-amber-2-text:         #8a5a00;
    --color-board-amber-2-alpha-12:     rgba(212,145,15,0.12);
    --color-board-warn-bg:              #fffaf2;

    /* ── Mdoc (Monday.com-inspired board) palette ── */
    --color-mdoc-blue:          #0073ea;
    --color-mdoc-blue-alpha-35: rgba(0,115,234,0.35);
    --color-mdoc-blue-alpha-12: rgba(0,115,234,0.12);
    --color-mdoc-blue-alpha-10: rgba(0,115,234,0.10);
    --color-mdoc-blue-alpha-08: rgba(0,115,234,0.08);
    --color-mdoc-blue-alpha-06: rgba(0,115,234,0.06);
    --color-mdoc-blue-alpha-04: rgba(0,115,234,0.04);
    --color-mdoc-page:          #eceff8;
    --color-mdoc-border:        #d0d4e4;
    --color-mdoc-text:          #323338;
    --color-mdoc-text-muted:    #676879;

    /* ── Brick / Jira-error (board) ── */
    --color-brick:              #bf2600;
    --color-brick-alpha-16:     rgba(191,38,0,0.16);
    --color-brick-alpha-12:     rgba(191,38,0,0.12);
    --color-brick-alpha-08:     rgba(191,38,0,0.08);
    --color-brick-alpha-04:     rgba(191,38,0,0.04);

    /* ── Navy (Jira-dark text palette) ── */
    --color-navy:               #172b4d;
    --color-navy-text-muted:    #42526e;
    --color-navy-alpha-08:      rgba(9,30,66,0.08);
    --color-navy-alpha-06:      rgba(9,30,66,0.06);

    /* ── Slate-900 alpha (board dark overlays) ── */
    --color-slate-dark-alpha-55:  rgba(15,15,30,0.55);
    --color-slate-900-alpha-25:   rgba(15,23,42,0.25);
    --color-slate-900-alpha-20:   rgba(15,23,42,0.20);
    --color-slate-900-alpha-12:   rgba(15,23,42,0.12);
    --color-slate-900-alpha-08:   rgba(15,23,42,0.08);
    --color-slate-900-alpha-06:   rgba(15,23,42,0.06);
    --color-slate-900-alpha-04:   rgba(15,23,42,0.04);

    /* ── Meetings panel palette ── */
    --color-meetings-border:      #dbe3f0;
    --color-meetings-muted:       #5e6f86;
    --color-meetings-dark:        #30445e;
    --color-meetings-blue:        #191970;
    --color-meetings-bg:          #e8eff8;
    --color-meetings-bg-active:   #dce8f8;
    --color-meetings-light:       rgba(25, 25, 112, 0.10);
    --color-cursor-amber:         #f0ad4e;

    /* ── Recording indicator colors ── */
    --color-record-red-bg:        #fca5a5;
    --color-record-green-bg:      #86efac;
    --color-record-green-text:    #15803d;
    --color-amber-400:            #fbbf24;
    --color-amber-800:            #92400e;

    /* ── Surface alpha (frosted glass / translucent panels) ── */
    --color-surface-alpha-96: rgba(255, 255, 255, 0.96);
    --color-surface-alpha-92: rgba(255, 255, 255, 0.92);
    --color-surface-alpha-70: rgba(255, 255, 255, 0.70);
    --color-surface-alpha-18: rgba(255, 255, 255, 0.18);

    /* ── Amber-600 (distinct from --color-warning-dark: #b45309) ── */
    --color-amber-600:       #d97706;
    --color-amber-alpha-18:  rgba(245, 158, 11, 0.18);
    --color-amber-alpha-12:  rgba(245, 158, 11, 0.12);
    --color-amber-alpha-10:  rgba(245, 158, 11, 0.10);
    --color-amber-alpha-08:  rgba(245, 158, 11, 0.08);

    /* ── Warm background gradient (ai-brain / studio parchment) ── */
    --gradient-warm-bg:      linear-gradient(180deg, #f8f7f5 0%, #f3f1ee 100%);

    /* ── Midnight blue (onboarding / AI brief accent) ── */
    --color-indigo:           #191970;
    --color-indigo-200:       #d0d0f5;
    --color-indigo-alpha-30:  rgba(25, 25, 112, 0.30);
    --color-indigo-alpha-25:  rgba(25, 25, 112, 0.25);
    --color-indigo-alpha-20:  rgba(25, 25, 112, 0.20);
    --color-indigo-alpha-15:  rgba(25, 25, 112, 0.15);
    --color-indigo-alpha-12:  rgba(25, 25, 112, 0.12);
    --color-indigo-alpha-10:  rgba(25, 25, 112, 0.10);
    --color-indigo-alpha-08:  rgba(25, 25, 112, 0.08);
    --color-indigo-alpha-07:  rgba(25, 25, 112, 0.07);
    --color-indigo-alpha-06:  rgba(25, 25, 112, 0.06);
    --color-indigo-alpha-04:  rgba(25, 25, 112, 0.04);
    --color-indigo-alpha-02:  rgba(25, 25, 112, 0.02);

    /* ── Yellow (onboarding task cards - Tailwind yellow-500) ── */
    --color-yellow-alpha-35:  rgba(234, 179, 8, 0.35);
    --color-yellow-alpha-15:  rgba(234, 179, 8, 0.15);
    --color-yellow-alpha-12:  rgba(234, 179, 8, 0.12);
    --color-yellow-alpha-04:  rgba(234, 179, 8, 0.04);

    /* ── Onboarding AI brief dark gradient ── */
    --gradient-brief-dark:   linear-gradient(135deg, #0f0a2a 0%, #1e1b4b 50%, #191970 100%);
}

/* === RESET & BASE === */
/* Design tokens are in /static/css/common.css */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    font-family: var(--font-sans);
    font-feature-settings: "cv01", "ss03";
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
a,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background:
        radial-gradient(ellipse 90% 55% at 12% 0%, rgba(25,25,112,0.055) 0%, transparent 65%),
        radial-gradient(ellipse 70% 45% at 88% 100%, rgba(53,53,168,0.04) 0%, transparent 65%),
        linear-gradient(158deg, #fafbff 0%, #f4f4f9 55%, #eeeef5 100%);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 16px;
    font-feature-settings: "cv01", "ss03";
}

/* ── Global grain texture overlay ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.055;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)'/%3E%3C/svg%3E");
    background-size: 220px 220px;
    background-repeat: repeat;
    mix-blend-mode: overlay;
}



/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.12;
    letter-spacing: -0.02em;
    font-weight: 700;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); }


/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-required {
    color: var(--color-error, #cf202f);
    margin-left: 3px;
    font-weight: 700;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 25, 112, 0.1);
}

.form-input:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.2);
}

.form-input--with-icon {
    padding-right: 44px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper__toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    display: flex;
    transition: color var(--transition);
}
.input-wrapper__toggle:hover { color: var(--color-text-sec); }
.input-wrapper__toggle svg { width: 18px; height: 18px; }

.form-select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 25, 112, 0.16);
}

.form-textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}
.form-textarea::placeholder {
    color: var(--color-text-muted);
}
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 25, 112, 0.16);
}
.form-textarea:hover:not(:focus) {
    border-color: var(--color-primary-light);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-sec);
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}
.form-link:hover { color: var(--color-primary-dark); text-decoration: underline; }


/* === BUTTONS === */
.btn,
.stg-btn,
.modal-box__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.16px;
    line-height: 1.2;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn--full { width: 100%; }

.btn--primary,
.stg-btn--primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover,
.stg-btn--primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn--primary:active,
.stg-btn--primary:active { transform: none; }
.btn--primary:disabled,
.stg-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn--dark {
    background: var(--color-dark-600);
    color: white;
    border-color: var(--color-dark-600);
}
.btn--dark:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.btn--outline,
.stg-btn--secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.btn--outline:hover,
.stg-btn--secondary:hover {
    background: rgba(25,25,112,0.08);
}

.btn--ghost,
.stg-btn--ghost,
.modal-box__btn--cancel {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid rgba(25,25,112,0.2);
}
.btn--ghost:hover,
.stg-btn--ghost:hover,
.modal-box__btn--cancel:hover {
    background: rgba(25,25,112,0.08);
    border-color: rgba(25,25,112,0.35);
}

.btn--danger,
.stg-btn--danger,
.modal-box__btn--danger {
    background: var(--color-error);
    color: #fff;
    border-color: var(--color-error);
}
.btn--danger:hover,
.stg-btn--danger:hover,
.modal-box__btn--danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(207, 32, 47, 0.18);
}

.btn--accent {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    border-color: var(--color-primary);
}
.btn--accent:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.btn svg,
.stg-btn svg,
.modal-box__btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.modal-box__btn {
    padding: 10px 20px;
    font-size: 0.85rem;
}


/* === MESSAGES / TOAST === */
.message {
    min-height: 1.5em;
    margin-top: 16px;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: center;
    transition: opacity 0.3s ease;
}
.message--success { color: var(--color-success); }
.message--error   { color: var(--color-error); }
.message--warning { color: var(--color-warning); }
.message--info    { color: var(--color-primary); }


/* === ROLE BADGES === */
.role-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: #f2f9ff;
    color: var(--color-primary);
    border: 1px solid rgba(25,25,112,0.2);
}

.role-badge--owner  { background: rgba(16,185,129,0.08); color: #059669; border-color: rgba(16,185,129,0.15); }
.role-badge--admin { background: rgba(25,25,112,0.12); color: var(--color-primary); border-color: rgba(25,25,112,0.2); }
.role-badge--member { background: rgba(156,163,175,0.08); color: #6b7280; border-color: rgba(156,163,175,0.15); }


/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

.spinner--dark {
    border-color: rgba(25,25,112,0.2);
    border-top-color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════
   LP AI LOADER - Octopus tentacles with Apple Intelligence aurora
   Usage: <div class="lp-ai-loader [lp-ai-loader--sm|--lg]">
            <svg class="lp-ai-loader__svg" viewBox="0 0 100 100" ...>
              <circle cx="50" cy="50" r="8" class="lp-ai-loader__orb"/>
              <path class="lp-ai-loader__t" transform="rotate(0,50,50)"   d="M50,41 C47,33 53,25 50,16"/>
              ... (×6 paths, rotating 0°/60°/120°/180°/240°/300°)
            </svg>
          </div>
   ═══════════════════════════════════════════════════════════════ */

@keyframes lp-aurora-sweep {
    0%   { filter: hue-rotate(0deg)   drop-shadow(0 0 5px rgba(191, 90, 242, 0.55)); }
    50%  { filter: hue-rotate(160deg) drop-shadow(0 0 8px rgba(0, 200, 255, 0.55)); }
    100% { filter: hue-rotate(0deg)   drop-shadow(0 0 5px rgba(191, 90, 242, 0.55)); }
}

@keyframes lp-tentacle-draw {
    0%   { stroke-dashoffset: 28; opacity: 0.55; }
    35%  { stroke-dashoffset: 0;  opacity: 1; }
    65%  { stroke-dashoffset: 0;  opacity: 1; }
    100% { stroke-dashoffset: 28; opacity: 0.55; }
}

@keyframes lp-orb-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.9; }
    50%       { transform: scale(1.35); opacity: 1; }
}

.lp-ai-loader {
    --lp-ai-size: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--lp-ai-size);
    height: var(--lp-ai-size);
    flex-shrink: 0;
}
.lp-ai-loader--sm { --lp-ai-size: 22px; }
.lp-ai-loader--lg { --lp-ai-size: 56px; }

.lp-ai-loader__svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: lp-aurora-sweep 4s ease-in-out infinite;
}

.lp-ai-loader__orb {
    fill: #BF5AF2;
    transform-origin: 50px 50px;
    animation: lp-orb-pulse 2s ease-in-out infinite;
}

.lp-ai-loader__t {
    fill: none;
    stroke: #BF5AF2;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 28;
    stroke-dashoffset: 28;
    animation: lp-tentacle-draw 1.8s ease-in-out infinite;
}
/* Stagger each tentacle arm */
.lp-ai-loader__t:nth-child(3) { animation-delay: 0.3s; }
.lp-ai-loader__t:nth-child(4) { animation-delay: 0.6s; }
.lp-ai-loader__t:nth-child(5) { animation-delay: 0.9s; }
.lp-ai-loader__t:nth-child(6) { animation-delay: 1.2s; }
.lp-ai-loader__t:nth-child(7) { animation-delay: 1.5s; }

.hidden { display: none !important; }

/* ── Team Switch Overlay ── */
.team-switch-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(2, 8, 20, 0.0);
    backdrop-filter: blur(0px);
    opacity: 0;
    animation: tsOverlayIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: all;
}

@keyframes tsOverlayIn {
    to {
        opacity: 1;
        background: rgba(2, 8, 20, 0.55);
        backdrop-filter: blur(12px);
    }
}

.team-switch-overlay__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #191970 0%, #3535a8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(25, 25, 112, 0.35);
    animation: tsIconPop 0.4s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes tsIconPop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.team-switch-overlay__icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
    animation: tsIconSpin 0.8s 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes tsIconSpin {
    from { transform: rotate(-90deg); opacity: 0.6; }
    to   { transform: rotate(0deg);   opacity: 1; }
}

.team-switch-overlay__text {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.01em;
    animation: tsTextIn 0.35s 0.18s ease both;
}

@keyframes tsTextIn {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

.team-switch-overlay__bar {
    width: 140px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    animation: tsTextIn 0.3s 0.25s ease both;
}

.team-switch-overlay__bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #3535a8, #5555cc);
    animation: tsBarFill 1.2s 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    width: 0%;
}

@keyframes tsBarFill {
    0%   { width: 0%; }
    60%  { width: 70%; }
    100% { width: 100%; }
}


/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR - Refined (collapsible)
   Light surface with subtle depth, collapses to 64px icon rail.
   ══════════════════════════════════════════════════════════════ */

/* Shell */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 40;
    overflow: hidden;
    border-right: 1px solid rgba(25,25,112,0.08);
    transition: width 0.28s var(--ease-out), min-width 0.28s var(--ease-out);
    box-shadow: 2px 0 20px rgba(25,25,112,0.05), 1px 0 0 rgba(25,25,112,0.07);
}
.sidebar.is-collapsed {
    width: var(--sidebar-w-collapsed);
    min-width: var(--sidebar-w-collapsed);
}

/* ── Brand header ── */
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 60px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(25,25,112,0.07);
    overflow: hidden;
    background: #ffffff;
}
.sidebar.is-collapsed .sidebar__brand {
    justify-content: center;
    padding: 0;
}
.sidebar__logo {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #191970 0%, #4040c0 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(25,25,112,0.30), 0 0 0 1px rgba(255,255,255,0.15) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sidebar__logo:hover { transform: scale(1.05); box-shadow: 0 4px 14px rgba(25,25,112,0.40); }
.sidebar__logo svg {
    width: 16px;
    height: 16px;
}
.sidebar__brand-text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, max-width 0.28s var(--ease-out);
    max-width: 160px;
}
.sidebar.is-collapsed .sidebar__brand-text {
    opacity: 0;
    max-width: 0;
}
.sidebar__brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    display: block;
}

/* ── Mobile close button ── */
.sidebar__close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--sb-text);
    cursor: pointer;
    z-index: 10;
    padding: 0;
}
.sidebar__close-btn:hover { background: var(--sb-bg-hover); }

/* ── Workspace switcher ── */
.sidebar__workspace {
    margin: 10px 10px 4px;
    padding: 8px 10px;
    background: rgba(25,25,112,0.04);
    border: 1px solid rgba(25,25,112,0.08);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    gap: 9px;
    overflow: visible;
    flex-shrink: 0;
}
.sidebar__workspace:hover {
    background: rgba(25,25,112,0.08);
    border-color: rgba(25,25,112,0.16);
    box-shadow: 0 2px 8px rgba(25,25,112,0.06);
}
.sidebar.is-collapsed .sidebar__workspace {
    justify-content: center;
    padding: 9px 0;
    margin: 4px 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    border-radius: 0;
}

.sidebar__workspace-avatar {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    background: var(--sidebar-team-color, var(--sb-logo-grad));
    transition: background 0.2s ease;
}
.sidebar__workspace-info {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, max-width 0.3s var(--ease-out);
    max-width: 140px;
}
.sidebar.is-collapsed .sidebar__workspace-info,
.sidebar.is-collapsed .sidebar__workspace-caret {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
}
.sidebar__workspace-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.sidebar__workspace-label {
    font-size: 0.62rem;
    color: var(--sb-section-label);
    font-weight: 400;
    letter-spacing: 0.04em;
}
.sidebar__workspace-caret {
    width: 14px;
    height: 14px;
    color: var(--sb-section-label);
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease, max-width 0.3s var(--ease-out);
    max-width: 20px;
}
.sidebar__workspace.open .sidebar__workspace-caret { transform: rotate(180deg); }

/* Dropdown */
.sidebar__team-menu {
    position: fixed;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 999;
    overflow: hidden;
    padding: 6px;
    animation: menuDrop 0.15s var(--ease-out) both;
}
@keyframes menuDrop {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sidebar__team-menu-header {
    padding: 9px 12px 6px;
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--sb-section-label);
    border-bottom: 1px solid var(--sb-border);
    margin: 0 -6px 4px;
}
.sidebar__team-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sb-text);
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.sidebar__team-menu-item:hover { background: var(--sb-bg-hover); color: var(--sb-text-hover); }
.sidebar__team-menu-item.active { color: var(--sb-accent); background: var(--sb-bg-active); font-weight: 600; }
.sidebar__team-menu-item-avatar {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ── Navigation ── */
.sidebar__nav {
    flex: 1;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: none;
}
.sidebar__nav::-webkit-scrollbar { display: none; }

/* Section labels */
.sidebar__section-label {
    font-size: clamp(0.7rem, 1.5vw, 0.78rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sb-section-label);
    padding: 16px 10px 4px;
    user-select: none;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.28s var(--ease-out), padding 0.28s var(--ease-out);
    max-height: 40px;
}
.sidebar.is-collapsed .sidebar__section-label {
    opacity: 0;
    max-height: 0;
    padding: 0;
}

.sidebar__nav-spacer { flex: 1; min-height: 8px; }

/* Nav links */
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    min-height: 44px;
    border-radius: 9px;
    font-size: 0.835rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: background 0.14s ease, color 0.14s ease, padding 0.28s var(--ease-out);
    position: relative;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.01em;
}
.sidebar__link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.14s ease, color 0.14s ease;
}
.sidebar__link:hover {
    background: rgba(25,25,112,0.055);
    color: #1e293b;
}
.sidebar__link:hover svg { opacity: 0.85; }
.sidebar__link.active {
    color: #191970;
    font-weight: 600;
    letter-spacing: -0.015em;
}
/* Collapsed: pill hidden, active bg lives on the link itself */
.sidebar.is-collapsed .sidebar__link.active {
    background: linear-gradient(135deg, rgba(25,25,112,0.10) 0%, rgba(53,53,168,0.065) 100%);
}
.sidebar.is-collapsed .sidebar__active-pill { display: none; }
.sidebar__link.active svg { opacity: 1; color: #191970; }

/* Active left-edge bar */
.sidebar__link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    background: linear-gradient(180deg, #4040c0 0%, #191970 100%);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px rgba(25,25,112,0.40);
}
.sidebar.is-collapsed .sidebar__link.active::before { display: none; }

/* Label text (hidden when collapsed) */
.sidebar__link-label {
    flex: 1;
    overflow: hidden;
    max-width: 160px;
    transition: opacity 0.2s ease, max-width 0.28s var(--ease-out);
    white-space: nowrap;
}
.sidebar.is-collapsed .sidebar__link-label {
    opacity: 0;
    max-width: 0;
}

/* Center icon when collapsed */
.sidebar.is-collapsed .sidebar__link {
    justify-content: center;
    padding: 10px;
}

/* ── Collapsed icon tooltips ── */
.sidebar__link[data-tooltip],
.sidebar__collapse-btn[data-tooltip],
.sidebar__workspace[data-tooltip] { position: relative; }
.sidebar.is-collapsed .sidebar__link[data-tooltip]::after,
.sidebar.is-collapsed .sidebar__collapse-btn[data-tooltip]::after,
.sidebar.is-collapsed .sidebar__workspace[data-tooltip]::after {
    content: attr(data-tooltip);
    position: fixed;
    left: calc(var(--sidebar-w-collapsed) + 10px);
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 0.73rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.sidebar.is-collapsed .sidebar__link[data-tooltip]:hover::after,
.sidebar.is-collapsed .sidebar__collapse-btn[data-tooltip]:hover::after,
.sidebar.is-collapsed .sidebar__workspace[data-tooltip]:hover::after { opacity: 1; }
/* Badge dot */
.sidebar__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid var(--sb-bg);
    z-index: 2;
    animation: badgePulse 2.2s ease infinite;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(1.3); }
}

/* Active pill (JS-positioned) */
.sidebar__active-pill {
    position: absolute;
    left: 8px;
    right: 8px;
    background: linear-gradient(135deg, rgba(25,25,112,0.10) 0%, rgba(53,53,168,0.065) 100%);
    border-radius: var(--radius-md);
    pointer-events: none;
    transition: top 0.15s ease-out, height 0.15s ease-out, opacity 0.15s ease;
    z-index: 0;
    opacity: 0;
    box-shadow: inset 0 0 0 1px rgba(25,25,112,0.07);
}
.sidebar__active-pill.pill-ready { opacity: 1; }
@keyframes pillPop {
    0%   { transform: scaleY(0.85); opacity: 0; }
    100% { transform: scaleY(1); opacity: 1; }
}
.sidebar__active-pill.pill-init { animation: pillPop 0.18s ease-out both; }
.sidebar__nav .sidebar__link { z-index: 1; }

/* ── Footer ── */
.sidebar__footer {
    padding: 8px 8px 14px;
    border-top: 1px solid rgba(25,25,112,0.07);
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
    background: rgba(248,248,253,0.6);
}

/* Collapse toggle */
.sidebar__collapse-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--sb-section-label);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
    width: 100%;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar__collapse-btn:hover { background: var(--sb-bg-hover); color: var(--sb-text-hover); }
.sidebar__collapse-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-out);
}
.sidebar.is-collapsed .sidebar__collapse-btn svg { transform: rotate(180deg); }
.sidebar.is-collapsed .sidebar__collapse-btn {
    justify-content: center;
    padding: 10px;
}
.sidebar__collapse-btn span {
    overflow: hidden;
    max-width: 160px;
    transition: opacity 0.2s ease, max-width 0.3s var(--ease-out);
    white-space: nowrap;
}
.sidebar.is-collapsed .sidebar__collapse-btn span {
    opacity: 0;
    max-width: 0;
}

/* Focus */
.sidebar__link:focus-visible,
.sidebar__workspace:focus-visible,
.sidebar__collapse-btn:focus-visible {
    outline: 2px solid var(--sb-accent);
    outline-offset: -2px;
}

/* Mobile close button - hidden on desktop */
.sidebar__close-btn {
    display: none;
    position: absolute;
    top: 14px;
    right: 12px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--sb-text);
    cursor: pointer;
    z-index: 1;
    transition: background 0.15s;
}
.sidebar__close-btn:hover { background: var(--sb-bg-hover); color: var(--sb-text-hover); }

/* Desktop */
@media (min-width: 769px) {
    .sidebar { width: var(--sidebar-w); }
    .sidebar.is-collapsed { width: var(--sidebar-w-collapsed); }
}

/* Mobile: slide-over */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        height: 100vh;
        box-shadow: none;
        width: var(--sidebar-w) !important;
        min-width: var(--sidebar-w) !important;
        transition: left 0.3s var(--ease-out), box-shadow 0.3s ease;
    }
    .sidebar.is-open {
        left: 0;
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
    }
    /* Hide desktop-only collapse toggle - irrelevant in slide-over mode */
    .sidebar__collapse-btn {
        display: none !important;
    }

    /* Show the mobile close (×) button inside the drawer */
    .sidebar__close-btn {
        display: flex;
    }

    /* Give the brand row relative positioning so the absolute close btn is contained */
    .sidebar {
        position: relative;
    }
}

/* Legacy JS aliases */
.sidebar__team-section { position: relative; }
.sidebar__team-icon-btn { display: none; }
.sidebar__teams { display: none; }
.sidebar__user { display: none !important; }




/* --- Main Content --- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR - Redesigned with clean glass + depth
   ══════════════════════════════════════════════════════════════ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 10px;
    height: 60px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(25, 25, 112, 0.07);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 1px 0 rgba(25,25,112,0.06), 0 2px 8px rgba(25,25,112,0.03);
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Hamburger collapse toggle */
.topbar__hamburger {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.14s ease, color 0.14s ease;
    padding: 0;
    margin-right: 2px;
}
.topbar__hamburger:hover {
    background: rgba(25,25,112,0.07);
    color: #191970;
}
.topbar__hamburger:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}
.topbar__hamburger svg { pointer-events: none; }

/* Page title in topbar */
.topbar__page-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    font-weight: 500;
    color: #94a3b8;
}
.topbar__page-title svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

/* Topbar active project name */
.topbar__project-name {
    font-size: 0.97rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    letter-spacing: -0.025em;
}
.topbar__project-name:empty { display: none; }

/* Greeting subtitle beside page title (dashboard only) */
.topbar__greeting {
    font-size: 0.84rem;
    font-weight: 500;
    color: #94a3b8;
    padding-left: 6px;
    border-left: 1.5px solid rgba(25,25,112,0.10);
    margin-left: 4px;
}

/* Chat / Studio mode switcher pill in topbar */
.topbar__mode-switcher {
    display: flex;
    border: 1px solid rgba(25,25,112,0.10);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(25,25,112,0.03);
}
.topbar__mode-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s;
    letter-spacing: -0.01em;
}
.topbar__mode-btn + .topbar__mode-btn {
    border-left: 1px solid rgba(25,25,112,0.08);
}
.topbar__mode-btn svg { width: 14px; height: 14px; }
.topbar__mode-btn:hover {
    color: #191970;
    background: rgba(25,25,112,0.05);
}
.topbar__mode-btn--active {
    background: linear-gradient(135deg, #191970 0%, #3535a8 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(25,25,112,0.30);
}
.topbar__mode-btn--active:hover {
    background: linear-gradient(135deg, #191970 0%, #3535a8 100%);
    color: #ffffff;
}
.topbar__mode-btn--active svg { color: rgba(255,255,255,0.9); }

.topbar__right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Divider between right-side action groups */
.topbar__right-divider {
    width: 1px;
    height: 20px;
    background: rgba(25,25,112,0.09);
    margin: 0 4px;
}

/* Invite button */
.topbar__invite-btn {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #475569;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.14s ease;
    border: 1px solid rgba(25,25,112,0.09);
    background: transparent;
    letter-spacing: -0.01em;
}
.topbar__invite-btn:hover {
    background: rgba(25,25,112,0.06);
    color: #191970;
    border-color: rgba(25,25,112,0.18);
}
.topbar__invite-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Search bar */
.topbar__search {
    position: relative;
}
.topbar__search input {
    width: 220px;
    padding: 8px 14px 8px 36px;
    border: 1.5px solid rgba(25,25,112,0.10);
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.83rem;
    background: rgba(248,248,253,0.9);
    color: #0f172a;
    outline: none;
    transition: all 0.18s ease;
    letter-spacing: -0.01em;
}
.topbar__search input:focus {
    border-color: #191970;
    background: white;
    box-shadow: 0 0 0 3px rgba(25,25,112,0.10);
    width: 270px;
}
.topbar__search input::placeholder { color: #94a3b8; }
.topbar__search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #94a3b8;
    pointer-events: none;
}

/* ── Search results dropdown ── */
.topbar__search-results {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: auto;
    min-width: min(340px, calc(100vw - 32px));
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(25,25,112,0.09);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(25,25,112,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 2200;
    padding: 6px 0;
    animation: dropIn 0.14s var(--ease-out) both;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.topbar__search-section-label {
    padding: 8px 14px 4px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: #94a3b8;
    text-transform: uppercase;
}

.topbar__search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    color: inherit;
    outline: none;
}
.topbar__search-result-item:hover,
.topbar__search-result-item--active {
    background: rgba(25,25,112,0.048);
}

.topbar__search-result-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(25,25,112,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #191970;
}
.topbar__search-result-icon svg { width: 17px; height: 17px; stroke-width: 1.75; }

.topbar__search-result-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.topbar__search-result-name {
    font-size: 0.865rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}
.topbar__search-result-desc {
    font-size: 0.765rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__search-empty {
    padding: 20px 14px;
    text-align: center;
    font-size: 0.84rem;
    color: #94a3b8;
    font-style: italic;
}

/* Icon buttons in topbar right */
.topbar__icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.14s ease, color 0.14s ease;
}
.topbar__icon-btn:hover {
    background: rgba(25,25,112,0.07);
    color: #191970;
}
.topbar__icon-btn svg { width: 19px; height: 19px; }

.topbar__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid white;
    animation: badgePop 0.3s var(--ease-out);
}
@keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* User avatar button */
.topbar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #191970 0%, #3535a8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 0 1.5px rgba(25,25,112,0.25), 0 2px 6px rgba(25,25,112,0.20);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    letter-spacing: -0.01em;
}
.topbar__avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 2px rgba(25,25,112,0.35), 0 4px 12px rgba(25,25,112,0.25);
}

/* Dropdown shell */
.topbar__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(25,25,112,0.14), 0 4px 16px rgba(0,0,0,0.07), 0 0 0 1px rgba(25,25,112,0.07);
    border: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s var(--ease-out);
    z-index: 2200;
    overflow: hidden;
}
.topbar__avatar:hover .topbar__dropdown,
.topbar__avatar.is-open .topbar__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.topbar__dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    font-size: 0.84rem;
    color: #475569;
    text-decoration: none;
    transition: background 0.12s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    background: none;
    letter-spacing: -0.01em;
}
.topbar__dropdown-item:hover { background: rgba(248,248,253,0.9); }

/* User identity item in dropdown */
.topbar__dropdown-item--user {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(248,248,253,0.95) 0%, rgba(241,242,255,0.85) 100%);
    border-bottom: 1px solid rgba(25,25,112,0.07);
    text-decoration: none;
    transition: background 0.14s ease;
}
.topbar__dropdown-item--user:hover {
    background: linear-gradient(135deg, rgba(241,242,255,1) 0%, rgba(235,236,255,0.9) 100%);
}

.topbar__user-avatar-mini {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #191970 0%, #3535a8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 6px rgba(25,25,112,0.22);
    flex-shrink: 0;
}

.topbar__user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.topbar__user-chevron {
    color: #cbd5e1;
    flex-shrink: 0;
    transition: color 0.12s ease;
}
.topbar__dropdown-item--user:hover .topbar__user-chevron {
    color: #191970;
}

.topbar__user-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar__user-email {
    font-size: 0.705rem;
    color: #94a3b8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Projects section wrapper */
.topbar__dropdown-section {
    padding: 6px 0;
    border-bottom: 1px solid rgba(25,25,112,0.07);
}

/* Footer (logout) */
.topbar__dropdown-footer {
    padding: 4px 0;
}
.topbar__dropdown-item--danger {
    color: #dc2626;
    font-weight: 600;
    gap: 8px;
}
.topbar__dropdown-item--danger:hover { background: rgba(239,68,68,0.06); }
.topbar__dropdown-item--danger svg { opacity: 0.85; }

/* Create project button in navbar dropdown */
.topbar__project-btn--create {
    color: #64748b;
    font-weight: 500;
    gap: 0;
    font-size: 0.83rem;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 2px;
}
.topbar__project-btn--create:hover {
    color: #191970;
    background: rgba(248,248,253,0.9);
}
.topbar__project-btn-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(25,25,112,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s ease;
}
.topbar__project-btn--create:hover .topbar__project-btn-icon {
    background: rgba(25,25,112,0.14);
}


/* --- Content Area --- */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content__grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-bottom: 24px;
}

/* === SHARED COMPONENTS === */

.card,
.mem-card,
.board-card,
.doc-card,
.stg-card,
.modal-box,
.modal__content,
.stg-modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border-lt);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card,
.mem-card,
.board-card,
.doc-card,
.stg-card {
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover,
.mem-card:hover,
.board-card:hover,
.doc-card:hover,
.stg-card:hover {
    border-color: rgba(25, 25, 112, 0.16);
    box-shadow: var(--shadow-md);
}

.card__header,
.modal__header,
.stg-modal__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border-lt);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card__title,
.modal__title,
.stg-modal__title {
    font-size: 1rem;
    font-weight: 700;
}

.card__body,
.modal__body,
.stg-modal__body {
    padding: 24px;
}

.card--focus {
    border-color: rgba(25, 25, 112, 0.22);
    box-shadow: 0 0 0 1px rgba(25, 25, 112, 0.04), var(--shadow-sm);
}

.card--ai {
    background: linear-gradient(135deg, rgba(25, 25, 112, 0.06), rgba(53, 53, 168, 0.04));
    border-color: rgba(25, 25, 112, 0.14);
}

.modal-overlay,
.task-modal-overlay,
.stg-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(13, 14, 31, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.active,
.task-modal-overlay.active,
.stg-overlay.active,
.modal-overlay[style*="display:flex"],
.modal-overlay[style*="display: flex"],
.task-modal-overlay[style*="display:flex"],
.task-modal-overlay[style*="display: flex"],
.stg-overlay[style*="display:flex"],
.stg-overlay[style*="display: flex"] {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.task-modal,
.modal-box,
.modal__content,
.stg-modal {
    width: min(calc(100% - 32px), 560px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    animation: fadeSlideUp 0.22s var(--ease-out);
}

.modal__content--large,
.stg-modal--large {
    width: min(calc(100% - 32px), 860px);
}

.modal--danger,
.stg-modal--danger-confirm {
    border-color: rgba(207, 32, 47, 0.18);
}

.modal__footer,
.modal__actions,
.modal-box__actions,
.stg-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px;
}

.modal__close,
.modal-box__close,
.stg-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.modal__close:hover,
.modal-box__close:hover,
.stg-modal__close:hover {
    color: var(--color-text);
    background: var(--color-surface-secondary);
    border-color: var(--color-border-lt);
}

.empty-state,
.timeline-empty,
.doc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 24px;
    text-align: center;
    color: var(--color-text-muted);
}

.empty-state--dashed {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.64);
}

.empty-state__icon,
.timeline-empty__icon,
.doc-empty__illustration {
    font-size: 2rem;
    line-height: 1;
    color: var(--color-primary);
}

.empty-state__title,
.timeline-empty__text,
.doc-empty__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.empty-state__desc,
.timeline-empty__hint,
.doc-empty__text {
    max-width: 420px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--color-text-sec);
}

.page-hero {
    background: var(--color-surface);
    border: 1px solid var(--color-border-lt);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    color: var(--color-text);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-xs);
}

.page-hero__eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    background: #f2f9ff;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.page-hero__title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.page-hero__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}


/* --- Calendar --- */
.calendar__header {
    display: flex;
    align-items: center;
    gap: 16px;
}


/* ═══════════════════════════════════════════════════════════════
   SHARED NAVIGATION â€” Mobile toggle, overlay, logout button
   (Moved here from base.html inline <style> block)
   ═══════════════════════════════════════════════════════════════ */

/* Mobile hamburger toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.mobile-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text, #0a0b0d);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-toggle:hover { background: var(--color-surface, #fff); }

/* Sidebar backdrop overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 40;
    backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* Base logout button (sidebar overrides below) */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: rgba(239,68,68,0.06);
    color: #b91c1c;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover { background: rgba(239,68,68,0.12); }

@media (max-width: 768px) {
    .mobile-toggle { display: flex; }

    .sidebar {
        position: fixed !important;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 200;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: none;
        overflow-y: auto;
    }

    .sidebar.is-open {
        left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }

    .sidebar-overlay {
        z-index: 150;
    }

    .mobile-toggle {
        z-index: 100;
    }

    /* Single-row topbar on mobile - forcefully override the 1080px two-row wrap layout */
    .topbar {
        padding: 0 12px 0 66px;
        height: 56px;
        min-height: 56px;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px;
    }

    /* Left area shrinks so right side (bell + avatar) is never pushed off screen */
    .topbar__left {
        flex: 1 1 auto !important;
        min-width: 0;
        overflow: hidden;
        width: auto !important;
    }

    /* Right side is always visible at its natural size - override the 1080px width:100% */
    .topbar__right {
        flex: 0 0 auto !important;
        width: auto !important;
        justify-content: flex-end;
        align-items: center;
        display: flex;
    }

    /* Hide the Chat/Studio mode-switcher pills on mobile - too wide for the topbar */
    .topbar__mode-switcher {
        display: none;
    }

    .topbar__invite-btn {
        width: 36px;
        padding: 0;
    }

    .topbar__invite-btn span {
        display: none;
    }

    /* Ensure main content fills the full width on mobile */
    .main {
        width: 100%;
        min-width: 0;
    }
}

.calendar__nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 700;
}

.calendar__nav-btn {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-page-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.calendar__nav-btn:hover { background: var(--color-border); }
.calendar__nav-btn svg { width: 14px; height: 14px; }

.calendar__toggle {
    display: flex;
    background: var(--color-page-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.calendar__toggle-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-sec);
    font-family: inherit;
    transition: all var(--transition);
}
.calendar__toggle-btn.active {
    background: white;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-border-lt);
    margin-top: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calendar__day-header {
    padding: 10px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: var(--color-page-bg);
}

.calendar__day {
    min-height: 90px;
    padding: 8px;
    background: white;
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}
.calendar__day:hover { background: var(--color-page-bg); }

.calendar__day-num {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text);
}

.calendar__day--muted .calendar__day-num { color: var(--color-text-muted); }

.calendar__day--today {
    border: 2px solid var(--color-primary);
    z-index: 1;
}
.calendar__day--today .calendar__day-num { color: var(--color-primary); }

.calendar__event {
    margin-top: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar__event--purple { background: rgba(25,25,112,0.14); color: var(--color-primary-dark); }
.calendar__event--teal   { background: rgba(0,211,149,0.15); color: var(--color-accent-dark); }
.calendar__event--amber  { background: rgba(245,158,11,0.15); color: #b45309; }


/* --- Activity Feed --- */
.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-lt);
}
.activity-item:last-child { border-bottom: none; }

.activity-item__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}
.activity-item__dot--purple { background: var(--color-primary); }
.activity-item__dot--green  { background: var(--color-accent); }
.activity-item__dot--amber  { background: var(--color-warning); }

.activity-item__text {
    font-size: 0.85rem;
    color: var(--color-text-sec);
    line-height: 1.5;
}
.activity-item__text strong { color: var(--color-text); }

.activity-item__time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}


/* --- AI Insight Card --- */
.ai-insight {
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(25,25,112,0.06), rgba(242,249,255,0.9));
    border: 1px solid rgba(25,25,112,0.18);
    margin-bottom: 12px;
}

.ai-insight__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.ai-insight__text {
    font-size: 0.84rem;
    color: var(--color-text-sec);
    line-height: 1.6;
}

.ai-brain-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
    background: rgba(0,211,149,0.1);
    padding: 5px 12px;
    border-radius: var(--radius-full);
}

.ai-brain-badge__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    animation: pulse-ring 2s ease infinite;
}


/* --- Footer --- */
.content__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 16px;
    border-top: 1px solid var(--color-border-lt);
}

.content__footer-links {
    display: flex;
    gap: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.content__footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.content__footer-links a:hover { color: var(--color-text-sec); }

/* --- Notification dropdown (topbar — shared across all pages) --- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 20rem;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border-lt);
    z-index: 200;
    overflow: hidden;
}

.notif-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-page-bg);
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-lt);
}

.notif-clear-btn {
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
}

.notif-clear-btn:hover { color: var(--color-primary-dark); }

.notif-body {
    max-height: min(24rem, 62vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.notif-body::-webkit-scrollbar {
    width: 8px;
}

.notif-body::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 999px;
}

.notif-body::-webkit-scrollbar-track {
    background: transparent;
}

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid var(--color-page-bg);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item .n-title { font-weight: 600; color: var(--color-text); }
.notif-item .n-time  { font-size: 0.75rem; color: var(--color-text-muted); }

/* --- Global toasts (used by notification manager) --- */
.lp-toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    z-index: 3000;
    pointer-events: none;
}

.lp-toast {
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.24);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}

.lp-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.lp-toast--success { background: #10b981; }
.lp-toast--info { background: #3b82f6; }
.lp-toast--warning { background: #f59e0b; }
.lp-toast--danger,
.lp-toast--error { background: #ef4444; }

.lp-toast__title {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 2px;
}

.lp-toast__message {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}


/* ═══════════════════════════════════════════════════════════════
    SIDEBAR - SubTeam Selector options
   (Legacy .sidebar__team-section/.sidebar__team-dropdown removed;
    the dropdown is now position:fixed, positioned by JS)
   ═══════════════════════════════════════════════════════════════ */

/* ── User Profile Pill ── */
.sidebar__user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    margin: 0 0 4px;
    transition: background 0.15s ease;
    cursor: default;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar__user-pill:hover { background: var(--sb-bg-hover); }
.sidebar__user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--sb-logo-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sidebar__user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-width 0.3s var(--ease-out);
    max-width: 160px;
}
.sidebar.is-collapsed .sidebar__user-info {
    opacity: 0;
    max-width: 0;
}
.sidebar__user-name {
    font-size: 0.77rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.sidebar__user-role {
    font-size: 0.62rem;
    color: var(--sb-section-label);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar.is-collapsed .sidebar__user-pill {
    justify-content: center;
    padding: 10px;
}

.sidebar__subteam-opt {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    font-size: 0.81rem;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--sb-text);
    font-family: inherit;
    transition: background 0.12s ease, color 0.12s ease;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 7px;
    line-height: 1.3;
}

.sidebar__subteam-opt:hover {
    background: var(--sb-bg-hover);
    color: var(--sb-text-hover);
}

.sidebar__subteam-opt.active {
    color: var(--sb-accent);
    font-weight: 600;
    background: var(--sb-bg-active);
}

.sidebar__subteam-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   NAVBAR - Wide dropdown + project list + dividers (refined)
   ═══════════════════════════════════════════════════════════════ */

.topbar__dropdown--wide {
    min-width: 256px;
}

.topbar__dropdown-group-label {
    font-size: 0.60rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #b0bcd0;
    padding: 8px 16px 4px;
    pointer-events: none;
}

.topbar__dropdown-divider {
    height: 1px;
    background: rgba(25,25,112,0.07);
    margin: 4px 10px;
}

.topbar__dropdown-item--active {
    color: #191970;
    font-weight: 600;
    background: rgba(25,25,112,0.05);
}

.topbar__project-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 7px 14px 7px 16px;
    font-size: 0.835rem;
    font-weight: 500;
    color: #475569;
    background: none;
    border: none;
    border-left: 2.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    letter-spacing: -0.01em;
}
.topbar__project-btn:hover {
    background: rgba(248,248,253,0.9);
    color: #0f172a;
    border-left-color: rgba(25,25,112,0.15);
}
.topbar__project-btn.active {
    color: #191970;
    font-weight: 600;
    background: rgba(25,25,112,0.05);
    border-left-color: #191970;
}

.topbar__project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #191970;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
}

/* Topbar subtitle (e.g. "Project Alpha Configuration" in settings) */
.topbar__subtitle {
    font-size: 0.77rem;
    color: #94a3b8;
    margin-left: 4px;
    font-weight: 400;
}

/* --- Notification dropdown (topbar – shared across all pages) --- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(25,25,112,0.13), 0 2px 8px rgba(0,0,0,0.07), 0 0 0 1px rgba(25,25,112,0.07);
    z-index: 200;
    overflow: hidden;
    animation: dropIn 0.15s var(--ease-out) both;
}

.notif-header {
    background: rgba(248,248,253,0.8);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.84rem;
    color: #0f172a;
    border-bottom: 1px solid rgba(25,25,112,0.07);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-body {
    max-height: 22rem;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(248,248,253,0.9);
    font-size: 0.845rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.12s ease;
}
.notif-item:hover { background: rgba(248,248,253,0.7); }
.notif-item:last-child { border-bottom: none; }
.notif-item .n-title { font-weight: 600; color: #0f172a; letter-spacing: -0.01em; }
.notif-item .n-time  { font-size: 0.73rem; color: #94a3b8; }
.notif-item.empty { color: #94a3b8; text-align: center; padding: 24px 16px; font-style: italic; }

@media (max-width: 1080px) {
    .topbar {
        padding: 0 14px 0 10px;
        gap: 8px;
    }
    .topbar__search input { width: 180px; }
    .topbar__search input:focus { width: 230px; }
    .topbar__invite-btn span { display: none; }
    .topbar__invite-btn { padding: 0 10px; min-width: 36px; justify-content: center; }
    .content { padding: 16px; }
    .content__grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   VOICE RECORDER - Floating FAB + Expandable Panel
   Shared across Dashboard, Meetings, and any future page.
   ═══════════════════════════════════════════════════════════════ */

.voice-recorder {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1000;
    font-family: inherit;
}

.voice-fab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,82,255, 0.4), 0 0 0 0 rgba(0,82,255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.voice-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 28px rgba(0,82,255, 0.5), 0 0 0 0 rgba(0,82,255, 0.3);
}

.voice-fab:active { transform: scale(0.97); }

.voice-fab__mic { width: 18px; height: 18px; flex-shrink: 0; }
.voice-fab__label { white-space: nowrap; }

.voice-fab__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50px;
    pointer-events: none;
}

.voice-fab--recording {
    background: var(--color-error);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5);
    animation: fabRecordGlow 2s ease-in-out infinite;
}

.voice-fab--recording .voice-fab__pulse {
    animation: fabPulseRing 1.5s ease-out infinite;
    border: 2px solid rgba(239, 68, 68, 0.4);
}

@keyframes fabRecordGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 4px 28px rgba(239, 68, 68, 0.7), 0 0 40px rgba(239, 68, 68, 0.15); }
}

@keyframes fabPulseRing {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.voice-fab--hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ── Panel ── */
.voice-panel {
    position: absolute;
    bottom: 16px;
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transform: scale(0.9) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.voice-panel--open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.voice-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--color-border-lt);
}

.voice-panel__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
}

.voice-panel__title-row svg { color: var(--color-primary); }

.voice-panel__close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
}

.voice-panel__close:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

/* ── State containers ── */
.voice-panel__state {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ── Idle ── */
.voice-idle-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,82,255, 0.08), rgba(162,93,220, 0.08));
    border: 1.5px solid rgba(0,82,255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    transition: all 0.3s;
}

.voice-idle-ring:hover {
    border-color: rgba(0,82,255, 0.4);
    background: linear-gradient(135deg, rgba(0,82,255, 0.12), rgba(162,93,220, 0.12));
}

.voice-panel__hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-align: center;
}

.voice-panel__record-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--color-error);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
}

.voice-panel__record-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.voice-panel__record-btn svg { flex-shrink: 0; }

/* ── Recording ── */
.voice-panel__waveform {
    width: 100%;
    border-radius: 8px;
    background: rgba(0,82,255, 0.04);
    border: 1px solid rgba(0,82,255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-panel__waveform canvas { display: block; }

.voice-panel__timer {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.voice-panel__controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.voice-panel__ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.voice-panel__ctrl-btn--cancel {
    background: rgba(239, 68, 68, 0.1);
    color: #cf202f;
    width: 36px;
    height: 36px;
}

.voice-panel__ctrl-btn--cancel:hover { background: rgba(239, 68, 68, 0.2); }

.voice-panel__ctrl-btn--stop {
    background: var(--color-error);
    color: #fff;
    width: 52px;
    height: 52px;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.35);
}

.voice-panel__ctrl-btn--stop:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45);
}

.voice-panel__ctrl-btn--pause {
    background: rgba(0,82,255, 0.1);
    color: var(--color-primary);
    width: 36px;
    height: 36px;
}

.voice-panel__ctrl-btn--pause:hover { background: rgba(0,82,255, 0.2); }

.voice-panel__live-tag {
    position: absolute;
    top: 20px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #cf202f;
}

.voice-panel__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cf202f;
    animation: liveDotPulse 1.2s ease-in-out infinite;
}

@keyframes liveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Processing ── */
.voice-panel__processing-anim {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-processing-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid rgba(0,82,255, 0.15);
    border-top-color: var(--color-primary);
    animation: voiceSpin 1s linear infinite;
}

@keyframes voiceSpin {
    to { transform: rotate(360deg); }
}

.voice-processing-icon { color: var(--color-primary); }

.voice-panel__processing-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-sec);
    text-align: center;
}

.voice-panel__progress {
    width: 100%;
    height: 4px;
    background: var(--color-border-lt);
    border-radius: 2px;
    overflow: hidden;
}

.voice-panel__progress-bar {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ── Done ── */
.voice-panel__done-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0,211,149, 0.1);
    border: 1.5px solid rgba(0,211,149, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: donePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes donePopIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.voice-panel__done-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

.voice-panel__done-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.5;
}

.voice-panel__done-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.voice-panel__done-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.voice-panel__done-btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.voice-panel__done-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0,82,255, 0.3);
}

.voice-panel__done-btn--ghost {
    background: #f8fafc;
    color: var(--color-text-sec);
    border: 1px solid var(--color-border);
}

.voice-panel__done-btn--ghost:hover {
    background: #f1f5f9;
    border-color: var(--color-border);
}

/* ── Error ── */
.voice-panel__error-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-panel__error-text {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .voice-recorder {
        bottom: 16px;
        right: 16px;
    }
    .voice-panel {
        width: calc(100vw - 32px);
        right: 0;
        bottom: 82px;
        max-height: calc(100dvh - 116px - env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .voice-fab__label { display: none; }
    .voice-fab {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* ── Voice Recorder: Upload / Divider ── */
.voice-panel__divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 2px 0;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.voice-panel__divider::before,
.voice-panel__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border, rgba(148, 163, 184, 0.2));
}

.voice-panel__upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: transparent;
    color: var(--color-text-secondary, #94a3b8);
    border: 1.5px dashed var(--color-border, rgba(148, 163, 184, 0.3));
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.voice-panel__upload-btn:hover {
    color: var(--color-primary, #0052ff);
    border-color: var(--color-primary, #0052ff);
    background: rgba(0,82,255, 0.06);
}
.voice-panel__upload-btn svg { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   LP POPUP - Global alert / confirm modal
   Used via window.__lp.alert() and window.__lp.confirm()
   ═══════════════════════════════════════════════════════════════ */
.lp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}
.lp-popup-overlay.lp-popup--visible {
    opacity: 1;
    pointer-events: all;
}
.lp-popup {
    background: var(--color-surface);
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 8px 48px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    width: 100%;
    max-width: 400px;
    padding: 28px 28px 24px;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0;
    border: 1px solid var(--color-border-lt);
}
.lp-popup-overlay.lp-popup--visible .lp-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.lp-popup__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.lp-popup__icon--info    { background: rgba(25,25,112,0.1);  color: var(--color-primary); }
.lp-popup__icon--danger  { background: rgba(239,68,68,0.1);   color: #dc2626; }
.lp-popup__icon--warning { background: rgba(245,158,11,0.1);  color: #d97706; }
.lp-popup__icon--success { background: rgba(16,185,129,0.1);  color: #059669; }
.lp-popup__icon svg { width: 22px; height: 22px; stroke-width: 2; }
.lp-popup__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 8px;
    line-height: 1.3;
}
.lp-popup__message {
    font-size: 14px;
    color: var(--color-text-sec);
    margin: 0 0 16px;
    line-height: 1.55;
}
.lp-popup__input {
    display: none;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    margin: 0 0 20px;
    border-radius: var(--radius-md, 8px);
    border: 1.5px solid var(--color-border, rgba(255,255,255,0.12));
    background: var(--color-bg-input, rgba(255,255,255,0.06));
    color: var(--color-text, #f0f0f0);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}
.lp-popup__input:focus {
    border-color: var(--color-accent, #7c6fde);
}
.lp-popup__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.lp-popup__btn {
    padding: 8px 18px;
    border-radius: var(--radius-md, 8px);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s ease, transform 0.1s ease;
    line-height: 1;
}
.lp-popup__btn:active { transform: scale(0.97); }
.lp-popup__btn--cancel {
    background: var(--color-page-bg, #f6f5f4);
    color: var(--color-text-sec);
    border: 1px solid var(--color-border);
}
.lp-popup__btn--cancel:hover { background: var(--color-border-lt); }
.lp-popup__btn--ok {
    background: var(--color-primary);
    color: #fff;
}
.lp-popup__btn--ok:hover { opacity: 0.88; }
.lp-popup__btn--danger {
    background: #dc2626;
    color: #fff;
}
.lp-popup__btn--danger:hover { opacity: 0.88; }

/* --- Topbar Responsive Fixes --- */
@media (max-width: 768px) {
    .topbar {
        padding: 0 12px;
    }
    .topbar__right {
        gap: 6px;
    }
    .topbar__search input {
        width: 130px;
    }
    .topbar__search input:focus {
        width: 160px;
    }
    .topbar__icon-btn {
        width: 38px;
        height: 38px;
    }
    .topbar__icon-btn svg {
        width: 18px;
        height: 18px;
    }
}
@media (max-width: 480px) {
    .topbar__search {
        display: none;
    }

    .topbar__icon-btn,
    .topbar__avatar {
        width: 44px;
        height: 44px;
    }
}
