/* ==========================================================================
   CORR360 — CONSOLE SOUVERAINE DE FORENSIQUE & RENSEIGNEMENT JUDICIAIRE
   Police360 (Enquête Opérationnelle) & Justice360 (Poursuites Judiciaires)
   République Démocratique du Congo • Ministère de la Justice • PNC / DCI
   ========================================================================== */

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

:root {
    color-scheme: dark;

    /* Base Palette */
    --bg-base: #070a12;
    --bg-surface: #0c1220;
    --bg-card: rgba(13, 20, 36, 0.85);
    --bg-card-hover: rgba(20, 30, 52, 0.92);
    --bg-input: #080d17;
    --bg-glass-elevated: rgba(15, 23, 42, 0.9);

    /* Borders — subtle and uniform */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-focus: #3b82f6;
    --border-glow-blue: rgba(59, 130, 246, 0.25);
    --border-glow-gold: rgba(245, 158, 11, 0.25);

    /* Text Hierarchy */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* Single-purpose accents */
    --accent-blue: #3b82f6;
    --accent-cobalt: #3b82f6;
    --accent-cobalt-glow: rgba(59, 130, 246, 0.18);
    --accent-cyan: #0ea5e9;
    --accent-cyan-glow: rgba(14, 165, 233, 0.15);
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-purple-glow: rgba(168, 85, 247, 0.15);
    --accent-gold: #f59e0b;
    --accent-gold-bright: #fbbf24;
    --accent-gold-glow: rgba(245, 158, 11, 0.18);

    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.12);
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.12);
    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.12);
    --status-danger-glow: rgba(239, 68, 68, 0.2);

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

    /* Shadows — restrained */
    --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
    --shadow-modal: 0 20px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-screen.hidden {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 32px 32px;
    box-shadow: var(--shadow-elevated);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header svg {
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.login-field input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-cobalt-glow);
}

.login-error {
    font-size: 12px;
    color: var(--status-danger);
    background: var(--status-danger-bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.login-submit {
    width: 100%;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.login-submit:hover {
    background: #2563eb;
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 13, 23, 0.7);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Typography Utilities */
.mono {
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
}

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */

.top-nav {
    background: rgba(9, 14, 25, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.emblem-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-main {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-republic {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold-bright);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.06em;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Nav Search Bar */
.nav-search {
    flex: 1;
    max-width: 360px;
    min-width: 160px;
    margin: 0 16px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.search-kbd {
    position: absolute;
    right: 12px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 1px 5px;
    border-radius: 4px;
    pointer-events: none;
}

.global-search-input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 40px 8px 34px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.global-search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-cobalt-glow);
}

.global-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(13, 20, 36, 0.97);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.global-search-results.visible {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background-color: var(--bg-card-hover);
}

/* Nav Actions Right */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.loom-identity-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 5px 10px;
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.loom-identity-selector:hover {
    border-color: rgba(168, 85, 247, 0.4);
}

.loom-role-select {
    background: transparent;
    border: none;
    color: #f3e8ff;
    font-size: 12px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

.loom-role-select option {
    background: #0f172a;
    color: #e2e8f0;
}

.mode-toggle {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 2px;
    flex-shrink: 0;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
}

.case-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.case-select option {
    background: #0f172a;
    color: #e2e8f0;
}

.case-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-cobalt-glow);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
    border: 1px solid transparent;
}

.btn-action.btn-gold {
    background: rgba(245, 158, 11, 0.14);
    color: var(--accent-gold-bright);
    border-color: rgba(245, 158, 11, 0.25);
}
.btn-action.btn-gold:hover {
    background: rgba(245, 158, 11, 0.22);
}

.btn-action.btn-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}
.btn-action.btn-emerald:hover {
    background: rgba(16, 185, 129, 0.2);
}

.btn-action.btn-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.25);
}
.btn-action.btn-blue:hover {
    background: rgba(59, 130, 246, 0.2);
}

.btn-action.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}
.btn-action.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   MAIN CONTAINER LAYOUT & CASE COMMAND DECK
   ========================================================================== */

.main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 24px 32px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    gap: 16px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Case Command Banner */
.case-command-banner {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.banner-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.banner-case-identity {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.banner-meta-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-case-id {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.02em;
}

.badge-classification {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--status-danger-bg);
    color: #fca5a5;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.04em;
}

.badge-legal-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--status-success-bg);
    color: #34d399;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.04em;
}

.banner-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.banner-jurisdiction-sub {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.banner-jurisdiction-sub strong {
    color: var(--text-primary);
}

.banner-actions-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   PROCEDURAL STEPPER
   ========================================================================== */

.stepper-integrated-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 11, 20, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    box-sizing: border-box;
}

.stepper-integrated-bar::-webkit-scrollbar {
    display: none;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
    border: 1px solid transparent;
    flex: 1;
    min-width: 90px;
}

.workflow-step:hover {
    background: rgba(59, 130, 246, 0.06);
}

.workflow-step.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
}

