/* ============================================
   VersionVault — Polished repository theme
   SharePoint clarity with Git-style operational signals
   ============================================ */

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

/* Prevent theme flicker / blackout flash during initial paint */
html.preload-no-transition,
html.preload-no-transition *,
html.preload-no-transition *::before,
html.preload-no-transition *::after {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -ms-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}

/* ── CSS Custom Properties & Design Token System ── */
:root {
    --theme-lightness: 100%;

    /* ── 1. Color Tokens ── */
    /* Primary Brand Purple */
    --color-primary: #7c3aed;
    --color-primary-hover: #6d28d9;
    --color-primary-active: #5b21b6;
    --color-primary-tint: rgba(124, 58, 237, 0.08);
    --color-primary-tint-strong: rgba(124, 58, 237, 0.16);
    --color-primary-text: #7c3aed;
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #8b5cf6;

    /* Neutrals & Surfaces default */
    --color-bg-page: #fbfbfa;
    --color-bg-surface: #ffffff;
    --color-bg-subtle: #f8fafc;
    --color-bg-hover: #f0f4f8;
    --color-border-subtle: #e2e8f0;
    --color-border-medium: #cbd5e1;
    --color-border-strong: #94a3b8;

    /* Legacy alias mappings for backwards compatibility */
    --bg-page: var(--color-bg-page);
    --bg-card: var(--color-bg-surface);
    --bg-card-header: var(--color-bg-subtle);
    --bg-hover: var(--color-bg-hover);
    --bg-primary: var(--color-bg-page);
    --bg-secondary: var(--color-bg-surface);
    --bg-glass: var(--color-bg-subtle);
    --bg-glass-hover: var(--color-bg-hover);
    --bg-input: var(--color-bg-surface);
    --bg-input-focus: var(--color-bg-hover);
    --border-card: 1px solid var(--color-border-subtle);
    --border-subtle: var(--color-border-subtle);
    --border-medium: var(--color-border-medium);
    --border-accent: rgba(124, 58, 237, 0.45);
    --border-focus: var(--color-primary);

    /* Text Tokens default */
    --color-text-primary: #0f172a;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;
    --color-text-inverse: #ffffff;
    --text-primary: var(--color-text-primary);
    --text-secondary: var(--color-text-secondary);
    --text-muted: var(--color-text-muted);
    --text-accent: var(--color-primary);

    /* Semantic Status Tokens (Solid + Tinted) */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-success-tint: rgba(16, 185, 129, 0.10);
    --color-success-text: #047857;

    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-warning-tint: rgba(245, 158, 11, 0.10);
    --color-warning-text: #b45309;

    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-tint: rgba(239, 68, 68, 0.10);
    --color-danger-text: #b91c1c;

    --color-info: #3b82f6;
    --color-info-hover: #2563eb;
    --color-info-tint: rgba(59, 130, 246, 0.10);
    --color-info-text: #1d4ed8;

    --color-gitlab: #fc6d26;
    --color-gitlab-hover: #e24329;
    --color-gitlab-tint: rgba(252, 109, 38, 0.12);
    --color-gitlab-text: #c2410c;

    /* Legacy palette aliases */
    --cyan-400: #8b5cf6;
    --cyan-500: #7c3aed;
    --cyan-600: #6d28d9;
    --violet-400: #c4b5fd;
    --violet-500: #7c3aed;
    --violet-600: #6d28d9;
    --emerald-400: #4ade80;
    --emerald-500: #22c55e;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --rose-400: #f87171;
    --rose-500: #ef4444;
    --blue-400: #8b5cf6;
    --blue-500: #7c3aed;

    /* ── 2. Typography Scale ── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --text-2xs: 0.6875rem; /* 11px */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.8125rem;  /* 13px */
    --text-base: 0.875rem; /* 14px */
    --text-md: 0.9375rem;  /* 15px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.375rem;   /* 22px */
    --text-2xl: 1.625rem;  /* 26px */
    --text-3xl: 2rem;      /* 32px */

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* ── 3. Spacing Scale (4px Base Unit) ── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* ── 4. Radius Scale ── */
    --radius-sm: 6px;      /* Buttons, inputs, badges */
    --radius-md: 10px;     /* Cards, dialogs, dropdowns */
    --radius-lg: 14px;     /* Large panels, modals */
    --radius-pill: 9999px; /* Status badges, tags, pills */
    --radius-xl: 16px;

/* ── Flex Utilities ── */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-center { align-items: center !important; }
.align-start { align-items: flex-start !important; }
.align-end { align-items: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.justify-start { justify-content: flex-start !important; }
.justify-end { justify-content: flex-end !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }

    /* ── 5. Shadows ── */
    --shadow-none: none;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-dropdown: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-modal: 0 20px 40px rgba(15, 23, 42, 0.16);
    --shadow-toast: 0 8px 24px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.55);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    --gradient-secondary: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-bg: var(--color-bg-page);

    --nav-height: 64px;
    --sidebar-width: 260px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Unified Reusable Component System ── */
.vv-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.vv-page-title-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.vv-page-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    line-height: 1.2;
    margin: 0;
}
.vv-page-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-muted);
    margin: var(--space-1) 0 0 0;
}
.vv-page-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.vv-breadcrumb,
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}
.vv-breadcrumb li,
.breadcrumb li {
    display: inline-flex;
    align-items: center;
    list-style: none !important;
    list-style-type: none !important;
    padding: 0;
    margin: 0;
}
.vv-breadcrumb a,
.breadcrumb a {
    color: #7c3aed;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.vv-breadcrumb a:hover,
.breadcrumb a:hover {
    color: #5b21b6;
    text-decoration: underline;
}
.vv-breadcrumb-separator,
.breadcrumb-sep {
    color: #7c3aed;
    font-weight: 700;
    font-size: 1rem;
    opacity: 0.9;
    user-select: none;
    padding: 0 2px;
}

/* ── Sticky Context Bar (Subheader Navigation / Floating Breadcrumb Header) ── */
.vv-sticky-context-bar {
    position: -webkit-sticky;
    position: sticky;
    top: 64px;
    z-index: 900;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 8px 16px;
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all var(--transition-fast);
}

/* Light Theme: Distinct soft purple/indigo tinted bar that stands out clearly from white table cards */
html.light-theme .vv-sticky-context-bar,
.vv-sticky-context-bar {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #d8b4fe;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.12), 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Dark Theme: Rich deep indigo/slate bar with glowing border */
html:not(.light-theme) .vv-sticky-context-bar {
    background: linear-gradient(135deg, #1e1b4b 0%, #18142e 100%);
    border: 1px solid rgba(167, 139, 250, 0.38);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40), 0 0 0 1px rgba(139, 92, 246, 0.18);
}

.vv-sticky-context-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.vv-sticky-file-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #6d28d9;
    background: rgba(124, 58, 237, 0.16);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 6px;
    padding: 3px 6px;
    line-height: 1;
    flex-shrink: 0;
}
html:not(.light-theme) .vv-sticky-file-icon {
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.28);
    border-color: rgba(167, 139, 250, 0.4);
}

.vv-sticky-folder-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.vv-sticky-breadcrumb {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6d28d9;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
html:not(.light-theme) .vv-sticky-breadcrumb {
    color: #c4b5fd;
}

.vv-sticky-breadcrumb::-webkit-scrollbar {
    display: none;
}

.vv-sticky-breadcrumb a {
    color: #6d28d9;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.vv-sticky-breadcrumb a:hover {
    color: #4c1d95;
    text-decoration: underline;
}
html:not(.light-theme) .vv-sticky-breadcrumb a {
    color: #c4b5fd;
}
html:not(.light-theme) .vv-sticky-breadcrumb a:hover {
    color: #f5f3ff;
}

.vv-sticky-breadcrumb .breadcrumb-sep {
    color: #8b5cf6;
    font-weight: 700;
    padding: 0 2px;
}
html:not(.light-theme) .vv-sticky-breadcrumb .breadcrumb-sep {
    color: #a78bfa;
}

.vv-sticky-filename {
    color: #4c1d95 !important;
    font-weight: 700 !important;
    text-overflow: ellipsis;
    overflow: hidden;
}
html:not(.light-theme) .vv-sticky-filename {
    color: #f5f3ff !important;
}

.vv-sticky-context-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vv-sticky-badge {
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
    font-weight: 600;
    white-space: nowrap;
}

.vv-sticky-btn {
    font-size: 0.75rem !important;
    padding: 4px 10px !important;
    font-weight: 600;
    white-space: nowrap;
}

.vv-sticky-btn-top {
    font-size: 0.75rem !important;
    font-weight: 600;
    padding: 4px 10px !important;
    cursor: pointer;
    background: #ffffff;
    color: #6d28d9;
    border: 1px solid #d8b4fe;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.1);
    transition: all var(--transition-fast);
}
.vv-sticky-btn-top:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}
html:not(.light-theme) .vv-sticky-btn-top {
    background: rgba(124, 58, 237, 0.22);
    color: #ddd6fe;
    border-color: rgba(167, 139, 250, 0.35);
}
html:not(.light-theme) .vv-sticky-btn-top:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}

@media (max-width: 640px) {
    .vv-sticky-context-bar {
        padding: 6px 10px;
        gap: 6px;
    }
    .vv-sticky-breadcrumb {
        font-size: 0.78rem;
    }
    .vv-sticky-btn-top .vv-btn-label {
        display: none;
    }
}

/* ── Enterprise Cards ── */
.vv-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.vv-card:hover {
    border-color: var(--color-border-medium);
}
.vv-card-header {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg-surface);
}
.vv-card-title {
    font-size: 0.92rem;
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.vv-card-body {
    padding: 0.75rem 1rem;
}
.vv-card-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg-subtle);
}

/* ── Metric Stat Cards (Notion / Linear Style) ── */
.vv-stat-grid,
.vv-stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 1.25rem;
}
.vv-stat-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    min-height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.vv-stat-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}
.vv-stat-icon-box,
.vv-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.vv-stat-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.vv-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    line-height: 1.2;
}
.vv-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-top: 2px;
}
.vv-stat-trend {
    display: none !important;
}

/* ── System Status Dashboard Grid & Info Rows ── */
.vv-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}
.vv-info-list {
    display: flex;
    flex-direction: column;
}
.vv-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06));
    font-size: 0.88rem;
    gap: 14px;
}
.vv-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.vv-info-label {
    color: var(--text-muted, #64748b);
    font-weight: 500;
    font-size: 0.86rem;
    white-space: nowrap;
}
.vv-info-value {
    color: var(--text-primary, #0f172a);
    font-weight: 600;
    font-size: 0.88rem;
    text-align: right;
    word-break: break-all;
}

/* ── Access Audit Matrix & Table ── */
.vv-audit-wrapper {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.vv-audit-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.vv-audit-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}
.vv-audit-table th {
    background: var(--bg-card-header, rgba(255, 255, 255, 0.03));
    padding: 10px 12px;
    font-size: 0.72rem !important;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    white-space: nowrap;
}
.vv-audit-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    vertical-align: middle;
}
.vv-audit-table tbody tr {
    transition: background var(--transition-fast, 0.15s ease);
}
.vv-audit-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}
.vv-audit-table tbody tr:hover td {
    color: var(--text-primary, #f8fafc);
}
.vv-audit-table tbody tr:last-child td {
    border-bottom: none;
}
.vv-audit-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}
.vv-audit-user-info {
    min-width: 0;
    flex: 1;
}
.vv-audit-user-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vv-audit-user-email {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vv-audit-res-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
}
.vv-audit-res-link {
    color: var(--color-primary, #6366f1);
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.vv-audit-res-link:hover {
    text-decoration: underline;
}
.vv-audit-filter-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.vv-audit-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.vv-audit-filter-item {
    flex: 1;
    min-width: 120px;
}
.vv-audit-filter-item label {
    display: block;
    font-size: 0.70rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
}
.vv-audit-filter-item select,
.vv-audit-filter-item input {
    width: 100%;
    height: 36px;
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    background: var(--bg-input, rgba(0, 0, 0, 0.2));
    color: var(--text-primary, #f8fafc);
    box-sizing: border-box;
}
html.light-theme .vv-audit-filter-item select,
html.light-theme .vv-audit-filter-item input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* ── Standardized Status Badges (Pills) ── */
.vv-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    line-height: 1.35;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.vv-badge--success {
    background: var(--color-success-tint);
    color: var(--color-success-text);
}
.vv-badge--warning {
    background: var(--color-warning-tint);
    color: var(--color-warning-text);
}
.vv-badge--danger {
    background: var(--color-danger-tint);
    color: var(--color-danger-text);
}
.vv-badge--info {
    background: var(--color-info-tint);
    color: var(--color-info-text);
}
.vv-badge--primary {
    background: var(--color-primary-tint);
    color: var(--color-primary-text);
}
.vv-badge--neutral {
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
}
.vv-badge--gitlab {
    background: var(--color-gitlab-tint);
    color: var(--color-gitlab-text);
}

/* File Type Badges */
.vv-badge--pdf   { background: rgba(220, 38, 38, 0.10); color: #dc2626; }
.vv-badge--word  { background: rgba(43, 87, 154, 0.10); color: #2b579a; }
.vv-badge--excel { background: rgba(33, 115, 70, 0.10); color: #217346; }
.vv-badge--code  { background: rgba(124, 58, 237, 0.10); color: #7c3aed; }

/* ── Standardized Version Switcher Pills ── */
.vv-version-pill-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-bg-subtle, rgba(255, 255, 255, 0.05));
    padding: 3px 6px;
    border-radius: 20px;
    border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.12));
}

.vv-version-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none !important;
    color: var(--color-text-secondary, #94a3b8) !important;
    background: transparent;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
}

.vv-version-pill:hover {
    color: var(--color-text-primary, #ffffff) !important;
    background: rgba(255, 255, 255, 0.08);
}

.vv-version-pill.active {
    color: #ffffff !important;
    background: var(--color-primary, #7c3aed) !important;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
    font-weight: 700;
}

/* ── Standardized Theme-Adaptive Zoom Toolbar & Canvas ── */
.vv-zoom-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.08));
    padding: 4px 8px;
    border-radius: 24px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html.light-theme .vv-zoom-toolbar {
    background: var(--color-bg-subtle, #f1f5f9);
    border-color: var(--color-border-subtle, #cbd5e1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.vv-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    line-height: 1.2;
    text-decoration: none !important;
}

html.light-theme .vv-zoom-btn {
    color: var(--color-text-primary, #1e293b);
    background: var(--color-bg-surface, #ffffff);
    border-color: var(--color-border-subtle, #e2e8f0);
}

.vv-zoom-btn:hover {
    color: #ffffff !important;
    background: var(--color-primary, #7c3aed) !important;
    border-color: var(--color-primary, #7c3aed) !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.vv-zoom-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 8px;
    min-width: 54px;
    text-align: center;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.4);
}

html.light-theme .vv-zoom-badge {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.3);
}

.vv-zoom-divider {
    width: 1px;
    height: 16px;
    background: var(--border-subtle, rgba(255, 255, 255, 0.15));
    margin: 0 2px;
}

html.light-theme .vv-zoom-divider {
    background: var(--border-subtle, #cbd5e1);
}

.image-zoom-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 10%, transparent 11%), radial-gradient(circle, rgba(255, 255, 255, 0.08) 10%, transparent 11%);
    background-color: var(--bg-card, #1c1a26);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
}

html.light-theme .image-zoom-viewport {
    background: radial-gradient(circle, rgba(0, 0, 0, 0.06) 10%, transparent 11%), radial-gradient(circle, rgba(0, 0, 0, 0.06) 10%, transparent 11%);
    background-color: var(--bg-card, #f8fafc);
    border-color: var(--border-subtle, #e2e8f0);
}

.pdf-zoom-viewport {
    position: relative;
    width: 100%;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.1));
    background: var(--bg-hover, #2a2936);
    min-height: 500px;
    padding: 12px;
    display: flex;
    justify-content: center;
}

html.light-theme .pdf-zoom-viewport {
    background: var(--color-bg-subtle, #f1f5f9);
    border-color: var(--border-subtle, #e2e8f0);
}

/* ── Enterprise Data Tables ── */
.vv-table-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.vv-table-responsive {
    width: 100%;
    overflow-x: auto;
}
.vv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
    text-align: left;
}
.vv-table th {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border-subtle);
}
.vv-table td {
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}
.vv-table tbody tr:last-child td {
    border-bottom: none;
}
.vv-table tbody tr:hover td {
    background: var(--color-bg-subtle);
}
.vv-table-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* ── Standard Action Buttons ── */
.vv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    font-family: var(--font-sans);
    line-height: 1.3;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.vv-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.vv-btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}
.vv-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #ffffff;
}
.vv-btn-secondary {
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    border-color: var(--color-border-medium);
}
.vv-btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-subtle);
    border-color: var(--color-border-strong);
    color: var(--color-text-primary);
}
.vv-btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}
.vv-btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
}
.vv-btn-danger {
    background: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}
.vv-btn-danger:hover:not(:disabled) {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
}
.vv-btn-sm {
    padding: 4px 10px;
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
}
.vv-btn-lg {
    padding: 10px 20px;
    font-size: var(--text-base);
}

/* ── Standard Form Controls ── */
.vv-form-group {
    margin-bottom: var(--space-4);
}
.vv-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}
.vv-input, .vv-select, .vv-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-sm);
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.vv-input:focus, .vv-select:focus, .vv-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-tint-strong);
}
.vv-help-text {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ── Standard Empty States ── */
.vv-empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
}
.vv-empty-icon {
    font-size: 2.2rem;
    margin-bottom: var(--space-3);
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vv-empty-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}
.vv-empty-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 440px;
    margin: 0 auto var(--space-4) auto;
    line-height: 1.5;
}

