/* ═══════════════════════════════════════════════════════════
   SENTINEL-KYC — Design System for Financial Services
   
   Palette: Deep Navy + Clean White + Trust Blue
   Typography: Inter + Plus Jakarta Sans
   Aesthetic: Premium fintech — clean, spacious, trustworthy
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
    /* Primary — Deep Navy (trust, authority) */
    --navy-900: #0c1222;
    --navy-800: #0f172a;
    --navy-700: #1e293b;
    --navy-600: #334155;
    --navy-500: #475569;

    /* Accent — Electric Blue (modern tech, action) */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --accent-subtle: #eff6ff;

    /* Indigo accent for premium feel */
    --indigo: #6366f1;
    --indigo-light: #e0e7ff;

    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-bg: #fef2f2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;

    /* Neutrals — Slate */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Surfaces */
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --surface-raised: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Typography */
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
    --duration-slow: 350ms;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--gray-800);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-900);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}
a:hover { color: var(--accent-hover); }

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: inherit;
    transition: all var(--duration) var(--ease);
}

input, textarea, select {
    font-family: var(--font-body);
    font-size: inherit;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }


/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--navy-800);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--duration-slow) var(--ease);
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.logo-icon svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.logo-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 16px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: var(--accent);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--duration) var(--ease);
    cursor: pointer;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
}


/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--duration-slow) var(--ease);
}


/* ═══════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════ */

.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
}
.menu-toggle:hover { background: var(--gray-100); color: var(--gray-700); }

.breadcrumb {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--gray-900);
}

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

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

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    width: 260px;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 0.85rem;
    transition: all var(--duration) var(--ease);
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    width: 320px;
}

.search-box input::placeholder { color: var(--gray-400); }

.topbar-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    position: relative;
}
.topbar-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.topbar-btn svg { width: 20px; height: 20px; }

.notification-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--success-bg);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--success);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}


/* ═══════════════════════════════════════
   PAGES
   ═══════════════════════════════════════ */

.page {
    display: none;
    padding: 28px;
    animation: fadeIn 0.3s var(--ease);
}

.page.active { display: block; }

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

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
}


/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
}
.card-link:hover { color: var(--accent-hover); }


/* ═══════════════════════════════════════
   METRICS ROW (Dashboard)
   ═══════════════════════════════════════ */

.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
}

.metric-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-icon svg { width: 18px; height: 18px; }
.metric-icon.blue { background: var(--accent-light); color: var(--accent); }
.metric-icon.green { background: var(--success-light); color: var(--success); }
.metric-icon.amber { background: var(--warning-light); color: var(--warning); }
.metric-icon.red { background: var(--danger-light); color: var(--danger); }

.metric-value {
    margin-bottom: 8px;
}

.metric-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}
.metric-change.positive { color: var(--success); }
.metric-change.negative { color: var(--danger); }

.metric-subtext {
    font-size: 0.78rem;
    color: var(--gray-500);
}


/* ═══════════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════════ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 18px;
}

/* Chart */
.chart-card { grid-column: 1; }
.chart-container {
    padding: 16px 22px 20px;
    height: 220px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--gray-500);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.legend-dot.approved { background: var(--success); }
.legend-dot.escalated { background: var(--warning); }
.legend-dot.rejected { background: var(--danger); }

/* Distribution Ring */
.distribution-card { grid-column: 2; grid-row: 1; }

.distribution-ring-container {
    display: flex;
    justify-content: center;
    padding: 20px 0 12px;
}

.distribution-ring {
    position: relative;
    width: 130px;
    height: 130px;
}

.distribution-ring svg {
    width: 100%;
    height: 100%;
}

.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
}

.ring-label {
    font-size: 0.72rem;
    color: var(--gray-500);
    font-weight: 600;
}

.distribution-list {
    padding: 4px 22px 20px;
}

.dist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
}

.dist-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dist-dot.approved { background: var(--success); }
.dist-dot.escalated { background: var(--warning); }
.dist-dot.rejected { background: var(--danger); }

