/* ============================================================
   Ledger360 — Shared Design System / App Shell Theme
   ------------------------------------------------------------
   Every module page includes this ONE stylesheet so the navbar,
   cards, KPI tiles, modals, buttons and charts look and behave
   identically across the whole application. Do not fork this
   file per-module — extend it here and every page picks up the
   change automatically.
   ============================================================ */

:root {
    --nav-bg: #0f172a;
    --page-bg: #f8fafc;
    --card-bg: #ffffff;
    --card-bg-alt: #f8fafc;
    --card-border: #e2e8f0;
    --primary-blue: #2563eb;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --section-header-bg: #f8fafc;
    --badge-bg: #e0f2fe;
    --badge-text: #0284c7;
    --track-bg: #e2e8f0;
    --accent-green: #16a34a;
    --accent-orange: #d97706;
    --accent-blue: #2563eb;
    --accent-red: #dc2626;

    /* Status colors (reserved — never reused for series/categories) */
    --status-success: #16a34a;
    --status-partial: #d97706;
    --status-critical: #dc2626;

    /* Chart categorical palette (validated: node validate_palette.js, PASS on #f8fafc surface) */
    --series-revenue: #2563eb;
    --series-expense: #eb6834;
    --series-capex:   #0284c7;
    --series-net:     #16a34a;
    --series-other:   #4a3aa7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--page-bg);
    color: var(--text-main);
}

/* ===== Top Navigation Bar (rendered by shell.js — do not hand-author markup) ===== */
.navbar {
    background-color: var(--nav-bg);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.navbar-brand .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #0284c7);
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
}

.navbar-brand small {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #93c5fd;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.navbar-breadcrumb {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.navbar-breadcrumb strong { color: #e2e8f0; }

.navbar-breadcrumb a.breadcrumb-link,
.navbar-breadcrumb button.breadcrumb-link {
    color: #94a3b8;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.navbar-breadcrumb a.breadcrumb-link:hover,
.navbar-breadcrumb button.breadcrumb-link:hover {
    color: #e2e8f0;
    text-decoration: underline;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    position: relative;
}

.navbar-select-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #1e293b;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    border: 1px solid #334155;
    white-space: nowrap;
}

.navbar-select-container select {
    background: transparent;
    color: #38bdf8;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    width: auto;
    max-width: 200px;
}

.navbar-select-container select option { color: #1e293b; }

.icon-btn {
    position: relative;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s;
    text-decoration: none;
}

.icon-btn:hover { background: #334155; color: #ffffff; }

.icon-btn .badge-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--status-critical);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--nav-bg);
}

/* Real, computed notifications — see getUserNotifications() in shell.js. Anchored under the bell icon,
   within .navbar-right (position: relative). */
