@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000;0,9..40,300..800;1,9..40,300..800&family=Geist:wght@100..900&display=swap');

/* ══════════════════════════════════════════════════════════════════════════
   1. CORE VARIABLES & GLOBAL RESET
   ══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Pure Modern Biscuit & Warm Sand Color Palette */
    --navy:      #F4F0EA;          /* Canvas background */
    --navy-mid:  #FFFFFF;          /* Floating Sidebar & Cards */
    --navy-card: #FAF6F1;          /* Sand-tint for row items */
    --navy-light:#FFFFFF;

    /* Biscuit, Warm Sand & Off-White Canvas Tokens */
    --bg-canvas:     #F5F2EC;
    --bg-surface:    #FFFFFF;
    --bg-card:       #FAF7F2;
    --bg-inset:      #EFECE6;
    --bg-dark:       #18191C;
    --bg-dark-card:  #22242B;

    /* Dynamic Brand & Accent Colors */
    --gold:          #1C1D1F;          /* Rich Charcoal / Obsidian Primary */
    --gold-light:    #FFD542;          /* Sunburst Yellow Accent */
    --gold-warm:     #D4A843;          /* Warm Gold Accent */
    --gold-dim:      rgba(28, 29, 31, 0.08);
    --gold-glow:     rgba(28, 29, 31, 0.2);

    --orange-accent: #FA6B5C;          /* Highlight / Coral Orange Accent */
    --orange-dim:    rgba(250, 107, 92, 0.12);

    /* Dynamic Card 1 Gradient System */
    --hero-card-bg-start: #E2D7C7;
    --hero-card-bg-end:   #CDA1B1;
    --hero-card-text:     #111111;

    /* System Feedback & Status States */
    --danger:           #E53935;
    --danger-dim:       rgba(229, 57, 53, 0.1);
    --success:          #2E7D32;
    --success-dim:      rgba(46, 125, 50, 0.1);
    --warning:          #D97706;
    --warning-dim:      rgba(217, 119, 6, 0.1);

    --status-active:    #2E7D32;
    --status-active-bg: rgba(46, 125, 50, 0.12);
    --status-urgent:    #E57373;
    --status-urgent-bg: rgba(229, 115, 115, 0.15);
    --status-warn:      #D4A843;
    --status-warn-bg:   rgba(212, 168, 67, 0.15);
    --status-info:      #4A90D9;
    --status-info-bg:   rgba(74, 144, 217, 0.15);

    /* Typography */
    --text:          #111111;
    --text-primary:  #141517;
    --text-dim:      #5C5854;
    --text-muted:    #9F978F;
    --text-on-dark:  #F7F6F3;

    /* Structure, Borders, Radius & Shadows */
    --border:        transparent;
    --border-subtle: rgba(0, 0, 0, 0.04);
    --border-input:  rgba(0, 0, 0, 0.075);
    --border-light:  rgba(20, 21, 23, 0.08);
    --border-dark:   rgba(255, 255, 255, 0.08);

    --radius:        24px;
    --radius-sm:     12px;
    --radius-md:     20px;
    --radius-lg:     32px;
    --radius-pill:   100px;

    --sidebar-w:     250px;
    --shadow:        0 10px 40px rgba(0, 0, 0, 0.025);
    --shadow-soft:   0 12px 36px rgba(0, 0, 0, 0.035);
    --shadow-card:   0 20px 50px rgba(0, 0, 0, 0.06);
    --shadow-float:  0 30px 80px rgba(0, 0, 0, 0.12);

    color-scheme: light;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: clip;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--navy);
    background-color: var(--bg-canvas);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: clip;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ══════════════════════════════════════════════════════════════════════════
   2. BRAND LOGO COMPONENT SYSTEM
   ══════════════════════════════════════════════════════════════════════════ */
.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    user-select: none;
    flex-shrink: 0;
}

.brand-mark {
    display: flex;
    align-items: flex-end;
    height: 28px;
    flex-shrink: 0;
}

.bar-orange {
    width: 6px;
    height: 28px;
    background-color: var(--orange-accent);
    margin-right: 3px;
    border-radius: 1px;
}

.mark-l {
    width: 16px;
    height: 28px;
    position: relative;
    margin-right: 1px;
}

.mark-l::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 28px;
    background-color: var(--text-primary);
    border-radius: 1px;
}

.mark-l::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 16px;
    height: 6px;
    background-color: var(--text-primary);
    border-radius: 1px;
}

.brand-divider {
    width: 1.5px;
    height: 32px;
    background-color: var(--text-primary);
    margin: 0 10px;
    opacity: 0.8;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--text-primary);
    font-family: 'Geist', sans-serif;
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.brand-text .top {
    font-size: 15px;
}

.brand-text .bottom {
    font-size: 13.5px;
    margin-top: 1px;
    transform: scaleX(0.92);
    transform-origin: left;
}

body.sidebar-collapsed .brand-divider,
body.sidebar-collapsed .brand-text {
    display: none !important;
}

body.sidebar-collapsed .brand-logo-wrap {
    justify-content: center;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════════════════
   3. CUSTOM SCROLLBAR ENGINE (SIDEBAR & TABLES)
   ══════════════════════════════════════════════════════════════════════════ */
.sidebar-nav,
.table-wrap {
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}

.sidebar-nav::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    opacity: 0.4;
    border-radius: 0px;
}

/* ══════════════════════════════════════════════════════════════════════════
   4. GLOBAL CUSTOM DROPDOWN SELECT & FORM INPUT ENGINE
   ══════════════════════════════════════════════════════════════════════════ */
select,
.dash-filter-select,
.filter-select,
.form-group select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    height: 44px !important;
    line-height: 44px !important;
    background-color: #FFFFFF !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 12px !important;
    border: 1px solid var(--border-input) !important;
    border-radius: 100px !important;
    padding: 0 40px 0 18px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    cursor: pointer !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015) !important;
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

select:hover,
.dash-filter-select:hover,
.filter-select:hover,
.form-group select:hover {
    background-color: #FFFFFF !important;
    border-color: var(--orange-accent) !important;
}

select:focus,
.dash-filter-select:focus,
.filter-select:focus,
.form-group select:focus {
    background-color: #FFFFFF !important;
    box-shadow: 0 0 0 3px var(--orange-dim) !important;
    border-color: var(--orange-accent) !important;
}

select option {
    background-color: #FFFFFF !important;
    color: #111111 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    padding: 10px 14px !important;
}

.form-group {
    margin-bottom: 20px;
}

label,
.filter-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
textarea {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.015);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):hover,
textarea:hover {
    border-color: var(--orange-accent);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
textarea:focus {
    background: #FFFFFF;
    border-color: var(--orange-accent);
    box-shadow: 0 0 0 3px var(--orange-dim);
}

textarea {
    resize: vertical;
    min-height: 110px;
    border-radius: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-error {
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 6px;
    font-weight: 600;
}

.form-help {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   5. DOCUMENT UPLOAD AREA & DROPZONE STYLING
   ══════════════════════════════════════════════════════════════════════════ */
.upload-box,
.upload-zone,
.upload-area,
.drop-zone,
.file-dropzone {
    background: #FFFFFF;
    border: 1.5px dashed rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    padding: 44px 28px;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    margin-top: 12px;
    margin-bottom: 24px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.01);
}

.upload-box:hover,
.upload-zone:hover,
.upload-area:hover,
.drop-zone:hover,
.file-dropzone:hover {
    border-color: var(--orange-accent);
    background: var(--orange-dim);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--gold-glow);
}

.upload-box h3,
.upload-area h3,
.drop-zone h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin: 12px 0 6px;
}