.dist-label { flex: 1; color: var(--gray-600); }
.dist-value { font-weight: 700; color: var(--gray-800); width: 36px; text-align: right; }
.dist-pct { color: var(--gray-400); font-size: 0.78rem; width: 44px; text-align: right; }

/* Recent Escalations */
.recent-card { grid-column: 1; }
.recent-list { padding: 12px 22px 16px; }

.recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.recent-item:last-child { border-bottom: none; }
.recent-item:hover { padding-left: 4px; }

.recent-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }
.recent-name { font-weight: 600; color: var(--gray-800); font-size: 0.9rem; }
.recent-detail { color: var(--gray-500); font-size: 0.78rem; margin-top: 1px; }

.recent-right { text-align: right; flex-shrink: 0; }
.recent-score { font-weight: 700; font-size: 0.9rem; }
.recent-score.low { color: var(--danger); }
.recent-score.medium { color: var(--warning); }
.recent-score.high { color: var(--success); }
.recent-time { color: var(--gray-400); font-size: 0.72rem; margin-top: 2px; }

/* Agent Performance */
.agents-card { grid-column: 2; }
.agent-perf-list { padding: 16px 22px 20px; }

.agent-perf-item {
    margin-bottom: 16px;
}
.agent-perf-item:last-child { margin-bottom: 0; }

.agent-perf-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.agent-perf-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
}

.agent-perf-status {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.agent-perf-status.online { background: var(--success-bg); color: var(--success); }
.agent-perf-status.offline { background: var(--danger-bg); color: var(--danger); }

.agent-perf-bar-wrap {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.agent-perf-bar {
    height: 100%;
    width: var(--pct);
    background: linear-gradient(90deg, var(--accent), var(--indigo));
    border-radius: 3px;
    transition: width 1s var(--ease);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.agent-perf-bar span { display: none; }

.agent-perf-detail {
    font-size: 0.72rem;
    color: var(--gray-400);
}


/* ═══════════════════════════════════════
   FILTER & PAGE ACTIONS
   ═══════════════════════════════════════ */

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}

.filter-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.filter-count {
    font-size: 0.72rem;
    opacity: 0.8;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
}
.export-btn:hover { background: var(--accent-hover); }


/* ═══════════════════════════════════════
   QUEUE LIST
   ═══════════════════════════════════════ */

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

.queue-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-xs);
}

.queue-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateX(4px);
}

.queue-item.high { border-left: 4px solid var(--danger); }
.queue-item.medium { border-left: 4px solid var(--warning); }
.queue-item.low { border-left: 4px solid var(--info); }

.queue-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gray-100), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    flex-shrink: 0;
}

.queue-info { flex: 1; min-width: 0; }
.queue-name { font-weight: 700; color: var(--gray-900); font-size: 0.95rem; }
.queue-meta { color: var(--gray-500); font-size: 0.78rem; margin-top: 2px; display: flex; gap: 16px; flex-wrap: wrap; }

