:root { --brand: #0f766e; --brand2: #0369a1; --ink: #1d2733; --muted: #66727f; --line: #dde3e9; --bg: #f3f6f8;
  --ok: #1e7b34; --ok-soft: #e6f4ea; --danger: #b3261e; --danger-soft: #fdecea; --warn-soft: #fff6e0; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; font-size: 16px; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
body.admin main { max-width: 1200px; }
a { color: var(--brand2); }
h1 { font-size: 1.4rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.2rem 0 .6rem; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .r { text-align: right; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card.center { text-align: center; } .narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: #e8f0fe; }
.flash.ok { background: var(--ok-soft); color: var(--ok); } .flash.error { background: var(--danger-soft); color: var(--danger); }
.notice { background: var(--warn-soft); border: 1px solid #f0d9a0; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.btn { display: inline-block; width: 100%; padding: 13px 18px; border: 0; border-radius: 10px; font: inherit; font-weight: 600; font-size: 1.05rem;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand2)); cursor: pointer; text-decoration: none; text-align: center; margin-top: 6px; }
.btn.ghost { background: #fff; color: var(--danger); border: 1px solid #e3b7b3; }
.btn.danger { background: var(--danger); }
body.admin .btn { width: auto; padding: 9px 16px; font-size: .95rem; }
label { display: block; margin-bottom: 12px; font-size: .92rem; color: #3b4652; }
input, textarea, select { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid #c5cdd6; border-radius: 10px; margin-top: 4px; background: #fff; }
input:focus, textarea:focus { outline: 2px solid #7fc2c0; border-color: var(--brand); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio { margin-bottom: 12px; font-size: .92rem; color: #3b4652; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.radio label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-size: 1rem; }
.radio input, .consent input { width: auto; margin: 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; background: #f7f9fa; padding: 10px; border-radius: 10px; }
.consent input { margin-top: 3px; transform: scale(1.3); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
/* Đầu trang phòng khám */
.clinic-head { display: flex; gap: 14px; align-items: center; padding: 22px 16px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); }
.clinic-head > * { max-width: 720px; }
.clinic-head h1 { margin: 0 0 4px; font-size: 1.35rem; }
.clinic-head .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; opacity: .95; }
.clinic-head a { color: #fff; }
.mark { flex: 0 0 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; }
@media (min-width: 760px) { .clinic-head { padding-left: calc(50vw - 344px); } }
.num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; align-items: center; justify-content: center; }
/* Chọn ngày, giờ */
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.day { flex: 0 0 76px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.day b { font-size: 1.1rem; } .day small { font-size: .72rem; color: var(--muted); }
.day.on { border: 2px solid var(--brand); background: #e6f6f4; }
.day.off { opacity: .45; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 0; text-align: center; text-decoration: none; color: var(--ink); font-weight: 600; }
.slot.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot.full { color: #b7bec6; text-decoration: line-through; background: #f5f6f7; }
.picked { background: #e6f6f4; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.big-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.kv { width: 100%; border-collapse: collapse; text-align: left; margin: 10px 0; }
.kv td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td:first-child { color: var(--muted); width: 38%; }
.code { font-size: 1.3rem; letter-spacing: 2px; font-family: ui-monospace, Consolas, monospace; }
.linkbox { font-size: .8rem; background: #f7f9fa; }
.clinic-link { display: block; text-decoration: none; color: var(--ink); }
.clinic-link span { display: block; font-size: .88rem; }
/* Quản trị */
.adm-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: #0f3d3a; color: #fff; }
.adm-top a { color: #fff; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; padding: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 10px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.dim td { opacity: .5; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #b7bec6; }
.dot.on { background: #22a559; box-shadow: 0 0 0 3px #d5f2e0; }
.warn { background: var(--warn-soft); padding: 10px; border-radius: 10px; font-size: .9rem; }
code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; }

/* 1.1.0: phòng khám hủy lịch */
.cancel-box { background: var(--danger-soft); border: 2px solid var(--danger); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.cancel-box h1 { color: var(--danger); }
.big-x { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--danger); font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; border: 2px solid var(--danger); }
.btn.ghost-ok { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.check-before { background: var(--warn-soft); padding: 10px 12px; border-radius: 10px; text-align: left; font-size: .9rem; }
