:root {
    /* ═══════════════════════════════════════════════════════════
     * NEXT-GEN DARK MODE — v3.0 "Obsidian"
     * Near-black OLED palette with electric blue accent.
     * Inspired by Linear, Vercel, Arc Browser, and Bloomberg.
     * ═══════════════════════════════════════════════════════════ */

    /* Core Surfaces */
    --bg-base: #06080C;
    --bg-surface: #0D1117;
    --bg-elevated: #161B22;
    --bg-active: #1C2333;

    /* Primary — Electric Blue */
    --primary: #58A6FF;
    --primary-dim: rgba(88, 166, 255, 0.08);
    --primary-bright: #79B8FF;
    --primary-rgb: 88, 166, 255;

    /* Accent Palette — per-module tinting */
    --accent: #E6EDF3;
    --accent-dim: rgba(230, 237, 243, 0.4);
    --accent-amber: #D29922;
    --accent-blue: #58A6FF;
    --accent-purple: #BC8CFF;
    --accent-teal: #39D2C0;
    --accent-rose: #F778BA;
    --accent-indigo: #6E79D6;
    --accent-emerald: #3FB950;
    --accent-orange: #F0883E;
    --glow-primary: 0 0 20px rgba(88, 166, 255, 0.15);
    --glow-hover: 0 0 30px rgba(88, 166, 255, 0.1);

    /* Semantic Colors */
    --danger: #F85149;
    --warning: #D29922;
    --success: #3FB950;

    /* Typography Colors */
    --text-display: #F0F6FC;
    --text-body: #C9D1D9;
    --text-muted: #8B949E;
    --text-subtle: #484F58;
    --text-main: #C9D1D9;
    --text-disabled: #30363D;

    /* Font Stack */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Border tokens */
    --line-subtle: #21262D;
    --line-stark: #30363D;
    --line-active: #3D444D;
    --border-default: #21262D;

    /* Metrics — tighter radii for premium feel */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-none: 0px;

    /* Spacing: 4/8/16/24/32/48 grid */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Shadows — deeper, more cinematic */
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-stark: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-drawer: -8px 0 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);

    /* Legacy compat aliases */
    --glass-border: var(--line-subtle);
    --glass-border-light: var(--line-stark);
    --glass-surface: var(--bg-elevated);
    --glass-hover: var(--bg-active);
    --primary-glow: var(--primary-dim);
    --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-bright));
    --bg-color: var(--bg-base);
    --slate-300: var(--text-body);
}

/* Admin modal & Org drawer → extracted to css/modules/admin.css and css/modules/org-drawer.css */


/* 
 * ============================================================
 * 2. BASE STYLES & RESET (Mobile First)
 * ============================================================
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    /* overflow-x: clip is stronger than hidden in Chrome/Blink:
       it clips even GPU-composited and position:fixed children
       that escape overflow:hidden due to stacking context promotion. */
    overflow-x: hidden !important;
    overflow-x: clip !important;
    /* intentional duplicate: clip overrides hidden where supported */
    overscroll-behavior-x: none;
    /* prevents horizontal rubber-banding in Chrome Android */
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    background-color: var(--bg-base);
    color: var(--text-body);
    font-family: var(--font-body);
    min-height: 100vh;
    /* NOTE: display:flex removed — Chrome treats overflow-x:clip differently inside
       a flex formatting context, allowing composited children to extend scrollable width. */
    line-height: 1.6;
}

/* ═══ Next-Gen Gradient Mesh Aurora Background ═══ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(88, 166, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 85% 70%, rgba(188, 140, 255, 0.04) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 50% 90%, rgba(57, 210, 192, 0.03) 0%, transparent 50%);
    pointer-events: none;
    animation: auroraDrift 25s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* --- Layout Shell --- */
.dashboard-wrapper {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
    opacity: 0;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column !important;
        padding: var(--space-md) !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        width: 100%;
        min-width: 0;
    }
}

@media (min-width: 768px) {
    .dashboard-wrapper {
        padding: var(--space-lg);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--line-subtle);
    position: relative;
    padding-top: 20px;
}