.queue-badges { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge.high { background: var(--danger-light); color: var(--danger); }
.badge.medium { background: var(--warning-light); color: #b45309; }
.badge.low { background: var(--info-light); color: var(--info); }
.badge.deepfake { background: #fce7f3; color: #be185d; }
.badge.geo { background: #fef3c7; color: #92400e; }
.badge.document { background: #e0e7ff; color: var(--indigo); }
.badge.nik { background: var(--danger-light); color: var(--danger); }
.badge.syndicate { background: #fee2e2; color: #991b1b; }

.queue-score {
    text-align: right;
    flex-shrink: 0;
    min-width: 60px;
}

.queue-score-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
}
.queue-score-value.low { color: var(--danger); }
.queue-score-value.medium { color: var(--warning); }
.queue-score-label { font-size: 0.68rem; color: var(--gray-400); }

.queue-time { font-size: 0.72rem; color: var(--gray-400); flex-shrink: 0; text-align: right; min-width: 70px; }


/* ═══════════════════════════════════════
   CASE DETAIL
   ═══════════════════════════════════════ */

.case-detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 22px;
    align-items: start;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 6px 0;
}
.back-btn:hover { color: var(--accent); }

/* Case Header */
.case-header-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.case-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.case-id-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.case-id {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.case-risk-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.case-risk-badge.high { background: var(--danger-light); color: var(--danger); }
.case-risk-badge.medium { background: var(--warning-light); color: #b45309; }
.case-risk-badge.low { background: var(--info-light); color: var(--info); }

.case-timer {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--warning);
    font-weight: 600;
}

.case-subject {
    display: flex;
    align-items: center;
    gap: 16px;
}

.case-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), var(--indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.case-subject-info h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.case-subject-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--gray-500);
}

.case-subject-meta strong { color: var(--gray-600); }

/* XAI Card */
.xai-card .card-header { padding-bottom: 0; }

.xai-content {
    padding: 16px 22px 20px;
}

.xai-summary {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.xai-summary p { margin-bottom: 8px; }
.xai-summary p:last-child { margin-bottom: 0; }
.xai-summary strong { color: var(--gray-900); }

.xai-recommendation {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--warning-bg);
    border: 1px solid var(--warning-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.recommendation-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.recommendation-icon svg { width: 18px; height: 18px; }
.recommendation-icon.amber { background: var(--warning-light); color: var(--warning); }

/* Signals */
.signals-card .card-header { padding-bottom: 0; }

.signals-grid {
    padding: 16px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.signal-item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}

.signal-item:hover { box-shadow: var(--shadow-sm); }
.signal-item.ok { border-left: 3px solid var(--success); }
.signal-item.warning { border-left: 3px solid var(--warning); background: var(--warning-bg); }
.signal-item.danger { border-left: 3px solid var(--danger); background: var(--danger-bg); }

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.signal-name { font-weight: 700; font-size: 0.9rem; color: var(--gray-800); }

.signal-score {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
}

.signal-item.ok .signal-score { color: var(--success); }
.signal-item.warning .signal-score { color: var(--warning); }
.signal-item.danger .signal-score { color: var(--danger); }

.signal-bar {
    height: 5px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.signal-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.8s var(--ease);
}
.signal-fill.warning { background: var(--warning); }
.signal-fill.danger { background: var(--danger); }

.signal-detail {
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.signal-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-right: 6px;
}
.signal-badge.ok { background: var(--success-light); color: var(--success); }
.signal-badge.warning { background: var(--warning-light); color: #92400e; }
.signal-badge.danger { background: var(--danger-light); color: var(--danger); }

.signal-evidence {
    margin-top: 12px;
}

.evidence-thumb {
    width: 200px;
    height: 120px;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.evidence-thumb.heatmap {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.15) 0%, 
        rgba(245, 158, 11, 0.3) 30%, 
        rgba(59, 130, 246, 0.15) 60%,
        rgba(239, 68, 68, 0.4) 80%
    );
    border: 1px solid var(--border);
}

.evidence-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
}


/* ═══════════════════════════════════════
   AUDIT TIMELINE
   ═══════════════════════════════════════ */

.audit-card .card-header { padding-bottom: 0; }

.audit-timeline {
    padding: 16px 22px 20px;
}

.timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 20px;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--gray-200);
    position: relative;
    z-index: 1;
}
.timeline-dot.blue { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.timeline-dot.green { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-dot.amber { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-dot.red { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }

.timeline-dot.pulse {
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--accent-light); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15); }
}

.timeline-content { flex: 1; }

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.timeline-agent {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-800);
}

.timeline-time {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--gray-400);
}

