/* ─── Design Tokens ─── */
:root {
  --bg:          #f6f2e8;
  --surface:     #ffffff;
  --surface-alt: #fbf7ee;
  --border:      #eadfca;
  --border-mid:  #d7c59e;
  --text:        #0f172a;
  --text-2:      #3d3424;
  --muted:       #786c59;
  --muted-light: #a8987c;

  --brand:       #dcb13b;
  --brand-dark:  #a77818;
  --brand-deep:  #4d350b;
  --brand-bg:    #fff8e5;
  --brand-mid:   #ecd28c;
  --brand-soft:  #f7ead0;

  --blue:        var(--brand);
  --blue-dark:   var(--brand-dark);
  --blue-bg:     var(--brand-bg);
  --blue-mid:    var(--brand-mid);

  --green:       #16a34a;
  --green-bg:    #f0fdf4;
  --green-mid:   #bbf7d0;

  --amber:       #9a650a;
  --amber-bright:#c88b19;
  --amber-bg:    #fffbeb;
  --amber-mid:   #fde68a;

  --violet:      #7c3aed;
  --violet-bg:   #f5f3ff;
  --violet-mid:  #ddd6fe;

  --slate:       #64748b;
  --slate-bg:    #f8fafc;
  --slate-mid:   #e2e8f0;

  --red:         #dc2626;
  --red-bg:      #fef2f2;
  --red-mid:     #fecaca;

  --map-available: #dcb13b;
  --map-available-border: #8b6410;
  --map-locked: #c8752c;
  --map-locked-border: #7c3d12;
  --map-paid: #2f9e6f;
  --map-paid-border: #176045;
  --map-reserved: #4f7fa8;
  --map-reserved-border: #284b67;
  --map-closed: #7b8178;
  --map-closed-border: #4f554e;

  --r-xs: 5px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 24px;

  --sh-xs: 0 1px 2px rgba(79,52,10,.06);
  --sh-sm: 0 1px 3px rgba(79,52,10,.09), 0 1px 2px rgba(79,52,10,.05);
  --sh:    0 4px 10px rgba(79,52,10,.08), 0 2px 4px rgba(79,52,10,.05);
  --sh-md: 0 10px 24px rgba(79,52,10,.11), 0 3px 8px rgba(79,52,10,.06);
  --sh-lg: 0 24px 56px rgba(79,52,10,.16), 0 8px 18px rgba(79,52,10,.08);

  --t: 0.14s ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(220,177,59,.20), transparent 30vw),
    linear-gradient(180deg, #fbf7ed 0%, var(--bg) 360px);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ─── Buttons ─── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t), box-shadow var(--t), transform 0.1s ease;
  background: linear-gradient(180deg, #e7bf4d 0%, var(--brand) 100%);
  color: #2b1d05;
  box-shadow: 0 1px 2px rgba(137,94,13,.25), 0 4px 12px rgba(220,177,59,.22);
}
button:hover:not(:disabled) {
  background: linear-gradient(180deg, #e9c760 0%, #c99a25 100%);
  box-shadow: 0 4px 12px rgba(137,94,13,.25), 0 1px 4px rgba(137,94,13,.18);
  transform: translateY(-1px);
}
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: 0.48; }

button.secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
  box-shadow: var(--sh-xs);
}
button.secondary:hover:not(:disabled) {
  background: var(--brand-bg);
  border-color: var(--brand-mid);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

button.danger {
  background: var(--red);
  box-shadow: 0 1px 2px rgba(220,38,38,.25);
}
button.danger:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 2px 6px rgba(220,38,38,.3);
}

button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--brand-dark);
  box-shadow: none;
  padding: 6px 4px;
}
button.ghost:hover:not(:disabled) {
  background: var(--blue-bg);
  transform: none;
  box-shadow: none;
}

