:root {
  --color-bg: #f2f6f7;
  --color-card: #ffffff;
  --color-primary: #1c768f;
  --color-primary-dark: #032539;
  --color-primary-light: #56a3ba;
  --color-accent: #fa991c;
  --color-text: #032539;
  --color-muted: #6b7280;
  --color-border: #dfe6e8;
  --color-error-bg: #fdecea;
  --color-error-text: #b3261e;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

/* --- Auth (login) page --- */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
}

.auth-footer {
  color: var(--color-muted);
  font-size: 0.78rem;
  text-align: center;
}

.auth-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
}

.auth-card h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
  text-align: center;
}

.tagline {
  text-align: center;
  color: var(--color-primary);
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subtitle {
  text-align: center;
  color: var(--color-muted);
  margin: 4px 0 24px;
  font-size: 0.9rem;
}

.auth-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 14px 0 6px;
}

.auth-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
}

.auth-card input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.auth-card button {
  width: 100%;
  margin-top: 22px;
  padding: 11px;
  background: linear-gradient(155deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-card button:hover {
  background: linear-gradient(155deg, var(--color-primary) 0%, var(--color-primary-dark) 75%, #021620 100%);
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

/* --- App shell (dashboards) --- */
.topbar {
  background: linear-gradient(100deg, var(--color-primary-light) 0%, var(--color-primary) 45%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
}

.brand-tagline {
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

.topnav {
  display: flex;
  gap: 16px;
}

.topnav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

.topnav a:hover,
.topnav a.active {
  color: #fff;
  border-bottom-color: #fff;
}

.topbar-right {
  white-space: nowrap;
}

.logout-link {
  color: #fff;
  margin-left: 14px;
  text-decoration: underline;
}

.app-footer {
  max-width: 960px;
  margin: 40px auto 0;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.page-narrow {
  max-width: 520px;
}

.page h1 {
  font-size: 1.6rem;
  margin-top: 0;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
}

.page-head select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.88rem;
}

.muted {
  color: var(--color-muted);
}

.small {
  font-size: 0.82rem;
}

.hidden {
  display: none !important;
}

.link-small {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: #eaeff1;
  padding: 5px 13px;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.4;
  transition: background 0.15s ease;
}

.link-small:hover {
  background: #dbe3e7;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-block {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(155deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
  color: #fff;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
  background: linear-gradient(155deg, var(--color-primary) 0%, var(--color-primary-dark) 75%, #021620 100%);
}

.btn-secondary {
  background: #eceef2;
  color: var(--color-text);
}

.btn-secondary:hover {
  background: #dfe2e8;
}

.btn-danger {
  background: var(--color-error-text);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

/* --- Cards / forms --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.theater-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.theater-card h3 {
  margin: 0 0 4px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.empty-state {
  color: var(--color-muted);
  padding: 40px 0;
  text-align: center;
}

.form-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.form-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 12px 0 6px;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="number"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.danger-zone {
  border-color: var(--color-error-text);
}

.danger-zone h3 {
  margin-top: 0;
}

.share-link-card label {
  margin-top: 0 !important;
}

.share-link-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.share-link-row input {
  flex: 1;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: #f7f9fa;
  color: var(--color-muted);
}

.form-card select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
  margin-top: 16px !important;
}

.checkbox-label input {
  width: auto;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
}

.switch-row-text {
  font-size: 0.9rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.switch input:checked ~ .switch-track {
  background: var(--color-primary);
}

.switch input:checked ~ .switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch input:focus-visible ~ .switch-track {
  box-shadow: 0 0 0 3px rgba(28, 118, 143, 0.35);
}

.alert-info {
  background: #eef2fb;
  color: #2c4a8f;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* --- Dashboard stats --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.stat-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2430;
}

.stat-label {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.stat-card .link-small {
  margin-top: 6px;
}

/* --- Data table --- */
.table-wrap {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}

.data-table thead th {
  color: var(--color-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--color-border);
}

.role-badge,
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.role-admin {
  background: #fdead0;
  color: #a15c00;
}

.role-manager {
  background: #eef2fb;
  color: #2c4a8f;
}

.role-coordinator {
  background: #eef7ee;
  color: #2e7d32;
}

.status-active {
  background: #eef7ee;
  color: #2e7d32;
}

.status-inactive {
  background: #f1f1f3;
  color: var(--color-muted);
}

.status-held {
  background: #fdf3d0;
  color: #8a6d00;
}

/* --- Events --- */
.event-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.event-banner {
  height: 120px;
  background: #e2e4e9 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.event-card-body {
  padding: 14px 16px;
}

.event-card-body h3 {
  margin: 0 0 2px;
}

.event-card-body p {
  margin: 2px 0;
}

.price-fields {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.price-row:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.price-row span {
  font-size: 0.88rem;
  font-weight: 600;
}

.price-row input {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.checkbox-list {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 220px;
  overflow-y: auto;
}

.checkbox-list .checkbox-label {
  margin-top: 8px !important;
}

.checkbox-list .checkbox-label:first-child {
  margin-top: 0 !important;
}

.banner-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.banner-choice {
  display: block;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 !important;
}

.banner-choice input {
  display: none;
}

.banner-choice img {
  display: block;
  width: 70px;
  height: 46px;
  object-fit: cover;
}

.banner-choice input:checked + img,
.banner-choice:has(input:checked) {
  border-color: var(--color-primary);
}

.current-banner img {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* --- Booking Engine --- */
.booking {
  display: flex;
  align-items: flex-start;
  position: relative;
}

.booking-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 16px;
}

.booking-sidebar .sidebar-section h2 {
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.booking-main {
  flex: 1;
  min-width: 0;
  height: calc(100vh - 56px);
  padding: 20px;
  display: flex;
}

.seat-chart-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #232733 0%, #2c3040 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.stage-arc {
  flex-shrink: 0;
  margin: 22px auto 0;
  width: min(70%, 480px);
  height: 34px;
  background: linear-gradient(180deg, #464c5e 0%, #383d4d 100%);
  border-radius: 0 0 60px 60px / 0 0 26px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.stage-arc span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
}

.booking-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.booking-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.legend-name {
  flex: 1;
}

.legend-price {
  color: var(--color-muted);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.legend-held {
  background: #f5c518;
}

.legend-booked {
  background: #616161;
}

.booking-seat {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  user-select: none;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  line-height: 1.1;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.booking-seat .seat-timer {
  font-size: 0.52rem;
  font-weight: 600;
}

.seat-held,
.seat-held-mine {
  background: #f5c518 !important;
  color: #3a2e00;
  text-shadow: none;
}

.seat-held-mine {
  border-color: #fff !important;
  box-shadow: 0 0 0 3px var(--color-primary), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.seat-held {
  cursor: default;
  opacity: 0.9;
}

.seat-booked {
  cursor: pointer;
}

/* "Dim booked seats" toggle — de-emphasizes booked seats so held/pending
   seats are the ones that catch the eye instead. */
#booking.dim-booked .seat-booked {
  opacity: 0.15;
  filter: grayscale(55%);
}

.seat-booked::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #2e7d32;
  color: #fff;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  font-size: 0.52rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: none;
  border: 1.5px solid #fff;
}

.seat-free:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 3px 8px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.modal label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 10px 0 4px;
}

.modal input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.92rem;
}

.details-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.details-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.details-row span:first-child {
  color: var(--color-muted);
}

.legend-taken {
  background: #616161;
}

/* --- Client Snapshot --- */
.snapshot-body {
  background: #ebe7e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 40px;
}

.snapshot-toolbar {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px;
}

.snapshot-stage-bg {
  width: 100%;
  display: flex;
  justify-content: center;
}

.snapshot-card {
  width: 100%;
  max-width: 640px;
  background: #fffdf9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.snapshot-banner {
  height: 220px;
  background: #d8d3c8 center/cover no-repeat;
}

.snapshot-header {
  text-align: center;
  padding: 26px 24px 6px;
}

.snapshot-header h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  color: #1f2430;
}

.snapshot-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.live-indicator {
  margin-top: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem !important;
  font-weight: 600;
  color: #2e7d32 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2e7d32;
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(46, 125, 50, 0); }
}

.snapshot-chart {
  margin: 22px 24px 0;
  background: linear-gradient(180deg, #232733 0%, #1b1e27 100%);
  border-radius: 14px;
  overflow: hidden;
  padding-bottom: 20px;
}

.snapshot-seatwrap {
  position: relative;
  height: 320px;
}

.snapshot-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
}

.snapshot-seat {
  position: absolute;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.snapshot-seat-taken {
  opacity: 0.32;
  filter: grayscale(70%);
}

.snapshot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  padding: 20px 24px 28px;
}

.snapshot-legend .legend-row {
  font-size: 0.85rem;
}

.snapshot-legend .legend-price {
  font-weight: 600;
  color: #1f2430;
}

@media (max-width: 900px) {
  .booking {
    flex-direction: column;
    align-items: stretch;
  }

  .booking-sidebar {
    width: 100%;
    height: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .booking-main {
    height: auto;
    padding: 14px;
  }

  .booking-viewport {
    flex: none;
    height: 65vh;
  }
}

/* --- Theater Builder --- */
.builder {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.builder-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 16px;
}

.sidebar-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section h2 {
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.sidebar-section h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  margin: 0 0 10px;
}

.sidebar-section label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 10px 0 4px;
}

.sidebar-section input[type="text"],
.sidebar-section input[type="number"] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 0.87rem;
}

.category-chip.active {
  border-color: var(--color-primary);
  background: #fdead0;
}

.category-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.category-chip .cat-name {
  flex: 1;
}

.category-chip .cat-edit,
.category-chip .cat-delete {
  color: var(--color-muted);
  font-size: 0.8rem;
  padding: 0 4px;
}

.category-chip .cat-edit:hover {
  color: var(--color-primary);
}

.category-chip .cat-delete:hover {
  color: var(--color-error-text);
}

.category-add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.category-add input[type="text"] {
  flex: 1;
  min-width: 110px;
  padding: 7px 9px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.category-add input[type="color"] {
  width: 40px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px;
}

.rotate-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 10px;
}

.builder-main {
  flex: 1;
  min-width: 0;
}

.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
  flex-wrap: wrap;
  gap: 10px;
}

.zoom-controls,
.save-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-viewport {
  height: calc(100vh - 116px);
  overflow: auto;
  background: #eef0f4;
  background-image: radial-gradient(circle, #d7dae0 1px, transparent 1px);
  background-size: 22px 22px;
}

.builder-canvas-sizer {
  position: relative;
}

.builder-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 2200px;
  height: 1300px;
  transform-origin: 0 0;
  background: transparent;
  touch-action: none;
}

.stage-label {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2b2f3a;
  color: #fff;
  padding: 8px 40px;
  border-radius: 4px;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  user-select: none;
}

.seat {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  cursor: grab;
  user-select: none;
  touch-action: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.seat.selected {
  border-color: #1f2430;
  box-shadow: 0 0 0 2px #1f2430;
}

.selection-box {
  position: absolute;
  border: 1px dashed var(--color-primary);
  background: rgba(107, 47, 179, 0.08);
  pointer-events: none;
}

.rotate-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: grab;
  touch-action: none;
}

@media (max-width: 900px) {
  .builder {
    flex-direction: column;
    align-items: stretch;
  }

  .builder-sidebar {
    width: 100%;
    height: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .builder-viewport {
    height: 65vh;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 18px;
  }
}