.workflow-step.completed {
    background: rgba(16, 185, 129, 0.06);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.workflow-step.active .step-num {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
}

.workflow-step.completed .step-num {
    background: var(--status-success);
    border-color: var(--status-success);
    color: #ffffff;
}

.step-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.workflow-step.active .step-title {
    color: #60a5fa;
}

.step-desc {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 11px;
    opacity: 0.35;
    flex-shrink: 0;
}

/* ==========================================================================
   TELEMETRY KPI STRIP
   ========================================================================== */

.banner-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 1200px) {
    .banner-telemetry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.telemetry-tile {
    background: rgba(11, 16, 29, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background 0.15s ease;
}

.telemetry-tile:hover {
    background: rgba(16, 24, 44, 0.7);
}

.telemetry-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.telemetry-val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    margin-top: 4px;
    line-height: 1.2;
}

.telemetry-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Threat Score Tile */
.telemetry-tile.threat-tile {
    border-color: rgba(239, 68, 68, 0.2);
}

.threat-val {
    color: var(--status-danger);
}

.threat-beacon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-danger);
    display: inline-block;
    /* ponytail: static dot, add subtle pulse only if ops requests it */
}

/* Keep keyframe for backwards compat but make it very subtle */
@keyframes threatPulse {
    0%   { opacity: 0.7; }
    50%  { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Banner Sub-Toolbar */
.banner-sub-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */

.tabs-nav {
    display: flex;
    gap: 2px;
    background: rgba(9, 14, 26, 0.8);
    border: 1px solid var(--border-subtle);
    padding: 4px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.tab-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    border-bottom-color: var(--accent-blue);
}

.tab-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.tab-btn.active .tab-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Tab Panels */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeInTab 0.2s ease-out;
}

.tab-content.active {
    display: flex;
}

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

/* ==========================================================================
   STUDIO CARDS, PANELS & DATA PRESENTATION
   ========================================================================== */

.studio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}

.studio-card-header {
    padding: 16px 20px;
    border-left: 3px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.studio-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Domain Filter Pills */
.domain-pill {
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
    user-select: none;
}

.domain-pill:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: var(--accent-blue) !important;
    color: #ffffff !important;
}

.domain-pill.active {
    background: rgba(59, 130, 246, 0.18) !important;
    border-color: var(--accent-blue) !important;
    color: #ffffff !important;
}

/* Suspect Cards Grid */
.person-overview-card {
    background: rgba(11, 16, 29, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.person-overview-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium) !important;
}

/* ==========================================================================
   TABLES & LISTS
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
}

.forensic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.forensic-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.forensic-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    min-height: 44px;
}

.forensic-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-purple {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
}

.badge-emerald {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.badge-rose {
    background: var(--status-danger-bg);
    color: #fca5a5;
}

/* Telemetry color utilities */
.text-purple { color: var(--accent-purple); }
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--status-success); }
.text-amber { color: var(--status-warning); }
.text-gold { color: var(--accent-gold-bright); }
.telemetry-unit { font-size: 13px; color: var(--text-muted); }
.threat-sub { color: #fca5a5; }

/* Nav button compact variant */
.btn-nav {
    padding: 7px 12px;
    font-size: 12px;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: var(--text-secondary);
    border-color: transparent;
    padding: 7px 8px;
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ==========================================================================
   NETWORK CANVAS & MAP
   ========================================================================== */

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    background: #070b14;
}

#network-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#network-canvas:active {
    cursor: grabbing;
}

.canvas-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.canvas-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.canvas-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
}

/* Cell Tower Map View */
.map-wrapper {
    width: 100%;
    height: 380px;
    background: #080d17;
    position: relative;
}

#leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-backdrop.open {
    display: flex;
}

.modal-window {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 650px;
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.15s;
}

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

.modal-body {
    padding: 24px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 440px;
    animation: toastSlideIn 0.25s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-success { border-left: 3px solid var(--status-success); }
.toast.toast-warning { border-left: 3px solid var(--status-warning); }
.toast.toast-danger  { border-left: 3px solid var(--status-danger); }
.toast.toast-info    { border-left: 3px solid var(--accent-blue); }

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

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
    background: rgba(9, 14, 25, 0.95);
    border-top: 1px solid var(--border-subtle);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-success);
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1400px) {
    .brand-sub {
        display: none;
    }
    .banner-telemetry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .nav-search {
        max-width: 200px;
    }
    .case-select {
        max-width: 160px;
    }
    .banner-actions-cluster {
        margin-top: 4px;
    }
}

@media (max-width: 992px) {
    .top-nav {
        flex-wrap: wrap;
        padding: 8px 12px;
        height: auto;
    }
    .nav-search {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 6px 0 0;
    }
    .banner-telemetry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .top-nav, .tabs-nav, .domain-pill, .btn-primary, .btn-action, .canvas-controls {
        display: none !important;
    }
    #tab-person {
        display: block !important;
        background: #fff !important;
        color: #000 !important;
    }
}
