/**
 * ESN|HUB Design System
 * Brutalist-Corporate Aesthetic
 * Version 1.0.5 - Fixed layout with dynamic z-index
 * Last update: 2026-02-06 16:20
 * 
 * No compilation needed - Pure CSS ready to use
 * Compatible with Tailwind CSS or standalone
 */

/* ============================================
   FONTS IMPORT (LOCAL)
   ============================================ */

/* --- JetBrains Mono --- */
/* JetBrains Mono - Regular (400) */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* JetBrains Mono - Bold (700) */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('/static/fonts/JetBrainsMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* JetBrains Mono - ExtraBold (800) */
@font-face {
    font-family: 'JetBrains Mono';
    src: url('/static/fonts/JetBrainsMono-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* --- IBM Plex Sans --- */
/* IBM Plex Sans - Light (300) */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* IBM Plex Sans - Regular (400) */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* IBM Plex Sans - SemiBold (600) */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* IBM Plex Sans - Bold (700) */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/static/fonts/IBMPlexSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
    /* Colors - Primary */
    --primary: #0A0A0A;
    --secondary: #FF3366;
    --accent: #00FFB3;
    --surface: #F5F5F5;
    --border: #E0E0E0;
    --text: #1A1A1A;
    --text-muted: #6B6B6B;

    /* Colors - Extended Palette */
    --electric-blue: #0066FF;
    --cyber-purple: #9933FF;
    --neon-orange: #FF6B35;
    --hot-pink: #FF2D95;
    --cyber-cyan: #00D9FF;
    --volt-yellow: #FFD60A;
    --matrix-green: #39FF14;
    --dark-slate: #1A1A2E;

    /* Colors - Status */
    --status-success: #00FFB3;
    --status-warning: #FFB800;
    --status-error: #FF3366;
    --status-info: #0099FF;
    --status-pending: #9933FF;

    /* Colors - Labels */
    --label-ghost: #FF3366;
    --label-pepite: #FF6B35;
    --label-senior: #0066FF;
    --label-expert: #9933FF;
    --label-remote: #00FFB3;
    --label-junior: #00D9FF;
    --label-lead: #FFD60A;
    --label-special: #FF2D95;

    /* Colors - Types */
    --type-candidat: #9933FF;
    --type-collaborateur: #0066FF;
    --type-partenaire: #FF3366;
    --type-freelance: #00D9FF;
    --type-client: #FFB800;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 100%);
    --gradient-secondary: linear-gradient(135deg, #FF3366 0%, #FF2D95 100%);
    --gradient-accent: linear-gradient(135deg, #00FFB3 0%, #39FF14 100%);
    --gradient-cyber: linear-gradient(135deg, #0066FF 0%, #9933FF 100%);
    --gradient-sunset: linear-gradient(135deg, #FF6B35 0%, #FF3366 100%);
    --gradient-ocean: linear-gradient(135deg, #00D9FF 0%, #0066FF 100%);

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

    /* Border */
    --border-width: 2px;
    --border-style: solid;
    --border-color: #0A0A0A;

    /* Typography */
    --font-sans: 'IBM Plex Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: #F5F5F5;
    line-height: 1.6;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.font-mono {
    font-family: var(--font-mono);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
    color: var(--secondary);
    font-size: 24px;
    font-weight: 700;
}

.section-subtitle {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

.section-details {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    margin-top: 8px;
    font-family: var(--font-mono);
}

/* ============================================
   MONTHS
   ============================================ */

.month {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.month-current {
    color: var(--neon-orange);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    border: var(--border-width) var(--border-style) var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--secondary);
}

.btn-secondary {
    background: white;
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-accent {
    background: var(--secondary);
    color: white;
}

.btn-accent:hover {
    background: var(--primary);
}

/* Semantic variants */
.btn-warning {
    background: var(--volt-yellow);
    color: var(--primary);
}

.btn-warning:hover {
    background: var(--primary);
    color: white;
}

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

.btn-danger:hover {
    background: var(--primary);
}

/* Button sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-md {
    padding: 10px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}



/* ============================================
   LOGO
   ============================================ */
.logo {
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 12px;
}

.logo-ao {
    color: white;
}

.logo-ao-primary {
    color: var(--primary);
}

.logo-separator {
    color: var(--secondary);
}

.logo-genia {
    color: var(--accent);
}

/* ============================================
   FOOTERS
   ============================================ */
.login-footer,
.recovery-footer,
.reset-footer {
    padding: 24px 32px;
    background: var(--surface);
    border-top: var(--border-width) var(--border-style) var(--border-color);
    text-align: center;
}

/* ============================================
   INPUTS & FORMS
   ============================================ */
.input,
.select,
.textarea {
    width: 100%;
    padding: 10px 16px;
    font-family: var(--font-sans);
    font-size: 14px;
    border: var(--border-width) var(--border-style) var(--border-color);
    background: white;
    transition: border-color var(--transition-fast);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

.input[type="checkbox"],
.input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

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

.form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

/* ============================================
   ICONS
   ============================================ */

/* Base icon action button */
.icon-action {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Edit icon - hover black */
.icon-action-edit:hover {
    background: var(--primary);
    color: white;
}


/* Delete icon - hover red border and text, white background */
.icon-action-delete {
    color: var(--text-primary);
}

.icon-action-delete:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: white;
}

/* On-dark modifier — for icon-action placed on a dark/black background */
.icon-action--on-dark {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

.icon-action--on-dark:hover {
    background: white;
    border-color: white;
    color: var(--primary);
}

/* Disabled icon action */
.icon-action-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #d1d5db;
}

.icon-action-disabled:hover {
    background: #e5e7eb;
    color: #9ca3af;
}


/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border: var(--border-width) var(--border-style) var(--border-color);
    padding: 24px;
    position: relative;
}

.card-dark {
    background: linear-gradient(135deg, var(--primary) 0%, #1A1A1A 100%);
    color: white;
}

/* KPI Card */
.kpi-card {
    background: white;
    border: var(--border-width) var(--border-style) var(--border-color);
    padding: 24px;
    transition: transform var(--transition-base);
    position: relative;
}

.kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: var(--border-width) var(--border-style) transparent;
    transition: border-color var(--transition-fast);
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-4px);
}

.kpi-card:hover::after {
    border-color: var(--secondary);
}

.kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4em 0.6em;
    min-width: 1.2em;
    min-height: 1.2em;
    background: var(--secondary);
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 20px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    margin: 16px 0 8px;
}

.kpi-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.kpi-progress {
    height: 4px;
    background: #E0E0E0;
    margin-top: 16px;
}

.kpi-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
    transition: width var(--transition-slow);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    border: var(--border-width) var(--border-style) var(--border-color);
    overflow: visible !important;
}

.table-header {
    display: grid;
    padding: 16px 24px;
    background: linear-gradient(90deg, var(--primary) 0%, #1A1A1A 100%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-row {
    display: grid;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: white;
    align-items: center;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.table-row:hover {
    background: rgba(255, 51, 102, 0.03);
    border-left-color: var(--accent);
    z-index: 2;
}

.table-row:last-child {
    border-bottom: none;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav-sidebar {
    width: 256px;
    background: white;
    border-right: var(--border-width) var(--border-style) var(--border-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--secondary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.02);
}

.nav-item:hover::before,
.nav-item.active::before {
    transform: scaleY(1);
}

.nav-number {
    margin-right: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.nav-item.active .nav-number {
    color: var(--secondary);
}


/* Mobile Menu Overlay */
.mobile-menu-overlay {
    backdrop-filter: blur(2px);
}

/* Mobile Sidebar Adjustments */
@media (max-width: 640px) {
    .nav-sidebar {
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
}

/* ============================================
   HEADER
   ============================================ */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0; /* Pas d'espace pour gagner de la place */
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    align-items: center;
    gap: 32px;
    border-bottom: var(--border-width) solid var(--border);
    margin-top: 8px; /* Espace minimal entre titre et tabs */
}

.tab-item {
    padding: 10px 4px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: var(--border-width) solid transparent;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    margin-bottom: calc(var(--border-width) * -1);
}

.tab-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--border-width);
    background: var(--secondary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tab-item:hover {
    color: var(--primary);
}

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

.tab-item.active::after {
    transform: scaleX(1);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-badge.hidden {
    display: none;
}

.notification-panel-body {
    height: 420px;
    overflow-y: scroll;
}


/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(0, 255, 179, 0.2);
    color: var(--accent);
}

.badge-danger {
    background: rgba(255, 51, 102, 0.2);
    color: var(--secondary);
}

.badge-neutral {
    background: #E0E0E0;
    color: var(--text-muted);
}

.badge-dark {
    background: var(--primary);
    color: white;
}

.badge-warning {
    background: var(--neon-orange);
    color: white;
}

/* ============================================
   PROFILE STATUS ICONS
   ============================================ */

/* Base profile status icon */
.profile-status-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    border-radius: 2px;
    transition: transform var(--transition-base);
    cursor: help;
}

.profile-status-icon:hover {
    transform: scale(1.1);
}

/* Profile Status - Warning (parsing errors, missing data) */
.profile-status-icon--warning {
    background: var(--neon-orange);
    color: white;
    font-weight: 900;
    font-size: 12px;
}

/* Profile Status - Waiting (waiting for Gustave AI analysis) */
.profile-status-icon--waiting {
    background: var(--volt-yellow);
}

.profile-status-icon--waiting .status-pulse {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}


/* Profile Status - Failed (processing failed) */
.profile-status-icon--failed {
    background: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.3);
    color: var(--status-error);
    font-weight: 900;
    font-size: 12px;
}

/* Profile Status - Retention (GDPR retention alert) */
.profile-status-icon--retention {
    background: var(--neon-orange);
    color: white;
    font-weight: 900;
    font-size: 12px;
}

/* Profile Status - Ready (profile ready, no errors) */
.profile-status-icon--ready {
    background: var(--status-success);
}

/* Profile status tooltip content styles */
.profile-status-tooltip-error {
    color: var(--status-error);
    font-weight: 900;
    font-size: 9px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.profile-status-error-item {
    background: rgba(255, 51, 102, 0.05);
    border-left: 3px solid var(--status-error);
    padding: 4px 8px;
    font-size: 8px;
    font-weight: 700;
    margin-bottom: 4px;
    border-radius: 2px;
}

.profile-status-error-item:last-child {
    margin-bottom: 0;
}

.profile-status-tooltip-success {
    color: var(--status-success);
    font-weight: 900;
    font-size: 9px;
    text-transform: uppercase;
    text-align: center;
}

.profile-status-tooltip-warning {
    color: var(--neon-orange);
    font-weight: 900;
    font-size: 9px;
    text-transform: uppercase;
    text-align: center;
}

.profile-status-tooltip-info {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-status-date {
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
    text-align: center;
    font-style: italic;
}

/* Animation for pulse effect */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ============================================
   USER ROLES
   ============================================ */

.role {
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-admin {
    color: var(--hot-pink) !important;
}

.role-user {
    color: var(--cyber-purple) !important;
}

/* ============================================
   NAVIGATION ITEMS (BRUTALIST)
   ============================================ */
.nav-item-brutalist {
    background-color: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 4px 4px 0 #0A0A0A;
    transition: all 0.1s ease;
}

.nav-item-brutalist:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #0A0A0A;
    background-color: var(--surface);
}

.nav-item-brutalist-active {
    background-color: var(--volt-yellow);
    color: var(--primary);
    border: 2px solid var(--primary);
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 #0A0A0A;
}

/* ============================================
   DRAWER (SIDE PANEL)
   ============================================ */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    z-index: 999;
}

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

.drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    border-left: var(--border-width) var(--border-style) var(--border-color);
    transition: right var(--transition-slow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.drawer.open {
    right: 0;
}

.drawer-header {
    padding: 24px;
    border-bottom: var(--border-width) var(--border-style) var(--border-color);
    background: white;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.drawer-footer {
    padding: 16px;
    border-top: var(--border-width) var(--border-style) var(--border-color);
    background: var(--surface);
}


/* ============================================
   NEEDZ DRAWER
   ============================================ */

.needz-drawer-header {
    background: white;
    padding: 12px 24px;
}

.needz-drawer-header-title {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    padding-bottom: 4px;
}

.needz-drawer-header-meta {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 8px;
}

.needz-drawer-header-customer {
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.needz-drawer-header-entity {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.needz-drawer-header-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================
   SKILL BADGES (rarity × necessity)
   ============================================ */
.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    max-width: 160px;
    overflow: hidden;
}

/* Text node inside a badge — handles truncation + tooltip via title attr */
.skill-badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* — Rare: filled + shadow + losange prefix — */
.skill-badge--crucial-rare {
    background: var(--secondary);
    color: white;
    box-shadow: 3px 3px 0 var(--primary);
}
.skill-badge--crucial-rare::before { content: "\25C6\00A0"; }

.skill-badge--important-rare {
    background: var(--primary);
    color: white;
    box-shadow: 3px 3px 0 var(--secondary);
}
.skill-badge--important-rare::before { content: "\25C6\00A0"; }

.skill-badge--useful-rare {
    background: var(--accent);
    color: var(--primary);
    box-shadow: 3px 3px 0 var(--primary);
}
.skill-badge--useful-rare::before { content: "\25C6\00A0"; }

/* — Standard: outline only — */
.skill-badge--crucial-standard {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.skill-badge--important-standard {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.skill-badge--useful-standard {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

/* — Common: dashed + reduced opacity — */
.skill-badge--crucial-common {
    background: transparent;
    color: var(--secondary);
    border: 2px dashed var(--secondary);
    opacity: 0.65;
}

.skill-badge--important-common {
    background: transparent;
    color: var(--primary);
    border: 2px dashed var(--primary);
    opacity: 0.65;
}

.skill-badge--useful-common {
    background: transparent;
    color: var(--accent);
    border: 2px dashed var(--accent);
    opacity: 0.65;
}

/* Legend row */
.skill-badge-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
}

.skill-badge-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.skill-badge-legend-swatch {
    width: 14px;
    height: 8px;
    display: inline-block;
}

.skill-badge-legend-swatch--rare {
    background: white;
    box-shadow: 2px 2px 0 rgba(255,255,255,0.4);
}

.skill-badge-legend-swatch--standard {
    background: transparent;
    border: 2px solid white;
}

.skill-badge-legend-swatch--common {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.6);
}

/* ============================================
   DRAWER TABS (brutalist, scoped)
   ============================================ */
.drawer-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: white;
    border-bottom: 4px solid var(--primary);
    padding: 0 24px;
    margin: 0;
}

.drawer-tab-item {
    padding: 10px 12px 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: none;
}

.drawer-tab-item:hover {
    color: var(--primary);
    background: var(--surface);
}

.drawer-tab-item.active {
    color: var(--primary);
    background: var(--surface);
    border-bottom: 3px solid var(--secondary);
    margin-bottom: -4px;
}

.drawer-tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}

/* ============================================
   MATCH DETAIL (brutalist, drawer right panel)
   ============================================ */

/* Active match in sidebar */
.active-match {
    background-color: var(--surface) !important;
    border-left: 3px solid var(--secondary) !important;
}

.active-match .match-list-name {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

/* Match list items */
.match-list-name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--primary);
    line-height: 1.3;
}

.match-list-qual {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
    padding: 0 4px;
}

.match-list-qual--perfect {
    color: var(--primary);
    background: var(--volt-yellow);
}

.match-list-qual--good {
    color: var(--accent);
}

.match-list-qual--weak {
    color: var(--secondary);
}

.match-list-qual--pending {
    color: var(--text-muted);
    font-style: italic;
}

/* Section cards */
.match-section {
    background: white;
    border: 4px solid var(--primary);
    padding: 24px;
    box-shadow: 6px 6px 0 var(--primary);
}

.match-section--flat {
    background: white;
    border: 2px solid var(--primary);
    padding: 24px;
}

.match-section-title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Qualification badges */
.match-qual {
    display: inline-block;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--primary);
}

.match-qual--perfect {
    background: var(--volt-yellow);
    color: var(--primary);
}

.match-qual--good {
    background: var(--accent);
    color: var(--primary);
}

.match-qual--weak {
    background: var(--secondary);
    color: white;
}

.match-qual--pending {
    background: var(--surface);
    color: var(--text-muted);
    border-style: dashed;
}

.match-qual--error {
    background: var(--secondary);
    color: white;
}

/* Brutalist gauge */
.match-gauge {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}

.match-gauge-segment {
    flex: 1;
    height: 28px;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--surface);
}

.match-gauge-segment--negative.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 3px 3px 0 var(--primary);
}

.match-gauge-segment--neutral.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 3px 3px 0 var(--secondary);
}

.match-gauge-segment--positive.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 3px 3px 0 var(--primary);
}

/* Action buttons */
.match-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: none;
}

.match-action-btn--primary {
    background: var(--volt-yellow);
    color: var(--primary);
    box-shadow: 3px 3px 0 var(--primary);
}

.match-action-btn--primary:hover {
    background: var(--primary);
    color: var(--volt-yellow);
}

.match-action-btn--secondary {
    background: var(--accent);
    color: var(--primary);
    box-shadow: 3px 3px 0 var(--primary);
}

.match-action-btn--secondary:hover {
    background: var(--primary);
    color: var(--accent);
}

.match-action-btn--danger {
    background: var(--secondary);
    color: white;
    box-shadow: 3px 3px 0 var(--primary);
}

.match-action-btn--danger:hover {
    background: var(--primary);
    color: var(--secondary);
}

.match-action-btn:disabled {
    background: var(--surface);
    color: var(--text-muted);
    border-style: dashed;
    box-shadow: none;
    cursor: not-allowed;
}

/* Pros / Cons blocks */
.match-pros {
    border-left: 6px solid var(--accent);
    background: white;
    border-top: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    padding: 20px;
}

.match-cons {
    border-left: 6px solid var(--secondary);
    background: white;
    border-top: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    padding: 20px;
}


/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 2200;
}

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

.modal-content {
    background: white;
    border: var(--border-width) var(--border-style) var(--border-color);
    max-width: 600px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
}

.modal-overlay.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: var(--border-width) var(--border-style) var(--border-color);
    background: linear-gradient(90deg, var(--primary) 0%, #1A1A1A 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-footer {
    padding: 24px;
    border-top: var(--border-width) var(--border-style) var(--border-color);
    background: var(--surface);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--primary);
    border: none;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--secondary);
    color: white;
}

/* ============================================
   TOOLTIP / POPOVER
   ============================================ */
.tooltip-trigger {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.tooltip {
    position: absolute;
    z-index: 99999 !important;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    max-width: 320px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    left: 0;
    top: 100%;
    margin-top: 8px;
}

.tooltip.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 99999 !important;
}

.tooltip--fixed {
    position: fixed;
}

.tooltip-header {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--surface);
    font-weight: 700;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 4px 4px 0 0;
}

.tooltip-body {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 11px;
}

.tooltip-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--surface);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-radius: 0 0 4px 4px;
}

