:root {
    /* Selfium palette (selfium.ly) */
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef2f8;
    --ink: #14213d;
    --ink-2: #5b6475;
    --line: #e3e8f0;
    --brand: #0f4c81;       /* Selfium navy */
    --brand-2: #1d7fd1;     /* Selfium blue */
    --brand-dark: #0b2545;
    --side-bg: #151f35;
    --accent: #1d7fd1;
    --accent-ink: #ffffff;  /* text on accent */
    --accent-soft: #e6f0fb;
    --accent-2: #f4a259;    /* Selfium orange highlight */
    --ok: #1a9e6e;  --ok-soft: #e3f5ee;
    --mid: #b7791f; --mid-soft: #fdf3dc;
    --bad: #c2410c; --bad-soft: #fdece4;
    --info: #1d7fd1;
    --radius: 18px;
    --shadow: 0 6px 24px rgba(20, 33, 61, .08);
    --font: "Cairo", Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }
.muted { color: var(--ink-2); }
.small, small { font-size: .82rem; }
.num { text-align: left; font-variant-numeric: tabular-nums; direction: ltr; }
th.num { text-align: left; }
.ltr-cell { text-align: right; }
.grow { flex: 1; }
.pad { padding: 1rem 1.25rem; }
.ico { flex: none; vertical-align: -3px; }
.ico.warn, .warn-text { color: var(--mid); }
.ico.danger { color: var(--bad); }

/* ---------- inputs & buttons ---------- */
input, select, textarea {
    font: inherit; color: inherit; width: 100%;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 127, 209, .25); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-2); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=color] { width: 28px; height: 28px; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .87rem; color: var(--ink-2); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); cursor: pointer; }
