/* LDesk — desk.lexiata.lk · UI styles */

:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Sinhala", "Iskoola Pota", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --border: #e2e7ef;
    --border-strong: #cfd7e3;
    --text: #172033;
    --muted: #5d6879;
    --faint: #6b7688;

    --brand: #004ea7;
    --brand-hover: #003f88;
    --brand-soft: #e7effa;
    --brand-ink: #003063;

    --success: #177245;
    --success-soft: #e6f4ec;
    --warning: #a65b00;
    --warning-soft: #fdf1df;
    --danger: #c0262d;
    --danger-soft: #fcebec;
    --info: #0b6aa2;
    --info-soft: #e5f2fa;

    --sidebar-bg: #003063;
    --sidebar-text: #c9d6ea;
    --sidebar-muted: #7f97bd;
    --sidebar-active: rgba(255, 255, 255, 0.12);
    --sidebar-hover: rgba(255, 255, 255, 0.07);

    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
    --focus: 0 0 0 3px rgba(0, 78, 167, 0.25);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0d131d;
    --surface: #141c29;
    --surface-2: #19222f;
    --border: #243043;
    --border-strong: #324057;
    --text: #e5eaf2;
    --muted: #9aa6b8;
    --faint: #7f8ba0;

    --brand: #5a9bf0;
    --brand-hover: #79aff5;
    --brand-soft: #16263d;
    --brand-ink: #cfe0f8;

    --success: #4cc38a;
    --success-soft: #11291f;
    --warning: #f0a54a;
    --warning-soft: #2e2211;
    --danger: #f06b70;
    --danger-soft: #331618;
    --info: #5bb5e8;
    --info-soft: #102636;

    --sidebar-bg: #0a111b;
    --sidebar-text: #b8c4d6;
    --sidebar-muted: #66748a;
    --sidebar-active: rgba(90, 155, 240, 0.16);
    --sidebar-hover: rgba(255, 255, 255, 0.05);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    --focus: 0 0 0 3px rgba(90, 155, 240, 0.35);
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

.icon { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── App shell ─────────────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 12px;
    overflow-y: auto;
}

.brand {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 18px; color: #fff;
    border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08);
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: background .15s, border-color .15s;
}
.brand:hover { text-decoration: none; color: #fff; border-color: rgba(255, 255, 255, .14); background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); }
.brand-mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 6px 14px rgba(37, 99, 235, .42)); }
.brand-img { border-radius: 11px; object-fit: cover; background: #fff; filter: none; box-shadow: 0 6px 14px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 255, 255, .16); }
.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -0.2px; line-height: 1.15; }
.brand-sub { font-size: 10.5px; color: var(--sidebar-muted); font-weight: 650; letter-spacing: .7px; text-transform: uppercase; }
.app-icon-row { display: flex; align-items: center; gap: 18px; }
.app-icon-preview { width: 72px; height: 72px; border-radius: 18px; background: var(--sidebar-bg); display: grid; place-items: center; flex: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--sidebar-muted); padding: 16px 12px 6px; font-weight: 600; }
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-weight: 500;
}
.nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav a.is-active { background: var(--sidebar-active); color: #fff; }
.nav a.is-active .icon { color: #8fc0ff; }

.sidebar-foot { margin-top: auto; padding: 16px 12px 0; font-size: 11.5px; color: var(--sidebar-muted); }
.sidebar-foot a { color: var(--sidebar-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 12px;
    height: 60px;
    padding: 0 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 650; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 550; font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.menu-btn { display: none; }

.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 28px; background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid var(--border); font-weight: 550; }
.banner a { color: inherit; text-decoration: underline; }

.scrim { display: none; }

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px;
    font: inherit; font-weight: 600; font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
[data-theme="dark"] .btn-primary { color: #06101e; }
[data-theme="dark"] .btn-primary:hover { color: #06101e; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }

.inline-form { display: inline; margin: 0; }

/* ── Cards & layout helpers ────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head p { margin: 2px 0 0; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card + .card, .card + .grid, .grid + .card, .card + .stats, .stack > * + * { margin-top: 20px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; width: 280px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty > .icon { color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ── Stat tiles ────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat-value.is-warning { color: var(--warning); }
.stat-value.is-success { color: var(--success); }

/* ── Tables ────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--muted); background: var(--surface-2);
    padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: 4px; }
.cell-title { font-weight: 600; color: var(--text); }
a.cell-title:hover { color: var(--brand); }
.cell-sub { font-size: 12.5px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list-main { min-width: 0; }
.list-main .cell-title, .list-main .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; word-break: break-word; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-top: 1px solid var(--border); }
.pager a, .pager span { font-weight: 600; font-size: 13px; }
.pager .is-disabled { color: var(--faint); }
.pager-info { color: var(--muted); font-weight: 500 !important; }

/* ── Badges ────────────────────────────────────────────────────────── */

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ── Alerts ────────────────────────────────────────────────────────── */

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.alert p { margin: 0; }

/* ── Forms ─────────────────────────────────────────────────────────── */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 16px; }
.form-grid .field + .field { margin-top: 0; }
label, .label { font-weight: 600; font-size: 13px; }
.label-note { font-weight: 400; color: var(--faint); }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="search"], input[type="number"], input[type="date"], input[type="month"], input[type="time"], select, textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.is-invalid input, .is-invalid select, .is-invalid textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin: 0; font-weight: 500; }
.code-input { font-family: var(--mono); font-size: 20px !important; letter-spacing: 6px; text-align: center; height: 48px !important; }

.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }

.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; }
.radio-card input { margin-top: 3px; accent-color: var(--brand); }
.radio-card strong { display: block; font-size: 13.5px; }
.radio-card span { display: block; font-size: 12.5px; color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ── Tabs ──────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); }
.chip:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.chip.is-active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ── Specific ──────────────────────────────────────────────────────── */