.upload-box p,
.upload-area p,
.drop-zone p {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════
   6. PUBLIC NAVIGATION BAR
   ══════════════════════════════════════════════════════════════════════════ */
.public-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 5%;
    background: rgba(244, 240, 234, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.25s ease;
    gap: 12px;
}

.nav-brand {
    font-family: 'Geist', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    text-decoration: none;
}

.nav-brand span {
    color: var(--orange-accent);
    transition: color 0.25s ease;
}

.nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-btn-ghost {
    color: var(--text-dim);
    border: 1px solid transparent;
}

.nav-btn-ghost:hover {
    color: var(--text);
    background: var(--navy-card);
}

.nav-btn-gold {
    background: var(--gold);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nav-btn-gold:hover {
    background: var(--orange-accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(250, 107, 92, 0.3);
}

.nav-features-link {
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    white-space: nowrap;
    transition: color 0.15s;
}

.nav-features-link:hover {
    color: var(--orange-accent);
}

.theme-toggle-wrap {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.theme-toggle-track {
    width: 48px !important;
    height: 26px !important;
    border-radius: 100px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border-subtle) !important;
    position: relative !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    align-items: center !important;
    padding: 3px !important;
}

.theme-toggle-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: var(--gold-light) !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.65rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.theme-toggle-star {
    display: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   7. DETACHED CAPSULE SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    height: calc(100vh - 48px);
    background: var(--navy-mid);
    border: none;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 101;
    box-shadow: var(--shadow);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 12px;
}

.sidebar-brand {
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 8px;
}

.sidebar-brand-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 12px !important;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    font-family: 'Geist', sans-serif;
    line-height: 1;
}

.sidebar-brand-name span {
    color: var(--orange-accent);
    transition: color 0.25s ease;
}

.sidebar-brand-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
}

#sidebar-toggle {
    background: var(--navy-card);
    border: none;
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease;
}

#sidebar-toggle:hover {
    background: var(--gold);
    color: #FFFFFF;
}

body.sidebar-collapsed #sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 16px 16px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 100px;
    transition: all 0.2s ease;
    border-left: none;
}

.nav-link:hover {
    color: var(--text);
    background: var(--navy-card);
}

.nav-link.active {
    color: #FFFFFF !important;
    background: var(--gold) !important;
}

.nav-link .icon {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    color: var(--text-dim);
}

.nav-link.active .icon {
    color: var(--gold-light) !important;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-family: 'DM Mono', monospace;
    padding: 2px 8px;
    border-radius: 100px;
    font-weight: 700;
}

.doc-submenu {
    display: none !important;
    background: transparent;
    padding: 2px 0 6px 16px;
    border-left: 2px solid var(--navy-card);
    margin: 4px 0 6px 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.doc-submenu.open {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    opacity: 1;
}

.doc-submenu .nav-link {
    padding: 8px 14px 8px 16px;
    font-size: 0.8rem;
    border-radius: 100px;
}

.doc-submenu .nav-link.active {
    background: var(--navy-card) !important;
    color: var(--text) !important;
}

.nav-arrow {
    margin-left: auto;
    font-size: 0.6rem;
    color: var(--text-muted);
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.nav-arrow.open {
    transform: rotate(180deg);
    color: var(--orange-accent);
}

.sidebar-footer {
    padding: 16px 8px 8px;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.sidebar-footer > div {
    font-size: 0.82rem !important;
    font-weight: 600;
    color: var(--text-dim) !important;
    margin-bottom: 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.sidebar-footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content !important;
    padding: 8px 18px;
    background: var(--navy-card);
    color: var(--text);
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
}

.sidebar-footer a:hover {
    background: var(--orange-accent);
    color: #FFFFFF;
    border-color: var(--orange-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--gold-glow);
}

body.sidebar-collapsed .sidebar {
    width: 76px;
    padding: 20px 8px;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-arrow,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer {
    display: none !important;
}

body.sidebar-collapsed .sidebar-brand-inner {
    justify-content: center !important;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

body.sidebar-collapsed .doc-submenu {
    display: none !important;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ══════════════════════════════════════════════════════════════════════════
   8. MAIN WORKSPACE & TOPBAR (FIXED SIDEBAR OFFSET & NO COLLISION)
   ══════════════════════════════════════════════════════════════════════════ */
.main {
    margin-left: 0;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

body.has-sidebar .main {
    margin-left: calc(var(--sidebar-w) + 48px);
    width: calc(100% - (var(--sidebar-w) + 48px));
}

body.has-sidebar.sidebar-collapsed .main {
    margin-left: 124px;
    width: calc(100% - 124px);
}

.mobile-menu-trigger {
    display: none !important;
}

.topbar {
    background: transparent;
    border-bottom: none;
    padding: 28px 32px 12px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.topbar-left-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.topbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
}

.topbar-search {
    margin-right: 0 !important;
    display: flex;
    align-items: center;
}

.topbar-search input[type="search"] {
    width: 250px !important;
    min-width: 0 !important;
    height: 42px !important;
    border-radius: 100px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border-input) !important;
    padding: 0 20px !important;
    font-size: 0.82rem !important;
    color: var(--text) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02) !important;
    outline: none !important;
}

.topbar-actions .btn-primary {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px !important;
    border-radius: 100px !important;
    background: var(--gold) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 16px var(--gold-glow) !important;
    border: none !important;
}

.content {
    padding: 12px 32px 32px;
    position: relative;
    z-index: 2;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════════════════
   9. DASHBOARD QUICK-ACCESS SEARCH, CASE FILTERS & STATS
   ══════════════════════════════════════════════════════════════════════════ */
.dash-search-container {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    width: 100%;
}

.dash-search-form {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    flex-wrap: wrap;
}

.dash-search-input-wrap {
    position: relative;
    flex: 1 1 340px;
    display: flex;
    align-items: center;
    width: 100%;
}

.dash-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--orange-accent);
    font-size: 1.35rem !important;
    z-index: 2;
    pointer-events: none;
}

.dash-search-input {
    width: 100% !important;
    height: 48px !important;
    padding: 0 42px 0 50px !important;
    background: #FFFFFF !important;
    border-radius: 100px !important;
    border: 1px solid var(--border-input) !important;
    font-size: 0.88rem !important;
    color: var(--text) !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: background-color 0.2s ease, box-shadow 0.2s ease !important;
}

.dash-search-input:focus {
    background: #FFFFFF !important;
    box-shadow: 0 0 0 3px var(--orange-dim) !important;
    border-color: var(--orange-accent) !important;
}

.dash-search-clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-search-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    max-width: 100%;
}

.dash-filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
}

.dash-search-submit {
    height: 48px !important;
    padding: 0 24px !important;
    border-radius: 100px !important;
    background: var(--gold) !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--gold-glow) !important;
    transition: transform 0.15s ease, background-color 0.15s ease !important;
}

.dash-search-submit:hover {
    background: var(--orange-accent) !important;
    transform: translateY(-1px);
}

.dash-search-results-overlay {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-subtle);
}

/* Case Classification and Filtering */
.case-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr auto;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

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

