@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #065BFF;
    --primary-hover: #0047D9;
    --primary-light: #EEF5FF;

    --bg-app: #FBFCFF;
    --surface: #FFFFFF;

    --text-dark: #101834;
    --text-body: #34405C;
    --text-muted: #6F7A94;
    --text-light: #9AA4B8;

    --success: #20BFA3;
    --success-bg: #E9FBF6;
    --danger: #F0445E;
    --danger-bg: #FFF0F2;
    --warning: #EAB308;
    --warning-bg: #FEF9C3;
    --info: #2F7BFF;
    --info-bg: #EEF5FF;

    --border: #E6EAF2;
    --border-soft: #F2F5FA;
    --sidebar-w: 228px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-card: 0 8px 24px rgba(16, 24, 52, 0.055);
    --shadow-hover: 0 18px 34px rgba(16, 24, 52, 0.11);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; }
button, input, select { font: inherit; }

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.brand {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 22px; 
    gap: 12px; 
}
.brand-icon {
    font-size: 22px;
    color: var(--primary);
}
.brand-text {
    font-size: 18px;
    font-weight: 800; 
    color: var(--primary);
    letter-spacing: -0.01em; 
    white-space: nowrap;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px; 
    padding: 10px 14px; 
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600; 
    font-size: 14px; 
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-dark);
    background: var(--bg-app);
}

.nav-item.active {
    background: var(--primary);
    color: #FFF;
    box-shadow: 0 8px 16px -10px rgba(29, 78, 216, 0.65);
}

.nav-footer {
    padding: 24px 16px; 
}

.premium-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md); 
    padding: 18px; 
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.premium-card-icon {
    width: 36px; height: 36px; 
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; 
    margin: 0 auto 12px; 
}

.premium-card h4 {
    font-size: 13px; 
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px; 
}

.premium-card p {
    font-size: 12px; 
    color: var(--text-muted);
    margin-bottom: 14px; 
}

.premium-btn {
    display: block;
    width: 100%;
    padding: 8px; 
    border: 1px solid var(--border);
    border-radius: 8px; 
    color: var(--primary);
    text-decoration: none;
    font-size: 12px; 
    font-weight: 600;
    transition: 0.2s;
}
.premium-btn:hover { background: var(--bg-app); }


/* ── MAIN CONTENT ── */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: 68px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-brand {
    display: none;
    align-items: center;
    gap: 8px;
}
.topbar-brand h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}
.topbar-brand .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
}

.breadcrumb {
    font-size: 14px; 
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px; 
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .active {
    color: var(--text-dark);
    font-weight: 700; 
}

.search-box {
    position: relative;
    width: 380px; 
}
.search-box input {
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px 10px 42px; 
    font-family: inherit;
    font-size: 13px; /* Middle ground */
    color: var(--text-dark);
    outline: none;
    transition: 0.2s;
}
.search-box input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light); 
}
.search-icon {
    position: absolute;
    left: 14px; top: 50%; transform: translateY(-50%); 
    color: var(--text-muted);
}
.search-shortcut {
    position: absolute;
    right: 14px; top: 50%; transform: translateY(-50%); 
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px; 
    border-radius: 4px;
    font-size: 11px; 
    font-weight: 600;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 22px; 
}
.notify-btn {
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: var(--text-muted); 
    position: relative;
    transition: 0.2s;
}
.notify-btn:hover { color: var(--text-dark); }
.notify-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger); color: #fff;
    font-size: 9px; font-weight: 700; 
    width: 15px; height: 15px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--surface); 
}

.profile-menu {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.profile-menu:hover { background: var(--bg-app); }
.profile-avatar {
    width: 36px; height: 36px; 
    background: var(--primary);
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; 
}
.profile-info { display: flex; flex-direction: column; }
.profile-name { font-weight: 700; color: var(--text-dark); font-size: 14px;  }
.profile-role { font-size: 12px; color: var(--text-muted); font-weight: 500;  }

/* Page Content */
.content {
    width: min(100%, 1480px);
    padding: 28px;
}

.page-header {
    margin-bottom: 24px; 
}
.page-header h1 {
    font-size: 24px;
    font-weight: 800; 
    color: var(--text-dark);
    margin-bottom: 6px; 
    letter-spacing: -0.02em; 
}
.page-header p {
    color: var(--text-muted);
    font-size: 14px; 
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px; 
    margin-bottom: 28px; 
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px; 
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 16px; 
    min-width: 0;
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-icon-wrapper {
    width: 52px; height: 52px; 
    border-radius: 14px; 
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; 
}
.bg-success { background: var(--success-bg); color: var(--success); }
.bg-danger { background: var(--danger-bg); color: var(--danger); }
.bg-info { background: var(--info-bg); color: var(--info); }
.bg-warning { background: var(--warning-bg); color: var(--warning); }
.bg-primary { background: var(--primary-light); color: var(--primary); }

.stat-details { flex: 1; }
.stat-title {
    font-size: 13px; font-weight: 600; color: var(--text-muted); 
    margin-bottom: 4px; 
}
.stat-value {
    font-size: 24px; font-weight: 800; color: var(--text-dark);
    letter-spacing: -0.02em; 
    margin-bottom: 6px; 
    line-height: 1; 
}
.stat-trend {
    font-size: 13px; font-weight: 600; 
    display: flex; align-items: center; gap: 4px;
}
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-text { color: var(--text-light); font-weight: 500; font-size: 12px; margin-left: 4px; }

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 20px; 
}

.main-grid > * {
    min-width: 0;
}

/* Cards/Panels */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex; flex-direction: column;
    min-width: 0;
}

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

