/* ============================================================================
   ReforgeDigital — Client Portal design system (2026)
   Premium sidebar app-shell. Shared by the portal + admin pages.
   Auth screens (login/register/setup) use the centered .auth-card layout.
   ============================================================================ */

:root {
    --bg-body: #f5f6f8;
    --bg-card: #ffffff;
    --bg-secondary: #f4f6f9;
    --bg-input: #f8fafc;
    --sidebar-bg: #0d0f15;
    --sidebar-text: #aab2c0;
    --sidebar-active: #ffffff;
    --text: #0b0d13;
    --text-muted: #69707d;
    --accent: #ff4d00;
    --accent-2: #ff7a33;
    --accent-soft: rgba(255, 77, 0, 0.08);
    --border: rgba(15, 23, 42, 0.09);
    --ring: rgba(255, 77, 0, 0.20);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.10);

    --ok-bg: rgba(16, 185, 129, 0.12);
    --ok-text: #058257;
    --warn-bg: rgba(245, 158, 11, 0.14);
    --warn-text: #b45309;
    --err-bg: rgba(239, 68, 68, 0.12);
    --err-text: #c0322b;

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'Fira Code', monospace;

    --radius: 8px;
    --radius-sm: 6px;
    --sidebar-w: 258px;
}

[data-theme="dark"] {
    --bg-body: #0a0b0f;
    --bg-card: #13151c;
    --bg-secondary: #171922;
    --bg-input: #171922;
    --sidebar-bg: #0c0d12;
    --sidebar-text: #8a91a0;
    --sidebar-active: #ffffff;
    --text: #eef0f5;
    --text-muted: #939aa8;
    --accent: #ff5e1a;
    --accent-2: #ff8f4d;
    --accent-soft: rgba(255, 94, 26, 0.12);
    --border: rgba(255, 255, 255, 0.09);
    --ring: rgba(255, 94, 26, 0.28);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);

    --ok-bg: rgba(16, 185, 129, 0.16);
    --ok-text: #6ee7b7;
    --warn-bg: rgba(245, 158, 11, 0.16);
    --warn-text: #fbbf24;
    --err-bg: rgba(239, 68, 68, 0.18);
    --err-text: #fca5a5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-body);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.code-tag { font-family: var(--font-code); font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; display: block; }
.muted { color: var(--text-muted); }
.empty { color: var(--text-muted); font-size: 0.92rem; padding: 8px 0; }
.text-accent { color: var(--accent); }

