:root {
  --brand: #0a5ef0; --brand-2: #0b1f5b; --brand-soft: #e4eeff;
  --accent: #12bde6;
  --bg: #f4f6fb; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --green: #15803d; --green-soft: #dcfce7; --red: #dc2626; --red-soft: #fee2e2; --amber: #b45309; --amber-soft: #fef3c7;
  --blue: #1d4ed8; --blue-soft: #dbeafe;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4d8dff; --brand-2: #7fb0ff; --brand-soft: #12244a;
    --bg: #0a0f1c; --card: #111a2c; --text: #e6ebf5; --muted: #94a3b8; --line: #1e2a42;
    --green: #4ade80; --green-soft: #14321f; --red: #f87171; --red-soft: #3b1515; --amber: #fbbf24; --amber-soft: #3a2a0b;
    --blue: #93c5fd; --blue-soft: #172554;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4d8dff; --brand-2: #7fb0ff; --brand-soft: #12244a;
  --bg: #0a0f1c; --card: #111a2c; --text: #e6ebf5; --muted: #94a3b8; --line: #1e2a42;
  --green: #4ade80; --green-soft: #14321f; --red: #f87171; --red-soft: #3b1515; --amber: #fbbf24; --amber-soft: #3a2a0b;
  --blue: #93c5fd; --blue-soft: #172554;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.35rem; } h3 { font-size: 1rem; }
p { margin: .4em 0; }
small { font-size: .8rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }
.mt { margin-top: 1rem; } .grow { flex: 1; min-width: 0; }
.row { display: flex; gap: .5rem; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: .6rem 1rem; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .05s, background .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn.big { padding: .9rem 1.2rem; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { padding: .35rem .6rem; min-width: 34px; }
.btn.sale { background: var(--green); border-color: var(--green); color: #fff; }
.btn.expense { background: var(--card); border-color: var(--red); color: var(--red); }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
select, input[type="date"] { width: auto; }
textarea { resize: vertical; }
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label, .filters label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; font-size: .9rem; }
.form .label { font-weight: 500; font-size: .9rem; margin-bottom: -.4rem; }
.error { color: var(--red); min-height: 1em; margin: 0; font-size: .9rem; }
.amount-input { font-size: 1.6rem; font-weight: 700; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; text-transform: uppercase; font-weight: 700; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.yesno { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-weight: 500; font-size: .9rem; }
.yesno > span:first-child { flex: 1; min-width: 160px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; min-width: 0; }
.card.narrow { width: 100%; max-width: 420px; }
.card.wide { width: 100%; max-width: 640px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.card-head h3 { margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 1rem 0; margin: 0; }
.tag { font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.tag.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill { font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.badge { background: var(--red); color: #fff; font-size: .7rem; border-radius: 999px; padding: .05rem .4rem; margin-left: auto; }
.alert { display: block; padding: .8rem 1rem; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-weight: 600; margin-bottom: 1rem; }
.alert.red { background: var(--red-soft); color: var(--red); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }

/* Auth / onboarding */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; gap: 3rem; flex-wrap: wrap; }
.auth-hero { max-width: 380px; }
.auth-hero h1 { font-size: 2.4rem; margin: .4rem 0 .2rem; }
.auth-hero p { color: var(--muted); font-size: 1.1rem; }
.ticks { padding: 0; list-style: none; margin: 1.2rem 0 0; }
.ticks li { padding: .3rem 0 .3rem 1.6rem; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #0b1f5b, #0a5ef0 60%, #12bde6); color: #fff; display: grid; place-items: center; font-weight: 800; }
.logo.big { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 16px; }
.tabs { display: flex; background: var(--bg); padding: 4px; border-radius: 12px; margin-bottom: 1rem; }
.tab { flex: 1; border: 0; background: transparent; padding: .55rem; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.demo-box { margin-top: 1rem; padding: .8rem; border-radius: 12px; background: var(--amber-soft); font-size: .9rem; }
.demo-box .row { margin-top: .5rem; }
.demo-bar { background: var(--amber-soft); color: var(--amber); font-size: .8rem; padding: .4rem 1rem; text-align: center; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1rem 0; }
.choice-card { display: flex; flex-direction: column; gap: .3rem; text-align: left; padding: 1rem; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.choice-card span { font-size: 1.8rem; }
.choice-card small { color: var(--muted); }
.choice-card.on { border-color: var(--brand); background: var(--brand-soft); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.cat input { position: absolute; opacity: 0; }
.cat span { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: .85rem; font-weight: 500; height: 100%; }
.cat i { font-style: normal; font-size: 1.3rem; }
.cat input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.big-emoji { font-size: 3rem; }

/* Shell */
.shell { min-height: 100vh; }
.side { display: none; }
.main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 1rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-biz { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.top-biz i { font-style: normal; font-size: 1.5rem; }
.top-biz h1 { font-size: 1.15rem; margin: 0; }
.top-biz small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view { padding: 1rem; max-width: 1200px; margin: 0 auto; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; color: var(--muted); font-size: .7rem; font-weight: 600; position: relative; }
.bottom a i { font-style: normal; font-size: 1.25rem; filter: grayscale(1); opacity: .7; }
.bottom a.on { color: var(--brand); }
.bottom a.on i { filter: none; opacity: 1; }
.bottom .badge { position: absolute; top: 4px; left: 55%; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .main { min-width: 0; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--card); border-right: 1px solid var(--line); padding: 1rem .8rem; gap: .8rem; }
  .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; padding: 0 .4rem; }
  .biz-switch { display: flex; align-items: center; gap: .6rem; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
  .biz-switch i { font-style: normal; font-size: 1.4rem; }
  .biz-switch span { flex: 1; min-width: 0; }
  .biz-switch b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
  .biz-switch small { color: var(--muted); }
  .side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
  .side nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 10px; color: var(--text); font-weight: 500; }
  .side nav a i { font-style: normal; width: 1.4rem; text-align: center; }
  .side nav a:hover { background: var(--bg); }
  .side nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
  .side-foot { display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--line); padding-top: .8rem; }
  .side-foot small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-foot b { font-size: .9rem; }
  .bottom { display: none; }
  .main { padding-bottom: 0; }
  .top { padding: 1rem 1.5rem; }
  .top-biz > i { display: none; }
  .view { padding: 1.5rem; }
}

/* Layout helpers */
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2.wide-left { grid-template-columns: 1.6fr 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1rem; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.three { grid-template-columns: repeat(3, 1fr); } }
.kpis.three > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 760px) { .kpis.three > :last-child:nth-child(odd) { grid-column: auto; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); min-width: 0; }
.kpi small { color: var(--muted); font-weight: 500; display: block; }
.kpi b { display: block; font-size: 1.35rem; font-weight: 800; margin: .15rem 0; overflow-wrap: anywhere; }
.kpi em { font-style: normal; font-size: .6em; font-weight: 600; color: var(--muted); }
.kpi span { font-size: .78rem; color: var(--muted); }
.kpi.green b { color: var(--green); } .kpi.red b { color: var(--red); }

.toolbar { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters { margin-bottom: .8rem; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg a { padding: .4rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.seg a.on { background: var(--brand); color: #fff; }
.datenav { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.datenav input { font-weight: 600; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list small { display: block; color: var(--muted); }
.tx-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.tx.sale .tx-icon { background: var(--green-soft); color: var(--green); }
.tx.expense .tx-icon { background: var(--red-soft); color: var(--red); }
.tx .amt { font-weight: 700; white-space: nowrap; }
.tx.sale .amt { color: var(--green); } .tx.expense .amt { color: var(--red); }
.tx .del { opacity: .5; } .tx .del:hover { opacity: 1; color: var(--red); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0 .2rem; border-bottom: 2px solid var(--line); }
.day-head small { color: var(--muted); }
.task.done b { text-decoration: line-through; color: var(--muted); }
.check { position: relative; flex-shrink: 0; }
.check input { position: absolute; opacity: 0; width: 26px; height: 26px; margin: 0; cursor: pointer; }
.check span { display: block; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); }
.check input:checked + span { background: var(--green); border-color: var(--green); }
.check input:checked + span::after { content: "✓"; color: #fff; display: grid; place-items: center; height: 100%; font-weight: 800; font-size: .9rem; }
.check input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.row-link { display: flex; justify-content: space-between; width: 100%; color: var(--text); gap: .5rem; }
.menu a { display: flex; align-items: center; gap: .7rem; width: 100%; color: var(--text); font-weight: 500; }
.menu a i { font-style: normal; width: 1.5rem; text-align: center; }
.menu a > span:last-child { margin-left: auto; color: var(--muted); }
.fields li { gap: .3rem; }

/* My day */
.greet { color: var(--muted); margin: 0 0 .8rem; }
.clock { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.clock.on { border-color: var(--green); background: linear-gradient(135deg, var(--green-soft), var(--card) 70%); }
.timer { font-size: 1.8rem; font-weight: 800; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1rem; }
.cta { display: flex; align-items: center; gap: .9rem; color: var(--text); font-weight: 600; }
.cta > span { font-size: 1.8rem; }
.cta small { display: block; color: var(--muted); font-weight: 400; }
.cta div { flex: 1; }

/* Report form */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--bg); border-radius: 12px; padding: .7rem; }
.summary small { color: var(--muted); display: block; }
.summary b { font-size: .95rem; }
.cashbox { border: 2px dashed var(--line); border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.cashbox small { color: var(--muted); display: block; }
.cashbox b { font-size: 1.2rem; }
.diff { font-weight: 700; min-height: 1.2em; }

/* Dashboard */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .bar-s { fill: var(--brand); opacity: .55; } .chart .bar-s.cur { opacity: 1; }
.chart .bar-e { fill: var(--red); opacity: .45; }
.chart text { fill: var(--muted); font-size: 12px; } .chart text.cur { fill: var(--text); font-weight: 700; }
.legend { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: .5rem; }
.legend i.s { background: var(--brand); } .legend i.e { background: var(--red); opacity: .6; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: .6rem; align-items: center; padding: .3rem 0; font-size: .9rem; }
.hbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar div { background: var(--bg); border-radius: 6px; height: 10px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.hbar b { font-size: .85rem; }
.people li { gap: .6rem; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(21,128,61,.5); } 70% { box-shadow: 0 0 0 8px rgba(21,128,61,0); } 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); } }

/* Staff reports */
.report-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.report .who { display: flex; align-items: center; gap: .6rem; }
.report .who small { display: block; color: var(--muted); }
.report dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: .4rem 0 0; font-size: .9rem; }
.report dt { color: var(--muted); } .report dd { margin: 0; font-weight: 600; text-align: right; }
.report.missing { opacity: .75; }
.issues { background: var(--amber-soft); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; }

/* Staff */
.invite { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: linear-gradient(135deg, var(--brand-soft), var(--card)); }
.invite .code { font-size: 2rem; font-weight: 800; letter-spacing: .25em; color: var(--brand); margin: .2rem 0; }
.invite > div:first-child { max-width: 420px; }
.people select { width: auto; padding: .35rem .5rem; font-size: .85rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: .5rem; border-bottom: 1px solid var(--line); }
.table td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* Modal & toast */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; animation: up .2s; }
@media (min-width: 600px) { .modal-wrap { align-items: center; } .modal { border-radius: 18px; } }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(30px); } }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; z-index: 60; transition: .25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--green); color: #fff; } .toast.bad { background: var(--red); color: #fff; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.loading { display: flex; justify-content: center; gap: 6px; padding: 3rem; }
.loading.full { min-height: 100vh; align-items: center; }
.loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: bounce 1s infinite; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

@media (max-width: 420px) {
  .choice { grid-template-columns: 1fr; }
  .kpi b { font-size: 1.1rem; }
  .timer { font-size: 1.5rem; }
}

/* ═════════════ v2 components ═════════════ */
.block { display: block; } .nowrap { white-space: nowrap; } .ml-auto { margin-left: auto; } .mr-auto { margin-right: auto; }
.r { text-align: right !important; } .red-text { color: var(--red) !important; } .blue { color: var(--blue); }
.req { color: var(--red); font-style: normal; font-weight: 400; font-size: .8rem; }
.tag.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.tag.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.btn.left { justify-content: flex-start; text-align: left; white-space: normal; }
.card.wider { width: 100%; max-width: 820px; }
.alert.flat { border-radius: 0; margin: 0; text-align: center; font-size: .85rem; padding: .5rem 1rem; }
.alerts { display: grid; gap: .5rem; margin-bottom: 1rem; }
.alerts .alert { margin: 0; font-weight: 500; font-size: .92rem; }
.alert:not(.red):not(.amber) { background: var(--blue-soft); color: var(--blue); }
.alert.amber { background: var(--amber-soft); color: var(--amber); }
.click { cursor: pointer; }
.list > li.click:hover, .table.click tbody tr:hover { background: var(--bg); }
.table.click tbody tr { cursor: pointer; }
.who { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.who small { display: block; }
.big-ico { font-size: 1.8rem; }
.kpis.two { grid-template-columns: 1fr 1fr; }
a.kpi { color: inherit; display: block; } a.kpi:hover { border-color: var(--brand); }
.grid3 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
.demo-users { display: grid; gap: .35rem; margin-top: .5rem; max-height: 330px; overflow: auto; }
.demo-users .btn { background: var(--card); }

/* Nav */
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .8rem .7rem .2rem; }
.side nav a .badge[hidden] { display: none; }
.branch-sel { padding: .35rem .5rem; font-size: .85rem; max-width: 170px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form-grid > label, .form-grid > .check-row { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .3rem; font-weight: 500; font-size: .9rem; }
.form-grid > label.half { grid-column: auto; }
.form-grid > .check-row { flex-direction: row; }
@media (max-width: 520px) { .form-grid > label.half { grid-column: 1 / -1; } }
.check-row { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 500; font-size: .9rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
fieldset.cfg { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin: 0 0 .6rem; }
fieldset.cfg legend { font-weight: 700; padding: 0 .4rem; }
.perm-box summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: .4rem 0; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; margin-top: .5rem; }
.perm-grid label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 500; }
.perm-table select { font-size: .8rem; padding: .3rem .4rem; }
.mod-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
input.mini { width: 90px; padding: .25rem .4rem; font-size: .85rem; display: inline-block; }
input.search { max-width: 280px; }
.modal.wide { max-width: 760px; }

/* Tabs & periods */
.tabs-line { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs-line a { padding: .6rem .9rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tabs-line a.on { color: var(--brand); border-color: var(--brand); }
.toolbar .tabs-line { margin-bottom: 0; border: 0; }
.periodbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.periodbar .seg { overflow-x: auto; max-width: 100%; }
.periodbar .seg a { white-space: nowrap; }
.chip-btn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.chip-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Registration */
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: s; }
.steps li { flex: 1; font-size: .8rem; font-weight: 600; color: var(--muted); padding-top: .5rem; border-top: 3px solid var(--line); counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.on { color: var(--brand); border-color: var(--brand); } .steps li.done { border-color: var(--brand); }
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin: 1rem 0; }
.cat-card { text-align: left; border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 14px; padding: .9rem; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: .4rem; }
.cat-card:hover, .cat-card.on { border-color: var(--brand); background: var(--brand-soft); }
.cat-card .ico { font-size: 1.8rem; }
.mods { display: flex; flex-wrap: wrap; gap: .25rem; }
.mods i { font-style: normal; font-size: .72rem; background: var(--bg); border-radius: 6px; padding: .1rem .4rem; color: var(--muted); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; margin: .8rem 0; }
.feature { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; }
.feature > span { font-size: 1.3rem; }
.feature small { display: block; color: var(--muted); }
.feature div { flex: 1; }
.feature.off { opacity: .8; border-style: dashed; }
.wait-row { text-align: left; border-top: 1px solid var(--line); padding: .6rem 0; }

/* Home */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.qa { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .8rem .4rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; text-align: center; box-shadow: var(--shadow); }
.qa span { font-size: 1.6rem; }
.qa:hover { border-color: var(--brand); }
.notice-mini { display: block; color: var(--text); background: var(--blue-soft); border-color: transparent; }
.notice-mini small { display: block; color: var(--muted); }
.notice.pinned { border-color: var(--brand); }

/* POS */
.pos { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .pos { grid-template-columns: 1fr 380px; align-items: start; } .pos-cart { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; overflow-x: hidden; } .pos-bar { display: none !important; } }
.pos-left > .row { margin-bottom: .6rem; }
.pos-left .search { max-width: none; }
.pos-cats { margin-bottom: .6rem; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.prod { display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; min-height: 84px; }
.prod:hover { border-color: var(--brand); }
.prod b { font-size: .9rem; line-height: 1.2; }
.prod .price { font-weight: 800; color: var(--brand); }
.prod small { color: var(--muted); font-size: .75rem; }
.prod.out { opacity: .5; cursor: not-allowed; }
.cart-list li { gap: .5rem; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: var(--bg); color: var(--text); width: 32px; height: 32px; font-size: 1rem; cursor: pointer; }
.stepper input { width: 48px; border: 0; border-radius: 0; text-align: center; padding: .3rem 0; }
.totals { border-top: 1px dashed var(--line); margin: .6rem 0; padding-top: .6rem; display: grid; gap: .3rem; }
.totals > div { display: flex; justify-content: space-between; align-items: center; }
.totals .grand { font-size: 1.15rem; font-weight: 800; }
.pos-cart .label { display: block; margin: .6rem 0 .3rem; font-weight: 500; font-size: .9rem; }
.pos-cart .chips { margin-bottom: .6rem; }
.pos-cart > .btn.big { margin-top: .6rem; }
.pos-bar { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); padding: .5rem 1rem; z-index: 9; }
.pos-bar .btn { box-shadow: 0 6px 20px rgba(0,0,0,.2); }
@media (min-width: 900px) { .pos-bar { left: 250px; bottom: 0; } }

/* Receipt / print */
.receipt { max-width: 340px; margin: 0 auto; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; text-align: center; }
.receipt h3 { margin: 0 0 .2rem; font-family: Inter, sans-serif; }
.receipt p { margin: .2rem 0; color: var(--muted); }
.receipt table { width: 100%; border-collapse: collapse; margin: .5rem 0; text-align: left; }
.receipt td { padding: .2rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.receipt .rc-tot .grand td { font-weight: 800; font-size: 1rem; border-bottom: 2px solid var(--text); }
.receipt .rc-meta { color: var(--text); }
.receipt .void { color: var(--red); font-weight: 800; font-size: 1.4rem; letter-spacing: .3em; }
.receipt .rc-foot { margin-top: .6rem; font-style: italic; }
.print-doc .kpis { grid-template-columns: repeat(4, 1fr); }
.print-doc .grid2 { grid-template-columns: 1fr 1fr; }
.print-doc .card { break-inside: avoid; box-shadow: none; }
.slip { max-width: 520px; margin: 0 auto; }
.report-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.report-head h2 { margin: 0; }
.table.pl td { padding: .4rem .3rem; }
.table.pl tr.sum td { font-weight: 700; border-top: 2px solid var(--line); }
.table.pl tr.grand td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--text); }
@media print { .side, .bottom, .top, .demo-bar, .toolbar { display: none !important; } body { background: #fff; } }

/* Stock receive lines */
.lines { display: grid; gap: .4rem; }
.line { display: grid; grid-template-columns: 1fr 80px 100px 34px; gap: .4rem; }
.lines.exp .line { grid-template-columns: 1fr 70px 90px 80px 130px 34px; }
@media (max-width: 640px) { .line, .lines.exp .line { grid-template-columns: 1fr 1fr; } .line select { grid-column: 1 / -1; } }
.total-line { text-align: right; font-size: 1.05rem; }

/* Bookings */
.bk-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: .7rem; overflow-x: auto; padding-bottom: .5rem; }
.bk-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; min-height: 200px; }
.bk-col h4 { margin: 0 0 .5rem; }
.bk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; padding: .5rem 0; }
.bk { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: .55rem .7rem; margin-bottom: .5rem; cursor: pointer; background: var(--card); display: grid; gap: .15rem; }
.bk:hover { box-shadow: var(--shadow); border-color: var(--brand); }
.bk small { color: var(--muted); }
.bk-time { font-size: .78rem; font-weight: 700; color: var(--brand); }
.bk.done { border-left-color: var(--green); opacity: .8; } .bk.cancelled, .bk.no_show { border-left-color: var(--red); opacity: .55; }
.bk.arrived { border-left-color: var(--amber); } .bk.confirmed { border-left-color: var(--blue); }

/* Orders kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: .7rem; overflow-x: auto; padding-bottom: .5rem; }
.kcol { background: color-mix(in srgb, var(--line) 35%, var(--bg)); border-radius: var(--radius); padding: .6rem; min-height: 240px; }
.kcol h4 { margin: .1rem .2rem .6rem; }
.job { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; cursor: pointer; display: grid; gap: .2rem; }
.job:hover { border-color: var(--brand); }
.job small { color: var(--muted); }

/* Assets */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 1rem; }
.asset .summary { margin: .5rem 0 .2rem; }

/* Admin */
.cat-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 1rem; }
.muted-card { opacity: .6; }
code { background: var(--bg); padding: .1rem .3rem; border-radius: 4px; font-size: .8rem; word-break: break-all; }

/* Brand logo */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.brand-wide { display: block; height: 44px; width: auto; }
.brand-wide.big { height: auto; width: min(320px, 100%); margin-bottom: .6rem; }
.brand { padding: .2rem .3rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-wide { background: #fff; border-radius: 10px; padding: 6px 10px; box-sizing: content-box; } }
:root[data-theme="dark"] .brand-wide { background: #fff; border-radius: 10px; padding: 6px 10px; box-sizing: content-box; }