:root {
  --bg: #f4f6f5;
  --panel: #ffffff;
  --panel-2: #f8faf9;
  --line: #e2e8e5;
  --line-2: #cfd8d4;
  --text: #16211d;
  --muted: #5d6b66;
  --brand: #0f766e;
  --brand-2: #0d5f59;
  --brand-soft: #e3f3f1;
  --good: #15803d;
  --good-soft: #e6f5ea;
  --warn: #b45309;
  --warn-soft: #fdf1e1;
  --bad: #b91c1c;
  --bad-soft: #fdeaea;
  --info-soft: #e8f0fb;
  --shadow: 0 1px 2px rgba(16, 33, 29, .06), 0 4px 16px rgba(16, 33, 29, .06);
  --s1: #0d9488;
  --s2: #6d5bd0;
  --radius: 10px;
  --font: Inter, "Noto Sans Ethiopic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --panel: #161e1b; --panel-2: #1b2521; --line: #26332e; --line-2: #33443d;
    --text: #e6eeea; --muted: #97a7a1; --brand: #2dd4bf; --brand-2: #5eead4; --brand-soft: #123a35;
    --good: #4ade80; --good-soft: #13301f; --warn: #fbbf24; --warn-soft: #3a2c10; --bad: #f87171; --bad-soft: #3b1717;
    --info-soft: #172537; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; --s1: #11a595; --s2: #8b7cf0; --on-brand: #042f2e;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --panel: #161e1b; --panel-2: #1b2521; --line: #26332e; --line-2: #33443d;
  --text: #e6eeea; --muted: #97a7a1; --brand: #2dd4bf; --brand-2: #5eead4; --brand-soft: #123a35;
  --good: #4ade80; --good-soft: #13301f; --warn: #fbbf24; --warn-soft: #3a2c10; --bad: #f87171; --bad-soft: #3b1717;
  --info-soft: #172537; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; --s1: #11a595; --s2: #8b7cf0; --on-brand: #042f2e;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.boot { display: flex; align-items: center; justify-content: center; height: 100vh; height: 100dvh; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.nowrap { white-space: nowrap; } .grow { flex: 1; min-width: 0; } .hide { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.side a.nav:hover { background: var(--panel-2); }
.side a.nav.on { background: var(--brand-soft); color: var(--brand-2); }
.side .navhead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 17px; }
.content { padding: 18px; max-width: 1400px; width: 100%; }
.bottomnav { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .content { padding: 12px 12px 90px; }
  .top { padding: 8px 12px; flex-wrap: wrap; row-gap: 6px; }
  #page-actions { order: 5; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  #page-actions:empty { display: none; }
  #page-actions .btn { flex: 0 0 auto; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; text-align: center; padding: 8px 2px 6px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .bottomnav a .ico { display: block; font-size: 18px; }
  .bottomnav a.on { color: var(--brand); font-weight: 600; }
}