.status-pills-row {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-pills-label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.status-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.area-tag {
    font-size: 0.72rem !important;
    padding: 4px 12px !important;
    border-radius: 100px !important;
    background: var(--navy-card);
    color: var(--text-dim);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.area-tag:hover {
    background: var(--gold);
    color: #FFFFFF;
}

/* Analytics Metrics & Graphical Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 22px 20px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.025);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.stat-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin: 14px 0 6px 0;
    letter-spacing: -0.04em;
    position: relative;
    z-index: 2;
}

.stat-sub {
    font-size: 0.74rem;
    color: var(--text-dim);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.stat-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--navy-card);
    z-index: 3;
}

.stat-card:nth-child(1) {
    background: linear-gradient(135deg, var(--hero-card-bg-start) 0%, var(--hero-card-bg-end) 200%);
    color: var(--hero-card-text);
    border: none;
    transition: background 0.3s ease;
}

.stat-card:nth-child(1) .stat-label {
    color: var(--hero-card-text);
    opacity: 0.8;
}

.stat-card:nth-child(1) .stat-label::after {
    content: "↑ 100% Vol";
    font-size: 0.62rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--hero-card-text);
}

.stat-card:nth-child(1) .stat-value {
    color: var(--hero-card-text);
}

.stat-card:nth-child(1) .stat-sub {
    color: var(--hero-card-text);
    opacity: 0.85;
}

.stat-card:nth-child(1)::before {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 22px;
    width: 70px;
    height: 38px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0px, rgba(255, 255, 255, 0.3) 7px, transparent 7px, transparent 13px);
    clip-path: polygon(0 85%, 25% 50%, 50% 65%, 75% 25%, 100% 10%, 100% 100%, 0 100%);
    z-index: 1;
}

.stat-card:nth-child(1)::after {
    background: var(--orange-accent);
}

.stat-card:nth-child(2) .stat-label::after {
    content: "Active";
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--orange-dim);
    color: var(--orange-accent);
}

.stat-card:nth-child(2)::before {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(var(--orange-accent) 0% 100%, var(--navy-card) 100%);
    mask: radial-gradient(transparent 56%, #000 57%);
    -webkit-mask: radial-gradient(transparent 56%, #000 57%);
    opacity: 0.85;
}

.stat-card:nth-child(2)::after {
    background: var(--orange-accent);
}

.stat-card.success .stat-label::after {
    content: "0% Done";
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
}

.stat-card.success::before {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 24px;
    width: 54px;
    height: 24px;
    border-bottom: 2px solid #2E7D32;
    background: linear-gradient(to top, rgba(46, 125, 50, 0.12), transparent);
    border-radius: 4px;
}

.stat-card.success::after {
    background: #2E7D32;
    width: 0%;
}

.stat-card.danger {
    background: #1C1D1F;
    color: #FFFFFF;
    border: none;
}

.stat-card.danger .stat-label {
    color: #9E9B93;
}

.stat-card.danger .stat-label::after {
    content: "Critical";
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(250, 107, 92, 0.2);
    color: var(--orange-accent);
}

.stat-card.danger .stat-value {
    color: #FFFFFF;
}

.stat-card.danger .stat-sub {
    color: var(--orange-accent);
}

.stat-card.danger::before {
    content: "";
    position: absolute;
    right: 22px;
    bottom: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--orange-accent);
    box-shadow: 0 0 0 0 rgba(250, 107, 92, 0.7);
    animation: dangerPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.stat-card.danger::after {
    background: var(--orange-accent);
    width: 100%;
}

@keyframes dangerPulse {
    0% { box-shadow: 0 0 0 0 rgba(250, 107, 92, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(250, 107, 92, 0); }
    100% { box-shadow: 0 0 0 0 rgba(250, 107, 92, 0); }
}

.stat-card.warning .stat-label::after {
    content: "Pending";
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 100px;
    background: rgba(255, 179, 0, 0.15);
    color: #B8860B;
}

.stat-card.warning::before {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 22px;
    width: 38px;
    height: 26px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0.12) 3px, transparent 3px);
    background-size: 8px 100%;
    opacity: 0.7;
}

.stat-card.warning::after {
    background: #FFB300;
    width: 0%;
}

/* ══════════════════════════════════════════════════════════════════════════
   10. MODERN DASHBOARD CARDS, BUTTONS, TABLES, ALERTS & LISTS
   ══════════════════════════════════════════════════════════════════════════ */
.card {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.025);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.045);
    border-color: var(--orange-accent);
}

.card-header {
    padding: 0 0 18px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--navy-card);
    border: 1px solid var(--border-subtle);
    font-size: 0.75rem !important;
    font-weight: 700;
    color: var(--gold) !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card-header a:hover {
    background: var(--gold);
    color: #FFFFFF !important;
    border-color: var(--gold);
    transform: translateY(-1px);
}

.card-body {
    padding: 8px 0 0 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    font-weight: 800;
    padding: 3px 12px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    border: none;
    transition: all 0.2s ease;
}

.badge-gold { background: var(--navy-card); color: var(--text-dim); }
.badge-danger { background: var(--orange-dim); color: var(--orange-accent); }
.badge-success { background: rgba(46, 125, 50, 0.12); color: #2E7D32; }
.badge-warning { background: rgba(255, 179, 0, 0.15); color: #D97706; }
.badge-muted { background: var(--navy-card); color: var(--text-muted); }

.badge-sm {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-block;
    white-space: nowrap;
}

.badge-progress { background: var(--status-info-bg); color: var(--status-info); }
.badge-urgent { background: var(--status-urgent-bg); color: var(--status-urgent); }
.badge-hearing { background: var(--status-active-bg); color: var(--status-active); }
.badge-adjourned { background: var(--status-warn-bg); color: var(--status-warn); }

.dash-filterable-card:nth-child(2) {
    background: #18191B;
    color: #FFFFFF;
    border: 1px solid var(--orange-dim);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.dash-filterable-card:nth-child(2) .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dash-filterable-card:nth-child(2) .card-title {
    color: #FFFFFF;
}

.dash-filterable-card:nth-child(2) .badge-danger {
    background: var(--orange-accent) !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 10px var(--gold-glow);
}

/* Interactive Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--orange-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-input);
}

.btn-outline:hover {
    border-color: var(--gold);
    background: var(--navy-card);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--navy-card);
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

.btn-warning {
    background: var(--warning-dim);
    color: var(--warning);
}

.btn-warning:hover {
    background: var(--warning);
    color: #FFFFFF;
}

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

/* Data Tables Framework */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 14px 18px;
    text-align: left;
    background: var(--navy-card);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }

tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: var(--navy-card); }
tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-sm); }
tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-sm); }

td {
    padding: 16px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dim);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
}

tbody tr:last-child td { border-bottom: none; }

/* System Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
}

.alert-success { background: var(--success-dim); color: #2E7D32; }
.alert-error { background: var(--danger-dim); color: var(--danger); }
.alert-info { background: var(--orange-dim); color: var(--orange-accent); }
.alert-warning { background: var(--warning-dim); color: var(--warning); }

/* Case Rows, Hearings & Notifications */
.dash-case-row {
    background: var(--navy-card) !important;
    border-radius: 18px !important;
    border: 1px solid var(--border-subtle) !important;
    margin-bottom: 10px !important;
    padding: 14px 18px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    transition: all 0.22s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.dash-case-row:hover {
    transform: translateX(5px);
    background: #FFFFFF !important;
    border-color: var(--orange-accent) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.035);
}

.dash-filterable-card:nth-child(2) .dash-case-row {
    background: #232427 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.dash-filterable-card:nth-child(2) .dash-case-row:hover {
    background: #2C2D32 !important;
    border-color: var(--orange-accent) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.case-num {
    font-family: 'DM Mono', monospace;
    font-weight: 700 !important;
    font-size: 0.73rem !important;
    color: var(--orange-accent) !important;
    letter-spacing: 0.04em;
    display: inline-block;
}

.case-title {
    font-weight: 700;
    font-size: 0.92rem !important;
    color: var(--text);
    margin-top: 2px;
}

.dash-filterable-card:nth-child(2) .case-title {
    color: #FFFFFF !important;
}

.notif-item {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    align-items: flex-start;
    width: 100%;
    transition: all 0.2s ease;
}

.notif-item:hover {
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.notif-item.unread {
    border-left: 4px solid var(--orange-accent);
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange-accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.notif-dot.read {
    background: var(--text-muted);
}

.notif-body {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
}

.notif-case {
    font-family: 'DM Mono', monospace;
    font-weight: 800;
    font-size: 0.72rem;
    color: var(--orange-accent);
}

.notif-msg {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2px 0;
    word-break: break-word;
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.hearing-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--navy-card);
    margin-bottom: 10px;
}

.hearing-date-block {
    text-align: center;
    background: #FFFFFF;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    min-width: 64px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.hearing-date-day {
    font-family: 'DM Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.hearing-date-mon {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Empty States */
.empty-state {
    padding: 38px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(250, 246, 241, 0.4);
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(0, 0, 0, 0.06);
    margin-top: 4px;
}

.dash-filterable-card:nth-child(2) .empty-state {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--orange-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem !important;
    margin-bottom: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    opacity: 1 !important;
}

.dash-filterable-card:nth-child(2) .empty-icon {
    background: #252629;
    color: var(--orange-accent);
}

.empty-state p {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-dim);
}

.dash-filterable-card:nth-child(2) .empty-state p {
    color: #9E9B93;
}

/* Template Grid Cards */
.tmpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.tmpl-card {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.tmpl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.05);
    border-color: var(--orange-accent);
}

.tmpl-top { padding: 20px 22px 16px; flex: 1; }
.tmpl-type { font-size: 0.68rem; font-family: 'DM Mono', monospace; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.tmpl-title { font-family: 'DM Sans', sans-serif; font-size: 1.05rem; color: var(--text); font-weight: 800; margin-bottom: 8px; }
.tmpl-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.6; }
.tmpl-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.tmpl-var {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    color: var(--orange-accent);
    background: var(--orange-dim);
    padding: 3px 10px;
    border-radius: 100px;
    font-weight: 700;
}

.tmpl-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--navy-card);
}

