:root {
    /* Hydro-Wates Theme Palette */

    /* Backgrounds - Professional Dark Greys */
    --color-bg-primary: #121212;
    --color-bg-secondary: #1e1e1e;
    --color-bg-tertiary: #2d2d2d;
    --color-bg-card: #252525;
    --color-bg-hover: #333333;

    /* Brand Colors */
    --color-primary: #20488f;
    /* Hydro-Wates Navy Blue */
    --color-primary-light: #3b6bb5;
    --color-primary-dark: #153266;

    --color-accent: #fccb06;
    /* Hydro-Wates Yellow/Gold */
    --color-accent-hover: #e5b805;

    /* Functional Colors */
    --color-success: #10b981;
    --color-success-light: #34d399;
    --color-danger: #ef4444;
    --color-danger-light: #f87171;
    --color-warning: #fccb06;
    --color-info: #3b82f6;

    /* Text Colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0e0e0;
    --color-text-tertiary: #a0a0a0;
    --color-text-muted: #6b7280;

    /* Border & Divider */
    --color-border: #404040;
    --color-border-light: #505050;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #20488f 0%, #153266 100%);
    --gradient-accent: linear-gradient(135deg, #fccb06 0%, #e5b805 100%);
    --gradient-card: linear-gradient(180deg, #252525 0%, #1e1e1e 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(252, 203, 6, 0.2);

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Transitions */
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-primary);
    font-weight: 700;
}

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

/* Navbar overrides */
.navbar {
    background-color: var(--color-bg-secondary) !important;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-weight: 700;
    color: var(--color-text-primary) !important;
    letter-spacing: -0.5px;
}

/* Card Overrides */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--color-border-light);
}

/* Button Overrides */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--spacing-sm) var(--spacing-lg);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--color-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-outline-secondary:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text-primary);
    border-color: var(--color-text-primary);
}

/* Badge Overrides */
.badge {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5em 0.8em;
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: var(--color-success-light) !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bg-warning {
    background-color: rgba(252, 203, 6, 0.2) !important;
    color: var(--color-warning) !important;
    border: 1px solid rgba(252, 203, 6, 0.3);
}

.bg-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: var(--color-danger-light) !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Links */
a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-accent);
}

/* Map Containers */
#usa-map {
    border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════════════════════ */
/*  NEXUS DASHBOARD CARDS                                     */
/* ═══════════════════════════════════════════════════════════ */

/* Legend */
.nexus-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot--registered {
    background: var(--color-success);
}

.legend-dot--physical {
    background: #f97316;
}

.legend-dot--economic {
    background: var(--color-accent);
}

.legend-dot--no-sales-tax {
    background: #8b5cf6;
}

/* Card Base */
.nexus-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

/* Card Border Accents */
.nexus-card--registered {
    border-top: 3px solid var(--color-success);
}

.nexus-card--physical {
    border-top: 3px solid #f97316;
}

.nexus-card--watching {
    border-top: 3px solid var(--color-accent);
}

.nexus-card--no-sales-tax {
    border-top: 3px solid #8b5cf6;
}

/* Card Header */
.nexus-card__header {
    padding: 1.25rem 1.25rem 0.75rem;
}

.nexus-card__title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.nexus-card__state-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-primary);
}