label.check.inline { align-self: end; padding-bottom: .6rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    padding: .55rem 1.05rem; border-radius: 10px; transition: background .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #ffffff; box-shadow: 0 2px 8px rgba(15, 76, 129, .25); }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-ghost { color: var(--bad); border-color: #f3c9b5; }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; padding: .75rem; font-size: 1rem; }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--mid-soft); color: var(--mid); }
.tag { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; padding: .05rem .45rem; border-radius: 6px; background: var(--accent-soft); color: var(--brand-2); margin-inline-start: .35rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: .25rem; }
.kind { display: inline-block; font-size: .74rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; vertical-align: middle; }
.kind.k1 { background: #fdf3dc; color: #8a5a0b; }
.kind.k2 { background: #fdebd8; color: #b45309; }
.kind.k3 { background: #fbe4ee; color: #a3195b; }
.kind.k4 { background: #eef1f5; color: #475569; }
.margin { font-weight: 700; }
.margin.low { color: var(--bad); } .margin.mid { color: var(--mid); } .margin.high { color: var(--ok); }

.alert { display: flex; gap: .5rem; align-items: center; padding: .65rem .85rem; border-radius: 10px; font-size: .9rem; }
.alert.err { background: var(--bad-soft); color: var(--bad); }
.alert.info-box { background: var(--accent-soft); color: var(--brand); margin-bottom: 1rem; max-width: 640px; }
.hint { display: flex; align-items: center; gap: .35rem; color: var(--ink-2); font-size: .85rem; margin: 0; }

/* ---------- boot / spinner / empty ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; margin: 3rem auto; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--ink-2); display: grid; justify-items: center; gap: .6rem; }
.empty-state.small { padding: 2.5rem 1rem; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.1fr; }
.auth-art {
    background: radial-gradient(1200px 500px at 110% -10%, rgba(29, 127, 209, .35), transparent 60%),
                linear-gradient(160deg, #0b2545, #0f4c81 60%, #1d7fd1);
    color: #ffffff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; gap: 2.5rem;
}
.auth-brand { display: flex; gap: 1rem; align-items: center; }
.auth-brand b { display: block; font-size: 2rem; }
.auth-brand span { opacity: .8; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; font-size: 1.05rem; }
.auth-points li { display: flex; gap: .75rem; align-items: center; }
.auth-points .ico { color: var(--accent-2); width: 22px; height: 22px; }
.auth-form { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 1rem; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 1.8rem; }
.auth-card > p { margin: -.6rem 0 .3rem; }
.auth-alt { text-align: center; color: var(--ink-2); font-size: .9rem; }
.link-btn { all: unset; cursor: pointer; color: var(--brand-2); font-size: .82rem; align-self: flex-start; }
.link-btn:hover { text-decoration: underline; }
.choice { border: 0; padding: 0; margin: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.choice legend { font-size: .87rem; color: var(--ink-2); font-weight: 500; margin-bottom: .3rem; }
.chip-radio { flex-direction: row; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-flex; gap: .4rem; align-items: center; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--ink); background: #fff; }
.chip-radio input:checked + span { border-color: var(--brand); background: var(--accent-soft); color: var(--brand); font-weight: 600; }
.chip-radio input:focus-visible + span { box-shadow: 0 0 0 3px rgba(29, 127, 209, .35); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: linear-gradient(180deg, var(--side-bg), var(--brand-dark)); color: #c9d6ea; display: flex; flex-direction: column; padding: 1rem .75rem;
}
.side-brand { display: flex; gap: .65rem; align-items: center; color: #ffffff; padding: .25rem .5rem 1.25rem; }
.side-brand:hover { text-decoration: none; }
.side-brand b { display: block; font-size: 1.15rem; }
.side-brand span { display: block; font-size: .78rem; opacity: .75; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.side nav a, .nav-soon {
    display: flex; gap: .65rem; align-items: center; padding: .6rem .75rem; border-radius: 10px;
    color: #c9d6ea; font-weight: 500; font-size: .93rem;
}
.side nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; color: #fff; }
.side nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 4px 14px rgba(29, 127, 209, .35); }
.nav-soon { opacity: .45; cursor: default; }
.nav-group { font-size: .72rem; letter-spacing: .02em; opacity: .55; padding: 1rem .75rem .35rem; }
.side-foot { display: flex; align-items: center; gap: .5rem; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: .75rem; }
.side-foot .icon-btn { color: #c9d6ea; }
.side-foot .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.me { display: flex; gap: .55rem; align-items: center; flex: 1; min-width: 0; }
.me b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { display: block; font-size: .74rem; opacity: .7; direction: ltr; text-align: right; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .8rem; }
.side-scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .75rem; padding: .7rem 1.75rem; background: rgba(245, 247, 251, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-title { font-weight: 600; }
.only-mobile { display: none; }
.content { padding: 1.5rem 1.75rem 3rem; max-width: 1280px; width: 100%; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; }
.page-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.head-actions { display: flex; gap: .5rem; align-items: center; }
.back { font-size: .85rem; color: var(--ink-2); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card.narrow { max-width: 640px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > h2 { padding: 1rem 1.25rem 0; }
.link { font-size: .87rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { display: flex; gap: .85rem; align-items: center; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-2); font-size: .85rem; }
.kpi-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.kpi-ico .ico { width: 22px; height: 22px; }
.kpi-ico.raw { background: #fdf3dc; color: #8a5a0b; }
.kpi-ico.fin { background: #fbe4ee; color: #a3195b; }
.kpi-ico.rec { background: #efe7fb; color: #6d28d9; }
.kpi-ico.mar { background: var(--ok-soft); color: var(--ok); }

.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cols .card + .card { margin-top: 0; }

.welcome {
    display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding: 1.4rem 1.6rem;
    border-radius: var(--radius); color: #ffffff;
    background: radial-gradient(600px 200px at 0% 0%, rgba(29, 127, 209, .45), transparent 70%), linear-gradient(135deg, #0b2545, #0f4c81 55%, #1d7fd1);
}
.welcome h1 { font-size: 1.35rem; }
.welcome p { margin: .4rem 0 .6rem; opacity: .9; }
.welcome a { color: var(--accent-2); font-weight: 600; }
.welcome .icon-btn { color: #c9d6ea; }
.steps { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .25rem; }

.bars { list-style: none; margin: 0; padding: .75rem 1.25rem 1rem; display: grid; gap: .65rem; }
.bars li { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 48px; gap: .75rem; align-items: center; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar.thin { height: 6px; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar span.low { background: var(--bad); } .bar span.mid { background: var(--mid); } .bar span.high { background: var(--ok); }
.attention { list-style: none; margin: 0; padding: .75rem 1.25rem 1rem; display: grid; gap: .55rem; font-size: .92rem; }
.attention li { display: flex; gap: .5rem; align-items: flex-start; }
.roadmap { margin-top: 1rem; }
.road { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; padding: 1rem 1.25rem 1.25rem; }
.road div { display: grid; gap: .25rem; padding: .9rem; border-radius: 12px; background: var(--surface-2); }
.road .ico { color: var(--brand-2); width: 22px; height: 22px; }
.road span { color: var(--ink-2); font-size: .85rem; }

/* ---------- toolbar / tabs / tables ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; background: var(--surface-2); padding: .25rem; border-radius: 12px; flex-wrap: wrap; }
.tabs button { font: inherit; border: 0; background: transparent; color: var(--ink-2); padding: .4rem .85rem; border-radius: 9px; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; }
.tabs button span { font-size: .75rem; background: rgba(0, 0, 0, .06); padding: 0 .4rem; border-radius: 6px; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.tabs.big { margin-bottom: 1rem; display: inline-flex; }
.search { flex-direction: row; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 .7rem; min-width: 240px; }
.search input { border: 0; padding: .5rem 0; box-shadow: none !important; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: right; font-size: .78rem; font-weight: 600; color: var(--ink-2); padding: .7rem 1rem; background: var(--surface-2); white-space: nowrap; }
.grid td { padding: .65rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.grid tbody tr:hover { background: #f5f9fe; }
.grid tr.inactive td { opacity: .5; }
.grid tr.bad td { background: var(--bad-soft); }
.grid td.actions { white-space: nowrap; text-align: left; width: 1%; }
.lines td { padding: .45rem .75rem; }
.lines select { min-width: 170px; }
.lines td:nth-child(3) select { min-width: 72px; }
.lines input.qty { width: 100px; text-align: left; direction: ltr; }
.share-col { width: 110px; }

/* ---------- forms ---------- */
.form { display: grid; gap: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .85rem; }
.box-soft { display: grid; gap: .85rem; padding: .9rem; border-radius: 12px; background: var(--surface-2); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); padding: .2rem; border-radius: 10px; gap: .2rem; }
.seg button { font: inherit; border: 0; background: transparent; padding: .4rem .8rem; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }
.seg button:disabled { opacity: .4; cursor: default; }
.seg.small button { padding: .25rem .6rem; font-size: .85rem; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem .8rem; display: grid; gap: .45rem; }
.perm-group legend { font-size: .82rem; color: var(--ink-2); padding: 0 .3rem; }

/* ---------- modal / toasts ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(20, 33, 61, .45); display: grid; place-items: center; padding: 1rem; animation: fade .15s; }
.modal { min-width: 0; background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(20, 33, 61, .3); animation: pop .18s ease-out; }
.modal.wide { max-width: 820px; }
.modal.small { max-width: 400px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-body { padding: 1.25rem; overflow-y: auto; min-width: 0; }
.modal-back > .modal { justify-self: stretch; margin-inline: auto; }
.modal footer { display: flex; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--line); }
.confirm { display: flex; gap: .75rem; align-items: flex-start; }
.confirm p { margin: .2rem 0 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 60; display: grid; gap: .5rem; }
.toast { display: flex; gap: .5rem; align-items: center; background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: pop .2s; font-weight: 500; }
.toast.ok .ico { color: #86efac; }
.toast.err { background: var(--bad); }

/* ---------- recipes ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.recipe-card { display: grid; gap: .6rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; transition: transform .12s, border-color .12s; }
.recipe-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.recipe-card h3 { font-size: 1.12rem; }
.rc-meta { display: flex; gap: .9rem; color: var(--ink-2); font-size: .84rem; flex-wrap: wrap; }
.rc-meta span { display: inline-flex; gap: .3rem; align-items: center; }
.rc-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding-top: .7rem; border-top: 1px dashed var(--line); }
.rc-money small { display: block; color: var(--ink-2); font-size: .74rem; }
.rc-money b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.recipe-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.recipe-main, .recipe-side, .cols > *, .board > * { min-width: 0; }
.recipe-side { position: sticky; top: 76px; display: grid; gap: 1rem; }
.recipe-side .card + .card { margin-top: 0; }
.scale { display: flex; gap: .25rem; align-items: center; font-size: .85rem; }
.scale button { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .2rem .55rem; cursor: pointer; }
.scale button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
textarea { resize: vertical; }
.steps-text { white-space: pre-wrap; margin: 0; }
.cost-card, .price-card { padding-bottom: 1rem; }
.cost-card h2, .price-card h2 { padding: 1rem 1.25rem .25rem; }
.big-cost { font-size: 2.3rem; font-weight: 700; padding: 0 1.25rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.big-cost small { font-size: 1rem; color: var(--ink-2); font-weight: 500; }
dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; margin: .75rem 1.25rem 0; font-size: .9rem; }
dt { color: var(--ink-2); }
dd { margin: 0; text-align: left; font-variant-numeric: tabular-nums; }
dt.total, dd.total { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: .35rem; }
.price-card label { margin: .5rem 1.25rem 0; }
.margin-meter { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .8rem 1.25rem 0; padding: .75rem; border-radius: 12px; }
.margin-meter small { display: block; font-size: .76rem; opacity: .85; }
.margin-meter b { font-size: 1.3rem; }
.margin-meter.low { background: var(--bad-soft); color: var(--bad); }
.margin-meter.mid { background: var(--mid-soft); color: var(--mid); }
.margin-meter.high { background: var(--ok-soft); color: var(--ok); }
.suggest { display: grid; gap: .45rem; margin: 1rem 1.25rem 0; padding-top: .9rem; border-top: 1px dashed var(--line); }
.suggest small { color: var(--ink-2); }
.sug-price { display: flex; align-items: center; gap: .5rem; }
.sug-price b { font-size: 1.4rem; color: var(--brand); }
.sug-price .btn { margin-inline-start: auto; }
ul.plain { list-style: none; padding: .5rem 1.25rem 1rem; margin: 0; display: grid; gap: .3rem; }

/* ---------- categories / roles ---------- */
.cat-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; align-items: start; }
.cat-board .card + .card { margin-top: 0; }
.cat-list { list-style: none; margin: 0; padding: .5rem .75rem; display: grid; gap: .15rem; }
.cat-list li { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 8px; }
.cat-list li:hover { background: var(--surface-2); }
.add-inline { display: flex; gap: .4rem; padding: .25rem .75rem .9rem; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.role-grid .card + .card { margin-top: 0; }
.role-card small { display: block; padding: 0 1.25rem 1rem; }
.perm-list { list-style: none; margin: 0; padding: .75rem 1.25rem; display: grid; gap: .3rem; font-size: .87rem; }
.perm-list li { color: #9aa6bd; display: flex; gap: .4rem; align-items: center; }
.perm-list li.on { color: var(--ink); }
.perm-list li.on .ico { color: var(--ok); }

/* ---------- inventory & production ---------- */
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.neg { color: var(--bad); } .pos { color: var(--ok); }
.ok-text { color: var(--ok); display: inline-flex; gap: .25rem; align-items: center; font-weight: 600; font-size: .87rem; }
.bad-text { color: var(--bad); font-weight: 600; font-size: .87rem; margin-inline-end: .4rem; }
.exp { font-size: .85rem; white-space: nowrap; }
.exp.soon { color: var(--mid); font-weight: 600; }
.exp.bad { color: var(--bad); font-weight: 700; }
button.kpi { font: inherit; text-align: right; cursor: pointer; }
.kpi.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 76, 129, .15); }
.kpi-ico.bad { background: var(--bad-soft); color: var(--bad); }
.toolbar-end { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
select.compact { width: auto; padding: .45rem .6rem; }
table.clickable tbody tr { cursor: pointer; }
tfoot td { border-top: 2px solid var(--line); padding: .75rem 1rem; background: var(--surface-2); }
.big-num { font-size: 1.2rem; }
h3.sub { font-size: .95rem; margin: 1.25rem 0 .5rem; color: var(--ink-2); }
.drawer-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.drawer-sum div { background: var(--surface-2); border-radius: 12px; padding: .6rem .8rem; }
.drawer-sum small { display: block; color: var(--ink-2); font-size: .76rem; }
.drawer-sum b { font-size: 1.05rem; }
.action-box { margin-top: .75rem; }
.finish-box { margin-top: 1rem; }
.preview-head { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: .6rem .8rem; background: var(--accent-soft); border-radius: 10px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.board .col { background: var(--surface-2); border-radius: var(--radius); padding: .75rem; min-height: 200px; display: grid; gap: .65rem; align-content: start; }
.board .col > header { display: flex; align-items: center; gap: .45rem; font-weight: 700; padding: .2rem .25rem .3rem; }
.board .col > header span { margin-inline-start: auto; font-size: .8rem; background: #fff; border-radius: 999px; padding: 0 .55rem; color: var(--ink-2); }
.board .col-0 > header .ico { color: var(--info); }
.board .col-1 > header .ico { color: var(--mid); }
.board .col-2 > header .ico { color: var(--ok); }
.col-empty { color: var(--ink-2); font-size: .85rem; text-align: center; margin: 1.5rem 0; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; display: grid; gap: .4rem; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.order-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.col-1 .order-card { border-inline-start: 4px solid var(--mid); }
.col-2 .order-card { opacity: .85; }
.oc-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; flex-wrap: wrap; }
.order-card h3 { font-size: 1.05rem; }
.oc-qty b { font-size: 1.15rem; }
.oc-note { margin: 0; font-size: .85rem; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: .3rem .55rem; }
.oc-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .2rem; }
.oc-foot .who { display: inline-flex; gap: .35rem; align-items: center; font-size: .85rem; color: var(--ink-2); }

ul.today { list-style: none; margin: 0; padding: .5rem 1.25rem 1rem; display: grid; gap: .5rem; }
ul.today li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.st { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st-0 { background: var(--info); } .st-1 { background: var(--mid); } .st-2 { background: var(--ok); }

/* ---------- customer orders ---------- */
.pill.info { background: #e6efff; color: var(--info); }
.pill.ready { background: #efe7fb; color: #6d28d9; }
.lbl { display: block; font-size: .87rem; color: var(--ink-2); font-weight: 500; margin-bottom: .35rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: inherit; border: 1px solid var(--line); background: #fff; padding: .35rem .85rem; border-radius: 999px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #ffffff; font-weight: 600; }
.chip:disabled { opacity: .6; cursor: default; }
.cust-search { position: relative; }
.search.big { padding: .25rem .8rem; }
.search.big input { font-size: 1.05rem; }
.suggest-list { list-style: none; margin: .3rem 0 0; padding: .3rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.suggest-list button { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; width: 100%; padding: .5rem .7rem; border-radius: 8px; cursor: pointer; }
.suggest-list button:hover { background: var(--surface-2); }
.suggest-list button.add { color: var(--brand-2); font-weight: 600; justify-content: flex-start; gap: .4rem; }
.cust-card { display: flex; gap: .75rem; align-items: center; padding: .75rem; border-radius: 12px; background: var(--surface-2); }
input.qty.sm { width: 90px; padding: .3rem .5rem; }
.deposit { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .9rem 1.25rem 0; padding-top: .8rem; border-top: 1px dashed var(--line); }
.card-title { padding: 1rem 1.25rem .5rem; }
.actions-col { display: grid; gap: .5rem; padding: 0 1.25rem 1.1rem; }
.row-act { display: flex; gap: .4rem; }
.row-act input { flex: 1; }
.runs { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; }
.runs li { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.pay-list { list-style: none; margin: 0; padding: 0 1.25rem .5rem; display: grid; gap: .4rem; }
.pay-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.pay-list li b { grid-row: span 2; align-self: center; }
.pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .6rem 1.25rem 1.1rem; }
.pay-form .btn { grid-column: span 2; }

.stepper { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.step { flex: 1; min-width: 110px; display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.step span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.step.done { background: var(--ok-soft); color: var(--ok); }
.step.done span { background: currentColor; }
.step.cur { background: var(--brand); color: #ffffff; }
.step.cur span { background: var(--accent); border-color: var(--accent); }
.step.cancelled { background: var(--bad-soft); color: var(--bad); flex: 2; }

.calendar { margin-bottom: 1rem; }
.calendar .card-head { justify-content: center; gap: 1.5rem; }
.calendar .card-head .icon-btn { font-size: 1.4rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: .75rem; }
.cal-dow { text-align: center; font-size: .78rem; color: var(--ink-2); padding: .2rem 0; }
.cal-day { font: inherit; text-align: right; min-height: 78px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: .35rem .45rem; display: flex; flex-direction: column; gap: .1rem; cursor: pointer; color: var(--ink); overflow: hidden; }
.cal-day.empty { border: 0; background: transparent; cursor: default; }
.cal-day .dn { font-weight: 700; font-size: .9rem; }
.cal-day .cnt { font-size: .78rem; font-weight: 600; }
.cal-day .occ { font-size: .72rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day.today { outline: 2px solid var(--accent); }
.cal-day.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 76, 129, .2); }
.load-1 { background: #eaf3fc !important; }
.load-2 { background: #cfe3f7 !important; }
.load-3 { background: #9cc7ef !important; }
.cal-legend { display: flex; gap: .4rem; align-items: center; justify-content: center; font-size: .78rem; color: var(--ink-2); padding: 0 0 .8rem; }
.cal-legend span { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }

.order-list { display: grid; gap: .5rem; }
.day-head { font-size: .95rem; color: var(--ink-2); margin: .8rem 0 .1rem; display: flex; gap: .4rem; align-items: center; }
.day-head span { font-size: .75rem; background: var(--surface-2); padding: 0 .45rem; border-radius: 6px; }
.order-row { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 1rem; align-items: center; padding: .75rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: inherit; box-shadow: var(--shadow); border-inline-start: 4px solid var(--info); }
.order-row:hover { text-decoration: none; border-color: var(--accent); }
.order-row.st-1 { border-inline-start-color: var(--mid); }
.order-row.st-2 { border-inline-start-color: #6d28d9; }
.order-row.st-3 { border-inline-start-color: var(--ok); opacity: .8; }
.order-row.st-4 { border-inline-start-color: #cbd5e1; opacity: .6; }
.order-row.late { border-inline-start-color: var(--bad); background: #fff8f5; }
.or-time { display: grid; text-align: center; }
.or-time b { font-size: 1.05rem; }
.or-time span { font-size: .75rem; color: var(--ink-2); }
.or-money { display: grid; text-align: left; }
.occ-chip { font-size: .75rem; background: var(--accent-soft); color: var(--brand-2); padding: .05rem .5rem; border-radius: 999px; }
.k-time-sm { font-variant-numeric: tabular-nums; min-width: 56px; }

/* ---------- kitchen screen ---------- */
.kitchen { min-height: 100vh; background: #0d1424; color: #e8edf6; padding: 1rem 1.25rem 2rem; font-size: 1.1rem; }
.k-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.k-head b { display: block; font-size: 1.3rem; }
.k-head span { opacity: .7; font-size: .9rem; }
.k-back { color: #e8edf6; font-size: 2rem; text-decoration: none; padding: 0 .4rem; }
.k-clock { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.k-clock small { font-size: 1rem; margin-inline-start: .3rem; opacity: .7; }
.k-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; }
.k-cols h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; margin: 0 0 .75rem; }
.k-cols h2 span { background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 0 .7rem; font-size: 1rem; }
.k-cols section { display: grid; gap: .75rem; align-content: start; }
.k-empty { opacity: .6; font-size: 1.1rem; }
.k-card { background: #151f35; border: 2px solid #22304f; border-radius: 16px; padding: 1rem 1.1rem; display: grid; gap: .6rem; }
.k-card.doing { border-color: var(--accent); background: #16304f; }
.k-card.late { border-color: #f87171; }
.k-top { display: flex; align-items: center; gap: 1rem; }
.k-top h3 { font-size: 1.5rem; }
.k-qty { background: var(--accent); color: #fff; border-radius: 12px; padding: .2rem .7rem; font-size: 1.6rem; font-weight: 800; white-space: nowrap; }
.k-qty small { font-size: .9rem; font-weight: 600; margin-inline-start: .25rem; }
.k-for { display: flex; align-items: center; gap: .4rem; opacity: .9; flex-wrap: wrap; }
.k-note { margin: 0; background: #e6f0fb; color: #0f4c81; border-radius: 10px; padding: .55rem .8rem; font-weight: 600; font-size: 1.15rem; }
.k-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.k-foot .muted { color: #9aa6bd; font-size: .9rem; }
.k-btn { font: inherit; font-size: 1.25rem; font-weight: 800; border: 0; border-radius: 14px; padding: .8rem 2rem; cursor: pointer; background: #e8edf6; color: #14213d; min-width: 140px; }
.k-btn.done { background: #22c55e; color: #052e16; }
.k-btn:active { transform: scale(.98); }
.k-del { display: flex; gap: .8rem; align-items: center; background: #151f35; border-radius: 14px; padding: .8rem 1rem; }
.k-del .muted { color: #9aa6bd; }
.k-del.st-3 { opacity: .5; }
.k-time { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 70px; }
.toasts.big .toast { font-size: 1.15rem; padding: 1rem 1.3rem; }

/* ---------- point of sale ---------- */
.pos-screen { height: 100vh; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.pos-open { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.pos-open .card { width: 100%; max-width: 420px; padding: 1.75rem; display: grid; gap: 1rem; justify-items: stretch; text-align: center; }
.pos-open .card svg { justify-self: center; }
.pos-open label { text-align: right; }
.big-input { font-size: 1.5rem !important; padding: .6rem .8rem !important; text-align: center; direction: ltr; }
.pos-head { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--brand); color: #ffffff; flex: none; flex-wrap: wrap; }
.pos-head b { display: block; }
.pos-head span { font-size: .82rem; opacity: .8; }
.pos-head .btn.ghost { color: #ffffff; border-color: rgba(255, 255, 255, .25); }
.pos-head .btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.k-back.dark { color: #ffffff; }
.pos-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.pos-products { min-height: 0; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.pos-scan { display: flex; align-items: center; gap: .5rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 0 .9rem; }
.pos-scan:focus-within { border-color: var(--accent); }
.pos-scan input { border: 0; font-size: 1.15rem; padding: .75rem 0; box-shadow: none !important; }
.pos-cats .chip { display: inline-flex; align-items: center; gap: .3rem; }
.chip.big { padding: .55rem 1.1rem; font-size: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.tile { font: inherit; position: relative; text-align: right; display: flex; flex-direction: column; gap: .3rem; padding: 1rem .9rem .8rem; min-height: 120px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; box-shadow: var(--shadow); color: var(--ink); transition: transform .08s, border-color .1s; }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(.97); }
.tile b { font-size: 1.05rem; line-height: 1.3; }
.t-dot { position: absolute; top: .7rem; left: .7rem; width: 10px; height: 10px; border-radius: 50%; }
.t-price { font-size: 1.2rem; font-weight: 700; color: var(--brand); margin-top: auto; }
.t-price small { font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.t-stock { font-size: .78rem; color: var(--ink-2); }
.tile.out { opacity: .45; cursor: not-allowed; }
.tile.out .t-stock { color: var(--bad); font-weight: 600; }
.pos-cart { min-height: 0; display: flex; flex-direction: column; background: #fff; border-inline-start: 1px solid var(--line); }
.pos-cart > header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.cart-lines { flex: 1; overflow-y: auto; padding: .4rem .6rem; }
.cart-empty { text-align: center; color: var(--ink-2); margin-top: 3rem; }
.cl { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; align-items: center; padding: .55rem .3rem; border-bottom: 1px dashed var(--line); }
.cl-name b { display: block; font-size: .95rem; }
.cl-name span { font-size: .78rem; color: var(--ink-2); }
.cl-qty { display: flex; align-items: center; gap: .3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.qbtn { font: inherit; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.2rem; cursor: pointer; }
.qbtn.wide { width: auto; padding: 0 .6rem; font-size: .9rem; direction: ltr; }
.cl-total { min-width: 60px; text-align: left; font-variant-numeric: tabular-nums; }
.cart-foot { border-top: 1px solid var(--line); padding: .8rem 1rem 1rem; display: grid; gap: .45rem; background: var(--surface-2); }
.cf-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cf-row .disc { width: 110px; text-align: left; direction: ltr; padding: .35rem .6rem; }
.cf-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .4rem; border-top: 1px solid var(--line); }
.cf-total b { font-size: 2rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.cf-total small { font-size: .9rem; color: var(--ink-2); }
.pay-btns { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .5rem; }
.pay { font: inherit; font-weight: 800; font-size: 1.1rem; border: 0; border-radius: 14px; padding: 1rem .5rem; cursor: pointer; background: #fff; border: 1px solid var(--line); }
.pay.cash { background: var(--ok); color: #fff; border-color: var(--ok); font-size: 1.3rem; }
.pay:disabled { opacity: .4; cursor: default; }
.btn.big { padding: .8rem 1.6rem; font-size: 1.1rem; }
.pay-box { display: grid; gap: .9rem; }
.pb-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.pb-total b { font-size: 1.8rem; color: var(--brand); }
.pb-change { display: flex; justify-content: space-between; align-items: baseline; padding: .7rem .9rem; border-radius: 12px; }
.pb-change b { font-size: 1.6rem; }
.pb-change.ok { background: var(--ok-soft); color: var(--ok); }
.pb-change.bad { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 860px) {
    .pos-screen { height: auto; overflow: visible; }
    .pos-body { grid-template-columns: 1fr; }
    .pos-cart { border-inline-start: 0; border-top: 1px solid var(--line); }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* 80 mm thermal ticket */
.ticket { width: 72mm; margin: 0 auto; font-size: 12px; color: #000; text-align: center; }
.ticket h1 { font-size: 16px; margin-bottom: 2px; }
.ticket p { margin: 2px 0; }
.ticket .void { font-weight: 800; font-size: 14px; }
.ticket table { width: 100%; border-collapse: collapse; margin: 6px 0; border-top: 1px dashed #000; border-bottom: 1px dashed #000; text-align: right; }
.ticket td { padding: 1px 0; }
.ticket tr.sub td:last-child { text-align: left; }
.ticket tr.sub td { padding-bottom: 4px; color: #333; }
.t-row { display: flex; justify-content: space-between; margin: 2px 0; }
.t-row.big { font-size: 15px; font-weight: 800; border-top: 1px solid #000; padding-top: 3px; }
.thanks { margin-top: 8px !important; }
@media print { @page { size: 80mm auto; margin: 3mm; } }

/* ---------- treasury & reports ---------- */
.acc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.acc-card { font: inherit; text-align: right; display: flex; gap: .75rem; align-items: center; padding: .9rem 1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; color: var(--ink); }
.acc-card b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.acc-card b small { font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.acc-card.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 76, 129, .15); }
.acc-card.total { background: var(--brand); color: #ffffff; cursor: default; }
.acc-card.total .muted, .acc-card.total small { color: #c9d6ea !important; }
.acc-card.add { justify-content: center; color: var(--brand-2); border-style: dashed; box-shadow: none; font-weight: 600; }
.acc-card.inactive { opacity: .5; }
.acc-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.acc-ico.cash { background: var(--ok-soft); color: var(--ok); }
.acc-ico.bank { background: #e6efff; color: var(--info); }
.sum-strip { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; padding: .6rem 1rem; margin-bottom: .75rem; background: var(--surface-2); border-radius: 12px; }
.pnl-table { width: 100%; border-collapse: collapse; }
.pnl-table td { padding: .5rem 1.25rem; border-bottom: 1px solid var(--line); }
.pnl-table td:last-child { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pnl-table tr.h td { background: var(--surface-2); font-weight: 700; color: var(--ink-2); font-size: .85rem; }
.pnl-table tr.t td { font-weight: 700; border-bottom: 2px solid var(--line); }
.pnl-table tr.big td { font-size: 1.2rem; }
.pnl-table tr.pos td:last-child { color: var(--ok); }
.pnl-table tr.neg td:last-child { color: var(--bad); }
.day-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 1rem 1.25rem .5rem; }
.db { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; min-width: 6px; }
.db span { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.db small { font-size: .65rem; color: var(--ink-2); }
.cols > div { display: grid; gap: 1rem; align-content: start; }
.cols > div > .card + .card { margin-top: 0; }
@media print { .side, .topbar, .head-actions { display: none !important; } .shell { display: block; } }

/* ---------- platform subscriptions ---------- */
.sub-info { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--ink-2); font-size: .88rem; margin-bottom: .9rem; }
.sub-info span { display: inline-flex; gap: .3rem; align-items: center; }
.temp-pass { border: 2px dashed var(--accent); background: var(--accent-soft); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .75rem; display: grid; gap: .4rem; }
.temp-pass > div { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.temp-pass code { font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; background: #fff; padding: .2rem .7rem; border-radius: 8px; color: var(--brand); user-select: all; }
.temp-pass p { margin: 0; color: var(--ink-2); }
.temp-pass .btn { justify-self: start; }
.sub-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .5rem; }
.timeline { list-style: none; margin: 0; padding: 0 .9rem 0 0; border-inline-start: 2px solid var(--line); display: grid; gap: .65rem; }
.timeline li { position: relative; padding-inline-start: .9rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid #fff; }
.timeline li.ev-2::before, .timeline li.ev-5::before, .timeline li.ev-6::before { background: var(--ok); }
.timeline li.ev-3::before, .timeline li.ev-4::before { background: var(--bad); }
.timeline li.ev-1::before, .timeline li.ev-8::before { background: var(--info); }

/* ---------- receipt ---------- */
.print-page { background: #fff; min-height: 100vh; padding: 1.5rem; }
.print-bar { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.receipt { max-width: 720px; margin: 0 auto; color: #111; }
.receipt header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: .75rem; }
.receipt h1 { font-size: 1.5rem; }
.receipt header p { margin: .2rem 0 0; color: #444; }
.r-no { display: grid; text-align: left; }
.r-no b { font-size: 1.2rem; }
.r-info, .r-total { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 1rem 0; }
.r-info dd, .r-total dd { margin: 0; text-align: right; }
.r-total { max-width: 340px; margin-inline-start: auto; }
.r-total dd { text-align: left; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt th, .receipt td { border-bottom: 1px solid #ccc; padding: .45rem .3rem; text-align: right; }
.r-notes { border: 1px dashed #999; padding: .6rem .8rem; border-radius: 8px; }
.receipt footer { text-align: center; color: #555; margin-top: 1.5rem; }
@media print { .no-print { display: none !important; } .print-page { padding: 0; } }

#blazor-error-ui { display: none; position: fixed; bottom: 0; inset-inline: 0; background: var(--mid-soft); padding: .7rem 1.25rem; z-index: 100; box-shadow: 0 -2px 8px rgba(0, 0, 0, .1); }
#blazor-error-ui .reload { font-weight: 600; margin-inline-start: .5rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .board { grid-template-columns: 1fr; }
    .k-cols { grid-template-columns: 1fr; }
    .recipe-layout { grid-template-columns: 1fr; }
    .recipe-side { position: static; }
    .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-art { padding: 1.5rem; gap: 1rem; }
    .auth-points { display: none; }
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; inset-block: 0; right: 0; width: 270px; z-index: 40; transform: translateX(100%); transition: transform .2s; }
    .menu-open .side { transform: none; }
    .menu-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); }
    .only-mobile { display: inline-grid; }
    .topbar { padding: .6rem 1rem; }
    .content { padding: 1rem 1rem 3rem; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .search { min-width: 0; width: 100%; }
    .bars li { grid-template-columns: 1fr 1fr 44px; }
    .order-row { grid-template-columns: 56px 1fr; }
    .order-row .or-money, .order-row .pill { grid-column: 2; justify-self: start; }
    .cal-day { min-height: 54px; }
    .cal-day .occ { display: none; }
}

/* ---------- reports ---------- */
.rep-group { font-size: 1rem; color: var(--ink-2); margin: 1.5rem 0 .75rem; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.rep-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); transition: border-color .15s, transform .15s; }
.rep-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.rep-card b { display: block; font-size: 1.02rem; margin-bottom: .2rem; }
.rep-card p { margin: 0; color: var(--ink-2); font-size: .86rem; line-height: 1.6; }
.rep-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--brand); }
.rep-ico.mar { background: var(--ok-soft); color: var(--ok); }
.rep-ico.fin { background: #fbe4ee; color: #a3195b; }
.rep-ico.rec { background: #efe7fb; color: #6d28d9; }
.rep-ico.raw { background: #fdf3dc; color: #8a5a0b; }

.period-bar { flex-wrap: wrap; justify-content: flex-end; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 1rem; }
.cols.even > .card { margin-top: 0; }
.card + .cols, .cols + .card { margin-top: 1rem; }
.card.pad h2 { margin-bottom: .75rem; }
.scroll-y { max-height: 420px; overflow-y: auto; }
.grid tfoot td { padding: .7rem 1rem; border-top: 2px solid var(--line); background: var(--surface-2); }

.ratio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.ratio-grid.one { grid-template-columns: 1fr 1fr; align-content: start; }
.ratio { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.ratio small { color: var(--ink-2); font-size: .82rem; font-weight: 600; }
.ratio b { display: block; font-size: 1.55rem; margin: .2rem 0; font-variant-numeric: tabular-nums; color: var(--brand); }
.ratio p { margin: 0; color: var(--ink-2); font-size: .8rem; line-height: 1.5; }

.verdict { padding: 1.1rem 1.25rem; border-inline-start: 6px solid var(--ok); }
.verdict.warn { border-inline-start-color: var(--mid); }
.verdict.bad { border-inline-start-color: var(--bad); }
.verdict-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.verdict-head b { font-size: 1.2rem; }
.verdict-head p { margin: 0; color: var(--ink-2); font-size: .88rem; }
.verdict.good .verdict-head .ico { color: var(--ok); } .verdict.warn .verdict-head .ico { color: var(--mid); } .verdict.bad .verdict-head .ico { color: var(--bad); }
.signals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .6rem; }
.signals li { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .8rem; border-radius: 12px; background: var(--surface-2); }
.signals li b { font-size: .9rem; }
.signals li p { margin: .15rem 0 0; font-size: .82rem; color: var(--ink-2); line-height: 1.55; }
.signals .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: .45rem; background: var(--ok); }
.signals .warn .dot { background: var(--mid); } .signals .bad .dot { background: var(--bad); }
.signals .bad { background: var(--bad-soft); } .signals .warn { background: var(--mid-soft); } .signals .good { background: var(--ok-soft); }

.be-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.be-row small { display: block; color: var(--ink-2); font-size: .82rem; }
.be-row b { display: block; font-size: 1.4rem; margin: .15rem 0; }
.be-row span { font-size: .8rem; color: var(--ink-2); }
.be-bar { position: relative; height: 14px; background: var(--surface-2); border-radius: 999px; margin-bottom: .75rem; }
.be-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 999px; }
.be-mark { position: absolute; top: -5px; bottom: -5px; width: 3px; background: var(--bad); border-radius: 2px; }

.hbars { display: grid; gap: .55rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) minmax(60px, 1fr) auto; gap: .6rem; align-items: center; font-size: .88rem; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.hb-v { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.hb-v small { color: var(--ink-2); font-weight: 400; }

.trend { display: flex; align-items: flex-end; gap: 1rem; height: 220px; padding: 1.25rem 1.25rem .5rem; }
.tr-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.tr-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.tr-bars span { width: 22%; max-width: 26px; min-height: 2px; border-radius: 5px 5px 0 0; }
.tr-col small { font-size: .75rem; color: var(--ink-2); white-space: nowrap; }
.tr-rev { background: #9cc7ef; } .tr-gross { background: var(--brand-2); } .tr-net { background: var(--ok); } .tr-net.neg { background: var(--bad); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); padding-top: 0; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 0 1.25rem 1.25rem; }
.q { border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; border-top: 4px solid var(--ok); }
.q.warn { border-top-color: var(--mid); } .q.info { border-top-color: var(--brand-2); } .q.bad { border-top-color: var(--bad); }
.q header { display: flex; justify-content: space-between; align-items: center; }
.q header span { background: var(--surface-2); border-radius: 999px; padding: 0 .55rem; font-size: .8rem; font-weight: 700; }
.q p { margin: .35rem 0 .5rem; font-size: .82rem; color: var(--ink-2); line-height: 1.55; }
.q ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .25rem; font-size: .88rem; }
.q li small { color: var(--ink-2); margin-inline-start: .3rem; }

.aging { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: .75rem; }
.ag { border-radius: 12px; padding: .7rem .8rem; background: var(--ok-soft); }
.ag.warn { background: var(--mid-soft); } .ag.bad { background: var(--bad-soft); }
.ag small { display: block; font-size: .78rem; color: var(--ink-2); }
.ag b { display: block; font-size: 1.15rem; margin: .1rem 0; }
.ag span { font-size: .78rem; color: var(--ink-2); }

@media (max-width: 900px) {
    .cols.even, .quad, .ratio-grid.one, .be-row { grid-template-columns: 1fr; }
    .aging { grid-template-columns: 1fr 1fr; }
}
@media print {
    .period-bar, .tabs { display: none !important; }
    .rep-card, .ratio, .card, .kpi { box-shadow: none; break-inside: avoid; }
    .scroll-y { max-height: none; overflow: visible; }
}
.period-bar input[type=date] { width: 150px; flex: none; }
.period-bar .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }

/* ---------- statements ---------- */
.filters { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters label { min-width: 200px; flex: 0 1 260px; }
.filters label.check { min-width: 0; flex: none; }
.statement .st-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.st-head > div:first-child b { display: block; font-size: 1.25rem; }
.st-head > div:first-child span { color: var(--ink-2); font-size: .88rem; }
.st-sum { display: flex; gap: .6rem; flex-wrap: wrap; }
.st-sum > div { background: var(--surface-2); border-radius: 12px; padding: .5rem .8rem; min-width: 130px; }
.st-sum small { display: block; color: var(--ink-2); font-size: .76rem; }
.st-sum b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.grid tr.st-open td { background: var(--accent-soft); font-weight: 600; }
.grid tr.sub-row td { background: var(--surface-2); padding-top: .3rem; padding-bottom: .6rem; border-top: 0; }
table.mini { width: 100%; max-width: 640px; border-collapse: collapse; font-size: .84rem; }
table.mini th { text-align: right; color: var(--ink-2); font-weight: 600; padding: .25rem .5rem; }
table.mini td { padding: .25rem .5rem; border-top: 1px dashed var(--line); }
@media print { .filters { display: none !important; } }
.grid td.arrow { color: var(--brand-2); font-weight: 700; text-align: center; padding-inline: .2rem; }
