﻿:root {
    --bg: #ffffff;
    --surface: rgba(255, 255, 255, 0.86);
    --surface2: rgba(249, 250, 251, 0.82);
    --border: rgba(148, 163, 184, 0.28);
    --text: #0f172a;
    --muted: #64748b;
    --brand: #5b21b6; /* deep purple */
    --brand2: #6366f1; /* indigo */
    --brandSoft: rgba(99, 102, 241, 0.12);
    --success: #16a34a;
    --warn: #f59e0b;
    --r-md: 16px;
    --r-lg: 24px;
    --shadow: 0 18px 45px rgba(15,23,42,0.10);
}

/* ---------- Layout ---------- */
.app-main {
    background: radial-gradient(1100px 550px at 15% 0%, rgba(99, 102, 241, 0.10), transparent 55%), radial-gradient(900px 500px at 85% 10%, rgba(91, 33, 182, 0.10), transparent 60%), #fff;
    min-height: calc(100vh - 120px);
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ---------- Typography ---------- */
.page-title {
    font-size: 40px;
    line-height: 1.05;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-subtitle {
    margin-top: 10px;
    color: var(--muted);
    font-size: 16px;
}

/* ---------- Reusable UI ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    /*box-shadow: var(--shadow);*/
    box-shadow: 0 14px 32px rgba(15,23,42,0.08);
    backdrop-filter: blur(10px);
}

.card-inner {
    padding: 22px;
}

.btn {
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}

    .btn:hover {
        box-shadow: 0 12px 30px rgba(15,23,42,0.12);
        transform: translateY(-1px);
    }

    .btn:active {
        transform: translateY(0px);
    }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    border: none;
    color: white;
    font-weight: 600;
}

.btn-secondary {
    background: white;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: var(--text);
    font-weight: 500;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.6);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
}

.badge-success {
    color: var(--success);
    border-color: rgba(22, 163, 74, 0.25);
    background: rgba(22, 163, 74, 0.08);
}

.badge-warn {
    color: #b45309;
    border-color: rgba(245,158,11,0.25);
    background: rgba(245,158,11,0.10);
}

/* Subtle accent (replace loud borders) */
.accent-left {
    position: relative;
    overflow: hidden;
}

    .accent-left::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: linear-gradient(180deg, var(--brand2), var(--brand));
        opacity: 0.55;
    }

/* Icon button (trash etc.) */
.icon-btn {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .icon-btn:hover {
        box-shadow: 0 10px 25px rgba(15,23,42,0.12);
    }

/* ---------- Dashboard helpers ---------- */
.grid-gap-md {
    gap: 14px;
}

.section-gap {
    margin-bottom: 18px;
}

/* Toggle row container */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    margin-top: 12px;
}

/* Label — calm, not bold */
.toggle-label {
    font-size: 13px;
    font-weight: 500; /* <-- THIS is the key */
    color: var(--muted);
}

/* Toggle button wrapper */
.toggle-switch {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

/* Track */
.toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.2s ease;
}

    /* Track when ON */
    .toggle-track.on {
        background: var(--success);
    }

/* Thumb */
.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(15,23,42,0.15);
    transition: transform 0.2s ease;
}

/* Move thumb when ON */
.toggle-track.on .toggle-thumb {
    transform: translateX(20px);
}

.toggle-row.unpaid .toggle-label {
    color: #b45309;
}

/* -------------------------------
   Dashboard Typography System
   Font Weight Hierarchy:
   - Card values: 700 (Primary data)
   - Section headers: 600 (Structure)
   - Card titles: 500 (Informational)
   - Subtext: 400 (Calm)
   - Nav links: 500 (Neutral)
   - Active nav: 600 (Context)
-------------------------------- */

/* Page title (still allowed to be strong) */
.dashboard-title {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Card titles / Labels - 500 (Informational) */
.metric-label,
.card-label,
.field-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Card values / KPI numbers - 700 (Primary data) */
.metric-value,
.card-value,
.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    font-feature-settings: "tnum";
}

/* Section headers - 600 (Structure) */
.section-header,
h2.section-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

/* Client names & important text - 600 */
.client-name,
.important-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* Subtext / Metadata - 400 (Calm) */
.metric-subtext,
.card-subtext,
.metadata-text {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.metadata-value {
    font-weight: 400;
    color: var(--text);
}

/* Make secondary metrics quieter */
.metric-muted {
    font-weight: 500;
    color: var(--muted);
}

/* ---------- Top Navigation ---------- */

.topnav {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topnav-link {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

    /* Hover = subtle */
    .topnav-link:hover {
        color: var(--text);
        background: rgba(99,102,241,0.08);
    }

    /* Active = calm confidence */
    .topnav-link.active {
        color: var(--text);
        background: var(--brandSoft);
        box-shadow: inset 0 0 0 1px var(--border);
    }

    /* AskBexx gets a tiny glow, not a shout */
    .topnav-link.askbexx.active {
        background: linear-gradient( 135deg, rgba(99,102,241,0.18), rgba(91,33,182,0.18) );
    }

.dashboard-header {
    padding-bottom: 28px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(148,163,184,0.18);
}
