:root {
  --navy: #0f172a;
  --navy-2: #1e293b;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-soft: #fff7ed;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; background: var(--orange); color: #fff; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--orange-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-dark { background: var(--navy); } .btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-soft); }
.btn-green { background: var(--green); } .btn-green:hover { background: #15803d; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=tel], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(249, 115, 22, .35); border-color: var(--orange); }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 48px; height: 38px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 2px; background: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--orange); }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #f1f5f9; color: #334155; white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-orange { background: var(--orange-soft); color: var(--orange-dark); }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--green-soft); color: #166534; margin-bottom: 18px; border: 1px solid #bbf7d0; }
.flash-error { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }

/* ---------- public ---------- */
.pub-header { background: #fff; border-bottom: 1px solid var(--line); border-top: 3px solid var(--orange); }
.pub-header .inner { max-width: 1080px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.pub-header img { height: 34px; display: block; }
.pub-header .brand-text { font-weight: 800; font-size: 18px; color: var(--navy); text-decoration: none; }
.pub-header a.site { color: var(--muted); font-size: 13px; text-decoration: none; }
.pub-header a.site:hover { color: var(--orange-dark); }
.pub-main { max-width: 1080px; margin: 0 auto; padding: 36px 20px 64px; }
.pub-footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px; }

.hero { display: flex; gap: 22px; align-items: center; margin-bottom: 30px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--orange), #c2410c);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 28px; flex: none;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line);
}
img.avatar { object-fit: cover; object-position: center 30%; background: #e2e8f0; }
.avatar-lg { width: 96px; height: 96px; }
.signature { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.signature .avatar { width: 48px; height: 48px; font-size: 18px; box-shadow: none; }
.signature p { margin: 0; }
.hero h1 { font-size: 30px; }
.types-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.type-card {
  display: flex; flex-direction: column; padding: 22px; text-decoration: none; color: inherit;
  border-top: 4px solid var(--c, var(--orange)); transition: transform .12s, box-shadow .12s;
}
.type-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(15, 23, 42, .1); }
.type-card h3 { font-size: 17px; margin-bottom: 4px; }
.type-card .tagline { color: var(--orange-dark); font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.type-card .desc { color: var(--muted); font-size: 14px; flex: 1; }
.type-meta { display: flex; gap: 14px; font-size: 13px; color: #475569; margin-top: 14px; align-items: center; }
.type-meta .go { margin-left: auto; color: var(--orange-dark); font-weight: 700; }

/* booking layout */
.book-wrap { display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.book-side { padding: 26px; border-right: 1px solid var(--line); background: #fcfcfd; }
.book-side .who { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.book-side .avatar { width: 46px; height: 46px; font-size: 18px; box-shadow: none; }
.book-side h1 { font-size: 22px; margin: 6px 0 12px; }
.meta-list { list-style: none; padding: 0; margin: 0 0 16px; }
.meta-list li { display: flex; gap: 10px; color: #475569; font-size: 14px; margin-bottom: 8px; align-items: flex-start; }
.meta-list svg { flex: none; margin-top: 2px; color: var(--muted); }
.note-card { background: var(--orange-soft); border: 1px solid #fed7aa; border-radius: 12px; padding: 14px; font-size: 14px; margin-bottom: 16px; white-space: pre-wrap; }
.book-body { padding: 26px; min-height: 520px; }
.picker { display: grid; grid-template-columns: 1fr 230px; gap: 26px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h2 { font-size: 17px; margin: 0; }
.cal-nav { display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-dow { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1; border-radius: 50%; border: 0; background: transparent; font: inherit; color: #94a3b8;
  cursor: default; display: grid; place-items: center; font-size: 14px; position: relative; max-width: 48px; margin: 0 auto; width: 100%;
}
.cal-day.avail { background: var(--orange-soft); color: var(--orange-dark); font-weight: 700; cursor: pointer; }
.cal-day.avail:hover { background: #ffedd5; }
.cal-day.selected { background: var(--orange); color: #fff; }
.cal-day.today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.slots h3 { font-size: 14px; margin-bottom: 10px; }
.slot-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.slot {
  border: 1.5px solid #fdba74; color: var(--orange-dark); background: #fff; border-radius: 10px; padding: 9px 10px;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center; line-height: 1.25;
}
.slot small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.slot:hover { border-color: var(--orange); background: var(--orange-soft); }
.tz-row { margin-top: 18px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.tz-row select { width: auto; max-width: 260px; padding: 6px 8px; font-size: 13px; }
.selected-time { background: var(--orange-soft); border: 1px solid #fed7aa; border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.empty-state { color: var(--muted); padding: 30px 0; text-align: center; font-size: 14px; }
.spinner { width: 22px; height: 22px; border: 3px solid #fed7aa; border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.hp { position: absolute; left: -9999px; }

/* welcome page */
.welcome-wrap { max-width: 860px; margin: 0 auto; }
.welcome-hero { text-align: center; margin-bottom: 22px; }
.check-circle { width: 58px; height: 58px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 12px; }
.video-box { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow); }
.video-box video, .video-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.welcome-msg { white-space: pre-wrap; font-size: 15.5px; }
.welcome-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-top: 18px; }
.detail-row { display: flex; gap: 10px; margin-bottom: 10px; font-size: 14.5px; align-items: flex-start; }
.detail-row svg { flex: none; margin-top: 3px; color: var(--orange); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.prep-list { padding-left: 0; list-style: none; margin: 0; }
.prep-list li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.prep-list li:last-child { border-bottom: 0; }
.prep-list li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 14px; height: 14px; border: 2px solid var(--orange); border-radius: 4px; }
.confirm-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-top: 18px; }
.confirm-banner p { margin: 0; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #cbd5e1; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: #fff; font-weight: 800; font-size: 17px; padding: 4px 4px 20px; }
.sidebar .brand span { color: var(--orange); }
.sidebar .brand-logo { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.sidebar .brand-logo img { height: 30px; display: block; }
.sidebar .brand-sub { font-size: 12px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; padding-left: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: #cbd5e1; text-decoration: none; padding: 9px 10px; border-radius: 9px; font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--navy-2); color: #fff; }
.sidebar nav a.active { background: var(--orange); color: #fff; }
.sidebar .bottom { margin-top: auto; font-size: 13px; }
.sidebar .bottom a, .sidebar .bottom button { color: #94a3b8; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 10px; text-decoration: none; display: block; }
.sidebar .bottom a:hover, .sidebar .bottom button:hover { color: #fff; }
.admin-main { padding: 28px 34px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { padding: 18px; }
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: #fafafa; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--c, var(--orange)); margin-right: 6px; vertical-align: middle; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #fafafa; }
.list-item .when { width: 92px; flex: none; font-size: 13px; font-weight: 700; }
.list-item .grow { flex: 1; min-width: 0; }
.card-title { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-title h2 { font-size: 16px; margin: 0; }
.tabs { display: flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.tabs a { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: #475569; font-weight: 600; font-size: 13px; }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.setup-list { list-style: none; padding: 0; margin: 0; }
.setup-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.setup-list li:last-child { border-bottom: 0; }
.tick { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.tick.ok { background: var(--green-soft); color: var(--green); }
.tick.todo { background: var(--amber-soft); color: var(--amber); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 13px; background: #f8fafc; }
.section { margin-bottom: 22px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 12px; }
.q-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: #fcfcfd; }
.q-item .q-top { display: grid; grid-template-columns: 1fr 150px auto auto; gap: 10px; align-items: center; }
.day-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; align-items: start; }
.range { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.range input { width: 130px; }
.video-preview { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; max-width: 520px; }
.video-preview video, .video-preview iframe { width: 100%; height: 100%; display: block; border: 0; }
.rec-dot { width: 10px; height: 10px; background: var(--red); border-radius: 50%; display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.progress { height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--orange); width: 0; transition: width .2s; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 30px; }

@media (max-width: 900px) {
  .book-wrap { grid-template-columns: 1fr; }
  .book-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .picker { grid-template-columns: 1fr; }
  .welcome-grid, .grid-2 { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .sidebar .brand { padding: 4px 10px; }
  .sidebar .bottom { margin-top: 0; }
  .admin-main { padding: 20px 16px 50px; }
  .q-item .q-top { grid-template-columns: 1fr; }
  .day-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pub-main { padding: 22px 14px 50px; }
  .hero { flex-direction: column; text-align: center; }
  .book-body, .book-side { padding: 18px; }
  .confirm-banner { flex-direction: column; align-items: flex-start; }
}