.tooltip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

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

.tooltip-item:hover {
    background: var(--surface);
}

.tooltip-close {
    width: 24px;
    height: 24px;
    background: black;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tooltip-close:hover {
    background: var(--secondary);
}

/* ============================================
   NUMERIC BADGE WITH TOOLTIP
   ============================================ */
.numeric-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--accent);
    color: black;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.numeric-badge:hover {
    background: var(--secondary);
    color: white;
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.numeric-badge.empty {
    background: var(--border);
    color: var(--text-muted);
}

.numeric-badge.empty:hover {
    background: var(--secondary);
    color: white;
}

/* ============================================
   LABEL SELECT (MULTI-SELECT)
   ============================================ */
.label-select {
    position: relative;
    display: inline-block;
}

.label-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.label-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.label-tag:hover {
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15);
}

.label-tag .remove-icon {
    font-size: 14px;
    opacity: 0.7;
}

.label-tag:hover .remove-icon {
    opacity: 1;
}

.label-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.label-add-btn:hover {
    background: var(--primary);
    color: white;
}

.label-dropdown {
    position: absolute !important;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    z-index: 9999 !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.label-dropdown.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 9999 !important;
}

.label-dropdown-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--surface);
    font-weight: 700;
    font-size: 11px;
    border-radius: 4px 4px 0 0;
}

.label-dropdown-body {
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.label-option {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.label-option:hover {
    background: var(--surface);
}

.label-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    cursor: pointer;
}

.label-option-preview {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.label-dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--surface);
    border-radius: 0 0 4px 4px;
}

/* ============================================
   TYPE SELECT (SINGLE-SELECT)
   ============================================ */
