/* Shared look of the Miss Minute booking demos (Mandap, Sehat): same file in both apps.
   Phone: curved gradient header, cards, floating bottom bar. Desktop (>= 960px): a left sidebar
   and a wider, multi-column dashboard. Each app sets --g1 / --g2 / --soft in index.html. */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --ink: #111827; --text: #374151; --muted: #6b7280; --line: #e9ebf2; --bg: #f5f6fb; --card: #fff;
  --good: #059669; --warn: #d97706; --bad: #dc2626; --info: #2563eb;
  --radius: 18px; --side: 248px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 14.5px; line-height: 1.5; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); -webkit-tap-highlight-color: transparent; }
a { color: var(--g1); }
h2 { color: var(--ink); font-size: 18px; margin: 18px 4px 10px; font-weight: 700; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up { color: var(--good); } .down { color: var(--bad); } .r { text-align: right; }

/* ---------- header ---------- */
.topbar { position: relative; color: #fff; overflow: hidden; background: linear-gradient(135deg, var(--g1), var(--g2));
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 38px; border-radius: 0 0 28px 28px; }
.topbar.tall { padding-bottom: 64px; }
.topbar::before, .topbar::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); pointer-events: none; }
.topbar::before { width: 230px; height: 230px; right: -70px; top: -100px; }
.topbar::after { width: 140px; height: 140px; left: -50px; bottom: -80px; }
.tb-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.tb-who { flex: 1; min-width: 0; }
.tb-hi { font-size: 12.5px; opacity: .85; }
.tb-nm { font-size: 18px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.2); color: #fff; display: grid; place-items: center;
  font-size: 18px; text-decoration: none; border: 0; cursor: pointer; flex: none; position: relative; font-weight: 700; padding: 0; }
.topbar h1 { margin: 16px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.4px; position: relative; z-index: 1; }
.tb-sub { font-size: 13px; opacity: .92; position: relative; z-index: 1; margin-top: 2px; }
.badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px;
  display: grid; place-items: center; padding: 0 5px; font-weight: 700; box-shadow: 0 0 0 2px var(--g1); }
main { position: relative; z-index: 2; padding: 16px 14px; max-width: 760px; margin: 0 auto; }
.topbar.tall + main { margin-top: -48px; padding-top: 0; }

/* ---------- cards, stats, lists ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 4px 18px rgba(17,24,39,.06); }
.card h3 { margin: 0 0 12px; font-size: 15.5px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.card h3 .act { margin-left: auto; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 4px 18px rgba(17,24,39,.06); }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { display: block; font-size: 21px; color: var(--ink); font-weight: 800; letter-spacing: -.3px; margin-top: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); } .stat.good b { color: var(--good); }
.stat .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); font-size: 17px; margin-bottom: 8px; }
a.stat, .stat[data-go] { text-decoration: none; color: inherit; cursor: pointer; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 600; color: var(--ink); }
.li .s { font-size: 12.5px; color: var(--muted); }
a.li:hover .t { color: var(--g1); }
.av { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--soft); color: var(--g1); font-size: 15px; }
.amt { font-weight: 700; color: var(--ink); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.empty .big { font-size: 42px; display: block; margin-bottom: 6px; }
.error { background: #fef2f2; color: var(--bad); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-weight: 600; }
.note { background: var(--soft); border-radius: 14px; padding: 10px 14px; font-size: 13px; margin: 10px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.sum { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.sum .li { padding: 6px 0; border: 0; }
.big-amt { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }

/* ---------- pills, buttons, chips, forms ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f5; color: var(--muted); white-space: nowrap; }
.pill.good { background: #d1fae5; color: #047857; } .pill.warn { background: #fef3c7; color: #b45309; }
.pill.bad { background: #fee2e2; color: #b91c1c; } .pill.info { background: #dbeafe; color: #1d4ed8; } .pill.brand { background: var(--soft); color: var(--g1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none; color: #fff; font-weight: 600;
  border-radius: 14px; padding: 12px 18px; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 6px 16px -6px var(--g1); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 7px 12px; border-radius: 11px; font-size: 13px; box-shadow: none; }
.btn.ghost { background: var(--soft); color: var(--g1); box-shadow: none; }
.btn.line { background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ok { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 6px 16px -6px #059669; }
.btn.danger { background: #fee2e2; color: #b91c1c; box-shadow: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: #fff; box-shadow: 0 2px 8px rgba(17,24,39,.06); border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--text); }
.chip.on { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; }
.topbar .chips { margin-top: 14px; position: relative; z-index: 1; }
.topbar .chip { background: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.topbar .chip.on { background: #fff; color: var(--g1); }
.seg { display: flex; background: #eef0f5; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
label.f input, label.f select, label.f textarea { display: block; width: 100%; margin-top: 6px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 12px; background: #fff; color: var(--ink); font-weight: 500; }
label.f textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g1) !important; box-shadow: 0 0 0 3px var(--soft); }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--g1); flex: none; }
.bar { height: 8px; background: #eef0f5; border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--g1), var(--g2)); border-radius: 999px; }
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: none; font-size: 32px; color: #d6d8e2; cursor: pointer; padding: 0; }
.stars button.on { color: #f5a300; }

/* ---------- tables, timeline, chart ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fafbff; }
.tbl .num { text-align: right; white-space: nowrap; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; }
.tl li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--g1); }
.tl li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::after { display: none; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .tk { font-size: 10px; fill: var(--muted); } .chart .vl { font-size: 10px; fill: var(--ink); font-weight: 700; }

/* ---------- sheet, toast, nav ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); animation: up .2s; }
.sheet h3 { margin: 0 0 14px; color: var(--ink); font-size: 17px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #111827; color: #fff;
  padding: 11px 18px; border-radius: 14px; z-index: 60; font-weight: 600; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: up .2s; }
.nav { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; background: #fff; border-radius: 22px;
  display: flex; padding: 6px; box-shadow: 0 12px 34px rgba(17,24,39,.16); }
.nav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 6px 2px; border-radius: 16px; position: relative; }
.nav a .ic { display: block; font-size: 20px; line-height: 1.3; }
.nav a.on { color: var(--g1); background: var(--soft); }
.nav a .badge { top: 0; right: calc(50% - 22px); box-shadow: 0 0 0 2px #fff; }
.nav .brand { display: none; }

/* ---------- login ---------- */
.auth { max-width: 460px; margin: 0 auto; }
.auth .hero { text-align: center; padding: 6px 0 18px; }
.auth .mark { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 24px; display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 14px 30px -10px var(--g1); }
.auth h1 { margin: 0; color: var(--ink); font-size: 26px; }
.demo-logins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-logins button { border: 0; border-radius: 16px; padding: 12px; text-align: left; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); }
.demo-logins button:nth-child(3n+2) { filter: hue-rotate(35deg); } .demo-logins button:nth-child(3n+3) { filter: hue-rotate(-40deg); }
.demo-logins b { display: block; font-size: 14px; } .demo-logins span { font-size: 12px; opacity: .9; }

