/* ================================================================
   UpBill — design system
   Modern, app-like, fully responsive (mobile-first bottom nav)
   ================================================================ */

:root {
    --bg: #f4f5fb;
    --surface: #ffffff;
    --ink: #111428;
    --muted: #6a7089;
    --line: #e8e9f3;
    --brand: #5b5bf7;
    --brand-2: #a855f7;
    --brand-soft: #eef0ff;
    --brand-ink: #4c4ddc;
    --ok: #12b76a;
    --warn: #f59e0b;
    --danger: #f04438;
    --info: #2e90fa;
    --sidebar: #0d0f22;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 10px 34px -14px rgba(17, 20, 45, .14);
    --font: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
input, select, textarea { font-family: inherit; }

.ic { width: 19px; height: 19px; flex: none; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.center-items { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }

/* ================================================================
   App shell
   ================================================================ */
.shell {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    background: linear-gradient(180deg, #0d0f22 0%, #12142e 100%);
    color: #fff;
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    border-right: 1px solid rgba(255, 255, 255, .05);
    z-index: 50;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 13px;
    color: rgba(255, 255, 255, .62);
    font-size: 14.5px;
    font-weight: 600;
    transition: background .18s, color .18s;
}
.nav-item .ic { width: 20px; height: 20px; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
    background: linear-gradient(135deg, #5b5bf7, #9333ea);
    color: #fff;
    box-shadow: 0 12px 24px -10px rgba(109, 94, 249, .65);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.plan-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
    padding: 12px 13px;
    border-radius: 15px;
    color: #fff;
    transition: background .18s;
}
.plan-pill:hover { background: rgba(255, 255, 255, .08); }
.plan-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
    flex: none;
}
.plan-pill.is-expired .dot { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .16); }
.plan-pill-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.plan-pill-text b { font-size: 13px; font-weight: 700; }
.plan-pill-text small { font-size: 11.5px; color: rgba(255, 255, 255, .55); }
.plan-pill .ic { width: 16px; height: 16px; color: rgba(255, 255, 255, .4); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.user-chip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.user-chip-text b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 11.5px; color: rgba(255, 255, 255, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .55);
    transition: background .15s, color .15s;
    flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar .icon-btn { background: #f4f5fb; color: #5c6279; border: 1px solid var(--line); }
.topbar .icon-btn:hover { background: #eceef8; color: var(--ink); }
.show-mobile { display: none !important; }

/* Avatars */
.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex: none;
    letter-spacing: .02em;
    user-select: none;
}
.avatar-btn { width: 36px; height: 36px; font-size: 12.5px; }
.tone-violet { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.tone-blue { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.tone-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.tone-amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.tone-rose { background: linear-gradient(135deg, #e11d48, #fb7185); }
.tone-indigo { background: linear-gradient(135deg, #4f46e5, #818cf8); }

/* Topbar */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 30px;
    background: rgba(244, 245, 251, .82);
    backdrop-filter: saturate(1.2) blur(14px);
    -webkit-backdrop-filter: saturate(1.2) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.trial-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 30px;
    font-size: 13.5px;
    background: linear-gradient(90deg, #eef0ff, #f6f0ff);
    color: #3f3fa8;
    border-bottom: 1px solid #e3e4fb;
}
.trial-bar span { display: flex; align-items: center; gap: 8px; }
.trial-bar .ic { width: 16px; height: 16px; }
.trial-bar a { font-weight: 800; color: #4c4ddc; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.trial-bar a .ic { width: 14px; height: 14px; }
.trial-bar.is-danger { background: linear-gradient(90deg, #feeceb, #fff4f2); color: #b42318; border-bottom-color: #fbd5d2; }
.trial-bar.is-danger a { color: #d92d20; }

.content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 26px 30px 70px;
    /* "backwards" (not "both") so no transform lingers after the animation —
       a residual transform would trap fixed-position drawers inside .content */
    animation: fadeUp .35s ease backwards;
}
.content > * + * { margin-top: 18px; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Toast */
.toast {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0d0f22;
    color: #fff;
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 18px 40px -12px rgba(10, 12, 30, .5);
    animation: toastIn .32s cubic-bezier(.2, .8, .2, 1) both;
    max-width: min(440px, calc(100vw - 32px));
}
.toast .ic { width: 18px; height: 18px; }
.toast-success .ic { color: #34d399; }
.toast-error .ic { color: #f87171; }
.toast-warn .ic { color: #fbbf24; }
.toast.hide { opacity: 0; transform: translateY(-8px); transition: .3s; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.bottom-nav { display: none; }
.fab { display: none; }

/* ================================================================
   Cards, layout helpers
   ================================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.card-head .link {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-ink);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.card-head .link .ic { width: 14px; height: 14px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================================================================
   Buttons / badges
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    background: none;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 18px;
    border-radius: 13px;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: transform .15s, box-shadow .2s, background .15s, border-color .15s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: scale(.98); }

.btn-primary {
    background: linear-gradient(135deg, #5b5bf7, #9333ea);
    color: #fff;
    box-shadow: 0 12px 24px -12px rgba(99, 91, 255, .8);
}
.btn-primary:hover { box-shadow: 0 16px 30px -12px rgba(99, 91, 255, .9); transform: translateY(-1px); }
.btn-ghost { background: var(--brand-soft); color: var(--brand-ink); }
.btn-ghost:hover { background: #e3e6ff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: #c9cbe6; background: #fafaff; }
.btn-danger { background: #feeceb; color: #c0261b; }
.btn-danger:hover { background: #fdd9d6; }
.btn-sm { padding: 9px 13px; font-size: 13px; border-radius: 11px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; flex: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}
.badge-success { background: #e7f8f0; color: #0a7c53; }
.badge-info { background: #e9f4ff; color: #1466c1; }
.badge-danger { background: #feeceb; color: #c0261b; }
.badge-muted { background: #eef0f6; color: #5c6279; }
.badge-warn { background: #fef4e6; color: #a15c07; }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ================================================================
   Stats & dashboard
   ================================================================ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 19px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -18px rgba(17, 20, 45, .22); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.stat-ic .ic { width: 19px; height: 19px; }
.stat-ic.green { background: #e7f8f0; color: #0a7c53; }
.stat-ic.amber { background: #fef4e6; color: #b45309; }
.stat-ic.rose { background: #feeceb; color: #c0261b; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-sub { font-size: 12.5px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }

.chart { display: flex; align-items: stretch; gap: 10px; height: 190px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; height: 100%; }
.chart-bar {
    width: 100%;
    max-width: 44px;
    border-radius: 9px 9px 5px 5px;
    background: linear-gradient(180deg, #a78bfa, #5b5bf7);
    min-height: 6px;
    transition: filter .15s;
}
.chart-bar:hover { filter: brightness(1.12); }
.chart-bar.is-zero { background: #e9eaf3; }
.chart-label { font-size: 11px; font-weight: 600; color: var(--muted); }

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fafaff;
    transition: .18s;
}
.quick:hover { border-color: #c9cbf0; background: #f4f4ff; transform: translateY(-1px); }
.quick .qic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #5b5bf7, #9333ea); color: #fff; }
.quick .qic .ic { width: 18px; height: 18px; }
.quick b { font-size: 13.5px; }
.quick span { font-size: 11.5px; color: var(--muted); }

/* Row list */
.row-list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.row-ic .ic { width: 19px; height: 19px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub .ic { width: 11px; height: 11px; display: inline-block; vertical-align: -1px; margin-right: 2px; }
.row-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.row-amt { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.row-arrow { color: #c3c6da; }
.row-arrow .ic { width: 16px; height: 16px; }

/* ================================================================
   Forms
   ================================================================ */
.field { display: flex; flex-direction: column; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 700; color: #3c4257; margin-bottom: 7px; display: flex; align-items: center; gap: 5px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.input, .select, .textarea {
    width: 100%;
    font-size: 14px;
    color: var(--ink);
    background: #fbfbfe;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 11px 13px;
    transition: border-color .16s, box-shadow .16s, background .16s;
    outline: none;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: #a5a6fb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(91, 91, 247, .13);
}
.input::placeholder, .textarea::placeholder { color: #a3a7bd; }
.select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a7089' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 38px;
    cursor: pointer;
}
.textarea { min-height: 92px; resize: vertical; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.check-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: #3c4257; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Search / filters */
.search-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #9ca1b8; }
.search .input { padding-left: 40px; }

.tabs {
    display: flex;
    gap: 5px;
    background: #eceef8;
    padding: 5px;
    border-radius: 14px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    transition: .15s;
    display: inline-flex;
    align-items: center;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -4px rgba(17, 20, 45, .18); }
.tab .count { font-size: 10.5px; background: #dfe2f2; color: #5c6279; border-radius: 99px; padding: 1px 7px; margin-left: 6px; font-weight: 800; }
.tab.active .count { background: var(--brand-soft); color: var(--brand-ink); }

/* Invoice item builder */
.item-table { display: flex; flex-direction: column; gap: 10px; }
.item-head {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 84px 120px 110px 38px;
    gap: 10px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    padding: 0 2px;
}
.item-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 84px 120px 110px 38px; gap: 10px; align-items: end; }
.item-row .field label { display: none; }
.item-amount { background: #f4f5fb; font-weight: 700; color: #3c4257; text-align: right; cursor: default; border-color: #eef0f7; }
.item-remove {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #feeceb;
    color: #c0261b;
    border: none;
    cursor: pointer;
    transition: .15s;
}
.item-remove:hover { background: #fdd9d6; }
.item-remove .ic { width: 16px; height: 16px; }

.totals {
    margin-left: auto;
    margin-top: 18px;
    width: min(340px, 100%);
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: #fafaff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
}
.total-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.total-row.grand { font-size: 16px; font-weight: 800; color: var(--ink); border-top: 1px dashed #dcddf0; padding-top: 10px; margin-top: 2px; }

/* ================================================================
   Plans / subscription
   ================================================================ */
.sub-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(120deg, #0d0f22, #221d4e 60%, #3b1d6e);
    color: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 24px 60px -30px rgba(13, 15, 34, .8);
    position: relative;
    overflow: hidden;
}
.sub-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, .45), transparent 65%);
    right: -90px;
    top: -130px;
    pointer-events: none;
}
.sub-hero > * { position: relative; }
.sub-hero h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.sub-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.sub-meta { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: rgba(255, 255, 255, .72); flex-wrap: wrap; }
.sub-meta span { display: flex; align-items: center; gap: 6px; }
.sub-meta .ic { width: 15px; height: 15px; color: #c4b5fd; }
.btn-white { background: #fff; color: #11142c; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }

.usage-card .meter-row + .meter-row { margin-top: 16px; }
.meter-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: #3c4257; margin-bottom: 8px; }
.meter-head span:last-child { color: var(--muted); font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: #eceef8; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5b5bf7, #a855f7); transition: width .5s ease; }
.meter i.full { background: linear-gradient(90deg, #f59e0b, #f04438); }

.pricing-toggle { display: inline-flex; background: #eceef8; border-radius: 12px; padding: 4px; gap: 4px; }
.pricing-toggle button {
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 9px;
    cursor: pointer;
    transition: .15s;
}
.pricing-toggle button.active { background: #fff; color: var(--ink); box-shadow: 0 4px 10px -4px rgba(17, 20, 45, .2); }
.pricing-toggle .save { font-size: 10.5px; color: #0a7c53; font-weight: 800; margin-left: 3px; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.plan {
    position: relative;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 22px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.plan:hover { transform: translateY(-3px); }
.plan.popular {
    border-color: #b7a6fb;
    background: linear-gradient(180deg, #f8f6ff 0%, #fff 55%);
    box-shadow: 0 24px 60px -28px rgba(109, 94, 249, .55);
}
.plan-tag {
    position: absolute;
    top: -13px;
    left: 24px;
    background: linear-gradient(135deg, #5b5bf7, #9333ea);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 99px;
}
.plan h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.plan-desc { font-size: 13px; color: var(--muted); margin-top: 4px; min-height: 38px; }
.plan-price { margin-top: 16px; display: flex; align-items: baseline; gap: 5px; }
.plan-price .amount { font-size: 36px; font-weight: 800; letter-spacing: -.045em; }
.plan-price .per { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-features { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.plan-features li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: #3c4257; font-weight: 500; }
.plan-features .ic { width: 16px; height: 16px; color: #0a7c53; margin-top: 2px; }
.plan .btn { margin-top: 22px; }
.plan.is-current { border-color: #34d399; }
.plan-current-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 22px;
    padding: 11px 16px;
    border-radius: 13px;
    background: #e7f8f0;
    color: #0a7c53;
    font-size: 13.5px;
    font-weight: 800;
    justify-content: center;
}

.plan-grid-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 26px 0 18px; }

/* ================================================================
   Customers
   ================================================================ */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cust-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform .18s, box-shadow .18s;
}
.cust-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -20px rgba(17, 20, 45, .25); }
.cust-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cust-top .avatar { width: 46px; height: 46px; font-size: 15px; border-radius: 15px; }
.cust-name { font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #fafaff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.cust-meta .label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cust-meta .value { font-size: 14px; font-weight: 800; margin-top: 2px; }
.cust-actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.cust-actions .btn { flex: 1; }

/* ================================================================
   Products
   ================================================================ */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.prod-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.prod-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prod-top .qic {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand-ink);
    flex: none;
}
.prod-top .qic .ic { width: 20px; height: 20px; }
.prod-info { min-width: 0; }
.prod-name { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-rate { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.prod-rate span { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.prod-actions { display: flex; gap: 8px; margin-top: auto; }
.prod-actions form { display: flex; }
.prod-actions .btn { flex: 1; }
.prod-actions form .btn { flex: none; }

/* ================================================================
   Drawer (slide-over / mobile bottom sheet)
   ================================================================ */
.drawer { position: fixed; inset: 0; z-index: 110; display: none; }
.drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 28, .5); backdrop-filter: blur(3px); animation: fadeIn .2s; }
.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(460px, 100%);
    background: #fff;
    padding: 26px;
    overflow-y: auto;
    animation: slideIn .26s cubic-bezier(.2, .8, .2, 1);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.drawer-head h3 { font-size: 18px; font-weight: 800; }
.drawer .form-actions { justify-content: stretch; }
.drawer .form-actions .btn { flex: 1; }

@keyframes slideIn { from { transform: translateX(44px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { transform: translateY(70px); opacity: .5; } to { transform: none; opacity: 1; } }

/* ================================================================
   Empty states
   ================================================================ */
.empty { padding: 46px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 4px; }
.empty-ic .ic { width: 28px; height: 28px; }
.empty h3 { font-size: 16px; font-weight: 800; }
.empty p { font-size: 13.5px; color: var(--muted); max-width: 380px; }
.empty .btn { margin-top: 8px; }

/* ================================================================
   Invoice document
   ================================================================ */
.invoice-shell { max-width: 880px; margin: 0 auto; }
.invoice-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.invoice-actions .remind { display: flex; gap: 8px; margin-right: auto; flex-wrap: wrap; }
.invoice-doc {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 40px;
    position: relative;
    overflow: hidden;
}
.doc-top { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 2px solid #111428; }
.doc-brand { display: flex; gap: 14px; align-items: flex-start; }
.doc-brand h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.doc-brand p { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 300px; line-height: 1.55; }
.doc-title { text-align: right; }
.doc-title .label { font-size: 21px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.doc-title .no { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.doc-meta .label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.doc-meta .who { font-size: 15px; font-weight: 800; }
.doc-meta p { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.doc-dates { display: flex; gap: 28px; justify-content: flex-end; text-align: right; }
.doc-dates .label { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.doc-dates .val { font-size: 13.5px; font-weight: 700; margin-top: 2px; }

.doc-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.doc-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; padding: 10px 8px; border-bottom: 1.5px solid #111428; }
.doc-table th.num, .doc-table td.num { text-align: right; }
.doc-table td { padding: 13px 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: top; }
.doc-table .desc { font-weight: 600; }
.doc-table .hsn { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }

.doc-total { margin-left: auto; width: min(320px, 100%); margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.doc-total .row { display: flex; justify-content: space-between; padding: 0; border: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.doc-total .row.grand { font-size: 17px; font-weight: 800; color: var(--ink); border-top: 1.5px solid #111428; padding-top: 10px; margin-top: 4px; }

.doc-note { margin-top: 26px; padding: 14px 16px; background: #fafaff; border: 1px dashed #dcddf0; border-radius: 12px; font-size: 12.5px; color: var(--muted); }
.doc-note b { color: #3c4257; }
.doc-foot { margin-top: 34px; display: flex; justify-content: space-between; gap: 16px; font-size: 11.5px; color: #a3a7bd; border-top: 1px solid var(--line); padding-top: 16px; flex-wrap: wrap; }
.stamp {
    position: absolute;
    top: 128px;
    right: 54px;
    border: 3px solid #12b76a;
    color: #0a7c53;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: .12em;
    padding: 8px 18px;
    border-radius: 10px;
    transform: rotate(-8deg);
    opacity: .8;
    text-transform: uppercase;
    pointer-events: none;
}

/* ================================================================
   Settings
   ================================================================ */
.settings-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; align-items: start; }
.settings-stack { display: flex; flex-direction: column; gap: 16px; }

/* ================================================================
   Auth pages
   ================================================================ */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); }
.auth-side {
    position: relative;
    background: #0d0f22;
    color: #fff;
    padding: 46px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    overflow: hidden;
}
.auth-side::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, .5), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, .4), transparent 50%);
    filter: blur(20px);
}
.auth-side > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth-copy h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; max-width: 440px; }
.auth-copy > p { margin-top: 14px; color: rgba(255, 255, 255, .62); max-width: 420px; font-size: 14.5px; line-height: 1.65; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: rgba(255, 255, 255, .78); font-weight: 600; }
.auth-points .ic { width: 17px; height: 17px; color: #34d399; }
.auth-foot { font-size: 12px; color: rgba(255, 255, 255, .35); }

.auth-main { display: grid; place-items: center; padding: 44px 22px; background: var(--bg); }
.auth-card { width: min(430px, 100%); }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 6px 0 26px; line-height: 1.6; }
.auth-card .field { margin-bottom: 16px; }
.auth-mobile-brand { display: none; justify-content: center; margin-bottom: 28px; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 22px; }
.auth-alt a { font-weight: 800; color: var(--brand-ink); }
.auth-error {
    background: #feeceb;
    color: #b42318;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.auth-error .ic { width: 17px; height: 17px; margin-top: 1px; }
.auth-success {
    background: #e8f9f0;
    color: #067647;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.auth-success .ic { width: 17px; height: 17px; margin-top: 1px; }
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 16px;
    background: #fff;
    border: 1px solid #d6d8ec;
    border-radius: 12px;
    color: var(--ink);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: border-color .18s, box-shadow .18s;
}
.btn-google:hover { border-color: #b9bce0; box-shadow: 0 6px 18px rgba(18, 20, 43, .08); }
.btn-google svg { flex: none; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: #e3e4f0; }
.demo-note {
    margin-top: 20px;
    background: #fff;
    border: 1px dashed #d6d8ec;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center;
    line-height: 1.5;
}
.demo-note b { color: var(--ink); }
.demo-note .ic { color: var(--brand); width: 18px; height: 18px; flex: none; }

/* ================================================================
   Landing page
   ================================================================ */
.landing { background: #f6f7fc; overflow-x: hidden; }
.landing .container { width: min(1140px, 100% - 40px); margin-inline: auto; }

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(246, 247, 252, .82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(232, 233, 243, .7);
}
.landing-nav .container { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 20px; }
.landing-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.landing-links { display: flex; align-items: center; gap: 26px; font-size: 13.5px; font-weight: 700; color: #4b5068; }
.landing-links a:hover { color: var(--brand-ink); }
.landing-cta { display: flex; gap: 10px; align-items: center; }

.hero { padding: 64px 0 36px; position: relative; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: 40px; align-items: center; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 99px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #4b5068;
    margin-bottom: 22px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px rgba(18, 183, 106, .15); }
.hero h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -.045em; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(100deg, #5b5bf7, #a855f7 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin-top: 18px; font-size: 16px; line-height: 1.7; color: #565b78; max-width: 490px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 18px; margin-top: 22px; font-size: 12.5px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta .ic { width: 15px; height: 15px; color: #0a7c53; }

.phone-wrap { position: relative; display: flex; justify-content: center; padding: 16px 0; }
.phone-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .28), transparent 62%); top: 50%; left: 50%; transform: translate(-50%, -50%); }
.phone {
    position: relative;
    width: 296px;
    height: 600px;
    background: #0d0f22;
    border-radius: 46px;
    padding: 11px;
    box-shadow: 0 40px 90px -30px rgba(13, 15, 34, .55);
    border: 1px solid rgba(255, 255, 255, .08);
}
.phone-notch { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 108px; height: 25px; background: #0d0f22; border-radius: 0 0 18px 18px; z-index: 3; }
.phone-screen { height: 100%; border-radius: 36px; background: #f4f5fb; overflow: hidden; display: flex; flex-direction: column; }
.mock-top { padding: 40px 18px 14px; background: linear-gradient(135deg, #11142c, #2a1d5c); color: #fff; }
.mock-hello { font-size: 10.5px; color: rgba(255, 255, 255, .55); font-weight: 600; }
.mock-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.mock-amount { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 12px; }
.mock-amount small { font-size: 10.5px; font-weight: 800; color: #34d399; vertical-align: middle; margin-left: 6px; }
.mock-chips { display: flex; gap: 8px; margin-top: 14px; }
.mock-chip { flex: 1; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 9px 10px; }
.mock-chip b { display: block; font-size: 12px; }
.mock-chip span { font-size: 9px; color: rgba(255, 255, 255, .5); font-weight: 700; }
.mock-body { padding: 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.mock-card { background: #fff; border-radius: 15px; padding: 12px 13px; display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 18px -10px rgba(17, 20, 45, .2); }
.mock-ic { width: 34px; height: 34px; border-radius: 10px; background: #eef0ff; color: #4c4ddc; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; flex: none; }
.mock-t { font-size: 11.5px; font-weight: 800; }
.mock-s { font-size: 9px; color: #8b8fa8; font-weight: 600; margin-top: 1px; }
.mock-amt { margin-left: auto; text-align: right; }
.mock-amt b { font-size: 11.5px; display: block; }
.mock-badge { display: inline-block; font-size: 8px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: #e7f8f0; color: #0a7c53; margin-top: 3px; }
.mock-badge.warn { background: #fef4e6; color: #a15c07; }
.mock-nav { margin-top: auto; background: #fff; border-top: 1px solid #e8e9f3; display: flex; justify-content: space-around; padding: 12px 10px 16px; }
.mock-nav span { width: 30px; height: 6px; border-radius: 99px; background: #e2e4f0; }
.mock-nav span.on { background: linear-gradient(90deg, #5b5bf7, #a855f7); }

.section { padding: 54px 0; }
.section-head { text-align: center; max-width: 580px; margin: 0 auto 40px; }
.section-head .eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-ink); }
.section-head h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.035em; margin-top: 10px; }
.section-head p { color: #565b78; font-size: 14.5px; line-height: 1.7; margin-top: 12px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); transition: transform .2s; }
.feature:hover { transform: translateY(-3px); }
.feature .fic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 16px; }
.feature .fic .ic { width: 21px; height: 21px; }
.feature h3 { font-size: 15px; font-weight: 800; }
.feature p { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 6px; }

.verticals { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.vertical { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 9px 16px; font-size: 13px; font-weight: 700; color: #4b5068; box-shadow: 0 4px 12px -8px rgba(17, 20, 45, .2); }

.cta-band {
    background: linear-gradient(125deg, #11142c, #31216b 58%, #4c1d95);
    border-radius: 28px;
    color: #fff;
    padding: 52px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 20px 0 10px;
}
.cta-band::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(168, 85, 247, .5), transparent 60%); top: -220px; right: -120px; }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.03em; position: relative; }
.cta-band p { color: rgba(255, 255, 255, .68); margin-top: 10px; font-size: 14.5px; position: relative; }
.cta-band .btn { margin-top: 26px; position: relative; background: #fff; color: #11142c; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .5); }

.landing-footer { border-top: 1px solid var(--line); margin-top: 54px; padding: 30px 0 44px; color: var(--muted); font-size: 13px; }
.landing-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.landing-footer .flinks { display: flex; gap: 20px; font-weight: 600; }
.landing-footer a:hover { color: var(--brand-ink); }

/* ================================================================
   Installer
   ================================================================ */
.install-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    background:
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, .16), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(168, 85, 247, .14), transparent 45%),
        var(--bg);
}
.install-wrap { width: min(540px, 100%); }
.install-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 22px; }
.install-card { padding: 32px; }
.install-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.install-card > p.muted { margin-top: 8px; font-size: 13.5px; line-height: 1.6; }
.check-list { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list li { display: flex; align-items: center; gap: 10px; background: #fafaff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; }
.check-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.check-dot .ic { width: 13px; height: 13px; }
.check-dot.ok { background: #e7f8f0; color: #0a7c53; }
.check-dot.bad { background: #feeceb; color: #c0261b; }
.check-list .small { margin-left: auto; }
.install-success { text-align: center; }
.success-ring { width: 64px; height: 64px; border-radius: 50%; background: #e7f8f0; color: #0a7c53; display: grid; place-items: center; margin: 4px auto 16px; }
.success-ring .ic { width: 28px; height: 28px; }
.install-success p { margin-top: 8px; font-size: 13.5px; line-height: 1.6; }
.demo-box { margin-top: 22px; background: #fafaff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; flex-wrap: wrap; }
.demo-cred { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; margin-top: 2px; }
.flash { border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; }
.flash-error { background: #feeceb; color: #b42318; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .plans { grid-template-columns: 1fr; }
    .plan-desc { min-height: 0; }
    .settings-grid { grid-template-columns: 1fr; }
    .hero .container { grid-template-columns: 1fr; gap: 8px; }
    .phone-wrap { padding: 26px 0 10px; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-mobile-brand { display: flex; }
    .auth-main { align-items: start; padding-top: 40px; }
}

@media (max-width: 920px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .topbar { padding: 12px 18px; }
    .topbar h1 { font-size: 17px; }
    .mobile-brand { display: block; }
    .trial-bar { padding: 10px 18px; font-size: 12.5px; }
    .content { padding: 18px 16px 122px; }
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid var(--line);
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        justify-content: space-around;
        box-shadow: 0 -12px 30px -18px rgba(17, 20, 45, .25);
    }
    .bn-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 10px;
        font-weight: 700;
        color: var(--muted);
        padding: 6px 10px;
        border-radius: 12px;
        min-width: 56px;
        transition: color .15s;
    }
    .bn-item .ic { width: 20px; height: 20px; }
    .bn-item.active { color: #4c4ddc; }
    .bn-item.active .ic { filter: drop-shadow(0 4px 8px rgba(91, 91, 247, .4)); }
    .fab {
        display: grid;
        position: fixed;
        right: 18px;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: 56px;
        height: 56px;
        border-radius: 19px;
        background: linear-gradient(135deg, #5b5bf7, #9333ea);
        color: #fff;
        place-items: center;
        box-shadow: 0 18px 34px -12px rgba(99, 91, 255, .75);
        z-index: 95;
        transition: transform .15s;
    }
    .fab .ic { width: 24px; height: 24px; }
    .fab:active { transform: scale(.94); }
    .toast { top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); right: 16px; left: 16px; max-width: none; }
    .hide-mobile { display: none !important; }
    .show-mobile { display: inline-flex !important; }
    .admin-mobile-nav {
        display: flex;
        gap: 8px;
        padding: 0 16px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-mobile-nav a {
        font-size: 12.5px;
        font-weight: 700;
        padding: 7px 12px;
        border-radius: 99px;
        background: #f4f5fb;
        border: 1px solid var(--line);
        color: #3c4257;
        white-space: nowrap;
    }
    .admin-mobile-nav a.active { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
    .invoice-actions .remind { margin-right: 0; }
}

@media (max-width: 640px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat { padding: 15px; border-radius: 18px; }
    .stat-value { font-size: 20px; }
    .stat-ic { width: 32px; height: 32px; border-radius: 10px; }
    .stat-ic .ic { width: 16px; height: 16px; }
    .stat-label { font-size: 10px; }
    .card { padding: 18px; border-radius: 18px; }
    .page-head h2 { font-size: 19px; }
    .page-head { align-items: center; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
    .item-head { display: none; }
    .item-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "prod prod" "desc desc" "qty rate" "amt del";
        gap: 8px;
        background: #fafaff;
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 12px;
        align-items: end;
    }
    .item-row .i-prod { grid-area: prod; }
    .item-row .i-desc { grid-area: desc; }
    .item-row .i-qty { grid-area: qty; }
    .item-row .i-rate { grid-area: rate; }
    .item-row .i-amt { grid-area: amt; }
    .item-row .i-del { grid-area: del; justify-self: end; }
    .item-row .field label { display: block; font-size: 10.5px; margin-bottom: 5px; }
    .totals { width: 100%; }
    .invoice-doc { padding: 22px; border-radius: 18px; }
    .doc-top { flex-direction: column; gap: 14px; }
    .doc-title { text-align: left; }
    .doc-meta { grid-template-columns: 1fr; gap: 14px; }
    .doc-dates { justify-content: flex-start; text-align: left; }
    .doc-table .hide-sm { display: none; }
    .stamp { top: auto; bottom: 24px; right: 20px; font-size: 15px; padding: 6px 12px; }
    .invoice-actions { justify-content: stretch; }
    .invoice-actions .btn { flex: 1 1 auto; }
    .features { grid-template-columns: 1fr; }
    .landing-links { display: none; }
    .plan-grid-head { margin-top: 22px; }
    .sub-hero { padding: 22px; }
    .sub-hero h2 { font-size: 21px; }
    .cust-grid { grid-template-columns: 1fr; }
    .tabs { width: 100%; }
    .tab { padding: 7px 11px; font-size: 12.5px; }
    .tab .count { margin-left: 4px; padding: 1px 6px; }
    .search { max-width: none; }
    .hero { padding: 40px 0 20px; }
    .cta-band { padding: 40px 20px; }
    .drawer-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 90dvh; border-radius: 24px 24px 0 0; animation: sheetIn .28s cubic-bezier(.2, .8, .2, 1); }
    .demo-box { flex-direction: column; align-items: stretch; }
    .demo-box .btn { width: 100%; }
    .auth-main { padding: 30px 16px 40px; }
}

/* ================================================================
   Admin console
   ================================================================ */
.admin-pill {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .14);
    color: #cdd0ff;
    flex: none;
}
.admin-pill-light { background: var(--brand-soft); color: var(--brand-ink); }
.admin-mobile-nav { display: none; }

.client-list { display: flex; flex-direction: column; }
.client-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
    min-width: 0;
}
.client-row:last-child { border-bottom: 0; }
.client-main { flex: 1; min-width: 0; }
.client-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.client-plan { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.detail-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 16px; align-items: start; }
.detail-grid .settings-stack { gap: 16px; }

.plan-share { display: flex; flex-direction: column; gap: 13px; }
.plan-share-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: #3c4257; }
.plan-share-row .name { width: 62px; flex: none; font-weight: 800; color: var(--ink); }
.plan-share-row .bar { flex: 1; height: 8px; border-radius: 99px; background: #eef0f7; overflow: hidden; }
.plan-share-row .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #a855f7); }
.plan-share-row .count { width: 28px; text-align: right; font-weight: 800; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eceef6; font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-weight: 600; }
.kv b { text-align: right; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* Payment QR + proof flow */
.pay-card { margin-top: 16px; }
.pay-form { margin-top: 16px; }
.pay-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: start; }
.pay-grid .card { margin-top: 0; }
.pay-card .card-body { display: flex; flex-direction: column; gap: 14px; }
.pay-card .card-body .btn { margin-top: 2px; }
.pay-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 16px 22px 4px; }
.pay-detail-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; }
.break { word-break: break-all; }
.field > span { font-size: 12.5px; font-weight: 700; color: #3c4257; margin-bottom: 7px; display: flex; align-items: center; gap: 5px; }
.pay-card .field { margin-bottom: 14px; }
.pay-card .field:last-of-type { margin-bottom: 16px; }
.cycle-radios { display: flex; gap: 10px; flex-wrap: wrap; }
.cycle-radios label {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
    border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 700;
    color: #3c4257; cursor: pointer; background: #fff;
}
.cycle-radios label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.qr-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 6px 4px 2px; }
.qr-wrap img { width: 100%; max-width: 240px; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 8px; }
.qr-empty {
    width: 100%; max-width: 240px; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13px; font-weight: 700;
}
.pay-total { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.qr-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #3c4257; padding-top: 8px; border-top: 1px dashed #eceef6; width: 100%; }
.qr-meta b { color: var(--ink); }
.pay-qr-img { width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 8px; }
.pay-proof-img { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 6px; }
.settings-grid .card .btn { margin-top: 4px; }
.left { text-align: left; }

@media (max-width: 880px) {
    .pay-grid { grid-template-columns: 1fr; }
    .pay-detail-grid { grid-template-columns: 1fr; padding: 14px 18px 2px; }
}

/* ================================================================
   Print
   ================================================================ */
@media print {
    body { background: #fff; }
    .sidebar, .topbar, .trial-bar, .bottom-nav, .fab, .toast, .invoice-actions, .no-print { display: none !important; }
    .shell { display: block; }
    .content { padding: 0; max-width: none; animation: none; }
    .invoice-doc { border: none; box-shadow: none; border-radius: 0; padding: 8px; }
    .invoice-shell { max-width: none; }
    .stamp { opacity: .9; }
    a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