#system-status-pillar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

@media (max-width: 768px) {
    #system-status-pillar {
        width: 100%;
        left: 0;
        transform: none;
        display: flex;
        justify-content: center;
    }
}

/* --- Dropdown Menu (Hidden by Default) --- */
.dropdown-content {
    display: none;
    position: absolute;
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    box-shadow: var(--shadow-stark);
    z-index: 1000;
    min-width: 200px;
}

.dropdown-content.show,
.profile-dropdown:hover .dropdown-content,
.profile-dropdown:focus-within .dropdown-content {
    display: block;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.breadcrumb {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    transition: color 0.2s ease;
}

.breadcrumb:hover {
    color: var(--text-display);
}

/* --- Typography (Institutional Hierarchy) --- */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-display);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-display);
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-display);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.stark-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.welcome-text {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--text-display);
    background: linear-gradient(135deg, var(--text-display) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Vox profiles grid - responsive 3+ columns */
#vox-profiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Admin org cards grid - responsive layout for editorial cards */
#admin-orgs-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* --- Editorial Cards & Tiles --- */
.editorial-card {
    background: var(--bg-surface);
    border: 1px solid var(--line-stark);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease;
}

.editorial-card:hover {
    border-color: var(--line-active);
}

.menu-card {
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line-subtle);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 110px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    grid-column: span 12;
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    /* Module accent — set per-card via inline style or data attr */
    --card-accent: var(--primary);
    border-left: 2px solid rgba(88, 166, 255, 0.2);
}

@media (min-width: 768px) {
    .menu-card {
        grid-column: span 6;
    }
}

@media (min-width: 1200px) {
    .menu-card {
        grid-column: span 4;
    }
}

.menu-card:hover {
    border-color: var(--card-accent);
    border-left-color: var(--card-accent);
    background: rgba(22, 27, 34, 0.8);
    transform: translateY(-3px);
    box-shadow: var(--shadow-stark), 0 0 20px rgba(var(--primary-rgb), 0.06);
}

.menu-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, rgba(var(--primary-rgb), 0.04) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.menu-card:hover::after {
    opacity: 1;
}

.profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--line-subtle);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease;
}

.profile-card:hover {
    border-color: var(--line-stark);
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--card-accent), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-card:hover::before {
    opacity: 0.4;
}

.card-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-accent, var(--primary));
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
}

.menu-card:hover .card-icon {
    background: rgba(var(--primary-rgb), 0.14);
    transform: scale(1.05);
}

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

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
    color: var(--text-display);
}

.card-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 300px;
    line-height: 1.4;
}

.card-arrow {
    margin-top: auto;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-arrow::after {
    content: '→';
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.menu-card:hover .card-arrow::after {
    transform: translateX(8px);
}

/* --- Forms & Inputs (Stark) --- */
.form-group {
    margin-bottom: 32px;
}

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

label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

input,
textarea,
select {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-elevated);
}

/* --- Buttons (Premium) --- */
.primary-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-bright));
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: none;
    border-radius: 100px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.25);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-bright), var(--primary));
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
    transform: translateY(-1px);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.2);
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    box-shadow: none;
}

.action-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    color: var(--text-display);
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.04em;
}

#job-monitor-drawer {
    position: fixed;
    bottom: 0;
    right: 16px;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--line-stark);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    z-index: 1000;
    transform: translateY(calc(100% - 48px));
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-stark);
}

.action-btn:hover {
    background: var(--bg-active);
    border-color: var(--line-active);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line-subtle);
    color: var(--text-muted);
    padding: 10px 16px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s ease;
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Status & Badges --- */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--line-stark);
    border-radius: 4px;
}

/* Legal Session Delete Button (Hover Only) */
.legal-session-item .session-delete-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.legal-session-item:hover .session-delete-btn {
    opacity: 1;
    pointer-events: auto;
}

/* --- Forms & Inputs (Stark) --- */
.form-group {
    margin-bottom: 32px;
}

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

label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