/* ─── Form Controls ─── */
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
  min-height: 40px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(220,177,59,.18);
}
input::placeholder { color: var(--muted-light); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.field-grid .wide  { grid-column: 1 / -1; }

/* ─── Topbar / Header ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 64px;
  background:
    linear-gradient(90deg, rgba(220,177,59,.16), transparent 38%),
    linear-gradient(90deg, #241906 0%, #4b3309 58%, #6e4b0c 100%);
  color: #fff;
  box-shadow: 0 2px 14px rgba(58,38,5,.22);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.topbar-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(220,177,59,.20);
  border: 1px solid rgba(220,177,59,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  max-width: 760px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-subtitle {
  font-size: 12px;
  opacity: 0.76;
  margin-top: 1px;
  letter-spacing: 0;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(220,177,59,.16);
  color: rgba(255,255,255,.9);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t);
  border: 1px solid rgba(220,177,59,.30);
}
.admin-link:hover {
  background: rgba(220,177,59,.25);
  text-decoration: none;
  color: #fff;
}

/* ─── Main Layout ─── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 10px;
  padding: 8px 10px 10px;
  align-items: start;
}

.layout > *,
.admin-main,
.panel {
  min-width: 0;
}

/* ─── Panel / Card ─── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}
.panel.pad { padding: 20px; }

/* ─── Toolbar ─── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(252,248,239,.96));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.toolbar label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.toolbar select {
  min-width: 144px;
  font-size: 13px;
  font-weight: 650;
  padding: 5px 32px 5px 12px;
  min-height: 36px;
  margin-top: 0;
  border-radius: 999px;
  border-color: #e6d7ba;
  background-color: #fff;
  box-shadow: var(--sh-xs);
}

.status-filter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 12px;
  border-right: 1px solid rgba(215,197,158,.70);
}

.status-filter-label > span {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Mobile Browser Tip ─── */
.mobile-browser-tip {
  display: none;
}

/* ─── Legend ─── */
.legend {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: 0;
  min-width: max-content;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eadbc2;
  padding: 5px 12px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  box-shadow: 0 1px 2px rgba(79,52,10,.05);
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.dot.available { background: var(--map-available); }
.dot.locked    { background: var(--map-locked); }
.dot.paid      { background: var(--map-paid); }
.dot.reserved  { background: var(--map-reserved); }
.dot.closed    { background: var(--map-closed); }

/* Registration summary chips */
.reg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  box-shadow: var(--sh-xs);
}
.reg-chip b { color: var(--text); font-weight: 700; }

/* ─── Booth Map ─── */
.front-map-tools {
  position: sticky;
  top: 12px;
  left: calc(100% - 194px);
  z-index: 20;
  width: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0 0 -147px auto;
  padding: 8px;
  border: 1px solid rgba(234,223,202,.9);
  border-radius: var(--r);
  background: rgba(255,255,255,.92);
  box-shadow: var(--sh-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.front-zoom-controls {
  display: grid;
  grid-template-columns: 32px 1fr 32px 44px;
  align-items: center;
  gap: 5px;
  width: 100%;
}

#front-zoom-label {
  min-width: 0;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.front-pan-pad {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(3, 28px);
  gap: 5px;
  justify-content: center;
}

.map-tool-btn {
  width: 32px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
  color: var(--text-2);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--sh-xs);
}

.map-tool-btn.primary {
  background: linear-gradient(180deg, #e7bf4d 0%, var(--brand) 100%);
  color: #2b1d05;
  border-color: var(--brand-mid);
}

.map-tool-btn.reset {
  color: var(--brand-deep);
  background: var(--brand-bg);
  border-color: var(--brand-mid);
}

.map-tool-btn:hover:not(:disabled) {
  transform: none;
}

.map-refresh-btn {
  width: 44px;
  font-size: 12px;
  font-weight: 700;
}

.map-wrap {
  position: relative;
  overflow: auto;
  padding: 0 6px 6px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 136px);
}

.map {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  background: linear-gradient(145deg, #efe4cf 0%, #ddc9a3 100%);
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
}

.map.zoomable-map {
  max-width: none;
}

.map-wrap {
  /* 单指/滚动交给浏览器，双指缩放由脚本接管 */
  touch-action: pan-x pan-y;
}

.map-wrap.map-pannable {
  cursor: grab;
}

.map-wrap.map-dragging {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

/* ─── 工具栏：展位搜索 / 筛选 ─── */
.booth-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-right: 12px;
  border-right: 1px solid rgba(215,197,158,.70);
}

.booth-search input {
  width: 130px;
  min-width: 0;
}

.booth-search button {
  flex-shrink: 0;
  white-space: nowrap;
}

.search-count {
  font-size: 12px;
  color: var(--muted, #8a7a5c);
  white-space: nowrap;
}

#area-filter,
#price-filter {
  max-width: 168px;
}

/* ─── 地图内状态图例（悬浮在地图左下角） ─── */
.map-legend {
  position: sticky;
  bottom: 10px;
  left: 10px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  margin-top: -40px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  font-size: 12px;
  pointer-events: none;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.map-legend .dot {
  width: 9px;
  height: 9px;
}

/* ─── 后台：近 14 天趋势图 ─── */
.trend-panel {
  margin-bottom: 24px;
}

.trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trend-head h2 {
  margin: 0 0 2px;
}

.trend-head .muted {
  font-size: 12px;
  margin: 0;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-2);
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.trend-chart-wrap {
  position: relative;
}

.trend-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-mid);
  box-shadow: var(--sh-sm);
  font-size: 12px;
  white-space: nowrap;
}

.chart-tooltip.hidden {
  display: none;
}

.chart-tooltip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

.chart-tooltip .tooltip-amount {
  color: var(--muted);
}

.trend-table {
  margin-top: 10px;
}

.trend-table summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.trend-table table {
  margin-top: 8px;
}

/* ─── 后台：账号管理 / 退出登录 ─── */
.admin-inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.admin-inline-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  min-width: 180px;
}

.logout-btn {
  display: block;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--muted);
}

.logout-btn:hover {
  color: var(--text-2);
  border-color: var(--brand-dark);
}

/* ─── 查询结果里的倒计时与自助取消 ─── */
.lookup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.lookup-actions button {
  padding: 4px 12px;
  font-size: 12px;
}

.lookup-actions .muted-note {
  font-size: 11px;
  color: var(--muted, #8a7a5c);
}

.lookup-countdown {
  margin-bottom: 6px;
}

.lookup-countdown .countdown {
  color: #c2410c;
}

.lookup-pay-box {
  margin-top: 10px;
}

.lookup-pay-box .payment-card {
  margin-top: 8px;
}

.lookup-method-editor {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.lookup-method-editor label {
  display: grid;
  gap: 4px;
  min-width: 150px;
  flex: 1;
  color: var(--muted);
}

.lookup-method-editor select {
  height: 36px;
  border-radius: var(--r-sm);
}

.lookup-method-editor button {
  min-height: 36px;
  padding: 0 14px;
}

.lookup-method-message {
  margin-top: 8px;
}

.lookup-method-note {
  margin-top: 6px;
  font-size: 12px;
}

.pay-method-group {
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
}

.pay-method-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.pay-method-option {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-alt);
}

.pay-method-option input {
  margin-top: 3px;
}

.pay-method-option b,
.pay-method-option small {
  display: block;
}

.pay-method-option small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.4;
}

.pay-method-option.pay-method-disabled {
  opacity: .62;
  background: #f7f3ea;
}

.offline-pay-notice,
.booth-card-release {
  border: 1px solid var(--amber-mid);
  background: var(--amber-bg);
  color: #7c4a03;
  border-radius: var(--r-sm);
}

.offline-pay-notice {
  padding: 10px 12px;
  margin: 0 0 10px;
}

.offline-pay-notice p {
  margin: 4px 0 0;
  line-height: 1.55;
  font-size: 13px;
}

.booth-card-release {
  margin-top: 8px;
  padding: 5px 7px;
  font-size: 12px;
}

.pay-method-pill {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--amber-bg);
  color: #8a5307;
  border: 1px solid var(--amber-mid);
  font-size: 12px;
}

/* ─── 搜索/筛选时地图上的展位表现 ─── */
.booth.booth-dim {
  opacity: 0.22;
  filter: grayscale(0.75);
}

.booth.booth-flash {
  z-index: 6;
  animation: booth-flash 0.85s ease-in-out 3;
}

