/* Trang tạo điểm (/tao-diem) + trang chủ cơ sở (/a/<token>) — #898. */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
    U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/be-vietnam-pro-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/fonts/be-vietnam-pro-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --brand: #0e7490;
  --brand-dark: #155e75;
  --brand-soft: #ecfeff;
  --warn-bg: #fffbeb;
  --warn-line: #f59e0b;
  --warn-ink: #92400e;
  --danger: #b91c1c;
  --ok: #047857;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
}
a { color: var(--brand); }
header.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
header.top a.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
header.top a.logo img { width: 28px; height: 28px; }
header.top .tag { margin-left: auto; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 20px; }
.tag { display: inline-block; background: #e0f2fe; color: #075985; border-radius: 999px; padding: 2px 10px; font-size: .8rem; white-space: nowrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* form */
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
input[type=text], input[type=time], input[type=number], select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid #a5f3fc; outline-offset: 1px; border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.svc-head, .svc-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 96px 44px; gap: 8px; align-items: center; }
.svc-head { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.svc-row { margin-bottom: 8px; }
.svc-row .prefix-fixed { text-align: center; font-weight: 700; font-size: 1.1rem; }
.svc-row input[type=number] { text-align: right; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover, .btn:hover { background: var(--brand-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .btn.secondary { background: #fff; color: var(--brand); }
button.secondary:hover, .btn.secondary:hover { background: var(--brand-soft); }
button.danger { background: #fff; color: var(--danger); border-color: #fca5a5; }
button.danger:hover { background: #fef2f2; }
button.icon { width: 44px; padding: 0; background: #fff; color: var(--muted); border-color: #cbd5e1; font-size: 1.2rem; }
button.icon:hover { background: #f1f5f9; color: var(--danger); }
button.big { width: 100%; font-size: 1.05rem; padding: 14px 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.msg { border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: .95rem; }
.msg.err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.msg.ok { background: #ecfdf5; color: var(--ok); border: 1px solid #a7f3d0; }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.warn strong { display: block; margin-bottom: 4px; }

/* link + nút chép */
.link-box { margin-bottom: 14px; }
.link-box .lbl { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-box .desc { color: var(--muted); font-size: .85rem; margin: 2px 0 6px; }
.link-line { display: flex; gap: 8px; }
.link-line input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: #f8fafc; }
.link-line button { flex: none; }
.link-box.secret .link-line input { border-color: var(--warn-line); background: var(--warn-bg); }

/* tem */
.tem-grid { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.tem-preview { width: 160px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: block; }
.tem-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tem-buttons button { width: 100%; }

/* quản trị */
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .9rem; }
.pill.open { background: #d1fae5; color: var(--ok); }
.pill.closed { background: #fee2e2; color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.2; }
.stat span { font-size: .8rem; color: var(--muted); }
.queue-list { margin: 0; padding-left: 18px; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
nav.tabs button { background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 12px; white-space: nowrap; }
nav.tabs button[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
nav.tabs button:hover { background: var(--brand-soft); }

/* báo cáo (#900) — biểu đồ bằng HTML/CSS, một màu, không thư viện */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.report-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--brand); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: #fff; color: var(--brand); min-height: 36px; padding: 6px 14px; }
.seg button[aria-pressed=true] { background: var(--brand); color: #fff; }
.vbars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding: 0 0 22px; position: relative; border-bottom: 1px solid var(--line); }
.vbar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.vbar i { display: block; width: 100%; max-width: 36px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 0; }
.vbar i.zero { background: var(--line); height: 2px !important; border-radius: 0; }
.vbar b { font-size: .75rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.vbar span { position: absolute; bottom: -20px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.vbar:hover i:not(.zero) { background: var(--brand-dark); }
.hbars { margin: 6px 0 12px; }
.hrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 128px; gap: 8px; align-items: center; min-height: 26px; }
.hrow .h { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hrow .track { position: relative; height: 14px; }
.hrow .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 0 4px 4px 0; }
.hrow .track u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.hrow .v { font-size: .8rem; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rtable { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.rtable th, .rtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.rtable th:first-child, .rtable td:first-child { text-align: left; }
.rtable thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.r-details { margin: 12px 0; }
.r-details summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 6px 0; }
.empty { color: var(--muted); font-size: .9rem; padding: 8px 0; }

@media (max-width: 560px) {
  .hrow { grid-template-columns: 40px minmax(0, 1fr) 104px; gap: 6px; }
  .vbar b { font-size: .65rem; }
  .rtable th, .rtable td { padding: 6px 4px; }
  .rtable { font-size: .8rem; }
  h1 { font-size: 1.35rem; }
  .card { padding: 16px; }
  .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .svc-head, .svc-row { grid-template-columns: minmax(0, 1fr) 56px 72px 44px; gap: 6px; }
  .tem-grid { grid-template-columns: 1fr; }
  .tem-preview { width: 140px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-line { flex-direction: column; }
  .link-line button { width: 100%; }
}