input,
textarea,
select {
    width: 100%;
    background: var(--bg-elevated) !important;
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-display);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-active) !important;
    box-shadow: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-subtle);
}

/* Accessibility fix: Prevent white background on autofill */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-elevated) inset !important;
    -webkit-text-fill-color: var(--text-display) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.view {
    display: none;
    opacity: 0;
}

.view.active {
    display: block;
    animation: editorialEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes editorialEntrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Surface Card System --- */
.glass-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.15s ease;
}

.glass-card:hover {
    border-color: var(--line-active);
}

/* --- Stagger Logic --- */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.15s;
}

.stagger-3 {
    animation-delay: 0.2s;
}

.stagger-4 {
    animation-delay: 0.25s;
}

.stagger-5 {
    animation-delay: 0.3s;
}

.stagger-6 {
    animation-delay: 0.35s;
}

.stagger-7 {
    animation-delay: 0.4s;
}

.stagger-8 {
    animation-delay: 0.45s;
}

/* Utility */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 
 * ============================================================
 * 9. UNIFIED MODAL & OVERLAY SYSTEM
 * ============================================================
 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 12, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

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

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--line-stark);
    padding: var(--space-lg);
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius-lg);
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.modal-content.wide {
    max-width: 840px;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

/* 
 * ============================================================
 * 10. SKELETON LOADING SYSTEM
 * ============================================================
 */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

@keyframes skeletonPulse {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.login-card {
    max-width: 420px;
    width: 100%;
    text-align: center;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl) var(--space-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(88, 166, 255, 0.04);
    position: relative;
    box-sizing: border-box;
}

/* Radial spotlight behind login card */
.login-card::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -30%;
    right: -30%;
    bottom: -40%;
    background: radial-gradient(ellipse at center, rgba(88, 166, 255, 0.06) 0%, transparent 65%);
    z-index: -1;
    pointer-events: none;
}

/* Login overlay gradient mesh */
#loginScreen.modal-overlay {
    background:
        radial-gradient(ellipse 70% 50% at 20% 30%, rgba(88, 166, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 80% 60%, rgba(188, 140, 255, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 50% 85%, rgba(57, 210, 192, 0.04) 0%, transparent 50%),
        rgba(6, 8, 12, 0.96);
    backdrop-filter: none;
}

.login-card .stark-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #F0F6FC 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* 
 * ============================================================
 * 8. VOX ATTENDANT ENGINE UI
 * ============================================================
 */
/* --- Vox Attendant Specific --- */
.vox-wizard-chat {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-subtle);
    height: 500px;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.msg-bubble {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.msg-assistant {
    background: var(--glass-hover);
    border: 1px solid var(--line-subtle);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.msg-user {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* --- Native Vox Animations (Migrated) --- */
.vox-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.vox-subview {
    display: none;
    animation: slideUp 0.4s ease-out;
}

.vox-subview.active {
    display: block;
}

/* --- Delay Badges --- */
/* 
 * ============================================================
 * 7. SEQUENCE CREATOR MODULE
 * ============================================================
 */
.delay-badge {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line-stark);
    border-radius: 100px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.delay-badge input {
    background: transparent;
    border: none;
    padding: 0;
    width: 24px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

.delay-badge input:focus {
    box-shadow: none;
    color: white;
}

/* --- Pills (Token Interpolation) --- */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-subtle);
}

.pill {
    background: var(--glass-surface);
    border: 1px solid var(--line-subtle);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.pill:hover {
    background: var(--glass-hover);
    border-color: var(--primary);
    transform: scale(1.05);
}

.pill::before {
    content: '{ }';
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--primary);
    opacity: 0.7;
}

/* --- Icon Selector (Visual Grid) --- */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.icon-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--glass-surface);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.icon-item:hover {
    background: var(--glass-hover);
    transform: translateY(-2px);
}

.icon-item.active {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.icon-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.icon-item span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.icon-item.active span {
    color: var(--primary);
}

/* --- Message Sequence --- */
.message-chain {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--line-subtle);
}

.chain-item {
    background: var(--glass-surface);
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.chain-item:hover {
    background: var(--glass-hover);
    border-color: var(--line-stark);
}

/* --- Workflow Builder (Refined) --- */
.workflow-list {
    margin-top: 16px;
}

.workflow-item {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.workflow-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line-stark);
    transform: translateX(4px);
}

.workflow-item .drag-handle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: var(--text-subtle);
    cursor: grab;
}

.workflow-item .step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

.workflow-item::after {
    content: '⚙️';
    opacity: 0.3;
    font-size: 0.8rem;
}

.energy-core-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.energy-core {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--primary-dim);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.energy-core:hover {
    border-color: var(--primary-bright);
}

.energy-core.active {
    animation: corePulse 2s infinite !important;
    border-color: var(--primary-bright);
}

@keyframes corePulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.03);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Wizard Stepper */
.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line-subtle);
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.wizard-step {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transcript Specific */
.vox-transcript {
    margin-top: 24px;
    height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--line-subtle);
    padding-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ts-line {
    margin-bottom: 12px;
    border-left: 2px solid var(--line-subtle);
    padding-left: 12px;
}

.ts-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.ts-ai {
    color: var(--text-main);
}

.ts-user {
    color: var(--primary);
}

.ts-streaming .ts-content::after {
    content: "▋";
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
    color: var(--primary);
    animation: voxCursorPulse 0.8s infinite;
    font-size: 0.8em;
}

@keyframes voxCursorPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Custom Scrollbar (Thin, Premium) --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--line-subtle);
    border-radius: 10px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--line-stark);
}