@keyframes booth-flash {
  0%, 100% { box-shadow: 0 0 0 3px rgba(230, 62, 62, 0.95), 0 0 14px 4px rgba(230, 62, 62, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(230, 62, 62, 0); }
}

.map img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.booth {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
  padding: clamp(1px, 2cqw, 4px);
  min-width: 20px;
  min-height: 20px;
  border: 0;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.48);
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), filter var(--t), background var(--t);
  border-radius: 3px;
  line-height: 1.1;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(20,31,19,.18);
}

.booth-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  font-size: clamp(6px, min(28cqw, 52cqh), 34px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: .9;
  text-align: center;
  pointer-events: none;
  letter-spacing: 0;
}

.booth-code-mid .booth-label {
  font-size: clamp(4.5px, min(20cqw, 46cqh), 28px);
}

.booth-code-long .booth-label {
  font-size: clamp(4.5px, min(15cqw, 38cqh), 20px);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: .9;
  text-wrap: balance;
}

.booth:hover {
  z-index: 5;
  filter: brightness(1.1);
  box-shadow: 0 0 0 3px rgba(255,255,255,.72), 0 4px 14px rgba(78,51,9,.28);
  transform: scale(1.04);
}

.booth.status-available {
  background: linear-gradient(180deg, rgba(235,196,83,.96) 0%, rgba(220,177,59,.94) 100%);
  color: #241806;
  text-shadow: 0 1px 2px rgba(255,255,255,.58);
  box-shadow:
    0 3px 9px rgba(78,51,9,.28);
}
.booth.status-locked {
  background: rgba(200,117,44,.88);
  filter: saturate(.94) brightness(.98);
}
.booth.status-paid {
  background: rgba(47,158,111,.88);
  filter: saturate(.94) brightness(.98);
}
.booth.status-reserved {
  background: rgba(79,127,168,.86);
  filter: saturate(.88) brightness(.95);
}
.booth.status-closed {
  background: rgba(123,129,120,.78);
  filter: saturate(.76) brightness(.90);
}

.booth.status-available:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(244,208,96,.98) 0%, rgba(226,182,62,.98) 100%);
}
.booth.status-locked:hover:not(:disabled)    { background: rgba(211,128,54,.96); }
.booth.status-paid:hover:not(:disabled)      { background: rgba(55,172,123,.96); }
.booth.status-reserved:hover:not(:disabled)  { background: rgba(89,140,181,.95); }
.booth.status-closed:hover:not(:disabled)    { background: rgba(133,139,130,.90); }

/* ─── Booth Grid Cards ─── */
.grid-booths {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  padding: 16px;
}

.booth-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  overflow: hidden;
}
.booth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--blue);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.booth-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  border-color: var(--border-mid);
}
.booth-card.status-locked::before   { background: var(--amber-bright); }
.booth-card.status-paid::before     { background: var(--green); }
.booth-card.status-reserved::before { background: var(--violet); }
.booth-card.status-closed::before   { background: var(--muted-light); }

.booth-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.booth-card strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.booth-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.booth-price {
  font-weight: 600;
  color: var(--text-2);
}

.booth-card-area {
  font-size: 11.5px;
  color: var(--muted-light);
  margin-top: 5px;
}

.booth-card-public {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--brand-bg);
  border: 1px solid var(--brand-mid);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ─── Status Pill ─── */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-pill.status-available { background: var(--brand-mid);  color: #4d350b; }
.status-pill.status-locked    { background: var(--amber-mid);  color: #78350f; }
.status-pill.status-paid      { background: var(--green-mid);  color: #14532d; }
.status-pill.status-reserved  { background: var(--violet-mid); color: #4c1d95; }
.status-pill.status-closed    { background: var(--slate-mid);  color: #475569; }

/* ─── Sidebar (front page) ─── */
.side {
  position: sticky;
  top: 74px;
}

.side h2 {
  font-size: 17px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  color: var(--brand-deep);
}

.side h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 2px;
}

.side.panel.pad { padding: 18px; }

.side-content {
  display: grid;
  gap: 12px;
}

.side-empty {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  border: 1px dashed var(--border-mid);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.side-empty b {
  color: var(--text-2);
  font-size: 15px;
}

/* ─── Booth Detail ─── */
.booth-detail-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  box-shadow: var(--sh-xs);
}
.booth-detail-card.status-available { background: #fff9e8; border-color: #efd27c; }
.booth-detail-card.status-locked    { background: var(--amber-bg); border-color: var(--amber-mid); }
.booth-detail-card.status-paid      { background: var(--green-bg); border-color: var(--green-mid); }
.booth-detail-card.status-reserved  { background: #f2f7fc; border-color: #cbdff1; }
.booth-detail-card.status-closed    { background: var(--slate-bg); border-color: var(--slate-mid); }

.booth-detail-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.booth-detail-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 2px;
}

.booth-detail-code {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.1;
}

.booth-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.booth-detail-grid > div,
.booth-extra-info > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: var(--r-xs);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(234,223,202,.68);
}

.booth-detail-grid span,
.booth-extra-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.booth-detail-grid b,
.booth-extra-info b {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.booth-extra-info {
  display: grid;
  gap: 8px;
}

.booth-primary-action {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 10px;
}

.booth-unavailable {
  margin-bottom: 0;
}

/* ─── KV (Key–Value) Display ─── */
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 14px;
  font-size: 14px;
  margin: 12px 0;
  align-items: baseline;
}
.kv > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.kv > b {
  font-weight: 500;
  color: var(--text);
}
.price-highlight {
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 15px;
}

.lookup-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.lookup-panel-head {
  margin-bottom: 10px;
}

.lookup-panel-head p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.lookup-form input {
  min-height: 42px;
}

.lookup-form button {
  min-height: 42px;
  padding: 0 12px;
  font-weight: 700;
}

/* ─── Messages / Alerts ─── */
.message {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--blue-bg);
  color: var(--brand-deep);
  border: 1px solid var(--blue-mid);
  font-size: 14px;
  line-height: 1.5;
}
.message.error {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-mid);
}
.message.success {
  background: var(--green-bg);
  color: #166534;
  border-color: var(--green-mid);
}

/* ─── Payment Card ─── */
.payment-card {
  border: 1px solid var(--green-mid);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 4px;
}
.payment-card-head {
  background: var(--green-bg);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 7px;
}
.payment-card-body { padding: 4px 14px 10px; }

.wechat-pay-card {
  border: 1px solid #b7ebc6;
  background: linear-gradient(180deg, #f7fff9 0%, #ffffff 100%);
  border-radius: var(--r-sm);
  padding: 12px;
  margin: 0 0 10px;
  box-shadow: var(--sh-xs);
}

.wechat-pay-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wechat-pay-head b {
  display: block;
  color: #14532d;
  font-size: 15px;
}

.wechat-pay-head span {
  display: block;
  color: #5f745f;
  font-size: 12px;
  line-height: 1.5;
}

.wechat-pay-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: #18a058;
  color: #fff !important;
  font-weight: 800;
  font-size: 18px !important;
}

.wechat-pay-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wechat-pay-button {
  width: 100%;
  background: #18a058;
  border-color: #18a058;
  box-shadow: 0 8px 18px rgba(24, 160, 88, .18);
}

.wechat-pay-button:hover:not(:disabled) {
  background: #128047;
  border-color: #128047;
}

.wechat-pay-button.secondary-pay {
  background: #fff;
  border-color: #18a058;
  color: #128047;
  box-shadow: none;
}

.wechat-pay-button.secondary-pay:hover:not(:disabled) {
  background: #ecfdf3;
  border-color: #128047;
  color: #0f6f3d;
}

.wechat-pay-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d8eadc;
  border-radius: var(--r-sm);
  background: #fff;
}

.wechat-pay-amount {
  font-size: 20px;
  font-weight: 800;
  color: #14532d;
  margin-bottom: 4px;
}

.wechat-pay-panel p {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}

.wechat-pay-qr {
  display: grid;
  place-items: center;
  padding: 12px;
  margin: 8px 0 10px;
  border: 1px solid #e3eadf;
  border-radius: var(--r-sm);
  background: #fff;
}

.wechat-pay-qr img {
  width: min(220px, 100%);
  height: auto;
  display: block;
}

.wechat-pay-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.wechat-pay-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  background: #18a058;
  border: 1px solid #18a058;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.wechat-pay-panel textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 640px) {
  .wechat-pay-buttons {
    grid-template-columns: 1fr;
  }
}

