:root {
  --brand: #3b82f6;
  --brand-soft: rgba(59, 130, 246, 0.12);
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .07), 0 4px 16px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }

/* top bar */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 800; font-size: 17px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav-link:hover { color: var(--ink); text-decoration: none; background: var(--bg); }
.nav-link.is-active { color: var(--brand); background: var(--brand-soft); }
.lang-link { font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.lang-link:hover { color: var(--brand); text-decoration: none; border-color: var(--brand); }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 20px 16px; text-align: center; color: var(--muted); font-size: 13px; display: flex; gap: 16px; justify-content: center; }
.footer a { color: var(--muted); }

/* headings */
h1.page-title { font-size: 24px; margin: 4px 0 6px; }
.page-sub { color: var(--muted); margin: 0 0 24px; }
.section-title { font-size: 18px; margin: 28px 0 12px; }

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat { padding: 18px; }
.stat .num { font-size: 28px; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 13px; }

/* entrance cards (index) */
.entrance { text-align: center; padding: 40px 24px; transition: transform .15s ease, box-shadow .15s ease; cursor: pointer; display: block; color: var(--ink); }
.entrance:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.12); text-decoration: none; }
.entrance .icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--brand-soft); color: var(--brand); }
.entrance h2 { margin: 0 0 8px; font-size: 19px; }
.entrance p { margin: 0; color: var(--muted); font-size: 14px; }
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; }
.hero p { color: var(--muted); font-size: 16px; margin: 0; }

/* buttons */
.btn { display: inline-block; border: none; cursor: pointer; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; background: var(--brand); color: #fff; transition: filter .15s ease, opacity .15s ease; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-ok { background: var(--ok); }
.btn-bad { background: var(--bad); }
.btn-warn { background: var(--warn); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .req { color: var(--bad); }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 90px; resize: vertical; }
.form-card { max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }

/* radio pills for location */
.radio-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill .pill { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; font-weight: 600; font-size: 14px; cursor: pointer; transition: all .12s; }
.radio-pill input:checked + .pill { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* day strip (booking) */
.day-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.day-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; text-align: center; cursor: pointer; background: var(--card); transition: all .12s; }
.day-card:hover { border-color: var(--brand); }
.day-card.is-selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.day-card .dow { font-size: 12px; color: var(--muted); }
.day-card .dnum { font-size: 20px; font-weight: 700; }
.day-card .dstate { font-size: 11px; color: var(--ok); font-weight: 600; }
.day-card.is-off { opacity: .45; cursor: not-allowed; }
.day-card.is-past { opacity: .35; }

/* slot buttons */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.slot-btn { padding: 10px; border: 1px solid var(--line); border-radius: 10px; text-align: center; cursor: pointer; font-weight: 600; font-size: 14px; background: var(--card); transition: all .12s; }
.slot-btn:hover { border-color: var(--brand); color: var(--brand); }
.slot-btn.is-selected { border-color: var(--brand); background: var(--brand); color: #fff; }

/* alerts */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.alert-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* weekly calendar */
.cal-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-nav .spacer { flex: 1; }
.cal-wrap { overflow-x: auto; }
table.cal-week { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.cal-week th { padding: 8px 6px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); background: #f9fafb; font-weight: 600; }
table.cal-week th.today { color: var(--brand); }
table.cal-week td { height: 44px; border: 1px solid var(--line); vertical-align: top; position: relative; }
.cal-block { margin: 2px 3px; border-radius: 6px; padding: 3px 6px; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--brand-soft); color: var(--brand); }
.cal-block.has-detail { background: var(--brand); color: #fff; }
.cal-block.booking { background: var(--warn); color: #fff; }
.cal-note { text-align: center; color: var(--muted); font-size: 13px; padding: 14px 0; }
.hour-label { color: var(--muted); font-size: 11px; text-align: right; padding-right: 6px; }

/* admin layout */
.admin-layout { display: flex; max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; gap: 20px; align-items: flex-start; }
.sidebar { width: 200px; flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 76px; }
.side-link { display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.side-link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.side-link.is-active { background: var(--brand-soft); color: var(--brand); }
.admin-main { flex: 1; min-width: 0; }
@media (max-width: 760px) { .admin-layout { flex-direction: column; } .sidebar { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 4px; } }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
table.data th { text-align: left; padding: 10px 12px; background: #f9fafb; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafafa; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-declined { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #e5e7eb; color: #374151; }
.badge-type { background: #e0e7ff; color: #3730a3; }

/* misc */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.center { text-align: center; }
.inline-flex { display: inline-flex; gap: 8px; }
.hidden { display: none !important; }
.kbd { font-family: monospace; background: #f3f4f6; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.required-star { color: var(--bad); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: #f3f4f6; padding: 2px 5px; border-radius: 6px; }

/* responsive tables on mobile */
@media (max-width: 760px) {
  table.data { font-size: 13px; }
}
