/* ============================================================
   Lumen Web — Base Styles
   Matching the mobile theme system as closely as possible.
   Light theme variables are set here; dark/calm can be added later.
   ============================================================ */

:root {
    --color-background: #F0F4F8;
    --color-card: #FFFFFF;
    --color-text-primary: #1B2250;
    --color-text-secondary: #6282E3;
    --color-accent: #512BD4;
    --color-danger: #D32F2F;
    --border-radius-card: 20px;
    --border-radius-button: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Segoe UI', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
}

/* ---- Layout ---- */

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

.sidebar {
    width: 220px;
    background-color: var(--color-card);
    padding: 24px 16px;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

main {
    flex: 1;
    padding: 32px;
    max-width: 900px;
}

.content {
    max-width: 800px;
}

/* ---- Nav menu ---- */

.nav-brand {
    margin-bottom: 32px;
}

.brand-name {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--color-text-primary);
}

.brand-tagline {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: 15px;
    transition: background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--color-background);
    color: var(--color-accent);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
}

.nav-label {
    margin-left: 6px;
}

/* ---- Cards ---- */

.card {
    display: block;
    background-color: var(--color-card);
    border-radius: var(--border-radius-card);
    padding: 20px;
    text-decoration: none;
    color: var(--color-text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s, box-shadow 0.15s;
    margin-bottom: 16px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.card p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.quote-card {
    background-color: var(--color-card);
    border-radius: var(--border-radius-card);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quote-text {
    font-size: 18px;
    color: var(--color-text-secondary);
    font-style: italic;
    margin: 0;
}

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

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--color-background);
}

.login-box {
    background-color: var(--color-card);
    border-radius: var(--border-radius-card);
    padding: 48px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.app-name {
    font-size: 42px;
    font-weight: bold;
    color: var(--color-text-primary);
    margin: 0 0 8px;
}

.app-tagline {
    color: var(--color-text-secondary);
    margin: 0 0 40px;
    font-size: 15px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-social {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-button);
    background-color: white;
    color: var(--color-text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-social:hover:not(:disabled) {
    background-color: var(--color-background);
}

.btn-social:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.terms a {
    color: var(--color-accent);
    text-decoration: underline;
}

.error-message {
    color: var(--color-danger);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ---- Danger button ---- */

.btn-danger {
    padding: 12px 24px;
    background-color: var(--color-danger);
    color: white;
    border: none;
    border-radius: var(--border-radius-button);
    font-size: 16px;
    cursor: pointer;
}

/* ---- Section headings ---- */

h1 {
    font-size: 28px;
    color: var(--color-text-primary);
    margin: 0 0 8px;
}

.subtitle {
    color: var(--color-text-secondary);
    margin: 0 0 24px;
}

section {
    margin-bottom: 32px;
}

section h2 {
    font-size: 18px;
    margin: 0 0 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* ---- Placeholder ---- */

.coming-soon {
    background-color: var(--color-card);
    border-radius: var(--border-radius-card);
    padding: 32px;
    text-align: center;
    color: var(--color-text-secondary);
}

/* ---- Mobile responsive ---- */

@media (max-width: 767px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        padding: 6px 8px;
        border-right: none;
        border-top: 1px solid #e0e0e0;
        z-index: 100;
        background-color: var(--color-card);
    }

    .nav-brand {
        display: none;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
    }

    .nav-links li {
        margin-bottom: 0;
        flex: 1;
        text-align: center;
    }

    .nav-links a {
        padding: 6px 4px;
        font-size: 11px;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        line-height: 1.2;
    }

    .nav-icon {
        font-size: 20px;
    }

    .nav-label {
        margin-left: 0;
    }

    main {
        padding: 16px;
        padding-bottom: 72px;
        max-width: 100%;
    }

    .content {
        max-width: 100%;
    }

    h1 {
        font-size: 22px;
    }

    .login-box {
        padding: 32px 20px;
        margin: 16px;
        max-width: 100%;
    }

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

/* ---- Blazor error UI ---- */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ============================================================
   App page components — use design-system tokens from
   colors_and_type.css (loaded first in index.html).
   ============================================================ */

/* ── Greeting header ── */
.greeting-header { margin-bottom: 20px; }
.greeting-day-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-wash); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px 14px;
    font-size: 12px; font-weight: 600; color: var(--accent-bold);
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 10px;
}
.greeting-title { font-family: var(--font-serif); font-size: 26px; font-weight: 500; color: var(--ink-1); margin: 0 0 4px; }
.greeting-sub   { font-size: 14px; color: var(--ink-3); margin: 0; }

/* ── Quote card ── */
.app-quote-card {
    background: var(--accent-wash); border-radius: 18px; padding: 18px 20px;
    margin-bottom: 20px; border: 1px solid var(--border);
}
.app-quote-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-bold); margin-bottom: 6px; }
.app-quote-text  { font-family: var(--font-serif); font-size: 17px; line-height: 1.45; color: var(--accent-ink); margin: 0; }

/* ── Quick stat strip ── */
.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.quick-stat-card {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 16px; padding: 14px 12px; text-align: center;
    box-shadow: var(--shadow-sm);
}
.quick-stat-icon { font-size: 22px; margin-bottom: 4px; color: var(--accent); }
.quick-stat-icon .material-symbols-rounded { font-size: 22px; }
.quick-stat-value { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink-1); line-height: 1.1; }
.quick-stat-label { font-size: 10px; color: var(--ink-3); margin-top: 3px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── App nav tiles ── */
.app-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app-tile {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 18px; padding: 18px 16px; text-decoration: none;
    display: flex; align-items: center; gap: 14px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}
.app-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.app-tile-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-tile-title { font-size: 15px; font-weight: 600; color: var(--ink-1); margin: 0 0 2px; }
.app-tile-sub   { font-size: 12px; color: var(--ink-3); margin: 0; }

/* ── Activity feed ── */
.feed-section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.feed-section-title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--ink-1); margin: 0; }
.feed-add-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent); color: var(--ink-on-accent);
    border: 0; border-radius: 999px; padding: 8px 16px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: var(--font-sans);
    transition: transform 0.15s;
}
.feed-add-btn:hover { transform: translateY(-1px); }

