/* ============================================================
   AzyPOS · Design system
   Tenant console + platform control tower + auth
   ============================================================ */
:root {
    --bg: #070b10;
    --bg-2: #0a1118;
    --bg-3: #0d1620;
    --surface: #101a24;
    --surface-2: #14212d;
    --surface-3: #1a2a38;
    --line: rgba(148, 180, 205, .13);
    --line-strong: rgba(148, 180, 205, .24);
    --text: #e9f2f8;
    --text-soft: #c4d3df;
    --muted: #7f95a8;
    --dim: #5d7182;
    --accent: #79f2b0;
    --accent-strong: #35d68a;
    --accent-ink: #04170e;
    --blue: #7dd3fc;
    --violet: #a78bfa;
    --amber: #fbbf24;
    --rose: #fb7185;
    --orange: #fb923c;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 9px;
    --shadow: 0 24px 70px -30px rgba(0, 0, 0, .85);
    --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f4f7f4;
    --bg-2: #eef3ee;
    --bg-3: #e7eee8;
    --surface: #ffffff;
    --surface-2: #f7faf7;
    --surface-3: #edf3ee;
    --line: rgba(21, 55, 39, .11);
    --line-strong: rgba(21, 55, 39, .2);
    --text: #11251b;
    --text-soft: #2c4638;
    --muted: #5f7467;
    --dim: #83968a;
    --accent: #129c61;
    --accent-strong: #0b7d4c;
    --accent-ink: #ffffff;
    --blue: #0284c7;
    --violet: #7c3aed;
    --amber: #b45309;
    --rose: #e11d48;
    --shadow: 0 24px 60px -34px rgba(16, 60, 40, .35);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 700px at 82% -10%, rgba(53, 214, 138, .09), transparent 60%),
        radial-gradient(900px 600px at -10% 100%, rgba(125, 211, 252, .07), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(121, 242, 176, .28); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(26px, 3vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
p { margin: 0; }
small { font-size: 12px; }
code, .mono { font-family: var(--mono); font-size: .86em; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app-shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 14px 16px;
    background: linear-gradient(180deg, rgba(16, 26, 36, .92), rgba(9, 15, 21, .96));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    z-index: 30;
}
[data-theme="light"] .sidebar { background: linear-gradient(180deg, #fff, #f4f8f4); }
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 20px;
}
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--accent), var(--accent-2, #5eead4));
    color: var(--accent-ink);
    font-weight: 800;
    font-size: 17px;
    box-shadow: 0 8px 24px -10px rgba(121, 242, 176, .8);
    flex: none;
    overflow: hidden;
}
.brand-logo { object-fit: cover; }
.brand-copy { min-width: 0; }
.brand-name { display: block; font-weight: 760; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; }
.nav-scroll { overflow-y: auto; flex: 1; scrollbar-width: thin; margin: 2px -6px 0; padding: 0 6px 12px; }
.nav-group { margin-bottom: 18px; }
.nav-label { margin: 0 0 7px 10px; color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    color: var(--text-soft);
    font-weight: 560;
    font-size: 13px;
    border: 1px solid transparent;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-link + .nav-link { margin-top: 2px; }
.nav-link svg { width: 17px; height: 17px; opacity: .68; flex: none; }
.nav-link:hover { background: rgba(255, 255, 255, .045); color: var(--text); }
.nav-link.active {
    background: linear-gradient(90deg, rgba(121, 242, 176, .14), rgba(121, 242, 176, .03));
    border-color: rgba(121, 242, 176, .22);
    color: var(--text);
}
[data-theme="light"] .nav-link.active { background: rgba(18, 156, 97, .1); }
.nav-link.active svg { opacity: 1; color: var(--accent); }
.nav-link.accent { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 10px 26px -16px rgba(121, 242, 176, .9); }
.nav-link.accent svg { opacity: 1; }
.nav-link.accent:hover { filter: brightness(1.05); color: var(--accent-ink); background: var(--accent); }
.nav-link .nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--rose); }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.workspace {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: 11px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
}
.workspace-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 750; color: var(--accent); flex: none; }
.workspace-name { display: block; font-size: 12.5px; font-weight: 680; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-plan { display: block; font-size: 10.5px; color: var(--muted); }
.workspace-link { margin-left: auto; color: var(--muted); display: flex; }
.workspace-link:hover { color: var(--accent); }
.workspace-link svg { width: 15px; height: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 30px;
    background: rgba(7, 11, 16, .78);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}
[data-theme="light"] .topbar { background: rgba(244, 247, 244, .86); }
.topbar-title { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.topbar-spacer { flex: 1; }
.branch-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 11px; border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft); font-size: 12px;
}
.branch-chip svg { width: 14px; height: 14px; color: var(--accent); }
.icon-btn {
    width: 36px; height: 36px; display: inline-grid; place-items: center;
    border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
    transition: .16s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.kbd {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--line); border-bottom-width: 2px;
    border-radius: 6px; padding: 1px 6px; font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 5px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--accent), var(--blue)); color: var(--accent-ink); font-weight: 800; font-size: 11px; }