/* ═══ Google SSO Button (Premium Glassmorphism) ═══ */
.google-sso-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-display);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    border-radius: 100px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.google-sso-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.google-sso-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ═══ ⌘K Keyboard Shortcut Badge ═══ */
.kbd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line-subtle);
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.kbd-badge:hover {
    border-color: var(--line-stark);
    color: var(--text-body);
    background: rgba(255, 255, 255, 0.06);
}

/* ═══ System Status Floating Pill ═══ */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid rgba(63, 185, 80, 0.2);
    background: rgba(63, 185, 80, 0.06);
    color: var(--success);
}

.status-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
    animation: subtlePulse 2s ease-in-out infinite;
}

.status-pill.degraded {
    border-color: rgba(210, 153, 34, 0.2);
    background: rgba(210, 153, 34, 0.06);
    color: var(--warning);
}

.status-pill.error {
    border-color: rgba(248, 81, 73, 0.2);
    background: rgba(248, 81, 73, 0.06);
    color: var(--danger);
}

/* 
 * ============================================================
 * 11. RESPONSIVE REFINEMENTS (12-Column Grid)
 * ============================================================
 */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {

    /* Layout & Wrapper */
    .dashboard-wrapper {
        padding: 16px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
        width: 100%;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
        gap: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .main-content {
        padding: var(--space-xs);
    }

    .breadcrumb {
        max-width: calc(100vw - 120px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    #org-context-display {
        max-width: 200px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Welcome Text & Cards */
    .welcome-text {
        font-size: 1.8rem;
    }

    .glass-card {
        padding: 16px;
    }

    /* Home control: single column */
    .home-dashboard {
        grid-template-columns: 1fr !important;
    }

    .admin-sidebar {
        display: none !important;
    }

    /* Admin view: stack vertically on mobile, reduce padding */
    #view-admin {
        flex-direction: column !important;
        height: auto !important;
        margin: 0 !important;
    }

    .admin-content {
        padding: 16px !important;
    }

    #admin-view-header h1 {
        font-size: 1.5rem !important;
    }

    /* Mobile admin tab bar — replaces hidden sidebar */
    .admin-mobile-tabs {
        display: flex !important;
        overflow-x: auto;
        gap: 4px;
        padding: 8px 12px;
        border-bottom: 1px solid var(--line-subtle);
        background: rgba(0, 0, 0, 0.2);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .admin-mobile-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-mobile-tab {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        background: none;
        border: 1px solid transparent;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        flex-shrink: 0;
    }

    .admin-mobile-tab.active {
        background: rgba(var(--primary-rgb), 0.1);
        color: var(--primary);
        border-color: var(--primary);
    }

    /* AI model grid: stack on mobile */
    #admin-sub-ai-models .glass-card>div {
        grid-template-columns: 1fr !important;
    }

    /* Settings tab buttons: wrap on mobile */
    .admin-tabs {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .admin-tabs .tab-btn {
        font-size: 0.7rem !important;
        padding: 8px 12px !important;
        white-space: nowrap;
    }

    /* Forms & Modals */
    .form-row {
        grid-template-columns: 1fr !important;
        flex-direction: column;
        gap: 12px;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 16px;
    }

    .pill-container {
        flex-wrap: wrap;
    }

    /* Drawer & Overlays */
    #job-monitor-drawer {
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: calc(100% - 20px) !important;
        min-width: 0 !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .system-logs,
    #system-logs {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .log-entry {
        word-break: break-all !important;
        white-space: normal !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #command-palette .modal-content {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        margin: 0 12px !important;
        box-sizing: border-box !important;
    }
}


.predictive-focus:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-dim);
}