.timeline-content p {
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.timeline-item.pending .timeline-content p {
    color: var(--accent);
    font-weight: 600;
}

.text-amber { color: var(--warning) !important; }


/* ═══════════════════════════════════════
   CASE SIDEBAR (Right Panel)
   ═══════════════════════════════════════ */

.case-sidebar {
    position: sticky;
    top: calc(var(--topbar-height) + 28px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Score Ring */
.score-card .card-header { padding-bottom: 0; }

.score-ring-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.score-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-ring svg { width: 100%; height: 100%; }

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    display: block;
}
.score-number.green { color: var(--success); }
.score-number.amber { color: var(--warning); }
.score-number.red { color: var(--danger); }

.score-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 600;
}

.score-threshold {
    padding: 0 22px 20px;
}

.threshold-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.threshold-value {
    font-weight: 700;
    color: var(--gray-700);
}

.threshold-bar {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    position: relative;
}

.threshold-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--warning));
    border-radius: 3px;
    transition: width 1s var(--ease);
}

.threshold-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 14px;
    background: var(--gray-800);
    border-radius: 1px;
}

/* Decision Card */
.decision-card .card-header { padding-bottom: 0; }

.decision-actions {
    padding: 16px 22px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.decision-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all var(--duration) var(--ease);
}

.decision-btn svg { width: 18px; height: 18px; }

.decision-btn.approve {
    background: var(--success);
    color: #fff;
}
.decision-btn.approve:hover { background: #059669; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }

.decision-btn.request-info {
    background: var(--accent);
    color: #fff;
}
.decision-btn.request-info:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

.decision-btn.reject {
    background: var(--surface);
    color: var(--danger);
    border: 2px solid var(--danger-light);
}
.decision-btn.reject:hover { background: var(--danger-bg); border-color: var(--danger); }

.decision-notes {
    padding: 0 22px 20px;
}

.decision-notes label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.decision-notes textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    resize: vertical;
    font-size: 0.85rem;
    color: var(--gray-800);
    outline: none;
    transition: border-color var(--duration) var(--ease);
}

.decision-notes textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Quick Actions */
.quick-actions-card .card-header { padding-bottom: 0; }

.quick-actions {
    padding: 12px 22px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
    line-height: 1.3;
}

.quick-btn svg { width: 18px; height: 18px; color: var(--accent); }
.quick-btn:hover { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }


/* ═══════════════════════════════════════
   CASES TABLE
   ═══════════════════════════════════════ */

.cases-table-wrap {
    overflow-x: auto;
}

.cases-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cases-table thead {
    background: var(--gray-50);
}

.cases-table th {
    padding: 12px 18px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.cases-table td {
    padding: 14px 18px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--gray-700);
}

.cases-table tbody tr {
    transition: background var(--duration) var(--ease);
    cursor: pointer;
}

.cases-table tbody tr:hover { background: var(--gray-50); }
.cases-table tbody tr:last-child td { border-bottom: none; }

.table-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}
.table-status.approved { background: var(--success-bg); color: var(--success); }
.table-status.escalated { background: var(--warning-bg); color: #b45309; }
.table-status.rejected { background: var(--danger-bg); color: var(--danger); }
.table-status.processing { background: var(--accent-subtle); color: var(--accent); }

.table-score { font-family: var(--font-display); font-weight: 700; }

.table-decided-by {
    font-size: 0.78rem;
    color: var(--gray-500);
}
.table-decided-by.ai { color: var(--accent); font-weight: 600; }


/* ═══════════════════════════════════════
   ANALYTICS
   ═══════════════════════════════════════ */

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.analytics-large-card {
    grid-column: 1 / -1;
}

.analytics-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 24px 22px;
    text-align: center;
}

.analytics-big-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.big-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1;
}

.big-unit {
    font-size: 1rem;
    color: var(--gray-400);
    font-weight: 600;
    margin-top: 2px;
}

.big-label {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 6px;
    font-weight: 600;
}

/* Fraud Types */
.fraud-type-list {
    padding: 16px 22px 20px;
}

.fraud-type-item {
    margin-bottom: 16px;
}
.fraud-type-item:last-child { margin-bottom: 0; }

.fraud-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.fraud-name { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.fraud-count { font-size: 0.82rem; color: var(--gray-500); }

.fraud-bar-wrap {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.fraud-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), #f97316);
    border-radius: 3px;
    transition: width 1s var(--ease);
}

