:root {
    --brand: #1f2937;
    --bg: #f7f7f9;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --text-muted: #6b7280;
    --up: #047857;
    --down: #b91c1c;
    --flat: #6b7280;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Login ---------- */

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: 16px;
    padding: 36px 32px 24px;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    max-height: 48px;
    margin: 0 auto 12px;
    display: block;
}

.login-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.subtitle {
    color: var(--text-muted);
    margin: 4px 0 0;
    font-size: 14px;
}

.alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 120ms ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.08);
}

.login-form button {
    margin-top: 4px;
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 120ms ease;
}

.login-form button:hover { opacity: 0.92; }

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---------- Dashboard ---------- */

.topbar {
    background: var(--surface);
    border-bottom: 3px solid var(--brand);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-brand { display: flex; align-items: center; gap: 12px; }

.topbar-logo { max-height: 36px; display: block; }

.topbar-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.topbar-name { font-weight: 600; }

.topbar-period { font-size: 13px; color: var(--text-muted); }

.topbar-nav { display: flex; align-items: center; gap: 16px; }

.topbar-user { font-size: 13px; color: var(--text-muted); }

.topbar-logout {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 120ms ease;
}

.topbar-logout:hover { background: var(--bg); color: var(--text); }

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.intro {
    color: var(--text-muted);
    margin: 0 0 24px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-value {
    font-size: 32px;
    font-weight: 600;
    margin: 8px 0 4px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kpi-delta {
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.kpi-delta--up { color: var(--up); }
.kpi-delta--down { color: var(--down); }
.kpi-delta--flat { color: var(--flat); }

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

.dashboard-footer {
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}

/* ---------- Generic ---------- */

.empty-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
}

.empty-shell h1 { font-size: 22px; margin-bottom: 8px; }
.empty-shell p { color: var(--text-muted); margin: 0; }