.type-select {
    position: relative;
    display: inline-block;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.type-badge:hover {
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.type-badge .dropdown-icon {
    font-size: 10px;
    opacity: 0.7;
}

.type-dropdown {
    position: absolute !important;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 9999 !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.type-dropdown.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 9999 !important;
}

.dropdown--fixed {
    position: fixed;
    z-index: 99999 !important;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    top: auto;
    left: auto;
    margin-top: 0;
}

.type-dropdown-body {
    padding: 4px;
}

.type-option {
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.type-option:hover {
    background: var(--surface);
    border-left-color: var(--secondary);
}

.type-option.selected {
    background: rgba(0, 255, 179, 0.1);
    border-left-color: var(--accent);
}

/* Predefined label/type colors */
.color-red {
    background: #FF3366;
    color: white;
}

.color-blue {
    background: #0066FF;
    color: white;
}

.color-green {
    background: #00FFB3;
    color: black;
}

.color-purple {
    background: #9933FF;
    color: white;
}

.color-orange {
    background: #FF9933;
    color: white;
}

.color-gray {
    background: #6B6B6B;
    color: white;
}

.color-cyan {
    background: #00CCFF;
    color: black;
}

.color-pink {
    background: #FF66CC;
    color: white;
}

/* ============================================
   SPINNER / LOADER
   ============================================ */

/* Spinner Base */
.spinner {
    display: inline-block;
    position: relative;
}

/* Spinner 1: Rotating Border */
.spinner-border {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-border.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.spinner-border.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Spinner 2: Square Brutalist */
.spinner-square {
    width: 40px;
    height: 40px;
    border: 3px solid black;
    position: relative;
    animation: spinSquare 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-square::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid var(--secondary);
    animation: spinSquareInner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Spinner 3: Dots */
.spinner-dots {
    display: flex;
    gap: 8px;
}

.spinner-dots .dot {
    width: 12px;
    height: 12px;
    background: var(--secondary);
    animation: dotPulse 1.4s ease-in-out infinite;
}

.spinner-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.spinner-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.spinner-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Spinner 4: Bars */
.spinner-bars {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 40px;
}

.spinner-bars .bar {
    width: 6px;
    height: 100%;
    background: var(--secondary);
    animation: barBounce 1.2s ease-in-out infinite;
}

.spinner-bars .bar:nth-child(1) {
    animation-delay: 0s;
}

.spinner-bars .bar:nth-child(2) {
    animation-delay: 0.1s;
}

.spinner-bars .bar:nth-child(3) {
    animation-delay: 0.2s;
}

.spinner-bars .bar:nth-child(4) {
    animation-delay: 0.3s;
}

/* Spinner 5: Pixel (8-bit style) */
.spinner-pixel {
    width: 40px;
    height: 40px;
    background:
        linear-gradient(var(--secondary) 0 0) 0 0 / 33.33% 33.33%,
        linear-gradient(var(--secondary) 0 0) 100% 0 / 33.33% 33.33%,
        linear-gradient(var(--secondary) 0 0) 100% 100% / 33.33% 33.33%,
        linear-gradient(var(--secondary) 0 0) 0 100% / 33.33% 33.33%;
    background-repeat: no-repeat;
    animation: pixelRotate 1s steps(4) infinite;
}

/* Spinner 6: Glitch */
.spinner-glitch {
    width: 40px;
    height: 40px;
    border: 3px solid var(--secondary);
    position: relative;
    animation: glitch 1s ease-in-out infinite;
}

.spinner-glitch::before,
.spinner-glitch::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 3px solid var(--accent);
    opacity: 0;
}

.spinner-glitch::before {
    animation: glitchBefore 1s ease-in-out infinite;
}

.spinner-glitch::after {
    animation: glitchAfter 1s ease-in-out infinite;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.loading-overlay .loading-text {
    color: white;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
}

/* Inline Spinner in buttons */
.btn .spinner-border {
    width: 16px;
    height: 16px;
    border-width: 2px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Spinner Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinSquare {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinSquareInner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes barBounce {

    0%,
    80%,
    100% {
        height: 40%;
        background: var(--secondary);
    }

    40% {
        height: 100%;
        background: var(--accent);
    }
}

@keyframes pixelRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(90deg);
    }
}

@keyframes glitch {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitchBefore {

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

    50% {
        opacity: 0.8;
        transform: translate(-4px, 0);
    }
}

@keyframes glitchAfter {

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

    50% {
        opacity: 0.8;
        transform: translate(4px, 0);
    }
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg,
            var(--surface) 25%,
            var(--border) 50%,
            var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border: 2px solid var(--border);
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
}

.skeleton-card {
    height: 120px;
}

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

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

/* ============================================
   ADVANCED FILTERS SYSTEM
   ============================================ */

/* Filter Bar (Top toolbar) */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 2px solid black;
    margin-bottom: 24px;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--neon-orange);
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-toggle-btn:hover {
    background: var(--neon-orange);
    color: white;
}

.filter-toggle-btn.active {
    background: var(--neon-orange);
    color: white;
}

.filter-toggle-icon {
    width: 18px;
    height: 18px;
}

.filter-search {
    flex: 1;
    position: relative;
}

.filter-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid var(--border);
    background: var(--surface);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
}

.filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-refresh-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-refresh-btn:hover svg {
    color: black;
}

.filter-refresh-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.filter-refresh-btn:active .filter-refresh-icon {
    transform: rotate(180deg);
}

/* Filter Panel */
.filter-panel {
    background: white;
    border: 2px solid black;
    padding: 24px;
    margin-bottom: 24px;
    display: none;
}

.filter-panel.open {
    display: block;
    animation: slideInUp 0.3s ease-out;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid black;
}

.filter-panel-title {
    font-size: 20px;
    font-weight: 700;
}

.filter-panel-actions {
    display: flex;
    gap: 12px;
}

.filter-reset-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid black;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset-btn:hover {
    background: var(--primary);
    color: white;
}

.filter-apply-btn {
    padding: 8px 16px;
    background: var(--neon-orange);
    border: 2px solid var(--neon-orange);
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-apply-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* Filter Grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Filter Section */
.filter-section {
    display: flex;
    flex-direction: column;
}

.filter-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.filter-section-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Checkbox Filters */
.filter-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.filter-checkbox-item:hover {
    background: white;
    border-left-color: var(--accent);
}

.filter-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.filter-checkbox-label {
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    flex: 1;
}

/* Checkbox with badge */
.filter-checkbox-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-checkbox-badge .badge {
    font-size: 11px;
    padding: 2px 8px;
}

/* Slider Filter */
.filter-slider {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.filter-slider-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-slider-value input {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid var(--border);
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: center;
    background: white;
}

.filter-slider-value input:focus {
    outline: none;
    border-color: var(--secondary);
}

.filter-slider-input {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    outline: none;
    border-radius: 0;
    margin: 12px 0;
}

.filter-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--neon-orange);
    cursor: pointer;
    border: 2px solid black;
}

.filter-slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--neon-orange);
    cursor: pointer;
    border: 2px solid black;
    border-radius: 0;
}

.filter-slider-input::-webkit-slider-thumb:hover {
    background: var(--secondary);
}

.filter-slider-input::-moz-range-thumb:hover {
    background: var(--secondary);
}

.filter-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* Range Slider (min-max) */
.filter-range-slider {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.filter-range-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-range-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.filter-range-value label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-range-value input {
    width: 100px;
    padding: 6px 10px;
    border: 2px solid var(--border);
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: center;
    background: white;
}

.filter-range-track {
    position: relative;
    height: 8px;
    background: var(--border);
    margin: 20px 0;
}

.filter-range-progress {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-orange), var(--accent));
}

.filter-range-slider .filter-slider-input {
    position: absolute;
    width: 100%;
    pointer-events: none;
    background: transparent;
}

.filter-range-slider .filter-slider-input::-webkit-slider-thumb {
    pointer-events: auto;
}

.filter-range-slider .filter-slider-input::-moz-range-thumb {
    pointer-events: auto;
}

/* Active filters count badge */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--secondary);
    color: white;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-bar {
        flex-wrap: wrap;
    }
    
    .filter-search {
        width: 100%;
        order: 3;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .filter-panel-actions {
        width: 100%;
    }
    
    .filter-reset-btn,
    .filter-apply-btn {
        flex: 1;
    }
}


/* ============================================
   DATE PICKER
   ============================================ */
.datepicker {
    border: var(--border-width) var(--border-style) var(--border-color);
    background: white;
    padding: 16px;
}

.datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: var(--border-width) var(--border-style) var(--border-color);
}

.datepicker-nav {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.datepicker-nav:hover {
    background: var(--secondary);
}

.datepicker-month {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 18px;
}

.datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.datepicker-day-label {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px;
}

.datepicker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: var(--border-width) solid transparent;
}

.datepicker-day:hover {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--secondary);
}

.datepicker-day.selected {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.datepicker-day.today {
    border-color: var(--accent);
}

.datepicker-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.datepicker-day.disabled:hover {
    background: transparent;
    border-color: transparent;
}

.datepicker-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: var(--border-width) var(--border-style) var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   USER MENU DROPDOWN
   ============================================ */

/* User Menu Container */
.user-menu {
    position: relative;
}

/* User Menu Toggle Button */
.user-menu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* User Menu Info Section */
.user-menu-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* User Avatar Initials (when no image) */
.user-avatar-initials {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-initials span {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: white;
}

/* User Details */
.user-details {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* Dropdown Icon */
.user-menu-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.user-menu-toggle[aria-expanded="true"] .user-menu-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-menu-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    background: white;
    border: 2px solid black;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.95) translateY(8px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-menu-dropdown.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Dropdown Header */
.user-menu-dropdown-header {
    padding: 12px 16px;
    border-bottom: 2px solid black;
    background: linear-gradient(90deg, var(--primary) 0%, #1A1A1A 100%);
}

.user-menu-dropdown-header p {
    font-size: 14px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown Body */
.user-menu-dropdown-body {
    padding: 4px 0;
}

/* Menu Items */
.user-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: none;
    border: none;
    border-left: 3px solid transparent;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background: var(--secondary);
    color: white;
    border-left-color: var(--accent);
}

.user-menu-item:active {
    background: var(--primary);
}

/* Menu Item Icon (optional) */
.user-menu-item-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

/* Separator */
.user-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Dark mode support */
.dark .user-menu-dropdown {
    background: #1A1A1A;
    border-color: #333;
}

.dark .user-menu-dropdown-header {
    background: linear-gradient(90deg, #0A0A0A 0%, #1A1A1A 100%);
}

.dark .user-menu-item {
    color: #E0E0E0;
}

.dark .user-menu-item:hover {
    background: var(--secondary);
    color: white;
}

.dark .user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .user-menu-dropdown {
        left: auto;
        right: 0;
        min-width: 200px;
    }
}

/* ============================================
   DOCUMENT CARDS
   ============================================ */

/* Document Card Container */
.document-card {
    background: white;
    border: 2px solid black;
    padding: 20px;
    position: relative;
    transition: all 0.2s ease;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.document-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    pointer-events: none;
}

.document-card:hover::after {
    border-color: var(--secondary);
}

/* Document Header */
.document-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.document-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Analysis Status Badge */
.document-analysis-status {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.document-analysis-status.analysed {
    background: rgba(0, 255, 179, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.document-analysis-status.in-progress {
    background: rgba(255, 184, 0, 0.2);
    color: var(--status-warning);
    border: 1px solid var(--status-warning);
}

.document-analysis-status.error {
    background: rgba(255, 51, 102, 0.2);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

/* Document Badges Row */
.document-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.document-type-badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 102, 255, 0.1);
    color: var(--electric-blue);
    border: 1px solid var(--electric-blue);
}

.document-subtype-badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 153, 255, 0.1);
    color: var(--status-info);
    border: 1px solid var(--status-info);
}

.document-read-status {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.document-read-status.to-read {
    background: rgba(255, 51, 102, 0.1);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.document-read-status.to-complete {
    background: rgba(255, 184, 0, 0.1);
    color: var(--status-warning);
    border: 1px solid var(--status-warning);
}

/* Document Summary */
.document-summary {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.document-summary-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.document-summary-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Document Actions */
.document-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.document-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text);
}

.document-action:hover {
    color: var(--secondary);
}

.document-action.primary {
    color: var(--electric-blue);
}

.document-action.primary:hover {
    color: var(--secondary);
}

.document-action.danger {
    color: var(--text-muted);
}

.document-action.danger:hover {
    color: var(--secondary);
}

.document-action-icon {
    width: 18px;
    height: 18px;
}

/* Separator between actions */
.document-action-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
}

/* Document In Progress Card */
.document-inprogress-card {
    background: white;
    border: 2px solid black;
    padding: 20px;
    position: relative;
}

.document-inprogress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.document-inprogress-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--status-warning);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.document-inprogress-title {
    flex: 1;
}

.document-inprogress-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.document-inprogress-title p {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--status-warning);
    font-weight: 600;
}

.document-inprogress-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-inprogress-skeleton .skeleton {
    height: 12px;
}

.document-inprogress-skeleton .skeleton:last-child {
    width: 70%;
}

/* Document Grid Layout */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

/* Compact variant */
.document-card.compact {
    padding: 16px;
}

.document-card.compact .document-card-title {
    font-size: 14px;
}

.document-card.compact .document-summary {
    margin-bottom: 12px;
    padding-bottom: 12px;
}

.document-card.compact .document-summary-text {
    -webkit-line-clamp: 2;
}

/* Responsive */
@media (max-width: 768px) {
    .document-grid {
        grid-template-columns: 1fr;
    }

    .document-actions {
        flex-wrap: wrap;
    }

    .document-action-separator {
        display: none;
    }
}

/* ============================================
   LOGIN & PASSWORD PAGES
   ============================================ */

/* Login/Password Container */
.login-container,
.recovery-container,
.reset-container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
}

.reset-container {
    max-width: 700px;
}

/* Login/Password Card */
.login-card,
.recovery-card,
.reset-card {
    background: white;
    border: var(--border-width) var(--border-style) var(--border-color);
    position: relative;
    overflow: hidden;
}

/* Headers */
.login-header,
.recovery-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1A1A1A 100%);
    padding: 48px 32px;
    text-align: center;
    position: relative;
}

.reset-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1A1A1A 100%);
    padding: 32px 32px;
    text-align: center;
    position: relative;
}

/* Body */
.login-body,
.recovery-body {
    padding: 40px 32px;
}

.reset-body {
    padding: 24px 32px;
}

/* Footer */
.login-footer,
.recovery-footer {
    padding: 24px 32px;
    background: var(--surface);
    border-top: var(--border-width) var(--border-style) var(--border-color);
    text-align: center;
}

.reset-footer {
    padding: 16px 32px;
    background: var(--surface);
    border-top: var(--border-width) var(--border-style) var(--border-color);
    text-align: center;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

/* Links */
.forgot-link,
.back-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.forgot-link:hover,
.back-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--secondary);
}