.card-title-group h2 {
    font-size: 16px; font-weight: 800; color: var(--text-dark); /* Middle ground */
    letter-spacing: -0.01em; margin-bottom: 4px; 
}
.card-subtitle {
    font-size: 13px; color: var(--text-muted); font-weight: 500; 
}

.card-actions {
    display: flex; gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.btn {
    padding: 8px 14px; border-radius: 8px; 
    font-family: inherit; font-size: 13px; font-weight: 600; 
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 8px; 
    justify-content: center;
    text-decoration: none;
    min-height: 36px;
}
.btn-outline {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-dark);
}
.btn-outline:hover { background: var(--bg-app); border-color: #CBD5E1; }
.btn-primary {
    background: var(--primary); color: #FFF; border: 1px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.card-body {
    padding: 20px 24px; 
}
.p-0 { padding: 0 !important; }

/* Table */
.modern-table {
    width: 100%; border-collapse: collapse;
}
.modern-table th {
    text-align: left; padding: 14px 20px; 
    font-size: 13px; font-weight: 600; color: var(--text-muted); 
    border-bottom: 1px solid var(--border);
}
.modern-table td {
    padding: 14px 20px; 
    font-size: 13px; font-weight: 500; color: var(--text-dark); 
    border-bottom: 1px solid var(--border);
}
.modern-table tr:last-child td { border-bottom: none; }
.modern-table tbody tr { transition: var(--transition); }
.modern-table tr:hover td { background: var(--bg-app); }

.badge {
    padding: 6px 12px; border-radius: 100px; 
    font-size: 12px; font-weight: 700; 
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid #A7F3D0; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #FECACA; }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid #BFDBFE; }

.icon-btn {
    background: none; border: none; cursor: pointer;
    font-size: 14px; color: var(--text-muted);
    padding: 4px; border-radius: 4px;
}
.icon-btn:hover { background: var(--bg-app); color: var(--primary); }

/* Quick Actions Card */
.action-grid {
    display: grid; grid-template-columns: 1fr; gap: 14px; 
}
.action-box {
    display: flex; align-items: center; gap: 14px; 
    padding: 14px; border-radius: 14px; 
    background: var(--surface); border: 1px solid var(--border);
    cursor: pointer; transition: 0.2s;
}
.action-box:hover {
    border-color: var(--primary); box-shadow: var(--shadow-sm);
    transform: translateY(-2px); 
}
.action-icon {
    width: 44px; height: 44px; border-radius: 12px; 
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #FFF; 
}
.action-text { text-align: left; }
.action-text h4 { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 2px;  }
.action-text p { font-size: 12px; color: var(--text-muted);  }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }
.font-medium { font-weight: 500; }

/* Shared standalone SaaS components */
.page-stack,
.section-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.filter-spacer { flex: 1 1 auto; }

.date-chip,
.soft-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.info-alert {
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-left: 3px solid var(--info);
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 12px;
    line-height: 1.6;
}

.mini-metric-grid,
.result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.mini-metric-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-metric,
.result-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--surface);
    min-width: 0;
}

.mini-metric.highlight {
    border-bottom: 3px solid var(--success);
}

.metric-label,
.result-card .title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.metric-help,
.result-card .desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.45;
}

.result-card .value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.2;
}

.calc-tabs,
.segmented-tabs {
    display: inline-flex;
    gap: 6px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 5px;
    margin-bottom: 24px;
}

.calc-tab,
.segmented-tab {
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 0;
    color: var(--text-muted);
    background: transparent;
}

.calc-tab.active,
.segmented-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.variable-row {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) auto;
    gap: 16px;
}

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

.insight-item,
.settings-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius-md);
}

.settings-option {
    align-items: center;
    justify-content: space-between;
}

.insight-item p,
.settings-option p { margin: 0; }

.insight-title,
.settings-option h4 {
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 800;
    margin-bottom: 4px;
}

.insight-copy,
.settings-option p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.insight-time {
    display: inline-block;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    margin-top: 8px;
}

.settings-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.settings-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    position: sticky;
    top: 96px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.table-scroll .modern-table {
    min-width: 760px;
}

.table-condensed th,
.table-condensed td {
    padding: 9px 10px !important;
    font-size: 11px !important;
    white-space: nowrap;
}

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

