:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --ink: #172019;
  --muted: #657068;
  --line: #dce3dd;
  --accent: #176b45;
  --accent-dark: #0f5134;
  --accent-soft: #e1f1e7;
  --warning: #855c0d;
  --warning-soft: #fff4d6;
  --danger: #a33a38;
  --danger-soft: #fae9e8;
  --radius: 8px;
  --shadow: 0 14px 40px rgba(34, 55, 41, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(23, 107, 69, .22); outline-offset: 2px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 8px 12px; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.app-shell { min-height: 100dvh; }
.sidebar { display: none; }
.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 12px 16px; background: rgba(247, 248, 245, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.15; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.demo-switcher { display: grid; gap: 2px; color: var(--muted); font-size: 11px; }
.demo-switcher select { height: 38px; max-width: 116px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; stroke-width: 1.8; }
main { width: min(100%, 1060px); margin: 0 auto; padding: 18px 16px 104px; }
.view { display: none; }
.view.active { display: block; animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.section-head h2, .section-head p { margin: 0; }
.section-head h2 { font-size: 20px; }
.section-head p { color: var(--muted); font-size: 14px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel + .panel, .panel + .section-head, .section-head + .panel { margin-top: 14px; }
.status-panel { display: grid; gap: 14px; padding: 20px; border-left: 4px solid var(--accent); }
.status-panel.warning { border-left-color: #d3941c; background: #fffdf7; }
.status-panel h2, .status-panel p { margin: 0; }
.status-panel p { color: var(--muted); }
.status-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.status-icon.warning { background: var(--warning-soft); color: var(--warning); }
.status-icon svg { width: 25px; height: 25px; }
.primary-button, .secondary-button, .danger-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: var(--radius); cursor: pointer; font-weight: 650; }
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.danger-button { border: 1px solid #e4bdbc; background: var(--danger-soft); color: var(--danger); }
.text-button { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--accent); }
.primary-button:active, .secondary-button:active, .danger-button:active, .icon-button:active { transform: translateY(1px); }
.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd5cd; border-radius: var(--radius); background: white; color: var(--ink); font-size: 16px; }
.field textarea { min-height: 88px; resize: vertical; }
.helper { margin: 0; color: var(--muted); font-size: 12px; }
.date-strip { display: grid; grid-template-columns: repeat(5, minmax(62px, 1fr)); gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.date-chip { min-width: 62px; min-height: 68px; padding: 8px 5px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.date-chip span, .date-chip strong { display: block; }
.date-chip span { color: var(--muted); font-size: 12px; }
.date-chip strong { margin-top: 3px; font-size: 18px; }
.date-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.segment { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.segment button { min-width: 72px; min-height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.segment button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(30, 50, 36, .1); font-weight: 650; }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.slot { min-height: 50px; padding: 6px; border: 1px solid #bfd0c3; border-radius: var(--radius); background: white; color: var(--accent-dark); cursor: pointer; font-weight: 650; }
.slot small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 400; }
.slot.selected { border-color: var(--accent); background: var(--accent); color: white; }
.slot.selected small { color: #d8efe1; }
.slot:disabled { border-color: var(--line); background: #eff1ef; color: #9aa19c; cursor: not-allowed; }
.booking-summary { display: grid; gap: 12px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: right; }
.list { display: grid; gap: 10px; }
.list-item { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.list-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.list-top h3, .list-top p { margin: 0; }
.list-top h3 { font-size: 16px; }
.list-top p { color: var(--muted); font-size: 13px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.meta-row svg { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.approved { background: var(--accent-soft); color: var(--accent-dark); }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat strong, .stat span { display: block; }
.stat strong { font-size: 24px; }
.stat span { color: var(--muted); font-size: 12px; }
.empty { padding: 34px 18px; border: 1px dashed #bec9c0; border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; margin-bottom: 8px; }
.empty h3, .empty p { margin: 0; }
.empty h3 { color: var(--ink); }
.empty p { margin-top: 4px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); min-height: calc(66px + env(safe-area-inset-bottom)); padding: 5px 12px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.bottom-nav button { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 56px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.bottom-nav button.active { color: var(--accent); font-weight: 700; }
.bottom-nav svg { width: 22px; height: 22px; stroke-width: 1.8; }
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13, 24, 16, .44); }
.modal-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; background: var(--surface); box-shadow: var(--shadow); animation: sheet .24s ease-out; }
@keyframes sheet { from { transform: translateY(30px); opacity: .4; } }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-sheet h2 { margin: 0 52px 6px 0; font-size: 21px; }
.modal-sheet > div > p { margin: 0 0 18px; color: var(--muted); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 86px; z-index: 200; display: none; max-width: 460px; margin: auto; padding: 13px 16px; border-radius: var(--radius); background: #18231b; color: white; box-shadow: var(--shadow); text-align: center; }
.toast.show { display: block; animation: toast .2s ease-out; }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } }
.admin-only.hidden { display: none !important; }

@media (min-width: 760px) {
  .app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 24px 14px 18px; border-right: 1px solid var(--line); background: var(--surface); }
  .brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; color: var(--ink); text-decoration: none; }
  .brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); background: var(--accent); color: white; font-weight: 800; }
  .brand strong, .brand small { display: block; }
  .brand small { color: var(--muted); font-size: 12px; }
  .side-nav { display: grid; gap: 5px; }
  .nav-item { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
  .nav-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item b { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 11px; }
  .side-note { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
  .side-note p, .side-note strong, .side-note small { display: block; margin: 0; }
  .side-note small { color: var(--muted); font-size: 11px; }
  .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
  .topbar { min-height: 82px; padding: 14px 28px; }
  .topbar h1 { font-size: 25px; }
  main { padding: 28px 28px 50px; }
  .bottom-nav { display: none; }
  .modal-sheet { top: 50%; left: 50%; right: auto; bottom: auto; width: min(520px, calc(100vw - 40px)); max-height: 84dvh; padding: 26px; border-radius: var(--radius); transform: translate(-50%, -50%); animation: modalIn .2s ease-out; }
  @keyframes modalIn { from { opacity: 0; transform: translate(-50%, -47%); } }
  .slot-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
  .list-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .item-actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
