/* =========================================================
   BusinessCall.co.za / CallAutomation
   ========================================================= */

:root {
    --bg: #0b0f1a;
    --bg-soft: #111729;
    --panel: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);
    --max: 1140px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: #f8fafc;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}
.logo { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.logo:hover { text-decoration: none; }
.logo-mark {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    width: 34px; height: 34px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.9rem;
}
.logo-text { font-size: 1.1rem; }
.main-nav { display: flex; align-items: center; gap: 1rem; }
.main-nav a { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.05s ease, background 0.2s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Main / pages ---------- */
.main { padding: 2rem 1.25rem 4rem; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(1000px 500px at 80% -20%, rgba(6,182,212,0.18), transparent 60%),
        radial-gradient(700px 400px at 0% 0%, rgba(37,99,235,0.18), transparent 60%),
        linear-gradient(180deg, #0b0f1a, #111729);
    color: #fff;
    padding: 5rem 1.25rem 6rem;
}
.hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: 3rem; color: #fff; }
.hero .lead { color: #cbd5e1; font-size: 1.15rem; max-width: 560px; }
.hero .badges { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.badge {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e2e8f0;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
}
.hero-cta { display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.hero-cta .btn-primary { padding: 0.85rem 1.4rem; font-size: 1rem; }
.hero-cta .btn-outline { color: #fff; border-color: rgba(255,255,255,0.3); }
.hero-cta .btn-outline:hover { background: rgba(255,255,255,0.08); }

.hero-card {
    background: #fff;
    color: var(--ink);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
}
.hero-card .row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); }
.hero-card .row:last-child { border-bottom: 0; }
.hero-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,0.15); }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section h2 { text-align: center; }
.section .lead { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 2.5rem; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1rem;
}
.feature {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.feature .icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: grid; place-items: center;
    font-weight: 800; margin-bottom: 0.85rem;
}

/* ---------- Pricing ---------- */
.pricing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1rem;
}
.plan {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow);
    position: relative;
}
.plan.featured {
    border: 2px solid var(--primary);
    transform: translateY(-4px);
}
.plan .ribbon {
    position: absolute; top: -12px; right: 16px;
    background: var(--primary); color: #fff;
    font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 999px;
}
.plan h3 { margin-bottom: 0.25rem; }
.plan .price { font-size: 2.2rem; font-weight: 800; margin: 0.5rem 0 0.25rem; }
.plan .price small { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.plan li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.plan li:last-child { border-bottom: 0; }
.plan .btn { margin-top: auto; }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: calc(100vh - 200px);
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.auth-card .muted { margin-bottom: 1.5rem; }
.auth-card .alt { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.field textarea { min-height: 100px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* ---------- Alerts ---------- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ---------- Dashboard ---------- */
.dash-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.dash-header h1 { font-size: 1.7rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}
.stat .label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin-top: 0.25rem; }

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.panel-header h2 { font-size: 1.2rem; margin: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}
.table th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.tag-active { background: #ecfdf5; color: #065f46; }
.tag-paused { background: #fef3c7; color: #92400e; }
.tag-draft  { background: #f1f5f9; color: #475569; }

.empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}

/* ---------- Transcript ---------- */
.transcript-row { display: none; background: #f8fafc; }
.transcript-row.open { display: table-row; }
.transcript {
    padding: 1rem 0.5rem;
    display: flex; flex-direction: column; gap: 0.6rem;
    max-height: 400px; overflow-y: auto;
}
.turn {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    max-width: 80%;
}
.turn .who { font-size: 0.7rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 0.25rem; font-weight: 600; }
.turn .what { font-size: 0.95rem; }
.turn-user  { align-self: flex-end; background: #eff6ff; border-color: #bfdbfe; }
.turn-agent { align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer {
    background: #0b0f1a;
    color: #cbd5e1;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-footer h4 { color: #fff; margin-bottom: 0.75rem; font-size: 0.95rem; }
.site-footer a { display: block; color: #94a3b8; margin-bottom: 0.4rem; font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.site-footer .logo-text { color: #fff; }
.site-footer .muted { color: #64748b; }
.copyright { padding-top: 1.5rem; text-align: center; color: #64748b; font-size: 0.85rem; }

/* ---------- Responsive (original) ---------- */
@media (max-width: 900px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .feature-grid, .pricing { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .row-2 { grid-template-columns: 1fr; }
    .main-nav a:not(.btn) { display: none; }
}

/* ===========================================================
   APP LAYOUT — logged-in shell
   =========================================================== */
.app-layout { background: #f1f5f9; }
.app-main { padding: 2rem 1.25rem 4rem; }

/* ── App header ───────────────────────────────────────────── */
.app-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
.app-header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.app-header-left  { display: flex; align-items: center; gap: 0.75rem; }
.app-header-right { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

/* ── Hamburger ────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Top nav links ────────────────────────────────────────── */
.app-top-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}
.top-nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.top-nav-link:hover { background: #f1f5f9; color: var(--ink); text-decoration: none; }
.top-nav-link.active { background: #eff6ff; color: var(--primary); font-weight: 600; }

/* ── Small button variant ─────────────────────────────────── */
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }

/* ── Icon button ──────────────────────────────────────────── */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: #f1f5f9; color: var(--ink); text-decoration: none; }

/* ── User avatar + dropdown ───────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.3rem 0.6rem 0.3rem 0.35rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
    transition: background 0.15s;
}
.user-avatar-btn:hover { background: #f8fafc; }
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-name-short { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--muted); flex-shrink: 0; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}
.dropdown-header {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.dd-email { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-divider { height: 1px; background: var(--line); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.12s;
}
.dropdown-item:hover { background: #f8fafc; text-decoration: none; }
.dd-active { background: #eff6ff; color: var(--primary); font-weight: 500; }
.dd-danger  { color: var(--danger); }
.dd-danger:hover { background: #fef2f2; }

.plan-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #eff6ff;
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: fit-content;
    margin-top: 0.2rem;
}

/* ===========================================================
   DASHBOARD COMPONENTS
   =========================================================== */

/* ── Stats grid ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.85rem;
}
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.stat-value { font-size: 1.65rem; font-weight: 800; margin: 0.2rem 0 0.15rem; line-height: 1.1; }
.stat-foot  { font-size: 0.8rem; }

/* ── Mini bar inside stat ─────────────────────────────────── */
.mini-bar-wrap {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.35rem 0 0.2rem;
}
.mini-bar { height: 100%; border-radius: 3px; transition: width .3s; }

/* ── Trend indicators ─────────────────────────────────────── */
.trend { font-size: 0.8rem; font-weight: 600; }
.trend-up { color: var(--success); }
.trend-dn { color: var(--danger); }

/* ── Onboarding checklist ─────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 0; }
.check-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px dashed var(--line);
}
.check-item:last-child { border-bottom: 0; }
.check-bubble {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--line);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}
.check-item.done .check-bubble {
    background: var(--success);
    color: #fff;
}

/* ── 2-column layout ──────────────────────────────────────── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Bar chart ────────────────────────────────────────────── */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-bottom: 24px;
    position: relative;
}
.bar-chart-sm  { height: 100px; }
.bar-chart-hours { gap: 2px; }
.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}
.bar-val {
    font-size: 0.65rem;
    color: var(--muted);
    min-height: 14px;
    line-height: 14px;
}
.bar-track {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: #f1f5f9;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}
.bar-fill {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    min-height: 2px;
}
.bar-fill.bar-zero { background: #e2e8f0; min-height: 0; }
.bar-lbl {
    font-size: 0.68rem;
    color: var(--muted);
    white-space: nowrap;
    position: absolute;
    bottom: -20px;
}

/* ── Agent cards ──────────────────────────────────────────── */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.agent-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.agent-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
}
.agent-avatar {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}
.agent-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-card-stats {
    display: flex;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.acs {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border-right: 1px solid var(--line);
    text-align: center;
}
.acs:last-child { border-right: 0; }
.acs-val { font-size: 1.1rem; font-weight: 700; }
.acs-lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.agent-card-foot {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
}

/* ── Recent calls list (compact) ─────────────────────────── */
.recent-calls-list { display: flex; flex-direction: column; }
.recent-call-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}
.recent-call-row:last-child { border-bottom: 0; }

/* ===========================================================
   SETTINGS PAGE
   =========================================================== */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--line);
}
.tab-link {
    padding: 0.6rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab-link:hover { color: var(--ink); text-decoration: none; }
.tab-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===========================================================
   BILLING PAGE
   =========================================================== */
.billing-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.billing-price-block { text-align: right; }
.billing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.billing-feature {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}
.plan-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.plan-compare-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    position: relative;
}
.plan-current { border: 2px solid var(--primary); background: #eff6ff; }
.plan-current-badge {
    position: absolute;
    top: -11px;
    right: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
.plan-feat-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}
.plan-feat-list li { font-size: 0.84rem; color: var(--muted); }

/* ===========================================================
   SPINNER / LOADER
   =========================================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
.spinner-dark {
    border-color: rgba(0,0,0,0.15);
    border-top-color: var(--primary);
}

/* ===========================================================
   AUTH PAGES — sign in / sign up / reset / verify
   =========================================================== */
.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem 1rem;
}
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.25rem 2.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.auth-card h1 {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    color: var(--ink);
}
.auth-alert { margin-bottom: 1rem; }

.auth-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 2px solid #86efac;
    color: #16a34a;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.auth-fail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: var(--danger);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.alt {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.88rem;
    color: var(--muted);
}
.btn-block { width: 100%; justify-content: center; text-align: center; }
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 4px 6px;
    margin-top: 13px;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

/* Referral banner */
.ref-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.ref-banner-icon { font-size: 1.6rem; line-height: 1; }

/* ===========================================================
   OTP DIGIT BOXES
   =========================================================== */
.otp-boxes {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}
.otp-digit {
    width: 48px;
    height: 56px;
    border: 2px solid var(--line);
    border-radius: 10px;
    font-size: 1.55rem;
    font-weight: 700;
    text-align: center;
    color: var(--ink);
    font-family: monospace;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
@media (max-width: 420px) {
    .otp-digit { width: 40px; height: 48px; font-size: 1.3rem; }
}

/* ===========================================================
   PAYMENT GATEWAY MODAL
   =========================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity:0; }
    to   { opacity:1; }
}
.modal-overlay[hidden] { display: none; }
.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.2s ease;
}
@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.modal-header h3 { font-size: 1.2rem; margin: 0; }
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.modal-close:hover { background: #f1f5f9; color: var(--ink); }

.gateway-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.gateway-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    cursor: pointer;
    background: #fff;
}
.gateway-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--ink);
}
.gateway-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.gw-ps { background: linear-gradient(135deg, #00c3ff, #0085ff); }
.gw-oz { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.gateway-name { font-weight: 700; font-size: 0.95rem; }
.gateway-desc { font-size: 0.8rem; color: var(--muted); }
.gateway-arrow { margin-left: auto; color: var(--muted); font-size: 1rem; }

/* ===========================================================
   PAYMENT GATEWAY PAGES
   =========================================================== */
.payment-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem 1rem;
}
.payment-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.payment-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}
.payment-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.payment-brand-name { font-size: 1.1rem; font-weight: 800; }
.payment-brand-tagline { font-size: 0.82rem; color: var(--muted); }
.payment-summary {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.payment-plan-name { font-size: 1rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem; }
.payment-amount {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}
.payment-amount span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.payment-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.5rem;
}
.payment-features span {
    font-size: 0.78rem;
    background: #eff6ff;
    color: var(--primary);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 500;
}
.payment-info { margin-bottom: 1.5rem; }
.payment-info p { color: var(--muted); font-size: 0.9rem; margin: 0; text-align: center; }
.payment-btn { font-size: 1.05rem; padding: 0.9rem 2rem; }
.payment-secure { text-align: center; margin-top: 0.75rem; color: var(--muted); font-size: 0.82rem; }

/* ===========================================================
   ALERT STYLES (expanded)
   =========================================================== */
.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* ===========================================================
   BILLING - 3-col stats
   =========================================================== */
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ===========================================================
   SETTINGS - danger btn
   =========================================================== */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* ===========================================================
   FOOTER (app mode — compact)
   =========================================================== */
.app-layout .site-footer { margin-top: 2rem; }

/* ===========================================================
   RESPONSIVE — app layout
   =========================================================== */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .hamburger { display: flex; }
    .app-top-nav {
        display: none;
        position: absolute;
        top: 58px;
        left: 0; right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        padding: 0.5rem 1rem 1rem;
        gap: 0.25rem;
        box-shadow: var(--shadow);
    }
    .app-top-nav.nav-open { display: flex; }
    .top-nav-link { padding: 0.6rem 0.75rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .two-col-grid { grid-template-columns: 1fr; }
    .plan-compare-grid { grid-template-columns: 1fr; }
    .agent-grid { grid-template-columns: 1fr; }
    .user-name-short { display: none; }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .billing-plan-row { flex-direction: column; align-items: flex-start; }
    .billing-price-block { text-align: left; }
}
