/* DESIGN SYSTEM & ROOT VARIABLES */
:root {
    --bg-base: #080b11;
    --bg-surface: #0f1420;
    --bg-surface-elevated: #161e2e;
    --bg-glass: rgba(15, 20, 32, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-accent: #8b5cf6;

    --color-emerald: #10b981;
    --color-emerald-bg: rgba(16, 185, 129, 0.12);
    --color-amber: #f59e0b;
    --color-amber-bg: rgba(245, 158, 11, 0.12);
    --color-rose: #f43f5e;
    --color-rose-bg: rgba(244, 63, 94, 0.12);
    --color-blue: #38bdf8;
    --color-blue-bg: rgba(56, 189, 248, 0.12);
    --color-purple: #a855f7;
    --color-purple-bg: rgba(168, 85, 247, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* CUSTOM SCROLLBARS */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

body.dark-theme {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    overflow-x: hidden;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* APP LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
    flex-shrink: 0;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

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

.brand-text h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-text .highlight {
    color: var(--brand-primary);
}

.brand-text .sub-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}

.nav-item.active {
    color: white;
    background: var(--brand-primary);
    box-shadow: var(--shadow-glow);
}

.sidebar-footer {
    margin-top: auto;
}

.system-status-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.live {
    background: var(--color-emerald);
    box-shadow: 0 0 10px var(--color-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

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

.status-title {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-meta {
    font-size: 10px;
    color: var(--text-muted);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1700px;
    min-width: 0;
}

/* TOPBAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-title-area h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-title-area .subtitle {
    color: var(--text-secondary);
    font-size: 12.5px;
    margin-top: 2px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

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

.btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
}

.btn-lg {
    padding: 11px 18px;
    font-size: 13.5px;
    font-weight: 700;
}

.btn-danger {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.btn-danger:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-icon {
    padding: 7px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 5-COLUMN BALANCED KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

@media (max-width: 1440px) {
    .kpi-grid {
        gap: 10px;
    }
    .kpi-card {
        padding: 12px 14px;
        gap: 10px;
    }
    .kpi-icon {
        width: 36px;
        height: 36px;
    }
    .kpi-value {
        font-size: 17.5px;
    }
}

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

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 13px 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    min-width: 0;
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.kpi-card.highlight-card {
    border-color: rgba(139, 92, 246, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(15, 20, 32, 0.95) 100%);
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 19px;
    height: 19px;
}

.kpi-icon.blue { background: var(--color-blue-bg); color: var(--color-blue); }
.kpi-icon.purple { background: var(--color-purple-bg); color: var(--color-purple); }
.kpi-icon.emerald { background: var(--color-emerald-bg); color: var(--color-emerald); }
.kpi-icon.amber { background: var(--color-amber-bg); color: var(--color-amber); }
.kpi-icon.rose { background: var(--color-rose-bg); color: var(--color-rose); }

.kpi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.kpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 18px;
    font-weight: 800;
    margin: 2px 0 1px;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

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

/* GLASS CARDS */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* SECTION MANAGEMENT */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* FILTER PANEL */
.filter-panel {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-row.top {
    display: flex;
    gap: 14px;
    align-items: center;
}

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

.search-input-wrap svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-input-wrap input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.search-input-wrap input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

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

.filter-group label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.quick-selects select,
.filter-chip select,
.form-group select,
.page-size-selector select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    outline: none;
    cursor: pointer;
}

/* FLEET TIER RIBBON */
.fleet-tier-ribbon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.ribbon-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-right: 4px;
    flex-shrink: 0;
}

.tier-pill {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.tier-pill:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.4);
}

.tier-pill.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.filter-row.bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-chip-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.filter-chip input[type="number"] {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.toggle-chip label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* DATA TABLES */
.table-container {
    overflow: hidden;
    margin-bottom: 20px;
}

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

.results-count {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.latency-badge {
    background: var(--color-emerald-bg);
    color: var(--color-emerald);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.table-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 440px);
    min-height: 380px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table thead th {
    position: sticky;
    top: 0;
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-subtle);
    background: #111724;
    z-index: 10;
    white-space: nowrap;
}

.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.carrier-dot-link {
    color: var(--color-blue);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.carrier-dot-link:hover {
    text-decoration: underline;
}

.legal-name-cell {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 280px;
}

.legal-name-cell .dba {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.fleet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.fleet-badge.small {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.fleet-badge.mid {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.fleet-badge.large {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.fleet-badge.enterprise {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

.pill.unpaid { background: var(--color-amber-bg); color: var(--color-amber); }
.pill.paid { background: var(--color-emerald-bg); color: var(--color-emerald); }
.pill.sold { background: var(--color-rose-bg); color: var(--color-rose); }
.pill.fresh { background: var(--color-blue-bg); color: var(--color-blue); }

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* SCRAPER ENGINE LAYOUT */
.scraper-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    margin-bottom: 18px;
}

.scraper-filter-box {
    padding: 16px 20px;
}

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

.form-row-grid .full-width {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.form-group input, .form-group select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12.5px;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--brand-primary);
}

.auto-toggle-box {
    grid-column: span 2;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 10px 14px;
    border-radius: var(--radius-md);
}

.toggle-switch-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.toggle-switch-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-primary);
}

.scraper-actions-bar {
    display: flex;
    gap: 12px;
    padding: 0 20px 18px 20px;
}

.scraper-actions-bar .btn {
    flex: 1;
}

.quota-pill {
    font-size: 11.5px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.quota-pill strong {
    color: var(--brand-primary);
}

.scraper-monitor-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.status-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
}

.status-pill.status-idle {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.status-pill.status-running {
    background: var(--color-emerald-bg);
    color: var(--color-emerald);
    animation: pulse 1.5s infinite;
}

.progress-wrap {
    margin: 14px 0 16px 0;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.progress-bar-bg {
    height: 8px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--color-emerald));
    transition: width 0.3s ease;
}

.metric-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.mini-stat {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-align: center;
}

.mini-stat.emerald h4 { color: var(--color-emerald); }
.mini-stat.amber h4 { color: var(--color-amber); }
.mini-stat.rose h4 { color: var(--color-rose); }

.mini-stat .mini-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.mini-stat h4 {
    font-size: 18px;
    font-weight: 800;
    margin-top: 2px;
}

.current-target-card {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

.target-label {
    font-size: 10.5px;
    color: var(--brand-primary);
    text-transform: uppercase;
    font-weight: 700;
}

.target-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}

.target-info strong {
    font-size: 13px;
    color: var(--text-primary);
}

.target-info span {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TERMINAL WINDOW */
.terminal-card {
    margin-bottom: 18px;
}

.terminal-window {
    background: #05070c;
    border-top: 1px solid var(--border-subtle);
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.terminal-line {
    line-height: 1.5;
    word-break: break-word;
}

/* RECONCILIATION & EXCLUSIONS */
.reconcile-audit-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-lg);
}

.audit-summary-info h3 {
    font-size: 16px;
    font-weight: 700;
}

.audit-summary-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 3px 0 10px 0;
}

.audit-stat-row {
    display: flex;
    gap: 14px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

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

@media (max-width: 1024px) {
    .exclusions-grid {
        grid-template-columns: 1fr;
    }
}

.sub-search-bar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.sub-search-bar input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: var(--transition);
}

.sub-search-bar input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.scrollable-table {
    max-height: 440px;
    overflow-y: auto;
}

.data-table.compact th, .data-table.compact td {
    padding: 8px 12px;
    font-size: 11.5px;
}

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--brand-primary); }
.badge-emerald { background: var(--color-emerald-bg); color: var(--color-emerald); }
.badge-rose { background: var(--color-rose-bg); color: var(--color-rose); }
.badge-blue { background: var(--color-blue-bg); color: var(--color-blue); }

/* MODALS */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

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

.modal-window {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    width: 100%;
    max-width: 650px;
    overflow: hidden;
}

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

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
}

.modal-tabs {
    display: flex;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 20px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

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

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

.detail-group label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.detail-group p {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
}

.compliance-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.comp-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 14px;
    border-radius: var(--radius-md);
    text-align: center;
}

.comp-box h4 {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.modal-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* TOAST NOTIFICATIONS (NO BROWSER POPUPS) */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
    pointer-events: none;
}

.toast {
    background: #111724;
    border: 1px solid var(--border-subtle);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: slideInToast 0.3s ease forwards;
    transition: all 0.3s ease;
}

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

.toast.toast-success {
    border-left: 4px solid var(--color-emerald);
}

.toast.toast-error {
    border-left: 4px solid var(--color-rose);
}

.toast.toast-info {
    border-left: 4px solid var(--brand-primary);
}

.toast .toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast.toast-success .toast-icon { color: var(--color-emerald); }
.toast.toast-error .toast-icon { color: var(--color-rose); }
.toast.toast-info .toast-icon { color: var(--brand-primary); }

.toast .toast-msg {
    flex: 1;
    font-size: 12.5px;
    line-height: 1.4;
}

.toast .toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.toast .toast-close:hover {
    color: var(--text-primary);
}