.feed-entry {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 18px; padding: 14px 16px;
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.feed-entry-dot {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #fff;
}
.feed-entry-body { flex: 1; min-width: 0; }
.feed-entry-type  { font-size: 13px; font-weight: 600; color: var(--ink-1); margin: 0 0 2px; }
.feed-entry-value { font-family: var(--font-serif); font-size: 16px; color: var(--ink-1); margin: 0 0 4px; font-weight: 500; }
.feed-entry-meta  { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.feed-entry-meta .sep { opacity: 0.4; }
.feed-entry-meta .logger { color: var(--accent-bold); font-weight: 600; }

/* ── Status badges ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; padding: 3px 10px;
    border-radius: 999px; white-space: nowrap;
}
.status-on-track  { background: var(--success-wash); color: var(--success); }
.status-stable    { background: var(--info-wash);    color: var(--info);    }
.status-watch     { background: var(--warning-wash); color: var(--warning); }
.status-low       { background: var(--danger-wash);  color: var(--danger);  }

/* ── Trend sparkline ── */
.trend-card {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 20px; padding: 20px;
    margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.trend-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.trend-label  { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.trend-value  { font-family: var(--font-serif); font-size: 26px; font-weight: 500; color: var(--ink-1); line-height: 1; }
.trend-delta  { font-size: 13px; color: var(--success); margin-top: 4px; font-weight: 600; }
.trend-bars   { display: flex; gap: 3px; align-items: flex-end; height: 44px; }
.trend-bar    { flex: 1; border-radius: 3px; min-width: 0; }
.trend-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.trend-sub-card {
    border-radius: 14px; padding: 14px 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.trend-sub-icon  { font-size: 20px; color: currentColor; }
.trend-sub-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.trend-sub-value { font-family: var(--font-serif); font-size: 20px; font-weight: 500; line-height: 1; }
.trend-sub-status { margin-top: 4px; }

