:root {
    --sidebar-width: 256px;
    --obs-bg: #f6f7f9;
    --obs-surface: #ffffff;
    --obs-surface-subtle: #f1f3f6;
    --obs-border: #e2e6ec;
    --obs-text: #161d26;
    --obs-text-muted: #5c6776;
    --obs-accent: #1e40af;
    --obs-accent-soft: rgba(30, 64, 175, 0.09);
    --obs-accent-text: #1e40af;
    --obs-mark-bg: #fef08a;
    --obs-mark-text: #1e293b;
}

[data-bs-theme="dark"] {
    --obs-bg: #0d1117;
    --obs-surface: #151b23;
    --obs-surface-subtle: #1c2430;
    --obs-border: #26303d;
    --obs-text: #e6edf3;
    --obs-text-muted: #8b98a8;
    --obs-accent: #3b82f6;
    --obs-accent-soft: rgba(59, 130, 246, 0.14);
    --obs-accent-text: #93c5fd;
    --obs-mark-bg: rgba(250, 204, 21, 0.25);
    --obs-mark-text: #fef08a;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.91rem;
    background-color: var(--obs-bg) !important;
    color: var(--obs-text) !important;
    -webkit-font-smoothing: antialiased;
}

body.sidebar-resizing {
    user-select: none;
    cursor: col-resize !important;
}

/* ==================== SHELL & SIDEBAR ==================== */
.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    background-color: var(--obs-surface) !important;
    border-color: var(--obs-border) !important;
}

@media (min-width: 992px) {
    .app-sidebar {
        width: var(--sidebar-width);
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    html.sidebar-collapsed .app-sidebar {
        width: 68px !important;
    }

    html.sidebar-collapsed .app-sidebar .nav-text,
    html.sidebar-collapsed .app-sidebar .brand-text,
    html.sidebar-collapsed .app-sidebar .sidebar-brand-lg,
    html.sidebar-collapsed .app-sidebar .sidebar-user-details,
    html.sidebar-collapsed .app-sidebar .sidebar-section-label {
        display: none !important;
    }

    html.sidebar-collapsed .app-sidebar .sidebar-header-lg {
        justify-content: center !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    html.sidebar-collapsed .app-sidebar .nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
}

.app-sidebar-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 1030;
    transition: background-color 0.15s ease;
}

.app-sidebar-resizer:hover,
body.sidebar-resizing .app-sidebar-resizer {
    background-color: var(--obs-accent);
    opacity: 0.55;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--obs-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-section-label {
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--obs-text-muted);
    padding: 0.75rem 0.75rem 0.3rem;
    font-weight: 600;
}

.app-sidebar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--obs-text-muted);
    border-radius: 0.45rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.app-sidebar .nav-link i {
    font-size: 1rem;
}

.app-sidebar .nav-link:hover {
    background-color: var(--obs-surface-subtle);
    color: var(--obs-text);
}

.app-sidebar .nav-link.active {
    background-color: var(--obs-accent-soft);
    color: var(--obs-accent-text) !important;
    font-weight: 600;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--obs-accent-soft);
    color: var(--obs-accent-text);
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==================== SURFACES & CARDS ==================== */
.obs-card {
    background-color: var(--obs-surface);
    border: 1px solid var(--obs-border);
    border-radius: 0.65rem;
}

.card {
    background-color: var(--obs-surface);
    border: 1px solid var(--obs-border);
    border-radius: 0.65rem;
    box-shadow: none !important;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--obs-border);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.85rem 1.15rem;
}

.page-header {
    border-bottom: 1px solid var(--obs-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.page-subtitle {
    color: var(--obs-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.stat-tile {
    background-color: var(--obs-surface);
    border: 1px solid var(--obs-border);
    border-radius: 0.65rem;
    padding: 1.1rem 1.25rem;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--obs-text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.stat-foot {
    font-size: 0.78rem;
    color: var(--obs-text-muted);
    margin-top: 0.35rem;
}

/* ==================== SUBTLE TAGS / PILLS ==================== */
.obs-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--obs-border);
    background-color: var(--obs-surface-subtle);
    color: var(--obs-text);
}

.obs-tag-success {
    background-color: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.28);
    color: #15803d;
}

[data-bs-theme="dark"] .obs-tag-success {
    color: #86efac;
}

.obs-tag-warning {
    background-color: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.3);
    color: #b45309;
}

[data-bs-theme="dark"] .obs-tag-warning {
    color: #fcd34d;
}

.obs-tag-danger {
    background-color: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.28);
    color: #b91c1c;
}

[data-bs-theme="dark"] .obs-tag-danger {
    color: #fca5a5;
}

.obs-tag-info {
    background-color: var(--obs-accent-soft);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--obs-accent-text);
}

/* ==================== TABLES ==================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--obs-border);
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--obs-text-muted);
    background-color: var(--obs-surface-subtle);
    border-bottom: 1px solid var(--obs-border);
    padding: 0.7rem 0.9rem;
}

.table tbody td {
    padding: 0.75rem 0.9rem;
    vertical-align: middle;
}

/* ==================== EDITORIAL EXCERPTS ==================== */
.fts-snippet {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.97rem;
    line-height: 1.65;
    padding: 0.9rem 1.1rem;
    border-left: 3px solid var(--obs-accent);
    background-color: var(--obs-surface-subtle);
    border-radius: 0 0.45rem 0.45rem 0;
    color: var(--obs-text);
}

.fts-snippet mark {
    background-color: var(--obs-mark-bg);
    color: var(--obs-mark-text);
    padding: 0.05rem 0.25rem;
    border-radius: 0.2rem;
    font-weight: 600;
}

.mono {
    font-family: 'Cascadia Code', 'Consolas', monospace;
}

.json-box {
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem;
    max-height: 160px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background-color: var(--obs-surface-subtle);
    border: 1px solid var(--obs-border);
    border-radius: 0.4rem;
    padding: 0.5rem 0.7rem;
    margin: 0;
}

/* ==================== AUTH SPLIT SCREEN ==================== */
.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-split {
        grid-template-columns: 1.05fr 1fr;
    }
}

.auth-brand-pane {
    background: linear-gradient(155deg, #0f172a 0%, #172554 55%, #1e3a5f 100%);
    color: #f8fafc;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-form-pane {
    background-color: var(--obs-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background-color: var(--obs-surface);
    border: 1px solid var(--obs-border);
    border-radius: 0.75rem;
    padding: 2rem;
}