/* ============================ APP SHELL ==================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    gap: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 6px; }
.side-brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
    color: #fff; text-decoration: none; letter-spacing: -0.03em;
    padding: 0 10px 22px;
}
.side-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px rgba(255,77,0,0.6); }
.side-section { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(255,255,255,0.32); padding: 16px 12px 6px; font-family: var(--font-code); }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-link {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 11px 13px; border-radius: 7px;
    color: var(--sidebar-text); text-decoration: none;
    font-size: 0.9rem; font-weight: 500; transition: background 0.18s, color 0.18s;
}
.side-link i { width: 18px; text-align: center; font-size: 0.95rem; opacity: 0.9; }
.side-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.side-link.active { background: rgba(255,255,255,0.08); color: var(--sidebar-active); }
.side-link.active::before { content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.side-link.active i { color: var(--accent); opacity: 1; }
.side-link .side-count { margin-left: auto; font-size: 0.68rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* Sidebar footer: a tools row + a pinned user-profile card */
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.side-tools { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 4px; }
.side-tools .side-link { flex: 1; padding: 9px 12px; font-size: 0.84rem; }
.sidebar .theme-toggle { flex: none; background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.14); color: var(--sidebar-text); width: 38px; height: 38px; }
.sidebar .theme-toggle:hover { background: #fff; color: #111; border-color: #fff; }
.side-profile { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.side-profile .avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; }
.side-profile .sp-main { min-width: 0; flex: 1; line-height: 1.3; }
.side-profile .sp-name { color: #fff; font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-profile .sp-mail { font-size: 0.72rem; color: rgba(255,255,255,0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-profile .sp-out { flex: none; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.5); text-decoration: none; transition: 0.18s; }
.side-profile .sp-out:hover { background: rgba(255,255,255,0.1); color: #fff; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 16px clamp(20px, 4vw, 44px);
    background: color-mix(in srgb, var(--bg-body) 82%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.app-topbar .crumb { font-family: var(--font-code); font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.app-topbar .tb-actions { display: flex; align-items: center; gap: 12px; }
.app-content { padding: clamp(24px, 4vw, 48px); max-width: 1180px; width: 100%; }

.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-top: 8px; }
.page-head p { color: var(--text-muted); margin-top: 10px; max-width: 680px; font-size: 1rem; }

.menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; width: 40px; height: 40px; color: var(--text); cursor: pointer; }

/* Mobile: sidebar slides in */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 200; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; }
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* ============================ COMPONENTS ================================== */
/* --- Grid / cards --- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(12, 1fr); }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }

.card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.card-head h2 { font-size: 1.12rem; }
.card-head h3 { font-size: 1rem; }
.section-gap { margin-top: 22px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px;
    background: var(--text); color: var(--bg-card);
    font-family: var(--font-body); font-weight: 600; font-size: 0.88rem;
    text-decoration: none; border: 1px solid var(--text); border-radius: var(--radius-sm);
    cursor: pointer; transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s, opacity 0.18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); opacity: 0.94; }
.btn-accent { background: var(--accent); border-color: transparent; color: #fff; box-shadow: none; }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); box-shadow: var(--shadow-sm); opacity: 1; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 6px; }
.btn-danger { background: transparent; color: var(--err-text); border-color: color-mix(in srgb, var(--err-text) 32%, transparent); }
.btn-danger:hover { background: var(--err-text); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { color: var(--accent); border-color: transparent; box-shadow: none; transform: none; }

.theme-toggle { width: 40px; height: 40px; border-radius: 7px; background: var(--bg-card); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.role-badge { font-family: var(--font-code); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.14em; border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; color: var(--text-muted); }

/* --- Forms --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-input, .form-textarea, select.form-input {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text);
    font-family: var(--font-body); font-size: 0.94rem;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.form-textarea { resize: vertical; min-height: 88px; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); background: var(--bg-card); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
input[type="range"] { accent-color: var(--accent); }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: none; }

/* --- Pills --- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 5px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.pill-paid { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.pill-pending { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.pill-overdue { background: var(--err-bg); color: var(--err-text); border-color: transparent; }

/* --- Progress --- */
.progress { width: 100%; height: 8px; border-radius: 3px; background: var(--bg-secondary); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.5s cubic-bezier(0.16,1,0.3,1); }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.84rem; margin-bottom: 8px; }
.progress-label strong { font-family: var(--font-display); font-size: 1.05rem; }

/* --- Stat cards --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.stat .stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); font-size: 1.05rem; }
.stat .stat-value { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1.05; order: 3; }
.stat .stat-label { color: var(--text-muted); font-size: 0.82rem; order: 2; margin-bottom: 7px; }

/* --- Stat card variants: trend + mini bar --- */
.stat .stat-top { display: flex; align-items: flex-start; justify-content: space-between; order: 1; margin-bottom: 18px; }
.stat .stat-trend { font-size: 0.72rem; font-weight: 700; padding: 4px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.stat .stat-trend.up { background: var(--ok-bg); color: var(--ok-text); }
.stat .stat-trend.down { background: var(--err-bg); color: var(--err-text); }
.stat .stat-trend.flat { background: var(--bg-secondary); color: var(--text-muted); }
.kpi-bar { height: 6px; border-radius: 3px; background: var(--bg-secondary); overflow: hidden; margin-top: 14px; order: 4; }
.kpi-bar > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* --- Vertical bar chart (Overall progress) --- */
.chart { display: flex; align-items: stretch; gap: clamp(10px, 3vw, 28px); height: 210px; padding-top: 4px; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chart-track { width: 100%; max-width: 72px; flex: 1; background: var(--bg-secondary); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.chart-fill { width: 100%; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 8px 8px 4px 4px; min-height: 5px; transition: height 0.7s cubic-bezier(0.16,1,0.3,1); }
.chart-meta { text-align: center; width: 100%; }
.chart-meta .cm-val { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; display: block; }
.chart-meta .cm-lbl { font-size: 0.74rem; color: var(--text-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Action required panel (what's blocking the client) --- */
.action-panel { border: 1px solid color-mix(in srgb, var(--warn-text) 34%, var(--border)); background: linear-gradient(120deg, var(--warn-bg), transparent 80%); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 24px; }
.action-panel .ap-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.action-panel .ap-head h2 { font-size: 1.05rem; }
.action-panel .ap-head .ap-ico { width: 30px; height: 30px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--warn-text); color: #fff; font-size: 0.85rem; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 9px; }
.todo-item:last-child { margin-bottom: 0; }
.todo-item .ti-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--warn-text); box-shadow: 0 0 0 4px var(--warn-bg); }
.todo-item .ti-main { flex: 1; min-width: 0; }
.todo-item .ti-title { font-weight: 600; font-size: 0.92rem; }
.todo-item .ti-sub { font-size: 0.8rem; color: var(--text-muted); }
.todo-item.ok .ti-dot { background: var(--ok-text); box-shadow: 0 0 0 4px var(--ok-bg); }

/* --- Activity feed --- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 34px; height: 34px; flex: none; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; background: var(--accent-soft); color: var(--accent); }
.feed-ico.green { background: var(--ok-bg); color: var(--ok-text); }
.feed-ico.amber { background: var(--warn-bg); color: var(--warn-text); }
.feed-ico.blue { background: color-mix(in srgb, #3b82f6 16%, transparent); color: #2563eb; }
.feed-main { flex: 1; min-width: 0; }
.feed-main .fm-text { font-size: 0.9rem; }
.feed-main .fm-text strong { font-weight: 600; }
.feed-main .fm-when { font-family: var(--font-code); font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; display: block; }

/* --- Help / direct-contact card --- */
.help-card { background: linear-gradient(150deg, var(--text), #20242e); color: #fff; border-radius: var(--radius); padding: 24px 26px; border: 1px solid var(--text); }
[data-theme="dark"] .help-card { background: linear-gradient(150deg, #1b1e27, #0f1117); }
.help-card h2 { color: #fff; font-size: 1.1rem; }
.help-card p { color: rgba(255,255,255,0.62); font-size: 0.88rem; margin: 8px 0 18px; }
.help-card .hc-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; }
.help-card .hc-line i { width: 30px; height: 30px; border-radius: 7px; background: rgba(255,255,255,0.08); display: inline-flex; align-items: center; justify-content: center; color: var(--accent-2); flex: none; }
.help-card .hc-line a { color: #fff; text-decoration: none; }
.help-card .hc-line a:hover { color: var(--accent-2); }
.help-card .hc-sla { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-size: 0.78rem; color: #fff; background: rgba(255,255,255,0.08); padding: 7px 12px; border-radius: 5px; }
.help-card .hc-sla .dot-live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,0.25); }

/* --- Key/value metric rows --- */
.metric-row { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.metric-row:last-child { border-bottom: 0; }
.metric-row .mr-label { color: var(--text-muted); font-size: 0.86rem; }
.metric-row .mr-value { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

/* --- Quick actions --- */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.qa-item { display: flex; flex-direction: column; gap: 9px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); text-decoration: none; color: var(--text); transition: 0.18s; }
.qa-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.qa-item i { width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-size: 0.9rem; }
.qa-item .qa-t { font-weight: 600; font-size: 0.92rem; }
.qa-item .qa-s { font-size: 0.78rem; color: var(--text-muted); }

/* --- Live-site status --- */
.site-status { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--ok-text) 28%, var(--border)); background: var(--ok-bg); margin-bottom: 24px; }
.site-status .ss-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--ok-text); position: relative; flex: none; }
.site-status .ss-pulse::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ok-text); opacity: 0.4; animation: ss-pulse 2s ease-out infinite; }
@keyframes ss-pulse { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(1.6); opacity: 0; } }
.site-status .ss-main { flex: 1; min-width: 0; }
.site-status .ss-title { font-weight: 600; color: var(--ok-text); }
.site-status .ss-sub { font-size: 0.8rem; color: var(--text-muted); }

/* --- FAQ accordion --- */
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 0.92rem; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '\002B'; color: var(--accent); font-size: 1.25rem; line-height: 1; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 0 16px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; }

/* --- Section heading with eyebrow --- */
.sec-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.sec-title h2 { font-size: 1.15rem; }
.sec-title .pill { margin-left: auto; }

/* --- Announcement banner --- */
.announce { display: flex; gap: 16px; align-items: flex-start; padding: 18px 22px; border-radius: var(--radius); background: linear-gradient(120deg, rgba(255,77,0,0.10), rgba(255,122,51,0.04)); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); margin-bottom: 24px; }
.announce .an-ico { width: 40px; height: 40px; flex: none; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.announce .an-body strong { display: block; font-family: var(--font-display); margin-bottom: 2px; }
.announce .an-body p { margin: 0; color: var(--text); white-space: pre-wrap; }
.announce .an-when { font-family: var(--font-code); font-size: 0.68rem; color: var(--text-muted); margin-top: 6px; display: block; }

/* --- Roadmap / milestones --- */
.roadmap { display: flex; flex-direction: column; gap: 0; }
.ms { display: flex; gap: 16px; position: relative; padding-bottom: 22px; }
.ms:last-child { padding-bottom: 0; }
.ms .ms-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.ms .ms-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--text-muted); z-index: 1; }
.ms .ms-line { flex: 1; width: 2px; background: var(--border); margin: 4px 0; }
.ms:last-child .ms-line { display: none; }
.ms.done .ms-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.ms.active .ms-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ms .ms-body { padding-top: 2px; flex: 1; }
.ms .ms-title { font-weight: 600; }
.ms.done .ms-title { color: var(--text-muted); }
.ms .ms-meta { font-family: var(--font-code); font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; }