/* Alerts */
.alert {
    padding: 16px;
    border: var(--border-width) var(--border-style) var(--border-color);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
}

.alert-error {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}

.alert-success {
    padding: 16px;
    border: var(--border-width) var(--border-style) var(--accent);
    background: rgba(0, 255, 179, 0.1);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Info Box */
.info-box {
    padding: 16px;
    background: rgba(0, 255, 179, 0.1);
    border: var(--border-width) var(--border-style) var(--accent);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

/* Password Requirements */
.password-requirements {
    padding: 16px;
    background: rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--primary);
    margin-bottom: 24px;
    font-size: 13px;
}

.requirement-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #666;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-item.valid {
    color: var(--accent);
}

.requirement-item.invalid {
    color: var(--text-muted);
}

.requirement-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-weight: 700;
}

/* Password Strength */
.password-strength {
    margin-top: 12px;
}

.strength-bar {
    height: 6px;
    background: #E0E0E0;
    position: relative;
    margin-top: 8px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all var(--transition-base);
    position: absolute;
    left: 0;
    top: 0;
}

.strength-weak {
    background: var(--secondary);
    width: 33%;
}

.strength-medium {
    background: #FFA500;
    width: 66%;
}

.strength-strong {
    background: var(--accent);
    width: 100%;
}

.strength-label {
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 700;
    margin-top: 4px;
    text-align: right;
}

.text-volt-yellow {
    color: var(--volt-yellow);
}

.text-status-error {
    color: var(--status-error);
}

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

.text-accent {
    color: var(--accent);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Stagger delays */
.stagger-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.stagger-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.stagger-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.stagger-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Accent bar */
.accent-bar-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
}

/* Noise texture overlay */
.noise-overlay {
    position: relative;
}

.noise-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    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.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #E62958;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

.grid {
    display: grid;
}

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

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-12 {
    grid-template-columns: repeat(12, 1fr);
}

/* Spacing utilities */
.p-4 {
    padding: 16px;
}

.p-6 {
    padding: 24px;
}

.p-8 {
    padding: 32px;
}

.m-4 {
    margin: 16px;
}

.m-6 {
    margin: 24px;
}

.m-8 {
    margin: 32px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

/* Text utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-normal {
    font-weight: 400;
}

.text-sm {
    font-size: 14px;
}

.text-base {
    font-size: 16px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 20px;
}

.text-2xl {
    font-size: 24px;
}

.text-3xl {
    font-size: 30px;
}

.text-4xl {
    font-size: 36px;
}

.uppercase {
    text-transform: uppercase;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    .nav-sidebar {
        width: 100%;
        height: auto;
    }

    .drawer {
        width: 100%;
        right: -100%;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   AI AGENTS
   ============================================ */

/* Agent Avatar Animations */
@keyframes spectrum1 {
    0%, 100% { height: 8px; }
    50% { height: 20px; }
}

@keyframes spectrum2 {
    0%, 100% { height: 12px; }
    50% { height: 6px; }
}

@keyframes spectrum3 {
    0%, 100% { height: 16px; }
    50% { height: 10px; }
}

@keyframes backflip {
    0% {
        transform: translateY(0) rotateY(0deg);
    }
    30% {
        transform: translateY(-40px) rotateY(0deg);
    }
    60% {
        transform: translateY(-40px) rotateY(180deg);
    }
    100% {
        transform: translateY(0) rotateY(360deg);
    }
}

@keyframes worried-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes border-chase {
    0% {
        clip-path: polygon(
            0% 0%, 30% 0%, 30% 4px, 4px 4px, 4px 30%, 0% 30%
        );
    }
    25% {
        clip-path: polygon(
            calc(100% - 30%) 0%, 100% 0%, 100% 30%, calc(100% - 4px) 30%, calc(100% - 4px) 4px, calc(100% - 30%) 4px
        );
    }
    50% {
        clip-path: polygon(
            calc(100% - 30%) calc(100% - 30%), 100% calc(100% - 30%), 100% 100%, calc(100% - 30%) 100%, calc(100% - 30%) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 30%)
        );
    }
    75% {
        clip-path: polygon(
            0% calc(100% - 30%), 4px calc(100% - 30%), 4px calc(100% - 4px), 30% calc(100% - 4px), 30% 100%, 0% 100%
        );
    }
    100% {
        clip-path: polygon(
            0% 0%, 30% 0%, 30% 4px, 4px 4px, 4px 30%, 0% 30%
        );
    }
}

@keyframes border-glow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(10, 10, 10, 0);
    }
    50% {
        box-shadow: 0 0 12px rgba(10, 10, 10, 0.6);
    }
}

/* Avatar Base */
.agent-avatar {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
}

.agent-avatar-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0A0A0A;
    top: 6px;
    left: 6px;
    z-index: 0;
}

.agent-avatar-inner {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 800;
    color: #0A0A0A;
    background-color: var(--agent-color);
    z-index: 1;
    cursor: pointer;
    transform-style: preserve-3d;
}

/* Backflip on hover for standalone idle avatars */
.agent-avatar.idle:hover .agent-avatar-inner,
.agent-avatar.idle-backflip:hover .agent-avatar-inner {
    animation: backflip 0.8s ease-in-out;
}

/* Speaking State - Audio Bars */
.agent-avatar.speaking .audio-bars {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.agent-avatar.speaking .audio-bar {
    width: 4px;
    background-color: #0A0A0A;
}

.agent-avatar.speaking .audio-bar:nth-child(1) {
    animation: spectrum1 0.4s ease-in-out infinite;
}

.agent-avatar.speaking .audio-bar:nth-child(2) {
    animation: spectrum2 0.35s ease-in-out infinite;
    animation-delay: 0.05s;
}

.agent-avatar.speaking .audio-bar:nth-child(3) {
    animation: spectrum3 0.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.agent-avatar.speaking .audio-bar:nth-child(4) {
    animation: spectrum1 0.45s ease-in-out infinite;
    animation-delay: 0.15s;
}

.agent-avatar.speaking .audio-bar:nth-child(5) {
    animation: spectrum2 0.4s ease-in-out infinite;
    animation-delay: 0.2s;
}

.agent-avatar.speaking .audio-bar:nth-child(6) {
    animation: spectrum3 0.38s ease-in-out infinite;
    animation-delay: 0.25s;
}

/* Worried State */
.agent-avatar.worried .agent-avatar-inner {
    border-style: dashed;
    animation: worried-shake 0.15s ease-in-out infinite;
}

/* Thinking State - Animated Border Chase */
.agent-avatar.thinking {
    position: relative;
}

.agent-avatar.thinking::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    background: #0A0A0A;
    z-index: 10;
    animation: border-chase 1.5s linear infinite;
}

.agent-avatar.thinking .agent-avatar-inner {
    border-width: 4px;
}

/* Business Card Styles */
.agent-card {
    background: #F5F5F5;
    border: 3px solid #0A0A0A;
    padding: 24px;
    box-shadow: 8px 8px 0 #0A0A0A;
    transition: none;
}

.agent-card-avatar {
    width: 120px;
    height: 120px;
    position: relative;
    flex-shrink: 0;
}

.agent-card-avatar-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0A0A0A;
    top: 8px;
    left: 8px;
    z-index: 0;
}

.agent-card-avatar-inner {
    width: 100%;
    height: 100%;
    border: 4px solid #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 800;
    color: #0A0A0A;
    background-color: var(--agent-color);
    cursor: pointer;
    transform-style: preserve-3d;
    z-index: 1;
}

.agent-card.idle:hover .agent-card-avatar-inner {
    animation: backflip 0.8s ease-in-out;
}

/* Agent Badge Styles */
.agent-badge {
    display: inline-block;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #0A0A0A;
    background: #0A0A0A;
    color: white;
}

.agent-badge-small {
    display: inline-block;
    padding: 3px 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #0A0A0A;
    background: #0A0A0A;
    color: white;
}

/* Agent Info Labels */
.agent-info-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B6B6B;
    margin-bottom: 4px;
}

.agent-info-value {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
}

.agent-info-label-small {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B6B6B;
    margin-bottom: 2px;
}

.agent-info-value-small {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: #1A1A1A;
}

/* Expandable Agent Cards */
.agent-expandable {
    position: relative;
}

.agent-expandable-container {
    display: flex;
    position: relative;
    width: fit-content;
}

/* Unified border wrapper that grows */
.agent-expandable-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border: 3px solid #0A0A0A;
    background: transparent;
    z-index: 0;
    pointer-events: none;
    transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease;
}

/* Unified shadow that grows */
.agent-expandable-container::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 80px;
    height: 80px;
    background: #0A0A0A;
    z-index: -1;
    transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.03s,
                height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.03s;
}

.agent-expandable:hover .agent-expandable-container::before {
    width: 366px;
    height: 160px;
}

.agent-expandable:hover .agent-expandable-container::after {
    width: 366px;
    height: 160px;
}

.agent-expandable-avatar {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
    z-index: 2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 800;
    color: #0A0A0A;
    background-color: var(--agent-color);
    transition: height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.3s ease;
}

.agent-expandable:hover .agent-expandable-avatar {
    height: 160px;
    transform: scale(1.02);
}

.agent-expandable-card {
    width: 0;
    height: 80px;
    opacity: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: #FFFFFF;
    transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.25s ease;
}

.agent-expandable:hover .agent-expandable-card {
    width: 286px;
    height: 160px;
    opacity: 1;
}

.agent-expandable-card-content {
    padding: 16px;
    padding-left: 20px;
    width: 286px;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.3s ease,
                transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.agent-expandable:hover .agent-expandable-card-content {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.12s;
}

/* Staggered reveal for card content children */
.agent-expandable-card-content > * {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.3s ease;
}

.agent-expandable:hover .agent-expandable-card-content > *:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s;
}

.agent-expandable:hover .agent-expandable-card-content > *:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.agent-expandable:hover .agent-expandable-card-content > *:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.25s;
}