.nexus-card__state-code {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.nexus-card__badges {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

/* Badges */
.nexus-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3em 0.7em;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nexus-badge--sm {
    padding: 0.2em 0.5em;
    font-size: 0.65rem;
}

.nexus-badge--registered {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.nexus-badge--physical {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.nexus-badge--watching {
    background: rgba(252, 203, 6, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(252, 203, 6, 0.3);
}

.nexus-badge--no-tax {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.nexus-badge--danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.nexus-badge--neutral {
    background: rgba(107, 114, 128, 0.15);
    color: var(--color-text-tertiary);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Card Sections */
.nexus-card__section {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nexus-card__section--last {
    border-bottom: none;
}

/* Section Header */
.nexus-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.nexus-section-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nexus-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

/* Subsections */
.nexus-subsection {
    margin-bottom: 0.75rem;
}

.nexus-subsection-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--color-text-tertiary);
    margin-bottom: 0.4rem;
}

/* Indicators */
.nexus-indicator {
    font-size: 0.72rem;
    font-weight: 600;
}

.nexus-indicator--active {
    color: #f97316;
}

.nexus-indicator--inactive {
    color: var(--color-text-muted);
}

.nexus-indicator--warning {
    color: var(--color-accent);
}

.nexus-indicator--safe {
    color: var(--color-text-muted);
}

/* Physical Presence Trigger Tags */
.nexus-trigger-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.nexus-trigger-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25em 0.6em;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #fdba74;
    white-space: nowrap;
}

.nexus-trigger-tag__icon {
    font-size: 0.75rem;
}

/* Progress Bars */
.nexus-progress-row {
    margin-bottom: 0.5rem;
}

.nexus-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.72rem;
    color: var(--color-text-tertiary);
    margin-bottom: 0.25rem;
}

.nexus-progress-values {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.nexus-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.nexus-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease, background 0.3s ease;
    min-width: 2px;
}

.nexus-progress-fill--low {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.nexus-progress-fill--moderate {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.nexus-progress-fill--high {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.nexus-progress-fill--critical {
    background: linear-gradient(90deg, #ef4444, #f87171);
    animation: pulse-bar 2s ease-in-out infinite;
}

.nexus-progress-fill--none {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes pulse-bar {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.nexus-condition-note {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 0.1rem;
}

/* Liability Callout */
.nexus-liability-callout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin: 0.5rem 0;
}

.nexus-liability-callout__label {
    font-size: 0.68rem;
    color: var(--color-danger-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.nexus-liability-callout__amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-danger-light);
}

/* Meta Rows */
.nexus-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding: 0.3rem 0;
}

.nexus-meta-row--footer {
    padding: 0.2rem 0;
}

/* Info Notes */
.nexus-info-note {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.5rem;
    line-height: 1.45;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.nexus-info-note--compact {
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
}

/* No Sales Tax Notice */
.nexus-no-tax-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 6px;
    font-size: 0.78rem;
    color: #c4b5fd;
}

.nexus-no-tax-icon {
    color: #a78bfa;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 1px;
}

/* P.L. 86-272 Warning */
.nexus-pl86-warning {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: rgba(252, 203, 6, 0.06);
    border: 1px solid rgba(252, 203, 6, 0.15);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--color-text-tertiary);
    margin-top: 0.4rem;
}

.nexus-pl86-warning__icon {
    color: var(--color-accent);
    flex-shrink: 0;
}

/* Card Footer */
.nexus-card__footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.nexus-card__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.nexus-portal-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 107, 181, 0.1);
    border: 1px solid rgba(59, 107, 181, 0.25);
    border-radius: 6px;
    color: var(--color-primary-light) !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all var(--transition-base);
}

.nexus-portal-link:hover {
    background: rgba(59, 107, 181, 0.2);
    border-color: var(--color-primary-light);
    color: var(--color-text-primary) !important;
    transform: translateX(2px);
}

.nexus-portal-link--secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--color-border);
    color: var(--color-text-tertiary) !important;
}

.nexus-portal-link--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary) !important;
}

/* Card Notes */
.nexus-card__notes {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.72rem;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.nexus-card__notes-icon {
    flex-shrink: 0;
    font-size: 0.75rem;
}

/* Add Card */
.nexus-card--add {
    border: 2px dashed var(--color-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    cursor: pointer;
}

.nexus-card--add:hover {
    border-color: var(--color-primary-light);
    background: rgba(59, 107, 181, 0.05);
}

.nexus-card--add__content {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.nexus-card--add__icon {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    color: var(--color-text-tertiary);
}

/* ═══════════════════════════════════════════════════════════ */
/*  REGISTRATION PRIORITY PANEL                               */
/* ═══════════════════════════════════════════════════════════ */

.priority-panel {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.priority-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.priority-panel__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-primary);
}

.priority-panel__subtitle {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 0.15rem;
}

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

.priority-panel__total-label {
    display: block;
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-panel__total-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-danger-light);
}

.priority-panel__table {
    width: 100%;
}

.priority-row {
    display: grid;
    grid-template-columns: 40px 1.5fr 1.2fr 1.5fr 1fr 100px;
    align-items: center;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition-base);
}

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

.priority-row:not(.priority-row--header):hover {
    background: rgba(255, 255, 255, 0.03);
}

.priority-row--header {
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    padding: 0.5rem 1.25rem;
}

.priority-row--high {
    border-left: 3px solid var(--color-danger);
}

.priority-row--moderate {
    border-left: 3px solid var(--color-accent);
}

.priority-row--low {
    border-left: 3px solid var(--color-border);
}

.priority-col {
    font-size: 0.82rem;
}

.priority-col--rank {
    text-align: center;
}

.priority-col--liability {
    text-align: right;
}

.priority-col--action {
    text-align: right;
}

.priority-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.priority-rank--high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-danger-light);
}

