@import url('https://fonts.googleapis.com/css2?family=El+Messiri:wght@500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --tq-900: #073b3a; --tq-800: #0a4f4d; --tq-700: #0e6764; --tq-600: #14918b; --tq-500: #1fa7a0; --tq-300: #7fd3cc; --tq-100: #d9f2ef; --tq-50: #eef9f7;
  --gold: #c8a24a; --gold-soft: #f5ecd6;
  --ivory: #faf7f2; --paper: #ffffff; --ink: #11302e; --ink-2: #4a6260; --ink-3: #8a9c9a; --line: #e6ebe8; --line-2: #eef1ef;
  --red: #c4474f; --red-soft: #fbe9ea; --amber: #c98a1b; --amber-soft: #fcf1dc; --green: #2b9a63; --green-soft: #e3f4ea; --violet: #7b68b5; --violet-soft: #eeebf7;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(7, 59, 58, .04), 0 6px 24px -8px rgba(7, 59, 58, .12);
  --shadow-lg: 0 24px 60px -18px rgba(7, 59, 58, .35);
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif; --display: 'El Messiri', 'IBM Plex Sans Arabic', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--ivory); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--tq-700); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 100% 0%, #26b8b0 0%, transparent 55%), radial-gradient(90% 80% at 0% 100%, #0b5553 0%, transparent 60%), linear-gradient(160deg, var(--tq-700), var(--tq-900)); }
.login-brand::after { content: ''; position: absolute; inset: auto -120px -160px auto; width: 480px; height: 480px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 60px rgba(255,255,255,.04), 0 0 0 130px rgba(255,255,255,.03); }
.login-brand h1 { font-family: var(--display); font-size: 54px; margin: 0; line-height: 1.15; }
.login-brand .tag { opacity: .85; font-size: 18px; margin-top: 6px; }
.login-brand .points { display: grid; gap: 14px; max-width: 420px; position: relative; z-index: 1; }
.login-brand .points div { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 12px 16px; border-radius: 14px; backdrop-filter: blur(6px); }
.login-brand .points svg { flex: none; }
.login-brand .by { opacity: .6; font-size: 13px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--display); font-size: 30px; margin: 0 0 4px; }
.demo-box { margin-top: 26px; padding: 18px; border-radius: var(--r); background: var(--tq-50); border: 1px dashed var(--tq-300); }
.demo-box .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, #fff, var(--tq-100)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; color: #dff3f1;
  background: linear-gradient(180deg, var(--tq-800), var(--tq-900)); }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.side .brand b { font-family: var(--display); font-size: 22px; color: #fff; display: block; line-height: 1.1; }
.side .brand span { font-size: 12px; opacity: .7; }
.side nav { display: grid; gap: 2px; overflow-y: auto; }
.side .sec { font-size: 11px; letter-spacing: .02em; opacity: .5; padding: 14px 12px 6px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #cfe9e6; font-weight: 500; transition: background .15s, color .15s; }
.side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side a .badge { margin-inline-start: auto; background: var(--gold); color: var(--tq-900); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); }
.side .me .who b { display: block; color: #fff; font-size: 14px; }
.side .me .who span { font-size: 12px; opacity: .7; }
.side .me button { margin-inline-start: auto; background: none; border: 0; color: #cfe9e6; cursor: pointer; padding: 6px; border-radius: 8px; }
.side .me button:hover { background: rgba(255,255,255,.1); }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(250,247,242,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.top h1 { font-family: var(--display); font-size: 24px; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .search { margin-inline-start: auto; position: relative; width: min(340px, 40vw); }
.top .search input { width: 100%; padding: 10px 40px 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.top .search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-pop { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; max-height: 380px; overflow: auto; }
.search-pop a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.search-pop a:hover, .search-pop a.sel { background: var(--tq-50); }
.page { padding: 24px 28px 90px; max-width: 1360px; }
.mnav { display: none; }

/* ---------- Building blocks ---------- */
.card { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 12px; }
.card-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.card-h .more { margin-inline-start: auto; font-size: 13px; }
.card-b { padding: 0 20px 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: linear-gradient(160deg, var(--tq-500), var(--tq-700)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(20,145,139,.6); }
.btn.gold { background: linear-gradient(160deg, #d9b765, #b58d33); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--tq-700); }
.btn.ghost:hover { background: var(--tq-50); box-shadow: none; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.wa { background: #1fae5b; color: #fff; border-color: transparent; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.tq { background: var(--tq-100); color: var(--tq-700); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.gold { background: var(--gold-soft); color: #8d6d1f; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* KPI */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .lbl { color: var(--ink-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; }
.kpi .val small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-inline-start: 4px; }
.kpi .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--tq-50); color: var(--tq-600); }
.kpi.hero { color: #fff; border: 0; background: radial-gradient(90% 120% at 0% 0%, rgba(255,255,255,.18), transparent 60%), linear-gradient(150deg, var(--tq-600), var(--tq-800)); }
.kpi.hero .lbl, .kpi.hero .sub { color: rgba(255,255,255,.8); }
.kpi.hero .ic { background: rgba(255,255,255,.15); color: #fff; }
.kpi .spark { position: absolute; inset-inline: 0; bottom: 0; height: 46px; opacity: .55; }

.hello { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.hello h2 { font-family: var(--display); font-size: 30px; margin: 0; font-weight: 600; }
.hello p { margin: 0; color: var(--ink-2); }

/* lists */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .t { min-width: 0; flex: 1; }
.li .t > b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t span { color: var(--ink-3); font-size: 13px; }
.li.click { cursor: pointer; border-radius: 10px; padding-inline: 8px; margin-inline: -8px; }
.li.click:hover { background: var(--tq-50); }
.time { font-weight: 700; color: var(--tq-700); width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.empty { padding: 26px 10px; text-align: center; color: var(--ink-3); }
.empty svg { display: block; margin: 0 auto 8px; opacity: .5; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: right; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--tq-50); }
.tbl .r { text-align: left; }
.tbl-wrap { overflow-x: auto; }

/* stock bar */
.bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--tq-500); }
.bar.low i { background: var(--red); } .bar.mid i { background: var(--amber); }

/* tabs */
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line-2); padding: 4px; border-radius: 14px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { background: var(--tq-600); color: #fff; }

/* forms */
.f { display: grid; gap: 6px; }
.f label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.in, .f input, .f select, .f textarea { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
.in:focus, .f input:focus, .f select:focus, .f textarea:focus { border-color: var(--tq-500); box-shadow: 0 0 0 3px rgba(31,167,160,.15); }
.f textarea { min-height: 70px; resize: vertical; }
.fg { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fg .full { grid-column: 1 / -1; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--tq-700); box-shadow: var(--shadow); }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* modal */
.ov { position: fixed; inset: 0; z-index: 100; background: rgba(7, 40, 39, .42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(880px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 20px 24px 6px; position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-h h3 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; }
.modal-h .x { margin-inline-start: auto; border: 0; background: var(--line-2); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; }
.modal-b { padding: 12px 24px 8px; }
.modal-f { display: flex; gap: 10px; padding: 14px 24px 20px; position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 30%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--tq-900); color: #fff; padding: 12px 20px; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 200; font-weight: 600; animation: pop .2s; display: flex; gap: 10px; align-items: center; }
.toast.bad { background: var(--red); }

/* alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--red-soft); color: #8e2a31; font-weight: 500; }
.alert.amber { background: var(--amber-soft); color: #7d5508; }
.alert.tq { background: var(--tq-50); color: var(--tq-800); }
.alert svg { flex: none; margin-top: 2px; }

/* patient */
.ph { display: flex; gap: 18px; align-items: center; padding: 22px; flex-wrap: wrap; }
.ph .avatar { width: 64px; height: 64px; border-radius: 20px; font-size: 26px; }
.ph h2 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 600; }
.ph .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.money3 { display: grid; grid-template-columns: repeat(3, auto); gap: 26px; margin-inline-start: auto; }
.money3 div span { display: block; font-size: 12px; color: var(--ink-3); }
.money3 div b { font-size: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 22px 20px; }

.tl { position: relative; padding-inline-start: 26px; }
.tl::before { content: ''; position: absolute; right: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-i { position: relative; padding: 4px 0 18px; }
.tl-i::before { content: ''; position: absolute; right: -24px; top: 10px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--c, var(--tq-500)); }
.tl-i .box { background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 16px; }
.tl-i.rev .box { opacity: .55; text-decoration: line-through; }
.tl-i .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-i .head b { font-size: 15.5px; }
.tl-i .det { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.mats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* dental chart */
.chart-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.teeth svg { width: 100%; height: auto; display: block; }
.tooth { cursor: pointer; transition: transform .12s; transform-box: fill-box; transform-origin: center; }
.tooth:hover { transform: scale(1.08); }
.tooth path { fill: #fff; stroke: #c9d6d3; stroke-width: 1.5; }
.tooth.has path { fill: var(--tq-100); stroke: var(--tq-500); }
.tooth.rct path { fill: var(--violet-soft); stroke: var(--violet); }
.tooth.crown path { fill: var(--gold-soft); stroke: var(--gold); }
.tooth.ext path { fill: #eceff0; stroke: #b5bec0; stroke-dasharray: 3 3; }
.tooth.sel path { stroke: var(--tq-800); stroke-width: 3; }
.tooth text { font-size: 10px; fill: var(--ink-3); text-anchor: middle; pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-inline-end: 5px; border: 1.5px solid; }
.picker svg { width: 100%; max-width: 560px; }

/* photos */
.ba { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10.4; background: #eee; user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.ba .handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 3px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.3); transform: translateX(-50%); pointer-events: none; }
.ba .handle::after { content: '⟷'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--tq-700); font-weight: 700; box-shadow: var(--shadow); }
.ba input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: ew-resize; }
.ba .lb { position: absolute; top: 12px; padding: 3px 10px; border-radius: 99px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; font-weight: 600; }
.ba .lb.l { left: 12px; } .ba .lb.r { right: 12px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.thumbs figure { margin: 0; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line-2); cursor: zoom-in; }
.thumbs img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.thumbs figcaption { padding: 6px 10px; font-size: 12.5px; color: var(--ink-2); }
.lightbox { max-width: 92vw; max-height: 86vh; border-radius: 14px; }

/* vial ring */
.vial { display: flex; align-items: center; gap: 12px; }
.ring { width: 46px; height: 46px; flex: none; }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--line-2); }
.ring .fg { stroke: var(--tq-500); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.ring.warn .fg { stroke: var(--amber); } .ring.bad .fg { stroke: var(--red); }
.ring text { font-size: 11px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; }
.bars div { flex: 1; background: linear-gradient(180deg, var(--tq-500), var(--tq-300)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars div:hover { background: var(--tq-700); }
.bars div:hover::after { content: attr(data-t); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--tq-900); color: #fff; padding: 4px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 5; }
.split { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.split i { display: block; height: 100%; }
.hbar { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; }
.hbar .bar { height: 10px; }

/* next phase */
.soon { position: relative; overflow: hidden; }
.soon .ribbon { position: absolute; top: 16px; left: -6px; background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 14px; border-radius: 0 8px 8px 0; }
.phone { width: 260px; margin: 0 auto; border-radius: 34px; background: #0f1f1e; padding: 12px; box-shadow: var(--shadow-lg); }
.phone .scr { background: #e9ddd2; border-radius: 24px; padding: 14px 10px; min-height: 360px; display: grid; gap: 8px; align-content: start; }
.bub { background: #fff; border-radius: 12px 12px 12px 4px; padding: 8px 11px; font-size: 13px; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bub small { display: block; text-align: left; color: #8a9; font-size: 10.5px; }
.site { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.site .hero { padding: 26px; color: #fff; background: linear-gradient(140deg, var(--tq-600), var(--tq-900)); }
.site .hero b { font-family: var(--display); font-size: 26px; display: block; }

/* receipt */
.receipt { max-width: 340px; margin: 0 auto; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; }
.receipt .rh { text-align: center; border-bottom: 1px dashed var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.receipt .rh b { font-family: var(--display); font-size: 22px; color: var(--tq-700); }
.receipt .ln { display: flex; justify-content: space-between; padding: 4px 0; }
.receipt .tot { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 17px; }

.count-row { display: grid; grid-template-columns: 1fr 110px 120px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.count-row input { text-align: center; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .chart-wrap { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; } .login-brand { padding: 32px 24px; min-height: 260px; } .login-brand h1 { font-size: 40px; } .login-brand .points { display: none; }
  .shell { grid-template-columns: 1fr; } .side { display: none; }
  .top { padding: 12px 14px; gap: 8px; } .top h1 { font-size: 19px; flex: 1; } .top .search { width: 40vw; margin-inline-start: 0; } #newp span { display: none; } #newp { padding: 10px 12px; }
  .page { padding: 16px 14px 100px; }
  .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 22px; } .kpi { padding: 14px; }
  .fg { grid-template-columns: 1fr; }
  .money3 { margin-inline-start: 0; gap: 18px; width: 100%; }
  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mnav a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 4px 0; }
  .mnav a.on { color: var(--tq-600); }
  .hbar { grid-template-columns: 100px 1fr auto; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; } .ov { align-items: end; padding: 0; }
  .count-row { grid-template-columns: 1fr 90px; } .count-row .sys { display: none; }
}
@media print {
  body { background: #fff; } .side, .top, .mnav, .modal-h, .modal-f, .noprint { display: none !important; }
  .ov { position: static; background: none; backdrop-filter: none; padding: 0; } .modal { box-shadow: none; max-height: none; }
  .shell > .main > .page { display: none; } .receipt { border: 0; }
}