/* --- Approvals --- */
.approve-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); margin-bottom: 10px; }
.approve-item .ap-main { flex: 1; min-width: 0; }
.approve-item .ap-title { font-weight: 600; }
.approve-item .ap-desc { font-size: 0.85rem; color: var(--text-muted); }
.approve-item.approved { border-color: color-mix(in srgb, var(--ok-text) 30%, transparent); }

/* --- Live links --- */
.featured-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; text-decoration: none; margin-bottom: 14px; box-shadow: 0 8px 22px rgba(255,77,0,0.26); transition: box-shadow 0.2s, transform 0.2s; }
.featured-link:hover { box-shadow: 0 12px 30px rgba(255,77,0,0.36); transform: translateY(-2px); }
.featured-link .fl-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.featured-link .fl-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-top: 2px; }
.featured-link .fl-go { font-size: 1.2rem; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); margin-bottom: 10px; transition: border-color 0.2s; }
.link-row:hover { border-color: var(--accent); }
.link-row .lr-main { min-width: 0; }
.link-row .lr-label { font-weight: 600; }
.link-row .lr-url { font-family: var(--font-code); font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

/* --- Files --- */
.file-row { display: flex; align-items: center; gap: 14px; padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); margin-bottom: 10px; }
.file-row .file-ico { width: 36px; height: 36px; flex: none; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.file-row .file-main { flex: 1; min-width: 0; }
.file-row .file-title { font-weight: 600; }
.file-row .file-meta { font-family: var(--font-code); font-size: 0.7rem; color: var(--text-muted); }

/* --- Timeline --- */
.timeline { list-style: none; display: grid; gap: 15px; padding-left: 4px; }
.timeline li { position: relative; padding-left: 22px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li::after { content: ''; position: absolute; left: 4px; top: 17px; bottom: -15px; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .when { display: block; font-family: var(--font-code); font-size: 0.68rem; color: var(--text-muted); margin-top: 5px; }

/* --- Comment thread --- */
.thread { display: grid; gap: 13px; margin-bottom: 20px; max-height: 440px; overflow-y: auto; padding-right: 6px; }
.bubble { padding: 13px 15px; border-radius: 9px 9px 9px 2px; border: 1px solid var(--border); background: var(--bg-secondary); max-width: 88%; }
.bubble.mine { margin-left: auto; border-radius: 9px 9px 2px 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.bubble.mine .bubble-meta { color: rgba(255,255,255,0.9); }
.bubble-meta { font-size: 0.68rem; font-family: var(--font-code); color: var(--text-muted); margin-bottom: 5px; }
.bubble p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }

/* --- Alerts --- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok-text); }
.alert-error { background: var(--err-bg); color: var(--err-text); }
.alert-info { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border); }

/* --- Auth screens --- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1100px 520px at 50% -8%, var(--accent-soft), transparent 70%); }
.auth-card { width: 100%; max-width: 420px; padding: 38px 34px 34px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); position: relative; }
.auth-card .theme-toggle { position: absolute; top: 16px; right: 16px; }
.auth-mark { width: 56px; height: 56px; border-radius: 10px; margin: 4px auto 18px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 1.45rem; box-shadow: 0 12px 26px rgba(255,77,0,0.32); }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand { display: block; font-family: var(--font-code); font-size: 0.7rem; font-weight: 500; text-decoration: none; color: var(--accent); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 8px; }
.auth-head h1 { font-size: 1.85rem; }
.auth-head .auth-sub { color: var(--text-muted); font-size: 0.95rem; margin-top: 8px; }
.auth-tag { font-family: var(--font-code); font-size: 0.68rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; display: block; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 6px; }
.remember { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-muted); cursor: pointer; user-select: none; }
.remember input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.auth-foot { text-align: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.auth-link { display: inline-block; margin-top: 4px; color: var(--text-muted); text-decoration: none; font-size: 0.88rem; transition: color 0.2s; }
.auth-link:hover { color: var(--accent); }
.auth-link + .auth-link { margin-left: 18px; }

/* --- Split auth (premium login) --- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-left { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 30px; background: var(--bg-card); }
.auth-left .auth-inner { width: 100%; max-width: 400px; }
.auth-left .brand { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; text-decoration: none; color: var(--text); margin-bottom: 40px; }
.auth-left .brand::after { content: '.'; color: var(--accent); }
.auth-left h1 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); line-height: 1.08; }
.auth-left .auth-sub { color: var(--text-muted); margin: 14px 0 30px; font-size: 0.96rem; }
.auth-left .theme-toggle { position: absolute; top: 22px; right: 22px; }
.field .req { color: var(--accent); }
.or-sep { display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: 0.78rem; margin: 6px 0 18px; }
.or-sep::before, .or-sep::after { content: ''; height: 1px; background: var(--border); flex: 1; }

.auth-right { position: relative; overflow: hidden; background: linear-gradient(155deg, #ff8a4d 0%, #ff5e1a 55%, #e64200 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 38px; padding: 48px 40px; }
.auth-right::before { content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.32), transparent 62%); top: -180px; right: -140px; }
.auth-right::after { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 60%); bottom: -120px; left: -90px; }
.hero-quote { position: relative; width: 100%; max-width: 360px; color: #fff; z-index: 2; }
.hero-quote .hq-text { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.4; opacity: 0.96; margin-bottom: 16px; }
.hero-quote .hq-who { display: flex; align-items: center; gap: 11px; }
.hero-quote .hq-av { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.28); display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-display); }
.hero-quote .hq-meta strong { display: block; font-size: 0.9rem; }
.hero-quote .hq-meta span { font-size: 0.78rem; opacity: 0.82; }
.hero-card { position: relative; z-index: 2; width: 100%; max-width: 360px; background: rgba(255,255,255,0.97); border-radius: 16px; padding: 22px; box-shadow: 0 34px 60px rgba(150,40,0,0.34); }
.hero-card .hcc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hero-card .hcc-ico { width: 38px; height: 38px; border-radius: 9px; background: #f1f2f5; display: flex; align-items: center; justify-content: center; color: #14161c; }
.hero-card .hcc-period { font-size: 0.72rem; color: #7a7f8a; border: 1px solid #e7e9ee; border-radius: 6px; padding: 5px 9px; }
.hero-card .hcc-pct { font-family: var(--font-display); font-weight: 800; font-size: 1.95rem; color: #14161c; display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.hero-card .hcc-pct .up { font-size: 0.7rem; background: rgba(16,185,129,0.14); color: #058257; padding: 3px 7px; border-radius: 6px; font-family: var(--font-body); }
.hero-card .hcc-bars { display: flex; align-items: flex-end; gap: 10px; height: 118px; }
.hero-card .hcc-bars > div { flex: 1; background: #f1f2f5; border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-card .hcc-bars > div > span { display: block; width: 100%; background: linear-gradient(180deg, #ff8f4d, #ff5e1a); border-radius: 6px; }

@media (max-width: 880px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-right { display: none; }
    .auth-left { padding: 36px 22px; }
}

/* --- Utilities --- */
.stack > * + * { margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 22px 0; border: 0; }

@media (max-width: 900px) {
    .span-8, .span-6, .span-4 { grid-column: span 12; }
    .grid { gap: 18px; }
}

/* ============================ MOBILE POLISH =============================== */
@media (max-width: 680px) {
    body { font-size: 14.5px; }
    .app-content { padding: 20px 16px 40px; }
    .app-topbar { padding: 12px 16px; }
    .card { padding: 20px 18px; }
    .page-head { margin-bottom: 22px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat { padding: 16px 16px; }
    .stat .stat-value { font-size: 1.35rem; }
    .stat .stat-top { margin-bottom: 12px; }
    /* Tables scroll horizontally instead of squashing */
    .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 460px; }
    .card-head { flex-wrap: wrap; }
    .featured-link { padding: 16px 18px; }
    .bubble { max-width: 94%; }
    .auth-card { padding: 30px 22px 26px; }
    .tb-actions .muted { display: none; }
}
@media (max-width: 380px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   ADMIN-ONLY LIGHT THEME (Adminator style)
   Applied via `.app.app-admin` on admin pages, so the client dashboard keeps
   its dark sidebar while the admin area gets a clean, light, professional look.
   ============================================================================ */
.app-admin { background: var(--bg-body); }
.app-admin .sidebar {
    background: var(--bg-card);
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}
.app-admin .sidebar::-webkit-scrollbar-thumb { background: var(--border); }
.app-admin .side-brand { color: var(--text); }
.app-admin .side-section { color: var(--text-muted); opacity: 0.75; }
.app-admin .side-link { color: var(--text-muted); }
.app-admin .side-link i { opacity: 0.85; }
.app-admin .side-link:hover { background: var(--bg-secondary); color: var(--text); }
.app-admin .side-link:hover i { opacity: 1; }
.app-admin .side-link.active { background: var(--accent-soft); color: var(--accent); }
.app-admin .side-link.active i { color: var(--accent); opacity: 1; }
.app-admin .side-link.active::before { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.app-admin .side-count { background: var(--accent); color: #fff; }

.app-admin .side-foot { border-top: none; }
.app-admin .side-tools { border-bottom: 1px solid var(--border); }
.app-admin .sidebar .theme-toggle {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-muted);
}
.app-admin .sidebar .theme-toggle:hover { background: var(--text); color: var(--bg-card); border-color: var(--text); }
.app-admin .side-profile { background: var(--bg-secondary); border-color: var(--border); }
.app-admin .side-profile .avatar { box-shadow: 0 4px 12px rgba(255,77,0,0.25); }
.app-admin .side-profile .sp-name { color: var(--text); }
.app-admin .side-profile .sp-mail { color: var(--text-muted); }
.app-admin .side-profile .sp-out { color: var(--text-muted); }
.app-admin .side-profile .sp-out:hover { background: var(--bg-card); color: var(--text); }

/* Cleaner admin topbar */
.app-admin .app-topbar { background: color-mix(in srgb, var(--bg-card) 88%, transparent); }
.app-admin .app-topbar .crumb { color: var(--text-muted); }