.client-head { display: flex; align-items: flex-start; gap: 16px; }
.client-avatar { width: 52px; height: 52px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 20px; font-weight: 700; flex: none; }
.client-head h2 { font-size: 20px; }
.client-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--muted); }
.client-meta span { display: inline-flex; align-items: center; gap: 6px; }

.qr-box { display: grid; place-items: center; width: 212px; height: 212px; background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 6px; }
.qr-box svg, .qr-box img { width: 200px; height: 200px; }
.secret { font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px; word-break: break-all; background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 10px 12px; border-radius: 8px; }
.setup-2fa { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 24px; align-items: start; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: var(--mono); font-size: 15px; letter-spacing: 1px; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 7px; flex: none; }
.activity .dot.is-bad { background: var(--danger); }
.activity .dot.is-good { background: var(--success); }
.activity-text { min-width: 0; }
.activity-text .cell-sub { overflow-wrap: anywhere; }

.test-log { font-size: 12.5px; color: var(--muted); }

/* ── Auth pages ────────────────────────────────────────────────────── */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background:
    radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box.is-wide { max-width: 600px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; color: var(--text); }
.auth-brand .brand-name { font-size: 22px; }
.auth-brand .brand-sub { color: var(--muted); }
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth .card-body { padding: 28px; }
.auth h1 { font-size: 20px; margin-bottom: 4px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--faint); }
.auth-theme { position: fixed; top: 14px; right: 14px; }

.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.steps span.is-done { background: var(--brand); }