/* Entrance animation - slide from right with brutalist punch */
@keyframes agentSlideIn {
    0% {
        opacity: 0;
        transform: translateX(120px);
    }
    60% {
        opacity: 1;
        transform: translateX(-8px);
    }
    80% {
        transform: translateX(3px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.agent-expandable {
    opacity: 0;
    animation: agentSlideIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.agent-expandable:nth-child(1) { animation-delay: 0.1s; }
.agent-expandable:nth-child(2) { animation-delay: 0.2s; }
.agent-expandable:nth-child(3) { animation-delay: 0.3s; }
.agent-expandable:nth-child(4) { animation-delay: 0.4s; }
.agent-expandable:nth-child(5) { animation-delay: 0.5s; }

/* Agent Color Presets */
.agent-color-red {
    --agent-color: #FF3366;
}

.agent-color-cyan {
    --agent-color: #00D9FF;
}

.agent-color-purple {
    --agent-color: #9933FF;
}

.agent-color-green {
    --agent-color: #39FF14;
}

.agent-color-yellow {
    --agent-color: #FFD60A;
}

.agent-color-orange {
    --agent-color: #FF6B35;
}

.agent-color-blue {
    --agent-color: #0066FF;
}

.agent-color-pink {
    --agent-color: #FF2D95;
}

/* ============================================
   AI AGENT CHAT SYSTEM
   ============================================ */

/* Chat Widget - Fixed Button Bottom Right */
.chat-widget-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 998;
    cursor: pointer;
    transition: transform var(--transition-base);
}

.chat-widget-button:hover {
    transform: translateY(-4px);
}

.chat-widget-button:active {
    transform: translateY(-2px);
}

/* Chat Widget Avatar - 60px */
.chat-widget-avatar {
    width: 60px;
    height: 60px;
    position: relative;
    flex-shrink: 0;
}

.chat-widget-avatar-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0A0A0A;
    top: 6px;
    left: 6px;
    z-index: 0;
}

.chat-widget-avatar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: #0A0A0A;
    background-color: var(--agent-color);
    z-index: 1;
    cursor: pointer;
}

.chat-widget-avatar.idle:hover .chat-widget-avatar-inner {
    animation: backflip 0.8s ease-in-out;
}


/* Chat Widget Avatar - Speaking State (audio bars) */
.chat-widget-avatar.speaking .audio-bars {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.chat-widget-avatar.speaking .audio-bar {
    width: 3px;
    background-color: #0A0A0A;
}

.chat-widget-avatar.speaking .audio-bar:nth-child(1) {
    animation: spectrum1 0.4s ease-in-out infinite;
}

.chat-widget-avatar.speaking .audio-bar:nth-child(2) {
    animation: spectrum2 0.35s ease-in-out infinite;
    animation-delay: 0.05s;
}

.chat-widget-avatar.speaking .audio-bar:nth-child(3) {
    animation: spectrum3 0.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.chat-widget-avatar.speaking .audio-bar:nth-child(4) {
    animation: spectrum1 0.45s ease-in-out infinite;
    animation-delay: 0.15s;
}

.chat-widget-avatar.speaking .audio-bar:nth-child(5) {
    animation: spectrum2 0.4s ease-in-out infinite;
    animation-delay: 0.2s;
}

.chat-widget-avatar.speaking .audio-bar:nth-child(6) {
    animation: spectrum3 0.38s ease-in-out infinite;
    animation-delay: 0.25s;
}

/* Chat Drawer - 30% width */
.chat-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    z-index: 999;
}

.chat-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.chat-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 30vw;
    min-width: 400px;
    max-width: 600px;
    height: 100vh;
    background: #F5F5F5;
    border-left: 2px solid #0A0A0A;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.chat-drawer.open {
    transform: translateX(0);
}

/* Chat Container for Dedicated Page (70% width) */
.chat-page-container {
    display: flex;
    gap: 16px;
    height: calc(100vh - 140px);
}

.chat-sidebar {
    width: 30%;
    background: white;
    border: 2px solid #0A0A0A;
    box-shadow: 6px 6px 0 #0A0A0A;
    display: flex;
    flex-direction: column;
}

.chat-main {
    width: 70%;
    background: white;
    border: 2px solid #0A0A0A;
    box-shadow: 6px 6px 0 #0A0A0A;
    display: flex;
    flex-direction: column;
}

/* Chat Header */
.chat-header {
    padding: 20px 24px;
    border-bottom: 2px solid #0A0A0A;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-title {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--primary);
}

.chat-header-close {
    width: 32px;
    height: 32px;
    border: 2px solid #0A0A0A;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-header-close:hover {
    background: #0A0A0A;
    color: white;
}

/* Chat History Bar - Horizontal Scroll */
.chat-history-bar {
    padding: 16px 24px;
    border-bottom: 2px solid #0A0A0A;
    background: white;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    flex-shrink: 0;
}

.chat-history-bar::-webkit-scrollbar {
    height: 6px;
}

.chat-history-bar::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.chat-history-bar::-webkit-scrollbar-thumb {
    background: #0A0A0A;
}

.chat-history-new-btn {
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: #0A0A0A;
    color: white;
    border: 2px solid #0A0A0A;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.chat-history-new-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

.chat-history-item {
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    background: white;
    color: var(--text);
    border: 2px solid #0A0A0A;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.chat-history-item:hover {
    background: #F5F5F5;
}

.chat-history-item.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #0A0A0A;
}

/* Chat Drawer Body — flex relay for the dynamic body container */
#chat-drawer-body,
#chat-drawer-body > [x-data] {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #FAFAFA;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #0A0A0A;
}

/* Chat Message - Base */
.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

/* Message Avatar - 40px */
.chat-message-avatar {
    width: 40px;
    height: 40px;
    position: relative;
    flex-shrink: 0;
}

.chat-message-avatar-shadow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #0A0A0A;
    top: 6px;
    left: 6px;
    z-index: 0;
}

.chat-message-avatar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    color: #0A0A0A;
    background-color: var(--agent-color);
    z-index: 1;
}

/* User Avatar - Uses existing avatar styles */
.chat-message-user-avatar {
    width: 40px;
    height: 40px;
    border: 2px solid #0A0A0A;
    flex-shrink: 0;
}

.chat-message-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Message Bubble */
.chat-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border: 2px solid #0A0A0A;
    position: relative;
}

/* User Message - Right Aligned */
.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message.user .chat-message-bubble {
    background: white;
    box-shadow: 4px 4px 0 #0A0A0A;
}

/* Bot Message - Left Aligned */
.chat-message.bot .chat-message-bubble {
    background: #F5F5F5;
    box-shadow: 4px 4px 0 #0A0A0A;
}

/* Message Content */
.chat-message-content {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.chat-message-content p {
    margin-bottom: 8px;
}

.chat-message-content p:last-child {
    margin-bottom: 0;
}

.chat-message-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chat-message-content pre {
    font-family: var(--font-mono);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border: 2px solid #0A0A0A;
    overflow-x: auto;
    margin: 8px 0;
}

/* Message Timestamp */
.chat-message-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Thinking Message - Animated */
.chat-message.thinking .chat-message-bubble {
    background: var(--accent);
    border-color: var(--accent);
    animation: thinking-pulse 1.5s ease-in-out infinite;
}

.chat-message.thinking .chat-message-content {
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-thinking-dots {
    display: flex;
    gap: 4px;
}

.chat-thinking-dot {
    width: 6px;
    height: 6px;
    background: #0A0A0A;
    animation: thinking-dot 1.4s ease-in-out infinite;
}

.chat-thinking-dot:nth-child(1) {
    animation-delay: 0s;
}

.chat-thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking-pulse {
    0%, 100% {
        box-shadow: 4px 4px 0 #0A0A0A;
    }
    50% {
        box-shadow: 6px 6px 0 #0A0A0A;
    }
}

@keyframes thinking-dot {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    40% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Bot Avatar States in Messages */
.chat-message-avatar.speaking .audio-bars-small {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1px;
    align-items: flex-end;
}

.chat-message-avatar.speaking .audio-bar-small {
    width: 3px;
    background-color: #0A0A0A;
}

.chat-message-avatar.speaking .audio-bar-small:nth-child(1) {
    animation: spectrum1 0.4s ease-in-out infinite;
}

.chat-message-avatar.speaking .audio-bar-small:nth-child(2) {
    animation: spectrum2 0.35s ease-in-out infinite;
    animation-delay: 0.05s;
}

.chat-message-avatar.speaking .audio-bar-small:nth-child(3) {
    animation: spectrum3 0.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.chat-message-avatar.speaking .audio-bar-small:nth-child(4) {
    animation: spectrum1 0.45s ease-in-out infinite;
    animation-delay: 0.15s;
}

.chat-message-avatar.thinking {
    position: relative;
}

.chat-message-avatar.thinking::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: #0A0A0A;
    z-index: 10;
    animation: border-chase 1.5s linear infinite;
}

/* Chat Input Area */
.chat-input-area {
    padding: 20px 24px;
    border-top: 2px solid #0A0A0A;
    background: white;
    flex-shrink: 0;
}

.chat-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: #F5F5F5;
    border: 2px solid #0A0A0A;
    resize: none;
    transition: all var(--transition-fast);
}

.chat-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 4px 4px 0 var(--secondary);
}

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

.chat-send-btn {
    width: 48px;
    height: 48px;
    background: #0A0A0A;
    border: 2px solid #0A0A0A;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 4px 6px 0 #0A0A0A;
}

.chat-send-btn:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0 #0A0A0A;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Chat Empty State */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.chat-empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.chat-empty-title {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    color: var(--primary);
    margin-bottom: 12px;
}

.chat-empty-text {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    max-width: 400px;
}

/* Responsive */
@media (max-width: 1024px) {
    .chat-drawer {
        width: 40vw;
        min-width: 350px;
    }
}

@media (max-width: 768px) {
    .chat-drawer {
        width: 100vw;
        min-width: 100vw;
        max-width: 100vw;
    }
    
    .chat-widget-button {
        bottom: 16px;
        right: 16px;
    }
    
    .chat-message-bubble {
        max-width: 80%;
    }
    
    .chat-page-container {
        flex-direction: column;
        height: auto;
    }
    
    .chat-sidebar,
    .chat-main {
        width: 100%;
    }
}

/* ============================================
   HTMX INDICATORS
   ============================================ */
.htmx-indicator.htmx-request {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ============================================
   FILTER DROPDOWNS FIX
   ============================================ */
#drawer-root {
    /* Ensure HTMX drawer always stays above page UI (filters, tables, etc.) */
    z-index: 1600 !important;
}

#staff-integration-container {
    overflow: visible !important;
}

#staff-integration-container > * {
    overflow: visible !important;
}

.filter-inline-bar {
    position: relative;
    z-index: 10;
    background: white;
    padding: 12px 16px;
    overflow: visible !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-search {
    flex: 0 0 180px;
    position: relative;
}

.filter-inline-bar form {
    overflow: visible !important;
}

.filter-inline-dropdown {
    position: relative;
    z-index: 20;
}

/* Filter button */
.filter-btn {
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.filter-btn-value {
    display: inline-block;
    min-width: 4ch; /* reserve space for 4 digits */
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.filter-btn:hover {
    background: var(--surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: var(--volt-yellow);
    border-color: rgba(0, 0, 0, 0.3);
}

/* Filter dropdown panel */
.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px;
    min-width: 200px;
}

.filter-dropdown-panel--wide {
    min-width: 240px;
}

/* Filter option in dropdown */
.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 8px;
    transition: background 0.2s ease;
    border-radius: 2px;
}

.filter-option:hover {
    background: var(--surface);
}

.filter-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.filter-option input[type="checkbox"]:checked {
    background: var(--primary);
}

.filter-option-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Search input in filter bar */
.filter-search-input-inline {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: all 0.2s ease;
    background: white;
}

.filter-search-input-inline:focus {
    outline: none;
    border-color: var(--secondary);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(255, 51, 102, 0.1);
}

.filter-search-input-inline::placeholder {
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Reset button in filter bar */
.filter-reset-btn {
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 8px;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-reset-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   BULK TOOLBAR
   ============================================ */
.bulk-toolbar {
    padding: 16px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bulk-toolbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bulk-selectall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.bulk-selectall__checkbox {
    width: 15px;
    height: 15px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary);
}

.bulk-selectall__label {
    font-size: 12px;
    font-weight: 800;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    border-left: 2px solid var(--primary);
    flex-wrap: wrap;
}

.bulk-selected-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-weight: 800;
    padding: 4px 8px;
    font-size: 12px;
}

.bulk-cancel {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.bulk-cancel:hover {
    text-decoration: underline;
}

/* ============================================
   STATS PILLS (COMPACT KPI)
   ============================================ */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.1s ease;
    background: white;
}

.stat-pill-label {
    letter-spacing: 0.5px;
}

.stat-pill-value {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

/* Primary (Total) */
.stat-pill--primary {
    background: var(--primary);
    color: var(--accent);
}

.stat-pill--primary .stat-pill-label {
    color: white;
}

/* Purple (Candidats) - cyber-purple */
.stat-pill--purple {
    background: var(--cyber-purple);
    color: white;
}

/* Blue (Collab/Alternants) - electric-blue */
.stat-pill--blue {
    background: var(--electric-blue);
    color: white;
}

/* Red (Partenaires) - secondary */
.stat-pill--red {
    background: var(--secondary);
    color: white;
}

/* Cyan (Freelance) - cyber-cyan */
.stat-pill--cyan {
    background: var(--cyber-cyan);
    color: var(--primary);
}

/* Green (CDI) - accent (vert cyan) */
.stat-pill--green {
    background: var(--accent);
    color: var(--primary);
}

/* Gray (Stagiaires) - text-muted */
.stat-pill--gray {
    background: var(--border);
    color: var(--text-muted);
}

/* ============================================
   ADD PROFILE BUTTON (PROMINENT CTA)
   ============================================ */
.btn-add-profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--volt-yellow);
    color: var(--primary);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 6px 6px 0px var(--primary);
    transition: all 0.1s ease;
    cursor: pointer;
}

.btn-add-profile:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--primary);
}