/* Admin tables & forms → extracted to css/modules/admin.css */

/* Close Button Styling */
.close-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-drawer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--danger);
}

.tab-link {
    padding: 12px 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    position: relative;
}

.tab-link:hover {
    color: white;
}

.tab-link.active {
    color: var(--primary);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

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

.modal-content {
    width: calc(100% - 32px);
    max-width: 500px;
    margin: 0 16px;
    /* Ensure content doesn't hit screen edges on small devices */
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* admin-form-group → extracted to css/modules/admin.css */



/* --- Premium Vox Config Dashboard --- */
.vox-config-container {
    background: var(--bg-surface);
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.vox-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line-stark);
    padding-bottom: 1.5rem;
}

.vox-header-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.vox-header-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.vox-header-text h1 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.vox-header-text p {
    font-size: 0.75rem;
    color: #71717a;
    /* Zinc 500 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.vox-status-badge {
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vox-status-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

.vox-status-dot.active {
    background: var(--success);
}

.vox-config-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.vox-config-field {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vox-field-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.vox-select-custom {
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.85rem;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.vox-tier-toggle {
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    border-radius: var(--radius-md);
    padding: 4px;
}

.vox-tier-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-subtle);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.vox-tier-btn.active {
    background: var(--primary);
    color: white;
}

.vox-range-premium {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 100px;
    appearance: none;
    cursor: pointer;
}

.vox-range-premium::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
}

.vox-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-family: monospace;
    color: var(--text-subtle);
    margin-top: 4px;
}

.vox-params-section {
    border-top: 1px solid var(--line-stark);
    padding-top: 1.5rem;
}

.vox-params-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.vox-trait-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vox-trait-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vox-trait-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.vox-trait-value {
    font-size: 11px;
    font-family: monospace;
    color: var(--primary);
    font-weight: 700;
}

.vox-trait-slider {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 100px;
    appearance: none;
    cursor: pointer;
}

.vox-trait-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
}

.vox-footer-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-subtle);
    font-style: italic;
    margin-top: 1rem;
}

.vox-deploy-btn-premium {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    margin-top: auto;
}

.vox-deploy-btn-premium:hover {
    background: var(--primary-bright);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {

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

@media (max-width: 640px) {

    .vox-config-grid,
    .vox-params-grid {
        grid-template-columns: 1fr;
    }

    .vox-config-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* 
 * ============================================================
 * 10. VOX SESSION ENHANCEMENTS (UX-9, UX-5, F-2)
 * ============================================================
 */

.vox-session-layout {
    display: flex;
    gap: 24px;
    height: 100%;
    min-height: 600px;
}

.vox-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vox-sidebar-panel {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 1px solid var(--line-subtle);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Dual Waveform Visualizer */
.vox-visualizer-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    margin-bottom: 16px;
}

.wave-track {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wave-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    width: 40px;
}

.user-track canvas {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border-radius: 8px;
}

.ai-track canvas {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05));
    border-radius: 8px;
}