/* ── Two-Column Layout (Content + Sidebar) ── */
.vv-two-col-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--space-6);
    align-items: start;
}
@media (max-width: 980px) {
    .vv-two-col-grid {
        grid-template-columns: 1fr;
    }
}
.vv-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.vv-sidebar-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}
.vv-sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}
.vv-sidebar-title h4 {
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.vv-sidebar-title a {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    text-decoration: none;
}

/* ── Sidebar Storage Widget (Pinned Footer) ── */
.vv-sidebar-storage {
    flex-shrink: 0;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
    background: var(--bg-card, #ffffff);
    box-shadow: 0 -4px 14px rgba(0,0,0,0.04);
    z-index: 10;
}
html.light-theme .vv-sidebar-storage,
html.dark-theme .vv-sidebar-storage {
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-subtle) !important;
}
.vv-storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.vv-storage-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #8b949e);
}
.vv-storage-percent {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #8b949e);
}
.vv-storage-amount {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 6px;
}
.vv-storage-amount-total {
    font-weight: 500;
    color: var(--text-muted, #8b949e);
}
.vv-progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg-subtle, #f1f5f9);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.vv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.vv-storage-btn {
    display: block;
    text-align: center;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    background: rgba(124, 58, 237, 0.06);
    color: #7c3aed;
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.vv-storage-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: #7c3aed;
    color: #6d28d9;
}

/* ── Project Cards Grid & Banner ── */
.vv-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}
.vv-project-card {
    padding: var(--space-5);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--color-border-subtle);
    background: var(--color-bg-surface);
}
.vv-project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}
.vv-project-card-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}
.vv-project-card-desc {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-3);
    line-height: 1.4;
}
.vv-project-card-meta {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    margin-bottom: var(--space-3);
}
.vv-project-banner {
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.vv-modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin: 0;
    color: var(--color-text-primary);
}
.vv-modal-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-3);
}

/* ── Auth SSO Elements ── */
.auth-sso-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-5) 0 var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-sso-line {
    flex: 1;
    border-bottom: 1px solid var(--color-border-subtle);
}
.auth-sso-text {
    padding: 0 var(--space-3);
    font-weight: var(--font-semibold);
}
.btn-gitlab-sso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    box-sizing: border-box;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(252, 109, 38, 0.45);
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(252, 109, 38, 0.12);
    transition: all var(--transition-fast);
}
.btn-gitlab-sso:hover {
    background: var(--color-gitlab-tint);
    border-color: var(--color-gitlab);
    color: var(--color-text-primary);
}

:root[data-theme="dark"] {
    --bg-page: #0a0a0f;
    --bg-card: #211f2b;
    --bg-card-header: #2c2938;
    --bg-hover: #322e40;
    --border-card: 1px solid rgba(255,255,255,0.12);
}

/* ── Light Theme Variables (Placed at top for instant 0ms CSS evaluation) ── */
html.light-theme {
    --bg-primary: var(--bg-page);
    --bg-secondary: var(--bg-card);
    --bg-card-hover: var(--bg-hover);
    --bg-glass: var(--bg-card-header);
    --bg-glass-hover: var(--bg-hover);
    --bg-input: var(--bg-card-header);
    --bg-input-focus: var(--bg-hover);
    --gradient-bg: var(--bg-page);
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Background Mesh Disabled (Prevents 3D shadow/glow anomalies) */
body::before {
    display: none !important;
}

/* ── Global Visible Scrollbar (Light & Dark Theme) ── */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 58, 237, 0.45) rgba(0, 0, 0, 0.04);
}

html.light-theme {
    scrollbar-color: #94a3b8 #f1f5f9;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

html:not(.light-theme) ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.4);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}

html.light-theme ::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
    border: 2px solid #f8fafc;
    background-clip: content-box;
}

html.light-theme ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
    border: 2px solid #f8fafc;
    background-clip: content-box;
}

html:not(.light-theme) ::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.7);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* ── Typography ── */
/* ── Clean SaaS Typography Hierarchy ── */
h1, .page-title, .page-header h1, .vv-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h2, .glass-card-header h2, .section-header {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h3, .glass-card-header h3 {
    font-size: 1.0rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h4, .glass-card-header h4 {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
}

h5, h6 {
    font-size: 0.80rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
}

body, p, .file-table td, .form-input, .tab-btn, .btn, .nav-link-item, .fs-base, .fs-md {
    font-size: 14px;
    line-height: 1.5;
}

label, .form-label, .stat-label, .file-meta, .badge, th, .fs-sm, .fs-xs, small, .version-meta, .text-muted.fs-sm, .text-muted.fs-xs {
    font-size: 12px;
    line-height: 1.4;
}

a {
    color: var(--cyan-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--cyan-500);
}

/* ── Layout ── */
.app-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Navigation ── */
.navbar-glass {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 2rem;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-glass:hover {
    background: var(--bg-card-hover);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.nav-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow-glow-cyan);
}
.brand-mark { width: 25px; height: 25px; display:block; color:#fff; }
.ui-icon { width:16px; height:16px; flex:0 0 auto; vertical-align:-3px; }
.btn-icon { width:34px; min-width:34px; height:34px; padding:0; display:inline-grid; place-items:center; }
.badge .ui-icon,.owner-label .ui-icon { width:14px; height:14px; margin-right:4px; }
.owner-label,.quick-pick-label { display:inline-flex; align-items:center; gap:5px; }
.empty-state-svg { width:34px; height:34px; fill:none; stroke:currentColor; stroke-width:1.5; }
.file-icon,.file-detail-icon { font-family:'JetBrains Mono',monospace; font-size:9px !important; font-weight:700; letter-spacing:-.03em; color:#7c3aed; background:#f4efff; border:1px solid #d8c7ff; }
html:not(.light-theme) .file-icon,html:not(.light-theme) .file-detail-icon { background:rgba(124,58,237,.18); border-color:rgba(245,158,11,.35); color:#f59e0b; }
.auth-logo-icon { background:#7c3aed; box-shadow:none; color:#fff; border-radius:9px; }.auth-brand-mark { width:38px; height:38px; display:block; }
.theme-toggle-btn { width:36px; height:36px; min-width:36px; display:grid; place-items:center; border-radius:50%; border:1.5px solid var(--border-medium,rgba(255,255,255,.18)); background:var(--bg-glass,rgba(255,255,255,.08)); cursor:pointer; transition:all .22s ease; }
.theme-icon { width:18px; height:18px; }
.theme-sun, svg.theme-sun { display:none !important; } .theme-moon, svg.theme-moon { display:inline-block !important; }
html:not(.light-theme) .theme-sun, html:not(.light-theme) svg.theme-sun, [data-theme="dark"] .theme-sun, [data-theme="dark"] svg.theme-sun { display:inline-block !important; }
html:not(.light-theme) .theme-moon, html:not(.light-theme) svg.theme-moon, [data-theme="dark"] .theme-moon, [data-theme="dark"] svg.theme-moon { display:none !important; }
html.light-theme .theme-sun, html.light-theme svg.theme-sun, [data-theme="light"] .theme-sun, [data-theme="light"] svg.theme-sun { display:none !important; }
html.light-theme .theme-moon, html.light-theme svg.theme-moon, [data-theme="light"] .theme-moon, [data-theme="light"] svg.theme-moon { display:inline-block !important; }

.navbar-glass { overflow: visible !important; }

/* ── Theme Control Wrapper & Floating Popup ── */
.theme-control-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.theme-toggle-btn:hover {
    color: #7c3aed;
    border-color: #7c3aed;
    background: rgba(124,58,237,.12);
    box-shadow: 0 0 14px rgba(124,58,237,.3);
    transform: scale(1.08);
}

/* Floating popup panel */
.theme-popup {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 9999;
    flex-direction: column;
    align-items: stretch;
    min-width: 265px;
    background: rgba(18, 16, 28, 0.94);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1.5px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    padding: 14px 16px 14px;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px -4px rgba(124, 58, 237, 0.3);
    animation: themePopupIn .18s cubic-bezier(.16,1,.3,1) both;
}

html.light-theme .theme-popup {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(124, 58, 237, 0.12), 0 8px 20px -4px rgba(124, 58, 237, 0.15);
}

.theme-popup::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-top: 1.5px solid rgba(139, 92, 246, 0.4);
    border-left: 1.5px solid rgba(139, 92, 246, 0.4);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

html.light-theme .theme-popup::before {
    border-top-color: rgba(124, 58, 237, 0.35);
    border-left-color: rgba(124, 58, 237, 0.35);
}

.theme-control-wrapper:hover .theme-popup,
.theme-popup:hover,
.theme-control-wrapper.is-open .theme-popup {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Invisible hover bridge: covers the gap between button and popup so hover never drops */
.theme-popup::after {
    content: '';
    position: absolute;
    top: -24px;
    left: -10px;
    right: -10px;
    height: 24px;
    background: transparent;
    pointer-events: auto;
}

@keyframes themePopupIn {
    from { opacity:0; transform:translateY(-6px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

.theme-popup-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a78bfa;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

html.light-theme .theme-popup-title {
    color: #7c3aed;
}

.theme-popup-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-tiny-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.theme-expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #888);
    cursor: pointer;
    transition: color .15s ease, transform .15s ease;
    border: none;
    background: transparent;
    padding: 3px;
    border-radius: 50%;
}

.theme-expand-icon:hover {
    color: #7c3aed;
    transform: scale(1.2);
}

.theme-range-input {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    border-radius: 99px;
    background: linear-gradient(to right, #7c3aed 100%, rgba(120,120,150,.25) 100%);
    outline: none;
    cursor: pointer;
    transition: background .1s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.theme-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2.5px solid #7c3aed !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(124, 58, 237, 0.2) !important;
    cursor: pointer !important;
    transition: transform .15s ease, box-shadow .15s ease !important;
}

.theme-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.25) !important;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.5), 0 0 0 3px rgba(124, 58, 237, 0.3) !important;
}

.theme-range-input::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2.5px solid #7c3aed !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(124, 58, 237, 0.2) !important;
    cursor: pointer !important;
    transition: transform .15s ease, box-shadow .15s ease !important;
}

.theme-range-input::-moz-range-thumb:hover {
    transform: scale(1.25) !important;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.5), 0 0 0 3px rgba(124, 58, 237, 0.3) !important;
}

.theme-range-input:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 3px;
}

.theme-popup-ticks {
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
}

.theme-popup-ticks span {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    padding: 1px 3px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.theme-popup-ticks span:hover {
    color: #7c3aed !important;
    font-weight: 700 !important;
    background: rgba(124, 58, 237, 0.15);
    transform: scale(1.15);
}

.theme-popup-ticks span.active {
    color: #7c3aed !important;
    font-weight: 700 !important;
}

.theme-brightness-badge {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    color: #7c3aed !important;
    background: rgba(124, 58, 237, 0.12) !important;
    border: 1px solid rgba(124, 58, 237, 0.25) !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    min-width: 42px !important;
    text-align: center !important;
    display: inline-block !important;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.1) !important;
}

.theme-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.theme-action-btn {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #f1f0f7;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.theme-action-btn:hover {
    background: rgba(124, 58, 237, 0.3);
    border-color: #a78bfa;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.theme-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html.light-theme .theme-action-btn {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
    text-shadow: none;
}

html.light-theme .theme-action-btn:hover {
    background: #f3e8ff;
    border-color: #7c3aed;
    color: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.18);
}

html.light-theme .theme-action-btn:active {
    transform: translateY(0);
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-link-item {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link-item:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.nav-link-item.active {
    color: var(--cyan-400);
    background: rgba(124, 58, 237, 0.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    cursor: default;
}

.nav-username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Cards (Elevated Surface - Level 1) ── */
.glass-card {
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: 10px;
    padding: 1.15rem 1.35rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

html.light-theme .glass-card {
    background: var(--bg-card);
    border-color: var(--border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.glass-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.glass-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.65rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.glass-card-header h3,
.glass-card-header h4 {
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--text-primary);
    margin: 0;
}

/* ── Buttons ── */
.btn-primary-gradient, .btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 8px 18px;
    min-height: 36px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.2);
}

.btn-primary-gradient:hover, .btn-primary:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
    background: var(--bg-glass-hover);
}

.btn-success-glow {
    background: linear-gradient(135deg, var(--emerald-500), #059669);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-success-glow:hover {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
    color: white;
}

.btn-danger-glow {
    background: linear-gradient(135deg, var(--rose-500), #e11d48);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-danger-glow:hover {
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.3);
    transform: translateY(-1px);
    color: white;
}

.btn-warning-glow {
    background: linear-gradient(135deg, var(--amber-500), #d97706);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-warning-glow:hover {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 0.95rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    height: 38px;
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all var(--transition-fast);
    outline: none;
    box-sizing: border-box;
}

.form-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

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

textarea.form-input {
    height: auto;
    resize: vertical;
    min-height: 80px;
    padding: 8px 12px;
}

.form-check-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

/* File upload zone */
.upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--cyan-500);
    background: rgba(124, 58, 237, 0.05);
}

.upload-zone.drag-over {
    box-shadow: var(--shadow-glow-cyan);
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.upload-zone-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-zone-text strong {
    color: var(--cyan-400);
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.file-selected-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.file-selected-icon {
    flex-shrink: 0;
}

.file-selected-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.file-selected-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.file-selected-clear:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    transform: scale(1.08);
}

.file-selected-clear:active {
    transform: scale(0.95);
}

/* ── Status Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-available {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-400);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-locked {
    background: rgba(245, 158, 11, 0.12);
    color: var(--amber-400);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-editor {
    background: rgba(124, 58, 237, 0.12);
    color: var(--cyan-400);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-viewer {
    background: rgba(139, 92, 246, 0.12);
    color: var(--violet-400);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-version {
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue-400);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.14) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.badge-info {
    background: rgba(59, 130, 246, 0.14) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dot-green { background: var(--emerald-400); box-shadow: 0 0 6px var(--emerald-400); }
.badge-dot-amber { background: var(--amber-400); box-shadow: 0 0 6px var(--amber-400); }
.badge-dot-red { background: var(--rose-400); box-shadow: 0 0 6px var(--rose-400); }
.badge-dot-blue { background: var(--blue-400); box-shadow: 0 0 6px var(--blue-400); }

/* ── Stats Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: 8px;
    padding: 0.65rem 0.95rem;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

html.light-theme .stat-card {
    background: var(--bg-card);
    border-color: var(--border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-card::before {
    display: none !important;
}

.stat-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: #a78bfa;
}

.stat-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
}

/* Category-tinted stat icons */
.stat-icon.stat-icon-purple {
    background: rgba(124, 58, 237, 0.15) !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
    color: #a78bfa !important;
}

.stat-icon.stat-icon-amber {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

.stat-icon.stat-icon-violet {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #c4b5fd !important;
}

.stat-icon.stat-icon-emerald {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #4ade80 !important;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 1px;
    font-weight: 500;
}

/* ── Tabs ── */
.tabs-container {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--cyan-400);
    border-bottom-color: var(--cyan-500);
}

.tab-count {
    background: var(--bg-glass);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.tab-btn.active .tab-count {
    background: rgba(124, 58, 237, 0.15);
    color: var(--cyan-400);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* ── File List / Table ── */
.file-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.file-table th {
    background: var(--bg-card-header);
    padding: 14px 16px;
    font-size: 12px !important;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.file-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    transition: background var(--transition-fast);
}

.file-table tbody tr {
    transition: background var(--transition-fast);
}

.file-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.025);
}

html:not(.light-theme) .file-table tbody tr:hover {
    background: var(--bg-hover);
}

.file-table tbody tr:hover td {
    color: var(--text-primary);
}

.table-user-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.table-meta-text {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg-glass);
    flex-shrink: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
}

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

.actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Bulk Actions Toolbar (Level 1 & Level 2) ── */
.bulk-toolbar-container {
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

html.light-theme .bulk-toolbar-container {
    background: var(--bg-card);
    border-color: var(--border-subtle);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bulk-select,
.bulk-input {
    background: var(--bg-card-header);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    height: 38px;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

html.light-theme .bulk-select,
html.light-theme .bulk-input {
    background: var(--bg-input, var(--bg-card));
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.bulk-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239b94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 34px;
    cursor: pointer;
}

.bulk-input {
    min-width: 170px;
}

.bulk-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

html.light-theme .bulk-input::placeholder {
    color: #94a3b8;
}

.bulk-select:hover,
.bulk-input:hover {
    border-color: rgba(124, 58, 237, 0.5);
}

.bulk-select:focus,
.bulk-input:focus {
    border-color: rgba(124, 58, 237, 0.6);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.btn-bulk-apply {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
    height: 38px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn-bulk-apply:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.7);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

html.light-theme .btn-bulk-apply {
    border-color: #7c3aed;
    color: #7c3aed;
}

html.light-theme .btn-bulk-apply:hover {
    background: #7c3aed;
    color: #ffffff;
}

/* ── Activity Feed & Semantic Color Coding ── */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: transparent;
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
}

/* Semantic Action Color Tints */
.activity-icon.action-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #4ade80 !important;
}

.activity-icon.action-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

.activity-icon.action-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

.activity-icon.action-neutral {
    background: rgba(124, 58, 237, 0.12) !important;
    border-color: rgba(124, 58, 237, 0.2) !important;
    color: #c4b5fd !important;
}

.activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.activity-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.activity-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.activity-time {
    font-size: 12px !important;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Version Timeline ── */
.version-timeline {
    position: relative;
    padding-left: 2rem;
}

.version-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-subtle);
}

.version-item {
    position: relative;
    padding: 1rem 0 1rem 1.5rem;
    border-bottom: none;
}

.version-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 1.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--cyan-500);
    z-index: 1;
}

.version-item:first-child::before {
    background: var(--cyan-500);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

.version-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 8px;
}

.version-number {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.version-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.version-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.version-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Diff View ── */
.diff-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.diff-stats-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 12px 16px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
}

.diff-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.diff-stat-add { color: var(--emerald-400); }
.diff-stat-del { color: var(--rose-400); }
.diff-stat-change { color: var(--amber-400); }

.diff-view {
    overflow-x: auto;
}

.diff-line {
    padding: 2px 16px 2px 50px;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    min-height: 1.6em;
    line-height: 1.6;
}

.diff-line-number {
    position: absolute;
    left: 0;
    width: 44px;
    text-align: right;
    padding-right: 12px;
    color: var(--text-muted);
    user-select: none;
    font-size: 0.75rem;
}

.diff-added {
    background: rgba(16, 185, 129, 0.1);
    color: var(--emerald-400);
    border-left: 3px solid var(--emerald-500);
}

.diff-removed {
    background: rgba(244, 63, 94, 0.1);
    color: var(--rose-400);
    border-left: 3px solid var(--rose-500);
}

.diff-header {
    background: rgba(124, 58, 237, 0.08);
    color: var(--cyan-400);
    font-weight: 600;
    border-left: 3px solid var(--cyan-500);
    padding-top: 6px;
    padding-bottom: 6px;
}

.diff-context {
    color: var(--text-muted);
    border-left: 3px solid transparent;
}

/* ── Code View ── */
.code-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.code-body {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
}

.code-body pre {
    margin: 0;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: transparent;
    counter-reset: line;
}

.code-body pre code {
    font-family: inherit;
}

.line-numbers {
    counter-reset: line;
}

.line-numbers .line {
    display: block;
    counter-increment: line;
}

.line-numbers .line::before {
    content: counter(line);
    display: inline-block;
    width: 3em;
    padding-right: 1em;
    text-align: right;
    color: var(--text-muted);
    user-select: none;
    opacity: 0.5;
}

/* ── Alerts / Flash Messages ── */
.alert-toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    position: relative;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--emerald-400);
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--rose-400);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--amber-400);
}