@media (max-width: 1180px) {
    .stats-row,
    .mini-metric-grid,
    .mini-metric-grid.three,
    .result-grid,
    .input-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-grid,
    .settings-shell {
        grid-template-columns: 1fr;
    }

    .settings-nav { position: static; }
}

@media (max-width: 860px) {
    :root { --sidebar-w: 76px; }

    .brand { justify-content: center; padding: 0; }
    .brand-text,
    .nav-item span,
    .premium-card { display: none; }
    .nav-menu { padding-inline: 10px; }
    .nav-item { justify-content: center; padding: 12px; }
    .nav-item i { width: auto; }
    .nav-footer { padding: 12px; }

    .topbar {
        padding: 0 18px;
        gap: 12px;
    }

    .search-box { display: none; }
    .profile-info { display: none; }
    .content { padding: 22px 18px; }
    .card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .stats-row,
    .mini-metric-grid,
    .mini-metric-grid.three,
    .result-grid,
    .input-grid {
        grid-template-columns: 1fr;
    }

    .filter-group,
    .filter-bar,
    .variable-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .date-chip,
    .soft-chip,
    .filter-bar .btn,
    .card-actions .btn {
        width: 100%;
    }

    .stat-card { align-items: flex-start; }
    .stat-value { font-size: 22px; }
    .breadcrumb { font-size: 12px; gap: 6px; }
}

/* Visual direction: clean education-SaaS shell adapted for WCU finance ops */

body {
    background:
        radial-gradient(circle at 70% 0%, rgba(6, 91, 255, 0.035), transparent 26rem),
        var(--bg-app);
    color: var(--text-body);
}

.sidebar {
    border-right-color: #E8ECF4;
    box-shadow: 8px 0 28px rgba(16, 24, 52, 0.025);
}

.brand {
    height: 78px;
    padding: 0 30px;
}

.brand-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--primary-light);
    font-size: 15px;
}

.brand-text {
    font-size: 23px;
    color: var(--primary);
    letter-spacing: -0.035em;
}

.nav-menu {
    padding: 14px 16px;
    gap: 8px;
}

.nav-item {
    min-height: 42px;
    padding: 11px 14px;
    border-radius: 9px;
    color: #26324F;
    font-size: 14px;
    font-weight: 700;
}

.nav-item i {
    font-size: 17px;
    color: #6D7890;
}

.nav-item:hover {
    background: #F4F7FB;
    color: var(--text-dark);
}

.nav-item:hover i { color: var(--primary); }