/* ---------- pieces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card > .bd { padding: 14px; }
.card > .bd.flush { padding: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 500; white-space: nowrap; min-height: 38px; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand, #fff); }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 8px; min-height: 30px; font-size: 13px; }
.btn.lg { padding: 12px 18px; min-height: 48px; font-size: 16px; }
.btn.block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.good { background: var(--good-soft); border-color: transparent; }
.chip.warn { background: var(--warn-soft); border-color: transparent; }
.chip.bad { background: var(--bad-soft); border-color: transparent; }
.chip.brand { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 500; }
input, select, textarea { border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
.input-lg { font-size: 18px; min-height: 50px; padding: 10px 14px; }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
table.t td.num, table.t th.num { text-align: right; }
.tablewrap { overflow: auto; max-width: 100%; }
@media (max-width: 820px) {
  table.t.cards thead { display: none; }
  table.t.cards tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.t.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 8px; text-align: right; }
  table.t.cards td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; }
  table.t.cards td.first { font-weight: 600; justify-content: flex-start; text-align: left; }
  table.t.cards td.first::before { content: none; }
}
.empty { padding: 30px; text-align: center; color: var(--muted); }

.kpi { padding: 14px; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; margin-top: 2px; }
.alert { padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); display: flex; gap: 8px; align-items: flex-start; }
.alert.bad { background: var(--bad-soft); } .alert.info { background: var(--info-soft); } .alert.good { background: var(--good-soft); }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 17, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 5vh 12px; overflow: auto; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; } .modal.xwide { max-width: 1100px; }
.modal > .hd { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal > .bd { padding: 16px; }
.modal > .ft { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 560px) { .overlay { padding: 0; align-items: stretch; } .modal { border-radius: 0; min-height: 100%; } }
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #16211d; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 90vw; }
.toast.bad { background: var(--bad); } .toast.good { background: var(--good); }
@media (max-width: 820px) { #toast-root { bottom: 80px; } }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good); cursor: pointer; border: 0; }
.sync.pending { background: var(--warn-soft); color: var(--warn); }
.sync.off { background: var(--bad-soft); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1fr); background: var(--bg); }
.login-hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(120% 90% at 0% 0%, #2dd4bf 0%, #0f766e 45%, #0a4f4a 100%); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.float { animation: float 9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.float.f2 { animation-duration: 11s; animation-delay: -3s; } .float.f3 { animation-duration: 13s; animation-delay: -6s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-18px) rotate(6deg); } }
.hero-in { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 56px; }
.hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.hero-brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.hero-copy { max-width: 520px; }
.hello { display: inline-block; font-size: 14px; font-weight: 600; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(4px); }
.hero-copy h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; margin: 18px 0 12px; font-weight: 800; letter-spacing: -.02em; }
.hero-copy h1 span { background: linear-gradient(90deg, #fff, #a7f3d0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { font-size: 16px; opacity: .9; margin: 0 0 22px; max-width: 440px; }
.hero-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hero-feats li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.hero-feats li span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); }
.hero-date { font-size: 13px; opacity: .85; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: 0 24px 60px rgba(16, 33, 29, .10); animation: rise .5s ease both; }
.login-card h2 { font-size: 24px; margin-top: 14px; }
.login-card > p { margin: 6px 0 20px; }
.login-logo { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 8px 22px rgba(15, 118, 110, .3); }
.login-card .col { gap: 14px; }
.inp { position: relative; display: block; }
.inp > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; opacity: .55; pointer-events: none; font-size: 15px; }
.inp input { padding-left: 38px; min-height: 48px; font-size: 16px; border-radius: 12px; }
.inp .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; padding: 8px; opacity: .6; }
.login-card .btn.primary { border-radius: 12px; min-height: 52px; font-weight: 700; }
.login-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; align-content: start; }
  .login-hero { border-radius: 0 0 28px 28px; }
  .hero-in { padding: calc(20px + env(safe-area-inset-top)) 22px 64px; gap: 14px; }
  .hero-feats, .hero-copy p, .hero-copy h1 br { display: none; }
  .hero-copy h1 { font-size: 28px; margin: 12px 0 0; }
  .hero-date { order: -1; position: absolute; right: 22px; top: calc(28px + env(safe-area-inset-top)); display: none; }
  .login-panel { padding: 0 16px 28px; margin-top: -44px; position: relative; }
  .login-card { padding: 24px 20px; border-radius: 18px; }
  .login-logo { display: none; }
  .login-card h2 { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .float, .login-card { animation: none; } }

/* ---------- boot splash ---------- */
.boot { flex-direction: column; gap: 14px; background: radial-gradient(120% 90% at 0% 0%, #2dd4bf 0%, #0f766e 45%, #0a4f4a 100%); color: #fff; font-size: 18px; }
.boot img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 12px 36px rgba(0,0,0,.25); animation: pulse 1.6s ease-in-out infinite; }
.boot-bar { width: 120px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; position: relative; }
.boot-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: #fff; border-radius: 4px; animation: slide 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- polish (brand, shell, cards) ---------- */
body { background: radial-gradient(1200px 400px at 100% -10%, var(--brand-soft), transparent 70%), var(--bg); background-attachment: fixed; }
.side { padding: 16px 12px 12px; }
.side .brand { text-decoration: none; color: var(--text); padding: 6px 8px 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.side .brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 12px rgba(15, 118, 110, .28); }
.brand .bn { font-weight: 800; font-size: 15px; line-height: 1.2; }
.brand > .grow { min-width: 0; }
.side a.nav { position: relative; transition: background .15s, color .15s; }
.side a.nav.on { background: linear-gradient(90deg, var(--brand-soft), transparent); font-weight: 600; }
.side a.nav.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); cursor: pointer; text-align: left; }
.side-user b { display: block; font-size: 13px; } .side-user small { color: var(--muted); font-size: 11px; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 600; font-size: 13px; }
.top { background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); padding-top: calc(10px + env(safe-area-inset-top)); }
.top h1 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.top-logo { display: none; width: 30px; height: 30px; border-radius: 9px; }
.card { border-radius: 14px; }
.card > .hd { padding: 14px 16px; } .card > .hd h2 { font-size: 15px; font-weight: 700; }
.btn { border-radius: 10px; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand)); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.kpi { position: relative; overflow: hidden; padding: 16px 16px 14px; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--brand), #2dd4bf); }
.grid4 > .kpi:nth-child(2)::before { background: linear-gradient(90deg, #6d5bd0, #a78bfa); }
.grid4 > .kpi:nth-child(3)::before { background: linear-gradient(90deg, #15803d, #4ade80); }
.grid4 > .kpi:nth-child(4)::before { background: linear-gradient(90deg, #b45309, #fbbf24); }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.welcome { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: 16px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #2dd4bf 0%, #0f766e 50%, #0a4f4a 100%); box-shadow: 0 10px 30px rgba(15, 118, 110, .25); position: relative; overflow: hidden; }
.welcome::after { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.08); }
.w-hi { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.w-sub { opacity: .88; margin-top: 4px; }
.w-act { position: relative; z-index: 1; }
.w-act .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(4px); }
.w-act .btn:hover { background: rgba(255,255,255,.26); }
.subs { grid-column: 1 / -1; font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.subs button { border: 1px dashed var(--brand); color: var(--brand-2); background: var(--brand-soft); border-radius: 7px; padding: 3px 9px; cursor: pointer; font-size: 12px; font-weight: 600; }
.install-help { text-align: center; } .install-help ol { text-align: left; line-height: 1.9; padding-left: 22px; }
.install-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 22px rgba(15, 118, 110, .3); }
@media (max-width: 820px) {
  .top-logo { display: block; }
  .user-btn .un { display: none; } .user-btn { padding: 3px; }
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 0 0 auto; }
  .welcome { padding: 16px; } .w-hi { font-size: 19px; } .w-act { width: 100%; } .w-act .btn { flex: 1; }
  .bottomnav { background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 -4px 20px rgba(16, 33, 29, .06); }
  .bottomnav a .ico { width: 44px; margin: 0 auto 2px; padding: 3px 0; border-radius: 999px; transition: background .15s; }
  .bottomnav a.on .ico { background: var(--brand-soft); }
}

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 14px; align-items: start; }
.pos .search { position: relative; }
.pos .results { max-height: calc(100vh - 230px); overflow: auto; }
.pr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pr:hover, .pr.sel { background: var(--brand-soft); }
.pr .nm { font-weight: 600; }
.pr .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.pr .units { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.pr .units button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 7px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
.pr .units button:hover { border-color: var(--brand); color: var(--brand); }
.cart { position: sticky; top: 70px; }
.cart .lines { max-height: calc(100vh - 420px); min-height: 120px; overflow: auto; }
.cl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cl.sel { background: var(--panel-2); }
.cl .nm { font-weight: 600; }
.cl .ctl { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cl .ctl input { width: 64px; min-height: 32px; padding: 4px 6px; text-align: center; }
.cl .ctl input.price { width: 90px; }
.cl .ctl select { width: auto; min-height: 32px; padding: 4px 6px; }
.qbtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 18px; line-height: 1; }
.totals { padding: 12px 14px; border-top: 1px solid var(--line); }
.totals .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bills { display: flex; gap: 6px; overflow-x: auto; }
.bills button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.bills button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.paym { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.paym button { padding: 12px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; }
.paym button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; color: var(--muted); }
@media (max-width: 1000px) {
  .pos { grid-template-columns: 1fr; }
  .pos .results { max-height: 45vh; }
  .cart { position: static; }
  .cart .lines { max-height: none; }
  .paybar { position: sticky; bottom: 64px; z-index: 5; }
}

/* ---------- charts ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; padding: 5px 0; }
.bar-row .track { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--s1); border-radius: 5px; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- receipt (print) ---------- */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  @page { margin: 0; }
}
.receipt { font: 12px/1.35 var(--mono); color: #000; padding: 6px 4px; width: 72mm; }
.receipt.w58 { width: 48mm; font-size: 11px; }
.receipt .c { text-align: center; } .receipt .b { font-weight: 700; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.report-print { padding: 16px; color: #000; font: 12px/1.4 var(--font); }
.report-print table { width: 100%; border-collapse: collapse; }
.report-print th, .report-print td { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; }

@media (pointer: coarse) { .kbdhints, .kbd { display: none !important; } }

/* ---------- refills, summary, labels ---------- */
.refills { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .refills { grid-template-columns: 1fr; } }
.refill .bd { display: flex; flex-direction: column; gap: 10px; }
.refill-med { padding: 10px 12px; background: var(--panel-2); border-radius: 10px; }
.summary-pre { white-space: pre-wrap; font: 13px/1.55 var(--font); margin: 0; }
ol.steps { line-height: 1.7; padding-left: 20px; margin: 0; } ol.steps li { margin-bottom: 10px; }
.label-preview { padding: 14px; background: var(--panel-2); border-radius: 10px; display: flex; justify-content: center; }
.lbl { box-sizing: border-box; padding: 1.2mm 2mm; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3mm;
  text-align: center; overflow: hidden; background: #fff; color: #000; font-family: var(--font); border: 1px dashed #bbb; }
.lbl-shop { font-size: 6pt; opacity: .7; white-space: nowrap; }
.lbl-name { font-size: 8pt; font-weight: 700; line-height: 1.1; max-height: 2.25em; overflow: hidden; }
.lbl-price { font-size: 12pt; font-weight: 800; line-height: 1.1; } .lbl-price small { font-size: 6pt; font-weight: 500; }
.lbl-bc { width: 88%; height: 8mm; } .lbl-bc svg { width: 100%; height: 100%; display: block; }
.lbl-code { font: 6pt var(--mono); letter-spacing: .08em; }
.lbl-sheet { display: grid; justify-content: center; }
.lbl-roll .lbl { break-after: page; page-break-after: always; }
@media print { .lbl { border: 0; } .lbl-sheet .lbl { border: 0; } }

/* ---------- screen lock ---------- */
#lock { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 90% at 0% 0%, #2dd4bf 0%, #0f766e 45%, #0a4f4a 100%); }
.lock-card { width: 100%; max-width: 360px; background: var(--panel); border-radius: 20px; padding: 28px 24px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.lock-card h2 { margin: 12px 0 4px; } .lock-card form { margin: 16px 0 8px; text-align: left; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
a[role=button] { cursor: pointer; color: var(--brand); text-decoration: underline; }
.tabs a[role=button], .bottomnav a[role=button] { text-decoration: none; color: var(--muted); }
.tabs a[role=button].on { color: var(--brand); }