/* Hourly Chart */
.hourly-chart {
    padding: 16px 22px 20px;
}

.hourly-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 150px;
}

.hourly-bar {
    flex: 1;
    height: var(--h);
    background: linear-gradient(180deg, var(--accent), rgba(59, 130, 246, 0.4));
    border-radius: 4px 4px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    transition: all var(--duration) var(--ease);
    min-height: 20px;
}

.hourly-bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.03);
    transform-origin: bottom;
}

.hourly-bar.active {
    background: linear-gradient(180deg, var(--indigo), rgba(99, 102, 241, 0.5));
}

.hourly-label {
    position: absolute;
    bottom: -22px;
    font-size: 0.68rem;
    color: var(--gray-400);
    font-weight: 600;
}

.hourly-val {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    padding-bottom: 4px;
}


/* ═══════════════════════════════════════
   PATTERN DETECTION
   ═══════════════════════════════════════ */

.patterns-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pattern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.pattern-card.critical { border-left: 4px solid var(--danger); }
.pattern-card.warning { border-left: 4px solid var(--warning); }

.pattern-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pattern-severity {
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.pattern-severity.critical { background: var(--danger-light); color: var(--danger); }
.pattern-severity.warning { background: var(--warning-light); color: #92400e; }

.pattern-time {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.pattern-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.pattern-card p {
    font-size: 0.88rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 14px;
}

.pattern-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.pattern-stats strong {
    color: var(--gray-900);
    font-family: var(--font-display);
}

.pattern-action-btn {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
}
.pattern-action-btn:hover { color: var(--accent-hover); }


/* ═══════════════════════════════════════
   CONFIGURATION
   ═══════════════════════════════════════ */

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.config-wide { grid-column: 1 / -1; }

.config-form {
    padding: 16px 22px 20px;
}

.config-field {
    margin-bottom: 20px;
}
.config-field:last-child { margin-bottom: 0; }

.config-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.config-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-200);
    border-radius: 3px;
    outline: none;
}

.config-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    transition: transform 0.15s ease;
}

.config-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.config-value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
    min-width: 50px;
    text-align: right;
}

.config-number {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    outline: none;
}

.config-number:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.config-unit {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.config-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.config-total {
    display: flex;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    color: var(--gray-700);
}

.config-total-value {
    font-family: var(--font-display);
    color: var(--success);
}

/* Hard Rules */
.hard-rules-list {
    padding: 12px 22px 16px;
}

.hard-rule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.hard-rule-item:last-child { border-bottom: none; }

.hard-rule-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    margin-top: 2px;
    cursor: pointer;
}

.hard-rule-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-800);
    display: block;
    margin-bottom: 2px;
}

.hard-rule-desc {
    font-size: 0.78rem;
    color: var(--gray-500);
    line-height: 1.5;
}


/* ═══════════════════════════════════════
   AUDIT LOG
   ═══════════════════════════════════════ */

.audit-log-list {
    display: flex;
    flex-direction: column;
}

.audit-log-entry {
    display: flex;
    gap: 18px;
    padding: 18px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    box-shadow: var(--shadow-xs);
    transition: all var(--duration) var(--ease);
}

.audit-log-entry:hover {
    box-shadow: var(--shadow-sm);
}

.audit-log-time {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gray-400);
    font-weight: 600;
    min-width: 56px;
    padding-top: 2px;
}

.audit-log-body { flex: 1; }

.audit-log-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.audit-log-case {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
}