.nav-item.active {
    background: linear-gradient(135deg, #0B6BFF 0%, #054DDF 100%);
    color: #FFFFFF;
    box-shadow: 0 12px 24px -14px rgba(6, 91, 255, 0.85);
}

.nav-item.active i { color: #FFFFFF; }

.premium-card {
    text-align: left;
    border-radius: 10px;
    padding: 18px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FBFDFF 100%);
    box-shadow: 0 10px 24px rgba(16, 24, 52, 0.06);
}

.premium-card-icon {
    margin: 0 0 14px;
    background: #E7FBF7;
    color: var(--success);
}

.premium-card h4 {
    font-size: 14px;
    margin-bottom: 6px;
}

.premium-card p {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}

.premium-btn {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    background: #FFFFFF;
    color: var(--primary);
    border-color: var(--border);
}

.topbar {
    height: 68px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom-color: #E8ECF4;
}

.breadcrumb {
    min-width: 225px;
    font-weight: 700;
    color: #7C879D;
}

.search-box {
    width: min(440px, 38vw);
    margin-inline: auto;
}

.search-box input {
    height: 42px;
    background: #FFFFFF;
    border-color: #E2E7F0;
    border-radius: 9px;
    box-shadow: 0 2px 10px rgba(16, 24, 52, 0.035);
}

.search-shortcut {
    border: 0;
    background: transparent;
    color: #6E7890;
}

.notify-btn {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
}

.notify-btn:hover {
    border-color: var(--border);
    background: #FFFFFF;
}

.notify-badge {
    top: 2px;
    right: 1px;
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.profile-avatar {
    background: linear-gradient(135deg, #0B6BFF, #054DDF);
    box-shadow: 0 8px 18px -12px rgba(6, 91, 255, 0.8);
}

.content {
    padding: 28px 34px;
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 28px;
    letter-spacing: -0.035em;
}

.page-header p {
    color: var(--text-muted);
    font-weight: 500;
}

.ops-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: -4px 0 24px;
}

.ops-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    box-shadow: var(--shadow-card);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

button.ops-chip {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
}

button.ops-chip:hover {
    background: #EEF5FF;
    color: var(--primary);
}

.ops-chip i {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
}

.ops-chip-warning i {
    background: var(--warning-bg);
    color: #A16207;
}

.ops-chip strong {
    display: block;
    color: var(--text-dark);
    font-size: 13px;
    margin-bottom: 1px;
}

.stats-row {
    gap: 16px;
}

.stat-card {
    min-height: 112px;
    border-radius: 13px;
    padding: 22px;
    background: #FFFFFF;
    box-shadow: var(--shadow-card);
}

.stat-card:hover {
    border-color: #D7E4FF;
}

.stat-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    flex: 0 0 auto;
}

.stat-title {
    font-size: 13px;
    font-weight: 800;
    color: #647089;
}

.stat-value {
    font-size: 25px;
    letter-spacing: -0.035em;
}

.trend-text {
    color: #77829A;
    font-weight: 700;
}

.card {
    border-color: var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    padding: 18px 20px;
    background: #FFFFFF;
}

.card-title-group h2 {
    font-size: 17px;
    letter-spacing: -0.025em;
}

.card-subtitle {
    color: var(--text-muted);
}

.card-body {
    padding: 20px;
}

.btn {
    min-height: 40px;
    border-radius: 9px;
    padding-inline: 16px;
    font-weight: 800;
}

.btn-primary {
    background: linear-gradient(135deg, #0B6BFF 0%, #054DDF 100%);
    border-color: transparent;
    box-shadow: 0 12px 22px -15px rgba(6, 91, 255, 0.9);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0057E8 0%, #003FC0 100%);
    border-color: transparent;
}

.btn-outline {
    background: #FFFFFF;
    color: #25324D;
}

.filter-bar {
    background: #FFFFFF;
}

.date-chip,
.soft-chip {
    min-height: 36px;
    background: #F7FAFF;
    color: #52607A;
    border-color: #E4EAF4;
}

.mini-metric,
.result-card,
.settings-option,
.insight-item {
    background: #FFFFFF;
    border-color: var(--border);
    box-shadow: 0 6px 18px rgba(16, 24, 52, 0.035);
}

.mini-metric,
.result-card {
    border-radius: 11px;
}

.metric-label,
.result-card .title {
    color: #6F7A94;
}

.info-alert {
    background: #F4F8FF;
    border-color: #D8E7FF;
    color: #42506B;
}

.calc-tabs,
.segmented-tabs {
    background: #F5F8FC;
    border-color: #E5EAF3;
}

.calc-tab.active,
.segmented-tab.active {
    color: var(--primary);
    box-shadow: 0 7px 18px rgba(16, 24, 52, 0.08);
}

.modern-table th {
    background: #FBFCFF;
    color: #66728A;
    font-weight: 800;
}

.modern-table td {
    color: #293653;
}

.modern-table tr:hover td {
    background: #F8FBFF;
}

.badge {
    border-radius: 999px;
    font-size: 11px;
    padding: 5px 10px;
}

.action-grid {
    grid-template-columns: 1fr;
}

.action-box {
    min-height: 78px;
    border-radius: 11px;
    background: linear-gradient(135deg, #F7FAFF 0%, #FFFFFF 100%);
}

.action-box:nth-child(2) {
    background: linear-gradient(135deg, #F1FFFB 0%, #FFFFFF 100%);
}

.action-box:nth-child(3) {
    background: linear-gradient(135deg, #FFF8EF 0%, #FFFFFF 100%);
}

.action-icon {
    border-radius: 13px;
}

.settings-nav {
    box-shadow: var(--shadow-card);
}

.settings-nav .nav-item.active {
    box-shadow: none;
}

@media (max-width: 1180px) {
    .ops-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    :root { --sidebar-w: 76px; }
    .brand-icon {
        display: inline-flex;
        width: 38px;
        height: 38px;
    }
    .topbar-right { gap: 8px; }
    .content { padding: 22px 18px; }
}

@media (max-width: 640px) {
    :root {
        --sidebar-w: 0px;
    }
    
    .sidebar {
        width: 100%;
        height: 60px;
        top: auto;
        bottom: 0;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        z-index: 100;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    }
    .brand, .nav-footer { display: none; }
    .nav-menu {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0;
        margin: 0;
    }
    .nav-item {
        flex-direction: column;
        padding: 6px;
        gap: 4px;
        font-size: 10px;
        justify-content: center;
    }
    .nav-item i { font-size: 18px; }
    .nav-item span { display: block; font-size: 10px; line-height: 1; }
    
    .main {
        margin-left: 0;
        width: 100%;
        margin-bottom: 60px;
    }

    .page-header h1 { font-size: 24px; }
    .ops-strip { grid-template-columns: 1fr; }
    .breadcrumb { display: none; }
    .topbar-brand { display: flex; }
    .api-status-badge { display: none !important; }
}

/* Interaction and surface refinements */
.card {
    border-color: transparent;
}

.card-header {
    border-bottom-color: var(--border-soft);
}

.info-alert {
    border: 0;
    border-left: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #F3F7FF 0%, #F8FBFF 100%);
    box-shadow: 0 10px 24px rgba(16, 24, 52, 0.035);
}

.mini-metric,
.result-card {
    border: 0;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
    box-shadow: 0 10px 24px rgba(16, 24, 52, 0.055);
}

.mini-metric.highlight {
    border-bottom: 0;
    background: linear-gradient(180deg, #FFFFFF 0%, #F2FFFB 100%);
    box-shadow: 0 10px 24px rgba(32, 191, 163, 0.12);
}

.result-grid {
    gap: 18px;
    margin-bottom: 18px;
}

.calc-summary {
    margin-top: 4px;
    padding: 16px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EEF5FF 0%, #F7FAFF 100%);
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(6, 91, 255, 0.08);
}

.calc-tabs {
    width: fit-content;
    margin-bottom: 28px;
}

.calc-tab {
    font-family: inherit;
}

.calc-tab:not(.active):hover {
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.7);
}

.date-trigger {
    cursor: pointer;
    border: 0;
    box-shadow: 0 8px 20px rgba(16, 24, 52, 0.055);
}

.date-trigger.is-active,
.date-trigger:hover {
    background: #EEF5FF;
    color: var(--primary);
}

.floating-panel {
    position: absolute;
    display: none;
    z-index: 1000;
    padding: 14px;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 22px 60px rgba(16, 24, 52, 0.18);
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    transform: translateY(18px);
    opacity: 0;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 12px;
    background: #101834;
    color: #FFFFFF;
    box-shadow: 0 18px 38px rgba(16, 24, 52, 0.24);
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    transition: var(--transition);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.floating-panel.is-open {
    display: block;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.panel-title-row strong {
    display: block;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 2px;
}

.panel-title-row span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.notification-panel {
    width: 340px;
}

.notify-list {
    display: grid;
    gap: 8px;
}

.notify-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 11px;
    background: #F8FBFF;
    color: var(--text-body);
    text-align: left;
    cursor: pointer;
}

.notify-item:hover {
    background: #EEF5FF;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.breadcrumb-separator {
    font-size: 10px;
    margin: 0 4px;
}

.page-stack-24 {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.chart-wrap {
    height: 320px;
    width: 100%;
}

.chart-filter-select {
    min-width: 150px;
    padding: 6px 32px 6px 12px;
    font-weight: 600;
}

.link-cta {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.insight-icon {
    margin-top: 2px;
}

.insight-content {
    flex: 1;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.table-right {
    text-align: right;
}

.modern-table th.table-right,
.modern-table td.table-right {
    text-align: right !important;
}

.modern-table td.table-right .value-strong,
.modern-table td.table-right .meta-text,
.modern-table td.table-right .value-strong.text-success,
.modern-table td.table-right .value-strong.text-danger {
    display: block;
    text-align: right;
}

.value-strong {
    font-weight: 700;
}

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

.action-icon-info { background: var(--info); }
.action-icon-success { background: var(--success); }
.action-icon-warning { background: var(--warning); }

.action-chevron {
    margin-left: auto;
    color: var(--text-light);
    font-size: 12px;
}

.card-mb-24 {
    margin-bottom: 24px;
}

.card-header-compact {
    padding-bottom: 16px;
}

.subtitle-gap {
    margin-top: 4px;
}

.section-title-sm {
    font-size: 15px;
}

.form-group-compact {
    margin-bottom: 0;
}

.row-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.helper-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.filter-bar-compact {
    padding: 16px 24px;
}

.label-inline {
    margin-bottom: 0;
}

.filter-select {
    min-width: 140px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.invalid-input {
    width: 80px;
    padding-top: 8px;
    padding-bottom: 8px;
    text-align: center;
}

.btn-pad {
    padding: 8px 20px;
}

.roas-note {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.table-cell-center {
    text-align: center;
}

.table-date {
    font-weight: 600;
}

.table-profit {
    font-weight: 700;
    color: var(--success);
}

.table-profit-danger {
    font-weight: 700;
    color: var(--danger);
}

.page-title-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    color: var(--primary);
    font-size: 24px;
}

.w-320 {
    max-width: 320px;
}

.w-150 {
    max-width: 150px;
}

.section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.section-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-save {
    padding: 10px 24px;
}

.settings-nav-item {
    margin-bottom: 4px;
}

.settings-text {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.theme-switcher label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.theme-select {
    min-height: 34px;
    min-width: 118px;
    padding: 6px 30px 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: #FFFFFF;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 700;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: radial-gradient(circle at 70% 0%, rgba(59, 130, 246, 0.16), transparent 28rem), #0A1224;
    color: #C3CEE3;
}

html[data-theme="dark"] .sidebar {
    background: #0E1830;
    border-right-color: #1B2A4A;
    box-shadow: 8px 0 28px rgba(3, 8, 24, 0.45);
}

html[data-theme="dark"] .brand-text,
html[data-theme="dark"] .card-title-group h2,
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .action-text h4,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .breadcrumb .active {
    color: #E3EBFF;
}

html[data-theme="dark"] .nav-item {
    color: #B5C3E0;
}

html[data-theme="dark"] .nav-item:hover {
    background: #172744;
    color: #E3EBFF;
}

html[data-theme="dark"] .topbar {
    background: rgba(12, 20, 38, 0.9);
    border-bottom-color: #1B2A4A;
}

html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .theme-select,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .date-custom input[type="date"] {
    background-color: #0F1C35;
    border-color: #24385F;
    color: #E3EBFF;
    box-shadow: none;
}

html[data-theme="dark"] .search-shortcut,
html[data-theme="dark"] .date-chip,
html[data-theme="dark"] .soft-chip,
html[data-theme="dark"] .ops-chip,
html[data-theme="dark"] .action-box,
html[data-theme="dark"] .notify-item,
html[data-theme="dark"] .search-result-item,
html[data-theme="dark"] .empty-result {
    background: #101D38;
    border-color: #24385F;
    color: #C3CEE3;
}

html[data-theme="dark"] .ops-chip strong,
html[data-theme="dark"] .search-result-item strong,
html[data-theme="dark"] .notify-item strong,
html[data-theme="dark"] .page-header p,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .stat-title,
html[data-theme="dark"] .meta-text,
html[data-theme="dark"] .profile-role,
html[data-theme="dark"] .theme-switcher label {
    color: #9FB1D5;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .mini-metric,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .settings-option,
html[data-theme="dark"] .insight-item,
html[data-theme="dark"] .premium-card,
html[data-theme="dark"] .date-custom,
html[data-theme="dark"] .info-alert,
html[data-theme="dark"] .generated-report,
html[data-theme="dark"] .report-copy,
html[data-theme="dark"] .floating-panel,
html[data-theme="dark"] .empty-report {
    background: #0F1B34;
    border-color: #213458;
    color: #C3CEE3;
    box-shadow: 0 10px 24px rgba(3, 8, 24, 0.35);
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modern-table th,
html[data-theme="dark"] .modern-table td,
html[data-theme="dark"] .section-divider {
    border-color: #213458;
}

html[data-theme="dark"] .modern-table th {
    background: #132242;
    color: #AFC0DF;
}

html[data-theme="dark"] .modern-table td {
    color: #D6E0F7;
}

html[data-theme="dark"] .modern-table tr:hover td {
    background: #15274A;
}

html[data-theme="dark"] .table-profit {
    color: #4ADE80;
}

html[data-theme="dark"] .table-profit-danger {
    color: #F87171;
}

html[data-theme="dark"] .btn-outline {
    background: #132444;
    color: #D6E0F7;
    border-color: #2A4270;
}

html[data-theme="dark"] .btn-outline:hover {
    background: #1A2D52;
}

html[data-theme="dark"] .date-presets button:hover,
html[data-theme="dark"] .date-presets button.active {
    background: #1C315A;
    color: #E3EBFF;
}

html[data-theme="dark"] .filter-bar {
    background: #0F1B34;
}

html[data-theme="dark"] .notify-btn:hover {
    background: #182B50;
    border-color: #2A4270;
}

html[data-theme="dark"] .profile-menu:hover {
    background: #162A4D;
}

html[data-theme="dark"] .premium-btn {
    background: #132444;
    border-color: #2A4270;
    color: #9FC3FF;
}

html[data-theme="dark"] .premium-card p {
    border-bottom-color: #213458;
}

@media (max-width: 860px) {
    .theme-switcher label {
        display: none;
    }

    .theme-select {
        min-width: 102px;
    }
}

@media (max-width: 640px) {
    .row-space-between {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

.notify-item i {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: #FFFFFF;
    color: var(--primary);
}

.notify-item strong {
    display: block;
    color: var(--text-dark);
    font-size: 13px;
    margin-bottom: 2px;
}

.notify-item span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.date-range-panel {
    width: min(560px, calc(100vw - 24px));
}

.search-panel {
    width: 430px;
}

.search-results {
    display: grid;
    gap: 8px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 11px;
    background: #F8FBFF;
    color: var(--text-body);
    text-align: left;
    cursor: pointer;
}

.search-result-item:hover {
    background: #EEF5FF;
    color: var(--primary);
}

.search-result-item strong {
    display: block;
    color: var(--text-dark);
    font-size: 13px;
    margin-bottom: 3px;
}

.search-result-item small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.empty-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 11px;
    background: #F8FBFF;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.report-generator {
    margin-bottom: 24px;
}

.report-prompt {
    width: 100%;
    resize: vertical;
    min-height: 92px;
    padding: 14px 16px;
    border: 0;
    border-radius: 12px;
    background: #F8FBFF;
    color: var(--text-dark);
    box-shadow: inset 0 0 0 1px rgba(16, 24, 52, 0.07);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.report-prompt:focus {
    box-shadow: inset 0 0 0 1px rgba(6, 91, 255, 0.32), 0 0 0 4px rgba(6, 91, 255, 0.08);
}

.generated-report {
    margin-top: 16px;
}

.empty-report {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F8FBFF 0%, #FFFFFF 100%);
    color: var(--text-muted);
    font-weight: 700;
}

.empty-report i {
    color: var(--primary);
}

.generated-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.generated-report-header h3 {
    margin: 8px 0 4px;
    color: var(--text-dark);
    font-size: 18px;
}

.generated-report-header p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.report-kpi-grid div {
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFF 100%);
    box-shadow: 0 10px 24px rgba(16, 24, 52, 0.045);
}

.report-kpi-grid span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.report-kpi-grid strong {
    color: var(--text-dark);
    font-size: 18px;
}

.report-copy {
    display: block;
    padding: 24px;
    border-radius: 12px;
    background: #F8FBFF;
    color: var(--text-body);
    line-height: 1.65;
}

.report-copy p {
    margin-bottom: 1em;
}

.report-copy h1, .report-copy h2, .report-copy h3, .report-copy h4 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    color: var(--text-dark);
}

.report-copy ul, .report-copy ol {
    margin-bottom: 1em;
    padding-left: 20px;
}
.report-copy table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.report-copy th, .report-copy td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.report-copy th {
    background-color: #f4f7fa;
    font-weight: 700;
    color: var(--text-dark);
}
html[data-theme="dark"] .report-copy table {
    background: #111827;
}
html[data-theme="dark"] .report-copy th {
    background: #1f2937;
}


.date-range-panel { width: min(780px, calc(100vw - 24px)); }
.date-picker-grid { display: grid; grid-template-columns: 200px 1fr; gap: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; }
.date-presets { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--border); background: #FAFAFA; }
.date-presets button { display: flex; align-items: center; width: 100%; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-body); text-align: left; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.date-presets button:hover { background: #EFEFEF; }
.date-presets button.active { background: #E8F0FE; color: var(--primary); font-weight: 600; }
.date-custom { display: flex; flex-direction: column; background: #FFFFFF; }
.dual-calendar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; }
.calendar-month { display: flex; flex-direction: column; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 600; color: var(--text-dark); }
.calendar-header button { background: transparent; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; }
.calendar-header button:hover { background: #F0F0F0; color: var(--text-dark); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.day-cell { position: relative; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; color: var(--text-dark); z-index: 1; }
.day-cell.empty { pointer-events: none; }
.day-cell:hover:not(.empty):not(.disabled) { background: #F0F0F0; border-radius: 4px; }
.day-cell.disabled { color: #CCC; cursor: not-allowed; background: transparent !important; }
.day-cell.in-range { background: #E8F0FE; color: var(--text-dark); }
.day-cell.start-date { background: var(--primary); color: #FFF; border-radius: 4px 0 0 4px; }
.day-cell.end-date { background: var(--primary); color: #FFF; border-radius: 0 4px 4px 0; }
.day-cell.start-date.end-date { border-radius: 4px; }
.date-compare-section { display: flex; flex-direction: column; background: #FAFAFA; border-top: 1px solid var(--border); }
.compare-toggle-row { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.compare-toggle-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-dark); cursor: pointer; }
.compare-rows-container { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.compare-range-row { display: flex; align-items: center; gap: 12px; }
.compare-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.primary-dot { background-color: var(--primary); }
.compare-dot-bg { background-color: #CBD5E1; }
.compare-preset-display { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-dark); }
.compare-select { flex: 1; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text-dark); background: #FFF; outline: none; }
.compare-select:disabled { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }
.compare-inputs { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.compare-inputs input { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; width: 110px; text-align: center; color: var(--text-dark); background: #FFF; outline: none; }
.compare-inputs input:disabled { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }
.panel-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }

@media (max-width: 768px) {
    .floating-panel {
        left: 12px !important;
        right: 12px;
        width: auto !important;
    }

    .date-picker-grid {
        grid-template-columns: 1fr;
    }
    
    .dual-calendar {
        grid-template-columns: 1fr;
    }

    .generated-report-header {
        flex-direction: column;
    }

    .report-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Final dark theme pass (Stockbit-inspired) */
html[data-theme="dark"] {
    --bg-app: #071326;
    --surface: #0E1D37;
    --border: #1E3559;
    --border-soft: #1B2F51;
    --text-dark: #E6EEFF;
    --text-body: #C9D6EF;
    --text-muted: #8EA3C7;
    --text-light: #7089B0;
    --primary: #2E7BFF;
    --primary-hover: #1D67E8;
    --primary-light: #11294D;
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 78% -10%, rgba(46, 123, 255, 0.24), transparent 30rem),
        radial-gradient(circle at 10% 120%, rgba(11, 92, 204, 0.16), transparent 26rem),
        #071326;
    color: var(--text-body);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .mini-metric,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .settings-option,
html[data-theme="dark"] .insight-item,
html[data-theme="dark"] .premium-card,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .floating-panel,
html[data-theme="dark"] .date-custom,
html[data-theme="dark"] .generated-report,
html[data-theme="dark"] .report-copy,
html[data-theme="dark"] .report-kpi-grid div,
html[data-theme="dark"] .empty-report,
html[data-theme="dark"] .settings-nav,
html[data-theme="dark"] .calc-summary {
    background: #0D1C35;
    border-color: var(--border);
    box-shadow: 0 10px 26px rgba(2, 8, 24, 0.45);
}

html[data-theme="dark"] .sidebar {
    background: #0B1830;
    border-right-color: #183055;
}

html[data-theme="dark"] .topbar {
    background: rgba(9, 20, 40, 0.9);
    border-bottom-color: #183055;
}

html[data-theme="dark"] .nav-item {
    color: #B7C8E7;
}

html[data-theme="dark"] .nav-item:hover {
    background: #132847;
    color: #E8F0FF;
}

html[data-theme="dark"] .nav-item.active {
    background: linear-gradient(135deg, #2E7BFF 0%, #1E63D6 100%);
    color: #FFFFFF;
}

html[data-theme="dark"] .brand-text,
html[data-theme="dark"] .card-title-group h2,
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .action-text h4,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .breadcrumb .active,
html[data-theme="dark"] .insight-title,
html[data-theme="dark"] .section-heading,
html[data-theme="dark"] .generated-report-header h3,
html[data-theme="dark"] .report-kpi-grid strong {
    color: #E6EEFF;
}

html[data-theme="dark"] .page-header p,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .stat-title,
html[data-theme="dark"] .meta-text,
html[data-theme="dark"] .profile-role,
html[data-theme="dark"] .theme-switcher label,
html[data-theme="dark"] .insight-copy,
html[data-theme="dark"] .settings-text,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .metric-help,
html[data-theme="dark"] .report-copy,
html[data-theme="dark"] .generated-report-header p,
html[data-theme="dark"] .report-kpi-grid span,
html[data-theme="dark"] .panel-title-row span {
    color: #8EA3C7;
}

html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .theme-select,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .date-custom input[type="date"],
html[data-theme="dark"] .report-prompt {
    background: #0A1A33;
    border-color: #264370;
    color: #E6EEFF;
    box-shadow: inset 0 0 0 1px rgba(37, 66, 112, 0.5);
}

html[data-theme="dark"] .search-shortcut,
html[data-theme="dark"] .date-chip,
html[data-theme="dark"] .soft-chip,
html[data-theme="dark"] .ops-chip,
html[data-theme="dark"] .action-box,
html[data-theme="dark"] .notify-item,
html[data-theme="dark"] .search-result-item,
html[data-theme="dark"] .empty-result {
    background: #102443;
    border-color: #284975;
    color: #C9D6EF;
}

html[data-theme="dark"] .ops-chip strong,
html[data-theme="dark"] .search-result-item strong,
html[data-theme="dark"] .notify-item strong {
    color: #E6EEFF;
}

html[data-theme="dark"] .modern-table th,
html[data-theme="dark"] .modern-table td,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .section-divider {
    border-color: #1E3559;
}

html[data-theme="dark"] .modern-table th {
    background: #122747;
    color: #9AB1D5;
}

html[data-theme="dark"] .modern-table td {
    background: #0D1C35;
    color: #D6E4FF;
}

html[data-theme="dark"] .modern-table tr:hover td {
    background: #142B4F;
}

html[data-theme="dark"] .info-alert {
    background: linear-gradient(135deg, #122B4D 0%, #0F2240 100%);
    color: #AFC3E7;
}

html[data-theme="dark"] .calc-summary {
    background: linear-gradient(135deg, #122B4D 0%, #0E2340 100%);
    color: #83B2FF;
    box-shadow: inset 0 0 0 1px rgba(46, 123, 255, 0.25);
}

html[data-theme="dark"] .btn-outline {
    background: #122748;
    color: #D9E6FF;
    border-color: #2D4F7D;
}

html[data-theme="dark"] .btn-outline:hover {
    background: #1A3259;
}

html[data-theme="dark"] .notify-btn:hover {
    background: #173257;
    border-color: #2D4F7D;
}

html[data-theme="dark"] .profile-menu:hover {
    background: #143055;
}

html[data-theme="dark"] .settings-nav {
    background: #0F223F;
}

html[data-theme="dark"] .settings-nav .nav-item:not(.active) {
    color: #A8BDDE;
}

html[data-theme="dark"] .settings-nav .nav-item:not(.active):hover {
    background: #173157;
}

html[data-theme="dark"] .premium-btn {
    background: #132A4C;
    border-color: #2C507F;
    color: #9FC3FF;
}

html[data-theme="dark"] .premium-card p {
    border-bottom-color: #1E3559;
}

html[data-theme="dark"] .date-presets button {
    color: #B8C8E6;
}

html[data-theme="dark"] .date-presets button:hover,
html[data-theme="dark"] .date-presets button.active {
    background: #1A3560;
    color: #E8F0FF;
}

html[data-theme="dark"] .date-custom .compare-row,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .search-shortcut {
    color: #8FA7CB;
}

html[data-theme="dark"] .notify-item i {
    background: #17365E;
    color: #8FB9FF;
}

html[data-theme="dark"] .empty-report,
html[data-theme="dark"] .action-box:nth-child(2),
html[data-theme="dark"] .action-box:nth-child(3),
html[data-theme="dark"] .action-box {
    background: #102443;
}

html[data-theme="dark"] .report-prompt:focus,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .search-box input:focus,
html[data-theme="dark"] .theme-select:focus {
    box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.28);
    border-color: #3F78C7;
}
