/* Commodity Intelligence Dashboard — design tokens + shell layout */

:root {
    --surface-1: #fcfcfb;
    --page-plane: #f9f9f7;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --text-muted: #898781;
    --gridline: #e1e0d9;
    --baseline: #c3c2b7;
    --border-hairline: rgba(11, 11, 11, 0.10);

    --series-blue: #2a78d6;
    --series-orange: #eb6834;
    --series-aqua: #1baf7a;
    --series-yellow: #eda100;
    --series-violet: #4a3aa7;

    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-serious: #ec835a;
    --status-critical: #d03b3b;
    --status-good-text: #006300;

    --sidebar-width: 230px;
    --topbar-height: 60px;
}

* { box-sizing: border-box; }

body.admin-body {
    background: var(--page-plane);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ─── Shell layout ─────────────────────────────────────────────────────── */

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

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--text-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-brand i { color: var(--series-blue); font-size: 1.3rem; }

.sidebar-nav { flex: 1; padding: 14px 10px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.92rem;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-nav a.active { background: var(--series-blue); color: #fff; }
.sidebar-nav a i { width: 18px; text-align: center; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.sidebar-footer .text-muted { color: rgba(255, 255, 255, 0.45) !important; }

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-hairline);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.topbar-right { display: flex; align-items: center; }
.sidebar-toggle { background: none; border: none; font-size: 1.4rem; }

.app-content { padding: 24px; }

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -100%;
        z-index: 1050;
        transition: left 0.2s ease;
    }
    .app-sidebar.open { left: 0; }
}

/* ─── Login page ───────────────────────────────────────────────────────── */

body.login-page {
    background: var(--page-plane);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.login-wrap { width: 100%; max-width: 380px; padding: 20px; }

.login-card {
    background: var(--surface-1);
    border: 1px solid var(--border-hairline);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 8px 24px rgba(11, 11, 11, 0.06);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--series-blue);
    color: #fff;
    font-size: 1.4rem;
}

/* ─── Stat tiles (dashboard KPIs) ──────────────────────────────────────── */

.stat-tile {
    background: var(--surface-1);
    border: 1px solid var(--border-hairline);
    border-radius: 12px;
    padding: 18px 20px;
    height: 100%;
}

.stat-tile .stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-tile .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 2px;
}

.stat-tile .stat-delta { font-size: 0.85rem; font-weight: 600; }
.stat-tile .stat-meta { font-size: 0.76rem; color: var(--text-muted); }

.text-success { color: var(--status-good-text) !important; }
.text-danger { color: var(--status-critical) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ─── Sentiment / status badges ────────────────────────────────────────── */

.badge-bullish { background: var(--status-good); color: #fff; }
.badge-bearish { background: var(--status-critical); color: #fff; }
.badge-neutral { background: var(--text-muted); color: #fff; }

/* ─── Cards / panels ────────────────────────────────────────────────────── */

.panel {
    background: var(--surface-1);
    border: 1px solid var(--border-hairline);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.market-score-ring {
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.news-item { padding: 10px 0; border-bottom: 1px solid var(--gridline); }
.news-item:last-child { border-bottom: none; }
.news-item .news-title { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); text-decoration: none; }
.news-item .news-title:hover { color: var(--series-blue); }
.news-item .news-meta { font-size: 0.75rem; color: var(--text-muted); }