/* Status Bar with Timer */
.session-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
}

.status-indicator {
    font-size: 0.85rem;
    color: var(--text-main);
}

.session-timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--primary);
    letter-spacing: 0.05em;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--line-subtle);
}

.section-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Sentiment Meter */
.sentiment-meter {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sentiment-fill {
    height: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 4px;
}

.sentiment-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

/* Recording Indicator */
.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rec-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .vox-session-layout {
        flex-direction: column;
    }

    .vox-sidebar-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--line-subtle);
    }
}

/* 
 * ============================================================
 * 10. PDF REPORT STYLING (Print/Export)
 * ============================================================
 */
.pdf-report-container {
    padding: 60px;
    background: #ffffff !important;
    color: #000000 !important;
}

.pdf-report-container .editorial-card,
.pdf-report-container .glass-card,
.pdf-report-container .history-card {
    background: transparent !important;
    border: 1px solid #eeeeee !important;
    color: #000000 !important;
    box-shadow: none !important;
    margin-bottom: 20px;
}

.pdf-report-container .stark-title,
.pdf-report-container .card-title,
.pdf-report-container h1,
.pdf-report-container h2,
.pdf-report-container h3,
.pdf-report-container h4 {
    color: #000000 !important;
}

.pdf-report-container .text-muted,
.pdf-report-container .text-subtle,
.pdf-report-container .stark-muted {
    color: #666666 !important;
}

.pdf-report-container .primary-btn,
.pdf-report-container .action-btn,
.pdf-report-container #backToMenuBtn {
    display: none !important;
}

.pdf-report-container .risk-score-badge {
    font-weight: 900;
    font-size: 1.2rem;
    padding: 8px 16px;
    border: 3px solid currentColor;
}

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .dashboard-wrapper {
        padding: 0;
    }

    .header-right,
    .dashboard-header,
    .system-logs {
        display: none !important;
    }
}

/* UI Polishing: Logout & Table Spacing */
.dropdown-item.danger {
    font-size: 0.72rem;
    padding: 6px 16px;
    opacity: 0.8;
}

.dropdown-item.danger:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

.admin-table td {
    padding: 16px 8px;
}

/* 
 * ============================================================
 * 11. RESPONSIVE UTILITIES (Phase 5 Support)
 * ============================================================
 */
@media (max-width: 768px) {

    /* Admin action modal is already responsive via max-width: 95vw */

    /* Modal Adjustments */
    .glass-modal {
        width: 95% !important;
        max-height: 90vh;
        margin: 10px;
    }

    /* Table Mobile Stack */
    .responsive-table thead {
        display: none;
        /* Hide headers */
    }

    .responsive-table tr {
        display: flex;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.02);
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid var(--line-subtle);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border: none;
        font-size: 0.9rem;
    }

    .responsive-table td:before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-right: 12px;
    }
}

/* Risk Intelligence Module - Enhanced Contrast */
.risk-intel-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.risk-intel-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

/* Ensure all inputs in risk module have proper contrast */
#tab-risk-intel input[type="text"],
#tab-risk-intel textarea {
    color: var(--text-display);
    background: var(--bg-surface);
}

#tab-risk-intel input[type="text"]::placeholder,
#tab-risk-intel textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 
 * ============================================================
 * 12. COMMAND PALETTE (UX #20)
 * ============================================================
 */
#command-palette {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(6, 8, 12, 0.7);
    z-index: 9999;
    align-items: flex-start;
    padding-top: 20vh;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

#command-palette.show {
    opacity: 1;
    pointer-events: auto;
}

#command-palette .modal-content {
    width: 100%;
    max-width: 640px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-subtle);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

#command-palette.show .modal-content {
    transform: scale(1);
}

.cmd-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-subtle);
    gap: 16px;
}

.cmd-input-wrapper svg {
    color: var(--primary);
    opacity: 0.8;
}

#cmd-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-main);
    font-family: var(--font-body);
    outline: none;
}