/* ─── Lookup Result Card ─── */
.lookup-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin: 8px 0;
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.lookup-card-head {
  background: var(--surface-alt);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.lookup-card-body {
  padding: 10px 13px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ─── Form Section ─── */
.section { display: grid; gap: 14px; }

/* ─── Countdown ─── */
.countdown {
  color: var(--red);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* ─── Utility ─── */
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ─── Admin Shell ─── */
.admin-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--t);
}

.admin-shell.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

/* ─── Admin Sidebar ─── */
.sidebar {
  background:
    linear-gradient(180deg, rgba(220,177,59,.10), transparent 220px),
    #211909;
  color: #f4ead5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.sidebar-logo {
  width: 34px; height: 34px;
  border-radius: var(--r-xs);
  background: linear-gradient(180deg, #e8c75a 0%, var(--brand) 100%);
  color: #2b1d05;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(220,177,59,.22), inset 0 0 0 1px rgba(255,255,255,.24);
}

.sidebar-logo svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-header h1 {
  font-size: 14px;
  font-weight: 700;
  color: #fff8e8;
}

.sidebar-header p {
  font-size: 11.5px;
  color: #9c8a69;
  margin-top: 1px;
}

.nav {
  padding: 8px 7px;
  flex: 1;
}

.nav button {
  width: 100%;
  margin-bottom: 2px;
  text-align: left;
  background: transparent;
  color: #b9aa8d;
  border: none;
  border-radius: var(--r-xs);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--t), color var(--t);
}
.nav button:hover:not(:disabled) {
  background: rgba(220,177,59,.10);
  color: #fff2d4;
  transform: none;
  box-shadow: none;
}
.nav button.active {
  background: rgba(220,177,59,.18);
  color: #ffe7a4;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-icon {
  width: 22px;
  height: 22px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle {
  position: absolute;
  top: 12px;
  right: 10px;
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
  color: #d8c89f;
  box-shadow: none;
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle:hover:not(:disabled) {
  background: rgba(220,177,59,.16);
  transform: none;
  box-shadow: none;
}

.admin-shell.sidebar-collapsed .sidebar-header {
  padding: 14px 12px;
}

.admin-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.admin-shell.sidebar-collapsed .sidebar-brand h1,
.admin-shell.sidebar-collapsed .sidebar-header p,
.admin-shell.sidebar-collapsed .nav-label,
.admin-shell.sidebar-collapsed .sidebar-footer {
  display: none;
}

.admin-shell.sidebar-collapsed .sidebar-toggle {
  position: static;
  margin: 10px auto 0;
  transform: rotate(180deg);
}

.admin-shell.sidebar-collapsed .nav {
  padding: 8px;
}

.admin-shell.sidebar-collapsed .nav button {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}

.admin-shell.sidebar-collapsed .nav button.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
  color: #9c8a69;
}
.sidebar-footer a { color: #f0c957; }

/* ─── Admin Main ─── */
.admin-main {
  padding: 24px;
  background: var(--bg);
  min-height: 100vh;
}

.admin-main.booths-mode {
  padding: 12px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-main.booths-mode .admin-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.admin-main.booths-mode .admin-head h1 {
  font-size: 18px;
}

.admin-main.booths-mode .admin-head p {
  display: none;
}

.admin-head h1 { font-size: 21px; color: var(--text); }
.admin-head p  { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

/* ─── Dashboard Metric Cards ─── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric {
  padding: 18px 16px 14px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #fff 0%, #fffaf0 100%);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t), transform var(--t);
  position: relative;
  overflow: hidden;
}
.metric:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.metric::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.metric:nth-child(1)::after { background: var(--brand); }
.metric:nth-child(2)::after { background: var(--blue); }
.metric:nth-child(3)::after { background: var(--amber-bright); }
.metric:nth-child(4)::after { background: var(--green); }
.metric:nth-child(5)::after { background: var(--violet); }
.metric:nth-child(6)::after { background: #059669; }

.metric-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(220,177,59,.14);
}

.metric-locked .metric-dot { background: var(--map-locked); box-shadow: 0 0 0 3px rgba(200,117,44,.14); }
.metric-paid .metric-dot,
.metric-money .metric-dot { background: var(--map-paid); box-shadow: 0 0 0 3px rgba(47,158,111,.14); }
.metric-reserved .metric-dot { background: var(--map-reserved); box-shadow: 0 0 0 3px rgba(79,127,168,.14); }

.metric b {
  display: block;
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.metric span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  display: block;
}

/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}

th {
  background: #f7efe0;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
  font-size: 14px;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fffaf0; }

.table-actions {
  min-width: 150px;
  vertical-align: top;
}

.table-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.table-action-row-right {
  justify-content: flex-end;
}

.table-action-row button {
  padding: 5px 11px;
  font-size: 12.5px;
}

/* ─── Login Page ─── */
.login {
  max-width: 380px;
  margin: 13vh auto 0;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-lg) !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.login-header {
  padding: 30px 28px 24px;
  background:
    linear-gradient(130deg, rgba(220,177,59,.22), transparent 42%),
    linear-gradient(130deg, #211909 0%, #7d5813 100%);
  color: #fff;
  text-align: center;
}
.login-icon {
  font-size: 38px;
  display: block;
  margin-bottom: 12px;
}
.login-header h1 { font-size: 20px; margin-bottom: 5px; }
.login-header p  { font-size: 13px; opacity: 0.6; }

.login-body {
  padding: 24px 28px 28px;
  background: var(--surface);
}

.login-hint {
  font-size: 12px;
  color: var(--muted-light);
  text-align: center;
  margin-top: 14px;
}

/* ─── Visual Map (draggable booths) ─── */
.visual-map { user-select: none; touch-action: none; }
.visual-map .booth {
  touch-action: none;
  cursor: grab;
  overflow: visible;
}

.visual-map .booth .booth-label {
  align-self: center;
  font-size: clamp(6px, min(28cqw, 54cqh), 26px);
}

.visual-map .booth-code-mid .booth-label {
  font-size: clamp(4.5px, min(19cqw, 48cqh), 20px);
}

.visual-map .booth-code-long .booth-label {
  font-size: clamp(4.5px, min(14cqw, 40cqh), 18px);
}
.visual-map .booth:active { cursor: grabbing; }

.visual-map .booth.selected {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px var(--brand), 0 6px 18px rgba(78,51,9,.30);
  z-index: 8;
}

.rotate-handle {
  position: absolute;
  left: 50%;
  top: -22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue);
  box-shadow: 0 2px 8px rgba(15,23,42,.25);
  transform: translateX(-50%);
  cursor: grab;
  display: none;
  z-index: 12;
}

.rotate-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 12px;
  width: 1px;
  height: 10px;
  background: rgba(255,255,255,.85);
  transform: translateX(-50%);
}

.visual-map .booth.selected .rotate-handle {
  display: block;
}

.rotate-handle:active {
  cursor: grabbing;
}

/* Marquee selection rectangle */
.marquee {
  position: absolute;
  border: 1.5px dashed var(--blue);
  background: rgba(220, 177, 59, .18);
  z-index: 20;
  pointer-events: none;
  border-radius: 2px;
}

/* ─── Map Toolbar ─── */
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 6px 10px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.2;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.map-toolbar::-webkit-scrollbar,
.map-hint::-webkit-scrollbar {
  display: none;
}

.map-toolbar > * {
  flex-shrink: 0;
}

.map-toolbar .tb-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.map-toolbar .tb-sep {
  width: 1px;
  height: 18px;
  background: var(--border-mid);
  flex: 0 0 1px;
}

.zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.zoom-group button { padding: 2px 8px; font-size: 13px; line-height: 1; }
#zoom-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.snap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.snap-toggle input {
  width: auto;
  min-height: 0;
  margin: 0;
  cursor: pointer;
}

.snap-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.map-toolbar select {
  width: auto;
  min-width: 0;
  padding: 3px 7px;
  font-size: 12px;
}

.sel-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}
.sel-count.empty { color: var(--muted-light); font-weight: 500; }

.map-toolbar button {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
}

.map-toolbar select,
.map-toolbar input[type="number"] {
  min-height: 28px;
}

.map-toolbar input[type="number"] {
  padding: 3px 8px;
}

.batch-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.batch-bar.hidden { display: none; }

.batch-bar select {
  height: 26px;
  min-height: 26px;
  border-radius: 999px;
  background: var(--surface-alt);
  border-color: var(--border);
  font-size: 11.5px;
  padding: 2px 22px 2px 9px;
}

.batch-bar button {
  min-height: 26px;
  height: 26px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  box-shadow: none;
}

.batch-bar button:hover:not(:disabled) {
  transform: none;
}

.batch-bar .batch-primary {
  background: var(--brand);
  color: #2b1d05;
  border-color: var(--blue);
}

.batch-bar .batch-primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.batch-bar button.secondary {
  background: var(--blue-bg);
  color: var(--brand-deep);
  border-color: var(--blue-mid);
}

.batch-bar button.ghost {
  background: transparent;
  color: var(--muted);
  padding-left: 8px;
  padding-right: 8px;
}

.map-hint {
  padding: 4px 14px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--blue-bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.map-hint kbd {
  display: inline-block;
  padding: 0 5px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  background: #fff;
  border: 1px solid var(--border-mid);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-2);
  line-height: 1.35;
}

/* ─── Form Panel Structure ─── */
.panel-header {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.panel-header h2 { font-size: 15px; color: var(--text); }
.panel-header p  { font-size: 13px; color: var(--muted); margin-top: 4px; }

.booth-map-col > .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px 10px;
}

.booth-map-col > .panel-header h2 {
  font-size: 15px;
  white-space: nowrap;
}

.booth-map-col > .panel-header p {
  margin-top: 0;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-section {
  padding: 18px 22px 20px;
  border-bottom: 1px solid var(--border);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-actions {
  padding: 14px 22px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Required field marker */
.req {
  display: inline;
  color: var(--red);
  margin-left: 2px;
  font-weight: 700;
}

label > .req {
  display: contents;
}

/* File input */
input[type="file"] {
  padding: 8px 10px;
  background: var(--surface-alt);
  border-style: dashed;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
input[type="file"]:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--text);
}

/* Published badge */
.pub-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pub-badge.on  { background: var(--green-mid); color: #14532d; }
.pub-badge.off { background: var(--slate-mid); color: #475569; }

/* Table inside a panel: remove redundant outer borders */
.panel > table {
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--border);
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(25, 31, 21, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.15s ease;
}

.modal {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--sh-lg);
  width: 100%;
  max-width: 720px;
  max-height: min(90vh, 820px);
  overflow: hidden;
  animation: modalSlideUp 0.18s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(220,177,59,.22);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #fff 0%, #fffaf0 100%);
  z-index: 3;
  border-radius: 18px 18px 0 0;
}
.modal-head h2 {
  font-size: 17px;
  font-weight: 750;
  color: var(--text);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fffaf0;
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.modal-close:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-mid);
  transform: none;
  box-shadow: none;
}

.modal .form-actions {
  border-radius: 0 0 18px 18px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: rgba(255,250,240,.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 -8px 22px rgba(79,52,10,.08);
}

.modal > form {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal > form::-webkit-scrollbar {
  width: 10px;
}

.modal > form::-webkit-scrollbar-track {
  background: #f7efe0;
}

.modal > form::-webkit-scrollbar-thumb {
  background: #d8c59d;
  border: 2px solid #f7efe0;
  border-radius: 999px;
}

.booth-form .form-section {
  padding: 10px 20px 12px;
}

.booth-form .form-section-title {
  margin-bottom: 9px;
  font-size: 10.5px;
}

.booth-form .field-grid {
  gap: 9px 14px;
}

.booth-form label {
  gap: 5px;
  font-size: 12.5px;
  font-weight: 650;
}

.booth-form input,
.booth-form select {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13.5px;
}

.booth-form .ratio-hint {
  margin-top: 7px !important;
  padding: 6px 9px;
  border-radius: var(--r-xs);
  background: var(--brand-bg);
  border: 1px solid var(--brand-mid);
  color: var(--brand-deep);
  line-height: 1.45;
}

.booth-form .form-actions {
  padding: 10px 20px;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Booth Merged Layout ─── */
.booth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
  transition: grid-template-columns var(--t), gap var(--t);
}

.booth-layout.booth-list-collapsed {
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
}

.booth-side-col {
  position: sticky;
  top: 68px;
}

.booth-side-col > .panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 84px);
}

.booth-map-col .map-wrap {
  padding: 0;
  max-height: calc(100vh - 178px);
}

.booth-map-col .visual-map {
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}

.booth-side-rail {
  display: none;
}

.booth-side-col.collapsed .booth-list-panel {
  display: none;
}

.booth-side-col.collapsed .booth-side-rail {
  display: grid;
  width: 138px;
  min-height: 172px;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--brand-mid);
  background: linear-gradient(180deg, #fffaf0 0%, #f7e6b7 100%);
  color: var(--brand-deep);
  box-shadow: var(--sh);
  gap: 8px;
  align-items: center;
  justify-items: stretch;
  align-content: start;
}

.booth-side-col.collapsed .booth-side-rail:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}

.booth-side-rail .rail-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(220,177,59,.34);
  font-size: 22px;
  color: var(--text);
}

.rail-arrow {
  font-size: 18px;
  line-height: 1;
  justify-self: end;
}

.rail-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-deep);
}