.erp-notif-panel {
    position: absolute;
    top: 44px;
    right: 0;
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    color: #1e293b;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    z-index: 500;
}
.erp-notif-head {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
}
.erp-notif-list { display: flex; flex-direction: column; }
.erp-notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
}
.erp-notif-item:hover { background: #f8fafc; }
.erp-notif-icon { font-size: 1.1rem; line-height: 1.4; }
.erp-notif-body { font-size: 0.8rem; line-height: 1.45; }
.erp-notif-detail { color: #64748b; }
.erp-notif-item.erp-notif-overdue .erp-notif-body b { color: #dc2626; }
.erp-notif-item.erp-notif-action .erp-notif-body b { color: #1d4ed8; }
.erp-notif-empty { padding: 20px 16px; color: #94a3b8; font-size: 0.82rem; text-align: center; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border-radius: 20px;
    border: 1px solid #334155;
    cursor: pointer;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.user-chip .user-meta { line-height: 1.1; }
.user-chip .user-name { font-size: 0.78rem; font-weight: 700; color: #f1f5f9; }
.user-chip .user-role { font-size: 0.66rem; color: #94a3b8; }

/* ===== Main Container ===== */
.main-container {
    max-width: 1440px;
    margin: 1.5rem auto 3rem;
    padding: 0 1.5rem;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-header-row h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.page-header-row p {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.period-pill {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.period-pill strong { color: var(--text-main); }

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--section-header-bg);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.step-badge {
    background-color: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* ===== KPI cards ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    border-left: 4px solid var(--primary-blue);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.1rem;
}

.kpi-sub {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.kpi-sub.up { color: var(--status-success); }
.kpi-sub.down { color: var(--status-critical); }
.kpi-sub.flat { color: var(--text-muted); }

/* ===== Dashboard grid rows ===== */
.dash-row {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.dash-row.row-2-1 { grid-template-columns: 2fr 1fr; }
.dash-row.row-1-1-1 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 980px) {
    .dash-row.row-2-1, .dash-row.row-1-1-1 { grid-template-columns: 1fr; }
}

/* ===== Trend chart ===== */
.chart-legend {
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-item .legend-value { color: var(--text-main); font-weight: 800; }

.chart-wrap { position: relative; width: 100%; }

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: #0f172a;
    color: #fff;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    font-size: 0.72rem;
    line-height: 1.5;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.1s;
    z-index: 20;
    white-space: nowrap;
}

.chart-tooltip.show { opacity: 1; }
.chart-tooltip .tt-title { font-weight: 800; margin-bottom: 0.2rem; color: #93c5fd; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 0.8rem; }

/* ===== Compliance snapshot ===== */
.compliance-list { display: flex; flex-direction: column; gap: 0.65rem; }

.compliance-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.65rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--card-border);
}

.status-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
    color: #fff;
    font-weight: 800;
}

.status-icon.good { background: var(--status-success); }
.status-icon.warning { background: var(--status-partial); }
.status-icon.critical { background: var(--status-critical); }
.status-icon.neutral { background: var(--text-muted); }

.compliance-body { display: flex; flex-direction: column; gap: 0.1rem; }
.compliance-title { font-size: 0.78rem; font-weight: 700; color: var(--text-main); }
.compliance-sub { font-size: 0.7rem; color: var(--text-muted); }

.overall-score-ring {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem;
    margin-bottom: 0.85rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.overall-score-ring .score-num { font-size: 1.5rem; font-weight: 800; color: var(--status-success); }
.overall-score-ring .score-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }

/* ===== Expense breakdown / generic bar rows ===== */
.bar-row { display: flex; flex-direction: column; gap: 0.9rem; }
.bar-item-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}
.bar-item-head .b-label { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--text-main); }
.bar-item-head .b-value { font-weight: 800; color: var(--text-main); }
.bar-track { width: 100%; background: #e2e8f0; height: 8px; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

/* ===== Quick actions / approvals ===== */
.quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}

.quick-item:hover { background: #f1f5f9; }
.quick-item:last-child { margin-bottom: 0; }
.quick-item .qi-left { display: flex; align-items: center; gap: 0.55rem; }
.quick-item .qi-icon { font-size: 1rem; }
.quick-item .qi-title { font-weight: 700; color: var(--text-main); }
.quick-item .qi-sub { font-size: 0.68rem; color: var(--text-muted); }
.count-chip {
    background: var(--badge-bg);
    color: var(--badge-text);
    font-weight: 800;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.count-chip.warn { background: #fef3c7; color: #d97706; }
.count-chip.crit { background: #fee2e2; color: #dc2626; }

/* ===== Activity feed ===== */
.activity-item { display: flex; gap: 0.6rem; margin-bottom: 0.9rem; }
.activity-item:last-child { margin-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-blue); margin-top: 0.4rem; flex-shrink: 0; }
.activity-text { font-size: 0.78rem; color: var(--text-main); line-height: 1.4; }
.activity-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ===== Generic data table (for module list/register screens) ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; text-align: left; }
.data-table thead tr { border-bottom: 2px solid var(--card-border); color: var(--text-muted); text-transform: uppercase; font-size: 0.68rem; }
.data-table th, .data-table td { padding: 0.65rem 0.6rem; }
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.15s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child { border-bottom: none; }

.pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.2px; }
.pill.good { background: #dcfce7; color: #15803d; }
.pill.warn { background: #fef3c7; color: #b45309; }
.pill.crit { background: #fee2e2; color: #b91c1c; }
.pill.neutral { background: #f1f5f9; color: #475569; }

/* ===== Module menu ===== */
.modules-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.modules-section-head h2 { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.modules-section-head p { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.module-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    min-width: 240px;
}

.module-search input {
    border: none;
    outline: none;
    font-size: 0.8rem;
    width: 100%;
    color: var(--text-main);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.module-tile {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.1rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.module-tile:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.module-tile-top { display: flex; justify-content: space-between; align-items: flex-start; }

.module-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #eff6ff;
}

.module-status {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.module-status.live { background: #dcfce7; color: #15803d; }
.module-status.soon { background: #f1f5f9; color: #64748b; }
.module-status.locked { background: #fee2e2; color: #b91c1c; }

.module-tile.locked { cursor: not-allowed; opacity: 0.62; }
.module-tile.locked:hover { transform: none; box-shadow: none; border-color: var(--card-border); }

.module-title { font-size: 0.92rem; font-weight: 700; color: var(--text-main); }
.module-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

.module-tile-foot {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== Modal (shared: admin setup, module preview, and future dialogs) ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.show { display: flex; }

.modal-box {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.modal-box.wide { max-width: 720px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--section-header-bg);
}

.modal-title { font-size: 0.95rem; font-weight: 800; color: var(--text-main); }
.modal-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
}

.modal-close:hover { background: #e2e8f0; color: var(--text-main); }

.modal-body { flex: 1; overflow-y: auto; padding: 1.25rem; }

.modal-body p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 1rem; }

.modal-feature-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.modal-feature-list li {
    font-size: 0.82rem;
    color: var(--text-main);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.admin-item:hover { background: #f1f5f9; border-color: var(--card-border); }
.admin-item .ai-icon {
    width: 34px; height: 34px; border-radius: 8px; background: #eff6ff;
    display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.admin-item .ai-title { font-size: 0.82rem; font-weight: 700; color: var(--text-main); }
.admin-item .ai-sub { font-size: 0.7rem; color: var(--text-muted); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
@media (max-width: 560px) { .admin-grid { grid-template-columns: 1fr; } }

/* ===== Buttons & forms (for future module screens) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--primary-blue); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: #ffffff; color: var(--text-main); border-color: var(--card-border); }
.btn-secondary:hover { background: #f1f5f9; }
.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.72rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Form fields (admin screens, module forms) ===== */
.field-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field-group label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.field-group label.required::after { content: " *"; color: var(--status-critical); }
/* Same required-field asterisk, for module pages using the simpler .field wrapper instead of .field-group. */
.field label.required::after { content: " *"; color: var(--status-critical); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

input[type="text"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-main);
    outline: none;
    background-color: #ffffff;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ---------- Shared search box — one pill-shaped, icon + input component for every free-text search
   field in the app (module top bars, filter rows, etc.), so they all look and behave identically
   instead of each page inventing its own. The inner <input> still needs type="text" for the base
   input rule above not to matter here — this class fully owns its look. ---------- */
.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--card-bg-alt, #f8fafc); border: 1px solid var(--card-border, #e2e8f0);
    border-radius: 999px; padding: 0.45rem 0.85rem; flex-shrink: 0;
}
.search-box:focus-within { border-color: var(--primary-blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); }
.search-box svg { flex-shrink: 0; color: var(--text-muted, #94a3b8); }
.search-box input {
    border: none; background: none; outline: none; box-shadow: none;
    font-family: inherit; font-size: 0.85rem; width: 100%; padding: 0; color: var(--text-main);
}

.avatar-sm {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff; font-size: 0.72rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.row-you { background: #eff6ff; }

/* ===== Toasts ===== */
.toast-container {
    position: fixed;
    top: 74px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 340px;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: opacity 0.4s ease;
}

.footnote {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