.checks { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checks li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.checks li:last-child { border-bottom: 0; }
.checks .ok { color: var(--success); font-weight: 600; }
.checks .bad { color: var(--danger); font-weight: 600; }
.checks .warn { color: var(--warning); font-weight: 600; }

.token-steps { margin: 0 0 16px; padding-left: 20px; }
.token-steps li { margin-bottom: 6px; }

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: translateX(0); }
    .scrim { position: fixed; inset: 0; background: rgba(8, 14, 24, .45); z-index: 40; }
    .scrim.is-open { display: block; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .content { padding: 18px 16px 40px; }
    .banner { padding: 10px 16px; }
    .user-chip .user-name { display: none; }
    .user-chip { padding: 2px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .search input { width: 100%; }
    .search, .toolbar-left { flex: 1; }
    .setup-2fa { grid-template-columns: minmax(0, 1fr); }
    .hide-sm { display: none; }
    .card-head { flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .stats { gap: 10px; }
    .stat { padding: 14px; }
    .stat-value { font-size: 22px; }
    .radio-cards { grid-template-columns: minmax(0, 1fr); }
    .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
    .dl dd { margin-bottom: 10px; }
    .codes { grid-template-columns: minmax(0, 1fr); }
    .table td, .table th { padding: 10px 12px; }
    .auth .card-body { padding: 22px; }
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .app { display: block; }
}

/* Theme toggle icons */
.when-dark { display: none; }
[data-theme="dark"] .when-light { display: none; }
[data-theme="dark"] .when-dark { display: inline; }
.when-light, .when-dark { line-height: 0; }

.snippet-cell { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* Layout fixes: grid children never inherit the stacked-card margin */
.grid > .card, .grid > .stack, .stats > .card { margin-top: 0; }
.topbar .menu-btn { display: none; }
.search input[type="search"] { padding-left: 36px; }
.table-wrap { position: relative; }
.sr-only { margin: -1px; padding: 0; border: 0; top: 0; left: 0; }
a.stat { color: inherit; text-decoration: none; transition: border-color .12s; }
a.stat:hover { border-color: var(--border-strong); text-decoration: none; }

@media (max-width: 860px) {
    .topbar .menu-btn { display: inline-flex; }
}

@media (max-width: 860px) {
    .sidebar { box-shadow: none; visibility: hidden; transition: transform .2s ease, visibility .2s; }
    .sidebar.is-open { box-shadow: var(--shadow-lg); visibility: visible; }
}

/* ── Batch 2: projects, statuses, tracker ─────────────────────────── */

.text-danger { color: var(--danger) !important; }
.chip-count { opacity: .65; font-weight: 600; margin-left: 2px; }
.inline-actions { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }

.st-processing { --st: #3b82f6; }
.st-started { --st: #10b981; }
.st-building { --st: #0ea5e9; }
.st-almost_done { --st: #f59e0b; }
.st-review { --st: #8b5cf6; }
.st-revision { --st: #f97316; }
.st-completed { --st: #16a34a; }
.st-cancelled { --st: #ef4444; }

.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
    color: color-mix(in srgb, var(--st, #64748b) 82%, var(--text));
    background: color-mix(in srgb, var(--st, #64748b) 14%, transparent);
}
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--st, #64748b); }

.st-btn { background: color-mix(in srgb, var(--st) 65%, #000); border-color: transparent; color: #fff; }
.st-btn:hover { background: color-mix(in srgb, var(--st) 55%, #000); border-color: transparent; color: #fff; }
[data-theme="dark"] .st-btn, [data-theme="dark"] .st-btn:hover { color: #fff; }
.status-buttons { display: grid; gap: 6px; }
.status-buttons .st-btn { justify-content: flex-start; width: 100%; height: 38px; }
.status-buttons .st-btn.is-current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--st); }
.st-dot { background: var(--st) !important; }

.project-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.project-title { font-size: 21px; margin: 8px 0 2px; }
.project-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; color: var(--brand); font-weight: 600; }

.pipeline { display: flex; margin: 22px 0 14px; overflow-x: auto; padding-bottom: 2px; }
.pipe-step { flex: 1; min-width: 64px; display: flex; flex-direction: column; align-items: center; position: relative; }
.pipe-step::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--border); z-index: 0; }
.pipe-step:first-child::before { display: none; }
.pipe-step.is-done::before, .pipe-step.is-active::before { background: var(--st, var(--brand)); }
.pipe-dot {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
    font-size: 11px; font-weight: 700; border: 2px solid var(--border); background: var(--surface); color: var(--faint);
}
.pipe-step.is-done .pipe-dot { background: var(--st, var(--brand)); border-color: var(--st, var(--brand)); color: #fff; }
.pipe-step.is-active .pipe-dot { border-color: var(--st, var(--brand)); color: var(--st, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st, var(--brand)) 18%, transparent); }
.pipe-name { font-size: 11px; color: var(--faint); margin-top: 6px; text-align: center; }
.pipe-step.is-done .pipe-name, .pipe-step.is-active .pipe-name { color: var(--text); font-weight: 600; }
.card .pipeline { --st: var(--brand); }

.progress { height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #003063, var(--st, #249cff)); }

.logo-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { width: 170px; height: 72px; border: 1px dashed var(--border-strong); border-radius: 8px; display: grid; place-items: center; background: #fff; padding: 8px; }
.logo-preview img { max-width: 100%; max-height: 100%; }

/* Public tracker */
body.public { background: #f4f6fb; color: #0a0f1e; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 800px; margin: 0 auto; padding: 22px 20px 0; }
.pub-brand { display: inline-flex; align-items: center; font-weight: 800; font-size: 18px; color: #003063; }
.pub-brand:hover { text-decoration: none; }
.pub-brand img { height: 38px; width: auto; }
.pub-contact { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: #334155; }
.pub-foot { text-align: center; color: #94a3b8; font-size: 12px; padding: 10px 20px 40px; }

.trk { max-width: 760px; margin: 0 auto; padding: 36px 20px 40px; }
.trk-hero { text-align: center; margin-bottom: 32px; }
.trk-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; color: #0a0f1e; }
.trk-hero p { color: #64748b; margin: 0; }
.trk-search { display: flex; max-width: 540px; margin: 22px auto 0; background: #fff; border: 2px solid #e4e9f2; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,48,99,.08); }
.trk-search:focus-within { border-color: #249cff; box-shadow: 0 6px 32px rgba(36,156,255,.2); }
.trk-search input[type="text"] { flex: 1; border: 0 !important; box-shadow: none !important; height: 54px; padding: 0 20px; font-size: 15px; background: transparent; color: #0a0f1e; letter-spacing: .3px; }
.trk-search button { margin: 6px; padding: 0 26px; border: 0; border-radius: 11px; background: linear-gradient(135deg, #003063, #004ea7); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.trk-search button:hover { opacity: .9; }
.trk-card { background: #fff; border: 1px solid #e4e9f2; border-radius: 22px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,48,99,.09); }
.trk-banner { display: flex; justify-content: space-between; gap: 16px; padding: 26px 30px; background: linear-gradient(135deg, color-mix(in srgb, var(--st) 80%, #000), var(--st)); color: #fff; }
.trk-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; opacity: .8; margin-bottom: 6px; }
.trk-project { font-size: 22px; font-weight: 800; line-height: 1.2; }
.trk-domain { font-size: 13px; opacity: .8; margin-top: 4px; }
.trk-pillrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.trk-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px 5px 9px; border-radius: 99px; background: rgba(255,255,255,.2); font-size: 12px; font-weight: 700; }
.trk-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: trkPulse 1.8s infinite; }
.trk-pct { font-size: 12px; opacity: .8; }
.trk-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 24px; }
.trk-section { padding: 22px 30px; border-bottom: 1px solid #e4e9f2; }
.trk-section .pipeline { margin: 0; }
.trk-section .pipe-dot { background: #fff; }
.trk-section .pipe-name { color: #94a3b8; }
.trk-section .pipe-step.is-done .pipe-name, .trk-section .pipe-step.is-active .pipe-name { color: #003063; }
.trk-label { font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px; }
.trk-barmeta { display: flex; justify-content: space-between; font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.trk-barmeta strong { color: #0a0f1e; }
.trk .progress { background: #f1f5f9; border: 0; }
.trk-msg { display: flex; gap: 10px; align-items: center; padding: 16px 30px; border-bottom: 1px solid #e4e9f2; font-size: 14px; color: #475569; }
.trk-details { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 30px 22px; }
.trk-details > div { padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.trk-details > div:nth-child(odd) { padding-right: 20px; border-right: 1px solid #f1f5f9; }
.trk-details > div:nth-child(even) { padding-left: 20px; }
.trk-details > div:nth-last-child(-n+2) { border-bottom: 0; }
.trk-details span { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 4px; }
.trk-details strong { font-size: 14px; color: #0a0f1e; word-break: break-word; }
.trk-details strong.mono { color: #004ea7; }
.trk-empty { text-align: center; padding: 50px 30px; }
.trk-empty h2 { font-size: 18px; margin-bottom: 8px; color: #0a0f1e; }
.trk-empty p { color: #94a3b8; max-width: 340px; margin: 0 auto; }
.trk-empty-icon { font-size: 40px; opacity: .5; margin-bottom: 12px; }
@keyframes trkPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

@media (max-width: 600px) {
    .trk { padding: 24px 14px 32px; }
    .trk-hero h1 { font-size: 22px; }
    .trk-search button { padding: 0 16px; }
    .trk-banner, .trk-section, .trk-msg { padding-left: 18px; padding-right: 18px; }
    .trk-project { font-size: 18px; }
    .trk-details { grid-template-columns: 1fr; padding: 6px 18px 18px; }
    .trk-details > div { border-right: 0 !important; padding-left: 0 !important; padding-right: 0 !important; border-bottom: 1px solid #f1f5f9 !important; }
    .trk-details > div:last-child { border-bottom: 0 !important; }
    .pipe-step { min-width: 52px; }
    .pipe-name { font-size: 10px; }
}
@media print { .status-buttons { display: none; } }

.order-chip { white-space: nowrap; }
@media (max-width: 860px) {
    .project-head { flex-direction: column; align-items: stretch; }
    .project-head .toolbar-right { order: -1; justify-content: flex-start; }
}
@media (max-width: 520px) {
    .pipe-step { min-width: 36px; }
    .pipe-dot { width: 24px; height: 24px; font-size: 10px; }
    .pipe-step::before { top: 11px; }
    .pipe-name { display: none; }
    .pipe-step.is-active .pipe-name { display: block; white-space: nowrap; }
}

/* ── Renewals (0.3.0) ─────────────────────────────────────────────── */
.text-warning { color: var(--warning); }
.stat-value.is-danger { color: var(--danger); }
.badge-perm { background: #7f1d1d; color: #fff; }
[data-theme="dark"] .badge-perm { background: #b91c1c; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); color: #fff; filter: brightness(1.1); }
.btn-perm { background: #7f1d1d; border-color: #7f1d1d; color: #fff; }
.btn-perm:hover { background: #991b1b; border-color: #991b1b; color: #fff; }
.btn-update { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.btn-update:hover { background: var(--success-soft); color: var(--success); }
.renewal-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.renewal-actions .inline-form { display: block; }
.timeline { list-style: none; margin: 0; padding: 2px 20px 12px; }
.timeline li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; line-height: 1; }
.timeline .is-done .tl-dot { background: var(--success); border-color: var(--success); }
.timeline .is-today .tl-dot { border-color: var(--brand); background: var(--brand-soft); }
.timeline .is-today .tl-label { color: var(--brand); }
.timeline .is-skipped { opacity: 0.5; }
.tl-label { font-weight: 550; }
.tl-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; }
.code-box { background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); padding: 12px 14px; font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; margin: 8px 0; }
.code-box-lg { max-height: 560px; margin: 0 20px 20px; white-space: pre; word-break: normal; }
.run-summary { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; cursor: pointer; font-size: 14px; }
.renew-badge { display: inline-block; margin-left: 6px; }
@media (max-width: 520px) {
    .timeline li { grid-template-columns: 24px 1fr; }
    .tl-date { grid-column: 2; }
    .code-box-lg { margin: 0 12px 12px; }
}
.chip-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
a.badge-danger:hover { text-decoration: none; filter: brightness(0.96); }
.only-sm { display: none; }
@media (max-width: 860px) { .only-sm { display: block; } .card.only-sm { margin-bottom: 16px; } }
[data-theme="dark"] .btn-success { background: #1d7a4c; border-color: #1d7a4c; color: #fff; }

/* ── 0.4.0 ─────────────────────────────────────────────────────────── */
input[type="date"], input[type="month"], input[type="time"] { min-height: 38px; line-height: 36px; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="month"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
[data-theme="dark"] input[type="date"], [data-theme="dark"] input[type="month"] { color-scheme: dark; }
.logo-preview.is-dark { background: #003063; border-style: solid; border-color: #003063; }
.pub-logo-dark { display: inline-flex; align-items: center; background: #003063; border-radius: 10px; padding: 8px 12px; }
.pub-logo-dark img { height: 30px; }
@media (max-width: 860px) { td.only-sm, th.only-sm { display: table-cell; margin: 0; } }
.text-right { text-align: right; }
/* Quotation items editor */
.items { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 12px; background: var(--surface-2); margin-top: 6px; }
.items-head, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 140px 120px 34px; gap: 10px; align-items: start; }
.items-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 4px 0 8px; }
.item-row { padding: 10px 0; border-top: 1px solid var(--border); }
.item-row:first-child { border-top: 0; }
.item-desc { display: grid; gap: 6px; }
.item-desc textarea { min-height: 38px; font-size: 13px; }
.item-amount { text-align: right; font-weight: 650; padding-top: 9px; font-variant-numeric: tabular-nums; }
.items [data-add-item] { margin-top: 10px; }
.totals-box { margin: 16px 0 0 auto; max-width: 360px; display: grid; gap: 8px; }
.totals-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.totals-row input { max-width: 160px; text-align: right; }
.totals-total { border-top: 1px solid var(--border); padding-top: 10px; font-size: 17px; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--border); }
.table .total-row td { font-size: 15px; color: var(--brand-ink); background: var(--brand-soft); }
@media (max-width: 860px) {
    .item-row { grid-template-columns: 1fr 1fr; }
    .item-desc { grid-column: 1 / -1; }
    .item-amount { grid-column: 1; text-align: left; padding-top: 4px; }
    .item-row [data-remove-item] { grid-column: 2; justify-self: end; }
    .totals-box { max-width: none; }
}
/* Money: costs card, report chart (palette validated: blue/orange, light + dark) */
.viz { --series-income: #2a78d6; --series-costs: #eb6834; }
[data-theme="dark"] .viz { --series-income: #3987e5; --series-costs: #d95926; }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 620px; height: auto; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar-income { fill: var(--series-income); }
.chart .bar-costs { fill: var(--series-costs); }
.chart .bar:hover { opacity: .78; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-income { background: var(--series-income); }
.sw-costs { background: var(--series-costs); }
.table-num td { font-variant-numeric: tabular-nums; }
.table tr.is-empty td { color: var(--faint); }
.text-success { color: var(--success); }
.money-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.money-row strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.money-label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.cost-add { padding: 12px 20px 16px; }
.cost-add > summary { list-style: none; display: inline-flex; }
.cost-add > summary::-webkit-details-marker { display: none; }
.cost-form { margin-top: 12px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav input[type="month"] { width: auto; }
.list li .inline-form { flex-shrink: 0; }
@media (max-width: 520px) { .money-row { grid-template-columns: 1fr 1fr; } .money-row strong { font-size: 16px; } }
.table th.text-right, .table td.text-right { text-align: right; }
@media (max-width: 860px) { .items-head { display: none; } }
input[type="file"] { max-width: 100%; font: inherit; font-size: 13px; }
/* v0.5 — discount switch (LKR / %) */
.discount-input { display: flex; align-items: center; gap: 8px; }
.discount-input input[type="text"] { max-width: 120px; text-align: right; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); flex: none; }
.seg label { position: relative; margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg span { display: block; padding: 7px 11px; font-size: 12.5px; font-weight: 650; color: var(--muted); line-height: 1.2; min-width: 38px; text-align: center; }
.seg label + label span { border-left: 1px solid var(--border-strong); }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.discount-amount { margin-top: -2px; }
.discount-amount [data-discount-amount] { color: var(--success); font-weight: 600; }
/* v0.5 — signature settings */
.sig-paper { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px 14px; display: flex; justify-content: flex-end; min-height: 120px; color: #0f172a; }
.sig-block { display: flex; flex-direction: column; align-items: center; min-width: 150px; }
.sig-block img { display: block; height: auto; max-width: 100%; }
.sig-line { width: 100%; border-top: 1px solid #94a3b8; margin-top: 4px; padding-top: 5px; text-align: center; font-size: 12.5px; line-height: 1.35; }
.sig-line strong { display: block; color: #0f172a; }
.sig-line span { color: #64748b; font-size: 11.5px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.range-row output { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
/* v0.5 — invoices */
.pay-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.pay-summary strong { font-size: 17px; font-variant-numeric: tabular-nums; display: block; }
.pay-bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 0 20px 14px; }
.pay-bar span { display: block; height: 100%; background: var(--success); }
.table .balance-row td { color: var(--warning); }
.table .paid-row td { color: var(--success); }
.pay-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pay-form .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .pay-form { grid-template-columns: minmax(0, 1fr); } .pay-summary { gap: 8px; } .pay-summary strong { font-size: 14.5px; } .discount-input input[type="text"] { max-width: 96px; } }
.totals-row[hidden] { display: none; }
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .stats.stats-3 { grid-template-columns: minmax(0, 1fr); } }
.field + .form-grid, .form-grid + .field { margin-top: 16px; }
input[type="range"]:focus { box-shadow: none; }
input[type="range"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
[data-theme="dark"] .seg input:checked + span { color: #06101e; }
/* v0.7 — Removed stage */
.badge-removed { background: #1e293b; color: #f8fafc; border: 1px solid #1e293b; }
[data-theme="dark"] .badge-removed { background: #334155; border-color: #475569; color: #f1f5f9; }
/* v0.8 — tick & delete */
.table .col-check { width: 38px; padding-right: 0; }
.col-check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.bulk-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 10px 8px 18px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); }
.bulk-bar[hidden] { display: none; }
.bulk-count { font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .card-head h2 { color: var(--danger); }
@media (max-width: 560px) { .bulk-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; border-radius: 14px; } }
.tpl-text summary { cursor: pointer; color: var(--brand); margin-top: 4px; }
.tpl-text .code-box { white-space: pre-wrap; word-break: normal; max-height: none; }

/* Rate 0 = Free item */
.is-free { color: var(--success); font-weight: 650; }
select.select-sm { width: auto; height: 30px; font-size: 12.5px; padding-left: 10px; background-position: calc(100% - 17px) 12px, calc(100% - 12px) 12px; }
.stat-value.stat-money { font-size: 24px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .stat-value.stat-money { font-size: 17px; } }
/* Room for the fixed bulk bar so it never covers the last rows / pagination */
body:has(.bulk-bar:not([hidden])) .content { padding-bottom: 96px; }
.preview-btns { display: inline-flex; gap: 4px; vertical-align: middle; }
.preview-btns .btn { font-size: 14px; line-height: 1; }
/* Row actions: every button on one line, vertically centred */
.act-row { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.act-row .inline-form { display: inline-flex; }
.act-row .preview-btns { vertical-align: initial; }
.table .actions .act-row > * + * { margin-left: 0; }
/* Danger zone: the two cards sit inside the frame with equal spacing and height */
.danger-grid { padding: 20px; align-items: stretch; }
.danger-grid > .card { margin-top: 0; display: flex; flex-direction: column; }
.danger-grid > .card .card-body { flex: 1; }
@media (max-width: 560px) {
    .table td.actions:has(.act-row) { white-space: normal; width: 136px; min-width: 136px; }
    .act-row { display: flex; flex-wrap: wrap; row-gap: 6px; width: 100%; }
    .act-row .preview-btns { order: 10; flex-basis: 100%; justify-content: flex-end; }
    .table .cell-title, .table .cell-sub { overflow-wrap: anywhere; }
}
.auth-brand .brand-sub { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; }
.remember-check { margin: 2px 0 16px; font-size: 13.5px; }
.remember-check { margin: 2px 0 16px; font-size: 13.5px; }