.alert-info {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: var(--cyan-400);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* ── Activity Feed ── */
.activity-feed {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
}

.activity-item:last-child {
    border-bottom: none;
}

/* Keep the file-detail sidebar compact: only the audit entries scroll, while
   the card title stays visible and the adjacent detail panels do not jump. */
.glass-card .file-audit-scroll {
    /* Fixed desktop viewport: three complete audit rows remain comfortably readable. */
    display: block;
    height: 210px !important;
    min-height: 0 !important;
    max-height: 210px !important;
    overflow-x: hidden;
    overflow-y: scroll !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
    padding-right: 6px;
}

.glass-card .file-audit-scroll .activity-item {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.file-audit-scroll::-webkit-scrollbar {
    width: 6px;
}

.file-audit-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.file-audit-scroll::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border: 2px solid transparent;
    border-radius: 8px;
    background-clip: content-box;
}

.file-audit-scroll::-webkit-scrollbar-thumb:hover {
    background-color: var(--cyan-500);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: var(--bg-glass);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

/* ── File Detail Page ── */
.file-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.file-detail-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.file-detail-info {
    flex: 1;
    min-width: 0;
}

.file-detail-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

/* ── High Visibility Breadcrumbs ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--cyan-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: #67e8f9;
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--cyan-400);
    font-weight: 700;
    font-size: 1rem;
    opacity: 0.9;
}

.file-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.file-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
}

.file-detail-meta-item span {
    color: var(--text-primary);
    font-weight: 600;
}

.file-detail-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Checkout banner */
.checkout-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    color: var(--amber-400);
    font-size: 0.9rem;
}

.checkout-banner strong {
    color: var(--amber-400);
}

/* ── Info Grid ── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 1rem;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
}

.info-label {
    font-size: 0.725rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 6px;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Permissions Table ── */
.perm-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.perm-table th {
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.perm-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

.perm-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.perm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ── Hero / Landing Page ── */
.hero-section {
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1), transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--cyan-400);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    letter-spacing: -0.03em;
}

.hero-title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 5rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: left;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:nth-child(1)::before { background: var(--gradient-primary); }
.feature-card:nth-child(2)::before { background: linear-gradient(90deg, var(--amber-500), var(--amber-400)); }
.feature-card:nth-child(3)::before { background: linear-gradient(90deg, var(--violet-500), var(--rose-400)); }

.feature-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-icon-cyan { background: rgba(124, 58, 237, 0.12); }
.feature-icon-amber { background: rgba(245, 158, 11, 0.12); }
.feature-icon-violet { background: rgba(139, 92, 246, 0.12); }

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Guaranteed Zero-Scroll Viewport Lock on All Auth Pages (with scroll fallback) ── */
html:has(.auth-container),
body:has(.auth-container),
body.auth-page,
.auth-layout {
    min-height: 100vh !important;
    overflow-y: auto !important;
}

body.auth-page .app-layout,
.auth-layout {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
}

body.auth-page .navbar-glass,
.auth-layout .navbar-glass {
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 1.5rem !important;
    flex-shrink: 0 !important;
}

body.auth-page .app-footer,
.auth-layout .app-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 24px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
    border-top: 1px solid var(--border-subtle) !important;
    color: var(--text-muted) !important;
    background: transparent !important;
}

body.auth-page .main-content,
.auth-layout .main-content,
.main-content:has(.auth-container) {
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow-y: auto !important;
}

.auth-container {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.25rem 1.6rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    margin: 0 auto;
    width: 100%;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.auth-logo {
    text-align: center;
    margin-bottom: 0.85rem;
}

.auth-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    box-shadow: var(--shadow-glow-cyan);
}

.auth-logo-icon svg {
    width: 22px;
    height: 22px;
}

.auth-logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 2px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.auth-card .form-group {
    margin-bottom: 0.65rem;
}

.auth-card .form-label {
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: block;
}

.auth-card .form-input {
    padding: 7px 11px;
    font-size: 0.88rem;
    border-radius: 6px;
}

/* ── Auto-Dismissible Auth Field Error Alerts ── */
.auth-error-alert {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #f43f5e;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.76rem;
    line-height: 1.35;
    margin-top: 5px;
    margin-bottom: 2px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.1);
    animation: alertSlideFadeIn 0.25s ease-out;
    max-height: 150px;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

@keyframes alertSlideFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-error-alert .auth-error-content {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex: 1;
}

.auth-error-alert .auth-error-icon {
    font-size: 0.82rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.auth-error-alert .auth-error-msg {
    flex: 1;
    word-break: break-word;
}

.auth-error-alert .auth-alert-close {
    background: none;
    border: none;
    color: #f43f5e;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.7;
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.auth-error-alert .auth-alert-close:hover {
    opacity: 1;
    transform: scale(1.15);
}

html.light-theme .auth-error-alert,
body.light-theme .auth-error-alert {
    background: #fff1f2;
    border-color: #fda4af;
    color: #e11d48;
}

html.light-theme .auth-error-alert .auth-alert-close,
body.light-theme .auth-error-alert .auth-alert-close {
    color: #e11d48;
}

/* ── Password Field Visibility Toggle ── */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .form-input {
    padding-right: 40px !important;
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
    background-color: rgba(124, 58, 237, 0.08);
}

.password-toggle-btn .ui-icon,
.password-toggle-btn svg {
    width: 17px;
    height: 17px;
    display: block;
    color: currentColor;
}

/* Suppress browser native password reveal icon (Microsoft Edge, IE, WebKit) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="text"]::-ms-reveal,
input[type="text"]::-ms-clear,
input::-ms-reveal,
input::-ms-clear {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

input::-webkit-credentials-auto-fill-button,
input::-webkit-contacts-auto-fill-button {
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
}

.auth-card .otp-code-input {
    padding: 7px 11px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .3em;
    text-align: center;
}

.auth-card .btn-primary-gradient,
.auth-card button[type="submit"] {
    padding: 9px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 6px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card .otp-help {
    font-size: 11px;
    margin: 2px 0 8px;
    color: var(--text-muted);
}

.auth-card .otp-resend-form {
    margin-top: 6px;
    display: flex;
    justify-content: center;
}

.auth-card .auth-account-badge {
    margin-bottom: 8px !important;
    padding: 6px 10px !important;
}

.auth-inline-link {
    display: flex;
    justify-content: flex-end;
    margin: -2px 0 8px;
    font-size: 11px;
}

.auth-security-note {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

/* ── Modern OTP Verification Component Styles ── */
.otp-info-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 12px;
}

html:not(.light-theme) .otp-info-panel {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.otp-info-col {
    display: flex;
    flex-direction: column;
}

.otp-info-col.otp-col-user {
    flex: 0 0 auto;
}

.otp-info-col.otp-col-email {
    flex: 1 1 auto;
    min-width: 0;
}

.otp-info-col.text-right {
    text-align: right;
    align-items: flex-end;
}

.otp-info-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1px;
}

.otp-info-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    max-width: 100%;
    line-height: 1.3;
}

/* 6-box OTP input with high accessibility contrast (WCAG) */
.otp-boxes-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 8px;
}

.otp-digit-box {
    width: 44px;
    height: 44px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    color: #111827;
    transition: all 0.15s ease-in-out;
    outline: none;
}

html:not(.light-theme) .otp-digit-box {
    background: #182221;
    border-color: #4b5563;
    color: #f3f4f6;
}

.otp-digit-box:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25) !important;
}

.otp-digit-box.is-invalid {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.04) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.otp-helper-text {
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: center;
    margin: 4px 0 12px;
    white-space: nowrap;
    line-height: 1.35;
}

.otp-helper-text.is-error {
    color: #ef4444;
    font-weight: 500;
}

.btn-outline-white {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-outline-white:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.btn-outline-white.is-disabled,
.btn-outline-white:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.otp-resend-container {
    margin-top: 8px;
}

.auth-divider-line {
    height: 1px;
    background: var(--border-subtle);
    margin: 12px 0 10px;
}

.auth-footer-clean {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-purple-link {
    color: #7c3aed !important;
    font-weight: 500;
    margin-left: 4px;
    text-decoration: none;
}

.auth-purple-link:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--cyan-400);
    font-weight: 500;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 12px;
}



/* ── Footer ── */
.app-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── Confirmation Modal ── */
.vv-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(2px);
}

.vv-modal-overlay[hidden] {
    display: none !important;
}

.vv-modal-overlay:not([hidden]) {
    display: block;
}

.vv-modal-overlay .vv-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-100%, -50%);
    box-sizing: border-box;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    pointer-events: auto;
}

@media (max-width: 760px) {
    .vv-modal-overlay .vv-modal {
        left: 50% !important;
        top: 50% !important;
        width: min(92vw, 480px) !important;
        transform: translate(-50%, -50%);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    box-sizing: border-box;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    max-width: 480px;
    width: 90%;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    box-sizing: border-box;
    margin: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .navbar-glass {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .file-detail-header {
        flex-direction: column;
    }

    .glass-card .file-audit-scroll {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        padding-right: 0;
    }

    .file-detail-actions {
        width: 100%;
    }

    .tabs-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .version-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 3rem 1rem 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn-primary-gradient,
    .hero-buttons .btn-ghost {
        width: 100%;
        justify-content: center;
    }
}

/* ── Utility Classes ── */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-cyan { color: var(--cyan-400); }
.text-emerald { color: var(--emerald-400); }
.text-amber { color: var(--amber-400); }
.text-rose { color: var(--rose-400); }
.text-violet { color: var(--violet-400); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-0 { gap: 0; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
[hidden] { display: none !important; }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.fs-sm { font-size: 0.8rem; }
.fs-xs { font-size: 0.75rem; }

.w-100 { width: 100%; }
.text-center { text-align: center; }

/* ── Repository & Organization Navigation Tabs ── */
.repo-nav-tabs,
.repo-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
    padding-bottom: 0px;
    overflow-x: auto;
}

.btn-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none !important;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
    line-height: 1.4;
    cursor: pointer;
}

.btn-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-tab.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    background: rgba(124, 58, 237, 0.08);
}

.btn-tab .badge {
    margin-left: 4px;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.btn-tab.active .badge {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ── Form Controls & Inputs (Dark / Light Theme Crisp Inputs) ── */
.form-control,
input[type="text"].form-control,
input[type="password"].form-control,
input[type="email"].form-control,
input[type="search"].form-control,
select.form-control,
textarea.form-control {
    display: block;
    width: 100%;
    height: 40px;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-card-header);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-control:hover {
    border-color: var(--border-accent);
    background-color: var(--bg-hover);
}

.form-control:focus {
    color: var(--text-primary);
    background-color: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239b94a8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 10px;
    padding-right: 36px;
    cursor: pointer;
}

select.form-control option {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* ── Modern Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.15s ease;
    user-select: none;
    box-sizing: border-box;
    text-align: center;
}

.btn.w-100,
.btn-block {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff !important;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card-header);
    border: 1px solid var(--border-medium);
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
    color: var(--text-primary) !important;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: var(--primary-hover);
}

.btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* ── SHA & Branch Badges ── */
.commit-sha-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.commit-sha-pill:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.08);
}