.rail-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: var(--r-xs);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(215,197,158,.72);
  font-size: 12px;
  font-weight: 700;
}

.booth-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.booth-list-title h2 {
  font-size: 17px;
}

.booth-list-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.booth-list-head-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

.booth-collapse-btn {
  width: 34px;
  padding: 0 !important;
  font-size: 18px;
  font-weight: 800;
}

.booth-list-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  position: relative;
  background: var(--surface);
}
.booth-list-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--blue);
}
.booth-list-row.status-locked::before   { background: var(--amber-bright); }
.booth-list-row.status-paid::before     { background: var(--green); }
.booth-list-row.status-reserved::before { background: var(--violet); }
.booth-list-row.status-closed::before   { background: var(--muted-light); }
.booth-list-row:last-child { border-bottom: 0; }
.booth-list-row:hover { background: var(--surface-alt); }
.booth-list-row.checked { background: var(--blue-bg); }
.booth-list-row.dragging { opacity: 0.4; }

.booth-list-row .row-check {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}
.drag-handle {
  flex-shrink: 0;
  color: var(--muted-light);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -2px;
}
.drag-handle:active { cursor: grabbing; }

.booth-list-info {
  min-width: 0;
  cursor: pointer;
}
.booth-list-info b {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.booth-list-info span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.booth-list-info em {
  display: block;
  margin-top: 3px;
  color: var(--brand-dark);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 750;
}

.booth-list-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.icon-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--sh-xs);
  font-size: 14px;
  font-weight: 750;
}

