/* 座位平面圖。效能規矩：本檔不得使用 transition／animation／box-shadow／transform／filter；
   hover 只換 stroke 顏色。tests/floorplan-browser.mjs 會掃描本檔。 */
:root {
  --page: #f5f6fb;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #687286;
  --line: #dce1ec;
  --blue: #3157d5;
  --blue-soft: #e9efff;
  --hl-fill: #ffe14d;
  --hl-stroke: #d6360f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body.floorplan-body {
  background: var(--page);
  color: var(--ink);
  font: 500 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
}

.fp-shell { display: flex; flex-direction: column; height: 100%; padding: 14px 18px; gap: 10px; }

.fp-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fp-brand { display: flex; align-items: center; gap: 12px; }
.fp-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 9px; background: var(--ink); color: #fff;
  font-weight: 900; text-decoration: none;
}
.fp-kicker { margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1; }
.fp-brand h1 { margin: 0; font-size: 22px; line-height: 1.2; }

.fp-nav { display: inline-flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fp-nav a {
  min-height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid transparent;
  border-radius: 7px; color: #526079; font-weight: 800; text-decoration: none;
}
.fp-nav a.active { border-color: rgba(49, 87, 213, 0.35); background: var(--blue-soft); color: var(--blue); }

.fp-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fp-search { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.fp-search input {
  width: min(340px, 60vw); min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.fp-count { color: var(--muted); font-weight: 700; min-width: 7em; }
.fp-zoom { display: inline-flex; gap: 4px; margin-left: auto; }
.fp-zoom button {
  min-height: 34px; min-width: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer;
}

.fp-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; }
.fp-canvas { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.fp-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 14px; align-self: start; }
.fp-status { margin: 0 0 8px; font-weight: 800; }
.fp-status[data-tone="error"] { color: #b42318; }
.fp-detail { margin: 0 0 10px; display: grid; grid-template-columns: 5em 1fr; gap: 4px 8px; }
.fp-detail dt { color: var(--muted); font-weight: 700; }
.fp-detail dd { margin: 0; font-weight: 800; word-break: break-all; }
.fp-crm-link { display: inline-block; margin-bottom: 10px; color: var(--blue); font-weight: 800; }
.fp-hint { margin: 0; color: var(--muted); font-size: 12px; }

/* 排座位與座位檢查 */
.fp-panel { max-height: 100%; overflow: auto; }
.fp-assign, .fp-audit { margin-bottom: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fp-assign-label { display: block; margin-bottom: 4px; font-weight: 800; }
.fp-assign input {
  width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.fp-assign-note { min-height: 1.5em; margin: 8px 0; font-size: 13px; word-break: break-all; }
.fp-assign-note[data-tone="error"] { color: #b42318; font-weight: 800; }
.fp-assign-note[data-tone="saved"] { color: #1f7a3d; font-weight: 800; }
.fp-assign-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fp-panel button {
  min-height: 34px; padding: 0 12px; border: 1px solid var(--blue); border-radius: 7px;
  background: var(--blue); color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.fp-panel button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.fp-panel button:disabled { border-color: var(--line); background: var(--page); color: var(--muted); cursor: not-allowed; }
.fp-audit-line { margin: 8px 0 0; font-size: 13px; }
.fp-audit-title { margin: 10px 0 4px; font-weight: 800; }
.fp-audit-list { margin: 0; padding: 0; list-style: none; }
.fp-audit-list li { margin-bottom: 4px; }
.fp-panel .fp-audit-list button {
  width: 100%; min-height: 30px; padding: 4px 8px; border-color: var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 700; text-align: left; word-break: break-all;
}

/* SVG：只有一張圖，縮放改 width（viewBox 自動等比），不做拖曳。 */
.floorplan-svg { display: block; width: 100%; height: auto; }
.floorplan-svg text { font-family: "Helvetica Neue", "PingFang TC", "Heiti TC", sans-serif; fill: #1f2a37; }
.floorplan-svg text.no { font-weight: 700; }
.floorplan-svg .seat { cursor: pointer; }
.floorplan-svg .seat text { pointer-events: none; }
.floorplan-svg .bx { fill: #ffffff; fill-opacity: 0.82; stroke: transparent; stroke-width: 0.9; }
.floorplan-svg .seat:hover .bx { stroke: var(--blue); }
.floorplan-svg .seat.empty text { fill: #6b7280; }
.floorplan-svg .seat.hl .bx { fill: var(--hl-fill); fill-opacity: 1; stroke: var(--hl-stroke); }
.floorplan-svg .seat.hl text { fill: #8a1c00; }
.floorplan-svg .seat.sel .bx { stroke: var(--blue); stroke-width: 1.4; }

@media (max-width: 860px) {
  .fp-shell { height: auto; }
  .fp-workspace { grid-template-columns: 1fr; }
  .fp-canvas { min-height: 60vh; }
  .fp-panel { max-height: none; overflow: visible; }
}