.badge-default-branch {
    background: rgba(124, 58, 237, 0.15);
    color: var(--violet-400);
    border: 1px solid rgba(124, 58, 237, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Floating Toast Overlay ── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.alert-toast {
    pointer-events: auto;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert-toast.toast-rich {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 290px;
    max-width: 420px;
    padding: 10px 14px;
}

.alert-toast span {
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.alert-toast.alert-success {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.alert-toast.alert-danger {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.2);
}

.alert-toast.alert-warning {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.alert-toast.alert-info {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.2);
}

/* ── Light Mode Toast Notification Overrides ── */
body.light-theme .alert-toast {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .alert-toast span {
    color: #0f172a !important;
    font-weight: 600 !important;
}

body.light-theme .alert-toast.alert-success {
    border-left: 5px solid #10b981 !important;
}

body.light-theme .alert-toast.alert-danger {
    border-left: 5px solid #f43f5e !important;
}

body.light-theme .alert-toast.alert-warning {
    border-left: 5px solid #f59e0b !important;
}

body.light-theme .alert-toast.alert-info {
    border-left: 5px solid #7c3aed !important;
}

body.light-theme .alert-close {
    color: #64748b !important;
}

body.light-theme .alert-close:hover {
    color: #0f172a !important;
}

.alert-toast span {
    flex: 1;
}

.alert-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.alert-close:hover {
    color: var(--text-primary);
}

/* ── Theme Toggle Button ── */
.theme-toggle-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    outline: none;
}

.theme-toggle-btn:hover {
    background: var(--bg-glass-hover);
    transform: scale(1.08);
    border-color: var(--cyan-500);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.3);
}

/* ── Warm, Non-Glaring Professional Light Theme (Linear / Slack SaaS Aesthetic) ── */
html.light-theme,
body.light-theme {
    --bg-primary: var(--bg-page);
    --bg-secondary: var(--bg-card);
    --bg-card-hover: var(--bg-hover);
    --bg-glass: var(--bg-card-header);
    --bg-glass-hover: var(--bg-hover);
    --bg-input: var(--bg-card-header);
    --bg-input-focus: var(--bg-hover);
    --gradient-bg: var(--bg-page);
}

body.light-theme::before {
    display: none;
}

body.light-theme .navbar-glass {
    background: var(--bg-card-header, var(--bg-card));
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

body.light-theme .nav-brand {
    color: var(--text-primary);
}

body.light-theme .nav-username {
    color: var(--text-secondary);
}

body.light-theme .nav-link.active {
    background: rgba(124, 58, 237, 0.08) !important;
    color: #7c3aed !important;
    border-color: rgba(124, 58, 237, 0.2) !important;
}

body.light-theme .glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

body.light-theme .glass-card:hover {
    border-color: var(--border-medium);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.light-theme .glass-card-header {
    border-bottom-color: var(--border-subtle);
}

body.light-theme .stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

body.light-theme .stat-value {
    color: var(--text-primary);
}

body.light-theme .stat-label {
    color: var(--text-muted);
}

body.light-theme .stat-icon-cyan { background: #ecfeff; color: #0891b2; }
body.light-theme .stat-icon-amber { background: #fffbeb; color: #d97706; }
body.light-theme .stat-icon-violet { background: #f5f3ff; color: #7c3aed; }
body.light-theme .stat-icon-emerald { background: #ecfdf5; color: #059669; }

body.light-theme .tabs-container {
    border-bottom-color: var(--border-subtle);
}

body.light-theme .tab-btn {
    color: var(--text-muted);
}

body.light-theme .tab-btn:hover {
    color: var(--text-primary);
}

body.light-theme .tab-btn.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

body.light-theme .tab-count {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

body.light-theme .tab-btn.active .tab-count {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.2);
}

body.light-theme .file-table th {
    background: var(--bg-card-header);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
}

body.light-theme .file-table td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

body.light-theme .file-table tbody tr:hover {
    background: var(--bg-hover);
}

body.light-theme .file-name a {
    color: #7c3aed;
    font-weight: 600;
}

body.light-theme .file-meta {
    color: var(--text-muted);
}

body.light-theme .form-input,
body.light-theme select.form-control {
    background: var(--bg-input, var(--bg-card));
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

body.light-theme .form-input:focus,
body.light-theme select.form-control:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

body.light-theme .btn-ghost {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

body.light-theme .btn-ghost:hover {
    background: var(--bg-hover);
    border-color: #7c3aed;
    color: #7c3aed;
}

body.light-theme .breadcrumb a {
    color: #7c3aed;
}

body.light-theme .breadcrumb-sep {
    color: #7c3aed;
}

body.light-theme .file-detail-meta-item {
    background: var(--bg-hover);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

body.light-theme .file-detail-meta-item span {
    color: var(--text-primary);
}

body.light-theme .info-item {
    background: var(--bg-hover);
    border-color: var(--border-subtle);
}

/* ── Live Auto-Sync Badge ── */
.live-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--emerald-400);
}

.sync-pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: syncPulse 1.8s infinite ease-in-out;
}

@keyframes syncPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #10b981; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

body.light-theme .live-sync-badge {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

/* ── Character & Word Level Inline Diff Badges ── */
mark.diff-word-add {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #059669 !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    border: 1px solid #10b981 !important;
    text-decoration: none !important;
}

mark.diff-word-del {
    background: rgba(244, 63, 94, 0.25) !important;
    color: #e11d48 !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    border: 1px solid #f43f5e !important;
    text-decoration: line-through !important;
}

body.light-theme mark.diff-word-add {
    background: #d1fae5 !important;
    color: #047857 !important;
    border-color: #34d399 !important;
}

/* ── Pro Diff Container & Horizontal/Vertical Scrollbar Controls ── */
.diff-container {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.diff-stats-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
}

.diff-stat-add { color: #059669; }
.diff-stat-del { color: #e11d48; }
.diff-stat-change { color: #7c3aed; }

.diff-view {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 680px;
    padding: 12px 0;
    white-space: pre;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* Custom Scrollbars for Smooth Horizontal & Vertical Scrolling */
.diff-view::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.diff-view::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
}

.diff-view::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.4);
    border-radius: 6px;
}

.diff-view::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.7);
}

.diff-line {
    padding: 3px 20px;
    margin: 1px 0;
    line-height: 1.45;
    min-width: max-content;
    box-sizing: border-box;
    display: block;
}

.diff-line:empty,
.diff-line.diff-context:empty {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.diff-line.diff-added {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    border-left: 4px solid #10b981;
}

.diff-line.diff-removed {
    background: rgba(244, 63, 94, 0.08);
    color: #be123c;
    border-left: 4px solid #f43f5e;
}

.diff-line.diff-header {
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
    font-weight: 700;
    border-left: 4px solid #7c3aed;
    margin-top: 4px;
    margin-bottom: 4px;
}

.diff-line.diff-context {
    color: #475569;
    border-left: 4px solid transparent;
}

/* Dark theme overrides for diff container */
body:not(.light-theme) .diff-container {
    background: #0f172a;
    border-color: #1e293b;
}

body:not(.light-theme) .diff-stats-bar {
    background: #1e293b;
    border-color: #334155;
}

body:not(.light-theme) .diff-line.diff-added {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

body:not(.light-theme) .diff-line.diff-removed {
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
}

body.light-theme mark.diff-word-del {
    background: #ffe4e6 !important;
    color: #be123c !important;
    border-color: #fb7185 !important;
}

body.light-theme .info-label {
    color: #64748b;
}

body.light-theme .info-value {
    color: #0f172a;
}



body.light-theme .git-user-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.15);
}

body.light-theme .git-user-header {
    background: #f8fafc;
    color: #7c3aed;
    border-bottom-color: #e2e8f0;
}

body.light-theme .git-user-item {
    border-bottom-color: #f1f5f9;
}

body.light-theme .git-user-item:hover {
    background: #f4efff;
}

body.light-theme .git-user-name {
    color: #0f172a;
}

body.light-theme .app-footer {
    border-top-color: #e2e8f0;
    color: #64748b;
}

/* ── Compare File Versions: focused review workspace ── */
.compare-page {
    --compare-surface: #ffffff;
    --compare-surface-soft: #f5faf8;
    --compare-border: #d7e4df;
    --compare-ink: #24292f;
    --compare-muted: #68766f;
    --compare-blue: #7c3aed;
    --compare-add: #047857;
    --compare-add-bg: #e5f8f2;
    --compare-remove: #be123c;
    --compare-remove-bg: #fff0f3;
    --compare-page-brightness: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem;
    color: var(--compare-ink);
    background: #f6f8fa;
    border: 1px solid #d8dee4;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    filter: brightness(var(--compare-page-brightness));
}

.compare-page .breadcrumb {
    margin-bottom: 0.9rem;
}

.compare-page .breadcrumb a { color: #0969da; }
.compare-page .breadcrumb li { color: #57606a; }
.compare-page .breadcrumb .text-primary,
.compare-page .page-header h1,
.compare-page h1,
.compare-page h2,
.compare-page h3 { color: var(--compare-ink); }
.compare-page .text-muted,
.compare-page .text-secondary { color: var(--compare-muted) !important; }

.compare-page-header {
    margin-bottom: 1.25rem;
}

.compare-heading,
.compare-preview-actions,
.compare-selectors,
.version-snapshot-pair,
.compare-score-group,
.compare-metric-list,
.diff-panel-title,
.diff-panel-stats {
    display: flex;
    align-items: center;
}

.compare-heading { gap: 0.6rem; }
.compare-heading-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, #7c3aed, #8250df);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.22);
    font-size: 1.15rem;
    line-height: 1;
}

.compare-page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.compare-page-header p { margin-top: 0.15rem; font-size: 0.82rem; }
.compare-preview-actions { gap: 0.5rem; }
.compare-preview-actions .btn-ghost { white-space: nowrap; }
.compare-brightness-control {
    display: grid;
    grid-template-columns: auto minmax(92px, 126px);
    align-items: center;
    column-gap: 0.55rem;
    row-gap: 0.18rem;
    padding: 0.35rem 0.55rem;
    color: #57606a;
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25;
}
.compare-brightness-control label { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 1rem; }
.compare-brightness-control output { color: #0969da; font-variant-numeric: tabular-nums; }
.compare-brightness-control input[type="range"] {
    grid-column: 1 / -1;
    width: 100%;
    height: 16px;
    accent-color: #0969da;
    cursor: pointer;
}
.compare-brightness-control input[type="range"]:focus-visible { outline: 2px solid #0969da; outline-offset: 3px; }

.compare-toolbar,
.compare-metrics,
.compare-empty {
    background: var(--compare-surface);
    border: 1px solid var(--compare-border);
    box-shadow: 0 8px 26px rgba(30, 64, 100, 0.07);
}

.compare-toolbar {
    border-radius: 15px 15px 0 0;
    overflow: hidden;
}

.compare-selector-row {
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}

.compare-selectors { gap: 0.75rem; }
.compare-field { min-width: 235px; }
.compare-field .form-label {
    display: block;
    margin: 0 0 0.38rem;
    color: var(--compare-muted);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}
.compare-field .form-label span { font-weight: 600; }
.compare-field select.form-control {
    min-height: 39px;
    padding: 7px 34px 7px 11px;
    font-weight: 650;
    border-radius: 8px;
    color: var(--compare-ink);
    background-color: #ffffff;
    border-color: #8c959f;
}
.compare-field select.form-control:focus { border-color: #0969da; box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.16); }
.compare-direction { margin-top: 1.25rem; color: #71817a; font-size: 1.2rem; }
.compare-submit { padding-bottom: 1px; }
.compare-submit .btn-primary-gradient { min-height: 39px; padding-inline: 1.1rem; }

.version-snapshot-pair { gap: 0.5rem; }
.version-snapshot {
    min-width: 138px;
    padding: 0.48rem 0.65rem;
    border: 1px solid #c8dfd9;
    border-radius: 8px;
    background: #f3fbf9;
    font-size: 0.73rem;
}
.version-snapshot-target { background: #effbf7; border-color: #c6eadf; }
.version-snapshot strong { display: block; color: var(--compare-ink); }
.version-snapshot div { display: flex; gap: 0.45rem; margin-top: 2px; color: var(--compare-muted); }
.version-snapshot code { color: var(--compare-blue); }
.snapshot-arrow { color: #86958f; }

.compare-metrics {
    margin-bottom: 1.15rem;
    padding: 0.8rem 1.2rem;
    border-top: 0;
    border-radius: 0 0 15px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.compare-score-group { gap: 0.65rem; flex-wrap: wrap; }
.metric-score { display: flex; align-items: baseline; gap: 0.45rem; color: var(--compare-blue); }
.metric-score span,
.metric-size { color: var(--compare-muted); font-size: 0.73rem; font-weight: 700; }
.metric-score strong { font-size: 1.15rem; }
.metric-confidence {
    padding: 0.3rem 0.62rem;
    border: 1px solid #bfe8d9;
    border-radius: 7px;
    background: #effbf7;
    color: #06745a;
    font-size: 0.72rem;
    font-weight: 700;
}
.metric-dot { width: 6px; height: 6px; margin-right: 0.38rem; display: inline-block; border-radius: 50%; background: #10b981; }
.metric-size strong { color: var(--compare-ink); margin-left: 0.25rem; }
.compare-metric-list { gap: 0; }
.compare-metric {
    min-width: 96px;
    padding: 0.12rem 0.75rem;
    border-left: 1px solid var(--compare-border);
}
.compare-metric span { display: block; color: var(--compare-muted); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.compare-metric strong { font-size: 0.88rem; }
.metric-added strong { color: var(--compare-add); }
.metric-removed strong { color: var(--compare-remove); }
.metric-changes strong { color: var(--compare-blue); }
.metric-hash strong { color: #6850c8; }

.compare-page .diff-container {
    border: 1px solid #cadbd6;
    border-radius: 13px;
    background: var(--compare-surface);
    box-shadow: 0 12px 32px rgba(31, 53, 47, 0.1);
}
.compare-page .diff-stats-bar {
    position: relative;
    z-index: 2;
    min-height: 48px;
    padding: 0.7rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: #edf7f4;
    border-bottom: 1px solid #cadbd6;
    color: var(--compare-ink);
}
.diff-panel-title { gap: 0.5rem; font-size: 0.78rem; }
.diff-panel-title > span:last-child { color: var(--compare-muted); font-weight: 500; }
.diff-status-dot { width: 9px; height: 9px; border: 2px solid #ffffff; border-radius: 50%; background: #1c433e; box-shadow: 0 0 0 1px #78918a; }
.diff-panel-stats { gap: 0.9rem; }
.compare-page .diff-stat { font-size: 0.76rem; font-weight: 750; }
.compare-page .diff-view {
    max-height: min(66vh, 720px);
    min-height: 260px;
    padding: 0.6rem 0 0.8rem;
    background: #fcfdfc;
    font-size: 0.79rem;
    line-height: 1.45;
    /* Collapse template indentation between rows; preserve diff text on each row. */
    white-space: normal;
    scrollbar-color: #78afa5 #edf7f4;
    scrollbar-width: thin;
}
.compare-page .diff-line {
    min-height: 25px;
    margin: 0;
    padding: 3px 16px 3px 20px;
    border-left-width: 4px;
    line-height: 1.48;
    white-space: pre;
    overflow-wrap: normal;
    word-wrap: normal;
}
.compare-page .diff-line.diff-added {
    background: var(--compare-add-bg);
    color: #066b55;
    border-color: #10b981;
}
.compare-page .diff-line.diff-removed {
    background: var(--compare-remove-bg);
    color: #a8173b;
    border-color: #fb3f67;
    text-decoration-color: rgba(190, 18, 60, 0.75);
}
.compare-page .diff-line.diff-header {
    margin: 0.45rem 0;
    background: #f4efff;
    color: #5b21b6;
    border-color: #48a9a0;
}
.compare-page .diff-line.diff-context { color: #52657d; }
.compare-page mark.diff-word-add,
.compare-page mark.diff-word-del {
    padding: 1px 4px !important;
    border-radius: 3px !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.compare-page mark.diff-word-add {
    background: #baf0dd !important;
    color: #006a4f !important;
    border-color: #24bd8f !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1.5px !important;
    text-underline-offset: 2px !important;
}
.compare-page mark.diff-word-del {
    background: #ffd6df !important;
    color: #a20f34 !important;
    border-color: #fb6a88 !important;
}
.compare-page .compare-empty { border-radius: 13px; padding: 2.5rem; text-align: center; }
.compare-page .btn-ghost {
    color: #0969da;
    background: #ffffff;
    border-color: #d0d7de;
}
.compare-page .btn-ghost:hover { background: #f3f4f6; border-color: #8c959f; }

/* This review workspace deliberately remains light even while the application shell is dark. */
body:not(.light-theme) .compare-page .diff-container,
body:not(.light-theme) .compare-page .diff-view { background: #ffffff; }
body:not(.light-theme) .compare-page .diff-stats-bar {
    background: #edf7f4;
    border-color: #cadbd6;
    color: var(--compare-ink);
}
body:not(.light-theme) .compare-page .diff-line.diff-added {
    background: var(--compare-add-bg);
    color: #066b55;
    border-color: #10b981;
}
body:not(.light-theme) .compare-page .diff-line.diff-removed {
    background: var(--compare-remove-bg);
    color: #a8173b;
    border-color: #fb3f67;
}
body:not(.light-theme) .compare-page .diff-line.diff-context { color: #52657d; }

@media (max-width: 1100px) {
    .compare-selector-row,
    .compare-metrics { align-items: stretch; flex-direction: column; }
    .version-snapshot-pair { justify-content: flex-start; }
    .compare-metric-list { width: 100%; }
    .compare-metric { flex: 1; }
}

@media (max-width: 720px) {
    .compare-page-header { align-items: flex-start; }
    .compare-preview-actions { width: 100%; flex-wrap: wrap; }
    .compare-brightness-control { flex: 1 0 100%; }
    .compare-preview-actions .btn-ghost { flex: 1; justify-content: center; }
    .compare-selectors { align-items: stretch; flex-direction: column; width: 100%; }
    .compare-field { min-width: 0; width: 100%; }
    .compare-direction { display: none; }
    .compare-submit .btn-primary-gradient { width: 100%; justify-content: center; }
    .version-snapshot-pair { flex-wrap: wrap; }
    .compare-metric-list { display: grid; grid-template-columns: 1fr 1fr; }
    .compare-metric { border: 1px solid var(--compare-border); padding: 0.45rem 0.65rem; }
    .compare-page .diff-stats-bar { align-items: flex-start; flex-direction: column; }
    .diff-panel-stats { gap: 0.6rem; flex-wrap: wrap; }
    .compare-page .diff-view { min-height: 220px; max-height: 62vh; }
}

/* ── Workspaces and document libraries ── */
.workspace-card-link,
.workspace-item {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.workspace-card-link {
    align-items: flex-start;
    flex-direction: column;
}

.workspace-card-link:last-child,
.workspace-item:last-child { border-bottom: 0; }
.workspace-card-link:hover,
.workspace-item:hover { color: var(--cyan-400); }
.workspace-card-link span { color: var(--text-muted); font-size: 0.82rem; }
.workspace-item .text-muted { margin-left: auto; font-size: 0.8rem; }

/* ── Notion-Tier Document Header & Properties Styles ── */
.notion-doc-header {
    position: relative;
    z-index: 10;
    overflow: visible;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.notion-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    margin-bottom: 0.85rem;
    position: relative;
    z-index: 11;
}

.notion-title-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 260px;
}

.notion-file-icon {
    width: 42px;
    height: 42px;
    font-size: 1.35rem;
    border-radius: 10px;
    background: var(--bg-glass, rgba(124, 58, 237, 0.08));
    border: 1px solid var(--border-subtle, rgba(124, 58, 237, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notion-title-text {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
    word-break: break-word;
}

.notion-prop-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.notion-prop-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    padding: 4px 12px;
    min-height: 34px;
    box-sizing: border-box;
    background: var(--bg-surface, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
    border-radius: 6px;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.notion-prop-item:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
    border-color: var(--border-color, rgba(0, 0, 0, 0.14));
}

.notion-prop-name {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    border-right: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
    padding-right: 8px;
    margin-right: 2px;
}

.notion-prop-val {
    color: var(--text-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.notion-prop-desc {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle, rgba(255,255,255,0.08));
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.85rem;
}

.notion-prop-desc-text {
    color: var(--text-secondary);
    line-height: 1.5;
}

.file-detail-header {
    position: relative;
    z-index: 100;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.file-detail-header-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.file-detail-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-detail-info {
    flex: 1;
    min-width: 0; /* Critical: prevents word-wrap layout overflow */
}

.file-detail-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 102;
}

.file-detail-info h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: anywhere;
    margin: 0;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
}

.file-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    margin-top: 0.4rem;
}

.file-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-glass);
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}

.file-detail-actions {
    display: none; /* Replaced by SharePoint-style 3-dot dropdown menu */
}

/* ══ Modern SharePoint-Style 3-Dot Dropdown Menu ══════════════════ */
.vv-sp-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 2;
}

.vv-sp-dropdown-wrapper.is-open,
.vv-sp-dropdown-wrapper:has(.vv-sp-dropdown-menu.show),
tr.row-dropdown-active,
tr:has(.vv-sp-dropdown-menu.show) {
    z-index: 99999 !important;
    position: relative !important;
}

.vv-sp-dots-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-glass, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
    color: var(--text-primary, #ffffff);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vv-sp-dots-btn:hover,
.vv-sp-dots-btn.active {
    background: var(--bg-hover, rgba(124, 58, 237, 0.18));
    border-color: var(--color-primary, #7c3aed);
    color: var(--color-primary, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.vv-sp-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 210px;
    max-width: 270px;
    max-height: min(480px, calc(100vh - 40px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--bg-card, #171523);
    border: 1px solid var(--border-card, rgba(255, 255, 255, 0.18));
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 999999 !important;
    flex-direction: column;
    gap: 1px;
    animation: spDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.vv-sp-dropdown-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

html.light-theme .vv-sp-dropdown-menu {
    background: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14), 0 3px 10px rgba(0, 0, 0, 0.06) !important;
}

.vv-sp-dropdown-menu.vv-sp-dropdown-menu-2col {
    min-width: 520px !important;
    max-width: 620px !important;
    width: max-content !important;
    padding: 10px !important;
    overflow-x: visible !important;
}

.vv-sp-dropdown-grid {
    display: flex;
    gap: 12px;
    width: 100%;
}

.vv-sp-dropdown-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
}

.vv-sp-dropdown-col:not(:last-child) {
    border-right: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    padding-right: 10px;
}

html.light-theme .vv-sp-dropdown-col:not(:last-child) {
    border-right-color: #e2e8f0;
}

.vv-sp-col-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    padding: 3px 6px 4px;
    user-select: none;
}

.vv-sp-dropdown-menu.show {
    display: flex !important;
}

.vv-sp-dropdown-menu.drop-up {
    top: auto !important;
    bottom: calc(100% + 4px) !important;
    animation: spDropdownFadeInUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes spDropdownFadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.vv-sp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
    min-height: 26px;
    font-size: 0.80rem;
    line-height: 1.25;
    font-weight: 500;
    color: var(--text-primary, #e2e8f0);
    text-decoration: none;
    border-radius: 5px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    transition: background 0.12s ease, color 0.12s ease;
}

html.light-theme .vv-sp-dropdown-item {
    color: #1e293b;
}

.vv-sp-dropdown-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.12));
    color: var(--color-primary, #7c3aed);
}

.vv-sp-dropdown-item.text-danger {
    color: #ef4444;
}

.vv-sp-dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.vv-sp-item-icon {
    font-size: 0.85rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vv-sp-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: visible;
}

.vv-sp-dropdown-divider {
    height: 1px;
    background: var(--border-subtle, rgba(255, 255, 255, 0.08));
    margin: 2px 3px;
}

html.light-theme .vv-sp-dropdown-divider {
    background: #f1f5f9;
}

.vv-sp-item-form {
    margin: 0;
    padding: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .file-detail-header-top {
        flex-direction: column;
    }
    .file-detail-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .file-detail-info h1 {
        font-size: 1.2rem;
    }
}
/* ================================================================
   VersionVault enterprise refresh — quiet SharePoint/Git discipline
   ================================================================ */
:root {
    --blue-500: #7c3aed;
    --cyan-400: #7c3aed;
    --cyan-500: #7c3aed;
    --cyan-600: #5b21b6;
    --violet-400: #a98ae9;
    --violet-500: #8250df;
    --gradient-primary: #7c3aed;
    --gradient-secondary: #8250df;
    --gradient-success: #1a7f37;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgba(31,35,40,.07);
    --shadow-md: 0 4px 12px rgba(31,35,40,.08);
    --shadow-lg: 0 12px 30px rgba(31,35,40,.12);
}

html.light-theme {
    --bg-primary: var(--bg-page);
    --bg-secondary: var(--bg-card);
    --bg-card-hover: var(--bg-hover);
    --bg-glass: var(--bg-card-header);
    --bg-glass-hover: var(--bg-hover);
    --bg-input: var(--bg-card-header);
    --bg-input-focus: var(--bg-hover);
    --gradient-bg: var(--bg-page);
}

body::before { display: none; }
body { font-size: 14px; line-height: 1.5; }

.navbar-glass {
    min-height: 64px;
    padding: 0 28px;
    background: var(--bg-secondary);
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}
.navbar-glass:hover { border-color: var(--border-subtle); box-shadow: none; }
.nav-brand { color: var(--text-primary); font-size: 18px; letter-spacing: -.02em; }
.nav-brand-icon {
    width: 30px; height: 30px; border-radius: 7px; background: #7c3aed;
    color: #fff; font-size: 15px; font-weight: 800; box-shadow: inset 0 -1px rgba(0,0,0,.16);
}
.nav-links { gap: 4px !important; }
.nav-link-item { padding: 9px 12px; border-radius: 6px; color: var(--text-secondary); font-weight: 500; }
.nav-link-item::before { display: none; }
.nav-link-item:hover { background: var(--bg-glass-hover); color: var(--text-primary); transform: none; }
.nav-link-item.active { color: #5b21b6; background: #f4efff; }
.nav-right { gap: 10px; }
.live-sync-badge { border-radius: 6px; font-size: 12px; font-weight: 600; padding: 6px 9px; }
.public-domain-badge { cursor: pointer; color: var(--emerald-500); background: rgba(31,136,61,.08); border-color: rgba(31,136,61,.28); font-family: inherit; }
.theme-toggle-btn, .nav-avatar { border-radius: 50%; }

.main-content {
    width: min(1320px, calc(100% - 64px));
    max-width: none;
    margin-inline: auto;
    padding: 46px 34px 62px;
}

/* File detail uses a deliberate workbench and control-rail composition.
   The canvas remains dark, while the small surface and border differences make
   the outer gutters and separate reading areas immediately visible. */
.file-detail-workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: start;
}

.file-detail-primary,
.file-detail-sidebar {
    min-width: 0;
}

.file-detail-sidebar {
    display: grid;
    gap: 18px;
    padding-left: 14px;
    border-left: 1px solid var(--border-subtle);
}

.file-detail-sidebar .glass-card {
    margin-bottom: 0 !important;
}

html:not(.light-theme) body {
    background: var(--bg-page);
}

html:not(.light-theme) .main-content {
    background: var(--bg-page);
    border: 0;
    box-shadow: none;
}

html:not(.light-theme) .file-detail-workbench-grid > .file-detail-primary > .glass-card,
html:not(.light-theme) .file-detail-sidebar .glass-card {
    /* Layer three: clearly elevated charcoal panels. */
    background: #1d2b28;
    border-color: #455c54;
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(227, 240, 234, 0.025);
}

html:not(.light-theme) .file-detail-sidebar {
    border-left-color: #567067;
}

html:not(.light-theme) .file-detail-workbench-grid .glass-card-header {
    background: #1a2724;
    border-bottom-color: #3d554d;
}

html:not(.light-theme) .file-detail-workbench-grid .glass-card-header h4 {
    color: #edf5f1;
}
.page-header { align-items: flex-end; margin-bottom: 16px; }
.page-header h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.eyebrow { color: #7c3aed; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }

.glass-card, .stat-card {
    background: var(--bg-card); border: var(--border-card); border-radius: 8px;
    box-shadow: var(--shadow-sm); backdrop-filter: none;
}
.glass-card::before { display: none; }
.glass-card:hover, .stat-card:hover { border-color: var(--border-medium); box-shadow: var(--shadow-sm); transform: none; }
.stats-grid { gap: 10px; }
.stat-card { min-height: 52px; padding: 0.65rem 0.95rem; }
.stat-card::before { display: none; }
.stat-value { font-size: 1.25rem; }
.stat-icon { border-radius: 6px; box-shadow: none; width: 32px; height: 32px; }
.stat-icon svg { width: 16px; height: 16px; fill: currentColor; }
.dashboard-search { padding: 6px 12px; width: min(260px, 28vw); font-size: 0.85rem; }
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.btn-primary-gradient { background: #7c3aed; border: 1px solid #7c3aed; border-radius: 6px; box-shadow: none; }
.btn-primary-gradient:hover { background: #5b21b6; box-shadow: none; transform: none; }
.btn-ghost { border-radius: 6px; }
.form-input { border-radius: 6px; }
.form-input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.2); }
.tab-btn { border-radius: 0; padding: 6px 14px; font-size: 0.82rem; }
.file-table th { background: var(--bg-card-header); color: var(--text-muted); font-size: 11px; letter-spacing: .05em; padding: 8px 12px; }
.file-table td { padding: 7px 12px; font-size: 0.82rem; }
.dashboard-stat-card,
.bulk-toolbar-container,
.dashboard-table-card {
    background: var(--bg-card);
    border: var(--border-card);
}
.dashboard-table-card .file-table th { background: var(--bg-card-header); }
.dashboard-table-card .file-table tbody tr:hover { background: var(--bg-hover); }
.file-name a {
    color: var(--text-primary, #f8fafc);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}
.file-name a:hover {
    color: #a78bfa;
    text-decoration: underline;
}
html.light-theme .file-name a,
body.light-theme .file-name a {
    color: #4f46e5;
    font-weight: 600;
}
html.light-theme .file-name a:hover,
body.light-theme .file-name a:hover {
    color: #4338ca;
}
.badge { border-radius: 20px; }
.workspace-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.workspace-actions .btn-ghost,
.workspace-actions .btn-primary-gradient,
.workspace-actions .btn-primary,
.workspace-actions .create-menu-trigger,
.workspace-actions .btn-sm {
    height: 34px;
    min-height: 34px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 6px;
    vertical-align: middle;
}

.create-menu { position:relative; display:inline-flex; align-items:center; }
.create-menu-trigger { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.create-menu-chevron { font-size:16px; line-height:1; margin-top:-1px; }
.create-menu-popover { position:absolute; z-index:90; left:0; right:auto; top:calc(100% + 7px); width:268px; padding:7px; background:var(--bg-card); border:1px solid var(--border-medium); border-radius:8px; box-shadow:var(--shadow-lg); }
.create-menu-popover[hidden] { display:none; }
.create-menu-label { margin:4px 8px 6px; color:var(--text-muted); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.create-menu-item { display:flex; align-items:center; gap:10px; padding:9px; color:var(--text-primary); text-decoration:none; border-radius:6px; }
.create-menu-item:hover,.create-menu-item:focus { background:var(--bg-glass-hover); color:var(--text-primary); outline:0; }
.create-menu-item strong,.create-menu-item small { display:block; }.create-menu-item strong { font-size:13px; }.create-menu-item small { margin-top:1px; color:var(--text-muted); font-size:11px; }
.document-type-mark { display:inline-grid; place-items:center; width:34px; height:38px; flex:0 0 auto; border:1px solid var(--border-medium); border-radius:5px; background:var(--bg-primary); color:var(--text-secondary); font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700; letter-spacing:-.04em; }
.document-type-md { color:#7442c8; background:#f3efff; border-color:#d8cafa; }.document-type-csv { color:#1a6b3e; background:#edf8f0; border-color:#b7dfc2; }.document-type-txt { color:#5b21b6; background:#f4efff; border-color:#d8c7ff; }
.create-document-shell { max-width:620px; padding:28px; background:var(--bg-card); border:1px solid var(--border-subtle); border-radius:8px; box-shadow:var(--shadow-sm); }
.create-document-heading { display:flex; align-items:flex-start; gap:14px; padding-bottom:22px; border-bottom:1px solid var(--border-subtle); }.create-document-heading .document-type-mark { width:44px; height:50px; font-size:11px; }.create-document-heading h1 { margin:0; font-size:1.55rem; letter-spacing:-.025em; }.create-document-heading p { margin:4px 0 0; }
.create-document-form { margin-top:22px; }.create-document-form label { display:block; margin-bottom:7px; color:var(--text-primary); font-size:13px; font-weight:600; }.filename-field { display:flex; align-items:stretch; }.filename-field .form-input { min-width:0; flex:1; border-radius:6px 0 0 6px; }.filename-extension { display:flex; align-items:center; padding:0 12px; background:var(--bg-primary); border:1px solid var(--border-medium); border-left:0; border-radius:0 6px 6px 0; color:var(--text-secondary); font-family:'JetBrains Mono',monospace; font-size:13px; }.field-help { margin:8px 0 0; color:var(--text-muted); font-size:12px; }.field-help strong { color:var(--text-secondary); font-family:'JetBrains Mono',monospace; font-weight:600; }.form-error { margin:6px 0 0; color:#cf222e; font-size:12px; }.create-document-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:24px; }
.app-footer { border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; padding: 20px 28px; color: var(--text-muted); }
.nav-notification-link { position:relative; color:var(--text-secondary); font-size:13px; font-weight:600; text-decoration:none; white-space:nowrap; }
.nav-notification-link:hover { color:var(--text-primary); }.notification-count { display:inline-grid; place-items:center; min-width:17px; height:17px; padding:0 4px; margin-left:3px; border-radius:10px; background:#7c3aed; color:#fff; font-size:10px; font-weight:800; }
.notification-list { overflow:hidden; }.notification-item { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border-bottom:1px solid var(--border-subtle); }.notification-item:last-child { border-bottom:0; }.notification-item p { margin:4px 0 0; color:var(--text-muted); font-size:12px; }.notification-unread { background:#f7f3ff; border-left:3px solid #7c3aed; }.table-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }.simple-pagination { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:18px; color:var(--text-muted); font-size:13px; }
html:not(.light-theme) .notification-unread { background:rgba(124,58,237,.15); }

.section-help { color: var(--text-muted); font-size: 12px; font-weight: 400; max-width: 470px; margin-top: 4px; }
.project-card { min-width: 0; }
.project-card-action-help { margin: 0 0 10px; color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.project-card-actions { display: flex; gap: 8px; }
.project-card-actions > a { flex: 1; justify-content: center; text-align: center; white-space: nowrap; }
.permissions-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.select-chevron { position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; height:16px; }
.git-user-dropdown { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:100; overflow:hidden; background:var(--bg-card); border:1px solid var(--border-medium); border-radius:7px; box-shadow:var(--shadow-lg); }
.git-user-header { padding:10px 14px; background:var(--bg-primary); border-bottom:1px solid var(--border-subtle); color:var(--text-muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.git-user-list { max-height:220px; overflow-y:auto; }
.git-user-item { display:flex; align-items:center; gap:12px; padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--border-subtle); transition:background-color .15s ease; }
.git-user-item:last-child { border-bottom:0; }.git-user-item:hover,.git-user-item:focus-within { background:var(--bg-glass-hover); }
.git-user-item.is-selected { background:rgba(124,58,237,.12); box-shadow:inset 3px 0 var(--primary); }
.user-pill-btn.is-selected { background:rgba(124,58,237,.12); border-color:var(--primary); color:var(--primary); }
body.light-theme .user-pill-btn.is-selected { background:rgba(124,58,237,.12); border-color:var(--primary); color:var(--primary); }
.git-user-name { color:var(--text-primary); font-size:14px; font-weight:600; }.git-user-email { color:var(--text-muted); font-size:12px; }
.domain-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--emerald-500); font-size: 12px; font-weight: 600; }
.share-link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin-bottom: 8px; background: var(--bg-primary); border: 1px solid var(--border-subtle); border-radius: 6px; }
.share-link-details { min-width: 0; flex: 1; }
.share-url { display: block; color: #7c3aed; font-family: 'JetBrains Mono', monospace; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 5px; }

.public-share-shell { max-width: 980px; margin: 22px auto 50px; }
.public-share-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; box-shadow: var(--shadow-md); overflow: hidden; }
.public-share-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 30px 32px; border-bottom: 1px solid var(--border-subtle); }
.public-file-mark { display: grid; place-items: center; width: 52px; height: 60px; background: #f4efff; border: 1px solid #d8c7ff; border-radius: 7px; color: #7c3aed; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; }
html:not(.light-theme) .public-file-mark { background: rgba(124,58,237,.18); border-color: rgba(245,158,11,.38); }
.public-file-heading { min-width: 0; }
.public-file-heading h1 { font-size: clamp(1.45rem, 4vw, 2rem); letter-spacing: -.035em; overflow-wrap: anywhere; line-height: 1.2; }
.public-file-heading p { color: var(--text-muted); margin-top: 5px; }
.public-download { padding: 10px 16px; white-space: nowrap; }
.public-meta-grid { display: grid; grid-template-columns: repeat(4,1fr); margin: 0; padding: 0 32px; border-bottom: 1px solid var(--border-subtle); }
.public-meta-grid div { padding: 18px 0; }
.public-meta-grid div + div { border-left: 1px solid var(--border-subtle); padding-left: 22px; }
.public-meta-grid dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.public-meta-grid dd { color: var(--text-primary); font-weight: 600; margin-top: 4px; }
.share-security-bar { display: flex; gap: 12px; align-items: flex-start; margin: 24px 32px; padding: 14px 16px; border: 1px solid #b7dfc2; background: #f0faf3; border-radius: 7px; color: #1a5d2c; }
html:not(.light-theme) .share-security-bar { background: rgba(31,136,61,.1); border-color: rgba(63,185,80,.3); color: #7ee787; }
.security-shield { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: #1f883d; font-weight: 700; }
.share-security-bar span:last-child { color: var(--text-muted); font-size: 12px; }
.public-preview { margin: 0 32px 32px; border: 1px solid var(--border-subtle); border-radius: 7px; overflow: hidden; }
.public-preview-title { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: var(--bg-primary); border-bottom: 1px solid var(--border-subtle); }
.public-preview-title h2 { font-size: 14px; }
.public-preview-title span { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.public-preview .code-container { max-height: 520px; overflow: auto; border: 0; border-radius: 0; }
.canonical-link-panel { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 32px 24px; padding:15px 16px; border:1px solid #d8c7ff; border-left:3px solid #7c3aed; border-radius:7px; background:#fbf7f2; }
html:not(.light-theme) .canonical-link-panel { background:rgba(124,58,237,.14); border-color:rgba(245,158,11,.32); border-left-color:#f59e0b; }
.canonical-link-copy { min-width:0; }.canonical-link { font-family:'JetBrains Mono',monospace; font-size:12px; overflow-wrap:anywhere; color:var(--text-primary); }
.canonical-host { color:#7c3aed; font-weight:700; }.canonical-token { color:var(--text-muted); }.canonical-link strong { font-weight:700; color:var(--text-primary); }
.btn-copy-link { white-space:nowrap; display:inline-flex; align-items:center; gap:7px; min-height:38px; }
.public-binary-state { display: flex; gap: 18px; align-items: center; margin: 0 32px 32px; padding: 28px; border: 1px dashed var(--border-medium); border-radius: 7px; }
.public-binary-state h2 { font-size: 16px; }.public-binary-state p { color: var(--text-muted); margin-top: 4px; }
.subdued { filter: grayscale(.7); }.error-mark { background: #fff1f0; border-color: #ffccc7; color: #cf222e; font-size: 24px; }
.public-error { max-width: 620px; margin: 60px auto; padding: 48px; text-align: center; }
.public-error .public-file-mark { margin: 0 auto 22px; }.public-error h1 { font-size: 26px; }.public-error > p { color: var(--text-muted); margin: 10px 0; }
.security-note { background: var(--bg-primary); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 12px; margin: 22px 0; color: var(--text-muted); font-size: 12px; }
.public-file-list { padding: 0 32px 28px; }.public-file-row { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 0; border-bottom:1px solid var(--border-subtle); }.public-file-row span { display:block; color:var(--text-muted); font-size:12px; margin-top:3px; }

*:focus-visible { outline: 3px solid rgba(124,58,237,.45); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
@media (max-width: 760px) {
    .navbar-glass { padding: 8px 14px; }.nav-links { order: 3; width: 100%; overflow-x: auto; margin-left: 0 !important; }.nav-username,.sync-text { display:none; }
    .main-content { width: 100%; padding: 24px 16px 38px; border-inline: 0 !important; }.page-header { align-items: stretch; }.stats-grid { grid-template-columns: repeat(2,1fr); }
    .file-detail-workbench-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .file-detail-sidebar { gap: 14px; padding-left: 0; border-left: 0; }
    .public-share-shell { margin: 0 auto 30px; }.public-share-header { grid-template-columns: auto minmax(0,1fr); padding: 22px 20px; }.public-download { grid-column: 1/-1; text-align:center; justify-content:center; }
    .public-meta-grid { grid-template-columns: repeat(2,1fr); padding:0 20px; }.public-meta-grid div:nth-child(3) { border-left:0; }.public-meta-grid div { border-bottom:1px solid var(--border-subtle); }
    .share-security-bar,.public-preview,.public-binary-state,.canonical-link-panel { margin-left:20px; margin-right:20px; }.canonical-link-panel { align-items:stretch; flex-direction:column; }.btn-copy-link { justify-content:center; }.share-link-row { align-items:flex-start; flex-direction:column; }.app-footer { flex-direction:column; gap:4px; }
    .permissions-grid { grid-template-columns:1fr; }.dashboard-search { width:min(100%,320px); }
    .project-card-actions { flex-wrap: wrap; }.project-card-actions > a { min-width: 132px; }
    .workspace-actions { width:100%; }.workspace-actions > .btn-primary-gradient { flex:1; justify-content:center; text-align:center; }.create-menu { flex:1; }.create-menu-trigger { width:100%; justify-content:center; }.create-menu-popover { left:0; right:auto; width:min(268px, calc(100vw - 32px)); }.create-document-shell { padding:20px; }.create-document-actions { justify-content:stretch; }.create-document-actions > * { flex:1; text-align:center; justify-content:center; }
}
@media (max-width: 430px) {
    .navbar-glass { min-height:58px; padding:7px 10px; flex-wrap:wrap; gap:8px; }
    .navbar-glass > .d-flex:first-child { display:contents; }
    .nav-brand { min-width:32px; order:1; }.nav-brand > span { display:none; }.nav-brand-icon { width:32px; height:32px; }
    .nav-right { margin-left:auto; gap:6px; min-width:0; flex-wrap:nowrap; order:2; }
    .nav-links { order:3; flex:0 0 100%; width:100%; margin:0 !important; padding-top:5px; border-top:1px solid var(--border-subtle); }
    .nav-right .btn-ghost,.nav-right .btn-primary-gradient { min-height:40px; padding:7px 9px; white-space:nowrap; font-size:12px; }
    .theme-toggle-btn { width:40px; min-width:40px; height:40px; }
    .theme-brightness-btn { min-width:34px; width:34px; height:34px; padding:0; }
    .theme-brightness-label { display:none; }
    .public-domain-badge { display:none; }
}

/* Email OTP verification */
.workspace-mode-switch { display:flex; gap:0; margin:0 0 18px; border-bottom:1px solid var(--border-subtle); }
.workspace-mode { display:block; padding:11px 16px 10px; color:var(--text-secondary); border-bottom:3px solid transparent; text-decoration:none; font-weight:650; }
.workspace-mode small { display:block; font-size:11px; color:var(--text-muted); font-weight:400; margin-top:2px; }
.workspace-mode:hover { color:var(--text-primary); background:var(--bg-glass-hover); }
.workspace-mode.active { color:#5b3cc4; border-bottom-color:#7254d6; background:rgba(114,84,214,.07); }
.workspace-mode.disabled { cursor:not-allowed; opacity:.58; user-select:none; }
.workspace-mode.disabled:hover { color:var(--text-secondary); background:transparent; }
.workspace-item > .ui-icon,.workspace-item > a > .ui-icon { width:20px; height:20px; color:#5b3cc4; flex:0 0 auto; }
.workspace-item .text-amber .ui-icon,.pin-mark .ui-icon { width:13px; height:13px; vertical-align:-2px; }
.approval-chip,.pin-mark { display:inline-flex; align-items:center; padding:3px 8px; border-radius:12px; font-size:11px; font-weight:700; white-space:nowrap; }
.approval-chip.pending { color:#8a5a00; background:#fff4d6; border:1px solid #f0cd7a; }.approval-chip.rejected { color:#b42318; background:#fff0ee; border:1px solid #f4b4ae; }
.pin-mark { color:#5b3cc4; background:#f0ebff; border:1px solid #d6c9fb; letter-spacing:.04em; }
.branch-hub-header .btn-primary-gradient,
.branch-repo-row .btn-ghost,
.branch-repo-toolbar .btn-ghost { display:inline-flex; align-items:center; gap:7px; }
.branch-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.branch-repo-panel { border:1px solid var(--border-subtle); background:var(--bg-card); border-radius:8px; overflow:hidden; box-shadow:var(--shadow-sm); }
.branch-repo-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 18px; border-bottom:1px solid var(--border-subtle); background:var(--bg-glass); }
.branch-repo-toolbar h3 { margin:0; font-size:16px; }
.branch-repo-row { display:grid; grid-template-columns:minmax(260px,1.15fr) minmax(240px,1fr) auto; align-items:center; gap:16px; padding:14px 18px; border-bottom:1px solid var(--border-subtle); transition:background var(--transition-fast); }
.branch-repo-row:last-child { border-bottom:0; }
.branch-repo-row:hover { background:var(--bg-glass-hover); }
.branch-repo-main { display:flex; align-items:center; gap:12px; min-width:0; }
.branch-repo-copy { min-width:0; }
.branch-repo-title { color:var(--text-primary); font-weight:700; text-decoration:none; overflow-wrap:anywhere; }
.branch-repo-title:hover { color:var(--text-accent); }
.branch-chip-list { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
.branch-chip { display:inline-flex; align-items:center; gap:6px; min-height:28px; padding:4px 9px; border:1px solid var(--border-subtle); border-radius:999px; background:var(--bg-secondary); color:var(--text-secondary); font-size:12px; font-weight:700; }
.branch-chip .ui-icon { width:14px; height:14px; }
.branch-chip.protected { color:#5b21b6; border-color:#d8c7ff; background:#f4efff; }
.branch-chip.muted { color:var(--text-muted); font-weight:600; }
.branch-chip small { color:var(--text-muted); font-size:10px; font-weight:800; text-transform:uppercase; }
.branch-node-icon { display:grid; place-items:center; width:30px; height:30px; border-radius:999px; color:#7c3aed; background:#f4efff; border:1px solid #d8c7ff; flex:0 0 auto; }
.branch-node-icon .ui-icon { width:16px; height:16px; }
html:not(.light-theme) .branch-chip.protected,
html:not(.light-theme) .branch-node-icon { color:#f59e0b; border-color:rgba(245,158,11,.34); background:rgba(124,58,237,.18); }
@media (max-width: 900px) {
    .branch-summary-grid { grid-template-columns:1fr; }
    .branch-repo-row { grid-template-columns:1fr; align-items:flex-start; }
    .branch-repo-row .btn-ghost { justify-content:center; width:100%; }
}
.otp-card { max-width: 440px; }
.otp-code-input { text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 1.45rem; font-weight: 700; letter-spacing: .38em; padding-left: .65em; }
.otp-help { color: var(--text-muted); font-size: 12px; margin: -2px 0 18px; }
.otp-submit { justify-content: center; gap: 8px; padding: 13px; }
.otp-submit .ui-icon { width: 17px; height: 17px; }
.otp-resend-form { display: flex; justify-content: center; margin-top: 18px; }
.auth-inline-link { display: flex; justify-content: flex-end; margin: -4px 0 18px; font-size: 12px; }
.auth-security-note { margin: -4px 0 18px; color: var(--text-muted); font-size: 12px; line-height: 1.45; }

/* ── Print & PDF Export Styles ── */
@media print {
    body::before { display: none !important; }
    .navbar-glass { position: static !important; background: transparent !important; border-bottom: 1px solid #ccc !important; box-shadow: none !important; }
    .nav-right, .theme-toggle-btn, .btn, .btn-ghost, .btn-primary-gradient, .btn-success-glow, .btn-warning-glow, .btn-danger-glow, .toast-container { display: none !important; }
    .app-layout { min-height: auto !important; }
    .main-content { padding: 0 !important; max-width: 100% !important; }
    .glass-card { background: #fff !important; color: #000 !important; border: 1px solid #ddd !important; box-shadow: none !important; }
    .blame-table { width: 100% !important; font-size: 9pt !important; }
    .blame-row { page-break-inside: avoid; }
}

/* ── Dashboard command-center refresh ─────────────────────────────── */
.dashboard-page-header { position:relative; align-items:center; padding:8px 0 4px; }
.dashboard-heading-copy { position:relative; z-index:1; }
.dashboard-heading-copy::before { content:""; position:absolute; z-index:-1; width:148px; height:110px; top:-28px; left:-45px; border-radius:50%; background:radial-gradient(circle,rgba(111,72,219,.13),rgba(111,72,219,0) 70%); pointer-events:none; }
.dashboard-kicker { display:flex; align-items:center; gap:7px; color:#6544c9; font-size:11px; letter-spacing:.1em; font-weight:800; text-transform:uppercase; margin-bottom:5px; }
.dashboard-kicker-orb { width:8px; height:8px; border-radius:50%; background:#5b35d5; box-shadow:0 0 0 4px rgba(91,53,213,.12); }
.dashboard-page-header h1 { color:#171b2c; font-size:clamp(1.7rem,3vw,2.25rem); font-weight:760; letter-spacing:-.055em; }
.dashboard-intro { max-width:690px; margin-top:3px; font-size:13px; }
.dashboard-header-actions { align-self:center; }
.dashboard-page-header .dashboard-search { width:min(270px,23vw); height:38px; border-color:#dfe2ed; background:#fff; box-shadow:0 1px 2px rgba(23,27,44,.03); }
.dashboard-stat-card { min-height:112px; gap:15px; border-color:#e4e6ef; border-radius:12px; box-shadow:0 3px 14px rgba(34,31,61,.035); }
.dashboard-stat-card:hover { border-color:#cfc7ed; box-shadow:0 9px 24px rgba(68,47,136,.08); transform:translateY(-2px); }
.dashboard-stat-card .stat-icon { width:48px; height:48px; border:0; border-radius:12px; }
.dashboard-stat-card .stat-value { color:#171b2c; font-size:1.7rem!important; font-variant-numeric:tabular-nums; letter-spacing:-.045em; }
.dashboard-stat-card .stat-label { color:#4f566a; font-size:12px!important; font-weight:700; margin-top:1px; }
.dashboard-stat-note { color:#82899a; font-size:10px; line-height:1.25; margin-top:4px; }
html.light-theme .dashboard-stat-card .stat-icon.stat-icon-purple { color:#6338dc!important; background:#efeaff!important; }
html.light-theme .dashboard-stat-card .stat-icon.stat-icon-amber { color:#d17b00!important; background:#fff1d8!important; }
html.light-theme .dashboard-stat-card .stat-icon.stat-icon-violet { color:#5730d7!important; background:#eee9ff!important; }
html.light-theme .dashboard-stat-card .stat-icon.stat-icon-emerald { color:#07845e!important; background:#def7ed!important; }
.dashboard-overview { display:grid; grid-template-columns:1fr 1fr minmax(280px,.85fr); gap:16px; align-items:start; margin:0 0 26px; }
.dashboard-panel { min-width:0; background:var(--bg-card); border:1px solid var(--border-subtle); border-radius:12px; box-shadow:0 3px 14px rgba(34,31,61,.035); overflow:hidden; }
.dashboard-panel-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:17px 18px 13px; border-bottom:1px solid #eff0f5; }
.dashboard-panel-eyebrow { display:block; color:#858b9c; font-size:9px; line-height:1.1; font-weight:800; letter-spacing:.1em; text-transform:uppercase; margin-bottom:5px; }
.dashboard-panel h2 { color:#202438; margin:0; font-size:15px; letter-spacing:-.025em; }
.dashboard-panel-link { flex:0 0 auto; color:#5b35d5; font-size:11px; font-weight:750; text-decoration:none; padding-top:3px; }
.dashboard-panel-link:hover { color:#4322af; }
.workspace-mini-list,.file-mini-list { padding:3px 10px 10px; }
.workspace-mini-row,.file-mini-row { display:flex; align-items:center; gap:10px; min-height:57px; padding:8px; border-radius:8px; color:inherit; text-decoration:none; }
.workspace-mini-row:hover,.file-mini-row:hover { background:#f7f6fc; color:inherit; }
.workspace-mini-icon { display:grid; place-items:center; width:32px; height:32px; flex:0 0 auto; border-radius:9px; color:#fff; background:linear-gradient(145deg,#714bdd,#4b27b9); box-shadow:0 3px 8px rgba(91,53,213,.18); font-size:10px; font-weight:800; letter-spacing:-.04em; }
.workspace-mini-row:nth-child(2) .workspace-mini-icon { background:linear-gradient(145deg,#2688dc,#1654bc); }.workspace-mini-row:nth-child(3) .workspace-mini-icon { background:linear-gradient(145deg,#16a178,#087757); }.workspace-mini-row:nth-child(4) .workspace-mini-icon { background:linear-gradient(145deg,#e69538,#d55d24); }
.workspace-mini-copy,.file-mini-copy { display:grid; min-width:0; gap:1px; flex:1; }.workspace-mini-copy strong,.file-mini-copy strong { overflow:hidden; color:#25293a; font-size:12px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }.workspace-mini-copy small,.file-mini-copy small { color:#858b9b; font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.workspace-mini-arrow { color:#a4a9b6; font-size:22px; line-height:1; }
.file-mini-type { display:grid; place-items:center; width:30px; height:34px; flex:0 0 auto; border-radius:6px; color:#4c5b71; background:#edf1f7; font-size:8px; font-weight:850; }.file-mini-type.file-type-pdf { background:#fee9ea; color:#d23743; }.file-mini-type.file-type-docx,.file-mini-type.file-type-doc { background:#e9f0ff; color:#2762c6; }.file-mini-type.file-type-xlsx,.file-mini-type.file-type-xls { background:#e2f5eb; color:#158153; }
.mini-lock { color:#a15f00; background:#fff3d9; border:1px solid #f5db9f; border-radius:10px; padding:2px 6px; font-size:9px; font-weight:750; }
.dashboard-pulse-panel { background:linear-gradient(145deg,#292044 0%,#201b36 100%); border-color:#392d5e; box-shadow:0 10px 24px rgba(47,30,89,.17); }.dashboard-pulse-panel h2 { color:#fff; }.dashboard-pulse-panel .dashboard-panel-eyebrow { color:#bcb2dd; }.dashboard-pulse-panel .dashboard-panel-header { border-color:rgba(255,255,255,.1); }.dashboard-pulse-panel .dashboard-panel-link { color:#d6caff; }.dashboard-pulse-panel .dashboard-panel-link:hover { color:#fff; }
.pulse-status { display:flex; align-items:center; gap:7px; margin:12px 18px 8px; color:#d9f8e9; font-size:10px; font-weight:700; }.pulse-dot { width:6px; height:6px; border-radius:50%; background:#34d399; box-shadow:0 0 0 4px rgba(52,211,153,.12); animation:dashboardPulse 2.2s infinite; }
@keyframes dashboardPulse { 50% { box-shadow:0 0 0 7px rgba(52,211,153,0); } }
.pulse-list { list-style:none; margin:0; padding:0 12px 10px; }.pulse-list li { display:flex; align-items:flex-start; gap:9px; padding:8px 6px; }.pulse-event-icon { display:grid; place-items:center; width:24px; height:24px; flex:0 0 auto; border-radius:7px; background:rgba(255,255,255,.09); color:#d9ceff; font-size:11px; }.pulse-list strong { display:block; color:#f5f1ff; font-size:10px; font-weight:700; line-height:1.25; }.pulse-list small { display:block; color:#aca2c8; font-size:9px; margin-top:2px; }.repository-shortcut { display:flex; align-items:center; gap:9px; border-top:1px solid rgba(255,255,255,.1); padding:11px 18px; color:#fff; text-decoration:none; }.repository-shortcut>span:first-child { display:grid; place-items:center; width:27px; height:27px; border-radius:7px; background:#6653a0; font-weight:800; }.repository-shortcut>span:nth-child(2) { display:grid; flex:1; }.repository-shortcut strong { font-size:10px; }.repository-shortcut small { color:#b8afd2; font-size:9px; }.repository-shortcut>b { color:#cfc5ed; font-size:21px; font-weight:400; }
.dashboard-empty-compact { display:flex; align-items:center; gap:9px; margin:12px; padding:12px; background:#f8f8fb; border:1px dashed #dfe1ea; border-radius:8px; color:#7e8493; }.dashboard-empty-compact>span { color:#6a42d8; font-size:18px; }.dashboard-empty-compact>div { display:grid; gap:2px; flex:1; }.dashboard-empty-compact strong { color:#363b4c; font-size:11px; }.dashboard-empty-compact small { font-size:10px; line-height:1.35; }.dashboard-empty-compact a { color:#5b35d5; font-size:10px; font-weight:750; }
html:not(.light-theme) .dashboard-page-header h1,.dashboard-panel h2,.workspace-mini-copy strong,.file-mini-copy strong { color:var(--text-primary); } html:not(.light-theme) .dashboard-panel { background:var(--bg-card); border-color:var(--border-subtle); } html:not(.light-theme) .dashboard-panel-header { border-color:var(--border-subtle); } html:not(.light-theme) .workspace-mini-row:hover,html:not(.light-theme) .file-mini-row:hover,html:not(.light-theme) .dashboard-empty-compact { background:var(--bg-hover); } html:not(.light-theme) .dashboard-empty-compact strong { color:var(--text-primary); }
@media (max-width:1120px) { .dashboard-overview { grid-template-columns:1fr 1fr; }.dashboard-pulse-panel { grid-column:1/-1; }.pulse-list { display:grid; grid-template-columns:repeat(3,1fr); } }
@media (max-width:760px) { .dashboard-page-header { padding-top:3px; }.dashboard-header-actions { width:100%; flex-wrap:wrap; }.dashboard-page-header .dashboard-search { flex:1; width:auto; min-width:170px; }.dashboard-overview { grid-template-columns:1fr; }.dashboard-pulse-panel { grid-column:auto; }.pulse-list { grid-template-columns:1fr; }.dashboard-stat-card { min-height:102px; padding:14px; }.dashboard-stat-card .stat-icon { width:42px; height:42px; }.dashboard-stat-card .stat-value { font-size:1.45rem!important; } }

/* ==========================================================================
   VersionVault Modern UI Redesign (Sidebar, Topbar, 8 Metrics & Panels)
   ========================================================================== */

/* ── App Layout with Sidebar ── */
.app-layout.has-sidebar {
    display: flex;
    min-height: 100vh;
    background: var(--bg-page, #0a0a0f);
    position: relative;
}

/* ── Modern Left Sidebar ── */
.vv-sidebar {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    background: var(--bg-card, #ffffff);
    border-right: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
    display: flex;
    flex-direction: column;
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    align-self: flex-start !important;
    overflow: hidden;
    z-index: 100;
    user-select: none;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.vv-sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,0.06));
    flex-shrink: 0;
}

.vv-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.vv-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.vv-brand-icon svg {
    width: 20px;
    height: 20px;
}

.vv-brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
}

.vv-brand-text,
.vv-brand-title {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.15;
}

.vv-brand-subtitle {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--color-primary, #6366f1);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-top: 2px;
    display: block;
    opacity: 0.92;
}

.vv-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.vv-sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}
.vv-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.2);
    border-radius: 4px;
}

.vv-nav-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #8b949e);
    padding: 6px 10px 4px;
}

.vv-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--text-secondary, #4b5563);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.16s ease;
    margin-bottom: 2px;
}

.vv-nav-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.08));
    color: var(--text-primary, #111827);
}

.vv-nav-item.active {
    background: #ede9fe;
    color: #7c3aed;
    font-weight: 600;
}

html.light-theme .vv-nav-item.active {
    background: #ede9fe;
    color: #6d28d9;
}

html:not(.light-theme) .vv-nav-item.active {
    background: rgba(124, 58, 237, 0.22);
    color: #c4b5fd;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.35);
}

.vv-nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vv-nav-icon svg {
    width: 17px;
    height: 17px;
}

/* ── Main Area Wrapper ── */
.vv-main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-page, #f8fafc);
}

/* ── Modern Topbar ── */
.vv-topbar {
    height: 64px;
    background: var(--bg-card, #ffffff);
    border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.vv-topbar-left {
    flex: 1;
    max-width: 520px;
}

.vv-global-search-form {
    width: 100%;
}

.vv-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.vv-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted, #9ca3af);
    pointer-events: none;
    display: flex;
    align-items: center;
}
.vv-search-icon svg {
    width: 15px;
    height: 15px;
}

.vv-search-input {
    width: 100%;
    height: 38px;
    background: var(--bg-input, #f3f4f6);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 20px;
    padding: 0 36px 0 36px;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.vv-search-input::-webkit-search-decoration,
.vv-search-input::-webkit-search-cancel-button,
.vv-search-input::-webkit-search-results-button,
.vv-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

.vv-search-input:focus {
    background: var(--bg-card, #ffffff);
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.vv-search-shortcut-pill {
    position: absolute;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    padding: 1px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.vv-search-clear-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 3px 6px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50%;
    z-index: 10;
}
.vv-search-clear-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover, #f1f5f9);
}

/* ── Global Search Advanced Suggestions Dropdown (Exact Match to User UI) ── */
.vv-search-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 520px;
    max-width: 90vw;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-medium, #cbd5e1);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10000;
    padding: 4px 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: vvSearchDropdownIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.vv-search-results-dropdown::-webkit-scrollbar {
    width: 6px;
}
.vv-search-results-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.vv-search-results-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-medium, #cbd5e1);
    border-radius: 10px;
}

@keyframes vvSearchDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.vv-search-result-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.12s ease;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.04));
}
.vv-search-result-row:last-child {
    border-bottom: none;
}
.vv-search-result-row:hover,
.vv-search-result-row.is-selected {
    background: var(--bg-hover, #f1f5f9);
}
html:not(.light-theme) .vv-search-result-row:hover,
html:not(.light-theme) .vv-search-result-row.is-selected {
    background: rgba(124, 58, 237, 0.16);
}

.vv-search-tag-code {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: 0.02em;
    min-width: 95px;
    max-width: 125px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top: 1px;
    flex-shrink: 0;
}
html:not(.light-theme) .vv-search-tag-code {
    color: #818cf8;
}

.vv-search-content-block {
    flex: 1;
    min-width: 0;
}
.vv-search-row-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.vv-search-result-row:hover .vv-search-row-title,
.vv-search-result-row.is-selected .vv-search-row-title {
    color: #2563eb;
}
html:not(.light-theme) .vv-search-result-row:hover .vv-search-row-title,
html:not(.light-theme) .vv-search-result-row.is-selected .vv-search-row-title {
    color: #a78bfa;
}

.vv-search-row-subtitle {
    font-size: 0.73rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
    line-height: 1.25;
}

.vv-search-dropdown-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.73rem;
    color: var(--text-muted);
    background: var(--bg-hover, rgba(0,0,0,0.02));
}
.vv-search-dropdown-footer-btn {
    color: var(--primary, #7c3aed);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.vv-search-dropdown-footer-btn:hover {
    text-decoration: underline;
}

.vv-search-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.vv-search-section-header {
    padding: 8px 14px 4px 14px;
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #94a3b8);
    background: var(--bg-hover, #f8fafc);
    border-bottom: 1px solid var(--border-subtle, #f1f5f9);
}

.vv-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.12s ease;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.04));
}
.vv-search-result-item:last-child {
    border-bottom: none;
}
.vv-search-result-item:hover,
.vv-search-result-item.is-selected {
    background: var(--bg-hover, #f1f5f9);
}
.vv-search-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.vv-search-item-info {
    flex: 1;
    min-width: 0;
}
.vv-search-item-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vv-search-item-sub {
    font-size: 0.73rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.vv-search-item-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.vv-search-item-title mark {
    background: rgba(250, 204, 21, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}
.vv-search-item-snippet {
    font-size: 0.71rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.vv-search-item-snippet mark {
    background: rgba(250, 204, 21, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
    font-style: normal;
}


.vv-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vv-topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(0,0,0,0.1));
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    transition: all 0.18s ease;
}

.vv-topbar-icon-btn:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.1));
    color: #7c3aed;
    border-color: #7c3aed;
}

.vv-topbar-icon-btn svg {
    width: 17px;
    height: 17px;
}

.vv-badge-dot-counter {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid var(--bg-card, #ffffff);
}

.vv-live-sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #16a34a;
    font-size: 0.78rem;
    font-weight: 600;
}

.gitlab-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(252, 109, 38, 0.1);
    border: 1px solid rgba(252, 109, 38, 0.3);
    color: #e24329;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.gitlab-pill:hover {
    background: rgba(252, 109, 38, 0.18);
    border-color: rgba(252, 109, 38, 0.5);
    color: #fc6d26;
    transform: translateY(-1px);
}
.gitlab-pill.is-offline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}
.gitlab-pill.is-offline:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
    color: #b91c1c;
    transform: translateY(-1px);
}
.gitlab-pill.is-offline .gitlab-dot {
    background: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}
.gitlab-fox-icon {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.gitlab-arrow-icon {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 1px;
    opacity: 0.85;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.gitlab-pill:hover .gitlab-arrow-icon {
    transform: translate(1px, -1px);
    opacity: 1;
}

.vv-sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: vvPulse 2s infinite;
}

@keyframes vvPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.vv-user-profile-widget {
    display: flex;
    align-items: center;
    padding-left: 6px;
    border-left: 1px solid var(--border-subtle, rgba(0,0,0,0.1));
}

.vv-user-profile-link {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text-primary);
}

.vv-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.vv-user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.vv-username {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text-primary);
}

.vv-user-role-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #7c3aed;
    text-transform: uppercase;
}

/* ── Dashboard Header ── */
.vv-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.vv-dashboard-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0;
}

.vv-dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── 8 Stat Cards Grid ── */
.vv-stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .vv-stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .vv-stat-cards-grid {
        grid-template-columns: 1fr;
    }
}

.vv-stat-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.vv-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.07);
    border-color: rgba(124, 58, 237, 0.3);
}

.vv-stat-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vv-stat-icon-box svg {
    width: 22px;
    height: 22px;
}

.vv-stat-purple { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.vv-stat-green  { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.vv-stat-amber  { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.vv-stat-violet { background: rgba(168, 85, 247, 0.1); color: #9333ea; }
.vv-stat-blue   { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.vv-stat-red    { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.vv-stat-teal   { background: rgba(20, 184, 166, 0.1); color: #0d9488; }
.vv-stat-orange { background: rgba(249, 115, 22, 0.1); color: #ea580c; }

.vv-stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vv-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 2px;
}

.vv-stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}

.vv-stat-trend {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
}

.vv-trend-up { color: #16a34a; }
.vv-trend-neutral { color: var(--text-muted, #9ca3af); }

/* ── Overview 3 Panels Grid ── */
.vv-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

@media (max-width: 1100px) {
    .vv-overview-grid {
        grid-template-columns: 1fr;
    }
}

.vv-panel-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.vv-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle, #f3f4f6);
}

.vv-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.vv-panel-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
}
.vv-panel-link:hover {
    text-decoration: underline;
}

.vv-panel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vv-panel-empty {
    min-height: 132px;
    display: grid;
    place-items: center;
    padding: 18px;
    border: 1px dashed var(--border-subtle, #e5e7eb);
    border-radius: 10px;
    color: var(--text-muted, #6b7280);
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
    background: var(--bg-hover, #f8fafc);
}

/* ── Recent Workspaces Panel Items ── */
.vv-workspace-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.15s ease;
}
.vv-workspace-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.05));
}

.vv-ws-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vv-ws-avatar-0 { background: #8b5cf6; }
.vv-ws-avatar-1 { background: #3b82f6; }
.vv-ws-avatar-2 { background: #10b981; }
.vv-ws-avatar-3 { background: #f97316; }
.vv-ws-avatar-4 { background: #ef4444; }

.vv-ws-content {
    flex: 1;
    min-width: 0;
}

.vv-ws-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vv-ws-name:hover {
    color: #7c3aed;
}

.vv-ws-meta {
    font-size: 0.73rem;
    color: var(--text-muted, #6b7280);
    margin-top: 1px;
}

.vv-ws-aside {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vv-ws-time {
    font-size: 0.72rem;
    color: var(--text-muted, #9ca3af);
}

.vv-star-btn {
    background: none;
    border: none;
    color: var(--text-muted, #cbd5e1);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.vv-star-btn svg {
    width: 16px;
    height: 16px;
    transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}
.vv-star-btn:hover {
    color: #f59e0b;
    transform: scale(1.15);
}
.vv-star-btn:hover svg polygon,
.vv-star-btn:hover polygon {
    fill: rgba(245, 158, 11, 0.35);
}
.vv-star-btn.is-starred {
    color: #f59e0b !important;
}
.vv-star-btn.is-starred svg polygon,
.vv-star-btn.is-starred polygon {
    fill: #f59e0b !important;
    stroke: #f59e0b !important;
}

/* ── File Star Toggle Button (Inline Beside File Name / Icon) ── */
.file-star-btn {
    background: transparent;
    border: none;
    padding: 0 4px;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    opacity: 0.6;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
.file-star-btn:hover {
    opacity: 1;
    color: #f59e0b !important;
    transform: scale(1.25);
}
.file-star-btn.is-starred {
    opacity: 1;
    color: #f59e0b !important;
}
.file-star-btn.is-starred:hover {
    transform: scale(1.25);
}

/* ── Recent Files Panel Items ── */
.vv-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.15s ease;
}
.vv-file-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.05));
}

.vv-file-doc-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vv-badge-docx, .vv-badge-doc, .vv-badge-txt { background: #2563eb; }
.vv-badge-xlsx, .vv-badge-xls, .vv-badge-csv { background: #16a34a; }
.vv-badge-pdf { background: #dc2626; }
.vv-badge-md { background: #7c3aed; }
.vv-badge-pptx, .vv-badge-ppt { background: #ea580c; }
.vv-badge-folder { background: #f59e0b; color: #ffffff; }

.vv-file-content {
    flex: 1;
    min-width: 0;
}

.vv-file-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vv-file-name:hover {
    color: #7c3aed;
}

.vv-file-meta {
    font-size: 0.73rem;
    color: var(--text-muted, #6b7280);
    margin-top: 1px;
}

.vv-file-aside {
    text-align: right;
    flex-shrink: 0;
    line-height: 1.2;
}

.vv-file-time {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted, #9ca3af);
}

.vv-file-author {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted, #9ca3af);
}

/* ── Recent Branch Activity Panel Items ── */
.vv-branch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.15s ease;
}
.vv-branch-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.05));
}

.vv-branch-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vv-branch-icon svg {
    width: 18px;
    height: 18px;
}

.vv-branch-content {
    flex: 1;
    min-width: 0;
}

.vv-branch-name {
    font-size: 0.84rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.vv-branch-sub {
    font-size: 0.73rem;
    color: var(--text-secondary, #4b5563);
    margin-top: 1px;
}

.vv-branch-meta {
    font-size: 0.69rem;
    color: var(--text-muted, #9ca3af);
}

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

.vv-branch-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 2px;
}

.vv-btn-subtle {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    border: 1px solid var(--border-subtle, #e5e7eb) !important;
    border-radius: 6px !important;
}

/* ── Activity Feed Panel ── */
.vv-feed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vv-feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.vv-feed-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.05));
}

.vv-feed-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.vv-feed-copy {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary);
}
.vv-feed-copy strong {
    font-weight: 700;
}

.vv-feed-time {
    font-size: 0.72rem;
    color: var(--text-muted, #9ca3af);
    flex-shrink: 0;
}

.vv-footer-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Responsive adjustments ── */
@media (max-width: 900px) {
    .vv-sidebar {
        display: none;
    }

    .vv-topbar {
        padding: 0 16px;
    }

    .vv-topbar-right {
        gap: 8px;
    }

    .vv-live-sync-pill,
    .vv-user-details,
    .vv-search-shortcut-pill {
        display: none;
    }

    .vv-dashboard-header {
        align-items: flex-start;
        gap: 14px;
    }
}

@media (max-width: 560px) {
    .vv-topbar-left {
        max-width: none;
    }

    .vv-topbar-icon-btn:nth-of-type(2),
    .vv-user-profile-widget {
        display: none;
    }

    .vv-dashboard-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .vv-create-trigger {
        width: 100%;
        justify-content: center;
    }
}

/* ── Dashboard laptop sizing ────────────────────────────────────────────
   The dashboard lives beside a fixed 250px navigation rail.  At 1280px an
   equal three-column grid leaves the branch activity card with only ~280px,
   which makes its title and row actions compete for the same space.  Keep
   the first two panels compact and reserve a purposeful reading column for
   branches; below this range the branch panel deliberately moves to a full
   row instead of being squeezed. */
.vv-overview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(340px, 1.4fr);
    gap: 16px;
}

.vv-overview-grid > .vv-panel-card,
.vv-panel-header,
.vv-panel-list,
.vv-branch-content {
    min-width: 0;
}

.vv-panel-header {
    gap: 12px;
}

.vv-panel-title,
.vv-panel-link {
    white-space: nowrap;
}

.vv-panel-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.vv-panel-link {
    flex: 0 0 auto;
}

.vv-branch-item {
    align-items: flex-start;
    gap: 10px;
    padding: 9px 8px;
}

.vv-branch-icon {
    margin-top: 2px;
}

.vv-branch-content {
    min-width: 138px;
}

.vv-branch-name,
.vv-branch-sub,
.vv-branch-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vv-branch-actions {
    gap: 4px;
    padding-top: 1px;
}

.vv-branch-status-dot {
    margin-right: 1px;
}

.vv-btn-subtle {
    padding-inline: 7px !important;
}

.vv-dashboard-header {
    margin-bottom: 18px;
}

.vv-stat-cards-grid {
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 1259px) {
    .vv-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vv-overview-grid > .vv-panel-card:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .vv-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .vv-overview-grid > .vv-panel-card:nth-child(3) {
        grid-column: auto;
    }
}

/* ========================================================================
   Reference-aligned dashboard shell
   Keep this block last: the app has legacy dashboard rules above it and the
   desktop shell needs one unambiguous set of proportions.
   ======================================================================== */
html.light-theme,
body.light-theme {
    --bg-page: var(--color-bg-page, #f8fafc);
    --bg-card: var(--color-bg-surface, #ffffff);
    --bg-card-header: var(--color-bg-subtle, #ffffff);
    --bg-hover: var(--color-bg-hover, #f5f3ff);
    --bg-input: var(--color-bg-subtle, #ffffff);
    --border-subtle: var(--color-border-subtle, #e4e8ef);
    --border-medium: var(--color-border-medium, #d7dce5);
    --text-primary: var(--color-text-primary, #172033);
    --text-secondary: var(--color-text-secondary, #475569);
    --text-muted: var(--color-text-muted, #64748b);
    --gradient-bg: var(--bg-page);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .025);
}

html.light-theme body,
body.light-theme {
    background: var(--bg-page);
    color: var(--text-primary);
}

html.light-theme .app-layout.has-sidebar,
body.light-theme .app-layout.has-sidebar,
html.light-theme .vv-main-wrapper,
body.light-theme .vv-main-wrapper {
    background: var(--bg-page);
}

html.light-theme .vv-sidebar,
body.light-theme .vv-sidebar,
html.light-theme .vv-topbar,
body.light-theme .vv-topbar {
    background: var(--bg-card);
    border-color: var(--border-subtle);
}

/* 200px rail mirrors the reference and releases enough room for useful data. */
.vv-sidebar {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

.vv-sidebar-brand {
    height: 60px;
    padding: 0 16px;
}

.vv-brand-link { gap: 9px; }
.vv-brand-icon { width: 32px; height: 32px; border-radius: 7px; box-shadow: 0 3px 8px rgba(109, 40, 217, .22); }
.vv-brand-text { font-size: 1.02rem; letter-spacing: -.035em; }

.vv-sidebar-scroll { padding: 12px 8px 20px; gap: 14px; }
.vv-nav-group-title { padding: 4px 8px 5px; font-size: .62rem; letter-spacing: .075em; }
.vv-nav-item { gap: 9px; padding: 6px 9px; margin-bottom: 1px; border-radius: 6px; font-size: .79rem; }
.vv-nav-icon { width: 17px; height: 17px; }
.vv-nav-icon svg { width: 16px; height: 16px; }

/* A compact 60px command bar with proper flex alignment and no absolute collision */
.vv-topbar {
    height: 60px;
    min-height: 60px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-card, #ffffff);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.vv-topbar-left {
    position: relative;
    flex: 0 1 380px;
    max-width: 380px;
    transform: none;
}
.vv-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.vv-search-input {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-input, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    color: var(--text-primary);
    padding: 0 36px 0 34px;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
}
.vv-search-input:focus {
    background: var(--bg-card, #ffffff);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.vv-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}
.vv-search-shortcut-pill {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    padding: 1px 6px;
    border-radius: 4px;
    pointer-events: none;
}
.vv-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}
.vv-topbar-icon-btn, .theme-toggle-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vv-live-sync-pill { padding: 4px 10px; font-size: .73rem; }
.vv-user-profile-widget { padding-left: 9px; }
.vv-user-avatar { width: 30px; height: 30px; }
.vv-username { font-size: .76rem; }

/* The actual work surface begins exactly beside the rail, rather than floating
   in a wide, gray gutter. */
.main-content { width: 100%; max-width: none; margin: 0; padding: 20px 18px 40px; }
.vv-dashboard-header { margin-bottom: 14px; }
.vv-dashboard-title { font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.vv-dashboard-header-actions { gap: 8px; }
.vv-create-trigger { min-height: 32px; padding: 0 12px; font-size: .76rem; border-radius: 6px; }

/* Metrics stay deliberately short and scan as a single row on broad screens. */
.vv-stat-cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.vv-stat-card { min-height: 100px; height: 100px; padding: 13px 14px; gap: 12px; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .025); }
.vv-stat-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .06); }
.vv-stat-icon-box { width: 48px; height: 48px; border-radius: 11px; }
.vv-stat-icon-box svg { width: 21px; height: 21px; }
.vv-stat-label { font-size: .72rem; margin-bottom: 1px; }
.vv-stat-value { font-size: 1.35rem; }
.vv-stat-trend { font-size: .67rem; line-height: 1.28; margin-top: 3px; }

/* No narrow third panel at laptop widths: branches receive a real full row. */
.vv-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 0; }
.vv-overview-grid > .vv-panel-card:nth-child(3) { grid-column: 1 / -1; }
.vv-panel-card { padding: 14px 16px; border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .025); }
.vv-panel-header { gap: 8px; margin-bottom: 9px; padding-bottom: 9px; }
.vv-panel-title { font-size: .88rem; }
.vv-panel-link { font-size: .7rem; }
.vv-panel-list { gap: 5px; }
.vv-workspace-item, .vv-file-item { padding: 6px 5px; gap: 10px; }
.vv-ws-avatar, .vv-file-doc-badge { width: 32px; height: 32px; border-radius: 8px; }
.vv-ws-name, .vv-file-name { font-size: .78rem; }
.vv-ws-meta, .vv-file-meta { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vv-ws-time, .vv-file-time { font-size: .66rem; }
.vv-file-author { font-size: .63rem; }
.vv-branch-item { padding: 7px 5px; }
.vv-activity-feed-panel { margin-top: 14px !important; }
.vv-feed-item { padding: 6px 5px; }

@media (min-width: 1450px) {
    .vv-stat-cards-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
    .vv-stat-card { padding: 12px 11px; gap: 10px; }
    .vv-stat-icon-box { width: 44px; height: 44px; }
    .vv-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .vv-overview-grid > .vv-panel-card:nth-child(3) { grid-column: auto; }
}

@media (max-width: 1099px) {
    .vv-stat-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .vv-topbar-left { position: relative; transform: none; flex: 0 1 300px; max-width: 300px; width: 100%; }
    .main-content { padding: 18px 16px 32px; }
}

@media (max-width: 680px) {
    .vv-stat-cards-grid, .vv-overview-grid { grid-template-columns: minmax(0, 1fr); }
    .vv-overview-grid > .vv-panel-card:nth-child(3) { grid-column: auto; }
    .vv-dashboard-header { flex-wrap: wrap; }
}

/* Theme tokens are written as inline custom properties by base.html's brightness controller. */
html.light-theme .vv-sidebar {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    background: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
}
html.light-theme .vv-sidebar-brand { height: 60px !important; }
html.light-theme .vv-topbar {
    height: 60px !important;
    min-height: 60px !important;
    background: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
}
html.light-theme .vv-main-wrapper,
html.light-theme .app-layout.has-sidebar,
html.light-theme .main-content { background: var(--bg-page) !important; }
html.light-theme .main-content { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 20px 18px 40px !important; }
html.light-theme .vv-stat-cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 14px !important; }
html.light-theme .vv-stat-card { min-height: 100px !important; height: 100px !important; background: var(--bg-card) !important; border-color: var(--border-subtle) !important; }
html.light-theme .vv-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px !important; }
html.light-theme .vv-overview-grid > .vv-panel-card:nth-child(3) { grid-column: 1 / -1 !important; }
html.light-theme .vv-panel-card { background: var(--bg-card) !important; border-color: var(--border-subtle) !important; }

@media (min-width: 1450px) {
    html.light-theme .vv-stat-cards-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
    html.light-theme .vv-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    html.light-theme .vv-overview-grid > .vv-panel-card:nth-child(3) { grid-column: auto !important; }
}

@media (max-width: 1099px) {
    html.light-theme .vv-stat-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 900px) {
    html.light-theme .main-content { padding: 18px 16px 32px !important; }
}

@media (max-width: 680px) {
    html.light-theme .vv-stat-cards-grid,
    html.light-theme .vv-overview-grid { grid-template-columns: minmax(0, 1fr) !important; }
    html.light-theme .vv-overview-grid > .vv-panel-card:nth-child(3) { grid-column: auto !important; }
}


/* ══ Favourites Screen Styling ══════════════════════════════════════ */
.fav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.fav-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fav-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fav-icon-badge svg {
    width: 18px;
    height: 18px;
    stroke: #f59e0b;
    fill: #f59e0b;
}
.fav-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 1rem;
}
.fav-stat-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 8px;
    padding: 0.65rem 0.95rem;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fav-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.fav-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fav-stat-icon svg {
    width: 16px;
    height: 16px;
}
.fav-stat-num {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}
.fav-stat-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1px;
}
.fav-stat-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}
.fav-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border-subtle, #e5e7eb);
    margin-top: 0.35rem;
    margin-bottom: 1.15rem;
    padding: 2px 0 4px 0;
    flex-wrap: wrap;
    align-items: center;
}
.fav-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-bottom: -4px;
}
.fav-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover, rgba(0, 0, 0, 0.02));
}
.fav-tab-btn.active {
    color: var(--primary, #7c3aed) !important;
    border-bottom-color: var(--primary, #7c3aed) !important;
    background: transparent;
}

/* ── Full Width Table Layout ── */
.fav-layout-grid {
    display: block;
    width: 100%;
}

.fav-table-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.fav-table-header {
    padding: 0.80rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card, #ffffff);
}
.fav-table-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.fav-table-title svg {
    width: 15px;
    height: 15px;
    color: #f59e0b;
    fill: #f59e0b;
}
.fav-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.fav-table th {
    padding: 9px 8px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    background: var(--bg-hover, #f9fafb);
    white-space: nowrap;
    line-height: 1.35;
    vertical-align: middle;
}
.fav-table th:first-child,
.fav-table td:first-child {
    padding-left: 14px;
}
.fav-table th:last-child,
.fav-table td:last-child {
    padding-right: 14px;
    text-align: right;
}
.fav-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    color: var(--text-primary);
    vertical-align: middle;
    line-height: 1.35;
}
.fav-table tr:last-child td {
    border-bottom: none;
}
.fav-table tr:hover td {
    background: var(--bg-hover, #f9fafb);
}
.fav-badge-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-docx, .badge-doc { background: rgba(43, 87, 154, 0.12); color: #2b579a; }
.badge-pdf { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.badge-xlsx, .badge-csv { background: rgba(33, 115, 70, 0.12); color: #217346; }
.badge-workspace { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.badge-branch { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.badge-repository { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.badge-generic { background: var(--bg-hover); color: var(--text-secondary); }

.fav-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    flex-shrink: 0;
}
.fav-icon-workspace { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.fav-icon-branch { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.fav-icon-repository { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.fav-icon-docx { background: rgba(43, 87, 154, 0.12); color: #2b579a; }
.fav-icon-pdf { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.fav-icon-xlsx { background: rgba(33, 115, 70, 0.12); color: #217346; }
.fav-icon-generic { background: var(--bg-hover); color: var(--text-secondary); }

.fav-item-name {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.12s ease;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
    font-size: 0.84rem;
}
.fav-item-name:hover {
    color: var(--primary, #7c3aed);
}

/* ── Sidebar Right Cards ── */
.fav-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.fav-sidebar-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.fav-sidebar-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.55rem;
    gap: 6px;
}
.fav-sidebar-title h4 {
    font-size: 0.80rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.fav-sidebar-title a {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary, #7c3aed);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.fav-quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    background: var(--bg-hover, #f9fafb);
    transition: transform 0.12s ease, background 0.12s ease;
}
.fav-quick-item:hover {
    transform: translateX(2px);
    background: rgba(124, 58, 237, 0.08);
}

.fav-banner-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 12px;
    padding: 1.15rem;
}

.fav-tip-card {
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 12px;
    padding: 1.15rem;
}

/* ── Pagination Buttons ── */
.fav-page-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    transition: all 0.15s ease;
}
.fav-page-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary, #7c3aed);
    color: var(--primary, #7c3aed);
}
.fav-page-btn.active {
    background: var(--primary, #7c3aed);
    color: #ffffff;
    font-weight: 700;
    border-color: #7c3aed;
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.35);
}
.fav-page-nav-btn {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    transition: all 0.15s ease;
}
.fav-page-nav-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary, #7c3aed);
    color: var(--primary, #7c3aed);
}
.fav-open-action-btn {
    padding: 3px 8px;
    font-size: 0.78rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    color: var(--primary, #7c3aed);
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    transition: background 0.15s ease;
}
.fav-open-action-btn:hover {
    background: var(--bg-hover);
}

/* ═════════════════════════════════════════════════════════════════
   NOTION-GRADE CEILING-LEVEL WORKSPACE POLISH & DECLUTTERING
   ═════════════════════════════════════════════════════════════════ */

/* 1. Global Font Smoothing & Crisp Typography */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    text-rendering: optimizeLegibility;
}

/* 2. Hide Verbose "Blah Blah" Explanatory Helpers While Maintaining Accessibility */
.project-card-action-help {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 3. Notion-Tier Clean Surfaces & Card Framing */
.glass-card, 
.vv-card, 
.vv-panel-card, 
.vv-table-card, 
.vv-project-card {
    border-radius: 12px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html.light-theme .glass-card,
html.light-theme .vv-card,
html.light-theme .vv-panel-card,
html.light-theme .vv-table-card,
html.light-theme .vv-project-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 14px rgba(0, 0, 0, 0.02) !important;
}

html:not(.light-theme) .glass-card,
html:not(.light-theme) .vv-card,
html:not(.light-theme) .vv-panel-card,
html:not(.light-theme) .vv-table-card,
html:not(.light-theme) .vv-project-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28) !important;
}

/* Subtle Interactive Lift on Cards */
.vv-project-card:hover,
.vv-panel-card:hover {
    border-color: rgba(124, 58, 237, 0.35) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.08) !important;
}

/* 4. Notion-Style Clean Database & Folder Table Rows */
.vv-table th, 
.dl-table th, 
.table th {
    padding: 10px 14px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--text-muted, #94a3b8) !important;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.08)) !important;
    background: transparent !important;
}

.vv-table td, 
.dl-table td, 
.table td {
    padding: 11px 14px !important;
    font-size: 0.84rem !important;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05)) !important;
    vertical-align: middle !important;
}

.vv-table tbody tr:hover, 
.dl-table tbody tr:hover, 
.table tbody tr:hover {
    background: rgba(124, 58, 237, 0.035) !important;
}

/* 5. Sleek Minimalist Badges */
.vv-badge, .badge {
    border-radius: 6px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
}

/* 6. Clean Button Transitions */
.vv-btn, .btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 7. Notion-Style Workspace & File Activity Items */
.vv-workspace-item,
.vv-file-item,
.vv-branch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
}

.vv-workspace-item:last-child,
.vv-file-item:last-child,
.vv-branch-item:last-child {
    border-bottom: none;
}

.vv-workspace-item:hover,
.vv-file-item:hover,
.vv-branch-item:hover {
    background: rgba(124, 58, 237, 0.04) !important;
}

.vv-ws-avatar {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.vv-file-doc-badge {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.70rem;
    font-weight: 700;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(124, 58, 237, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.vv-ws-content,
.vv-file-content,
.vv-branch-content {
    flex: 1;
    min-width: 0;
}

.vv-ws-name,
.vv-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.25;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vv-ws-name:hover,
.vv-file-name:hover {
    color: var(--color-primary);
}

.vv-ws-meta,
.vv-file-meta,
.vv-branch-meta {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vv-ws-aside,
.vv-file-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.vv-ws-time,
.vv-file-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.vv-file-author {
    font-size: 0.70rem;
    color: var(--text-muted);
}

/* ── Top View Switcher (Dashboard Overview vs Explorer & Admin Data) ── */
.vv-view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card, #1e1b2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.vv-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.vv-view-tab:hover {
    color: var(--text-primary, #ffffff);
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
    text-decoration: none;
}

.vv-view-tab.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25) 0%, rgba(109, 40, 217, 0.35) 100%);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.18);
}

.vv-view-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vv-view-tab-icon svg {
    width: 16px;
    height: 16px;
}

body.light-theme .vv-view-switcher,
html.light-theme .vv-view-switcher {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

body.light-theme .vv-view-tab,
html.light-theme .vv-view-tab {
    color: #64748b;
}

body.light-theme .vv-view-tab:hover,
html.light-theme .vv-view-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
}

body.light-theme .vv-view-tab.active,
html.light-theme .vv-view-tab.active {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: #ddd6fe;
}

/* ══ Floating Per-Row Action Menu (Viewport Fixed, No Clipping) ══ */
.row-action-wrapper {
    position: relative;
    display: inline-block;
}

.row-action-menu {
    position: fixed;
    z-index: 9999999 !important;
    min-width: 200px;
    max-width: 260px;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 3px 10px rgba(0, 0, 0, 0.12);
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    display: none;
    flex-direction: column !important;
    gap: 2px;
}

.row-action-menu.show {
    display: flex !important;
}

.row-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease;
}

.row-action-item:hover {
    background: var(--bg-hover, rgba(124, 58, 237, 0.08));
    color: var(--primary, #7c3aed);
}

.row-action-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* ── SharePoint-style Folder Color Picker Modal (VV-TC-085) ── */
.folder-color-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.folder-color-modal-overlay.show {
    display: flex !important;
}

.folder-color-modal-box {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 410px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    animation: folderModalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

@keyframes folderModalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.folder-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.folder-swatch:hover {
    transform: scale(1.12);
}

.folder-swatch.is-active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px #0284c7 !important;
    transform: scale(1.06);
}

/* Dark mode support */
body.dark-mode .folder-color-modal-box,
html.dark-theme .folder-color-modal-box {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
    box-shadow: 0 25px 35px -5px rgba(0, 0, 0, 0.7) !important;
}

body.dark-mode .folder-color-modal-box h3,
html.dark-theme .folder-color-modal-box h3 {
    color: #f8fafc !important;
}

body.dark-mode .folder-color-modal-box label,
html.dark-theme .folder-color-modal-box label {
    color: #cbd5e1 !important;
}

body.dark-mode .folder-color-modal-box input,
html.dark-theme .folder-color-modal-box input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .folder-swatch.is-active,
html.dark-theme .folder-swatch.is-active {
    box-shadow: 0 0 0 2px #1e293b, 0 0 0 4.5px #38bdf8 !important;
}

body.dark-mode #cancelFolderModalBtn,
html.dark-theme #cancelFolderModalBtn {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}