.btn-add-profile:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px var(--primary);
}

.btn-add-profile svg {
    transition: transform 0.2s ease;
}

.btn-add-profile:hover svg {
    transform: rotate(90deg);
}

/* ============================================
   CJM CALCULATOR (COMPACT DROPDOWN)
   ============================================ */
.btn-cjm-calculator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--volt-yellow);
    color: var(--primary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 6px 6px 0px var(--primary);
    transition: all 0.1s ease;
    cursor: pointer;
}

.btn-cjm-calculator:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px var(--primary);
}

.cjm-result-badge {
    background: var(--primary);
    color: var(--volt-yellow);
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: -0.5px;
    border: 1px solid var(--primary);
}

.cjm-calculator-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 2px solid var(--primary);
    box-shadow: 4px 4px 0px var(--primary);
    padding: 16px;
    min-width: 280px;
    z-index: 999;
}

.cjm-copy-btn {
    padding: 6px;
    border: 2px solid var(--primary);
    background: white;
    transition: all 0.1s ease;
    cursor: pointer;
}

.cjm-copy-btn:hover {
    background: var(--primary);
    color: white;
}

.cjm-input-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.cjm-input {
    width: 100%;
    border: 2px solid var(--primary);
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.1s ease;
}

.cjm-input:focus {
    outline: none;
    background: var(--surface);
}

.cjm-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--volt-yellow);
    border: 2px solid var(--primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 900;
    transition: all 0.1s ease;
    cursor: pointer;
    background: white;
}

.pagination-btn:hover {
    background: var(--primary);
    color: white;
}

.pagination-btn--active {
    background: var(--volt-yellow);
    color: var(--primary);
}

.pagination-btn--disabled {
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
}

/* ============================================
   INTERVIEW COPILOT
   ============================================ */

/* Sidebar - Question Bank */
.copilot-sidebar {
    width: 300px;
    border-right: 2px solid var(--primary);
    background: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.copilot-sidebar-header {
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.copilot-sidebar-header h3 {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.copilot-sidebar-close {
    width: 24px;
    height: 24px;
    background: white;
    color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
}

.copilot-sidebar-close:hover {
    background: var(--secondary);
    color: white;
}

.copilot-sidebar-body {
    flex: 1;
    overflow-y: auto;
}

/* Category accordion */
.copilot-cat-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: none;
    border-bottom: 2px solid var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    transition: none;
}

.copilot-cat-btn:hover {
    background: var(--volt-yellow);
    color: var(--primary);
}

.copilot-cat-count {
    font-size: 9px;
    padding: 2px 8px;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
}

/* Subcategory */
.copilot-subcat-btn {
    width: 100%;
    padding: 10px 16px 10px 24px;
    background: white;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
    transition: none;
}

.copilot-subcat-btn:hover {
    color: var(--primary);
    background: var(--surface);
}

.copilot-subcat-count {
    font-size: 8px;
    padding: 1px 6px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Question item */
.copilot-q-item {
    padding: 10px 16px 10px 36px;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: none;
}

.copilot-q-item:hover {
    background: rgba(255, 51, 102, 0.03);
    border-left-color: var(--secondary);
}

.copilot-q-item--active {
    background: var(--surface);
    border-left-color: var(--secondary);
}

.copilot-q-item--treated {
    border-left-color: var(--accent);
}

.copilot-q-item--treated:hover {
    border-left-color: var(--accent);
}

/* Question status checkbox */
.copilot-q-check {
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copilot-q-check--done {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
}

/* Workspace tabs */
.copilot-tab-bar {
    display: flex;
    border-bottom: 3px solid var(--primary);
    background: white;
    flex-shrink: 0;
}

.copilot-tab {
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: none;
}

.copilot-tab:hover {
    color: var(--primary);
    background: var(--surface);
}

.copilot-tab--active {
    color: var(--primary);
    background: var(--surface);
}

.copilot-tab--active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary);
}

/* Rating blocks */
.copilot-rating {
    display: flex;
    gap: 4px;
}

.copilot-rating-block {
    width: 38px;
    height: 38px;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    transition: none;
    background: white;
    color: var(--primary);
}

.copilot-rating-block--filled {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

.copilot-rating-block:hover {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* CV Panel */
.copilot-cv-panel {
    width: 50%;
    min-width: 480px;
    max-width: 700px;
    border-left: 2px solid var(--primary);
    background: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.copilot-cv-panel-header {
    padding: 0 8px;
    height: 42px;
    background: white;
    border-bottom: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.copilot-cv-panel-header h3 {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
}

.copilot-cv-panel-body {
    flex: 1;
    overflow-y: auto;
}

/* Force single-column in narrow CV panel */
.copilot-cv-panel-body [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
}

/* Embedded PDF toolbar (copilot) */
.copilot-pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    height: 42px;
    background: white;
    border-bottom: 3px solid var(--primary);
    flex-shrink: 0;
}

.copilot-pdf-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copilot-pdf-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.copilot-pdf-toolbar-title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 8px;
    color: var(--primary);
}

.copilot-pdf-nav {
    display: flex;
    align-items: center;
    border: 2px solid var(--primary);
    height: 28px;
}

.copilot-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    background: white;
    border: none;
    cursor: pointer;
    color: var(--primary);
    padding: 0;
}
.copilot-pdf-btn:hover {
    background: var(--surface);
}
.copilot-pdf-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.copilot-pdf-btn-left {
    border-right: 2px solid var(--primary);
}
.copilot-pdf-btn-right {
    border-left: 2px solid var(--primary);
}

.copilot-pdf-icon {
    width: 14px;
    height: 14px;
}

.copilot-pdf-page {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    padding: 0 8px;
    white-space: nowrap;
}

.copilot-pdf-scale {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    background: transparent;
    border: none;
    padding: 0 4px;
    cursor: pointer;
    height: 100%;
    outline: none;
    color: var(--primary);
}

.copilot-pdf-btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    margin-left: 4px;
}
.copilot-pdf-btn-close:hover {
    background: var(--secondary);
}

/* Expected elements toggle */
.copilot-expected-toggle {
    width: 100%;
    padding: 10px 16px;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-bottom: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.copilot-expected-toggle:hover {
    background: var(--volt-yellow);
}

.copilot-expected-body {
    padding: 16px;
    border: 2px solid var(--primary);
    border-top: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.6;
    background: white;
}

/* Progress bar in header */
.copilot-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copilot-progress-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.7);
}

.copilot-progress-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.copilot-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* ============================================
   RECRUITER INSTRUCTIONS BLOCK
   ============================================ */
.recruiter-instructions {
    background: var(--volt-yellow);
    border: 4px solid var(--primary);
    box-shadow: 8px 8px 0 var(--primary);
}

.recruiter-instructions__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 32px;
    border-bottom: 4px solid var(--primary);
}

.recruiter-instructions__label {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
}

.recruiter-instructions__body {
    padding: 32px;
}

.recruiter-instructions__textarea {
    width: 100%;
    background: white;
    border: 2px solid var(--primary);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--primary);
    padding: 16px;
    resize: vertical;
    min-height: 120px;
    transition: none;
}

.recruiter-instructions__textarea:focus {
    outline: none;
    box-shadow: 4px 4px 0 var(--primary);
}

.recruiter-instructions__textarea::placeholder {
    color: rgba(10, 10, 10, 0.35);
    font-style: italic;
}

/* ============================================
   ORGANIZATION SECTION PANEL
   ============================================ */
.org-section {
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.org-section__header {

    padding: 12px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.org-section__title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.org-section__title svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.org-section__desc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.6;
}

.org-section__body {
    padding: 24px;
}

/* ============================================
   MAIN PART — primary content area wrapper
   ============================================ */

/* Top-level content container for all app sections (at, staff, org, settings, watcher…) */
.main-part {
    padding: 24px;
    transition: all 200ms ease-in-out;
}

/* ============================================
   APP SECTION — unified page section layout
   ============================================ */

/* Outer container: stacks blocks with consistent vertical spacing */
.app-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Page-level header: title + description + optional right-side actions */
.app-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}

/* Sub-section block */
.app-section__block {
    display: flex;
    flex-direction: column;
}

/* Sub-section header row: icon + title/subtitle */
.app-section__block-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Colored icon box */
.app-section__icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--icon-color, var(--primary));
    color: white;
    flex-shrink: 0;
}

.app-section__icon svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   ICON-SQ — standalone reusable icon block
   Parameters (CSS custom properties):
     --icon-size  : container size in px  (default 40px)
     --icon-color : background color      (default var(--primary))
   Usage in template:
     {{ template "icon_documents" dict "Color" "electric-blue" "Size" "40" }}
   ============================================ */
.icon-sq {
    --icon-size: 40px;
    --icon-color: var(--primary);
    width: var(--icon-size);
    height: var(--icon-size);
    min-width: var(--icon-size);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--icon-color);
    color: white;
    flex-shrink: 0;
}

.icon-sq__svg {
    width: calc(var(--icon-size) * 0.5);
    height: calc(var(--icon-size) * 0.5);
}

/* Sub-section content body */
.app-section__block-body {
    padding: 24px;
    margin-top: 16px;
}