#cmd-palette-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.cmd-footer-badge {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--line-subtle);
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
}

#cmd-palette-results {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.1s ease;
    margin-bottom: 2px;
    border: 1px solid transparent;
}

.cmd-item:hover,
.cmd-item.selected {
    background: var(--glass-hover);
    border-color: var(--line-stark);
}

.cmd-item.selected {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.cmd-item .cmd-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    opacity: 0.7;
}

.cmd-item.selected .cmd-icon {
    color: var(--primary);
    opacity: 1;
}

.cmd-item .cmd-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.cmd-item.selected .cmd-label {
    color: white;
    font-weight: 600;
}

.cmd-item .cmd-shortcut {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    opacity: 0.6;
}

/* 
 * ============================================================
 * 13. HEALTH INDICATORS (UX #34)
 * ============================================================
 */
.status-dot-active {
    color: var(--success);
    font-weight: 600;
}

.status-dot-degraded {
    color: var(--warning);
    font-weight: 600;
}

.status-dot-error {
    color: var(--danger);
    font-weight: 700;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.menu-card .health-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 10;
}

.health-indicator.healthy {
    background: var(--success);
    box-shadow: 0 0 4px var(--success);
}

.health-indicator.degraded {
    background: var(--warning);
    box-shadow: 0 0 4px var(--warning);
}

.health-indicator.error {
    background: var(--danger);
    box-shadow: 0 0 4px var(--danger);
}

/* Dragging State for Admin Config */
.sequence-item.dragging {
    opacity: 0.5;
    background: var(--bg-surface-active);
    border: 2px dashed var(--primary);
}

/* BOD Presentation Maker → extracted to css/modules/bod-pres.css */

/* Org Drawer → extracted to css/modules/org-drawer.css */



/* 
 * ============================================================
 * 15. AUTHORITATIVE MOBILE REWRITE (≤768px)
 * ============================================================
 *
 * Purpose:
 *   Single consolidated mobile breakpoint that overrides ALL layout
 *   elements for phone viewports. This replaces the scattered @media
 *   blocks earlier in the file.
 *
 * Invariants:
 *   - NO horizontal scrolling: every element fits within viewport width
 *   - Stack all multi-column grids to single column
 *   - Touch-friendly targets: minimum 44px hit areas
 *   - Reduced padding/margins for screen real estate
 *
 * How to undo:
 *   Remove this entire section. Earlier @media blocks provide partial
 *   (but incomplete) mobile support as fallback.
 */
