html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    background-color: #0f1923;
    color: #e5e7eb;
    line-height: 1.6;
}

/* Override Bootstrap's dark text colors for better contrast */
.text-muted {
    color: #9ca3af !important;
}

.text-light {
    color: #e5e7eb !important;
}

.text-primary {
    color: #60a5fa !important;
}

.text-success {
    color: #34d399 !important;
}

.text-warning {
    color: #fbbf24 !important;
}

.text-danger {
    color: #f87171 !important;
}

.text-info {
    color: #67e8f9 !important;
}

.sidebar .nav-link {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.15s;
}

.sidebar .nav-link:hover {
    background-color: #1e293b;
}

.sidebar .nav-link.active {
    background-color: #1e3a5f;
    color: #7dd3fc !important;
}

.navbar-brand {
    font-size: 1.15rem !important;
    letter-spacing: 0.5px;
}

.top-bar {
    background-color: #111827 !important;
    border-bottom: 1px solid #1e293b !important;
}

/* Agent output panel */
.agent-output {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    background-color: #0a0e14 !important;
    letter-spacing: 0.2px;
}

.agent-output div {
    margin-bottom: 2px;
}

.agent-output pre {
    background-color: #151b24 !important;
    border: 1px solid #1e293b;
    border-radius: 6px;
    font-size: 0.82rem;
    padding: 12px !important;
    margin: 8px 0;
}

.agent-output code {
    font-size: 0.85em;
}

.agent-output hr {
    border-color: #1e293b !important;
    opacity: 0.6;
    margin: 12px 0;
}

.agent-output h3, .agent-output h4, .agent-output h5, .agent-output h6 {
    margin-top: 12px;
    margin-bottom: 6px;
}

/* Tab bar */
.nav-tabs {
    border-bottom-color: #1e293b !important;
    background-color: #111827;
    padding: 4px 8px 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    color: #6b7280;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.nav-tabs .nav-link.active {
    background-color: #0a0e14 !important;
    border: 1px solid #1e293b !important;
    border-bottom: none !important;
    color: #e5e7eb !important;
}

.nav-tabs .nav-link:hover:not(.active) {
    background-color: #1e293b;
    color: #d1d5db;
}

.nav-tabs .badge {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Cards (Status, Treasury pages) */
.card {
    border-radius: 10px;
    border-color: #1e293b !important;
    background-color: #111827 !important;
    color: #e5e7eb !important;
}

.card-body {
    color: #e5e7eb !important;
}

.card-body p {
    color: #d1d5db !important;
}

.card-title {
    color: #67e8f9 !important;
}

.card-header {
    border-color: #1e293b !important;
    background-color: #0f172a !important;
    padding: 14px 18px;
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: #1e293b;
    font-size: 0.9rem;
}

.table-dark td, .table-dark th {
    padding: 10px 14px;
}

/* Form controls */
.form-control {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #9ca3af;
}

/* Buttons */
.btn-primary {
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
}

.btn-outline-secondary {
    color: #9ca3af !important;
    border-color: #4b5563 !important;
}

.btn-outline-secondary:hover {
    color: #e5e7eb !important;
    background-color: #374151 !important;
    border-color: #6b7280 !important;
}

/* Alerts */
.alert {
    border-radius: 10px;
    font-size: 0.95rem;
}

/* Blazor error UI */
#blazor-error-ui {
    background: #7f1d1d;
    color: #fecaca;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.9rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 10px;
}

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

::-webkit-scrollbar-track {
    background: #0a0e14;
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

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

/* ==================== Sidebar layout ==================== */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    z-index: 1050;
    background-color: #111827 !important;
    border-right: 1px solid #1e293b;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-toggle {
    color: #9ca3af;
    border: 1px solid #4b5563;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px 8px;
}

.sidebar-toggle:hover {
    color: #e5e7eb;
    background-color: #374151;
}

/* ==================== Mobile (< 768px) ==================== */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 240px;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    .top-bar {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    .nav-tabs .nav-link {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    .agent-output {
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .card-header {
        padding: 10px 12px;
    }

    .table-dark td, .table-dark th {
        padding: 6px 8px;
        font-size: 0.82rem;
    }
}