/* Compact action/stats toolbar */
.app-section__toolbar {
    background: white;
    border: 2px solid var(--primary);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ============================================
   GUIDELINE CARD
   ============================================ */
.guideline-card {
    background: white;
    border: 2px solid black;
    border-radius: 0;
    transition: box-shadow 0.15s ease;
}

.guideline-card:hover {
    box-shadow: 4px 4px 0 black;
}

.guideline-card__header {
    padding: 14px 16px;
    border-bottom: 2px solid black;
}

.guideline-card__name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.guideline-card__desc {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.guideline-card__footer {
    padding: 10px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   DOCUMENT CARD
   ============================================ */
.doc-card-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-card {
    background: white;
    border: 2px solid black;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}

.doc-card:hover {
    box-shadow: 4px 4px 0 black;
}

.doc-card__header {
    padding: 10px 16px;
    border-bottom: 2px solid black;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-card__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: #6b7280;
}

.doc-card__name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-width: 0;
}

.doc-card__body {
    padding: 12px 16px;
    flex: 1;
}

.doc-card__summary {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card__footer {
    padding: 10px 16px;
    border-top: 2px solid black;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Document type tag (classification, neutral) */
.doc-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border: 1px solid black;
    border-radius: 0;
    display: inline-block;
    background: white;
    color: black;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.doc-tag--type {
    background: var(--neon-orange);
    border-color: var(--neon-orange);
    color: white;
}

.doc-tag--subtype {
    background: var(--cyber-cyan);
    border-color: var(--cyber-cyan);
    color: black;
}

.doc-tag--nature {
    background: var(--matrix-green);
    border-color: var(--matrix-green);
    color: black;
}

/* ============================================
   REFERENCE CARD
   ============================================ */
.ref-card {
    background: white;
    border: 2px solid black;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}

.ref-card:hover {
    box-shadow: 4px 4px 0 black;
}

.ref-card__header {
    padding: 10px 16px;
    border-bottom: 2px solid black;
}

.ref-card__name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.ref-card__body {
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ref-card__footer {
    padding: 10px 16px;
    border-top: 2px solid black;
}

/* Reference metadata tags */
.ref-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border: 1px solid black;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ref-tag--customer {
    background: var(--electric-blue);
    border-color: var(--electric-blue);
    color: white;
}

.ref-tag--activity {
    background: var(--neon-orange);
    border-color: var(--neon-orange);
    color: white;
}

.ref-tag--sector {
    background: var(--matrix-green);
    border-color: var(--matrix-green);
    color: black;
}

/* ============================================
   DOCUMENT CAROUSEL
   ============================================ */
.doc-carousel {
    overflow-y: auto;
    border-top: 2px solid black;
    width: 100%;
    height: 480px;
    scroll-snap-type: y mandatory;
    display: grid;
    grid-template-columns: repeat(var(--doc-carousel-cols, 2), 1fr);
    align-content: start;
    /* Soft edge fade on top/bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

.doc-carousel__item {
    padding: 12px;
    scroll-snap-align: start;
}

/* ============================================
   DOCUMENT FILTER
   ============================================ */
.doc-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-top: 2px solid black;
    border-bottom: 2px solid black;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.doc-filter-dropdowns {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
}

.doc-filter-search {
    position: relative;
    display: flex;
    align-items: center;
}

.doc-filter-search__icon {
    position: absolute;
    left: 8px;
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.doc-filter-search__input {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 5px 24px 5px 26px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: white;
    outline: none;
    width: 160px;
    transition: none;
}

.doc-filter-search__input:focus {
    border-color: black;
    box-shadow: 2px 2px 0 black;
}

.doc-filter-search__input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.doc-filter-search__clear {
    position: absolute;
    right: 6px;
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.doc-filter-search__clear:hover {
    color: black;
}

.doc-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--primary);
    color: white;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    border-radius: 8px;
}

.doc-filter-empty {
    padding: 32px;
    text-align: center;
    border-top: 2px solid black;
}

/* Status badges */
.status-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border: 1px solid black;
    border-radius: 0;
    display: inline-block;
}

.status-badge--ready {
    background: var(--accent);
    color: black;
    border-color: black;
}

.status-badge--processing {
    background: var(--volt-yellow);
    color: black;
    border-color: black;
}

.status-badge--error {
    background: var(--secondary);
    color: white;
    border-color: black;
}

/* ============================================
   TOM / AI MESSAGE BLOCK
   ============================================ */
.tom-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8f8f8;
    border-left: 4px solid black;
}

.tom-message__avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid black;
}

.tom-message__text {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    font-weight: 500;
    padding-top: 6px;
}

/* ============================================
   INFO LABEL/VALUE PAIRS
   ============================================ */
.info-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.info-value {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid black;
    padding: 2px 8px;
    background: white;
    display: inline-block;
}

/* ============================================
   SOURCE CARD (WATCHER SOURCES)
   ============================================ */
.source-card {
    padding: 16px;
    border: 2px solid black;
    background: white;
    text-align: left;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.source-card:hover {
    border-color: var(--primary);
    box-shadow: 4px 4px 0 var(--primary);
}

.source-card:hover .source-card__type {
    color: var(--secondary);
}

.source-card__logo {
    height: 32px;
    object-fit: contain;
    transition: filter 0.2s ease;
}

.source-card:hover .source-card__logo {
    filter: none;
}

.source-card__type {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.source-card__desc {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #6b7280;
    margin-top: 4px;
}

/* ============================================
   ORGANIZATION DATA CARD
   ============================================ */
.org-card-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.org-card-field:last-child {
    border-bottom: none;
}

.org-card-key {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.org-card-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
}

.org-analysis-text {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
    overflow-y: auto;
    max-height: 480px;
}

.org-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-bottom: none;
    gap: 12px;
}

.org-status-bar--ready {
    border-color: var(--primary);
    background: rgba(0, 255, 179, 0.04);
}

.org-status-bar--in-progress {
    border-color: var(--volt-yellow);
    background: rgba(255, 214, 10, 0.04);
}

.org-status-bar--error {
    border-color: var(--secondary);
    background: rgba(255, 51, 102, 0.04);
}

.org-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.org-status-dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    flex-shrink: 0;
}

/* ============================================
   KPI BLOCK — Dashboard v2 Cards
   ============================================ */
.kpi-block {
    background: white;
    border: 2px solid var(--primary);
    box-shadow: 5px 5px 0 var(--primary);
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.kpi-block:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--primary);
}

.kpi-block:active {
    transform: translate(1px, 1px);
    box-shadow: 3px 3px 0 var(--primary);
}

/* Colored top accent bar */
.kpi-block__accent {
    height: 5px;
    background: var(--kpi-color, var(--primary));
    flex-shrink: 0;
}

.kpi-block__inner {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header row: tag + optional date/badge */
.kpi-block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.kpi-block__tag {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
}

.kpi-block__meta {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Giant number */
.kpi-block__num {
    font-family: var(--font-mono);
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    letter-spacing: -0.04em;
}

.kpi-block__num-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Mini progress bar */
.kpi-block__bar {
    height: 3px;
    background: var(--border);
    margin-top: 14px;
    overflow: hidden;
}

.kpi-block__bar-fill {
    height: 100%;
    background: var(--kpi-color, var(--primary));
}

/* Sub-metrics — 3-column grid */
.kpi-block__metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.kpi-block__metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 8px;
    border-right: 1px solid var(--border);
}

.kpi-block__metric:last-child {
    border-right: none;
}

.kpi-block__metric-val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.kpi-block__metric-key {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-align: center;
}

/* Sub-metrics — 2-column variant */
.kpi-block__metrics--2col {
    grid-template-columns: repeat(2, 1fr);
}

/* Last project snippet */
.kpi-block__sub {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-block__sub-label {
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 3px;
}

.kpi-block__sub-val {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Dark variant (Forfaits) ── */
.kpi-block--dark {
    background: var(--primary);
}

.kpi-block--dark .kpi-block__tag {
    color: rgba(255, 255, 255, 0.55);
}

.kpi-block--dark .kpi-block__num {
    color: white;
}

.kpi-block--dark .kpi-block__num-label,
.kpi-block--dark .kpi-block__meta {
    color: rgba(255, 255, 255, 0.4);
}

.kpi-block--dark .kpi-block__bar {
    background: rgba(255, 255, 255, 0.1);
}

.kpi-block--dark .kpi-block__metrics {
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-block--dark .kpi-block__metric {
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-block--dark .kpi-block__metric-key {
    color: rgba(255, 255, 255, 0.35);
}

.kpi-block--dark .kpi-block__sub {
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-block--dark .kpi-block__sub-label {
    color: rgba(255, 255, 255, 0.3);
}

.kpi-block--dark .kpi-block__sub-val {
    color: rgba(255, 255, 255, 0.8);
}

.kpi-block--dark:hover {
    box-shadow: 7px 7px 0 var(--volt-yellow);
}

/* ============================================
   MD-CONTENT — rendered markdown/HTML content
   ============================================ */

.md-content {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}

.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6 {
    font-family: var(--font-mono);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--primary);
    margin: 1.4em 0 0.5em;
    line-height: 1.2;
}

.md-content h1 { font-size: 1.3rem; border-bottom: 3px solid var(--primary); padding-bottom: 4px; }
.md-content h2 { font-size: 1.1rem; border-bottom: 2px solid var(--primary); padding-bottom: 3px; }
.md-content h3 { font-size: 0.95rem; }
.md-content h4,
.md-content h5,
.md-content h6 { font-size: 0.85rem; }

.md-content p {
    margin: 0 0 0.9em;
}

.md-content ul,
.md-content ol {
    margin: 0.5em 0 0.9em 1.4em;
    padding: 0;
}

.md-content ul {
    list-style: none;
}

.md-content ul > li {
    position: relative;
    padding-left: 1.1em;
}

.md-content ul > li::before {
    content: "—";
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--secondary);
}

.md-content ol {
    list-style: decimal;
}

.md-content ol > li {
    padding-left: 0.3em;
}

.md-content li {
    margin-bottom: 0.3em;
    line-height: 1.6;
}

.md-content strong,
.md-content b {
    font-weight: 800;
    color: var(--primary);
}

.md-content em,
.md-content i {
    font-style: italic;
}

.md-content code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--primary);
    color: var(--accent);
    padding: 1px 5px;
    border: 1px solid var(--primary);
}

.md-content pre {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--primary);
    color: var(--accent);
    border: 2px solid var(--primary);
    padding: 12px 14px;
    overflow-x: auto;
    margin: 0.8em 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.md-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.md-content blockquote {
    border-left: 4px solid var(--secondary);
    margin: 0.8em 0;
    padding: 6px 14px;
    background: var(--surface);
    font-style: italic;
    color: var(--text-muted);
}

.md-content a {
    color: var(--secondary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.md-content a:hover {
    color: var(--primary);
}

.md-content hr {
    border: none;
    border-top: 2px solid var(--primary);
    margin: 1.2em 0;
}

.md-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
    margin: 0.8em 0;
}

.md-content th {
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75em;
    background: var(--primary);
    color: #fff;
    padding: 6px 10px;
    text-align: left;
    border: 1px solid var(--primary);
}

.md-content td {
    padding: 6px 10px;
    border: 1px solid var(--primary);
    vertical-align: top;
}

.md-content tr:nth-child(even) td {
    background: var(--surface);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .drawer,
    .modal-overlay,
    .drawer-overlay,
    .chat-drawer,
    .chat-drawer-overlay,
    .chat-widget-button {
        display: none !important;
    }
}

/* ============================================
   PROJECTS SPA — BEM Components
   ============================================ */

/* --- SPA Tab Bar --- */
.projects-tab-bar {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    border-bottom: 2px solid var(--primary);
    padding: 0 16px;
    background: var(--surface);
    overflow-x: auto;
    scrollbar-width: none;
}

.projects-tab-bar::-webkit-scrollbar {
    display: none;
}

.projects-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
    border: 2px solid transparent;
    border-bottom: none;
    cursor: pointer;
    color: var(--text-muted);
    white-space: nowrap;
    transition: none;
    position: relative;
    bottom: -2px;
}

.projects-tab:hover {
    background: var(--surface);
    color: var(--primary);
}

.projects-tab--active {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
    border-bottom-color: white;
}

.projects-tab__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid currentColor;
    opacity: 0.5;
}

.projects-tab__close:hover {
    opacity: 1;
    background: var(--primary);
    color: white;
}

/* --- Project Detail Header --- */
.project-header {
    background: white;
    border-bottom: 2px solid var(--primary);
    padding: 16px 24px 0;
}

.project-header__title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.project-header__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-header__doc-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.project-header__tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    margin-top: 8px;
}

/* --- Project Nav Tabs --- */
.project-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: none;
    cursor: pointer;
}

.project-nav-tab:hover {
    color: var(--primary);
    background: var(--surface);
}

.project-nav-tab--active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
    background: transparent;
}

/* --- Project Action Items --- */
.project-action-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--border);
    background: white;
    cursor: default;
    transition: none;
}

.project-action-item--done {
    cursor: pointer;
    border-left: 4px solid var(--matrix-green);
}

.project-action-item--done:hover {
    background: var(--surface);
    box-shadow: 3px 3px 0 var(--primary);
}

.project-action-item--running {
    border-left: 4px solid var(--volt-yellow);
}

.project-action-item__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.project-action-item__label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary);
}

/* --- Project Artefact Items --- */
.project-artefact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 2px solid var(--border);
    background: white;
    cursor: pointer;
    gap: 10px;
}

.project-artefact-item:hover {
    background: var(--surface);
    box-shadow: 3px 3px 0 var(--primary);
}

.project-artefact-item__info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.project-artefact-item__name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-artefact-item__delete {
    flex-shrink: 0;
    padding: 4px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
}

.project-artefact-item__delete:hover {
    color: var(--secondary);
    background: var(--surface);
}

/* --- FAB Chat Button --- */
.project-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 100;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 4px 4px 0 var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.project-fab:hover {
    background: var(--secondary);
    box-shadow: 4px 4px 0 var(--primary);
}

.project-fab:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--secondary);
}

/* =============================================
   PROJECT HOME — IDENTITY CARD
   ============================================= */