.user-name { display: block; font-size: 12px; font-weight: 650; line-height: 1.2; }
.user-role { display: block; font-size: 10px; color: var(--muted); }
.content { padding: 28px 30px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- Typography / headers ---------- */
.eyebrow { color: var(--accent); font-size: 10.5px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 7px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.positive { color: var(--accent); }
.negative { color: var(--rose); }
.warning { color: var(--amber); }
.tiny { font-size: 11px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 0 15px;
    border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--surface-2); color: var(--text);
    font-size: 12.5px; font-weight: 680; letter-spacing: .01em;
    transition: .16s ease; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 28px -16px rgba(121, 242, 176, .8); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.btn-danger { border-color: rgba(251, 113, 133, .3); color: var(--rose); background: rgba(251, 113, 133, .07); }
.btn-danger:hover { border-color: var(--rose); color: var(--rose); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-lg { min-height: 46px; padding: 0 22px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards / panels ---------- */
.card, .panel {
    background: linear-gradient(160deg, var(--surface), rgba(16, 26, 36, .82));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
[data-theme="light"] .card, [data-theme="light"] .panel { background: var(--surface); }
.card { padding: 18px; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { position: relative; padding: 17px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, var(--surface), rgba(16, 26, 36, .6)); overflow: hidden; }
[data-theme="light"] .metric { background: var(--surface); }
.metric::after { content: ""; position: absolute; inset: auto -20% -60% auto; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(121, 242, 176, .12), transparent 70%); }
.metric-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.metric-value { margin-top: 8px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 780; letter-spacing: -.03em; }
.metric-note { margin-top: 4px; color: var(--dim); font-size: 11.5px; }
.metric-accent { border-color: rgba(121, 242, 176, .28); background: linear-gradient(150deg, rgba(121, 242, 176, .13), var(--surface)); }
.metric-warn { border-color: rgba(251, 191, 36, .28); }
.metric-warn .metric-value { color: var(--amber); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(121, 242, 176, .1); }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(251, 191, 36, .1); }
.dot.rose { background: var(--rose); box-shadow: 0 0 0 4px rgba(251, 113, 133, .1); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { text-align: left; padding: 10px 14px; color: var(--dim); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid rgba(148, 180, 205, .07); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table .main-cell { font-weight: 650; color: var(--text); }
.table .sub-cell { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; border: 1px solid transparent; white-space: nowrap; }
.badge-green { background: rgba(121, 242, 176, .1); color: var(--accent); border-color: rgba(121, 242, 176, .2); }
.badge-blue { background: rgba(125, 211, 252, .1); color: var(--blue); border-color: rgba(125, 211, 252, .2); }
.badge-amber { background: rgba(251, 191, 36, .1); color: var(--amber); border-color: rgba(251, 191, 36, .2); }
.badge-rose { background: rgba(251, 113, 133, .1); color: var(--rose); border-color: rgba(251, 113, 133, .2); }
.badge-violet { background: rgba(167, 139, 250, .1); color: var(--violet); border-color: rgba(167, 139, 250, .2); }
.badge-dim { background: rgba(148, 180, 205, .08); color: var(--muted); border-color: var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; color: var(--text-soft); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--text-soft); letter-spacing: .02em; }
.field .hint { margin-top: 5px; color: var(--dim); font-size: 11px; }
.input, select.input, textarea.input {
    width: 100%; min-height: 39px; padding: 8px 11px;
    border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--bg-2); color: var(--text); outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
[data-theme="light"] .input { background: #fff; }
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(121, 242, 176, .12); }
textarea.input { min-height: 80px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-soft); }
.check input { accent-color: var(--accent-strong); width: 15px; height: 15px; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.search-input .input { padding-left: 34px; }
.form-actions { display: flex; gap: 9px; justify-content: flex-end; padding-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

/* ---------- Flash ---------- */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; font-size: 12.5px; }
.flash svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.flash-success { background: rgba(121, 242, 176, .08); border-color: rgba(121, 242, 176, .25); color: #b9ffd9; }
.flash-error { background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .25); color: #ffc2cb; }
[data-theme="light"] .flash-success { color: #0b6b43; }
[data-theme="light"] .flash-error { color: #a3122e; }

/* ---------- Empty ---------- */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--dim); margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- Charts ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 12px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-val { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-track { width: 100%; max-width: 38px; flex: 1; display: flex; align-items: flex-end; }
.chart-bar { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), rgba(53, 214, 138, .25)); min-height: 3px; transition: height .5s ease; }
.chart-col:nth-child(even) .chart-bar { background: linear-gradient(180deg, var(--blue), rgba(125, 211, 252, .18)); }
.chart-label { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.progress.amber > span { background: linear-gradient(90deg, #d97706, var(--amber)); }

/* ---------- Timeline / lists ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid rgba(148, 180, 205, .07); }
.list-row:last-child { border-bottom: 0; }
.list-icon { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.list-icon svg { width: 16px; height: 16px; }
.list-main { min-width: 0; flex: 1; }
.list-title { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-end { text-align: right; flex: none; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; padding: 0 0 16px 4px; }
.timeline-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(121, 242, 176, .12); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-time { font-size: 10.5px; color: var(--dim); }
.timeline-title { font-size: 12px; font-weight: 600; }
.timeline-sub { font-size: 11px; color: var(--muted); }

/* ---------- Auth / landing ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-visual { position: relative; overflow: hidden; padding: 46px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(900px 600px at 20% 10%, rgba(53, 214, 138, .2), transparent 60%), linear-gradient(160deg, #07110c, #05090d 70%); }
.auth-visual::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(121, 242, 176, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(121, 242, 176, .045) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom right, rgba(0,0,0,.9), transparent 75%); }
.auth-visual > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.auth-copy h1 { font-size: clamp(34px, 4vw, 52px); max-width: 12ch; letter-spacing: -.045em; }
.auth-copy p { color: var(--muted); margin-top: 14px; max-width: 42ch; font-size: 14px; }
.auth-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.auth-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(121, 242, 176, .22); background: rgba(121, 242, 176, .07); color: #c9ffe2; font-size: 11px; }
.auth-preview { margin-top: 30px; border-radius: 18px; border: 1px solid rgba(121, 242, 176, .16); background: rgba(7, 14, 11, .55); padding: 16px; max-width: 420px; backdrop-filter: blur(8px); }
.auth-preview-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.auth-preview-total { font-size: 34px; font-weight: 800; letter-spacing: -.04em; margin: 6px 0 2px; }
.auth-preview-line { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11.5px; color: var(--text-soft); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 26px; background: var(--bg); }
.auth-card { width: 100%; max-width: 390px; }
.auth-card .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.auth-card h2 { font-size: 26px; letter-spacing: -.03em; margin: 18px 0 5px; }
.auth-card .lead { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-card .form-grid { gap: 13px; }
.auth-foot { margin-top: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-foot a { color: var(--accent); font-weight: 650; }
.auth-alt { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-box { margin-top: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 11px 13px; background: rgba(121, 242, 176, .04); font-size: 11.5px; color: var(--muted); }
.demo-box strong { color: var(--text); }
.demo-box code { color: var(--accent); }

/* ---------- Command palette ---------- */
.palette-backdrop, .modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(2, 5, 8, .72); backdrop-filter: blur(6px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 10vh 18px 18px;
}
.modal-backdrop { align-items: center; padding-top: 18px; }
.palette { width: 100%; max-width: 580px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 40px 100px -20px #000; overflow: hidden; }
.palette-input { width: 100%; border: 0; background: transparent; padding: 16px 18px; font-size: 15px; outline: none; color: var(--text); }
.palette-list { max-height: 360px; overflow-y: auto; border-top: 1px solid var(--line); padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: var(--text-soft); font-size: 13px; cursor: pointer; }
.palette-item:hover, .palette-item.selected { background: rgba(121, 242, 176, .09); color: var(--text); }
.palette-item svg { width: 16px; height: 16px; color: var(--accent); }
.palette-hint { padding: 9px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10.5px; display: flex; gap: 14px; }

/* ---------- Modal ---------- */
.modal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 40px 100px -20px #000; max-height: 88vh; overflow-y: auto; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-title { font-size: 16px; font-weight: 720; }
.modal-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; position: sticky; bottom: 0; background: var(--surface); }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease; }
.toast.success { border-color: rgba(121, 242, 176, .35); }
.toast.error { border-color: rgba(251, 113, 133, .35); }
.toast svg { width: 16px; height: 16px; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(148, 180, 205, .07); font-size: 12px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row strong { font-variant-numeric: tabular-nums; }
.avatar-lg { width: 54px; height: 54px; border-radius: 16px; font-size: 18px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 22px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-block { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-family: var(--mono); font-size: 11.5px; color: var(--accent); overflow-x: auto; }
.danger-zone { border: 1px solid rgba(251, 113, 133, .25); background: rgba(251, 113, 133, .04); border-radius: 12px; padding: 15px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface-2); position: relative; }
.plan-card.current { border-color: rgba(121, 242, 176, .4); box-shadow: inset 0 0 0 1px rgba(121, 242, 176, .1); }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; }
.plan-price span { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.plan-features { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.plan-features li { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; color: var(--text-soft); }
.plan-features svg { width: 13px; height: 13px; color: var(--accent); flex: none; margin-top: 2px; }
.feature-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--amber); }
.offline-pill { display: none; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(251, 191, 36, .12); color: var(--amber); border: 1px solid rgba(251, 191, 36, .25); font-size: 10.5px; font-weight: 650; }
body.is-offline .offline-pill { display: inline-flex; }

@media (max-width: 1200px) {
    .grid-4, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: 252px; transform: translateX(-105%); transition: transform .2s ease; }
    body.nav-open .sidebar { transform: none; }
    .topbar { padding: 12px 16px; }
    .content { padding: 20px 16px 40px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .metrics, .grid-4, .plan-grid { grid-template-columns: 1fr; }
    .page-head { align-items: flex-start; }
    .topbar-title, .branch-chip .branch-label { display: none; }
    .table th, .table td { padding: 10px 9px; }
}

/* ---------- Admin overrides ---------- */
body.admin {
    --bg: #08080c;
    --bg-2: #0d0d13;
    --bg-3: #12121a;
    --surface: #111118;
    --surface-2: #17171f;
    --surface-3: #20202b;
    --line: rgba(196, 181, 253, .1);
    --line-strong: rgba(196, 181, 253, .2);
    --accent: #c4b5fd;
    --accent-strong: #a78bfa;
    --accent-ink: #160f2e;
    --blue: #93c5fd;
    --amber: #fbbf24;
    background:
        radial-gradient(1100px 600px at 90% -10%, rgba(139, 92, 246, .13), transparent 60%),
        radial-gradient(800px 500px at -10% 100%, rgba(251, 191, 36, .05), transparent 55%),
        var(--bg);
}
body.admin .sidebar { background: linear-gradient(180deg, rgba(17, 17, 24, .96), rgba(8, 8, 12, .98)); border-right-color: var(--line); }
body.admin .brand-mark { background: linear-gradient(145deg, #c4b5fd, #a78bfa); color: #160f2e; box-shadow: 0 8px 24px -10px rgba(167, 139, 250, .8); }
body.admin .nav-link.active { background: linear-gradient(90deg, rgba(196, 181, 253, .16), rgba(196, 181, 253, .02)); border-color: rgba(196, 181, 253, .25); }
body.admin .nav-link.active svg { color: var(--accent); }
body.admin .eyebrow { color: var(--accent); }
body.admin .topbar { background: rgba(8, 8, 12, .8); }
body.admin .metric-accent { border-color: rgba(196, 181, 253, .28); background: linear-gradient(150deg, rgba(196, 181, 253, .12), var(--surface)); }
body.admin .chart-bar { background: linear-gradient(180deg, var(--accent), rgba(167, 139, 250, .2)); }
body.admin .chart-col:nth-child(even) .chart-bar { background: linear-gradient(180deg, var(--amber), rgba(251, 191, 36, .15)); }
body.admin .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 28px -16px rgba(167, 139, 250, .8); }
body.admin .btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
body.admin .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196, 181, 253, .12); }
body.admin .avatar { background: linear-gradient(145deg, #c4b5fd, #fbbf24); color: #160f2e; }
body.admin .auth-visual { background: radial-gradient(900px 600px at 20% 10%, rgba(139, 92, 246, .22), transparent 60%), linear-gradient(160deg, #0c0815, #050508 70%); }
body.admin .auth-visual::before { background-image: linear-gradient(rgba(196, 181, 253, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(196, 181, 253, .05) 1px, transparent 1px); }
body.admin .auth-pill { border-color: rgba(196, 181, 253, .24); background: rgba(196, 181, 253, .08); color: #e6ddff; }
body.admin .auth-preview { border-color: rgba(196, 181, 253, .2); }
.admin-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 6px; background: rgba(196, 181, 253, .1); color: var(--accent); border: 1px solid rgba(196, 181, 253, .2); font-size: 9.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