/* ---------- month calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 2px 0; }
.cal .d { border-radius: 10px; background: #f8f9fc; min-height: 50px; padding: 4px; font-size: 12px; cursor: pointer; border: 1.5px solid transparent; display: flex; flex-direction: column; gap: 2px; }
.cal .d.off { visibility: hidden; }
.cal .d.today { border-color: var(--g1); }
.cal .d.sel { background: var(--soft); border-color: var(--g1); }
.cal .d b { font-size: 12px; color: var(--ink); }
.cal .d i { display: block; height: 7px; border-radius: 4px; background: #d1fae5; }
.cal .d i.hold { background: #fde68a; } .cal .d i.booked { background: #fca5a5; } .cal .d i.blocked { background: #9ca3af; } .cal .d i.past { background: #e5e7eb; }
.cal .d .lbl { font-size: 10px; line-height: 1.2; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 14px; height: 8px; border-radius: 4px; margin-right: 4px; vertical-align: middle; }

/* ---------- desktop: sidebar + wide dashboard ---------- */
.cols { display: grid; gap: 14px; }
.cols > * { min-width: 0; }   /* a wide chip row scrolls inside its column instead of widening the page */
@media (min-width: 960px) {
  body { padding-bottom: 0; padding-left: var(--side); }
  .nav { left: 0; top: 0; bottom: 0; right: auto; width: var(--side); border-radius: 0; flex-direction: column; padding: 18px 14px; gap: 4px;
    box-shadow: 1px 0 0 var(--line); background: #fff; }
  .nav .brand { display: flex; flex: none; align-items: center; gap: 10px; padding: 4px 8px 20px; text-decoration: none; color: var(--ink); }
  .nav .brand i { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-style: normal; font-size: 20px; background: linear-gradient(135deg, var(--g1), var(--g2)); }
  .nav .brand b { font-size: 18px; } .nav .brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
  .nav a:not(.brand) { flex: none; display: flex; align-items: center; gap: 12px; text-align: left; font-size: 14px; padding: 11px 14px; border-radius: 13px; }
  .nav a .ic { font-size: 18px; width: 24px; text-align: center; }
  .nav a .badge { position: static; margin-left: auto; box-shadow: none; }
  body.guest { padding-left: 0; }
  .topbar { border-radius: 0 0 0 28px; padding: 22px 36px 46px; }
  .topbar.tall { padding-bottom: 76px; }
  main { max-width: 1180px; padding: 22px 36px 40px; }
  .topbar.tall + main { margin-top: -56px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stats.three { grid-template-columns: repeat(3, 1fr); }
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .cols.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .cols > .card, .cols > div > .card { margin-bottom: 0; }
  .cols > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 24px; }
  .toast { bottom: 28px; }
  .cal .d { min-height: 76px; }
}
@media print {
  body { padding: 0; background: #fff; } .nav, .topbar, .no-print, .toast { display: none !important; }
  .sheet-bg { position: static; background: none; } .sheet { max-height: none; box-shadow: none; }
  body > *:not(.sheet-bg) { display: none !important; }
}