@media (max-width: 768px) {

    /* ── Global Overflow Prevention (Chrome/Blink extra guards) ── */
    html,
    body {
        overflow-x: hidden !important;
        overflow-x: clip !important;
        /* clip overrides hidden for composited children */
        overscroll-behavior-x: none;
        width: 100% !important;
        max-width: 100% !important;
        /* avoid 100vw which includes scrollbar in Chrome */
    }

    /* ── Dropdown: prevent right-edge overflow on narrow phones ── */
    .dropdown-content {
        min-width: unset;
        max-width: calc(100vw - 32px);
    }

    /* ── Layout Shell ── */
    .dashboard-wrapper {
        padding: 12px !important;
        margin: 0 !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* ── Dashboard Header — Stack Vertically ── */
    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
        padding-bottom: 12px !important;
        width: 100% !important;
    }

    .header-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .header-right {
        width: 100% !important;
        justify-content: flex-end !important;
        gap: 12px !important;
    }

    /* ── System Status Pillar ── */
    #system-status-pillar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* ── Dashboard Grid — Force Single Column ── */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .menu-card {
        grid-column: span 1 !important;
    }

    /* ── Main Content — Prevent Overflow ── */
    .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        padding: var(--space-xs) !important;
    }

    /* ── Job Monitor Drawer — Full Width Bottom Sheet ── */
    #job-monitor-drawer {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        border-radius: 12px 12px 0 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* ── Typography Scaling ── */
    .welcome-text {
        font-size: 1.4rem !important;
    }

    .breadcrumb {
        max-width: calc(100vw - 120px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 0.7rem !important;
    }

    #org-context-display {
        max-width: 180px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #org-context-container {
        margin-left: 0 !important;
    }

    /* ── Cards & Containers ── */
    .glass-card {
        padding: 16px !important;
    }

    .home-dashboard {
        grid-template-columns: 1fr !important;
    }

    /* ── Login Card — Mobile Padding ── */
    .login-card {
        padding: var(--space-lg) var(--space-md) !important;
        margin: 0 12px !important;
    }

    .login-card .stark-title {
        font-size: 1.8rem !important;
    }

    /* ── Admin Module ── */
    .admin-sidebar {
        display: none !important;
    }

    #view-admin {
        flex-direction: column !important;
        height: auto !important;
        margin: 0 !important;
    }

    .admin-content {
        padding: 12px !important;
    }

    #admin-view-header h1 {
        font-size: 1.4rem !important;
    }

    .admin-mobile-tabs {
        display: flex !important;
        overflow-x: auto;
        gap: 4px;
        padding: 8px 12px;
        border-bottom: 1px solid var(--line-subtle);
        background: rgba(0, 0, 0, 0.2);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .admin-mobile-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-mobile-tab {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        background: none;
        border: 1px solid transparent;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        flex-shrink: 0;
    }

    .admin-mobile-tab.active {
        background: rgba(var(--primary-rgb), 0.1);
        color: var(--primary);
        border-color: var(--primary);
    }

    #admin-sub-ai-models .glass-card>div {
        grid-template-columns: 1fr !important;
    }

    .admin-tabs {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .admin-tabs .tab-btn {
        font-size: 0.7rem !important;
        padding: 8px 12px !important;
        white-space: nowrap;
    }

    /* ── Forms & Modals ── */
    .form-row {
        grid-template-columns: 1fr !important;
        flex-direction: column;
        gap: 12px;
    }

    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 16px !important;
    }

    .glass-modal {
        width: 95% !important;
        max-height: 90vh;
        margin: 10px;
    }

    .pill-container {
        flex-wrap: wrap;
    }

    /* ── System Logs — Constrain to Viewport ── */
    .system-logs,
    #system-logs {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .log-entry {
        word-break: break-all !important;
        white-space: normal !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ── Command Palette ── */
    #command-palette .modal-content {
        width: calc(100% - 24px) !important;
        max-width: calc(100% - 24px) !important;
        margin: 0 12px !important;
        box-sizing: border-box !important;
    }

    /* ── Vox Module ── */
    .vox-session-layout {
        flex-direction: column !important;
    }

    .vox-sidebar-panel {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid var(--line-subtle) !important;
    }

    .vox-config-grid,
    .vox-params-grid {
        grid-template-columns: 1fr !important;
    }

    .vox-config-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    /* ── Responsive Tables ── */
    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block !important;
        width: 100% !important;
    }

    .admin-table thead {
        display: none !important;
    }

    .admin-table tr {
        margin-bottom: var(--space-md) !important;
        border: 1px solid var(--line-subtle) !important;
        background: var(--bg-surface) !important;
        border-radius: var(--radius-sm) !important;
        padding: var(--space-xs) !important;
    }

    .admin-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        padding: var(--space-xs) var(--space-sm) !important;
        border-bottom: 1px solid var(--line-subtle) !important;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: flex;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.02);
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid var(--line-subtle);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border: none;
        font-size: 0.9rem;
    }

    .responsive-table td:before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-right: 12px;
    }

    /* ── BOD Presenter — Stack Metadata Grid ── */
    .bod-pres-meta-grid {
        grid-template-columns: 1fr !important;
    }

    .bod-pres-slides-grid {
        grid-template-columns: 1fr !important;
    }

    .bod-pres-history-grid {
        grid-template-columns: 1fr !important;
    }

    #tab-bod-pres .glass-card {
        padding: 16px !important;
    }

    /* BOD Presenter action row — stack button and slide count */
    #tab-bod-pres .glass-card>div:last-of-type {
        flex-direction: column !important;
        gap: 12px !important;
    }
}