/* CareByte Simple — clear, calm and easy to tap.
   Large text, one main action per screen, colours that always come with words. */

:root {
  --brand: #0f833e; --brand-dark: #0b6a2e; --brand-ink: #0a3d1f; --brand-soft: #e7f5ec; --brand-soft-2: #f3faf5;
  --ink: #10231a; --text: #2b3b33; --muted: #5f6f67; --line: #dfe7e2; --line-2: #eef3f0;
  --bg: #f4f6f5; --card: #fff;
  --red: #b42318; --red-soft: #fdecea; --amber: #8a5a00; --amber-soft: #fff4d6; --blue: #1d5fae; --blue-soft: #e8f0fb;
  --green: #0f833e; --green-soft: #e3f4e9; --gray-soft: #eef1ef;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,35,26,.06), 0 4px 16px rgba(16,35,26,.05);
  --side: 252px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16.5px; font-weight: 700; }
p { margin: 0 0 10px; }
img { max-width: 100%; }
.ico { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #7cc89a; outline-offset: 2px; }

/* ---------- Shell ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; color: var(--ink); }
.side-brand:hover { text-decoration: none; }
.side-brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line-2); padding: 3px; }
.side-brand b { display: block; font-size: 15px; line-height: 1.2; }
.side-brand small { color: var(--muted); font-size: 12.5px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--text); font-weight: 600; font-size: 15.5px; margin-bottom: 2px; }
.side-nav a:hover, .side-foot a:hover { background: var(--brand-soft-2); text-decoration: none; }
.side-nav a.on, .side-foot a.on { background: var(--brand-soft); color: var(--brand-dark); box-shadow: inset 3px 0 0 var(--brand); }
.side-nav a .ico, .side-foot a .ico { color: var(--muted); }
.side-nav a.on .ico { color: var(--brand); }
.count { margin-left: auto; font-style: normal; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 700; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tabs .count { margin-left: 4px; background: var(--amber-soft); color: var(--amber); }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px 14px; }
.side-user b { display: block; font-size: 14.5px; line-height: 1.2; }
.side-user small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.side-out { color: var(--red) !important; }
.side-out .ico { color: var(--red) !important; }

.shell { margin-left: var(--side); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 66px; padding: 0 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.gsearch { position: relative; flex: 1; max-width: 620px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid transparent; border-radius: 12px; padding: 0 12px; height: 44px; color: var(--muted); }
.gsearch:focus-within { border-color: var(--brand); background: #fff; }
.gsearch input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--ink); height: 100%; outline: none; min-width: 0; }
.gsearch kbd { font: 12px var(--font); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--muted); background: #fff; }
.gsearch-results { position: absolute; left: 0; right: 0; top: 50px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(16,35,26,.16); padding: 6px; max-height: 70vh; overflow: auto; }
.gsearch-results a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); }
.gsearch-results a:hover, .gsearch-results a.sel { background: var(--brand-soft-2); text-decoration: none; }
.gsearch-results .grp { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.gsearch-results small { display: block; color: var(--muted); font-size: 13px; }
.branch-pick { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.branch-pick select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font: inherit; font-size: 14.5px; background: #fff; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.newmenu { position: relative; margin-left: auto; }
.newmenu summary { list-style: none; }
.newmenu summary::-webkit-details-marker { display: none; }
.newmenu-list { position: absolute; right: 0; top: 52px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(16,35,26,.16); padding: 6px; min-width: 230px; z-index: 50; }
.newmenu-list a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; color: var(--text); font-weight: 600; }
.newmenu-list a:hover { background: var(--brand-soft-2); text-decoration: none; }
.newmenu-list .ico { color: var(--brand); }
.page { padding: 24px 28px 110px; max-width: 1280px; }
.banner { background: var(--amber-soft); color: var(--amber); padding: 10px 28px; font-size: 15px; border-bottom: 1px solid #f1dfae; }
.offline-bar { display: flex; align-items: center; gap: 10px; background: #2b3b33; color: #fff; padding: 9px 28px; font-size: 15px; }
.offline-bar .link { color: #b7f0cb; }
.scrim { display: none; }

/* ---------- Page head, tabs ---------- */
.phead { margin-bottom: 20px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: var(--muted); }
.phead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.phead .sub { color: var(--muted); margin: 4px 0 0; font-size: 15.5px; }
.phead-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 11px 14px; font-weight: 650; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card.flush .card-h { padding: 16px 20px 0; }
.card-h .sub { color: var(--muted); font-size: 14.5px; margin: 2px 0 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.split-r { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.sep { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* Stats */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; display: block; }
.stat b { display: block; font-size: 25px; color: var(--ink); margin-top: 2px; letter-spacing: -.01em; }
.stat small { color: var(--muted); font-size: 13.5px; }
.stat.red b { color: var(--red); } .stat.green b { color: var(--green); }

/* Task tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); box-shadow: var(--shadow); min-height: 84px; transition: border-color .15s, transform .15s; }
.tile:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); }
.tile-ico { width: 48px; height: 48px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.tile-txt { flex: 1; min-width: 0; }
.tile-txt b { display: block; font-size: 16.5px; }
.tile-txt small { display: block; color: var(--muted); font-size: 14px; }
.tile-n { font-size: 30px; font-weight: 800; color: var(--ink); min-width: 40px; text-align: right; }
.tile-go { color: var(--muted); }
.tile.amber .tile-ico { background: var(--amber-soft); color: var(--amber); }
.tile.red .tile-ico { background: var(--red-soft); color: var(--red); }
.tile.blue .tile-ico { background: var(--blue-soft); color: var(--blue); }
.tile.zero { opacity: .72; }
.tile.zero .tile-n { color: var(--muted); }
.section-label { font-size: 13.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 10px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1.5px solid transparent; font: 650 15.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cfdad3; }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand-dark); }
.btn-ghost:hover { background: var(--brand-soft-2); }
.btn-danger { background: #fff; color: var(--red); border-color: #f0c4bf; }
.btn-danger:hover { background: var(--red-soft); }
.btn-warn { background: var(--amber); color: #fff; }
.btn-lg { height: 54px; padding: 0 24px; font-size: 17px; border-radius: 12px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14.5px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-dark); font-weight: 650; cursor: pointer; text-decoration: underline; }

/* ---------- Badges, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 650; white-space: nowrap; line-height: 1.4; }
.b-gray { background: var(--gray-soft); color: #45534c; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 750; font-size: 15px; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.plink { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.plink b { display: block; font-weight: 650; line-height: 1.25; }
.plink small { display: block; color: var(--muted); font-size: 13px; }
.plink:hover b { text-decoration: underline; }
.money { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money.red { color: var(--red); } .money.green { color: var(--green); }

/* ---------- Lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > .li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.list > li:first-child, .list > .li:first-child { border-top: 0; }
.card:not(.flush) .list > li, .card:not(.flush) .list > .li { padding-left: 0; padding-right: 0; }
.li-main { flex: 1; min-width: 200px; }
.li-main b { color: var(--ink); }
.li-main small, .li-sub { display: block; color: var(--muted); font-size: 14px; }
.li-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qno { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafcfb; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 750; border-top: 2px solid var(--line); }
.card.flush .tbl th:first-child, .card.flush .tbl td:first-child { padding-left: 20px; }
.card.flush .tbl th:last-child, .card.flush .tbl td:last-child { padding-right: 20px; }

.lsearch { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #cfdad3; border-radius: 12px; padding: 0 6px 0 12px; height: 50px; color: var(--muted); max-width: 640px; flex: 1; }
.lsearch:focus-within { border-color: var(--brand); }
.lsearch input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 16px; min-width: 0; height: 100%; }
.lsearch .btn { height: 38px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- Forms ---------- */
.form .form-title { margin-bottom: 4px; }
.form .form-sub { color: var(--muted); margin-bottom: 16px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.fgrid.three { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field { margin-bottom: 14px; min-width: 0; }
.field > label, .flabel { display: block; font-weight: 650; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.req { color: var(--red); font-style: normal; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=url], input[type=month], select, textarea {
  width: 100%; min-height: 46px; border: 1.5px solid #cfdad3; border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; }
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,131,62,.15); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); vertical-align: middle; }
input[type=file] { font: inherit; font-size: 15px; max-width: 100%; }
.hint { display: block; color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check span { flex: 1; }
.check small { display: block; color: var(--muted); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line-2); }
details.more { margin: 4px 0 14px; }
details.more > summary { cursor: pointer; font-weight: 650; color: var(--brand-dark); padding: 6px 0; }
details.more[open] > summary { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1.5px solid #cfdad3; border-radius: 11px; cursor: pointer; font-weight: 600; background: #fff; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.chip:focus-within { box-shadow: 0 0 0 3px rgba(15,131,62,.2); }
.pick-list { border: 1.5px solid #cfdad3; border-radius: var(--radius-sm); max-height: 320px; overflow-y: auto; }
.pick-list label { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.pick-list label:first-child { border-top: 0; }
.pick-list label:has(input:checked) { background: var(--brand-soft-2); }
.pick-list .grow small { display: block; color: var(--muted); font-size: 13.5px; }
.amount-big { font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.amount-input { font-size: 24px !important; font-weight: 700; height: 58px; }

/* ---------- Notes, flashes, empty ---------- */
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 15.5px; border: 1px solid; }
.flash > div { flex: 1; }
.flash-success { background: var(--green-soft); color: #0b5a2b; border-color: #b9e2c7; }
.flash-error { background: var(--red-soft); color: #8f1b12; border-color: #f2c2bc; }
.flash-info, .flash-warning { background: var(--blue-soft); color: #164a87; border-color: #c4d8f2; }
.flash-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 15px; margin-bottom: 14px; }
.note > div { flex: 1; }
.note-tip { background: var(--brand-soft-2); color: #1d4a30; border: 1px solid #d1eadb; }
.note-tip .ico { color: var(--brand); }
.note-warn { background: var(--amber-soft); color: #6d4700; border: 1px solid #f0dca6; }
.note-ok { background: var(--green-soft); color: #0b5a2b; border: 1px solid #b9e2c7; }
.note-danger { background: var(--red-soft); color: #8f1b12; border: 1px solid #f2c2bc; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ico { color: #a9bab0; margin-bottom: 8px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 420px; margin: 0 auto 14px; }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: 14.5px; }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }

/* ---------- Patient file ---------- */
.pfile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pfile-head h1 { font-size: 25px; }
.pfile-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; color: var(--muted); font-size: 15px; margin-top: 4px; }
.alert-strip { display: flex; gap: 10px; align-items: center; background: #fff1e6; color: #8a3a00; border: 1px solid #f6caa6; border-radius: 12px; padding: 10px 14px; font-weight: 650; margin: 14px 0 0; }
.steps { display: flex; align-items: flex-start; overflow-x: auto; padding: 4px 2px 6px; gap: 0; }
.step { flex: 1; min-width: 92px; text-align: center; position: relative; }
.step::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.now::before { background: var(--brand); }
.step i { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 3px solid var(--line); color: var(--muted); font-style: normal; font-weight: 750; }
.step.done i { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.now i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px rgba(15,131,62,.14); }
.step span { display: block; font-size: 13.5px; font-weight: 650; color: var(--muted); margin-top: 6px; line-height: 1.25; }
.step.done span, .step.now span { color: var(--ink); }
.nextstep { display: flex; align-items: center; gap: 16px; background: var(--brand-ink); color: #fff; border-radius: var(--radius); padding: 18px 20px; margin-top: 16px; flex-wrap: wrap; }
.nextstep .ns-txt { flex: 1; min-width: 220px; }
.nextstep small { display: block; color: #a8d9b9; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; }
.nextstep b { display: block; font-size: 18px; }
.nextstep p { margin: 2px 0 0; color: #d4ecdc; font-size: 15px; }
.nextstep .btn-primary { background: #fff; color: var(--brand-ink); }
.nextstep .btn-primary:hover { background: var(--brand-soft); }
.nextstep .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.nextstep.waiting { background: #fff; color: var(--ink); border: 1.5px dashed #b9cbbf; }
.nextstep.waiting small { color: var(--muted); }
.nextstep.waiting p { color: var(--muted); }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.action { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 650; }
.action .ico { color: var(--brand); }
.action small { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.action:hover { border-color: var(--brand); text-decoration: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); border: 2px solid var(--brand); }
.timeline .when { color: var(--muted); font-size: 13.5px; }
.vit { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.vit div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.vit span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.vit b { font-size: 19px; color: var(--ink); }
.vit .warn { background: var(--amber-soft); }
.vit .warn b { color: var(--amber); }
.soap dt { font-weight: 700; color: var(--ink); margin-top: 10px; }
.soap dd { margin: 2px 0 0; white-space: pre-line; }

/* ---------- Queue board, beds, POS ---------- */
.serving { background: var(--brand-ink); color: #fff; border-radius: var(--radius); padding: 22px; text-align: center; }
.serving small { color: #a8d9b9; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.serving .big { font-size: 64px; font-weight: 800; line-height: 1.05; margin: 6px 0; }
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bed { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; color: var(--ink); min-height: 92px; display: flex; flex-direction: column; gap: 3px; }
.bed b { font-size: 15px; }
.bed small { color: var(--muted); font-size: 13px; }
.bed.free { border-style: dashed; background: var(--brand-soft-2); color: var(--brand-dark); }
.bed.busy { border-color: #b8cdf0; background: var(--blue-soft); }
.bed:hover { text-decoration: none; border-color: var(--brand); }
.pos { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.pos-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-height: 64vh; overflow-y: auto; padding: 2px; }
.pos-item { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; color: var(--ink); min-height: 88px; }
.pos-item:hover { border-color: var(--brand); }
.pos-item b { display: block; font-size: 15px; line-height: 1.25; }
.pos-item small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.pos-item .price { color: var(--brand-dark); font-weight: 750; margin-top: 6px; display: block; }
.pos-item.out { opacity: .5; cursor: not-allowed; }
.cart-line { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.cart-line .grow b { display: block; font-size: 15px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: var(--bg); font-size: 18px; cursor: pointer; }
.qty input { width: 46px; height: 34px; border: 0; text-align: center; font: inherit; min-height: 0; padding: 0; border-radius: 0; }
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 22px; font-weight: 800; color: var(--ink); border-top: 2px solid var(--line); padding-top: 10px; margin-top: 6px; }
.barchart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.barchart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.barchart .bar i { display: block; width: 100%; max-width: 46px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; }
.barchart .bar i.out { background: #e3a08f; }
.barchart .bar span { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.hbar { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--brand); }
.viewer { position: relative; background: #111; border-radius: 12px; overflow: hidden; height: 460px; display: grid; place-items: center; touch-action: none; }
.viewer img { max-width: 100%; max-height: 100%; transform-origin: center; user-select: none; -webkit-user-drag: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a, .thumbs button { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: #000; padding: 0; cursor: pointer; display: grid; place-items: center; color: #fff; font-size: 12px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .on { border-color: var(--brand); }
.video-frame { width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #111; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.msg.mine { background: var(--brand-soft-2); }
.setup li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.setup li:first-child { border-top: 0; }
.setup .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: #fff; }
.setup .done .tick { background: var(--brand); border-color: var(--brand); }
.setup .done b { text-decoration: line-through; color: var(--muted); }
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 24px 64px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,30,20,.45); }
dialog .card { margin: 0; box-shadow: none; border: 0; }
.help-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.help-steps li { counter-increment: s; position: relative; padding: 4px 0 10px 40px; }
.help-steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 750; display: grid; place-items: center; font-size: 14px; }

/* ---------- Bottom nav (phones) ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--line); display: none; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 12px var(--font); color: var(--muted); background: none; border: 0; padding: 6px 2px; cursor: pointer; }
.bottom-nav a:hover { text-decoration: none; color: var(--brand); }

/* ---------- Sign-in pages ---------- */
body.auth { background: #0a3d1f; min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-photo { background: url("../img/auth-login.jpg") center/cover; position: relative; }
.auth-photo::after { content: ""; position: absolute; inset: 0; background: rgba(10,61,31,.55); }
.auth-photo div { position: absolute; left: 48px; right: 48px; bottom: 48px; color: #fff; z-index: 1; }
.auth-photo h2 { color: #fff; font-size: 34px; line-height: 1.15; margin-bottom: 10px; }
.auth-photo p { color: #d4ecdc; font-size: 17px; max-width: 460px; }
.auth-side { background: #fbfaf6; display: flex; flex-direction: column; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-card.wide { max-width: 560px; }
.auth-card .logo { height: 46px; margin-bottom: 26px; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; }
.auth-card .btn { width: 100%; }
.auth-card .foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 15px; }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 6px; width: 36px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.demo { background: #fff; border: 1px dashed #b9cbbf; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 18px; color: var(--muted); }
.demo code { background: var(--brand-soft); color: var(--brand-dark); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.plan { border: 1.5px solid #cfdad3; border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; position: relative; }
.plan input { position: absolute; opacity: 0; }
.plan:has(input:checked) { border-color: var(--brand); background: var(--brand-soft-2); box-shadow: 0 0 0 3px rgba(15,131,62,.15); }
.plan b { display: block; color: var(--ink); }
.plan span { color: var(--muted); font-size: 14px; }
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.plain-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; max-width: 520px; box-shadow: var(--shadow); }

/* ---------- Responsive ---------- */
.only-mobile { display: none !important; }
@media (max-width: 1080px) {
  .split, .split-r, .pos { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  .bottom-nav.only-mobile { display: flex !important; }
  .side { transform: translateX(-102%); transition: transform .22s; box-shadow: 0 0 40px rgba(0,0,0,.2); width: 280px; }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,30,20,.4); z-index: 39; }
  .shell { margin-left: 0; }
  .top { padding: 0 12px; gap: 8px; height: 60px; }
  .gsearch kbd { display: none; }
  .page { padding: 18px 14px 110px; }
  .banner, .offline-bar { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: 23px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-photo { display: none; }
  .list > li, .list > .li { padding: 14px 16px; }
  .tiles { grid-template-columns: 1fr; }
  .viewer { height: 340px; }
}
@media print {
  .side, .top, .bottom-nav, .tabs, .phead-actions, .no-print, .flash, .banner, .offline-bar { display: none !important; }
  .shell { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
.ppick { position: relative; }
.ppick-chosen { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--brand); background: var(--brand-soft-2); border-radius: var(--radius-sm); }
.ppick-chosen span { flex: 1; }
.ppick-chosen .ico { color: var(--brand); }
.ppick-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(16,35,26,.16); padding: 6px; max-height: 320px; overflow: auto; }
.ppick-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px; border-radius: 9px; font: inherit; cursor: pointer; color: var(--text); }
.ppick-list button:hover, .ppick-list button.sel { background: var(--brand-soft-2); }
.ppick-list small { display: block; color: var(--muted); font-size: 13px; }

/* Search boxes: the input sits inside a styled box, so it needs no border of its own. */
.gsearch input[type=search], .lsearch input[type=search] { border: 0; min-height: 0; padding: 0; box-shadow: none; background: transparent; border-radius: 0; }
.gsearch input[type=search]:focus, .lsearch input[type=search]:focus { box-shadow: none; }
@media (max-width: 520px) {
  .step { min-width: 52px; }
  .step i { width: 30px; height: 30px; }
  .step::before { top: 14px; }
  .step span { font-size: 11.5px; }
  .nextstep .row, .nextstep .row .btn, .nextstep form.inline, .nextstep form.inline .btn { width: 100%; }
}
.steps { scrollbar-width: none; } .steps::-webkit-scrollbar { display: none; }
@media (min-width: 1081px) { .pos > form { position: sticky; top: 82px; max-height: calc(100vh - 100px); overflow-y: auto; } }
.fgrid.three { align-items: end; }
.tbl .num, .tbl td > b:only-child { white-space: nowrap; }
