:root {
  --bg: #f3f7f8; --card: #fff; --text: #13252f; --muted: #5d707b; --border: #dbe5e9; --soft: #eef4f6;
  --primary: #0b7a75; --primary-d: #075e5a; --primary-soft: #e3f3f1;
  --green: #138a5b; --green-soft: #e3f6ed; --amber: #a3620a; --amber-soft: #fff3df; --red: #c23a46; --red-soft: #fde9eb;
  --blue: #2463b3; --blue-soft: #e6effb; --purple: #6a4fc4; --purple-soft: #efeafd;
  --radius: 14px; --shadow: 0 6px 24px rgba(19, 37, 47, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.noscroll { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; margin-bottom: 12px; }
h4 { font-size: 14px; margin: 14px 0 6px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.left { text-align: left; }
.hidden { display: none !important; }
.good { color: var(--green); }
.bad { color: var(--red); }

/* ---- Shell */
.sim-banner { background: #fff6e0; color: #7a4d00; font-size: 12px; text-align: center; padding: 6px 12px; border-bottom: 1px solid #f1dfb5; }
.header { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 24px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand b { display: block; font-size: 18px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11px; color: var(--muted); margin-top: -2px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.top-links { display: flex; gap: 4px; flex: 1; }
.top-links a { padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.top-links a.on, .top-links a:hover { background: var(--soft); color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; border: 0; background: transparent; width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; font-size: 17px; color: var(--muted); }
.icon-btn:hover { background: var(--soft); }
.dot { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 500; max-width: 220px; }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-d); display: grid; place-items: center; font-weight: 700; flex: none; }
.main { max-width: 1180px; margin: 0 auto; padding: 24px 24px 100px; min-height: 60vh; }
.bottom-nav { display: none; }
.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Buttons & badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--primary); color: #fff; font-weight: 600; padding: 10px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .15s; text-align: center; }
.btn:hover { background: var(--primary-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 20px; font-size: 16px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn.soft { background: var(--primary-soft); color: var(--primary-d); }
.btn.soft:hover { background: #d3ece9; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost.danger { background: #fff; color: var(--red); border-color: #f2c4c9; }
.btn.locked { background: #e8edf0; color: #7a8a94; opacity: 1; }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; font-weight: 600; }
.link { cursor: pointer; }
.link:hover { color: var(--primary); }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.teal { background: var(--primary-soft); color: var(--primary-d); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---- Cards & layout */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 0; }
.page-head .back { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); color: var(--text); font-size: 18px; flex: none; }
.narrow { max-width: 720px; }
.detail { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.detail > *, .checkout > * { min-width: 0; }
.sticky { position: sticky; top: 80px; }
.section-title { margin: 26px 0 12px; font-size: 18px; }
.list { display: grid; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.empty { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty h3 { margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.banner { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; }
.banner.success { background: var(--green-soft); color: #0d5f3f; border: 1px solid #bfe6d2; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; margin: 10px 0; }
.note.info { background: var(--blue-soft); color: #1d4f8f; }
.note.warn { background: var(--amber-soft); color: #7a4a06; }
.note.good { background: var(--green-soft); color: #0d5f3f; }

/* ---- Home */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; margin-bottom: 22px; }
.hero h1 { font-size: 40px; line-height: 1.08; margin: 12px 0 10px; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { max-width: 520px; margin: 0; }
.hero-points { display: grid; gap: 10px; }
.hero-points div { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px; font-weight: 500; }
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 0 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--primary); }
.search span { font-size: 20px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: 0; padding: 15px 0; background: transparent; font-size: 16px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 14px; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pkg { display: flex; flex-direction: column; margin: 0; }
.pkg h3 { margin: 10px 0 4px; font-size: 17px; }
.pkg-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pkg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; gap: 8px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 6px; }
.tests-inline { color: var(--muted); margin: 0; }
.price { white-space: nowrap; }
.price b { font-size: 17px; }
.price s { color: var(--muted); font-size: 13px; }
.off { color: var(--green); font-size: 12px; font-weight: 700; }
.row-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.row-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-main b, .row-main span { display: block; }

/* ---- Cart / pricing */
.lines { display: grid; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.line > div:first-child { min-width: 0; }
.line b, .line span { display: block; }
.line-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.line-right s { display: inline; }
.sum { display: grid; gap: 6px; padding-top: 12px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; }
.sum .grand { font-size: 17px; font-weight: 700; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 4px; }
.facts { display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: 14px; }
.facts span { color: var(--muted); }
.facts b { font-weight: 500; word-break: break-word; }
.checklist { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.checklist li::before { content: "✓"; color: var(--primary); font-weight: 700; margin-right: 8px; }

/* ---- Checkout */
.step h3 { display: flex; align-items: center; gap: 10px; }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; display: grid; place-items: center; }
.picks { display: grid; gap: 8px; margin-bottom: 10px; }
.picks.two { grid-template-columns: 1fr 1fr; }
.pick { text-align: left; border: 1.5px solid var(--border); background: #fff; border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.pick b, .pick span { display: block; }
.pick.on { border-color: var(--primary); background: #f2faf9; box-shadow: inset 0 0 0 1px var(--primary); }
.pick.static { cursor: default; }
.date-chip { display: grid; justify-items: center; line-height: 1.15; padding: 8px 12px; border-radius: 12px; min-width: 64px; }
.date-chip b { font-size: 18px; }
.date-chip small { font-size: 11px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.slot { border: 1.5px solid var(--border); background: #fff; border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; }
.slot b { display: block; font-size: 13px; }
.slot small { color: var(--green); font-size: 12px; }
.slot.on { border-color: var(--primary); background: #f2faf9; }
.slot:disabled { opacity: .45; cursor: not-allowed; background: var(--soft); }
.slot:disabled small { color: var(--muted); }

/* ---- Forms */
.form { display: grid; gap: 12px; }
.form.grid2 { grid-template-columns: 1fr 1fr; }
.span2, .span-all { grid-column: 1 / -1; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .filters input, .filters select {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; font-weight: 400; color: var(--text); outline: 0; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--primary); }
.form input:disabled { background: var(--soft); color: var(--muted); }
.form label.check, label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 14px; }
.form label.check input, label.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.prefix { display: flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.prefix:focus-within { border-color: var(--primary); }
.prefix span { padding: 10px 12px; background: var(--soft); color: var(--muted); font-weight: 600; }
.prefix input { border: 0 !important; border-radius: 0 !important; }
.inline-form { grid-template-columns: 1fr auto; align-items: end; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; flex: 1 1 160px; padding: 8px 10px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- Orders */
.order-card, .job-card { display: grid; gap: 6px; color: var(--text); margin: 0; transition: border-color .15s; }
.order-card:hover, .job-card:hover { border-color: var(--primary); }
.oc-top, .oc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.oc-mid { color: var(--muted); font-size: 14px; }
.status-card h2 { font-size: 24px; margin: 4px 0; }
.status-card p { margin: 0; color: var(--muted); }
.status-card.good { border-color: #bfe6d2; background: linear-gradient(180deg, #f2fbf6, #fff); }
.status-card.bad { border-color: #f2c4c9; background: linear-gradient(180deg, #fff5f6, #fff); }
.report-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.report-box b, .report-box span { display: block; }
.report-box .btn-row { margin: 0; }
.pay-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--amber-soft); border-color: #f1dbb0; }
.pay-card b, .pay-card span { display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary-soft); border: 2px solid var(--primary); }
.timeline li.current .tl-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline li.bad .tl-dot { border-color: var(--red); background: var(--red); box-shadow: none; }
.tl-title { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.tl-staff { color: var(--purple); margin-top: 2px; }
.receipt-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 14px; }
.big-amount { font-size: 28px; font-weight: 800; }

/* ---- Agent / lab / admin */
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab.on { background: var(--primary); color: #fff; }
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 16px; }
.st { font-size: 12px; color: var(--muted); text-align: center; }
.st span { display: block; height: 6px; border-radius: 3px; background: var(--border); margin-bottom: 6px; }
.st.done { color: var(--primary-d); font-weight: 600; }
.st.done span { background: var(--primary); }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .btn { padding: 12px; }
.action-grid .note, .action-grid p { margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { display: grid; gap: 4px; color: var(--muted); font-size: 12px; text-transform: capitalize; }
.thumb img, .doc-icon { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--soft); }
.doc-icon { display: grid; place-items: center; font-weight: 800; color: var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: left; color: var(--text); cursor: default; }
a.stat, button.stat { cursor: pointer; }
a.stat:hover, button.stat:hover { border-color: var(--primary); }
.stat.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 24px; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #f8fbfc; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-act] { cursor: pointer; }
.table tr[data-act]:hover td { background: #f6fafb; }
.table tr.inactive td { opacity: .55; }
.publish { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.audit { display: grid; gap: 8px; }
.audit > div { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.audit > div:last-child { border: 0; }
.admin-nav { margin-bottom: 18px; }
.admin-nav .tab { text-decoration: none; }

/* ---- Login */
.login { max-width: 420px; margin: 20px auto; }
.login-card { padding: 28px; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand .logo { margin: 0 auto 12px; width: 48px; height: 48px; font-size: 26px; }
.login-brand h2 { margin-bottom: 4px; }
.otp-input { font-size: 24px !important; letter-spacing: .5em; text-align: center; }
.otp-demo { font-size: 16px; letter-spacing: .15em; }
.demo-logins summary { cursor: pointer; font-weight: 600; }
.demo-logins .facts { margin-top: 10px; }

/* ---- Modal, toasts, menus */
.overlay { position: fixed; inset: 0; background: rgba(10, 25, 33, .5); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(680px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; }
.modal-head p { margin: 2px 0 0; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 20px 18px; }
.modal-foot:has(> :only-child) { justify-content: flex-end; }
.menu { display: grid; gap: 4px; }
.menu a, .menu button { display: block; text-align: left; padding: 12px; border-radius: 10px; color: var(--text); border: 0; background: none; cursor: pointer; font-weight: 500; }
.menu a:hover, .menu button:hover { background: var(--soft); }
.notif-list { display: grid; gap: 6px; }
.notif { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--text); border: 1px solid var(--border); }
.notif.unread { background: var(--primary-soft); border-color: #bfe0dc; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100% - 32px)); }
.toast { background: #13252f; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; animation: up .2s; transition: opacity .4s; }
.toast.success { background: #0f6e48; }
.toast.error { background: #b02f3b; }
.toast.hide { opacity: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* ---- Responsive */
@media (max-width: 900px) {
  .detail, .checkout, .hero { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .header { padding: 0 16px; gap: 10px; height: 58px; }
  .top-links, .hide-sm { display: none; }
  .user-chip { padding: 3px; }
  .main { padding: 16px 16px 96px; }
  h1 { font-size: 22px; }
  .hero h1 { font-size: 28px; }
  .hero-points { display: none; }
  .form.grid2, .picks.two, .action-grid, .inline-form, .check-grid { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .row-card { flex-wrap: wrap; }
  .row-card .row-main { flex-basis: calc(100% - 52px); }
  .row-card .price { margin-left: 52px; flex: 1; }
  .stepper { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
  .card { padding: 15px; }
  .bottom-nav:not([hidden]) { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--border); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: grid; justify-items: center; font-size: 11px; color: var(--muted); font-weight: 500; }
  .bottom-nav a span { font-size: 19px; }
  .bottom-nav a.on { color: var(--primary); }
  .toasts { bottom: 80px; }
  .overlay { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
}
@media print {
  body * { visibility: hidden; }
  #receipt, #receipt * { visibility: visible; }
  #receipt { position: absolute; left: 0; top: 0; width: 100%; }
}

/* ---- AI */
.ai-card { background: linear-gradient(135deg, #f4f1ff 0%, #fff 60%); border-color: #ddd5fb; }
.ai-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ai-head b, .ai-head span { display: block; }
.ai-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--purple); color: #fff; display: grid; place-items: center; flex: none; font-size: 16px; }
.ai-form { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.ai-form textarea { flex: 1; min-width: 0; border: 1.5px solid #d6cdf7; border-radius: 12px; padding: 10px 12px; resize: vertical; outline: 0; background: #fff; }
.ai-form textarea:focus { border-color: var(--purple); }
.ai-form .btn { background: var(--purple); }
.ai-form .btn:hover { background: #5640a8; }
.sm-chip { font-size: 13px; padding: 5px 12px; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--purple); font-size: 14px; padding: 10px 0; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; border-top-color: var(--purple); }
.ai-advice { margin: 10px 0; }
.ai-item { border-color: #e4defb; }
.ai-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ai-foot span { flex: 1; min-width: 200px; }
.danger-note { background: var(--red-soft); color: #8d1f2a; border: 1px solid #f2c4c9; }
.ai-note { background: var(--purple-soft); color: #43338a; }
.ai-check { margin-top: 14px; border: 1px solid #e4defb; border-radius: 12px; padding: 14px; }
.ai-check-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; margin-bottom: 10px; }
.ai-check-head b, .ai-check-head span { display: block; }
.ai-check-head.good { background: var(--green-soft); color: #0d5f3f; }
.ai-check-head.warn { background: var(--amber-soft); color: #7a4a06; }
.ai-check-head.bad { background: var(--red-soft); color: #8d1f2a; }
.ai-check-head.bad .ai-icon { background: var(--red); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 10px; }
.check-list li > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.check-list li.pass > span { background: var(--green-soft); color: var(--green); }
.check-list li.warn > span { background: var(--amber-soft); color: var(--amber); }
.check-list li.fail > span { background: var(--red-soft); color: var(--red); }
.check-list b, .check-list div > span { display: block; }
.table.compact td, .table.compact th { padding: 6px 8px; }
@media (max-width: 640px) { .ai-form { flex-direction: column; } }

/* ---- Installable app */
.show-sm { display: none; }
.install-banner { display: none; }
.install-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--blue); color: var(--blue); border-radius: 5px; font-size: 12px; }
@media (display-mode: standalone) {
  .header { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
}
@media (max-width: 640px) {
  .show-sm { display: inline; }
  .install-btn { padding: 6px 10px; }
  .install-banner:not([hidden]) { display: flex; align-items: center; gap: 10px; position: fixed; left: 10px; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 29;
    background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px 8px 10px 10px; box-shadow: 0 10px 30px rgba(19, 37, 47, .18); }
  .install-banner img { width: 40px; height: 40px; border-radius: 10px; }
  .install-banner div { flex: 1; min-width: 0; }
  .install-banner b, .install-banner span { display: block; }
  .install-banner span { font-size: 12px; color: var(--muted); }
  @media (display-mode: standalone) { .header { height: calc(58px + env(safe-area-inset-top)); } }
}
@media (max-width: 640px) { .brand small { display: none; } }

/* ---- Install popup */
.install-sheet { position: relative; padding: 26px 22px 16px; text-align: center; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.install-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 8px 24px rgba(11, 122, 117, .3); margin-bottom: 12px; }
.install-sheet h3 { font-size: 20px; margin-bottom: 4px; }
.install-sheet > p { margin: 0 0 12px; font-size: 14px; }
.install-perks { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.install-perks li { background: var(--primary-soft); color: var(--primary-d); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.install-sheet .install-steps { list-style: none; padding: 0; text-align: left; gap: 12px; margin: 4px 0 14px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.i-share { width: 20px; height: 20px; vertical-align: -4px; color: var(--blue); }
.install-actions { display: grid; gap: 8px; }
.block-btn { width: 100%; }
.install-sheet .note { text-align: left; }
.not-now { margin-top: 12px; color: var(--muted); font-weight: 500; }
.ios-pointer { color: var(--blue); font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.ios-pointer span { display: inline-block; animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---- AI assistant tabs & prescription */
.ai-tabs { display: flex; gap: 4px; background: #fff; border: 1px solid #e4defb; border-radius: 11px; padding: 3px; margin-bottom: 10px; }
.ai-tabs button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 14px; }
.ai-tabs button.on { background: var(--purple); color: #fff; }
.rx-drop { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: #fff; border: 1.5px dashed #cfc4f6; border-radius: 12px; padding: 14px; }
.rx-icon { font-size: 30px; }
.rx-preview { width: 56px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.rx-text b, .rx-text span { display: block; }
.rx-drop .file-btn { background: var(--purple); }
.rx-drop .link-btn { grid-column: 1 / -1; justify-self: center; color: var(--purple); }
.offer { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--green-soft); border: 1px solid #bfe6d2; color: #0d5f3f; border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.offer b, .offer span { display: block; }
.ai-refining { display: inline-flex; align-items: center; gap: 6px; color: var(--purple); font-weight: 600; }
@media (max-width: 640px) { .rx-drop { grid-template-columns: auto 1fr; } .rx-drop .file-btn { grid-column: 1 / -1; } .offer { flex-direction: column; align-items: stretch; } }

/* ---- Report explanation */
.explain-card { border-color: #ddd5fb; background: linear-gradient(180deg, #f8f6ff, #fff 120px); }
.explain-list { display: grid; gap: 10px; margin: 12px 0; }
.explain-item { border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 10px; padding: 10px 12px; background: #fff; }
.explain-item.low { border-left-color: var(--blue); }
.explain-item p { margin: 6px 0 0; font-size: 14px; }
.ex-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Privacy */
.consent-list { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 8px; }
.prose h3 { margin: 18px 0 6px; }
.prose p { margin: 0 0 8px; line-height: 1.6; }
.mt { margin-top: 22px; }

/* ---- Barcode scanner */
.scan-field { display: flex; gap: 6px; }
.scan-field input { flex: 1; min-width: 0; }
.scanner { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ff4d5e; box-shadow: 0 0 8px #ff4d5e; animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateY(-60px); } 50% { transform: translateY(60px); } }

/* ---- Lab: critical + demo */
.critical-box { background: var(--red-soft); border: 1.5px solid #e9a3ab; color: #7c1823; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.critical-box ul { margin: 6px 0; padding-left: 18px; }
.demo-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; background: #fafcfc; }

/* ---- Analytics */
.range-tabs { margin: 0; }
.kpi small { display: block; font-size: 11px; margin-top: 2px; }
.ai-stats .stat { border-color: #e4defb; background: #faf8ff; }
.ai-stats .stat strong { color: var(--purple); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-grid > * { min-width: 0; margin: 0; }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .mark { fill: var(--primary); }
.chart .hit { fill: transparent; }
.chart .bar:hover .mark { fill: var(--primary-d); }
.table-view { margin-top: 8px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--muted); }
.barlist { display: grid; gap: 8px; }
.bl-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.bl-fill { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; min-width: 2px; }
.bl-value { font-weight: 600; min-width: 44px; text-align: right; }
.chart-tip { position: fixed; z-index: 70; background: #13252f; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 8px; pointer-events: none; box-shadow: var(--shadow); white-space: nowrap; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }

/* ---- AI assistant chat */
.chat-page { max-width: 820px; }
.chat-card { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 460px; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #fbfaff; }
.chat-empty { margin: auto; text-align: center; max-width: 440px; }
.ai-icon.big { width: 52px; height: 52px; font-size: 24px; margin: 0 auto 10px; border-radius: 16px; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 88%; }
.msg.user { align-self: flex-end; }
.msg.user .bubble-text { background: var(--primary); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg.bot .bubble-text { background: #fff; border: 1px solid #e4defb; border-radius: 16px 16px 16px 4px; }
.msg.risk .bubble-text { border-color: #f2c4c9; background: var(--red-soft); }
.bubble-text { padding: 10px 14px; font-size: 14.5px; line-height: 1.5; min-width: 0; }
.bubble-text p { margin: 0 0 6px; }
.bubble-text p:last-of-type { margin-bottom: 0; }
.bot-avatar { width: 30px; height: 30px; border-radius: 10px; background: var(--purple); color: #fff; display: grid; place-items: center; flex: none; font-size: 14px; }
.msg-items { display: grid; gap: 6px; margin-top: 10px; }
.msg-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--soft); border-radius: 10px; padding: 6px 8px 6px 10px; font-size: 13px; }
.msg-sources { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.msg-sources .src { background: var(--purple-soft); color: var(--purple); border-radius: 999px; padding: 2px 8px; }
.msg-meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.typing { display: flex; gap: 4px; padding: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9acf0; animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.chat-sugg { padding: 10px 14px 0; margin: 0; border-top: 1px solid var(--border); }
.chat-form { display: flex; gap: 8px; padding: 10px 14px; }
.chat-form input { flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; outline: 0; }
.chat-form input:focus { border-color: var(--purple); }
.chat-form .btn { background: var(--purple); }
.chat-note { padding: 0 14px 10px; margin: 0; }
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 25; background: var(--purple); color: #fff; font-weight: 700; padding: 12px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(106, 79, 196, .35); }
.ai-fab[hidden] { display: none; }
.ai-fab:hover { background: #5640a8; }

/* ---- Staff sidebar (desktop) */
.sidenav { display: none; }
@media (min-width: 1100px) {
  body.with-sidenav .sidenav:not([hidden]) { display: block; position: fixed; top: 64px; left: 0; bottom: 0; width: 220px; background: #fff; border-right: 1px solid var(--border); padding: 16px 10px; overflow-y: auto; z-index: 15; }
  body.with-sidenav .main { margin-left: 220px; max-width: 1180px; }
  body.with-sidenav .admin-nav { display: none; }
  body.with-sidenav .top-links { display: none; }
}
.sidenav-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 10px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 14px; }
.sidenav a span { width: 20px; text-align: center; }
.sidenav a:hover { background: var(--soft); }
.sidenav a.on { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }

/* ---- My reports */
.report-card { display: flex; align-items: center; gap: 12px; margin: 0; }
.rc-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.rc-icon.ok { background: var(--green-soft); }
.rc-main { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }

/* ---- Payment methods & login art */
.pay-total { text-align: center; margin-bottom: 12px; }
.pay-methods { display: grid; gap: 8px; margin-bottom: 8px; }
.pay-method { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.pay-method:has(input:checked) { border-color: var(--primary); background: #f2faf9; }
.pay-method input { accent-color: var(--primary); }
.pay-method b, .pay-method small { display: block; }
.pm-icon { font-size: 22px; }
.login-art { width: 200px; max-width: 70%; display: block; margin: 0 auto 8px; }

/* ---- Lab priority, agent checklist, AI dashboard */
.ai-tile { border-color: #e4defb; background: #faf8ff; }
.ai-tile strong { color: var(--purple); }
.table tr.row-alert td { background: #fff7f8; }
.checklist-card { border-color: #e4defb; }
.cl-progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
.cl-progress span { display: block; height: 100%; background: var(--purple); border-radius: 3px; transition: width .3s; }
.cl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cl-list li { display: flex; gap: 10px; align-items: flex-start; }
.cl-list li b, .cl-list li span { display: block; }
.cl-list input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--purple); flex: none; }
.cl-auto { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); flex: none; margin-top: 2px; }
.cl-list li.done .cl-auto { background: var(--green-soft); color: var(--green); }
.cl-list li.done b { color: var(--green); }
.status-list, .gov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.status-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.status-list li b, .status-list li span.small, .gov-list b, .gov-list span.small { display: block; }
.gov-list li { display: flex; gap: 10px; }
.gov-list li > span { width: 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.up-good { color: var(--green); display: block; font-size: 11px; margin-top: 2px; }
.up-bad { color: var(--red); display: block; font-size: 11px; margin-top: 2px; }
.small-strong { font-size: 18px !important; }
@media (max-width: 640px) {
  .bottom-nav:not([hidden]) { grid-template-columns: repeat(5, 1fr); }
  .chat-card { height: calc(100vh - 230px); }
  .msg { max-width: 95%; }
}
.topbar { position: sticky; top: 0; z-index: 20; }
.topbar .header { position: static; }
@media (min-width: 1100px) { body.with-sidenav .sidenav:not([hidden]) { top: var(--topbar, 64px); } }
.sticky { top: calc(var(--topbar, 64px) + 16px); }

/* ---- Phone layout refinements */
@media (max-width: 640px) {
  /* Floating Ask AI on the right, above the bottom bar */
  .ai-fab { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); padding: 11px 16px; font-size: 14px; }
  .toasts { bottom: calc(132px + env(safe-area-inset-bottom)); }

  /* Tables become stacked cards */
  .table-card { overflow: visible; background: transparent; border: 0; padding: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px 2px; margin-bottom: 10px; }
  .table tr.row-alert { border-color: #f2c4c9; }
  .table tr.row-alert td { background: transparent; }
  .table td { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; word-break: break-word; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 2px; }
  .table td:not([data-label])::before, .table td[data-label=""]::before { content: none; }
  .table td:not([data-label]), .table td[data-label=""] { grid-template-columns: 1fr; }
  .table td:first-child { font-size: 15px; }
  .table tr[data-act]:hover td { background: transparent; }
  .table.compact td { grid-template-columns: 1fr auto; }
  .chart .table td { grid-template-columns: 1fr auto; }

  /* Compact, swipeable stage tiles (lab) */
  .stage-tiles { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; scrollbar-width: none; }
  .stage-tiles::-webkit-scrollbar { display: none; }
  .stage-tiles .stat { flex: 0 0 auto; min-width: 104px; padding: 10px 12px; }
  .stage-tiles .stat strong { font-size: 20px; }

  /* Filters: two per row */
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters input[type=search], .filters .btn { grid-column: 1 / -1; }
  .filters label.check { grid-column: 1 / -1; }
  .filters input, .filters select { width: 100%; }

  .page-head h1 { font-size: 21px; }
  .range-tabs { width: 100%; }
  .range-tabs .tab { flex: 1; }
  .stat { padding: 12px; }
  .stat strong { font-size: 21px; }
  .detail, .checkout { gap: 0; }
  .action-grid .btn { white-space: normal; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }
}
.td-v { min-width: 0; }

/* =====================================================================
   DESIGN SYSTEM v2 — enterprise look (tokens, shell, components)
   ===================================================================== */
:root {
  --bg: #f4f6f9; --card: #fff; --text: #0f1b2a; --text-2: #334155; --muted: #64748b; --border: #e3e8ef; --soft: #f1f4f8;
  --primary: #0d7a74; --primary-d: #095c57; --primary-soft: #e6f4f2;
  --purple: #6b56d6; --purple-soft: #f0edfd;
  --nav-bg: #0c1a2b; --nav-text: #b6c2d1; --nav-active: #13a49b;
  --radius: 12px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 42, .05);
  --shadow: 0 1px 3px rgba(15, 27, 42, .08), 0 1px 2px rgba(15, 27, 42, .04);
  --shadow-lg: 0 16px 40px rgba(15, 27, 42, .14);
  --side-w: 252px;
}
body { font-size: 14px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.i { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* ---- Top bar */
.sim-banner { display: none !important; }
.header { height: 64px; padding: 0 24px; gap: 16px; background: #fff; border-bottom: 1px solid var(--border); }
.logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #14aca2, #0a5f5a); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.logo .i { width: 22px; height: 22px; stroke-width: 3; color: #fff; vertical-align: 0; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand small { font-size: 11px; }
.top-links { gap: 2px; }
.top-links a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-weight: 500; color: var(--text-2); }
.top-links a .i { width: 17px; height: 17px; color: var(--muted); }
.top-links a.on { background: var(--primary-soft); color: var(--primary-d); }
.top-links a.on .i { color: var(--primary); }
.icon-btn { color: var(--text-2); }
.icon-btn .i { width: 20px; height: 20px; vertical-align: 0; }
.dot { top: 2px; right: 2px; border: 2px solid #fff; min-width: 19px; height: 19px; font-size: 10.5px; }
.test-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff7e6; color: #8a5a00; border: 1px solid #f3dca8; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: help; }
.test-pill .i { width: 14px; height: 14px; }
.user-chip { border-color: var(--border); padding: 3px 10px 3px 3px; gap: 9px; max-width: 260px; }
.user-chip .avatar { background: linear-gradient(135deg, #e6f4f2, #d3ece9); color: var(--primary-d); width: 32px; height: 32px; }
.uc-text { display: grid; line-height: 1.15; text-align: left; }
.uc-text b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-text small { font-size: 11px; color: var(--muted); }
.user-chip > .i { width: 16px; height: 16px; color: var(--muted); }
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--soft); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; height: 40px; color: var(--muted); }
.top-search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.top-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: 14px; color: var(--text); }
.top-context { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); }
.top-context .i { color: var(--primary); }
.menu-btn { display: none; }

/* ---- Staff sidebar */
.sidenav { display: none; }
body.with-sidenav .sidenav:not([hidden]) {
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 40;
  background: var(--nav-bg); color: var(--nav-text); padding: 0; border: 0; overflow: hidden;
}
.sidenav-brand { height: 64px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); flex: none; }
.sidenav-brand .brand { color: #fff; }
.sidenav-brand .brand small { color: #7f93a8; }
.sidenav-nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.sidenav-group { margin-top: 14px; }
.sidenav-title { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6c8197; padding: 0 10px 6px; }
.sidenav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--nav-text); font-weight: 500; font-size: 13.5px; margin-bottom: 2px; }
.sidenav a .i { width: 18px; height: 18px; color: #8297ad; }
.sidenav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidenav a.on { background: rgba(19, 164, 155, .16); color: #fff; box-shadow: inset 3px 0 0 var(--nav-active); }
.sidenav a.on .i { color: #4fd1c5; }
.sidenav-foot { flex: none; padding: 14px 22px; font-size: 12px; color: #7f93a8; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
@media (min-width: 1100px) {
  body.with-sidenav .topbar, body.with-sidenav .main { margin-left: var(--side-w); }
  body.with-sidenav .main { max-width: none; padding: 28px 32px 60px; }
  body.with-sidenav .admin-nav { display: none; }
  body.with-sidenav .header .brand { display: none; }
}
@media (max-width: 1099px) {
  body.with-sidenav .menu-btn { display: inline-grid; }
  body.with-sidenav .sidenav:not([hidden]) { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.with-sidenav.nav-open .sidenav:not([hidden]) { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(12, 26, 43, .45); z-index: 35; }
  body.with-sidenav .admin-nav { display: none; }
}

/* ---- Page structure */
.main { padding: 28px 28px 100px; }
.page-head { margin-bottom: 22px; align-items: flex-end; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.kicker { font-size: 11.5px; letter-spacing: .08em; color: var(--muted); }
.section-title { font-size: 16px; font-weight: 650; margin: 28px 0 12px; }
.card { border-radius: var(--radius-lg); border-color: var(--border); box-shadow: var(--shadow-sm); padding: 20px; }
.card h3 { font-size: 15px; font-weight: 650; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }

/* ---- Buttons & badges */
.btn { font-size: 13.5px; padding: 9px 15px; border-radius: 9px; gap: 7px; box-shadow: 0 1px 2px rgba(13, 122, 116, .25); }
.btn .i { width: 16px; height: 16px; vertical-align: 0; }
.btn.ghost, .btn.soft { box-shadow: none; }
.btn.ghost { border-color: var(--border); }
.btn.lg { padding: 12px 20px; font-size: 15px; border-radius: 11px; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.badge { font-size: 11.5px; padding: 3px 9px; gap: 5px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.no-dot::before { display: none; }

/* ---- KPI / stat tiles */
.stat { border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); border-color: var(--border); }
.stat span { font-size: 12.5px; font-weight: 500; }
.stat strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; display: block; margin-top: 2px; }
.kpi2 { display: flex; gap: 14px; align-items: flex-start; }
.kpi2 .kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.kpi2 .kpi-icon .i { width: 21px; height: 21px; vertical-align: 0; }
.kpi2 .kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi2 .kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }
.kpi2 .kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi2 .kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi2 .kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi2 small { display: block; font-size: 12px; margin-top: 2px; color: var(--muted); }

/* ---- Tables */
.table-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.table th { background: #f8fafc; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: #6b7a8c; padding: 11px 14px; }
.table td { padding: 13px 14px; border-color: #eef1f5; }
.table tr[data-act]:hover td { background: #f7fafb; }

/* ---- Forms */
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .filters input, .filters select { border-width: 1px; border-radius: 9px; padding: 10px 12px; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus { box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary); outline: 0; }

/* ---- Tabs */
.tabs { border-radius: 11px; box-shadow: var(--shadow-sm); }
.tab { font-weight: 600; font-size: 13.5px; }

/* ---- Mobile app shell */
.bottom-nav a .bn-i { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 14px; margin-bottom: 2px; }
.bottom-nav a .i { width: 22px; height: 22px; vertical-align: 0; }
.bottom-nav a.on .bn-i { background: var(--primary-soft); color: var(--primary); }
.bottom-nav .dot { top: -4px; right: 2px; }
.ai-fab { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #7b66e6, #5b45c8); }
.ai-fab .i { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .header { height: 58px; padding: 0 14px; gap: 8px; }
  .main { padding: 16px 14px 110px; }
  .bottom-nav:not([hidden]) { box-shadow: 0 -4px 20px rgba(15, 27, 42, .06); border-top-color: #eef1f5; padding-top: 7px; }
  .bottom-nav a { font-size: 11px; font-weight: 600; }
  .card { padding: 16px; border-radius: 14px; }
  .page-head h1 { font-size: 21px; }
  .test-pill { padding: 5px 7px; }
  .top-search { display: none; }
}

/* ---- Admin dashboard */
.dash-head p { margin: 4px 0 0; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.dash-grid > * { min-width: 0; margin: 0; }
.card-head h3 .i, .section-title .i { color: var(--primary); }
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.pipe-step { position: relative; text-align: center; background: var(--soft); border-radius: 12px; padding: 12px 4px 10px; }
.pipe-step strong { display: block; font-size: 22px; font-weight: 700; }
.pipe-step > span:not(.pipe-icon):not(.pipe-arrow) { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.pipe-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.pipe-icon .i { width: 16px; height: 16px; vertical-align: 0; }
.pipe-arrow { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: #b9c4d0; z-index: 1; }
.pipe-arrow .i { width: 14px; height: 14px; }
.mt-s { margin-top: 18px; }
.agent-load { display: grid; gap: 10px; }
.al-row { display: grid; grid-template-columns: 28px 120px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.al-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; background: var(--primary-soft); color: var(--primary-d); }
.attn-list { display: grid; gap: 8px; }
.attn { display: grid; grid-template-columns: 36px 1fr auto 16px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.attn:hover { border-color: #cdd6e0; background: #fafbfc; }
.attn b, .attn span.small { display: block; }
.attn strong { font-size: 20px; }
.attn-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.attn-icon .i { vertical-align: 0; }
.attn.red .attn-icon { background: var(--red-soft); color: var(--red); } .attn.red strong { color: var(--red); }
.attn.amber .attn-icon { background: var(--amber-soft); color: var(--amber); } .attn.amber strong { color: var(--amber); }
.attn.blue .attn-icon { background: var(--blue-soft); color: var(--blue); } .attn.blue strong { color: var(--blue); }
.attn-go { color: #b9c4d0; width: 16px; height: 16px; }
.all-clear { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--green-soft); color: #0d5f3f; }
.all-clear b, .all-clear span { display: block; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feed li { display: flex; gap: 10px; font-size: 13.5px; }
.feed li span.small { display: block; margin-top: 1px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.flush { margin: 0; }
.inline { display: inline !important; font-size: inherit !important; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .pipeline { grid-template-columns: repeat(3, 1fr); } .pipe-arrow { display: none; } .al-row { grid-template-columns: 28px 1fr auto; } .al-row .bl-track { display: none; } }
.sidenav a span { width: auto; text-align: left; }
.sidenav-brand .brand small { white-space: nowrap; }

/* ---- Customer home v2 */
.hero, .hero-points { display: none; }
.hero2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: start; padding: 34px; margin: -4px 0 8px; border-radius: 22px;
  background: radial-gradient(1200px 400px at -10% -40%, #d7f1ee 0%, transparent 60%), radial-gradient(800px 380px at 110% 120%, #ece7ff 0%, transparent 55%), #fff;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--primary-d); background: var(--primary-soft); padding: 5px 11px; border-radius: 999px; }
.eyebrow .i { width: 15px; height: 15px; }
.hero2 h1 { font-size: 44px; line-height: 1.06; letter-spacing: -.035em; margin: 16px 0 12px; font-weight: 800; }
.hero2 h1 em { font-style: normal; background: linear-gradient(90deg, #0d7a74, #6b56d6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero2-text > p { color: var(--text-2); font-size: 15.5px; line-height: 1.6; margin: 0 0 20px; max-width: 540px; }
.hero-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 0 16px; height: 54px; box-shadow: var(--shadow); max-width: 560px; color: var(--muted); }
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 15.5px; background: transparent; color: var(--text); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; }
.trust span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.trust .i { width: 16px; height: 16px; color: var(--primary); }
.hero2 .ai-card { margin: 0; box-shadow: var(--shadow); }
.ai-icon .i { width: 18px; height: 18px; vertical-align: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.concern-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.concern { display: grid; justify-items: center; gap: 8px; padding: 14px 6px; border: 1px solid var(--border); background: #fff; border-radius: 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); box-shadow: var(--shadow-sm); transition: transform .12s, border-color .12s; }
.concern:hover { transform: translateY(-2px); border-color: #cdd6e0; }
.concern.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); color: var(--primary-d); }
.concern-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.concern-icon .i { width: 22px; height: 22px; vertical-align: 0; }
.concern-icon.teal { background: var(--primary-soft); color: var(--primary); } .concern-icon.red { background: var(--red-soft); color: var(--red); }
.concern-icon.purple { background: var(--purple-soft); color: var(--purple); } .concern-icon.blue { background: var(--blue-soft); color: var(--blue); }
.concern-icon.amber { background: var(--amber-soft); color: var(--amber); } .concern-icon.green { background: var(--green-soft); color: var(--green); }
.pkg { padding: 18px; transition: box-shadow .15s, transform .15s; }
.pkg:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pkg-top { align-items: center; }
.pkg-top > div { display: flex; align-items: center; gap: 8px; }
.pkg-top .muted .i { width: 13px; height: 13px; vertical-align: -2px; }
.pkg-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #e6f4f2, #d6eeea); color: var(--primary); }
.pkg-icon .i { vertical-align: 0; }
.pkg h3 { font-size: 16.5px; margin: 12px 0 4px; }
.pkg-tests { list-style: none; padding: 0; margin: 6px 0 4px; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.pkg-tests li { display: flex; gap: 6px; align-items: center; }
.pkg-tests .i { width: 14px; height: 14px; color: var(--green); }
.pkg-tests .more { color: var(--muted); padding-left: 20px; }
.pkg-foot { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 12px; }
.row-icon { background: var(--primary-soft); color: var(--primary); }
.row-icon .i { vertical-align: 0; }
.test-list .row-card { box-shadow: var(--shadow-sm); }
.how { margin-top: 12px; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.how-step { position: relative; display: grid; gap: 6px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.how-n { position: absolute; top: 14px; right: 16px; font-size: 28px; font-weight: 800; color: #eef1f5; }
.how-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); }
.how-icon .i { vertical-align: 0; }
@media (max-width: 1000px) { .hero2 { grid-template-columns: 1fr; } .concern-grid { grid-template-columns: repeat(4, 1fr); } .how-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .hero2 { padding: 18px 16px; border-radius: 18px; gap: 16px; }
  .hero2 h1 { font-size: 29px; margin: 12px 0 8px; }
  .hero2-text > p { font-size: 14px; margin-bottom: 14px; }
  .hero-search { height: 48px; }
  .trust { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .trust span { font-size: 12px; }
  .concern-grid { gap: 8px; }
  .concern { padding: 10px 2px; font-size: 11.5px; border-radius: 12px; }
  .concern-icon { width: 40px; height: 40px; border-radius: 12px; }
  .pkg-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -14px; padding: 2px 14px 8px; scrollbar-width: none; }
  .pkg-grid::-webkit-scrollbar { display: none; }
  .pkg-grid .pkg { flex: 0 0 82%; scroll-snap-align: start; }
  .how-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .how-step { padding: 14px; }
}
.hero2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero2 > * { min-width: 0; }
.hero2 h1 { font-size: 42px; }
.trust { display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 22px; }
.ai-card textarea { min-width: 0; }
@media (max-width: 1000px) { .hero2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .hero2 h1 { font-size: 29px; }
  .trust { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ai-tabs button { font-size: 13px; padding: 8px 6px; }
}
.empty-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 28px; }
.empty-icon .i { width: 28px; height: 28px; vertical-align: 0; }
.back .i { width: 18px; height: 18px; vertical-align: 0; }
.ai-check-head .ai-icon .i { width: 16px; height: 16px; }
.btn .i + .i { display: none; }
.action-grid .btn .i, .btn-row .btn .i { flex: none; }
@media (max-width: 640px) { .bottom-nav:not([hidden]) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; } }
@media (max-width: 640px) { .btn-row .btn, .card .btn { white-space: normal; max-width: 100%; } }