.priority-rank--low {
    background: rgba(107, 114, 128, 0.2);
    color: var(--color-text-muted);
}

.priority-progress {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.priority-progress__label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
}

.priority-action {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.priority-action--register {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger-light);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.priority-action--register:hover {
    background: rgba(239, 68, 68, 0.2);
}

.priority-action--monitor {
    background: rgba(107, 114, 128, 0.12);
    color: var(--color-text-muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .priority-row {
        grid-template-columns: 30px 1fr 1fr;
        gap: 0.3rem;
    }

    .priority-col--triggers,
    .priority-col--economic,
    .priority-col--action {
        display: none;
    }

    .priority-panel__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

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

/* ═══════════════════════════════════════════════════════════ */
/*  SYNC TOAST                                                */
/* ═══════════════════════════════════════════════════════════ */

.sync-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.sync-toast--loading {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

.sync-toast--success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--color-success);
    color: var(--color-success-light);
}

.sync-toast--error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--color-danger);
    color: var(--color-danger-light);
}

/* ═══════════════════════════════════════════════════════════ */
/*  STATE DETAIL MODAL                                        */
/* ═══════════════════════════════════════════════════════════ */

.nexus-card--clickable {
    cursor: pointer;
}

.nexus-card--clickable:hover {
    border-color: var(--color-primary-light);
}

.state-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.state-modal__content {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    width: 95vw;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.25s ease;
}

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

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

.state-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-bg-primary);
    z-index: 1;
}

.state-modal__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-primary);
}

.state-modal__subtitle {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
    display: block;
    margin-top: 0.15rem;
}

.state-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.state-modal__close {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    line-height: 1;
}

.state-modal__close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: var(--color-danger-light);
}

/* Summary Stats */
.state-modal__summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.state-modal__stat {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.state-modal__stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.state-modal__stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.state-modal__stat--danger .state-modal__stat-value {
    color: var(--color-danger-light);
}

/* Revenue Breakdown */
.state-modal__breakdown {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.state-modal__section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin: 0 0 0.75rem 0;
}

.state-modal__type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.state-modal__type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.state-modal__type-icon {
    font-size: 1.4rem;
}

.state-modal__type-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-modal__type-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.state-modal__type-count {
    font-size: 0.68rem;
    color: var(--color-text-muted);
}

/* Invoice Table */
.state-modal__table-section {
    padding: 0;
}

.state-modal__table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
}

.state-modal__filters {
    display: flex;
    gap: 0.5rem;
}

.state-modal__filter-select {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
}

.state-modal__filter-select:focus {
    outline: none;
    border-color: var(--color-primary-light);
}

.state-modal__table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.state-modal__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.state-modal__table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.state-modal__table thead th {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.state-modal__table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition-base);
}

.state-modal__table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.state-modal__table td {
    padding: 0.5rem 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.state-modal__row--flagged {
    background: rgba(239, 68, 68, 0.04) !important;
    border-left: 3px solid var(--color-danger) !important;
}

.state-modal__row--flagged:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}

.state-modal__invoice-link {
    color: var(--color-primary-light) !important;
    text-decoration: none;
    font-weight: 600;
}

.state-modal__invoice-link:hover {
    text-decoration: underline;
    color: var(--color-text-primary) !important;
}

.state-modal__table-footer {
    padding: 0.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

/* No Data */
.state-modal__no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-muted);
    text-align: center;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .state-modal__content {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

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

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