.tmpl-meta { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.tmpl-actions { display: flex; gap: 8px; }

.scope-badge-firm { background: rgba(0, 0, 0, 0.05); color: var(--text-dim); }
.scope-badge-global { background: var(--orange-dim); color: var(--orange-accent); }
.scope-badge-personal { background: var(--navy-card); color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════════════
   11. LANDING PAGE HERO, TICKER & WORKSPACE PREVIEW
   ══════════════════════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    z-index: 2;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 5% 60px;
    text-align: center;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    font-weight: 800;
    color: var(--text-dim);
    background: var(--bg-surface);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    max-width: 100%;
    text-align: center;
}

.hero-eyebrow-line {
    height: 6px;
    width: 6px;
    border-radius: 50%;
    background: var(--orange-accent);
    flex-shrink: 0;
}

.hero-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(2rem, 5vw, 4.2rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    max-width: 860px;
    margin: 0 auto 20px;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.hero-title em {
    font-style: italic;
    color: var(--orange-accent);
    font-weight: 700;
}

.hero-sub {
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    color: var(--text-dim);
    line-height: 1.65;
    max-width: 680px;
    margin: 0 auto 36px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-cta-primary {
    background: var(--gold);
    color: #FFFFFF;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.btn-cta-primary:hover {
    background: var(--orange-accent);
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(250, 107, 92, 0.35);
}

.btn-cta-outline {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
}

.btn-cta-outline:hover {
    border-color: var(--orange-accent);
    color: var(--orange-accent);
    transform: translateY(-2px);
}

.preview-wrap {
    position: relative;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.preview-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 70%;
    background: radial-gradient(circle, rgba(250, 107, 92, 0.15) 0%, rgba(212, 168, 67, 0.08) 50%, transparent 80%);
    filter: blur(50px);
    pointer-events: none;
}

.preview-frame {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-float);
    overflow: hidden;
    text-align: left;
    width: 100%;
}

.preview-bar {
    background: var(--bg-card);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #D1D5DB;
    flex-shrink: 0;
}

.preview-url {
    margin-left: 12px;
    background: var(--bg-surface);
    padding: 4px 16px;
    border-radius: var(--radius-pill);
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

.preview-content {
    background: var(--bg-surface);
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 480px;
    width: 100%;
}

.preview-sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-light);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ps-brand {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
    padding: 0 10px 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.ps-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 10px 10px 4px;
}

.ps-item {
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-item.active {
    background: var(--gold);
    color: #FFFFFF;
}

.preview-main {
    padding: 24px;
    background: var(--bg-surface);
    overflow-x: auto;
    width: 100%;
}

.pm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.pm-stat {
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.pm-stat-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pm-stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
}

.pm-stat-val.gold { color: var(--gold-warm); }
.pm-stat-val.danger { color: var(--status-urgent); }
.pm-stat-val.warn { color: var(--status-warn); }

.pm-table-head,
.pm-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1fr;
    padding: 10px 14px;
    align-items: center;
    font-size: 0.82rem;
    gap: 8px;
    min-width: 0;
}

.pm-table-head {
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.68rem;
    border-bottom: 1px solid var(--border-light);
}

.pm-row {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    border: 1px solid var(--border-light);
}

.pm-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-cell.title {
    font-weight: 700;
    color: var(--text-primary);
}

/* Ticker Strip */
.ticker-strip {
    background: var(--gold);
    color: #FFFFFF;
    padding: 15px 0;
    overflow: hidden;
    white-space: nowrap;
    margin: 40px 0 80px;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 40px;
    animation: ticker 34s linear infinite;
    width: max-content;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
}

.ticker-item strong {
    color: var(--gold-light);
    font-family: 'DM Mono', monospace;
    font-weight: 700;
}

.new-badge {
    font-size: 0.62rem;
    font-weight: 800;
    background: var(--orange-accent);
    color: #FFFFFF;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ══════════════════════════════════════════════════════════════════════════
   12. SHOWCASE SECTIONS, DARK SHOWCASE, SPLIT GRIDS, QUOTE, CTA & FOOTER
   ══════════════════════════════════════════════════════════════════════════ */
section {
    position: relative;
    z-index: 2;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-eyebrow-line {
    height: 2px;
    width: 24px;
    background: var(--orange-accent);
    flex-shrink: 0;
}

.section-eyebrow-text {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--orange-accent);
}

.section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.75rem, 3.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.section-sub {
    font-size: 1.02rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 620px;
    font-weight: 500;
    margin-bottom: 44px;
}

.features-section,
.calendar-preview-section,
.team-section,
.ai-section,
.notif-section,
.quote-section,
.cta-section {
    padding: 80px 5%;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 24px;
    width: 100%;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: rgba(250, 107, 92, 0.3);
}

.feature-icon-wrap {
    width: 52px;
    height: 52px;
    background: var(--orange-dim);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    margin-bottom: 20px;
    color: var(--orange-accent);
}

.feature-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.new-features-section {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    border-radius: var(--radius-lg);
    padding: 70px 6%;
    max-width: 1280px;
    width: calc(100% - 10%);
    margin: 40px auto 60px;
}

.new-features-section .section-title { color: #FFFFFF; }
.new-features-section .section-sub { color: #A0A5B1; }

.new-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 24px;
    margin-top: 40px;
    width: 100%;
}

.new-feature-block {
    background: var(--bg-dark-card);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    border: 1px solid var(--border-dark);
    position: relative;
    width: 100%;
}

.nfb-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.nfb-badge.new { background: var(--orange-accent); color: #FFFFFF; }
.nfb-badge.improved { background: var(--gold-warm); color: var(--gold); }

.nfb-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.nfb-desc {
    font-size: 0.9rem;
    color: #A0A5B1;
    line-height: 1.6;
    margin-bottom: 20px;
}

.nfb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nfb-chip {
    background: rgba(255, 255, 255, 0.06);
    color: #E2E4E9;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-preview-inner,
.team-inner,
.ai-inner,
.notif-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    width: 100%;
}

.ai-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.ai-type-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    box-shadow: var(--shadow-soft);
}

.cal-mock,
.team-mock,
.ai-doc-preview,
.notif-mock {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    width: 100%;
}

.cal-mock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cal-mock-title { font-weight: 800; font-size: 1.1rem; }

.cal-mock-toggle span {
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    color: var(--text-muted);
}

.cal-mock-toggle span.active {
    background: var(--gold);
    color: #FFFFFF;
}

.cal-mock-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
    width: 100%;
}

.cal-mock-dow {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    padding-bottom: 8px;
}

.cal-mock-day {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 6px 2px;
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.cal-mock-day.today {
    background: var(--orange-accent);
    color: #FFFFFF;
}

.cal-ev-chip {
    width: 100%;
    height: 4px;
    border-radius: 2px;
}

.team-mock-header {
    font-weight: 800;
    font-size: 1rem;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-light);
    width: 100%;
}

.team-member:last-child { border: none; }

.tm-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.tm-info { flex: 1; min-width: 0; }
.tm-name { font-weight: 700; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-role { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tm-role-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.ai-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
    flex-wrap: wrap;
}

.ai-doc-title { font-weight: 800; font-size: 0.9rem; min-width: 0; }

.ai-doc-badge {
    background: var(--orange-dim);
    color: var(--orange-accent);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
}

.ai-doc-body { padding: 12px 0; }

.ai-doc-line {
    height: 8px;
    background: var(--bg-inset);
    border-radius: 4px;
    margin-bottom: 8px;
}

.ai-doc-line.gold { background: var(--orange-accent); opacity: 0.4; }
.ai-doc-line.w-75 { width: 75%; }
.ai-doc-line.w-full { width: 100%; }
.ai-doc-line.w-90 { width: 90%; }
.ai-doc-line.w-85 { width: 85%; }
.ai-doc-line.w-60 { width: 60%; }
.ai-doc-line.w-45 { width: 45%; }

.ai-template-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    border: 1px solid var(--border-light);
    width: 100%;
}

.ai-tmpl-icon { color: var(--orange-accent); flex-shrink: 0; }
.ai-tmpl-info { min-width: 0; flex: 1; }
.ai-tmpl-name { font-weight: 700; font-size: 0.82rem; }
.ai-tmpl-vars { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-tmpl-scope {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.ai-tmpl-scope.global { background: rgba(74, 144, 217, 0.15); color: #4A90D9; }
.ai-tmpl-scope.firm { background: rgba(212, 168, 67, 0.15); color: #D4A843; }

.notif-mock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 14px;
    font-weight: 800;
}

.notif-count {
    background: var(--orange-accent);
    color: #FFFFFF;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.quote-section {
    text-align: center;
    padding: 80px 5%;
    width: 100%;
}

.quote-inner {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 60px 8%;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    position: relative;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.quote-mark {
    font-family: 'DM Sans', sans-serif;
    font-size: 4.5rem;
    line-height: 0.85;
    color: var(--orange-accent);
    opacity: 0.35;
    margin-bottom: -16px;
}

.quote-text {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.1rem, 2.3vw, 1.55rem);
    font-style: italic;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.55;
    margin: 20px 0 24px;
}

.quote-divider {
    width: 40px;
    height: 2px;
    background: var(--orange-accent);
    margin: 0 auto 16px;
}

.quote-attr {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.cta-section {
    text-align: center;
    position: relative;
    background-image:
        linear-gradient(135deg, rgba(20, 21, 23, 0.88) 0%, rgba(34, 36, 43, 0.92) 100%),
        url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 90px 6%;
    max-width: 1280px;
    width: calc(100% - 10%);
    margin: 0 auto 60px;
    overflow: hidden;
    box-shadow: var(--shadow-float);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    word-break: break-word;
}

.cta-sub {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 580px;
    margin: 0 auto 36px;
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.cta-actions .btn-cta-primary {
    background: var(--orange-accent);
    color: #FFFFFF;
}

.cta-actions .btn-cta-primary:hover {
    background: #FFFFFF;
    color: var(--gold);
}

.cta-actions .btn-cta-outline {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cta-actions .btn-cta-outline:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

footer {
    background: var(--navy);
    border-top: 1px solid var(--border-light);
    padding: 40px 5% 60px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-brand {
    font-family: 'Geist', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.footer-brand span {
    color: var(--orange-accent);
    transition: color 0.25s ease;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--orange-accent);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    width: 100%;
    margin-top: 10px;
}

/* ══════════════════════════════════════════════════════════════════════════
   13. UTILITY & SCROLL REVEAL ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-header h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.page-header p {
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-top: 4px;
    font-weight: 500;
}

.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 24px 0;
}

.priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.priority-urgent { background: var(--danger); }
.priority-high { background: var(--warning); }
.priority-medium { background: var(--gold-light); }
.priority-low { background: var(--text-muted); }

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ══════════════════════════════════════════════════════════════════════════
   14. MOBILE & TABLET RESPONSIVENESS OVERRIDES
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    #sidebar-toggle { display: none !important; }
    body.has-sidebar .main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar {
        transform: translateX(-120%);
        margin: 0;
        height: 100vh;
        width: 280px !important;
        border-radius: 0;
        top: 0;
        left: 0;
        z-index: 101;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    }

    .mobile-menu-trigger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #FFFFFF;
        border: none;
        color: var(--text);
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
        flex-shrink: 0;
    }

    .topbar { padding: 16px; }
    .content { padding: 16px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .case-filter-grid { grid-template-columns: 1fr 1fr; }
    .filter-actions { grid-column: span 2; justify-content: flex-end; }

    .cal-preview-inner,
    .team-inner,
    .ai-inner,
    .notif-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .preview-content { grid-template-columns: 1fr; }
    .preview-sidebar { display: none; }

    .hero-actions,
    .cta-actions {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

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

@media (max-width: 768px) {
    .public-nav { padding: 12px 4%; }
    .nav-features-link { display: none; }
    .brand-divider { display: none; }
    .brand-text .top { font-size: 0.78rem; }
    .brand-text .bottom { font-size: 0.55rem; }
    .nav-links { gap: 10px; }
    .nav-btn { padding: 8px 14px; font-size: 0.8rem; }

    .topbar-title { font-size: 1.4rem; }
    .topbar-title::after { display: none !important; }
    .topbar-search { display: none !important; }

    .hero { padding: 96px 5% 48px; }
    .hero-eyebrow { font-size: 0.75rem; padding: 6px 12px; }

    .dash-search-container { padding: 16px; margin-bottom: 20px; border-radius: 20px; }
    .dash-search-form { flex-direction: column; align-items: stretch; gap: 12px; }
    .dash-search-input-wrap { width: 100%; flex: 1 1 auto; }
    .dash-search-filters { flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
    .dash-filter-label { display: none !important; }
    .dash-filter-select { width: 100% !important; max-width: 100% !important; }
    .dash-search-submit { width: 100% !important; justify-content: center !important; }

    .form-row { grid-template-columns: 1fr; }
    .case-filter-grid { grid-template-columns: 1fr; }
    .filter-actions { grid-column: span 1; }

    .dash-case-row { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px !important; }
    .dash-case-row > a.btn { align-self: flex-end; }
    .features-grid { grid-template-columns: 1fr; }

    .new-features-section,
    .cta-section {
        width: 100%;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        padding-left: 5%;
        padding-right: 5%;
    }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .stat-card { min-height: 140px; padding: 18px 16px; }
    footer { flex-direction: column; gap: 16px; text-align: center; padding: 32px 20px; }
}

@media (max-width: 520px) {
    .brand-text { display: none; }

    .pm-table-head,
    .pm-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .pm-th:nth-child(2),
    .pm-cell:nth-child(2),
    .pm-th:nth-child(3),
    .pm-cell:nth-child(3) {
        display: none;
    }

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

    .cal-mock-day {
        min-height: 38px;
        font-size: 0.72rem;
        padding: 4px 1px;
    }

    .cal-mock-dow { font-size: 0.65rem; }
    .ai-doc-preview, .team-mock, .notif-mock, .cal-mock { padding: 16px; }
    .quote-inner { padding: 40px 5%; }
    .ai-template-row { flex-wrap: wrap; }
    .ai-tmpl-scope { margin-left: 0; margin-top: 4px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   15. DARK THEME ENVIRONMENT ([data-theme="dark"] Overrides)
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --navy:          #121418;
    --navy-mid:      #1D2128;
    --navy-card:     #252A33;
    --navy-light:    #2E3440;

    --bg-canvas:     #0E0F12;
    --bg-surface:    #16181D;
    --bg-card:       #1E2026;
    --bg-inset:      #262930;
    --bg-dark:       #121316;

    --gold:          #F3F4F6;
    --gold-light:    #FFB800;
    --gold-warm:     #FFB800;
    --gold-dim:      rgba(255, 184, 0, 0.12);
    --gold-glow:     rgba(255, 184, 0, 0.25);

    --text:          #F9FAFB;
    --text-primary:  #F5F6F8;
    --text-dim:      #9CA3AF;
    --text-muted:    #6B7280;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-input:  rgba(255, 255, 255, 0.08);
    --border-light:  rgba(255, 255, 255, 0.08);
    --shadow:        0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-soft:   0 12px 36px rgba(0, 0, 0, 0.4);
    --shadow-card:   0 20px 50px rgba(0, 0, 0, 0.5);

    color-scheme: dark;
}

[data-theme="dark"] body {
    background: var(--navy);
    color: var(--text);
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
[data-theme="dark"] textarea {
    background: var(--navy-card);
    border-color: var(--border-input);
    color: var(--text);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    background: var(--navy-mid);
    border-color: var(--orange-accent);
}

[data-theme="dark"] select,
[data-theme="dark"] .dash-filter-select,
[data-theme="dark"] .filter-select,
[data-theme="dark"] .form-group select {
    background-color: var(--navy-card) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23F3F4F6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    border-color: var(--border-input) !important;
    color: var(--text) !important;
}

[data-theme="dark"] select:hover,
[data-theme="dark"] .dash-filter-select:hover,
[data-theme="dark"] .filter-select:hover,
[data-theme="dark"] .form-group select:hover {
    background-color: var(--navy-light) !important;
    border-color: var(--orange-accent) !important;
}

[data-theme="dark"] select option {
    background-color: var(--navy-mid) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .upload-box,
[data-theme="dark"] .upload-zone,
[data-theme="dark"] .upload-area,
[data-theme="dark"] .drop-zone,
[data-theme="dark"] .file-dropzone {
    background: var(--navy-mid);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .upload-box:hover,
[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-area:hover,
[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .file-dropzone:hover {
    background: var(--navy-card);
    border-color: var(--orange-accent);
}

[data-theme="dark"] .sidebar {
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #sidebar-toggle { background: var(--navy-card); color: var(--text-dim); }
[data-theme="dark"] #sidebar-toggle:hover { background: var(--orange-accent); color: #FFFFFF; }
[data-theme="dark"] .nav-link:hover { background: var(--navy-card); color: var(--text); }
[data-theme="dark"] .nav-link.active { background: var(--orange-accent) !important; color: #FFFFFF !important; }
[data-theme="dark"] .nav-link.active .icon { color: #FFFFFF !important; }
[data-theme="dark"] .doc-submenu { border-left-color: var(--navy-card); }
[data-theme="dark"] .sidebar-overlay { background: rgba(0, 0, 0, 0.7); }

[data-theme="dark"] .public-nav {
    background: rgba(18, 20, 24, 0.88);
    border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .topbar-search input[type="search"] {
    background: var(--navy-mid) !important;
    color: var(--text) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--border-input) !important;
}

[data-theme="dark"] .topbar-actions .btn-primary { background: var(--orange-accent) !important; color: #FFFFFF !important; }
[data-theme="dark"] .mobile-menu-trigger { background: var(--navy-mid) !important; color: var(--text) !important; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important; }

[data-theme="dark"] .theme-toggle-track {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(22px) !important;
    background: #111115 !important;
    color: #FFB800 !important;
}

[data-theme="dark"] .nav-btn-gold {
    background: var(--orange-accent);
    color: #FFFFFF;
}

[data-theme="dark"] .btn-cta-primary {
    background: var(--orange-accent);
    color: #FFFFFF;
}

[data-theme="dark"] .btn-cta-primary:hover {
    background: #FFFFFF;
    color: #111115;
}

[data-theme="dark"] .card-header a {
    background: var(--navy-card);
    border-color: var(--border-subtle);
    color: var(--text) !important;
}

[data-theme="dark"] .card-header a:hover {
    background: var(--orange-accent);
    border-color: var(--orange-accent);
    color: #FFFFFF !important;
}

[data-theme="dark"] .dash-search-container { background: var(--navy-mid); border: 1px solid var(--border-subtle); box-shadow: var(--shadow); }
[data-theme="dark"] .dash-search-input { background: var(--navy-card) !important; color: var(--text) !important; border: 1px solid var(--border-input) !important; }
[data-theme="dark"] .dash-search-input:focus { background: var(--navy-mid) !important; border-color: var(--orange-accent) !important; }

[data-theme="dark"] .dash-search-submit { background: var(--orange-accent) !important; color: #FFFFFF !important; }
[data-theme="dark"] .dash-search-submit:hover { opacity: 0.9 !important; color: #FFFFFF !important; }
[data-theme="dark"] .dash-search-results-overlay { background: var(--navy-mid); border: 1px solid var(--border-subtle); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }

[data-theme="dark"] .stat-card { background: var(--navy-mid); border: 1px solid var(--border-subtle); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); }
[data-theme="dark"] .stat-card.danger { background: #18191B; border: 1px solid var(--orange-dim); }

[data-theme="dark"] .card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .tmpl-card,
[data-theme="dark"] .feature-card {
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] thead th,
[data-theme="dark"] .tmpl-footer,
[data-theme="dark"] .hearing-item,
[data-theme="dark"] .notif-item {
    background: var(--navy-card);
}

[data-theme="dark"] .hearing-date-block { background: var(--navy-mid); }
[data-theme="dark"] td { border-bottom-color: var(--border-subtle); color: var(--text-dim); }
[data-theme="dark"] tbody tr:hover { background: var(--navy-card); }

[data-theme="dark"] .dash-case-row { background: var(--navy-card) !important; border: 1px solid var(--border-subtle) !important; }
[data-theme="dark"] .dash-case-row:hover { background: var(--navy-light) !important; border-color: var(--orange-accent) !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }

[data-theme="dark"] .empty-state { background: rgba(255, 255, 255, 0.015); border: 1px dashed rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .empty-icon { background: var(--navy-card); color: var(--orange-accent); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
[data-theme="dark"] .empty-state p { color: var(--text-dim); }

[data-theme="dark"] .sidebar-footer a { background: var(--navy-card); color: var(--text); border-color: var(--border-subtle); }
[data-theme="dark"] .sidebar-footer a:hover { background: var(--orange-accent); color: #FFFFFF; border-color: var(--orange-accent); }

/* ══════════════════════════════════════════════════════════════════════════
   16. CLIENT PREVIEW PALETTE SWITCHER OVERRIDES
   ══════════════════════════════════════════════════════════════════════════ */
[data-palette="cobalt"] {
    --gold:          #2F6FED;
    --gold-light:    #5389F5;
    --gold-dim:      rgba(47, 111, 237, 0.12);
    --gold-glow:     rgba(47, 111, 237, 0.25);

    --orange-accent: #2F6FED;
    --orange-dim:    rgba(47, 111, 237, 0.12);

    --hero-card-bg-start: #1E40AF;
    --hero-card-bg-end:   #3B82F6;
    --hero-card-text:     #FFFFFF;
}

[data-palette="emerald"] {
    --gold:          #4A6B43;
    --gold-light:    #CFDECA;
    --gold-dim:      rgba(207, 222, 202, 0.25);
    --gold-glow:     rgba(207, 222, 202, 0.4);

    --orange-accent: #4A6B43;
    --orange-dim:    rgba(74, 107, 67, 0.12);

    --hero-card-bg-start: #CFDECA;
    --hero-card-bg-end:   #9AB493;
    --hero-card-text:     #1C241A;
}

[data-palette="amethyst"] {
    --gold:          #7C3AED;
    --gold-light:    #8B5CF6;
    --gold-dim:      rgba(124, 58, 237, 0.12);
    --gold-glow:     rgba(124, 58, 237, 0.25);

    --orange-accent: #7C3AED;
    --orange-dim:    rgba(124, 58, 237, 0.12);

    --hero-card-bg-start: #5B21B6;
    --hero-card-bg-end:   #8B5CF6;
    --hero-card-text:     #FFFFFF;
}

[data-palette="offwhite"] {
    --gold:          #475569;
    --gold-light:    #94A3B8;
    --gold-dim:      rgba(71, 85, 105, 0.12);
    --gold-glow:     rgba(71, 85, 105, 0.25);

    --orange-accent: #475569;
    --orange-dim:    rgba(71, 85, 105, 0.12);

    --hero-card-bg-start: #E2E8F0;
    --hero-card-bg-end:   #CBD5E1;
    --hero-card-text:     #111111;
}

[data-palette="sage"] {
    --gold:          #596131;
    --gold-light:    #E1E5AC;
    --gold-dim:      rgba(89, 97, 49, 0.12);
    --gold-glow:     rgba(89, 97, 49, 0.25);

    --orange-accent: #596131;
    --orange-dim:    rgba(89, 97, 49, 0.12);

    --hero-card-bg-start: #E1E5AC;
    --hero-card-bg-end:   #B5BC7E;
    --hero-card-text:     #111111;
}

.preview-palette-picker {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    font-family: 'DM Sans', sans-serif;
}

[data-theme="dark"] .preview-palette-picker {
    background: #1D2128;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.preview-picker-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.palette-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

.palette-btn:hover { transform: scale(1.15); }
.palette-btn.active { border-color: var(--text); transform: scale(1.15); }

.palette-btn-default  { background: linear-gradient(135deg, #1C1D1F 50%, #FA6B5C 50%); }
.palette-btn-cobalt   { background: linear-gradient(135deg, #2F6FED 50%, #3B82F6 50%); }
.palette-btn-emerald  { background: linear-gradient(135deg, #4A6B43 50%, #CFDECA 50%); }
.palette-btn-amethyst { background: linear-gradient(135deg, #7C3AED 50%, #8B5CF6 50%); }
.palette-btn-offwhite { background: linear-gradient(135deg, #475569 50%, #E2E8F0 50%); }
.palette-btn-sage     { background: linear-gradient(135deg, #596131 50%, #E1E5AC 50%); }

/* ══════════════════════════════════════════════════════════════════════════
   AUTH: PASSWORD VISIBILITY TOGGLE, STRENGTH METER & REMEMBER ME
   ══════════════════════════════════════════════════════════════════════════ */
.password-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field-wrap input {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--text);
    background: var(--navy-card);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--orange-accent);
    outline-offset: 2px;
}

.password-toggle-btn svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Strength Meter */
.strength-meter {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--navy-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.strength-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.strength-label-muted {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
}

.strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.strength-bar {
    height: 5px;
    border-radius: 100px;
    background: var(--border-input);
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.strength-rules {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
}

.strength-rule {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.strength-rule-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.45;
    flex-shrink: 0;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.strength-rule.met {
    color: var(--success);
    font-weight: 600;
}

.strength-rule.met .strength-rule-dot {
    background: var(--success);
    opacity: 1;
}

/* Remember Me Row */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}

.remember-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--text-muted);
    background: #FFFFFF;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    flex-shrink: 0;
    transition: all 0.18s ease;
}

.remember-checkbox::before {
    content: "";
    width: 9px;
    height: 9px;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    background: #FFFFFF;
    transition: transform 0.15s ease-in-out;
}

.remember-checkbox:checked {
    background: var(--orange-accent);
    border-color: var(--orange-accent);
}

.remember-checkbox:checked::before {
    transform: scale(1);
}

.remember-checkbox:focus-visible {
    outline: 2px solid var(--orange-accent);
    outline-offset: 2px;
}

[data-theme="dark"] .password-toggle-btn:hover {
    background: var(--navy-light);
}

[data-theme="dark"] .strength-meter {
    background: var(--navy-card);
    border-color: var(--border-subtle);
}

[data-theme="dark"] .remember-checkbox {
    background: var(--navy-card);
    border-color: var(--text-muted);
}

[data-theme="dark"] .remember-checkbox:checked {
    background: var(--orange-accent);
    border-color: var(--orange-accent);
}

@media (max-width: 520px) {
    .strength-rules {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR TITLE LAYOUT FOR LONG CASE TITLES
   ══════════════════════════════════════════════════════════════════════════ */
.topbar {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 12px;
}

.topbar-left-wrapper {
    flex: 1 1 360px;
    min-width: 0;
    align-items: flex-start;
}

.topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(1.35rem, 2vw, 2.05rem);
    line-height: 1.18;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topbar-actions {
    flex: 0 0 auto;
    max-width: 100%;
    flex-wrap: wrap !important;
}

@media (max-width: 1200px) {
    .topbar-left-wrapper {
        flex: 1 1 100%;
    }

    .topbar-actions {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 960px) {
    .topbar-left-wrapper {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .topbar-title {
        font-size: 1.25rem;
        line-height: 1.22;
        -webkit-line-clamp: 2;
    }

    .topbar-search input[type="search"] {
        width: 100% !important;
        min-width: 180px !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   OPTIONAL AREA(S) OF LAW — COLLAPSIBLE SELECTOR
   ══════════════════════════════════════════════════════════════════════════ */
.area-optional-box {
    background: var(--navy-card);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.area-optional-box.is-open {
    border-color: var(--orange-accent);
    box-shadow: 0 0 0 3px var(--orange-dim);
}

.area-optional-toggle {
    width: 100%;
    background: #FFFFFF;
    border: none;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.area-optional-summary {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.area-optional-chevron {
    font-size: 0.75rem;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.area-optional-box.is-open .area-optional-chevron {
    transform: rotate(180deg);
    color: var(--orange-accent);
}

.area-checks {
    display: none;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border-subtle);
    max-height: 220px;
    overflow-y: auto;
}

.area-optional-box.is-open .area-checks {
    display: block;
}

.area-checks #id_areas_of_law {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.area-checks #id_areas_of_law > div {
    flex: 0 0 auto;
}

.area-checks label {
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 100px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.area-checks label:hover {
    border-color: var(--orange-accent);
    color: var(--text);
}

.area-checks input[type="checkbox"] {
    appearance: auto;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    padding: 0;
    margin: 0;
    accent-color: var(--orange-accent);
    cursor: pointer;
}

.area-checks label.is-checked {
    background: var(--orange-dim);
    border-color: var(--orange-accent);
    color: var(--text);
    font-weight: 700;
}

[data-theme="dark"] .area-optional-box {
    background: var(--navy-card);
    border-color: var(--border-input);
}

[data-theme="dark"] .area-optional-toggle {
    background: var(--navy-mid);
    color: var(--text);
}

[data-theme="dark"] .area-checks label {
    background: var(--navy-mid);
    border-color: var(--border-subtle);
    color: var(--text-dim);
}

[data-theme="dark"] .area-checks label.is-checked {
    background: var(--orange-dim);
    border-color: var(--orange-accent);
    color: var(--text);
}

/* ══════════════════════════════════════════════════════════════════════════
   17. GLOBAL CUSTOM SELECT DROPDOWN & CALENDAR / DATETIME PICKER ENGINE
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Custom Select Dropdown ─────────────────────────────────────────────── */
.ui-select-wrap {
    position: relative;
    width: 100%;
}

.ui-select-native {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
}

.ui-select-trigger {
    width: 100%;
    height: 44px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-input);
    border-radius: 100px;
    padding: 0 40px 0 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ui-select-trigger:hover:not(:disabled) {
    border-color: var(--orange-accent);
}

.ui-select-wrap.is-open .ui-select-trigger,
.ui-select-trigger:focus-visible {
    border-color: var(--orange-accent);
    box-shadow: 0 0 0 3px var(--orange-dim);
    outline: none;
}

.ui-select-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: var(--navy-card);
}

.ui-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.ui-select-label.is-placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.ui-select-chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    color: var(--text);
    pointer-events: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.ui-select-wrap.is-open .ui-select-chevron {
    transform: translateY(-50%) rotate(180deg);
    color: var(--orange-accent);
}

.ui-select-menu {
    position: fixed;
    z-index: 9998;
    background: #FFFFFF;
    border: 1px solid var(--border-input);
    border-radius: 18px;
    padding: 6px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
    max-height: 260px;
    overflow-y: auto;
    display: none;
}

.ui-select-menu.is-open {
    display: block;
    animation: uiPopIn 0.16s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ui-select-search-wrap {
    padding: 4px 4px 6px;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 2;
}

.ui-select-search {
    width: 100% !important;
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 100px !important;
    font-size: 0.8rem !important;
    background: var(--navy-card) !important;
}

.ui-select-option {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 9px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.ui-select-option:hover:not(:disabled),
.ui-select-option.is-focused:not(:disabled) {
    background: var(--navy-card);
    color: var(--text);
}

.ui-select-option.is-selected {
    background: var(--orange-dim);
    color: var(--orange-accent);
    font-weight: 700;
}

.ui-select-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ui-select-check {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--orange-accent);
    flex-shrink: 0;
}

.ui-select-empty {
    padding: 12px 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Custom Date & Datetime Picker ──────────────────────────────────────── */
.ui-date-wrap {
    position: relative;
    width: 100%;
}

.ui-date-trigger {
    width: 100%;
    height: 44px;
    background-color: #FFFFFF;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0 42px 0 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ui-date-trigger:hover:not(:disabled) {
    border-color: var(--orange-accent);
}

.ui-date-wrap.is-open .ui-date-trigger,
.ui-date-trigger:focus-visible {
    border-color: var(--orange-accent);
    box-shadow: 0 0 0 3px var(--orange-dim);
    outline: none;
}

.ui-date-display.is-placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.ui-date-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy-card);
    color: var(--orange-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ui-date-wrap.is-open .ui-date-icon,
.ui-date-trigger:hover .ui-date-icon {
    background: var(--orange-dim);
}

.ui-cal-popover {
    position: fixed;
    z-index: 9999;
    width: 304px;
    background: #FFFFFF;
    border: 1px solid var(--border-input);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.14);
    display: none;
    user-select: none;
}

.ui-cal-popover.is-open {
    display: block;
    animation: uiPopIn 0.16s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ui-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.ui-cal-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--navy-card);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.16s ease;
}

.ui-cal-nav:hover {
    background: var(--orange-accent);
    border-color: var(--orange-accent);
    color: #FFFFFF;
}

.ui-cal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.ui-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}

.ui-cal-weekdays span {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 4px 0;
}

.ui-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ui-cal-day {
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s ease;
}

.ui-cal-day:hover:not(:disabled) {
    background: var(--navy-card);
    color: var(--orange-accent);
}

.ui-cal-day.is-outside {
    color: var(--text-muted);
    opacity: 0.45;
}

.ui-cal-day.is-today {
    border: 1.5px solid var(--orange-accent);
    color: var(--orange-accent);
    font-weight: 800;
}

.ui-cal-day.is-selected {
    background: var(--orange-accent) !important;
    color: #FFFFFF !important;
    font-weight: 800;
    box-shadow: 0 4px 12px var(--orange-dim);
}

.ui-cal-time {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ui-cal-time-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.ui-cal-time-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ui-cal-time-select {
    height: 32px !important;
    line-height: 32px !important;
    padding: 0 24px 0 10px !important;
    border-radius: 100px !important;
    font-family: 'DM Mono', monospace !important;
    font-size: 0.78rem !important;
    background-position: right 8px center !important;
    background-size: 10px !important;
    width: auto !important;
}

.ui-cal-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ui-cal-foot-btn {
    border: none;
    background: var(--navy-card);
    color: var(--text-dim);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.16s ease;
}

.ui-cal-foot-btn:hover {
    background: var(--orange-dim);
    color: var(--orange-accent);
}

.ui-cal-foot-btn.is-primary {
    background: var(--gold);
    color: #FFFFFF;
}

.ui-cal-foot-btn.is-primary:hover {
    background: var(--orange-accent);
    color: #FFFFFF;
}

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

/* ── Dark Theme Overrides ───────────────────────────────────────────────── */
[data-theme="dark"] .ui-select-trigger,
[data-theme="dark"] .ui-date-trigger {
    background-color: var(--navy-card);
    border-color: var(--border-input);
    color: var(--text);
}

[data-theme="dark"] .ui-select-trigger:hover:not(:disabled),
[data-theme="dark"] .ui-date-trigger:hover:not(:disabled) {
    background-color: var(--navy-light);
    border-color: var(--orange-accent);
}

[data-theme="dark"] .ui-select-menu,
[data-theme="dark"] .ui-cal-popover {
    background: var(--navy-mid);
    border-color: var(--border-subtle);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .ui-select-option:hover:not(:disabled),
[data-theme="dark"] .ui-select-option.is-focused:not(:disabled) {
    background: var(--navy-card);
}

[data-theme="dark"] .ui-cal-nav,
[data-theme="dark"] .ui-cal-foot-btn,
[data-theme="dark"] .ui-date-icon {
    background: var(--navy-card);
}

[data-theme="dark"] .ui-cal-foot-btn.is-primary {
    background: var(--orange-accent);
    color: #FFFFFF;
}

/* ══════════════════════════════════════════════════════════════════════════
3. CUSTOM SCROLLBAR ENGINE (SIDEBAR & TABLES)
   ══════════════════════════════════════════════════════════════════════════ */
.sidebar-nav,
.table-wrap {
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(159, 151, 143, 0.55) transparent;
}

.sidebar-nav:hover,
.table-wrap:hover {
    scrollbar-color: var(--orange-accent) var(--navy-card);
}

.sidebar-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.sidebar-nav::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
    background: var(--navy-card);
    border-radius: 100px;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(159, 151, 143, 0.55);
    border-radius: 100px;
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--orange-accent);
}

.sidebar-nav::-webkit-scrollbar-corner,
.table-wrap::-webkit-scrollbar-corner {
    background: transparent;
}

[data-theme="dark"] .sidebar-nav,
[data-theme="dark"] .table-wrap {
    scrollbar-color: rgba(156, 163, 175, 0.4) transparent;
}

[data-theme="dark"] .sidebar-nav:hover,
[data-theme="dark"] .table-wrap:hover {
    scrollbar-color: var(--orange-accent) var(--navy-card);
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-track,
[data-theme="dark"] .table-wrap::-webkit-scrollbar-track {
    background: var(--navy-card);
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb,
[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--orange-accent);
}

/* ══════════════════════════════════════════════════════════════════════════
   DOCUMENT LIBRARY — SEARCH & FILTER BAR LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.search-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 24px;
    padding: 12px 14px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.search-bar form {
    display: flex !important;
    flex: 1 1 100%;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.search-input-wrap {
    position: relative;
    flex: 1 1 220px;
    min-width: 180px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.95rem;
    line-height: 1;
    color: var(--orange-accent);
    pointer-events: none;
    z-index: 2;
}

.search-input-wrap input[type="text"],
.search-input-wrap input[type="search"] {
    width: 100% !important;
    height: 44px !important;
    padding: 0 18px 0 42px !important;
    border-radius: 100px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--border-input) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015) !important;
    outline: none !important;
}

.search-input-wrap input[type="text"]:hover,
.search-input-wrap input[type="search"]:hover {
    border-color: var(--orange-accent) !important;
}

.search-input-wrap input[type="text"]:focus,
.search-input-wrap input[type="search"]:focus {
    border-color: var(--orange-accent) !important;
    box-shadow: 0 0 0 3px var(--orange-dim) !important;
}

/* Keep the three filter dropdowns aligned side by side on one row */
.search-bar .ui-select-wrap {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 148px;
}

.search-bar .ui-select-trigger {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 16px;
    font-size: 0.82rem;
}

.search-bar > select,
.search-bar form > select {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 148px !important;
    height: 44px !important;
    line-height: 44px !important;
    padding: 0 36px 0 16px !important;
    font-size: 0.82rem !important;
}

.search-bar .btn {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 20px;
    border-radius: 100px;
    font-size: 0.82rem;
}

/* Dark theme overrides */
[data-theme="dark"] .search-bar {
    background: var(--navy-mid);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .search-input-wrap input[type="text"],
[data-theme="dark"] .search-input-wrap input[type="search"] {
    background: var(--navy-card) !important;
    border-color: var(--border-input) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .search-input-wrap input[type="text"]:focus,
[data-theme="dark"] .search-input-wrap input[type="search"]:focus {
    background: var(--navy-mid) !important;
    border-color: var(--orange-accent) !important;
}

/* Tablet & mobile wrapping */
@media (max-width: 1180px) {
    .search-bar,
    .search-bar form {
        flex-wrap: wrap !important;
    }

    .search-input-wrap {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .search-bar .ui-select-wrap,
    .search-bar > select,
    .search-bar form > select {
        flex: 1 1 0;
        min-width: 140px;
    }
}

@media (max-width: 640px) {
    .search-bar {
        border-radius: 20px;
        padding: 12px;
    }

    .search-bar .ui-select-wrap,
    .search-bar > select,
    .search-bar form > select {
        flex: 1 1 calc(33.333% - 8px);
        min-width: 0;
    }

    .search-bar .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .search-bar .ui-select-wrap,
    .search-bar > select,
    .search-bar form > select {
        flex: 1 1 100%;
    }
}