/* Shared look for every page: soft grey canvas, white rounded cards, blue accent, Poppins, a slim sidebar in the staff dashboard.
   Loaded AFTER each page's own <style>, so it restyles them without touching their layout rules. */

:root, :root:not([data-theme="light"]) {
  --bg: #f5f5f5; --card: #ffffff; --ink: #1d1f23; --muted: #8d939a; --line: #eceef1;
  --accent: #1362fc; --accent-hover: #0b4fd6; --accent-soft: rgba(19, 98, 252, .10);
  --ok: #24a05f; --warn: #d9820a; --bad: #f2574b;
  --free: #e6f6ed; --part: #fff3dc; --full: #fdeaea;
  --radius: 18px; --radius-sm: 10px; --shadow: 0 6px 30px rgba(24, 36, 70, .05);
  color-scheme: light;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); }
h1, h2, h3 { color: #000; font-weight: 600; letter-spacing: -.01em; }

/* ---- cards ---- */
.card, .panel, .overlay .panel { background: var(--card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; color: #000; }
.card h3 { font-size: 14px; }
.overlay { background: rgba(18, 24, 40, .45); backdrop-filter: blur(2px); }
.overlay .panel { max-width: 920px; }

/* ---- buttons ---- */
.btn, nav button, button.btn {
  font-family: inherit; font-weight: 500; font-size: 13.5px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, box-shadow .15s, color .15s, border-color .15s;
}
.btn:hover { border-color: #d9dde3; background: #fafbfc; }
.btn.primary, .btn.go { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(19, 98, 252, .22); }
.btn.primary:hover, .btn.go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: rgba(242, 87, 75, .35); background: #fff; }
.btn.danger:hover { background: rgba(242, 87, 75, .08); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- fields ---- */
label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid #e4e7ec; border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input::placeholder, textarea::placeholder { color: #b5bac1; }

/* ---- tables ---- */
table { border-collapse: separate; border-spacing: 0; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 10px 12px; background: #fafafb; border-bottom: 1px solid var(--line); }
th:first-child { border-top-left-radius: 10px; } th:last-child { border-top-right-radius: 10px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: #3b3f46; }
tbody tr:hover td { background: #fbfcff; }
.cal td.d { border-radius: 6px; }
.free { background: var(--free); } .part { background: var(--part); } .full { background: var(--full); }
.tile { border: 0; border-radius: 14px; background: #f7f8fa; box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(24, 36, 70, .08); }

/* ---- small things ---- */
.pill, .tag { border: 0; background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.healthy, .ok { color: var(--ok); } .unhealthy, .err { color: var(--bad); } .muted { color: var(--muted); }
.price { color: #000; font-weight: 600; }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
hr { border: 0; border-top: 1px solid var(--line); }

/* ============ staff dashboard shell ============ */
.shell { display: flex; min-height: 100vh; }
.side { width: 244px; flex: 0 0 244px; background: #fff; padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; box-shadow: 4px 0 30px rgba(24, 36, 70, .04); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand b { font-size: 15px; font-weight: 600; color: #000; line-height: 1.2; word-break: break-word; }
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; box-shadow: 0 8px 18px rgba(19, 98, 252, .3); }
.side #tabs { display: flex; flex-direction: column; gap: 4px; flex-wrap: nowrap; }
.side #tabs button { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; border: 0; background: transparent; color: #8d939a; padding: 11px 13px; border-radius: 13px; font-weight: 500; box-shadow: none; }
.side #tabs button:hover { background: #f4f6fb; color: var(--accent); }
.side #tabs button.on { background: var(--accent); color: #fff; box-shadow: 0 10px 20px rgba(19, 98, 252, .28); }
.side #tabs svg { width: 19px; height: 19px; flex: 0 0 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main-col { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 22px 32px 6px; background: transparent; border: 0; }
.topbar h1 { margin: 0; font-size: 24px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar select { min-width: 150px; background: #fff; }
.userchip { display: flex; align-items: center; gap: 10px; background: #fff; padding: 6px 14px 6px 6px; border-radius: 99px; box-shadow: var(--shadow); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1362fc, #6d9bff); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.userchip .muted { color: #4a4f57; font-size: 12.5px; line-height: 1.2; }
.main-col main { max-width: 1280px; margin: 0; padding: 16px 32px 40px; }
#login { max-width: 400px; margin: 10vh auto; padding: 32px; }
#login h2 { font-size: 20px; margin-bottom: 18px; }
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; overflow-x: auto; box-shadow: 0 4px 20px rgba(24, 36, 70, .05); }
  .side #tabs { flex-direction: row; gap: 4px; }
  .side #tabs button { width: auto; white-space: nowrap; padding: 9px 12px; }
  .topbar, .main-col main { padding-left: 16px; padding-right: 16px; }
}

/* ============ guest and staff-outside pages (book, signup, platform, pay, confirmation) ============ */
body > header, .site-head { background: #fff; border: 0; box-shadow: 0 4px 24px rgba(24, 36, 70, .05); }
body > header h1 { color: #000; font-weight: 600; }
.opt { border-top: 1px solid var(--line); }
.gallery img, .rt img { border-radius: 14px; }
.card .price { font-size: 20px; }

/* ============ MVC start page (Bootstrap) ============ */
.navbar { background: #fff !important; border: 0 !important; box-shadow: 0 4px 24px rgba(24, 36, 70, .05); }
.navbar-brand { font-weight: 600; color: #000 !important; }
.btn-primary { background: var(--accent); border-color: var(--accent); border-radius: var(--radius-sm); box-shadow: 0 6px 16px rgba(19, 98, 252, .22); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline-primary, .btn-outline-secondary { border-radius: var(--radius-sm); }
.btn-outline-primary { color: var(--accent); border-color: var(--accent); } .btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); }
.card.mb-3 { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-control { border-radius: var(--radius-sm); border-color: #e4e7ec; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Guest-facing pages: a plain button is the main action (blue); .ghost is the quiet one. */
body.guest .btn:not(.ghost):not(.danger) { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(19, 98, 252, .22); }
body.guest .btn:not(.ghost):not(.danger):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
body.guest > header { padding: 18px 24px; display: flex; align-items: center; gap: 12px; }
body.guest > header h1 { font-size: 20px; }
body.guest > header::before { content: ""; width: 14px; height: 14px; border-radius: 5px; background: var(--accent); box-shadow: 0 4px 10px rgba(19, 98, 252, .35); flex: 0 0 14px; }
body.guest main { padding-top: 24px; }

/* ============ dashboard widgets ============ */
.kpi-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.kpi { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 24px; border-radius: 16px; color: #fff; overflow: hidden; box-shadow: 0 10px 24px rgba(24, 36, 70, .10); }
.kpi strong { display: block; font-size: 30px; font-weight: 600; line-height: 1.15; }
.kpi span { display: block; font-size: 13.5px; opacity: .95; font-weight: 500; }
.kpi em { display: block; font-style: normal; font-size: 11.5px; opacity: .85; margin-top: 2px; }
.kpi-ico svg { width: 46px; height: 46px; stroke: #fff; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.kpi.click { cursor: pointer; transition: transform .12s; } .kpi.click:hover { transform: translateY(-2px); }
.k-blue { background: linear-gradient(135deg, #4facfe, #5b7cff); }
.k-green { background: linear-gradient(135deg, #3ddc97, #1fc7a0); }
.k-amber { background: linear-gradient(135deg, #ffb347, #ffcf5c); }
.k-coral { background: linear-gradient(135deg, #ff6b5e, #ff9a6b); }
.kpi-small { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; } .kpi-small .kpi { padding: 16px 18px; } .kpi-small .kpi strong { font-size: 22px; }
.dash-row { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.dash-left { display: grid; gap: 20px; } .dash-left .card, .dash-main { margin-bottom: 0; }
.dash-row2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; } .dash-row2.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.dash-row2 .card, .dash-row3 .card { margin-bottom: 0; }
.card.center { text-align: center; } .card.center .chart.donut { margin: 4px auto; display: block; }
.big { font-size: 30px; font-weight: 600; color: #000; line-height: 1.2; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; } .head h2 { margin-bottom: 2px; }
.nums { display: flex; gap: 22px; font-size: 13px; color: var(--muted); } .nums b { font-size: 20px; margin-right: 4px; }
.chart { width: 100%; height: auto; display: block; } .chart.donut { width: auto; }
.chart .ax { font-size: 11px; fill: #a3a9b1; font-family: inherit; }
.chart .dn-big { font-size: 24px; font-weight: 600; fill: #000; font-family: inherit; } .chart .dn-small { font-size: 11px; fill: #8d939a; font-family: inherit; }
.hb { margin-bottom: 14px; } .hb-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; } .hb-top b { color: #000; }
.hb-track { height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; } .hb-track i { display: block; height: 100%; border-radius: 99px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; } .lg b { color: #000; margin-left: 4px; }
.nb { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 10px; } .nb:last-child { border-bottom: 0; } .nb:hover { background: #f8f9fc; }
.nb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .nb-main b { color: #000; font-weight: 500; }
.nb-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; } .nb-side b { color: #000; font-weight: 600; }
.nb .avatar { flex: 0 0 38px; width: 38px; height: 38px; }
.adv { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); } .adv:last-child { border-bottom: 0; }
.adv i { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: #4aa3ff; }
.adv-good i { background: #35c47c; } .adv-warn i { background: #ffb02e; } .adv b { color: #000; font-weight: 500; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-row, .dash-row2, .dash-row2.wide, .dash-row3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ============ grouped sidebar, status pills, room tiles, registers ============ */
.side #tabs { gap: 2px; }
.ng { margin-bottom: 4px; }
.ng-head { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 0; background: transparent; padding: 8px 12px 6px; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #a3a9b1; cursor: pointer; }
.ng-head i { width: 7px; height: 7px; border-right: 2px solid #b5bac1; border-bottom: 2px solid #b5bac1; transform: rotate(-45deg); transition: transform .15s; }
.ng.open .ng-head i { transform: rotate(45deg); }
.ng-items { display: none; flex-direction: column; gap: 2px; } .ng.open .ng-items { display: flex; }
.side #tabs button .ico { flex: 0 0 19px; display: inline-flex; } .side #tabs button .ico svg { width: 19px; height: 19px; }
.side #tabs button span:not(.ico) { font-size: 13.5px; }
.sp { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.sp-ok { background: #e6f6ed; color: #1b8a52; } .sp-warn { background: #fff3dc; color: #b9700a; } .sp-bad { background: #fdeaea; color: #d1453b; } .sp-info { background: var(--accent-soft); color: var(--accent); }
.mini { padding: 4px 8px; font-size: 12.5px; border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 14px; font: inherit; font-size: 13px; cursor: pointer; color: #4a4f57; } .chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tiles2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.rt { border-radius: 14px; padding: 12px 14px; background: #f7f8fa; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.rt.free { background: #eefaf3; } .rt.part { background: #fff6e5; } .rt.full { background: #fdeeee; }
.rt.dirty { box-shadow: inset 0 0 0 2px #ffb02e; } .rt.ooo { box-shadow: inset 0 0 0 2px #f2574b; opacity: .85; }
.rt-top { display: flex; justify-content: space-between; align-items: center; } .rt-top strong { font-size: 17px; color: #000; }
.rt select, .rt input { margin-top: 6px; width: 100%; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; background: #eee; }
.sw.free { background: #bfe8d0; } .sw.part { background: #ffe1a8; } .sw.full { background: #f5b9b9; } .sw.dirty { background: #fff; box-shadow: inset 0 0 0 2px #ffb02e; } .sw.ooo { background: #fff; box-shadow: inset 0 0 0 2px #f2574b; }
.sc-chip { border-radius: 8px; padding: 4px 8px; margin: 2px 0; font-size: 12px; cursor: pointer; }
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } .form-grid label.wide { grid-column: 1 / -1; }
#recFormBody h2 { margin-bottom: 14px; }
.adv-info i { background: #4aa3ff; }

/* attendance sheet */
table.sheet th, table.sheet td { padding: 6px 4px; text-align: center; font-size: 12px; white-space: nowrap; } table.sheet td:first-child, table.sheet th:first-child { text-align: left; position: sticky; left: 0; background: #fff; min-width: 140px; }
table.sheet .hol { background: #fff7e6; } table.sheet .sp { padding: 1px 6px; }

/* POS */
.pos-grid { display:grid; grid-template-columns: 2fr 1fr; gap:16px; } @media (max-width: 900px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-menu { display:grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap:10px; }
.pos-item { display:flex; flex-direction:column; gap:4px; text-align:left; padding:12px; border:1px solid #e5e9f2; border-radius:8px; background:#fff; cursor:pointer; } .pos-item:hover { border-color:#1362fc; }
.pc-row { display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-bottom:1px solid #eef1f6; }
.pos-total { font-size:18px; margin:12px 0; } .btn.mini { padding:2px 8px; }

/* AI */
.ai-log { min-height:240px; max-height:50vh; overflow:auto; display:flex; flex-direction:column; gap:8px; margin:12px 0; }
.ai-msg { padding:10px 12px; border-radius:10px; max-width:80%; white-space:pre-wrap; } .ai-msg.user { align-self:flex-end; background:#1362fc; color:#fff; } .ai-msg.assistant { align-self:flex-start; background:#f1f4fa; }