.proj-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.proj-id-card {
    background: white;
    border: 2px solid var(--primary);
    box-shadow: 4px 4px 0 var(--primary);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.proj-id-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.proj-id-card__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 40px;
    align-items: flex-start;
    flex: 1;
}

.proj-id-card__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-self: flex-start;
}

.proj-id-card__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}

.proj-id-card__field--lg {
    min-width: 160px;
}

.proj-id-card__field--full {
    flex-basis: 100%;
}

.proj-id-card__label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.proj-id-card__value {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.proj-id-card__value--muted {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.proj-id-card__desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 2px;
}

.proj-id-card__divider {
    width: 2px;
    background: var(--border);
    align-self: stretch;
    flex-shrink: 0;
    margin: 4px 0;
}

/* =============================================
   PROJECT HOME — MAIN LAYOUT GRID
   ============================================= */

.proj-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.proj-layout__actions {
    display: flex;
    flex-direction: column;
}

@media (max-width: 960px) {
    .proj-layout {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   PROJECT HOME — ACTION PIPELINE
   ============================================= */

.action-pipeline {
    display: flex;
    flex-direction: column;
}

.action-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-top: none;
    background: white;
    cursor: default;
    transition: none;
}

.action-step:first-child {
    border-top: 2px solid var(--border);
}

.action-step--done {
    cursor: pointer;
    border-left: 4px solid var(--matrix-green);
}

.action-step--done:hover {
    background: var(--surface);
    box-shadow: 3px 3px 0 var(--primary);
    position: relative;
    z-index: 1;
}

.action-step--running {
    border-left: 4px solid var(--volt-yellow);
    background: rgba(255, 230, 0, 0.04);
}

.action-step--failed {
    border-left: 4px solid var(--secondary);
}

.action-step--waiting {
    border-left: 4px solid var(--electric-blue);
    cursor: pointer;
}

.action-step--waiting:hover {
    background: var(--surface);
    position: relative;
    z-index: 1;
}

.action-step__num {
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}

.action-step--done   .action-step__num { background: var(--matrix-green); }
.action-step--running .action-step__num { background: var(--volt-yellow); color: var(--primary); }
.action-step--failed  .action-step__num { background: var(--secondary); }
.action-step--waiting .action-step__num { background: var(--electric-blue); }

.action-step__label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex: 1;
    color: var(--primary);
}

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

.action-step__dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.action-step__dot--empty   { border: 2px solid var(--border); background: transparent; }
.action-step__dot--done    { background: var(--matrix-green); }
.action-step__dot--failed  { background: var(--secondary); }

.action-step__dot--running {
    background: var(--volt-yellow);
    animation: proj-pulse 1s ease-in-out infinite;
}

.action-step__dot--waiting {
    background: var(--electric-blue);
    animation: proj-pulse 1.5s ease-in-out infinite;
}

@keyframes proj-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

.action-step__badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.action-step__badge--done    { color: var(--matrix-green); border-color: var(--matrix-green); }
.action-step__badge--running { color: #a89800; border-color: var(--volt-yellow); }
.action-step__badge--failed  { color: var(--secondary); border-color: var(--secondary); }
.action-step__badge--waiting { color: var(--electric-blue); border-color: var(--electric-blue); }

/* =============================================
   PROJECT HOME — ARTEFACT LIST
   ============================================= */

.project-artefact-list {
    display: flex;
    flex-direction: column;
}

.project-artefact-item__icon {
    width: 26px;
    height: 26px;
    background: var(--surface);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.proj-empty-state {
    padding: 32px 16px;
    text-align: center;
    border: 2px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =============================================
   BRUTALIST DRAWER
   ============================================= */

.action-drawer {
    background: white;
    border-left: 4px solid var(--primary);
    box-shadow: -8px 0 0 var(--primary);
    display: flex;
    flex-direction: column;
}

.action-drawer__header {
    background: var(--primary);
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.action-drawer__agent-badge {
    width: 36px;
    height: 36px;
    background: white;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid white;
}

.action-drawer__title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: white;
}

.action-drawer__subtitle {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    margin-top: 2px;
}

.action-drawer__loader {
    display: none;
}

.htmx-request .action-drawer__loader {
    display: flex;
    align-items: center;
}

.action-drawer__close {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: none;
}

.action-drawer__close:hover {
    background: white;
    color: var(--primary);
    border-color: white;
}

.action-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.action-drawer__footer {
    padding: 14px 20px;
    border-top: 2px solid var(--primary);
    background: var(--surface);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.action-drawer__placeholder {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.action-drawer__placeholder-bar {
    height: 12px;
    background: var(--border);
    animation: proj-pulse 1.2s ease-in-out infinite;
}

.action-drawer__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
/* =============================================
   SLIDE VIEWER — brutalist action result slides
   ============================================= */

.slide-viewer {
    border: 2px solid var(--border);
    background: white;
    position: relative;
    display: flex;
    flex-direction: column;
}

.slide-viewer__container {
    position: relative;
    height: 520px;
    flex-shrink: 0;
}

.slide-viewer__slides {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.slide-viewer__slide {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 20px 52px;
    display: flex;
    flex-direction: column;
}

.slide-viewer__slide-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.slide-viewer__nav {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    z-index: 10;
}

.slide-viewer__nav--left { left: 0; }
.slide-viewer__nav--right { right: 0; }

.slide-viewer__nav-btn {
    width: 36px;
    height: 72px;
    background: white;
    border: 2px solid var(--border);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: none;
}

.slide-viewer__nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.slide-viewer__nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: white;
    color: var(--border);
}

.slide-viewer__footer {
    height: 48px;
    border-top: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    flex-shrink: 0;
}

.slide-viewer__dot {
    width: 8px;
    height: 8px;
    background: var(--border);
    cursor: pointer;
    flex-shrink: 0;
}

.slide-viewer__dot--active {
    background: var(--primary);
}

/* =============================================
   SWOT grid for rfq synthesis
   ============================================= */

.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--border);
    flex: 1;
    overflow: auto;
}

.swot-cell {
    padding: 16px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.swot-cell:nth-child(even) { border-right: none; }
.swot-cell:nth-last-child(-n+2) { border-bottom: none; }

.swot-cell__label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.swot-cell--strengths .swot-cell__label   { color: #00A854; }
.swot-cell--weaknesses .swot-cell__label  { color: var(--secondary); }
.swot-cell--opportunities .swot-cell__label { color: #1565C0; }
.swot-cell--threats .swot-cell__label    { color: var(--accent); }

/* GO/NO GO badge */

.go-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    border: 4px solid;
    text-align: center;
}

.go-badge--go   { border-color: #00A854; background: rgba(0, 168, 84, 0.05); }
.go-badge--nogo { border-color: var(--secondary); background: rgba(220, 0, 50, 0.05); }

.go-badge__verdict {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.go-badge--go   .go-badge__verdict { color: #00A854; }
.go-badge--nogo .go-badge__verdict { color: var(--secondary); }

/* =============================================
   RESULT ACCORDION — brutalist accordion
   ============================================= */

.result-accordion {
    border: 2px solid var(--border);
}

.result-accordion__item {
    border-bottom: 2px solid var(--border);
}

.result-accordion__item:last-child {
    border-bottom: none;
}

.result-accordion__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface);
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text);
    transition: none;
    gap: 8px;
}

.result-accordion__trigger:hover {
    background: var(--primary);
    color: white;
}

.result-accordion__body {
    padding: 16px;
    border-top: 2px solid var(--border);
    background: white;
    display: none;
}

.result-accordion__body[x-show] {
    display: block;
}

.result-section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.06em;
    display: block;
}



/* Result tags */

.result-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.result-tag--filled   { background: var(--primary); border-color: var(--primary); color: white; }
.result-tag--primary  { border-color: var(--primary); color: var(--primary); background: transparent; }
.result-tag--secondary { border-color: var(--secondary); color: var(--secondary); background: transparent; }
.result-tag--accent   { border-color: var(--accent); color: var(--accent); background: transparent; }
.result-tag--muted    { border-color: var(--border); color: var(--text-muted); background: transparent; }

/* Result table */

.result-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid var(--border);
}

.result-table th {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    text-align: left;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.result-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 12px;
    vertical-align: top;
}

.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: var(--surface); }

/* ============================================
   FOLDER CARD
   ============================================ */

.doc-card-folder {
    position: relative;
    background: white;
    border: 2px solid black;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    gap: 10px;
    cursor: pointer;
    min-height: 140px;
    user-select: none;
    transition: none;
}

.doc-card-folder:hover {
    box-shadow: 4px 4px 0 black;
    background: var(--surface);
}

.doc-card-folder__icon {
    color: var(--secondary);
}

.doc-card-folder__icon svg {
    width: 40px;
    height: 40px;
}

.doc-card-folder__name {
    font-family: monospace;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    word-break: break-word;
    line-height: 1.4;
}

.doc-card-folder__hint {
    font-family: monospace;
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-card-folder__actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
}

.doc-card-folder:hover .doc-card-folder__actions {
    opacity: 1;
}

/* ============================================
   FOLDER NAVIGATION BAR
   ============================================ */

.doc-folder-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 12px;
    margin-bottom: 8px;
    border-bottom: 2px solid black;
}

.doc-folder-nav__back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: none;
    border: 2px solid black;
    padding: 4px 10px;
    cursor: pointer;
    transition: none;
}

.doc-folder-nav__back:hover {
    background: black;
    color: white;
}

.doc-folder-nav__name {
    font-family: monospace;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

/* ============================================
   FOLDER MOVE MODAL
   ============================================ */

.folder-move-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-move-option {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    font-family: monospace;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    border-bottom: 1px solid var(--border);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: none;
}

.folder-move-option:hover {
    background: var(--surface);
}

/* ============================================
   RESPONSIVE TABLE GRIDS
   ============================================ */

/* AT table grid — ESN sector (TJM column) */
.at-table-grid--esn {
    grid-template-columns: 40px 2fr 80px 100px 90px 90px 1fr 80px 160px 70px 100px;
    gap: 8px;
    align-items: center;
}

/* AT table grid — HR sector (Type column, no TJM) */
.at-table-grid--hr {
    grid-template-columns: 40px 2fr 90px 80px 90px 90px 1fr 80px 160px 70px 100px;
    gap: 8px;
    align-items: center;
}

/* Staff table grid */
.staff-table-grid {
    grid-template-columns: 40px 60px 2fr 80px 100px 120px 120px 1fr 110px 150px 70px 60px 110px;
    gap: 12px;
    align-items: center;
}

/*
 * Column visibility helpers:
 *   col-hide-xl  — hidden at ≤1600px (staff Owner, Src, Date)
 *   col-hide-md  — hidden at ≤1280px (AT Owner/Date, Staff Groups)
 */

/* ≤1600px: Staff secondary columns (Owner + Src + Date) disappear, Actions shrinks */
@media (max-width: 1600px) {
    .staff-table-grid {
        grid-template-columns: 40px 60px 2fr 80px 100px 120px 120px 1fr 110px 120px;
    }
    .col-hide-xl {
        display: none !important;
    }
}

/* ≤1280px: AT secondary (Owner + Date) disappear, Actions shrinks;
             Staff Groups also disappears */
@media (max-width: 1280px) {
    .at-table-grid--esn {
        grid-template-columns: 40px 2fr 80px 100px 90px 90px 1fr 80px 130px;
    }
    .at-table-grid--hr {
        grid-template-columns: 40px 2fr 90px 80px 90px 90px 1fr 80px 130px;
    }
    .staff-table-grid {
        grid-template-columns: 40px 60px 2fr 80px 100px 120px 1fr 110px 120px;
    }
    .col-hide-md {
        display: none !important;
    }
}

/* Filter bar wraps at smaller viewports */
@media (max-width: 1280px) {
    .filter-inline-bar {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .filter-inline-form {
        flex: 1 1 100%;
    }
}

.folder-move-option:last-child {
    border-bottom: none;
}
