:root {
  --bg: #f6f2ea;
  --panel: rgba(255, 255, 255, 0.82);
  --text: #24312d;
  --soft: #65716c;
  --line: rgba(38, 49, 45, 0.12);
  --accent: #9f3b37;
  --green: #2f8f7b;
  --gray: #8a948f;
  --gold: #b7792f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(120deg, rgba(47, 143, 123, 0.10), transparent 32%),
    linear-gradient(240deg, rgba(159, 59, 55, 0.10), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 242, 234, 0.88);
  backdrop-filter: blur(20px);
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.1;
}

.topbar p,
.section-head p {
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
}

.top-actions button,
.assignment-actions button {
  min-height: 38px;
  padding: 8px 12px;
}

main {
  padding: 24px 28px 40px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(38, 49, 45, 0.08);
}

.metrics article {
  padding: 16px;
}

.metrics span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.controls {
  position: sticky;
  top: 118px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 9px 11px;
}

.result-count {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.batch-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.batch-actions button {
  min-height: 38px;
}

.batch-actions button.active {
  border-color: rgba(159, 59, 55, 0.54);
  background: rgba(159, 59, 55, 0.1);
  color: var(--accent);
}

.batch-status {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.occupied {
  background: var(--green);
}

.dot.vacant {
  background: var(--gray);
}

.dot.corridor {
  width: 24px;
  height: 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(38, 49, 45, 0.14);
}

.dot.pillar {
  background: rgba(38, 49, 45, 0.28);
}

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

.section-head h2 {
  font-size: 18px;
}

.floor-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf6;
}

.floor-plan {
  position: relative;
  min-height: 1500px;
  min-width: 760px;
  background:
    linear-gradient(90deg, rgba(32, 38, 36, 0.04) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(0deg, rgba(32, 38, 36, 0.04) 1px, transparent 1px) 0 0 / 100% 2.78%,
    #fbfaf6;
}

.seat-zone,
.seat-structure,
.seat-node {
  position: absolute;
}

.seat-zone {
  display: none;
  z-index: 0;
  align-items: flex-start;
  border: 2px dashed;
  border-radius: 8px;
  color: rgba(32, 38, 36, 0.42);
  font-size: 13px;
  font-weight: 900;
  padding: 10px;
  pointer-events: none;
}

.seat-zone-north {
  inset: 2.8% 13% 60% 1.8%;
}

.seat-zone-central {
  inset: 37% 13% 32% 1.8%;
}

.seat-zone-south {
  inset: 67% 13% 2.5% 1.8%;
}

.seat-structure {
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(32, 38, 36, 0.14);
  border-radius: 8px;
  color: rgba(32, 38, 36, 0.62);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.seat-structure-corridor {
  border-style: solid;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(38, 49, 45, 0.44);
}

.seat-structure-pillar {
  border: 2px solid rgba(38, 49, 45, 0.28);
  background: rgba(38, 49, 45, 0.12);
}

.seat-structure-north {
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent);
}

.seat-node {
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  overflow: visible;
  border: 2px solid var(--team-color, rgba(32, 38, 36, 0.18));
  border-radius: 8px;
  color: #fff;
  padding: 4px 5px;
  text-align: center;
  box-shadow: inset 0 8px 0 var(--team-color, transparent);
  transition: opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.seat-node.occupied {
  background: var(--green);
}

.seat-node.vacant {
  background: rgba(138, 148, 143, 0.22);
  border-color: rgba(38, 49, 45, 0.14);
  color: rgba(38, 49, 45, 0.72);
  box-shadow: inset 0 8px 0 rgba(138, 148, 143, 0.16);
}

.seat-node.unavailable,
.status-pill.unavailable {
  background: #eee8e3;
  color: rgba(88, 67, 58, 0.86);
}

.seat-node.unavailable {
  border-color: rgba(159, 59, 55, 0.22);
  box-shadow: inset 0 8px 0 rgba(159, 59, 55, 0.22);
}

.seat-node strong {
  font-size: 13px;
  line-height: 1;
}

.seat-node span {
  width: 100%;
  overflow: visible;
  font-size: 12px;
  line-height: 1.12;
  white-space: normal;
  word-break: keep-all;
}

.seat-node:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 8px 0 var(--team-color, transparent), 0 12px 22px rgba(31, 41, 36, 0.18);
}

.seat-node.selected {
  box-shadow: inset 0 8px 0 var(--team-color, transparent), 0 0 0 3px #fff, 0 0 0 6px rgba(159, 59, 55, 0.74), 0 16px 28px rgba(31, 41, 36, 0.2);
}

.seat-node.batch-selected {
  box-shadow: inset 0 8px 0 var(--team-color, transparent), 0 0 0 3px #fff, 0 0 0 7px rgba(183, 121, 47, 0.86), 0 16px 28px rgba(31, 41, 36, 0.22);
}

.seat-node.office {
  grid-template-columns: auto 1fr;
  justify-items: center;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--team-color, #6f3fa8), #2f8f7b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 14px 26px rgba(31, 41, 36, 0.13);
}

.seat-node.office strong {
  font-size: 18px;
}

.seat-node.office span {
  font-size: 14px;
  font-weight: 900;
}

.seat-node.muted {
  opacity: 0.18;
}

.seat-detail-number {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  margin: 10px 0 16px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.vacant {
  background: var(--gray);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.detail-list dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.assignment-box {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.people-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.person-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
}

.person-button strong,
.person-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-button span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.person-button.pending {
  border-color: rgba(183, 121, 47, 0.34);
  background: rgba(255, 247, 235, 0.9);
}

.person-button.active {
  color: #fff;
  background: var(--accent);
}

.person-button.active span {
  color: rgba(255, 255, 255, 0.84);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .legend {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, max-content);
  }
}

@media (max-width: 720px) {
  .topbar,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar,
  .section-head {
    flex-direction: column;
  }

  .metrics,
  .controls {
    grid-template-columns: 1fr;
  }

  .floor-plan {
    min-width: 840px;
    min-height: 1260px;
  }
}
