/* IIPE 2026 Hero's Room QMS — shared styles (mobile-first) */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2420;
  --muted: #8a7f74;
  --line: #eee5d8;
  --brand: #1f6f66;        /* Rajanti teal */
  --brand-dark: #15524b;
  --accent: #e8804c;       /* warm coral */
  --accent-soft: #fdeee4;
  --gold: #c9a227;
  --danger: #c0392b;
  --ok: #2e8b57;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(43, 36, 32, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5; min-height: 100vh;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 80px; }
.wrap.wide { max-width: 980px; }

header.app {
  display: flex; align-items: center; gap: 10px; padding: 14px 2px 12px;
}
header.app .logo {
  width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 20px; flex: none;
}
header.app h1 { font-size: 17px; line-height: 1.2; }
header.app .sub { font-size: 12px; color: var(--muted); }
header.app .right { margin-left: auto; text-align: right; font-size: 11px; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card h2 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .count { font-size: 12px; color: var(--muted); font-weight: normal; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
label .opt { color: var(--muted); font-weight: normal; }
input[type=text], input[type=tel], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 16px; background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700;
  background: var(--brand); color: #fff; cursor: pointer; text-decoration: none;
  transition: transform .05s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn.big { padding: 16px 20px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.warm { background: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 13.5px; background: #fff; cursor: pointer; user-select: none;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.badge.reg { background: #eef3f9; color: #3a6ea5; }
.badge.watch { background: #fdf3d7; color: #9a7b0a; }
.badge.queue { background: var(--accent-soft); color: var(--accent); }
.badge.consult { background: #e7f4ee; color: var(--ok); }
.badge.done { background: #efece8; color: var(--muted); }
.badge.regen { background: #f5e9f7; color: #8e44ad; }
.badge.buffer { background: #efece8; color: var(--muted); border: 1px dashed var(--muted); }
.badge.sent { background: #e7f4ee; color: var(--ok); }
.badge.sim { background: #fdf3d7; color: #9a7b0a; }
.badge.fail { background: #fdeaea; color: var(--danger); }

.row {
  display: flex; align-items: center; gap: 10px; padding: 11px 4px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 700; }
.row .meta { font-size: 12px; color: var(--muted); }
.row.sel { background: var(--accent-soft); border-radius: 10px; }
.row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.pos-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none;
}
.pos-num.later { background: #d8d2c8; color: #6d655b; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--brand); }
.stat span { font-size: 11px; color: var(--muted); }

/* ---- ticket stub: the visitor's own live queue ticket (register + status) ---- */
.ticket-stub {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; text-align: center; margin-bottom: 14px;
}
.ticket-stub .ts-head { padding: 13px 16px 11px; border-bottom: 1px dashed var(--line); }
.ticket-stub .ts-event { font-weight: 800; font-size: 15px; color: var(--brand); }
.ticket-stub .ts-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ticket-stub .ts-body { padding: 18px 16px 4px; }
.ticket-stub .ts-welcome { font-size: 13px; color: var(--muted); }
.ticket-stub .tk {
  font-size: 60px; font-weight: 900; letter-spacing: 2px; line-height: 1.05; color: var(--brand);
}
.ticket-stub .ts-pet { font-size: 15px; font-weight: 600; }
.ticket-stub .ts-state { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--accent); }
.ticket-stub .ts-stats {
  display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 4px;
}
.ticket-stub .ts-stats > div + div { border-left: 1px solid var(--line); }
.ticket-stub .ts-stats b {
  display: block; font-size: 36px; font-weight: 900; line-height: 1.1; color: var(--brand);
}
.ticket-stub .ts-stats span { font-size: 12px; color: var(--muted); }
.ticket-stub .ts-warn {
  margin: 16px 0 4px; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); color: #a8501f; font-size: 12.5px; line-height: 1.45; text-align: left;
}
.ticket-stub .ts-qr { margin: 18px 0 8px; }
.ticket-stub .ts-qr img { width: 180px; height: 180px; display: block; margin: 0 auto; }
.ticket-stub .ts-link { font-size: 12px; color: var(--muted); padding-bottom: 14px; word-break: break-all; }
.ticket-stub .ts-link a { color: var(--brand); font-weight: 700; }
.ticket-stub .ts-foot {
  border-top: 1px dashed var(--line); background: #fffdf9; padding: 12px;
  font-size: 13px; color: var(--muted);
}
.ticket-stub .ts-foot a { color: var(--brand); text-decoration: none; }
/* being called: the one state the visitor must not miss across a noisy hall */
.ticket-stub.st-called { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ticket-stub.st-called .tk, .ticket-stub.st-called .ts-event { color: var(--accent); }
.ticket-stub.st-done { opacity: .75; }
.ticket-stub.st-done .tk { color: var(--muted); }

.ticket-hero { text-align: center; padding: 26px 16px; }
.ticket-hero .tk {
  font-size: 64px; font-weight: 900; letter-spacing: 2px; color: var(--brand); line-height: 1.1;
}
.ticket-hero .hint { font-size: 13px; color: var(--muted); margin-top: 10px; }

.dropzone {
  border: 2.5px dashed var(--line); border-radius: var(--radius); padding: 34px 16px;
  text-align: center; color: var(--muted); font-size: 14px; background: #fffdf9; cursor: pointer;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs .th { position: relative; }
.thumbs img { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumbs .st { position: absolute; top: 4px; left: 4px; }
.thumbs .acts { display: flex; gap: 4px; margin-top: 4px; justify-content: center; }
.thumbs .acts .btn { padding: 4px 10px; font-size: 13px; }

.msg { padding: 10px 13px; border-radius: 10px; font-size: 13.5px; margin: 10px 0; display: none; }
.msg.show { display: block; }
.msg.ok { background: #e7f4ee; color: var(--ok); }
.msg.err { background: #fdeaea; color: var(--danger); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: center; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  overflow-x: auto; z-index: 50;
}
.nav a, .nav button {
  padding: 8px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.nav a.on, .nav button.on { background: var(--brand); color: #fff; }

.mod { display: none; }
.mod.on { display: block; }

.patient-card { border-left: 5px solid var(--brand); }
.patient-card .pet { font-size: 26px; font-weight: 900; }
.patient-card dl { display: grid; grid-template-columns: 110px 1fr; gap: 5px 10px; margin: 12px 0; font-size: 14px; }
.patient-card dt { color: var(--muted); }
.patient-card dd { font-weight: 600; }
.regen-alert {
  background: #f5e9f7; border: 1.5px solid #d3a9dd; color: #8e44ad;
  padding: 10px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 600; margin: 10px 0;
}

.two-col { display: grid; gap: 14px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

.empty { text-align: center; color: var(--muted); font-size: 13.5px; padding: 22px 10px; }
.mode-pill {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.mode-pill.live { background: #e7f4ee; color: var(--ok); }
.mode-pill.sim { background: #fdf3d7; color: #9a7b0a; }