.icon-btn:hover:not(:disabled) {
  transform: none;
  background: var(--brand-bg);
  border-color: var(--brand-mid);
  color: var(--brand-deep);
  box-shadow: var(--sh-sm);
}

.icon-btn.copy {
  color: var(--brand-dark);
}

.icon-btn.edit {
  color: var(--text-2);
}

.icon-btn.delete {
  background: var(--red-bg);
  border-color: var(--red-mid);
  color: var(--red);
}

.icon-btn.delete:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Group headers */
.booth-group { border-bottom: 1px solid var(--border); }
.booth-group:last-child { border-bottom: 0; }
.booth-group-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 8px 12px;
  background: linear-gradient(180deg, #fffaf0 0%, var(--surface-alt) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  user-select: none;
}
.booth-group-head:hover { background: var(--brand-bg); }
.booth-group-head.drag-over { background: var(--brand-mid); }
.booth-group-toggle {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  border-color: transparent;
  background: transparent;
  color: var(--brand-deep);
  box-shadow: none;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  transition: transform var(--t);
}
.booth-group-toggle:hover:not(:disabled) {
  background: rgba(220,177,59,.16);
  transform: none;
  box-shadow: none;
}
.booth-group.collapsed .booth-group-toggle { transform: rotate(-90deg); }
.booth-group.collapsed .booth-group-rows { display: none; }