.audit-log-event {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.audit-log-event.approved { background: var(--success-bg); color: var(--success); }
.audit-log-event.escalated { background: var(--warning-bg); color: #b45309; }
.audit-log-event.rejected { background: var(--danger-bg); color: var(--danger); }

.audit-log-body p {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.6;
}


/* ═══════════════════════════════════════
   MODAL
   ═══════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration) var(--ease);
}

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

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--duration-slow) var(--ease);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    color: var(--gray-400);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.modal-body {
    padding: 16px 24px;
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 20px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
}

.modal-btn.secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}
.modal-btn.secondary:hover { background: var(--gray-200); }

.modal-btn.primary {
    background: var(--accent);
    color: #fff;
}
.modal-btn.primary:hover { background: var(--accent-hover); }

.modal-btn.danger {
    background: var(--danger);
    color: #fff;
}
.modal-btn.danger:hover { background: #dc2626; }


/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 400px;
    border: 1px solid var(--border);
    animation: toastIn 0.3s var(--ease);
    font-size: 0.85rem;
    font-weight: 600;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }

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

.toast-exit {
    animation: toastOut 0.3s var(--ease) forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(20px); }
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 1200px) {
    .case-detail-layout {
        grid-template-columns: 1fr;
    }
    .case-sidebar {
        position: static;
    }
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .config-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .metrics-row {
        grid-template-columns: 1fr;
    }
    .search-box input {
        width: 160px;
    }
    .search-box input:focus {
        width: 200px;
    }
    .topbar {
        padding: 0 16px;
    }
    .page {
        padding: 16px;
    }
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* ═══ New KYC Submission Button & Modal Form ═══ */
.new-kyc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.new-kyc-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.modal-lg {
    max-width: 680px;
    width: 90%;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--gray-900);
    font-size: 0.88rem;
    font-family: inherit;
    transition: var(--transition-fast);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}
.upload-dropzone:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.04);
}
.upload-dropzone span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700);
}
.upload-dropzone small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ═══════════════════════════════════════
   SOULSEARCH OSINT VISUAL SCANNER HUD (THE CIRCLE STYLE)
   ═══════════════════════════════════════ */
.soulsearch-card {
    background: linear-gradient(145deg, #090e1a, #0f172a);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-lg);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.soulsearch-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, #06b6d4, transparent);
    animation: cyberPulse 2.5s infinite;
}

@keyframes cyberPulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.soulsearch-hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.soulsearch-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #38bdf8;
    font-size: 0.95rem;
}
.soulsearch-badge-live {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.soulsearch-badge-live .dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: blink 1.2s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.soulsearch-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    padding: 20px;
}

.soulsearch-face-scanner {
    position: relative;
    width: 100%;
    height: 220px;
    background: #020617;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.soulsearch-face-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.1) brightness(0.95);
}
.soulsearch-scanner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, transparent 40%, rgba(2, 6, 23, 0.7) 90%);
}
.soulsearch-laser-beam {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #38bdf8, #06b6d4, transparent);
    box-shadow: 0 0 15px #38bdf8, 0 0 30px #06b6d4;
    animation: laserScan 2.2s ease-in-out infinite alternate;
}
@keyframes laserScan {
    0% { top: 0%; }
    100% { top: 96%; }
}
.soulsearch-reticle {
    position: absolute;
    width: 140px;
    height: 140px;
    border: 2px dashed rgba(56, 189, 248, 0.6);
    border-radius: 50%;
    animation: spinReticle 12s linear infinite;
}
@keyframes spinReticle {
    100% { transform: rotate(360deg); }
}

.soulsearch-terminal {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 14px;
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
    color: #38bdf8;
    height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.soulsearch-log-line {
    display: flex;
    gap: 8px;
    line-height: 1.4;
}
.soulsearch-log-line .timestamp { color: #64748b; }
.soulsearch-log-line .tag { color: #a855f7; font-weight: bold; }
.soulsearch-log-line .text-info { color: #38bdf8; }
.soulsearch-log-line .text-success { color: #4ade80; }
.soulsearch-log-line .text-alert { color: #f87171; font-weight: bold; }

.soulsearch-matches-row {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.soulsearch-match-item {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
}
.soulsearch-match-item:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    background: rgba(30, 41, 59, 0.9);
}
.soulsearch-match-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}
.soulsearch-match-info {
    flex: 1;
    min-width: 0;
}
.soulsearch-match-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: #f1f5f9;
}
.soulsearch-match-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.soulsearch-match-score {
    font-weight: 800;
    font-size: 0.85rem;
    color: #4ade80;
}

