/* SISKIN Labs Branding */
:root {
    --siskin-yellow: #f0e51b;
    --siskin-navy: #1D3557;
    --siskin-red: #E63946;
    --siskin-text: #2B2D42;
    --siskin-gray: #F8F9FA;
    --topbar-height: 56px;
    --footer-height: 40px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #FAFAFA;
    color: var(--siskin-text);
    margin: 0;
}

/* ── Top bar: full-width, pinned ── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: white;
    border-bottom: 3px solid var(--siskin-yellow);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1.25rem;
    z-index: 1100;
}

.topbar img {
    height: 36px;
    border-radius: 6px;
}

.topbar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
}

.topbar-sep {
    color: #ccc;
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0 2px;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
}

/* ── Container below topbar ── */
.below-topbar {
    padding-top: var(--topbar-height);
    padding-bottom: var(--footer-height);
    display: flex;
    min-height: calc(100vh - var(--footer-height));
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: var(--footer-height);
    width: 16rem;
    background: var(--siskin-gray);
    border-right: 1px solid #E5E5E5;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: var(--siskin-text) !important;
    padding: 0.6rem 1rem;
    border-left: 4px solid transparent;
    border-radius: 0 !important;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    background: rgba(240, 229, 27, 0.10);
    text-decoration: none;
}

.sidebar .nav-link.active {
    background: rgba(240, 229, 27, 0.25) !important;
    border-left: 4px solid var(--siskin-yellow);
    color: var(--siskin-navy) !important;
    font-weight: 600;
}

/* ── Main content ── */
.main-content {
    margin-left: 16rem;
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* page-header class kept for backwards compat but hidden — title is in topbar */
.page-header {
    display: none;
}

/* ── Button overrides — SISKIN palette ── */
.btn-primary {
    background-color: var(--siskin-navy) !important;
    border-color: var(--siskin-navy) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #152a45 !important;
    border-color: #152a45 !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.btn-info {
    background-color: var(--siskin-navy) !important;
    border-color: var(--siskin-navy) !important;
    color: white !important;
}
.btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: #152a45 !important;
    border-color: #152a45 !important;
    color: white !important;
}

.btn-outline-danger {
    color: var(--siskin-red) !important;
    border-color: var(--siskin-red) !important;
}
.btn-outline-danger:hover {
    background-color: var(--siskin-red) !important;
    color: white !important;
}

.btn-outline-secondary {
    color: var(--siskin-navy) !important;
    border-color: #ccc !important;
}
.btn-outline-secondary:hover {
    background-color: var(--siskin-gray) !important;
    color: var(--siskin-navy) !important;
}

/* ── Cards ── */
.source-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #EEE;
    margin-bottom: 1rem;
}

/* ── Section headers ── */
.section-header {
    color: var(--siskin-navy);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--siskin-red);
}

/* ── Info / source boxes ── */
.info-box,
.source-box {
    background: var(--siskin-gray);
    border-left: 4px solid var(--siskin-red);
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #666;
}

/* ── Status indicators ── */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.status-recent { background-color: #2A9D8F; }
.status-stale  { background-color: #F4A261; }
.status-error  { background-color: #E63946; }

/* ── KPI metric cards ── */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #EEE;
    text-align: center;
}
.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--siskin-navy);
}
.kpi-card .kpi-label {
    font-size: 0.85rem;
    color: #666;
}

/* ── Footer: pinned to bottom ── */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: white;
    border-top: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.app-footer p {
    margin: 0;
    font-size: 0.75rem;
    color: #999;
}

/* ── Chart Builder panel sections ── */
.cb-section {
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.cb-section-header {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--siskin-navy);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.cb-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.25rem;
}

.cb-source-info {
    display: inline-block;
    background: #F0F0F0;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    color: #666;
    margin-top: 4px;
}

.cb-section-ai {
    border-left: 3px solid var(--siskin-yellow);
}

.cb-section .form-check {
    padding-top: 1px;
    padding-bottom: 1px;
    min-height: auto;
}

.cb-section .dash-dropdown {
    font-size: 0.8rem;
}

.cb-section .Select-control {
    font-size: 0.8rem;
}

/* ── Chart clipboard copy button ── */
.cb-chart-wrap {
    position: relative;
}

.cb-copy-btn {
    position: absolute;
    top: 8px;
    right: -32px;
    z-index: 10;
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #999;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s;
}

.cb-copy-btn:hover {
    color: var(--siskin-navy);
}

.cb-data-table {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.cb-data-table td {
    text-align: right;
}

.cb-data-table td:first-child {
    text-align: left;
}