.booth-group-main {
  min-width: 0;
  cursor: pointer;
}

.booth-group-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booth-group-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.booth-group-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.booth-group-actions button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 11.5px;
  box-shadow: var(--sh-xs);
}

.booth-group-actions .ghost {
  color: var(--brand-dark);
  padding: 3px 6px;
}

.booth-group-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}

/* List batch bar */
.list-batch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fffaf0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.list-batch-bar button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}
.list-batch-bar .sel-count { font-size: 12px; }

.list-batch-bar .batch-action {
  border-radius: 999px;
  box-shadow: none;
}

.list-batch-bar .batch-action:disabled {
  background: var(--surface);
  color: var(--muted-light);
  border-color: var(--border);
  opacity: .72;
}

.list-batch-bar .batch-action:not(:disabled) {
  box-shadow: var(--sh-xs);
}

.list-batch-bar #list-delete-btn:not(:disabled) {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-mid);
}

.list-batch-bar #list-delete-btn:not(:disabled):hover {
  background: var(--red);
  color: #fff;
}
#booth-list { flex: 1; overflow-y: auto; min-height: 0; }

/* Drag-saving indicator */
@keyframes saving-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.booth-saving { animation: saving-pulse 0.6s ease infinite; }

@media (max-width: 900px) {
  .booth-layout   { grid-template-columns: 1fr; }
  .booth-side-col { position: static; }
  .booth-side-col > .panel { max-height: none; }
  #booth-list { max-height: 60vh; }
}

/* ─── Empty State ─── */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ─── Responsive ─── */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
}

@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 16px; height: 56px; }
  .topbar h1 { font-size: 15px; }
  .topbar-icon { width: 34px; height: 34px; font-size: 17px; }
  .admin-link { padding: 6px 10px; font-size: 12px; }
  .layout { padding: 12px; gap: 12px; }
  .toolbar { padding: 8px 10px; gap: 8px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 14px; }
}

