/* Medhal Hub – prototype styles. Brand navy taken from the Medhal logo. */
:root {
  --navy: #1e3a7b;
  --navy-2: #2a4d9b;
  --navy-d: #132857;
  --sky: #8fa1c9;
  --sky-l: #e8edf7;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f1;
  --ink: #16203a;
  --ink-2: #3a4560;
  --muted: #6b7590;
  --ok: #1d9a6c;
  --ok-l: #e4f5ee;
  --warn: #d98a1c;
  --warn-l: #fdf1df;
  --bad: #cf4436;
  --bad-l: #fbe7e4;
  --sand: #b8925a;
  --sand-l: #f6efe3;
  --r: 14px;
  --r-s: 10px;
  --sh: 0 1px 2px rgba(20, 35, 80, .05), 0 4px 16px rgba(20, 35, 80, .06);
  --sh-l: 0 12px 40px rgba(20, 35, 80, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Geeza Pro", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[dir=rtl] body, html[dir=rtl] { font-family: "IBM Plex Sans Arabic", var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .flip { transform: scaleX(-1); }

/* ---------- Splash ---------- */
#splash { position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-items: center; transition: opacity .5s var(--ease), visibility .5s; }
#splash.hide { opacity: 0; visibility: hidden; }
#splash .wrap { display: grid; justify-items: center; gap: 22px; }
#splash img { width: 220px; mix-blend-mode: multiply; animation: splashIn 1s var(--ease) both; }
#splash .bar { width: 160px; height: 3px; background: var(--sky-l); border-radius: 3px; overflow: hidden; }
#splash .bar span { display: block; height: 100%; width: 40%; background: var(--navy); border-radius: 3px; animation: load 1.1s var(--ease) infinite; }
@keyframes splashIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(280%); } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar { background: #fff; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img { width: 64px; height: 64px; object-fit: contain; mix-blend-mode: multiply; }
.brand b { display: block; font-size: 15px; color: var(--navy); letter-spacing: .2px; }
.brand small { color: var(--muted); font-size: 12px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; }
[dir=rtl] .nav-sec { letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; cursor: pointer; position: relative; transition: background .2s, color .2s; }
.nav a:hover { background: var(--bg); color: var(--navy); }
.nav a.on { background: var(--sky-l); color: var(--navy); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--navy); }
.nav a .badge { margin-inline-start: auto; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.who .av { width: 34px; height: 34px; font-size: 13px; }
.who small { display: block; color: var(--muted); font-size: 12px; }

.main { overflow-y: auto; height: 100vh; scroll-behavior: smooth; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: rgba(244, 246, 250, .85); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 21px; margin: 0; letter-spacing: -.01em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .sp { flex: 1; }
.mobile-logo { display: none; width: 40px; height: 40px; object-fit: contain; mix-blend-mode: multiply; }
.view { padding: 8px 28px 48px; max-width: 1320px; }
.view.anim > * { animation: fadeIn .22s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Controls ---------- */
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 500; color: var(--muted); transition: all .2s; white-space: nowrap; }
.seg button.on { background: var(--navy); color: #fff; box-shadow: 0 2px 6px rgba(30, 58, 123, .3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 14px; border-radius: 10px; font-weight: 600; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { box-shadow: var(--sh); }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.pri:hover { background: var(--navy-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--sky-l); box-shadow: none; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; outline: none; transition: border .2s, box-shadow .2s; }
.input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(42, 77, 155, .14); }
label.f { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sky-l); color: var(--navy); white-space: nowrap; }
.badge.ok { background: var(--ok-l); color: var(--ok); }
.badge.warn { background: var(--warn-l); color: #a8650c; }
.badge.bad { background: var(--bad-l); color: var(--bad); }
.badge.sand { background: var(--sand-l); color: #8a6a37; }
.badge.grey { background: #eef0f4; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Cards & layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card.pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.card-h h3 { margin: 0; font-size: 15px; }
.card-h .sp { flex: 1; }
.card-b { padding: 0 20px 18px; }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hero { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 18px; }
.hero h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.hero p { margin: 4px 0 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sky-l); color: var(--navy); }
.kpi .ic.sand { background: var(--sand-l); color: var(--sand); }
.kpi .ic.ok { background: var(--ok-l); color: var(--ok); }
.kpi .ic.bad { background: var(--bad-l); color: var(--bad); }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }

.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); transition: background .15s; }
.li:first-child { border-top: 0; }
.li.click { cursor: pointer; }
.li.click:hover { background: #f8f9fc; }
.li .t { font-weight: 600; }
.li .s { color: var(--muted); font-size: 12px; }

.av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; flex: none; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.av.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 26px; }
.av.round { border-radius: 50%; }
.av.grey { background: linear-gradient(135deg, #c5cad4, #8d94a3); }
.av.chestnut { background: linear-gradient(135deg, #c77a3a, #8b4513); }
.av.bay { background: linear-gradient(135deg, #8a5636, #4b2a18); }
.av.black { background: linear-gradient(135deg, #4a4e5c, #1c1e26); }
.av.palomino { background: linear-gradient(135deg, #e3c47e, #b58b3a); }
.av.owner { background: linear-gradient(135deg, var(--navy-2), var(--navy-d)); }

.bar { height: 8px; background: #edf0f6; border-radius: 99px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--navy); transition: width .6s var(--ease); }
.anim .bar > span { animation: grow 1s var(--ease) both; }
@keyframes grow { from { width: 0; } }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span, .bar.over > span { background: var(--bad); }
.bar.near > span { background: var(--warn); }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; border-radius: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; transition: color .2s, border-color .2s; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; transition: background .15s; }
table.t tr.click:hover td { background: #f8f9fc; }
.end { text-align: end !important; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

/* ---------- Rounds ---------- */
.rounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 20px 18px; }
.round { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; background: #fff; }
.round:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.round .nm { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.round.done { background: linear-gradient(180deg, #f5fbf8, #fff); border-color: #cfeadd; }
.round.overdue { border-color: #f1c4bd; background: linear-gradient(180deg, #fdf3f1, #fff); }
.round.due { border-color: #f0d6ab; background: linear-gradient(180deg, #fefaf2, #fff); }

/* ---------- Feeding checklist ---------- */
.round-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.round-tab { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; display: flex; gap: 10px; align-items: center; text-align: start; transition: all .2s var(--ease); }
.round-tab.on { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 123, .12); }
.round-tab b { display: block; }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.fh { padding: 14px 16px; display: grid; gap: 12px; transition: opacity .3s, border-color .2s; }
.fh.away { opacity: .55; }
.fh.refused { border-color: #f1c4bd; }
.fh.partial { border-color: #f0d6ab; }
.fh-h { display: flex; gap: 12px; align-items: center; }
.fh-h .t { font-weight: 700; font-size: 15px; }
.fl { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: center; }
.fl .nm { display: flex; flex-direction: column; }
.fl .nm small { color: var(--muted); font-size: 12px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty input { width: 100%; border: 0; text-align: center; padding: 7px 4px; outline: none; font-weight: 600; min-width: 0; }
.qty span { padding: 0 8px; color: var(--muted); font-size: 12px; }
.qty.changed { border-color: var(--warn); background: var(--warn-l); }
.qty.changed input { background: transparent; }
.extra-row { display: grid; grid-template-columns: 1fr 96px 28px; gap: 8px; align-items: center; }
.icon-btn { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--bad-l); color: var(--bad); }
.sticky-confirm { position: sticky; bottom: 16px; margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--navy-d); color: #fff; border-radius: 14px; box-shadow: var(--sh-l); }
.anim .sticky-confirm { animation: rise .4s var(--ease) both; }
.sticky-confirm .muted { color: #b9c3dc; }
.done-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--ok-l); color: #0f6c4a; margin-bottom: 16px; }
.done-banner .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: pop .5s var(--ease) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } to { transform: none; opacity: 1; } }

/* ---------- Usage logger ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; transition: all .18s var(--ease); }
[dir=rtl] .chip { padding: 7px 7px 7px 12px; }
.chip .av { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.chip.plain { padding: 8px 14px; }
.chip.on { border-color: var(--navy); background: var(--sky-l); color: var(--navy); box-shadow: 0 0 0 2px rgba(30, 58, 123, .12); }
.chip[disabled] { opacity: .45; }
.chip small { color: var(--muted); font-weight: 500; }
.step { display: grid; gap: 10px; }
.step h4 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.step h4 i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 11px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { border: 0; background: #f6f7fb; width: 42px; height: 42px; font-size: 20px; color: var(--navy); }
.stepper input { width: 80px; border: 0; text-align: center; font-size: 18px; font-weight: 700; outline: none; }

/* ---------- Exercise ---------- */
.expill { display: inline-flex; align-items: center; gap: 3px; margin: 1px; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--sky-l); color: var(--navy); white-space: nowrap; }
.expill.lunge { background: var(--navy); color: #fff; }
.expill.warn { background: var(--warn-l); color: #a8650c; }
.expill.bad { background: var(--bad); color: #fff; }
.expill.skip { background: #eef0f4; color: var(--muted); text-decoration: line-through; }
table.exgrid td.c, table.exgrid th.c { text-align: center; padding: 8px 4px; min-width: 64px; }
.ex14 { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 14px; }
.ex14 .d { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 8px; background: var(--bg); min-height: 58px; align-content: start; }
.chip.cond-warn.on { border-color: var(--warn); background: var(--warn-l); color: #a8650c; }
.chip.cond-bad.on { border-color: var(--bad); background: var(--bad-l); color: var(--bad); }
@media (max-width: 860px) { .ex14 { grid-template-columns: repeat(7, 1fr); } }

/* ---------- Horses ---------- */
.horse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.hc { padding: 16px; display: grid; gap: 12px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; }
.hc:hover { transform: translateY(-3px); box-shadow: var(--sh-l); }
.hc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.hc .meta b { color: var(--ink); font-weight: 600; }
.mini { display: grid; gap: 6px; }
.mini .r { display: grid; grid-template-columns: 70px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; }

/* ---------- Drawer & modal ---------- */
#overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#overlay.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(15, 25, 55, .38); opacity: 0; transition: opacity .3s; }
#overlay.open .scrim { opacity: 1; }
.drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(680px, 100%); background: var(--bg); box-shadow: var(--sh-l); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .38s var(--ease); }
[dir=rtl] .drawer { transform: translateX(-105%); }
#overlay.open .drawer { transform: none; }
.drawer-h { display: flex; gap: 14px; align-items: center; padding: 20px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-b { padding: 18px 24px 40px; overflow-y: auto; flex: 1; }
.modal { position: absolute; top: 50%; left: 50%; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 40px); overflow-y: auto; background: #fff; border-radius: 18px; box-shadow: var(--sh-l); transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: all .3s var(--ease); }
.modal.wide { width: min(880px, calc(100% - 24px)); }
#overlay.open .modal { transform: translate(-50%, -50%); opacity: 1; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 18px 22px; display: grid; gap: 14px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.calc { background: var(--bg); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; font-size: 13px; }
.calc .row b { margin-inline-start: auto; }

/* ---------- Plan editor ---------- */
.plan-round { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.plan-round h5 { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.plan-line { display: grid; grid-template-columns: 1fr 110px 28px; gap: 8px; align-items: center; }

/* ---------- Invoice document ---------- */
.inv-doc { background: #fff; color: #111; padding: 34px 38px; font-size: 12.5px; line-height: 1.45; direction: ltr; }
.inv-doc span.ar { unicode-bidi: isolate; }
.inv-doc .ar { direction: rtl; font-family: "IBM Plex Sans Arabic", var(--font); }
.inv-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; border-bottom: 2px solid var(--navy); padding-bottom: 16px; }
.inv-top img { width: 110px; mix-blend-mode: multiply; }
.inv-top .ar { text-align: right; }
.inv-title { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 14px; }
.inv-title h2 { margin: 0; font-size: 20px; color: var(--navy); }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.inv-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.inv-box .k { color: #667; font-size: 11px; }
.inv-box .kv { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th { background: var(--navy); color: #fff; font-weight: 600; font-size: 11px; padding: 7px 8px; text-align: left; }
.inv-table th .ar { display: block; font-weight: 500; opacity: .85; }
.inv-table td { padding: 7px 8px; border-bottom: 1px solid #edf0f5; vertical-align: top; }
.inv-table td.r, .inv-table th.r { text-align: right; }
.inv-table tr.hrow td { background: var(--sky-l); font-weight: 700; color: var(--navy); }
.inv-table tr.sec td { color: #667; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 10px; border-bottom: 0; }
.inv-table tr.inc td { color: #4b7a63; }
.inv-table .d2 { color: #778; font-size: 11px; }
.inv-sum { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-top: 16px; align-items: start; }
.inv-tot .kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #edf0f5; }
.inv-tot .kv.big { font-size: 15px; font-weight: 800; color: var(--navy); border-bottom: 2px solid var(--navy); }
.qr { display: flex; gap: 12px; align-items: center; }
.qr svg { width: 110px; height: 110px; }
.stamp { display: inline-block; padding: 4px 10px; border: 2px solid currentColor; border-radius: 8px; font-weight: 800; letter-spacing: .08em; transform: rotate(-6deg); }
.stamp.paid { color: var(--ok); }
.stamp.unpaid { color: var(--bad); }
.stamp.draft { color: var(--muted); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--navy-d); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--sh-l); font-weight: 500; animation: toastIn .4s var(--ease) both; }
.toast.out { animation: toastOut .3s ease forwards; }
.toast .i { color: #7fe0b4; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Bottom nav (mobile) ---------- */
.bnav { display: none; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { height: calc(100vh - 64px); }
  .mobile-logo { display: block; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 17px; white-space: nowrap; }
  .lang-l { display: none; }
  .topbar .seg button { padding: 6px 9px; }
  .topbar .sub { display: none; }
  .view { padding: 6px 14px 30px; }
  .rounds, .round-tabs { grid-template-columns: 1fr; }
  .round-tabs { grid-template-columns: repeat(3, 1fr); }
  .round-tab { padding: 10px; flex-direction: column; text-align: center; gap: 4px; }
  .round-tab .small { display: none; }
  .feed-grid { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .bnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: #fff; border-top: 1px solid var(--line); z-index: 20; justify-content: space-around; align-items: center; }
  .bnav a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); text-decoration: none; padding: 6px 4px; cursor: pointer; }
  .bnav a.on { color: var(--navy); font-weight: 700; }
  .hide-m { display: none !important; }
  .inv-doc { padding: 18px; }
  .inv-top { grid-template-columns: 1fr; text-align: center; }
  .inv-top .ar { text-align: center; }
  .inv-meta, .inv-sum { grid-template-columns: 1fr; }
  #toasts { bottom: 78px; }
}

/* ---------- Print: only the invoice ---------- */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  html, body, .main, .shell { height: auto !important; overflow: visible !important; }
  #root { display: none; }
  #overlay, #overlay .modal { position: static !important; transform: none !important; max-height: none !important; overflow: visible !important; width: 100% !important; box-shadow: none !important; opacity: 1 !important; }
  .scrim, .modal-h, .modal-f { display: none !important; }
  .print-area { position: static; width: 100%; padding: 0 !important; }
  .inv-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-table tr.hrow td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =====================================================================
   v3 – login, roles, two stables, quick actions, settings
   ===================================================================== */
.bad-t { color: var(--bad); }
.link { color: var(--navy); font-weight: 600; cursor: pointer; }
.sdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.av.xl { width: 76px; height: 76px; font-size: 28px; }
.av.role-owner { background: linear-gradient(135deg, #c9a66b, #8a6a37); }
.av.role-admin { background: linear-gradient(135deg, var(--navy-2), var(--navy-d)); }
.av.role-staff { background: linear-gradient(135deg, #4f8fb8, #2c5f86); }
.av.role-groom { background: linear-gradient(135deg, #3aa57d, #1d7656); }
.badge.role-b-owner { background: var(--sand-l); color: #8a6a37; }
.badge.role-b-admin { background: var(--sky-l); color: var(--navy); }
.badge.role-b-staff { background: #e3eef6; color: #2c5f86; }
.badge.role-b-groom { background: var(--ok-l); color: var(--ok); }
.badge.pk-vip { background: linear-gradient(90deg, #1e3a7b, #2a4d9b); color: #fff; }
.badge.pk-small { background: var(--sky-l); color: var(--navy); }
.badge.pk-vip.basic, .badge.pk-small.basic { opacity: .85; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.1fr; background: #fff; }
.login-brand { background: radial-gradient(120% 90% at 20% 10%, #2a4d9b 0%, #132857 70%); color: #fff; display: grid; align-content: center; justify-items: center; gap: 10px; padding: 40px; text-align: center; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; inset: auto -20% -40% -20%; height: 60%; background: radial-gradient(closest-side, rgba(201,166,107,.25), transparent); }
.login-brand img { width: 200px; background: #fff; border-radius: 28px; padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: splashIn 1s var(--ease) both; }
.login-brand h1 { margin: 10px 0 0; font-size: 30px; letter-spacing: -.02em; }
.login-brand p { margin: 0; color: #c4cfe8; }
.login-stables { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; justify-content: center; position: relative; z-index: 1; }
.login-stables div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 10px 14px; display: grid; gap: 2px; text-align: start; font-weight: 600; min-width: 180px; }
.login-stables small { color: #b9c3dc; font-weight: 400; }
.login-panel { padding: 28px 40px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.login-step { margin: auto 0; display: grid; gap: 8px; animation: rise .45s var(--ease) both; max-width: 640px; width: 100%; align-self: center; }
.login-step h2 { margin: 0; font-size: 26px; }
.login-foot { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.user-card { display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; text-align: center; }
.user-card:hover { transform: translateY(-3px); box-shadow: var(--sh-l); border-color: var(--sky); }
.user-card .av { width: 52px; height: 52px; font-size: 18px; }
.user-card small { font-size: 11px; }
.pin-step { justify-items: center; text-align: center; max-width: 360px; }
.pin-step > .btn { justify-self: start; }
.pin-dots { display: flex; gap: 14px; margin: 8px 0 6px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--sky); transition: all .2s var(--ease); }
.pin-dots span.on { background: var(--navy); border-color: var(--navy); transform: scale(1.1); }
.pin-dots.shake { animation: shake .4s; }
.pin-dots.shake span { border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; }
.pinpad button { height: 64px; border-radius: 18px; border: 1px solid var(--line); background: #f7f8fb; font-size: 24px; font-weight: 600; display: grid; place-items: center; transition: transform .1s, background .2s; }
.pinpad button:active { transform: scale(.94); background: var(--sky-l); }

/* Shell bits */
.tb-title { min-width: 0; }
.tb-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stable-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--navy); }
.stable-seg button { display: inline-flex; align-items: center; gap: 7px; }
.stable-seg button.on .sdot { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.me-btn .av { width: 36px; height: 36px; font-size: 13px; transition: transform .2s; }
.me-btn:hover .av { transform: scale(1.06); }
.who { border: 0; background: transparent; width: 100%; border-radius: 12px; cursor: pointer; transition: background .2s; }
.who:hover { background: var(--bg); }
.who .flip, .who > svg { margin-inline-start: auto; color: var(--muted); }
.brand small { display: flex; align-items: center; gap: 6px; }
.view { transition: opacity .16s ease, transform .16s ease; }
.view.switching { opacity: 0; transform: translateY(6px); }
.fab { position: fixed; inset-inline-end: 26px; bottom: 26px; z-index: 15; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; box-shadow: 0 10px 30px rgba(30,58,123,.45); display: grid; place-items: center; transition: transform .2s var(--ease), box-shadow .2s; }
.fab:hover { transform: scale(1.07) rotate(90deg); }
.fab svg.i { width: 26px; height: 26px; stroke-width: 2.2; }
.sheet { position: absolute; left: 50%; bottom: 0; width: min(560px, 100%); transform: translate(-50%, 105%); background: #fff; border-radius: 22px 22px 0 0; padding: 14px 18px 26px; box-shadow: var(--sh-l); transition: transform .35s var(--ease); max-height: 85vh; overflow-y: auto; }
#overlay.open .sheet { transform: translate(-50%, 0); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 12px; font-size: 16px; }
.sheet .nav a { padding: 13px 12px; }
.modal.small-modal { width: min(360px, calc(100% - 24px)); }

/* Home */
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; margin: -4px 0 18px; }
.qa { display: inline-flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-weight: 600; color: var(--navy); box-shadow: var(--sh); transition: transform .2s var(--ease), box-shadow .2s; }
.qa:hover { transform: translateY(-2px); box-shadow: var(--sh-l); }
.qa svg.i { width: 20px; height: 20px; }
.qa.sand { background: var(--sand-l); border-color: #ead9bd; color: #7a5a2a; }
.company { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.stable-card { text-align: start; padding: 14px 16px; display: grid; gap: 12px; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.stable-card:hover { transform: translateY(-2px); box-shadow: var(--sh-l); }
.stable-card.on { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,123,.12); }
.sc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sc-grid small { display: block; color: var(--muted); font-size: 11px; }
.sc-grid b { font-size: 14px; display: flex; gap: 4px; align-items: center; }
.rd { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #d7dce6; }
.rd.done { background: var(--ok); } .rd.overdue { background: var(--bad); } .rd.due { background: var(--warn); }
.kpi.click { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi.click:hover { transform: translateY(-2px); box-shadow: var(--sh-l); }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.li-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--sky-l); color: var(--navy); flex: none; }
.li-ic.bad { background: var(--bad-l); color: var(--bad); } .li-ic.warn { background: var(--warn-l); color: #a8650c; } .li-ic.okc { background: var(--ok-l); color: var(--ok); }
.lvl { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lvl.bad { background: var(--bad); } .lvl.warn { background: var(--warn); } .lvl.ok { background: var(--ok); }
.li.dim { opacity: .6; }
.li.inactive { opacity: .5; }
.empty svg.i { vertical-align: -4px; color: var(--ok); }

/* Groom tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { border: 0; border-radius: 20px; padding: 22px 18px; color: #fff; display: grid; gap: 6px; justify-items: start; text-align: start; background: linear-gradient(135deg, var(--navy-2), var(--navy-d)); box-shadow: var(--sh-l); transition: transform .2s var(--ease); min-height: 140px; align-content: end; }
.tile:active { transform: scale(.97); }
.tile:hover { transform: translateY(-3px); }
.tile svg.i { width: 32px; height: 32px; margin-bottom: auto; opacity: .9; }
.tile b { font-size: 19px; }
.tile span { opacity: .85; font-size: 13px; }
.tile.ex { background: linear-gradient(135deg, #c9a66b, #8a6a37); }
.tile.log { background: linear-gradient(135deg, #3aa57d, #1d7656); }
.tiles.compact { grid-template-columns: repeat(2, 1fr); }
.tiles.compact .tile { min-height: 96px; padding: 16px; }
.tiles.compact .tile:not(.feed):not(.ex):not(.log) { background: linear-gradient(135deg, #5f6f94, #3a4560); }

/* Controls */
.seg.full { width: 100%; } .seg.full button { flex: 1; }
.seg.wrap { flex-wrap: wrap; }
.search { position: relative; min-width: 240px; }
.search .input { padding-inline-start: 36px; }
.search svg.i { position: absolute; inset-inline-start: 11px; top: 11px; color: var(--muted); }
.switch-row { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.switch { width: 46px; height: 26px; border-radius: 99px; border: 0; background: #cfd5e1; position: relative; transition: background .2s; padding: 0; }
.switch span { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: inset-inline-start .2s var(--ease); }
.switch.on { background: var(--ok); }
.switch.on span { inset-inline-start: 23px; }
.calc.sandbg { background: var(--sand-l); }

/* Horses */
.pk-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.pk-count { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; align-items: baseline; gap: 8px; }
.pk-count b { font-size: 22px; color: var(--navy); }
.pk-count span { color: var(--muted); font-size: 12px; }
.hc > .badge { justify-self: start; }
.hc .meta { grid-template-columns: 1fr 1fr; }

/* Packages & prices */
.pkg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pkg-card { padding: 16px; display: grid; gap: 10px; align-content: start; border-top: 4px solid var(--sky); }
.pkg-card.full { border-top-color: var(--sand); }
.pkg-price { display: flex; align-items: center; gap: 8px; }
.price-in { width: 130px; }
.price-in input { font-size: 16px; }
.pkg-card .price-in { width: 150px; }
.pkg-card .price-in input { font-size: 20px; font-weight: 800; color: var(--navy); }
.incl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.incl li { display: flex; gap: 6px; align-items: center; }
.incl li svg.i { width: 15px; height: 15px; color: var(--ok); }
.incl li.no svg.i { color: var(--warn); }
.allow { display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; }
table.t tr.grp td { background: #f7f8fb; font-weight: 700; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 14px; }
[dir=rtl] table.t tr.grp td { letter-spacing: 0; }
table.t td .price-in { margin-inline-start: auto; }
.pkg-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pkg-opt { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; display: grid; gap: 4px; text-align: start; transition: all .2s var(--ease); }
.pkg-opt span { color: var(--navy); font-weight: 800; font-size: 16px; }
.pkg-opt small { color: var(--muted); }
.pkg-opt.on { border-color: var(--navy); background: var(--sky-l); box-shadow: 0 0 0 3px rgba(30,58,123,.12); }
table.matrix td.c, table.matrix th.c { text-align: center; }
.yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok-l); color: var(--ok); }
.yes svg.i { width: 14px; height: 14px; }
.audit { max-height: 520px; overflow-y: auto; }
.audit .li { padding: 10px 20px; font-size: 13px; }

/* Invoice document additions */
.inv-doc .nv { color: var(--navy); font-size: 14px; }
.inv-tech { margin-top: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: #8a91a5; word-break: break-all; }
.qr-ph { width: 110px; height: 110px; border: 2px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.inv-table th, .inv-table td { font-size: 11.5px; }

@media (max-width: 1100px) {
  .pkg-grid, .pkg-pick { grid-template-columns: repeat(2, 1fr); }
  .company { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 26px 18px 30px; }
  .login-brand img { width: 120px; border-radius: 20px; }
  .login-brand h1 { font-size: 22px; }
  .login-stables { display: none; }
  .login-panel { padding: 18px; }
  .user-grid { grid-template-columns: repeat(2, 1fr); }
  .stable-seg button { padding: 6px 8px; font-size: 12px; }
  .stable-pill { padding: 5px 9px; font-size: 12px; }
  .stable-pill svg.i { display: none; }
  .topbar .icon-only { display: none; }
  .me-btn .av { width: 34px; height: 34px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 110px; }
  .sc-grid { grid-template-columns: repeat(2, 1fr); }
  .kpis.three { grid-template-columns: 1fr; }
  .pk-counts { grid-template-columns: repeat(2, 1fr); }
  .pkg-grid, .pkg-pick { grid-template-columns: 1fr; }
  .fab { bottom: 78px; inset-inline-end: 16px; width: 52px; height: 52px; }
  .quick-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .qa { flex: none; }
  .search { min-width: 0; flex: 1; }
}

/* Layout follows the content area width (sidebar-aware) */
.main { container-type: inline-size; container-name: main; }
.cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@container main (max-width: 980px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .pkg-grid, .pkg-pick { grid-template-columns: repeat(2, 1fr); }
}
@container main (max-width: 700px) {
  .company { grid-template-columns: 1fr; }
  .rounds { grid-template-columns: 1fr; }
  .round-tabs { grid-template-columns: repeat(3, 1fr); }
  .round-tab { flex-direction: column; text-align: center; gap: 4px; padding: 10px; }
  .round-tab .small { display: none; }
  .tiles { grid-template-columns: 1fr; }
  .pk-counts { grid-template-columns: repeat(2, 1fr); }
  .feed-grid { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}

.bnav a { position: relative; }
.bnav a .badge { position: absolute; top: 0; inset-inline-end: calc(50% - 22px); padding: 0 5px; min-width: 16px; height: 16px; font-size: 10px; justify-content: center; }
.inv-sum { grid-template-columns: 1fr 340px; }

/* =========================================================================
   v4 – owner vs school horses, consumption, sales, petty cash, classes
   ========================================================================= */
:root { --school: #2f7d5b; --school-l: #e3f3ea; }
.badge.school { background: var(--school-l); color: var(--school); }
.badge.own { background: var(--sky-l); color: var(--navy); }
.badge svg.i { width: 13px; height: 13px; }
.av.school { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--school); }
.hc.school { border-top: 3px solid var(--school); }
.hc.owner { border-top: 3px solid var(--navy); }
.ok-t { color: var(--ok); }
.opt { font-size: 11px; font-weight: 600; color: var(--sand); background: var(--sand-l); padding: 2px 7px; border-radius: 99px; }
.btn.bad { background: var(--bad); color: #fff; border-color: var(--bad); }
.card-f { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.big-tabs button { font-size: 14.5px; padding: 10px 16px; display: inline-flex; align-items: center; gap: 8px; }

/* horse picker grouped by type */
.pick-grp + .pick-grp { margin-top: 12px; }
.pick-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
[dir=rtl] .pick-h { letter-spacing: 0; text-transform: none; }
.pick-h svg.i { width: 15px; height: 15px; }

/* consumption rows */
.cons-list { display: grid; gap: 8px; }
.cons-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .2s, background .2s; }
.cons-row.on { border-color: var(--navy); background: #f7f9fe; }
.cons-row .nm { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cons-row .nm b { font-size: 15px; }
.cons-row .nm small { color: var(--muted); font-size: 12px; }
.al { font-size: 12px; font-weight: 600; color: var(--ok); }
.al.over { color: var(--bad); }
.al.charged { color: var(--sand); }
.cons-row .stepper button { width: 46px; height: 46px; }
.cons-row .stepper input { width: 56px; }

/* class load pills */
.load { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--ok-l); color: var(--ok); }
.load.warn { background: var(--warn-l); color: #a8650c; }
.load.bad { background: var(--bad-l); color: var(--bad); }

/* sales */
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.prod { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.prod.on { border-color: var(--navy); background: #f7f9fe; }
.prod .nm { flex: 1; min-width: 0; display: grid; }
.prod .nm small { color: var(--muted); font-size: 12px; }
.prod .stepper button { width: 36px; height: 36px; font-size: 18px; }
.prod .stepper input { width: 44px; font-size: 15px; }
.calc .row.big { font-size: 16px; font-weight: 700; }
.cart { position: sticky; top: 76px; }

/* petty cash */
.cash-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #fff, var(--sky-l)); }
.cash-hero .big { font-size: 30px; font-weight: 800; color: var(--navy); margin: 2px 0; }
.thumb { border: 1px solid var(--line); border-radius: 8px; padding: 0; width: 38px; height: 38px; overflow: hidden; background: #fff; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.receipt-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.receipt-in img { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.receipt-in label.btn { cursor: pointer; }
.receipt-big { max-width: 100%; max-height: 65vh; display: block; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); }

/* dashboard */
.occ { display: grid; gap: 10px; margin-top: 10px; }
.company-tot { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-bottom: 18px; font-size: 13px; }
.company-tot b { color: var(--navy); }
.kpi .foot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.stock-t td, table.stock-t th { white-space: nowrap; }

@container main (max-width: 700px) {
  .prods { grid-template-columns: 1fr; }
  .cart { position: static; }
  .cash-hero .btn { width: 100%; justify-content: center; }
  .cons-row { padding: 10px; }
}
@media (max-width: 760px) {
  .big-tabs button { flex: 1; justify-content: center; padding: 10px 8px; font-size: 13.5px; }
}
.pk-counts { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } .pk-count b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.calc:not(:has(> .row, > div, > b, > label, > button)) { display: block; } .calc > svg.i { vertical-align: -4px; margin-inline-end: 6px; }
.cols > *, .stack > * { min-width: 0; }
.repeat-btn { white-space: normal; text-align: start; height: auto; padding-block: 8px; }
.repeat-btn > span { display: grid; }
.repeat-btn small { font-size: 11.5px; font-weight: 500; }
.chips { min-width: 0; }

/* =========================================================================
   v5 – live server, ERP claims, reports
   ========================================================================= */
#busybar { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 200; pointer-events: none; opacity: 0; background: linear-gradient(90deg, transparent, var(--sand), var(--navy), transparent); background-size: 200% 100%; transition: opacity .2s; }
body.busy #busybar { opacity: 1; animation: busy 1s linear infinite; }
body.busy [data-act] { cursor: progress; }
@keyframes busy { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.input.lg { font-size: 17px; padding: 12px 14px; }
.pinpad button.go { background: var(--navy); color: #fff; border-color: var(--navy); }
.pinpad button[disabled] { opacity: .35; cursor: default; }
.pin-dots { flex-wrap: wrap; justify-content: center; max-width: 240px; }
.demo-flag { margin: 0 14px 6px; padding: 4px 10px; border-radius: 99px; background: var(--warn-l); color: #a8650c; font-size: 11.5px; font-weight: 700; text-align: center; }
.profit-strip { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; background: linear-gradient(135deg, #fff, var(--ok-l)); }
.profit-strip .big { font-size: 28px; font-weight: 800; color: var(--navy); }
.ps-cells { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 22px; flex: 1; }
.ps-cells small { display: block; color: var(--muted); font-size: 11.5px; }
.ps-cells b { font-size: 14px; }
.big2 { font-size: 20px; font-weight: 800; color: var(--navy); }
.chart { width: 100%; height: auto; display: block; }
.chart .b-rev { fill: var(--navy); }
.chart .b-cost { fill: var(--sand); opacity: .85; }
.chart .l-profit { fill: none; stroke: var(--ok); stroke-width: 2.5; }
.chart .d-profit { fill: #fff; stroke: var(--ok); stroke-width: 2.5; }
.chart .axis { stroke: var(--line); }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.lg-rev { background: var(--navy); } .lg-cost { background: var(--sand); } .lg-profit { background: var(--ok); }
.erp-box { border: 1.5px dashed var(--sand); background: var(--sand-l); border-radius: 12px; padding: 10px 14px; margin: 12px 0; display: grid; gap: 4px; }
.erp-box .big3 { font-size: 18px; font-weight: 800; color: var(--navy); }
.inv-doc.slip { max-width: 420px; margin: 0 auto; }
.team { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.team svg.i { width: 14px; height: 14px; }
.cat-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cat-seg .badge { padding: 0 6px; font-size: 11px; }
.items-t td { vertical-align: top; }
.items-t select.input { min-width: 96px; }
@container main (max-width: 700px) {
  .ps-cells { grid-template-columns: repeat(2, auto); }
  .profit-strip .btn { width: 100%; justify-content: center; }
}
@media print { #busybar, #toasts { display: none !important; } }
.cat-seg { min-width: 0; }
.cat-seg button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.25; padding-inline: 6px; text-align: center; }
@container main (max-width: 520px) { .cat-seg button svg.i { display: none; } .cat-seg button { font-size: 12.5px; } }

/* v5.1 – e-mail code sign-in */
.code-step { justify-items: center; text-align: center; }
.mail-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--sky-l); color: var(--navy); display: grid; place-items: center; }
.mail-ic svg.i { width: 30px; height: 30px; }
.code-in { position: relative; display: block; width: 100%; max-width: 340px; cursor: text; }
.code-field { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; caret-color: transparent; }
.code-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-cells i { font-style: normal; height: 58px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; display: grid; place-items: center; font: 700 26px/1 "SF Mono", Menlo, Consolas, monospace; color: var(--navy); transition: border-color .15s, box-shadow .15s; }
.code-in:focus-within .code-cells i.cur { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30, 58, 123, .15); }
.demo-code { background: var(--warn-l); color: #8a560c; padding: 8px 14px; border-radius: 12px; font-size: 13px; }
.demo-code b { font-size: 17px; letter-spacing: 3px; }
.user-card small svg.i { width: 13px; height: 13px; vertical-align: -2px; }

/* =========================================================================
   v6 – depth, 3D & motion (friendly, light, never in the way)
   ========================================================================= */
:root {
  --depth: 0 1px 1px rgba(20, 35, 80, .04), 0 4px 10px rgba(20, 35, 80, .05), 0 12px 28px rgba(20, 35, 80, .06);
  --depth-hi: 0 2px 4px rgba(20, 35, 80, .06), 0 16px 32px rgba(20, 35, 80, .13), 0 34px 70px rgba(20, 35, 80, .12);
  --spring: cubic-bezier(.2, .9, .25, 1.15);
}
body { background: radial-gradient(1100px 560px at 100% -10%, #e6ecfa 0%, transparent 60%), radial-gradient(900px 520px at -10% 110%, #f5eee2 0%, transparent 55%), var(--bg); background-attachment: fixed; }
.card { box-shadow: var(--depth); }

/* 3D tilt + soft light that follows the pointer */
:is(.kpi, .tile, .stable-card, .hc, .qa, .pkg-card, .profit-strip, .user-card, .pk-count, .prod, .cons-row) {
  position: relative; transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)) scale(var(--press, 1));
  transition: transform .55s var(--spring), box-shadow .3s ease, border-color .2s;
}
:is(.kpi, .tile, .stable-card, .hc, .qa, .pkg-card, .profit-strip, .user-card, .pk-count, .prod, .cons-row)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .35s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(30, 58, 123, .09), rgba(30, 58, 123, 0) 55%);
}
.tile::before, .profit-strip::before { background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 55%); }
.tilting { transition: transform .09s linear, box-shadow .3s ease !important; }
.tilting::before { opacity: 1; }
:is(.kpi.click, .tile, .stable-card, .hc, .qa, .pkg-card, .profit-strip, .user-card, .pk-count, .prod):hover,
.kpi.click:hover, .hc:hover, .user-card:hover, .qa:hover, .stable-card:hover, .tile:hover {
  --lift: -4px; box-shadow: var(--depth-hi);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)) scale(var(--press, 1));
}
:is(.kpi.click, .tile, .stable-card, .hc, .qa, .user-card, .prod):active, .tile:active { --press: .965; --lift: 0px; transition-duration: .12s; }

/* Pressable buttons with real depth */
.btn { box-shadow: 0 2px 0 var(--line), 0 3px 8px rgba(20, 35, 80, .05); transition: transform .12s ease, box-shadow .12s ease, background .2s; }
.btn:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 0 0 var(--line), 0 1px 3px rgba(20, 35, 80, .06); }
.btn.ghost { box-shadow: none; }
.btn.pri { background: linear-gradient(180deg, #2f56a8, #1e3a7b); box-shadow: 0 3px 0 #132857, 0 10px 20px rgba(30, 58, 123, .26); }
.btn.pri:hover { background: linear-gradient(180deg, #3560b6, #22418a); }
.btn.pri:active:not([disabled]) { transform: translateY(3px); box-shadow: 0 0 0 #132857, 0 3px 8px rgba(30, 58, 123, .2); }
.btn.ok { background: linear-gradient(180deg, #22ad7a, #1a8a60); box-shadow: 0 3px 0 #136b4a, 0 10px 20px rgba(29, 154, 108, .25); }
.btn.ok:active:not([disabled]) { transform: translateY(3px); box-shadow: 0 0 0 #136b4a; }
.btn[disabled] { box-shadow: none; }
.chip { transition: transform .25s var(--spring), background .2s, border-color .2s, box-shadow .2s; }
.chip.on { box-shadow: 0 6px 14px rgba(30, 58, 123, .18); transform: translateY(-1px); }
.chip:active:not([disabled]) { transform: scale(.94); }
.stepper button { transition: transform .15s var(--spring), background .2s; }
.stepper button:active { transform: scale(.86); background: var(--sky-l); }
.seg button { transition: background .25s, color .25s, box-shadow .25s, transform .2s var(--spring); }
.seg button.on { box-shadow: 0 4px 12px rgba(20, 35, 80, .14); }
.tile { position: relative; overflow: hidden; box-shadow: 0 6px 0 -2px rgba(0, 0, 0, .12), 0 20px 40px rgba(19, 40, 87, .25); }
.tile svg.i { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); transition: transform .5s var(--spring); }
.tile:hover svg.i { transform: translateZ(30px) scale(1.12) rotate(-6deg); }
.qa svg.i { transition: transform .45s var(--spring); }
.qa:hover svg.i { transform: scale(1.18) rotate(-8deg); }

/* Friendly greeting */
.hero { align-items: center; }
.hello-ic { font-size: 38px; line-height: 1; display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: #fff; box-shadow: var(--depth); animation: hello 3.2s ease-in-out infinite; flex: none; }
@keyframes hello { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-6deg); } }

/* Drag to rearrange */
[data-sort] > * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.drag-ghost { position: fixed !important; z-index: 300; margin: 0 !important; pointer-events: none; transform: rotate(2.5deg) scale(1.05) !important; box-shadow: 0 30px 60px rgba(20, 35, 80, .28) !important; transition: none !important; opacity: .97; }
.drag-src { opacity: .3; outline: 2px dashed var(--sky); outline-offset: -2px; box-shadow: none !important; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.tip-drag { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: -4px 0 16px; border-radius: 14px; background: linear-gradient(135deg, #fff, var(--sky-l)); border: 1px dashed var(--sky); color: var(--navy); font-size: 13px; font-weight: 600; animation: rise .6s var(--ease) both .4s; }
.tip-drag span { flex: 1; }
.tip-drag > svg.i { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

/* 3D page entrance */
@keyframes rise { from { opacity: 0; transform: perspective(1000px) translateY(18px) rotateX(9deg) scale(.985); } to { opacity: 1; transform: none; } }
.view.anim > * { animation-duration: .6s; transform-origin: 50% 0; }
#view { view-transition-name: view; }
::view-transition-old(view) { animation: vtOut .18s ease both; }
::view-transition-new(view) { animation: vtIn .3s var(--ease) both; }
::view-transition-group(root) { animation-duration: .18s; }
@keyframes vtOut { to { opacity: 0; transform: scale(.985) translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; } }
.bnav a.on svg.i, .nav a.on svg.i { animation: pop .45s var(--spring); }

/* Sign-in: floating 3D logo with parallax */
.login-brand { perspective: 1000px; }
.login-brand > :not(.ring):not(.orb) { position: relative; z-index: 2; }
.logo3d { transform: rotateY(calc(var(--px, 0) * 28deg)) rotateX(calc(var(--py, 0) * -28deg)); transform-style: preserve-3d; transition: transform .35s ease-out; }
.login-brand .logo3d img { animation: splashIn 1s var(--ease) both, bob 6s ease-in-out 1s infinite; box-shadow: 0 30px 70px rgba(0, 0, 0, .35), 0 0 0 8px rgba(255, 255, 255, .06); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.ring { position: absolute; left: 50%; top: 45%; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .11); pointer-events: none; z-index: 0; }
.ring.r1 { width: 420px; height: 420px; margin: -210px 0 0 -210px; transform: translate(calc(var(--px, 0) * -24px), calc(var(--py, 0) * -24px)); transition: transform .4s ease-out; }
.ring.r2 { width: 680px; height: 680px; margin: -340px 0 0 -340px; border-style: dashed; border-color: rgba(201, 166, 107, .16); animation: spin 90s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 1; background: radial-gradient(circle at 32% 30%, #fff 0%, #f3dfb8 22%, #b8925a 55%, rgba(184, 146, 90, 0) 72%); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .5s ease-out; }
.orb.o1 { width: 74px; height: 74px; top: 14%; inset-inline-start: 14%; transform: translate(calc(var(--px, 0) * 60px), calc(var(--py, 0) * 60px)); animation: drift 9s ease-in-out infinite; }
.orb.o2 { width: 44px; height: 44px; bottom: 18%; inset-inline-end: 16%; transform: translate(calc(var(--px, 0) * -80px), calc(var(--py, 0) * -80px)); animation: drift 7s ease-in-out -2s infinite; background: radial-gradient(circle at 32% 30%, #fff 0%, #c9d6f5 25%, #5b7cc4 58%, rgba(91, 124, 196, 0) 74%); }
.orb.o3 { width: 26px; height: 26px; top: 28%; inset-inline-end: 22%; transform: translate(calc(var(--px, 0) * 110px), calc(var(--py, 0) * 110px)); animation: drift 11s ease-in-out -5s infinite; }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -16px; } }
.login-panel .login-step { animation: rise .55s var(--ease) both; }
.user-card { transition: transform .45s var(--spring), box-shadow .3s, border-color .2s; }

/* Confetti */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }

/* Overlays feel physical */
.drawer-h, .sheet-h { touch-action: none; }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -4px auto 10px; }
.modal { transition: transform .35s var(--spring), opacity .25s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  :is(.kpi, .tile, .stable-card, .hc, .qa, .pkg-card, .profit-strip, .user-card, .pk-count, .prod, .cons-row) { transform: none !important; }
}

/* v7 – billing cycles, allowance override, away */
.allow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 12px; border-radius: 12px; background: var(--sand-l); }
.allow-grid .qty { width: 100%; }
.away-hist { font-size: 13px; }
.away-hist summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.away-hist .row { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.calc.badbg { background: var(--bad-l); }
.li.dim { opacity: .7; }

/* v7 – guided tour */
.tour { position: fixed; inset: 0; z-index: 500; animation: tourIn .25s ease both; }
.tour.out { opacity: 0; transition: opacity .25s; }
@keyframes tourIn { from { opacity: 0; } }
.tour-catch { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(10, 20, 45, .58), 0 0 0 3px rgba(255, 255, 255, .9), 0 0 30px 6px rgba(184, 146, 90, .55); pointer-events: none; transition: all .4s cubic-bezier(.2, .8, .2, 1); }
.tour.center .tour-spot { box-shadow: 0 0 0 9999px rgba(10, 20, 45, .58); }
.tour-tip { position: fixed; background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: 0 24px 60px rgba(10, 20, 45, .35); transition: left .4s cubic-bezier(.2, .8, .2, 1), top .4s cubic-bezier(.2, .8, .2, 1); }
.tour-tip.pop { animation: tipPop .4s cubic-bezier(.2, .9, .25, 1.2) both; }
@keyframes tipPop { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.tour-tip h3 { margin: 4px 0 6px; font-size: 17px; color: var(--navy); }
.tour-tip p { margin: 0; color: var(--ink-2); line-height: 1.6; font-size: 14px; }
.tour-top { display: flex; align-items: center; justify-content: space-between; }
.tour-count { font-size: 12px; font-weight: 700; color: var(--sand); background: var(--sand-l); padding: 2px 9px; border-radius: 99px; }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 12px; flex-wrap: wrap; }
.tour-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: all .3s; }
.tour-dots i.past { background: var(--sky); }
.tour-dots i.on { width: 20px; background: var(--navy); }
.tour-btns { display: flex; justify-content: space-between; gap: 10px; }
.tour-btns .btn { flex: 1; justify-content: center; }

/* v8: calm, steady screen */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.av.round { padding: 0; border: 0; gap: 0; cursor: inherit; background-clip: padding-box; line-height: 1; }
.av.round:hover { transform: none; box-shadow: none; }
.me-btn:hover .av.round { transform: scale(1.06); }
.av.school.round { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--school); }
/* v8: report export */
.exp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.exp { display: grid; gap: 4px; justify-items: start; text-align: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.exp:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.exp svg { width: 22px; height: 22px; }
.exp b { font-size: 15px; } .exp span { font-size: 12px; color: var(--muted); }
.exp.pdf { background: linear-gradient(135deg, var(--navy-2), var(--navy-d)); color: #fff; border-color: transparent; }
.exp.pdf span { color: rgba(255,255,255,.8); }
.exp.xls svg { color: #1d7656; } .exp.csv svg { color: var(--muted); }
.exp.loading, .btn.loading { opacity: .6; pointer-events: none; }
.round-tab.on { border-color: var(--navy); box-shadow: 0 0 0 3px var(--sky-l); }
@media (max-width: 640px) { .exp-grid { grid-template-columns: 1fr; } }
/* v9: passwords */
.pw-in { position: relative; display: block; }
.pw-in .input { width: 100%; padding-inline-end: 48px; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { background: var(--bg); color: var(--navy); }
.pw-eye svg { width: 20px; height: 20px; }
.pw-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 4px; } .pw-rules li svg { width: 14px; height: 14px; }
.pw-rules li.ok { color: var(--ok, #1d7656); }
.trust-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.trust-row input { width: 18px; height: 18px; accent-color: var(--navy); }
.login-step.stack label.f { text-align: start; }
/* v10: iPhone / Android home-screen app – keep clear of rounded corners, the notch and the home indicator */
:root { --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
@media (max-width: 860px) {
  .main { height: calc(100dvh - 64px - var(--sab)); }
  .topbar { padding-top: max(12px, var(--sat)); padding-left: max(16px, var(--sal)); padding-right: max(16px, var(--sar)); }
  .bnav { height: calc(64px + var(--sab)); padding: 0 max(14px, calc(var(--sal) + 10px)) var(--sab) max(14px, calc(var(--sar) + 10px)); align-items: center; }
  .bnav a { flex: 1; min-width: 0; text-align: center; }
  .bnav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .fab { bottom: calc(78px + var(--sab)); inset-inline-end: max(16px, calc(var(--sar) + 12px)); }
  .sheet { padding-bottom: calc(14px + var(--sab)); }
  .toasts, #toasts { bottom: calc(84px + var(--sab)) !important; }
}
@media (display-mode: standalone) and (max-width: 860px) {
  .bnav { border-top-left-radius: 22px; border-top-right-radius: 22px; box-shadow: 0 -6px 24px rgba(20,35,80,.06); }
}
/* v11: bell, tasks, notifications, events, access matrix, hours */
.bell-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--navy); cursor: pointer; flex: none; }
.bell-btn svg.i { width: 20px; height: 20px; }
.bell-btn.has svg.i { animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(8deg); } 96% { transform: rotate(-4deg); } }
.bell-n { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: #d9473a; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.notif-sheet { max-height: 88vh; }
.notif-list { display: grid; gap: 6px; }
.notif { display: flex; gap: 10px; align-items: flex-start; text-align: start; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.notif.unread { background: linear-gradient(135deg, #f3f7ff, #fff); border-color: #cddbf5; }
.notif .n-b { display: grid; gap: 2px; min-width: 0; }
.n-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--sky-l, #eaf1fb); color: var(--navy); flex: none; }
.n-ic.task { background: #fdf1dc; color: #8a5a12; } .n-ic.taskDone { background: #e6f5ee; color: #1d7656; }
.push-box { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--bg); margin: 8px 0; flex-wrap: wrap; }
.push-box.on { background: #e6f5ee; } .push-box.denied, .push-box.no { background: #fbe9e6; } .push-box.home { background: #fdf1dc; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 14px; }
.task.hi { border-inline-start: 4px solid #d9473a; } .task.late { background: linear-gradient(180deg, #fdf4f2, #fff); }
.task.done .tk-t { text-decoration: line-through; color: var(--muted); } .task.cancelled { opacity: .6; }
.tk-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #b9c3d6; background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; margin-top: 1px; color: #fff; transition: all .2s var(--ease); }
.tk-check:hover:not(:disabled) { border-color: #2f9c72; transform: scale(1.08); }
.task.done .tk-check { background: #2f9c72; border-color: #2f9c72; }
.tk-check svg.i { width: 16px; height: 16px; stroke-width: 3; }
.tk-b { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tk-meta { gap: 10px; align-items: center; } .tk-meta svg.i { width: 14px; height: 14px; vertical-align: -2px; }
.avs { display: inline-flex; } .avs .av { margin-inline-end: -6px; box-shadow: 0 0 0 2px #fff; }
.sand-t { color: #8a5a12; font-weight: 600; }
.ev { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px; align-items: start; }
.ev.cancelled { opacity: .55; }
.ev-date { display: grid; justify-items: center; background: linear-gradient(135deg, var(--navy-2, #2a4d9b), var(--navy-d, #132857)); color: #fff; border-radius: 14px; padding: 8px 4px; }
.ev-date b { font-size: 24px; line-height: 1; } .ev-date span { font-size: 12px; opacity: .9; } .ev-date small { font-size: 11px; opacity: .8; margin-top: 2px; }
.ev-b { display: grid; gap: 4px; min-width: 0; } .ev-b svg.i { width: 14px; height: 14px; vertical-align: -2px; }
.ev-m { display: grid; justify-items: end; gap: 4px; min-width: 150px; }
.ev-m .bar { width: 140px; }
.badge.navy { background: #e3eaf8; color: var(--navy); }
@media (max-width: 640px) { .ev { grid-template-columns: 54px 1fr; } .ev-m { grid-column: 1 / -1; justify-items: start; } }
/* access matrix */
.ax-wrap { overflow: auto; max-height: 72vh; }
.ax { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.ax th, .ax td { padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.ax thead th { position: sticky; top: 0; z-index: 2; vertical-align: bottom; min-width: 104px; }
.ax .ax-sticky { position: sticky; inset-inline-start: 0; z-index: 1; min-width: 210px; max-width: 260px; text-align: start; box-shadow: 1px 0 0 var(--line); }
.ax thead .ax-sticky { z-index: 3; }
.ax tr.ax-g td { background: var(--bg); font-weight: 700; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.ax-h { display: grid; justify-items: center; gap: 2px; text-align: center; } .ax-h small { color: var(--muted); font-weight: 500; font-size: 11px; }
.ax td.c { text-align: center; }
.ax-cell { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid #dfe4ee; background: #fff; color: #c3cad8; display: inline-grid; place-items: center; cursor: pointer; transition: all .15s var(--ease); }
.ax-cell svg.i { width: 16px; height: 16px; stroke-width: 2.6; }
.ax-cell.on { background: #e6f5ee; border-color: #9fd6bd; color: #1d7656; }
.ax-cell.custom { border-color: #e0a43a; box-shadow: 0 0 0 2px #fdf1dc; } .ax-cell.on.custom { background: #fdf1dc; color: #8a5a12; } .ax-cell.custom:not(.on) { color: #b2392b; background: #fdf4f2; }
.ax-cell:hover:not(:disabled) { transform: scale(1.1); } .ax-cell:disabled { opacity: .45; cursor: not-allowed; }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; } .ax-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid #dfe4ee; vertical-align: -2px; }
.ax-dot.on { background: #e6f5ee; border-color: #9fd6bd; } .ax-dot.custom { border-color: #e0a43a; background: #fdf4f2; } .ax-dot.on.custom { background: #fdf1dc; }
.link-btn { border: 0; background: none; color: var(--navy); font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 6px; }
.acc-g { display: grid; gap: 4px; align-content: start; }
.acc-row { display: flex; align-items: center; gap: 8px; text-align: start; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.acc-row .acc-box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #b9c3d6; display: grid; place-items: center; color: #fff; flex: none; }
.acc-row.on .acc-box { background: #2f9c72; border-color: #2f9c72; } .acc-row .acc-box svg.i { width: 12px; height: 12px; stroke-width: 3.2; }
.acc-row.custom { border-color: #e0a43a; } .acc-row:disabled { opacity: .5; cursor: not-allowed; } .acc-row .badge { margin-inline-start: auto; }
.chip-x { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; color: inherit; } .chip-x svg.i { width: 12px; height: 12px; }
.input.bad-script { border-color: #d9473a; box-shadow: 0 0 0 3px #fbe9e6; } .script-hint { display: block; margin-top: 4px; }
.av.role-manager { background: linear-gradient(135deg, var(--navy-2, #2a4d9b), var(--navy-d, #132857)); }
.av.role-employee { background: linear-gradient(135deg, #4f8fb8, #2c5f86); }
/* v12: integrations */
.ig-f { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.ig-f .row { gap: 8px; } .ig-f textarea { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.ig-add { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; background: var(--bg); }
.ig-card select.input { max-width: 420px; }
.ig-mode { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.ig-mode .btn { flex: none; }
.ig-body { padding: 14px 18px 16px; }
@media (max-width: 860px) {
  .topbar { gap: 8px; }
  .bell-btn { width: 36px; height: 36px; border-radius: 11px; }
  .topbar .stable-seg { min-width: 0; flex-shrink: 1; overflow: hidden; }
  .topbar .stable-seg button { min-width: 0; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
}
@media (max-width: 380px) { .topbar .stable-seg button { max-width: 92px; padding: 6px 7px; } .topbar .mobile-logo { width: 34px; } }
.li.wrap, .hours-row { flex-wrap: wrap; row-gap: 8px; }
.hours-row .input[type=time], .li.wrap .input[type=time] { width: 112px; }
@media (max-width: 640px) { .pkg-grid { grid-template-columns: 1fr !important; } .hours-row b { min-width: 0 !important; flex: 1 1 100%; } }
@media (max-width: 640px) { .hours-row .input[type=time] { width: 100px; padding-inline: 8px; } }
@media (max-width: 640px) {
  .seg.full { display: flex; } .seg.full button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; }
  .li { flex-wrap: wrap; row-gap: 6px; }
}
/* v13: backups, integrations grid, settings tabs */
.bk-li, .bk-file { align-items: center; }
.bk-t { flex: 1; min-width: 0; } .bk-t b { overflow-wrap: anywhere; } .bk-t .s { overflow-wrap: anywhere; }
.bk-body { padding: 14px 18px 18px; }
.bk-g { display: grid; gap: 6px; } .bk-gh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bk-g .list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; } .bk-g .list .li:first-child { border-top: 0; }
.bk-file .s svg.i { width: 12px; height: 12px; vertical-align: -1px; }
.ig-grid { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1200px) { .ig-grid { grid-template-columns: 1fr 1fr; } .ig-grid .ig-card { margin-bottom: 0 !important; } }
.ig-card .ig-f .input, .ig-card textarea { min-width: 0; }
@media (min-width: 861px) { .view .tabs { flex-wrap: wrap; overflow: visible; row-gap: 2px; } }
@media (max-width: 860px) { .view .tabs { scroll-padding-inline: 16px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); padding-inline: 4px; } }
.ig-body .seg { width: fit-content; max-width: 100%; }
.ig-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.ig-add-grid > label:last-child { grid-column: 1 / -1; }
@media (max-width: 520px) { .ig-add-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .view { padding-bottom: calc(96px + var(--sab, 0px)); } }
.bk-now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--sky-l, #eaf1fb); }
.bk-now .btn { flex: none; }
/* v13: comfortable tap targets on phones (≈44 px) */
@media (max-width: 860px) {
  .btn { min-height: 44px; } .btn.sm { min-height: 40px; } .btn.lg { min-height: 50px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  .seg button { min-height: 40px; } .tabs button { min-height: 44px; }
  .chip { min-height: 36px; } .user-card, .round-tab { min-height: 44px; }
  .bnav a { min-height: 52px; justify-content: center; }
}
/* v13: rows and drawer headers never squeeze text to a sliver on phones */
@media (max-width: 640px) {
  .li > div[style*="flex:1"], .li > div[style*="flex: 1"] { flex: 1 1 150px !important; }
  .drawer-h { flex-wrap: wrap; row-gap: 10px; }
  .drawer-h > div[style*="flex:1"] { flex: 1 1 170px !important; min-width: 0; }
  .drawer-h .av.lg { width: 52px; height: 52px; font-size: 20px; }
  .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
}
/* bigger invisible hit area for on/off switches */
.switch { position: relative; }
.switch::after { content: ''; position: absolute; inset: -9px -6px; }
@media (max-width: 640px) {
  .drawer-h > .av { order: 0; } .drawer-h > div[style*="flex:1"] { order: 1; } .drawer-h > [data-act="close"] { order: 2; } .drawer-h > .btn:not([data-act="close"]), .drawer-h > .row { order: 3; }
  .li > b.num:not(:first-child) { margin-inline-start: auto; }
}
.switch { flex-shrink: 0; }
.search { flex: 1 1 220px; } .search .input { width: 100%; }
.row:has(> .search) { flex-wrap: wrap; }
/* v14: class plans, meals, notices */
.av.role-coach { background: linear-gradient(135deg, #7a3e9d, #4d2466); } .badge.role-b-coach { background: #f1e8f7; color: #5c2d78; }
.plans-b { padding: 8px 14px 14px; display: grid; gap: 10px; } .plans-h { font-weight: 700; color: var(--navy); font-size: 13px; text-transform: uppercase; letter-spacing: .3px; margin-top: 4px; }
.plans-card .card-h { flex-wrap: wrap; row-gap: 8px; }
.plan { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; padding: 12px; align-items: start; box-shadow: none; border: 1px solid var(--line); }
.plan.out { border-color: #e0a43a; background: linear-gradient(135deg, #fefaf2, #fff); } .plan.done { opacity: .78; } .plan.cancelled, .plan.skipped { opacity: .55; }
.plan-t { display: grid; justify-items: center; background: var(--bg); border-radius: 12px; padding: 8px 4px; } .plan-t b { font-size: 16px; } .plan-t small { color: var(--muted); }
.plan-b { display: grid; gap: 4px; min-width: 0; } .plan-b svg.i { width: 14px; height: 14px; vertical-align: -2px; }
.plan-a { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 640px) { .plan { grid-template-columns: 54px 1fr; } .plan-a { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } .plan-a .btn { flex: 1 1 auto; } }
.meals { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.meal { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.meal.ok { background: #e6f5ee; border-color: #9fd6bd; color: #1d7656; } .meal.sand { background: #fdf1dc; border-color: #ecc98b; color: #8a5a12; } .meal.bad { background: #fbe9e6; border-color: #f1b2a8; color: #b2392b; }
@media (max-width: 860px) { button.meal { min-height: 38px; padding: 6px 12px; } }
.feed-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.feed-opt { display: grid; justify-items: center; gap: 4px; padding: 14px 8px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 22px; cursor: pointer; }
.feed-opt span { font-size: 13px; font-weight: 600; } .feed-opt.on.all { border-color: #2f9c72; background: #e6f5ee; } .feed-opt.on.some { border-color: #e0a43a; background: #fdf1dc; } .feed-opt.on.none { border-color: #d9473a; background: #fbe9e6; }
.chip.warnchip { border-color: #ecc98b; }
.nt-lang { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.sched { display: grid; gap: 4px; margin-bottom: 10px; } .sched .li { padding: 8px 4px; }

/* v15 – empty Arabic boxes: show the hint right-to-left (dir=auto falls back to LTR when empty) */
html[dir=rtl] .input[dir=auto]:placeholder-shown { direction: rtl; unicode-bidi: isolate; text-align: right; }
@media (max-width: 600px) { .tk-check { width: 34px; height: 34px; } }
.av.role-other { background: linear-gradient(135deg, #4a7d6e, #2c5246); } .badge.role-b-other { background: #e6f1ed; color: #2c5246; }

/* v16 – feeding */
.tile.meal { background: linear-gradient(135deg, #4a7d6e, #2c5246); }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.feed-card { padding: 0; overflow: hidden; }
.fc-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.fc-note { padding: 0 14px 8px; }
.fc-f { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.feed-list { display: grid; }
.feed-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: #fff; text-align: start; cursor: pointer; font: inherit; color: inherit; }
.feed-row:hover:not(:disabled) { background: #f6f8fc; }
.feed-row:disabled { cursor: default; opacity: 1; }
.feed-row.late { background: #fff6f4; }
.feed-row.done .fr-b > span:first-child, .feed-row.done .fr-b > b { color: var(--muted, #6b7690); }
.feed-row .tk-check { pointer-events: none; }
.feed-row .tk-check.on { background: #2f9c72; border-color: #2f9c72; }
.fr-t { display: grid; min-width: 54px; flex: none; } .fr-t small { color: var(--muted, #6b7690); font-size: 11px; }
.fr-b { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; }
.feed-row > .badge { flex: none; margin-top: 2px; }
.feed-tasks .feed-list .feed-row:first-child { border-top: 0; }
.feed-sum { gap: 8px; align-items: center; }
.feed-sum.click { border: 0; cursor: pointer; font: inherit; color: inherit; text-align: start; }
.meal-times { gap: 12px; align-items: end; }
.mt-f { display: grid; gap: 2px; } .mt-f .input { width: 118px; }
.fp-row { align-items: center; gap: 10px; }
.fp-row.sel { background: #f3f6fc; }
.fp-row .acc-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #b9c3d6; background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; color: #fff; padding: 0; }
.fp-row .acc-box.on { background: var(--navy-2, #2a4d9b); border-color: var(--navy-2, #2a4d9b); }
.fp-row .acc-box svg.i { width: 14px; height: 14px; stroke-width: 3; }
.fp-n { min-width: 120px; flex: 0 1 180px; }
.fp-meals { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.fp-meal { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; }
.flines { display: grid; gap: 8px; justify-items: start; }
.fline { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto 40px; gap: 8px; align-items: center; width: 100%; }
.fline .input { min-width: 0; }
.fline-u { min-width: 38px; }
.feed-opts.five { grid-template-columns: repeat(5, 1fr); gap: 8px; }
.feed-opts.five .feed-opt { padding: 10px 4px; font-size: 20px; }
.feed-opts.five .feed-opt small { font-size: 11px; color: var(--muted, #6b7690); }
.feed-opt.on.most { border-color: #2f9c72; background: #eef8f3; } .feed-opt.on.half, .feed-opt.on.little { border-color: #e0a43a; background: #fdf1dc; }
.feed-req.cancelled { opacity: .6; }
@media (max-width: 600px) {
  .feed-grid { grid-template-columns: 1fr; }
  .feed-opts.five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .feed-opts.five .feed-opt span { font-size: 11px; }
  .fline { grid-template-columns: minmax(0, 1fr) 76px auto 40px; gap: 6px; }
  .mt-f .input { width: 100px; }
  .fp-row { flex-wrap: wrap; }
  .fp-meals { order: 5; flex-basis: 100%; padding-inline-start: 34px; }
}

/* v17 – phone top bar & bottom bar */
.tb-title h1 .t-s { display: none; }
.branch-btn { display: none; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; font-size: 12.5px; color: var(--ink); min-width: 0; max-width: 132px; cursor: pointer; flex-shrink: 1; }
.branch-btn .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.branch-btn svg.i.down { width: 14px; height: 14px; transform: rotate(90deg); flex: none; }
.branch-btn .sdot { flex: none; }
.branch-row { width: 100%; border: 0; background: #fff; font: inherit; gap: 10px; padding: 14px 16px; }
.branch-row.on { background: #f3f6fc; }
.bnav-plus { display: none; }
@media (max-width: 860px) {
  .topbar .stable-seg { display: none; }
  .branch-btn { display: inline-flex; }
  .tb-title { min-width: 0; flex: 1 1 auto; }
  .tb-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .sp { display: none; }
  .fab { display: none !important; }
  .main { height: calc(100dvh - 60px - var(--sab) * .7); }
  .bnav { height: calc(60px + var(--sab) * .7); padding: 0 max(6px, var(--sal)) calc(var(--sab) * .7) max(6px, var(--sar)); justify-content: space-between; align-items: center; }
  .bnav a { flex: 1 1 0; min-width: 0; padding: 6px 2px; }
  .bnav a span { font-size: 10.5px; }
  .bnav-plus { display: grid; place-items: center; flex: none; width: 52px; height: 52px; margin: -20px 4px 0; border-radius: 18px; border: 0; background: linear-gradient(135deg, var(--navy-2, #2a4d9b), var(--navy-d, #132857)); color: #fff; box-shadow: 0 8px 20px rgba(30, 58, 123, .35), 0 0 0 5px #fff; cursor: pointer; }
  .bnav-plus svg.i { width: 24px; height: 24px; stroke-width: 2.4; }
  .toasts, #toasts { bottom: calc(80px + var(--sab) * .7) !important; }
  .sheet { padding-bottom: calc(14px + var(--sab) * .7); }
}
@media (max-width: 640px) {
  .tb-title h1 .t-l { display: none; }
  .tb-title h1 .t-s { display: inline; }
  .tb-title .sub { display: none; }
  .topbar .mobile-logo { width: 34px; flex: none; }
}
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button svg.i { flex: none; }

/* v18 – photos and profile */
.av.av-s { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.av.has-photo { background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; color: transparent; }
.av-edit { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 16px; flex: none; }
.av-cam { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy, #1e3a7b); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff; }
.av-cam svg.i { width: 14px; height: 14px; }
.prof-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.prof-sec { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }
.prof-top .stack > .badge { justify-self: start; }