@media (max-width: 700px) {
  body {
    font-size: 14px;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  button {
    min-height: 42px;
    padding: 9px 13px;
  }

  .topbar {
    height: auto;
    min-height: 58px;
    padding: 10px 12px;
    align-items: flex-start;
  }

  .topbar-brand {
    min-width: 0;
    gap: 9px;
  }

  .topbar h1 {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-subtitle {
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex-shrink: 0;
  }

  .admin-link {
    height: 36px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .panel {
    border-radius: var(--r-sm);
  }

  .panel.pad,
  .side.panel.pad {
    padding: 14px;
  }

  .toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: calc(100vw - 22px);
  }

  .toolbar label {
    min-width: 0;
    flex-shrink: 0;
  }

  .toolbar select {
    min-width: 128px;
    width: 128px;
    font-size: 13px;
    min-height: 34px;
    padding: 5px 30px 5px 10px;
  }

  .status-filter-label {
    gap: 8px;
    padding-right: 8px;
  }

  .toolbar .legend {
    display: flex;
    margin-left: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    min-width: 0;
    flex: 0 0 auto;
  }

  .badge {
    flex-shrink: 0;
    min-height: 32px;
    padding: 4px 10px;
  }

  .map-wrap {
    padding: 10px;
    overscroll-behavior-x: contain;
    display: block;
    max-width: calc(100vw - 22px);
    max-height: calc(100vh - 148px);
  }

  .map-wrap::before {
    content: "可左右滑动查看完整展位图";
    display: block;
    margin: 0 0 8px;
    padding: 7px 9px;
    border-radius: var(--r-xs);
    background: var(--blue-bg);
    color: var(--brand-deep);
    font-size: 12px;
    border: 1px solid var(--blue-mid);
  }

  .map {
    min-width: 720px;
    width: 720px;
  }

  .map.zoomable-map {
    max-width: none;
  }

  .booth {
    min-width: 30px;
    min-height: 26px;
    font-size: 9.5px;
  }

  .front-map-tools {
    top: 10px;
    left: calc(100% - 160px);
    width: 146px;
    gap: 5px;
    margin-bottom: -126px;
    padding: 6px;
    border-radius: var(--r-sm);
  }

  .front-zoom-controls {
    grid-template-columns: 26px 1fr 26px 38px;
    gap: 4px;
  }

  #front-zoom-label {
    font-size: 11px;
  }

  .front-pan-pad {
    grid-template-columns: repeat(3, 26px);
    grid-template-rows: repeat(3, 24px);
    gap: 4px;
  }

  .map-tool-btn {
    width: 26px;
    min-height: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 13px;
  }

  .map-refresh-btn {
    width: 38px;
    font-size: 11px;
  }

  .grid-booths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .booth-card {
    padding: 12px;
  }

  .booth-card-header {
    align-items: center;
  }

  .booth-card strong {
    font-size: 16px;
  }

  .side {
    position: static;
    order: 2;
  }

  .side h2 {
    font-size: 15px;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .kv {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .kv > b {
    overflow-wrap: anywhere;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    max-width: none !important;
    max-height: 92vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  .modal-head {
    padding: 14px 16px;
  }

  .modal .form-section,
  .form-section {
    padding: 14px 16px 16px;
  }

  .modal .form-actions,
  .form-actions {
    padding: 12px 16px;
  }

  .form-actions button {
    flex: 1;
  }

  .admin-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 120;
    overflow: visible;
  }

  .sidebar-header {
    padding: 12px 14px 8px;
  }

  .sidebar-header p,
  .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px 10px;
    -webkit-overflow-scrolling: touch;
  }

  .nav button {
    width: auto;
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 8px 10px;
  }

  .admin-main {
    padding: 12px 10px 18px;
  }

  .admin-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .admin-head h1 {
    font-size: 18px;
  }

  .admin-head label {
    width: 100%;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric {
    padding: 14px 12px 12px;
  }

  .metric b {
    font-size: 20px;
  }

  .panel-header {
    padding: 14px 14px 12px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: var(--r-sm);
    -webkit-overflow-scrolling: touch;
  }

  th,
  td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .table-action-row {
    flex-wrap: nowrap;
  }

  .booth-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .booth-side-col {
    position: static;
  }

  .booth-side-col > .panel {
    max-height: none;
  }

  .map-toolbar {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 9px 10px;
    -webkit-overflow-scrolling: touch;
  }

  .map-toolbar > * {
    flex-shrink: 0;
  }

  .map-hint {
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .visual-map {
    min-width: 760px;
    width: 760px;
  }

  #booth-list {
    max-height: none;
  }

  .list-batch-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 8px 10px;
  }

  .booth-list-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 7px;
    padding: 9px 10px 9px 12px;
  }

  .booth-list-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .login {
    margin: 8vh 12px 0;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .toolbar {
    flex-wrap: nowrap;
  }

  .grid-booths,
  .cards {
    grid-template-columns: 1fr;
  }

  .topbar h1,
  .topbar-subtitle {
    max-width: 52vw;
  }
}

/* ─── Front Mobile Polish ─── */
@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background: #f8f2e5;
  }

  .topbar {
    width: 100%;
    max-width: 100vw;
    min-height: 64px;
    padding: 10px 12px;
    align-items: center;
    overflow: hidden;
  }

  .topbar-brand {
    width: 100%;
  }

  .topbar-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 18px;
  }

  .topbar h1 {
    max-width: calc(100vw - 86px);
    font-size: 16px;
    line-height: 1.2;
  }

  .topbar-subtitle {
    max-width: calc(100vw - 86px);
    font-size: 12px;
    margin-top: 3px;
  }

  .mobile-browser-tip {
    display: flex;
    align-items: center;
    gap: 9px;
    width: calc(100% - 16px);
    margin: 8px 8px 0;
    padding: 10px;
    border: 1px solid rgba(220, 177, 59, .45);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff8e6 0%, #fff2cf 100%);
    box-shadow: 0 6px 18px rgba(79, 52, 10, .10);
  }

  .mobile-browser-tip[hidden] {
    display: none;
  }

  .mobile-browser-tip-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--brand);
    color: #2b1d05;
    font-weight: 800;
    font-size: 15px;
  }

  .mobile-browser-tip-text {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 2px;
  }

  .mobile-browser-tip-text b {
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.25;
  }

  .mobile-browser-tip-text span {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
  }

  .mobile-browser-tip-close {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
    color: var(--text-2);
    border-color: rgba(220, 177, 59, .45);
    box-shadow: none;
  }

  .layout {
    width: 100%;
    max-width: 100vw;
    padding: 8px 8px 12px;
    gap: 8px;
    overflow: hidden;
    align-items: stretch;
  }

  .layout > .panel,
  .layout > .panel:first-child {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    max-width: 100%;
    padding: 8px;
    gap: 8px;
    background: rgba(255, 250, 240, .96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .status-filter-label {
    gap: 6px;
    padding-right: 8px;
  }

  .status-filter-label > span {
    font-size: 12px;
  }

  .toolbar select {
    width: 116px;
    min-width: 116px;
    min-height: 32px;
    padding: 4px 28px 4px 10px;
    font-size: 12px;
  }

  .toolbar .legend {
    gap: 6px;
    scrollbar-width: none;
  }

  .toolbar .legend::-webkit-scrollbar {
    display: none;
  }

  .badge {
    min-height: 30px;
    padding: 3px 9px;
    font-size: 12px;
  }

  .dot {
    width: 9px;
    height: 9px;
  }

  .map-wrap {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 132px);
    padding: 6px;
    border-radius: 0 0 10px 10px;
    overflow: auto;
    overscroll-behavior-x: contain;
  }

  .map-wrap > .map {
    max-width: none;
  }

  #booth-stage {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .map-wrap::before {
    content: none;
  }

  .front-map-tools {
    top: 8px;
    left: calc(100% - 148px);
    width: 140px;
    padding: 6px;
    gap: 5px;
    margin-bottom: -118px;
    border-radius: 10px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 22px rgba(79,52,10,.14);
  }

  .front-zoom-controls {
    grid-template-columns: 25px 1fr 25px 36px;
  }

  #front-zoom-label {
    font-size: 11px;
  }

  .front-pan-pad {
    grid-template-columns: repeat(3, 25px);
    grid-template-rows: repeat(3, 23px);
  }

  .map-tool-btn {
    width: 25px;
    min-height: 23px;
    height: 23px;
    border-radius: 7px;
    font-size: 12px;
  }

  .map-refresh-btn {
    width: 36px;
    font-size: 10.5px;
  }

  .side.panel.pad {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border-radius: 10px;
  }

  .side h2 {
    font-size: 16px;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .side-empty {
    padding: 13px;
    font-size: 12.5px;
  }

  .booth-detail-card {
    gap: 10px;
    padding: 12px;
  }

  .booth-detail-code {
    font-size: 24px;
  }

  .booth-detail-grid {
    gap: 7px;
  }

  .booth-detail-grid > div,
  .booth-extra-info > div {
    padding: 8px;
  }

  .booth-detail-grid span,
  .booth-extra-info span {
    font-size: 11.5px;
  }

  .booth-detail-grid b,
  .booth-extra-info b {
    font-size: 14px;
  }

  .price-highlight {
    font-size: 16px;
  }

  .booth-primary-action {
    min-height: 44px;
    font-size: 15px;
    border-radius: 9px;
  }

  .lookup-panel {
    margin-top: 12px;
    padding-top: 12px;
  }

  .lookup-panel-head {
    margin-bottom: 8px;
  }

  .lookup-form {
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 7px;
  }

  .lookup-form input,
  .lookup-form button {
    min-height: 40px;
  }

  .lookup-card-head {
    padding: 8px 10px;
  }

  .lookup-card-body {
    padding: 9px 10px;
  }
}

@media (max-width: 390px) {
  .booth-detail-grid {
    grid-template-columns: 1fr;
  }

  .lookup-form {
    grid-template-columns: 1fr;
  }
}
