:root {
  --bg: #090909;
  --bg-2: #141414;
  --fg: #ffffff;
  --fg-muted: rgba(255,255,255,0.55);
  --fg-faint: rgba(255,255,255,0.32);
  --line: rgba(255,255,255,0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Cairo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; padding: 24px; }

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 40px 30px 30px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
}

.login-mark { width: 82px; margin-bottom: 30px; }

.login-card form { display: flex; flex-direction: column; gap: 16px; text-align: right; }
.login-card label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--fg-muted); }

input {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s var(--ease);
}
input:focus { border-color: rgba(255,255,255,0.55); }

button {
  padding: 13px 26px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.3s var(--ease);
}
button:hover { opacity: 0.85; }
button:disabled { opacity: 0.45; cursor: default; }

button.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 9px 20px;
  font-size: 13px;
}

.error { margin: 0; font-size: 12.5px; color: #ff8a8a; }

/* ---------- dashboard ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.bar-mark { width: 46px; }
.mobile-nav-toggle { display: none; }
.event-context {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-inline-start: 10px;
}
.event-context span { color: var(--fg-faint); font-size: 10px; white-space: nowrap; }
.event-context select { min-width: 170px; max-width: 250px; padding: 8px 10px; font-size: 12px; }
.event-context b { padding: 4px 8px; border: 1px solid var(--line); font-size: 10px; font-weight: 600; white-space: nowrap; }
.who { margin-inline-start: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; }
.who .role { font-size: 11px; color: var(--fg-faint); letter-spacing: 0.08em; }

.dashboard-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 22px 60px;
  align-items: start;
}

.wrap { min-width: 0; display: flex; flex-direction: column; gap: 30px; }

.side-nav {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(255,255,255,0.22);
}

.side-title {
  margin-bottom: 8px;
  color: var(--fg-faint);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.side-link,
.side-sub button {
  width: 100%;
  text-align: right;
  border-radius: 10px;
}

.side-link {
  padding: 11px 13px;
  background: transparent;
  color: var(--fg);
  border: 1px solid transparent;
}

.side-link.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.side-sub {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: -2px 8px 8px 0;
  padding-right: 10px;
  border-right: 1px solid rgba(255,255,255,0.10);
}

.side-sub button {
  padding: 7px 10px;
  background: transparent;
  color: var(--fg-muted);
  border: none;
  font-size: 12px;
}

.side-sub button:hover,
.side-sub button.active {
  color: var(--fg);
  background: rgba(255,255,255,0.07);
}

.admin-section[hidden] {
  display: none !important;
}

.admin-section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.section-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.card {
  padding: 20px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.card .k { font-size: 11.5px; color: var(--fg-faint); letter-spacing: 0.06em; }
.card .v { margin-top: 8px; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .v.small-value { font-size: 14px; line-height: 1.5; }
.sales-summary-cards { margin-bottom: 16px; }

.block {
  min-width: 0;
  padding: 22px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.block.wide { grid-column: 1 / -1; }
.block h2 { margin: 0 0 16px; font-size: 15px; font-weight: 600; letter-spacing: 0.03em; }

.block-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.block-head h2 { margin: 0; }
.block-head input { margin-inline-start: auto; min-width: 240px; flex: 1; max-width: 340px; }

.ticket-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.sync-status {
  margin-inline-start: auto;
  color: var(--fg-faint);
  font-size: 11px;
}

.sync-status.bad { color: #ff8a8a; }

.ticket-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.ticket-tabs button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--fg-muted);
}

.ticket-tabs button.active {
  background: #fff;
  color: #000;
}

.ticket-tabs span { margin-inline-start: 5px; font-variant-numeric: tabular-nums; }

.compact-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-filters select {
  min-height: 38px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
}

.button-link {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.button-link.ghost { background: transparent; color: #fff; border-color: var(--line); }

.redeem-row { display: flex; gap: 10px; flex-wrap: wrap; }
.redeem-row input { flex: 1; min-width: 200px; direction: ltr; text-align: left; letter-spacing: 0.08em; }

.msg { margin: 14px 0 0; font-size: 13px; }
.msg.ok { color: #8ee6a8; }
.msg.bad { color: #ff8a8a; }

.scanner {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.scanner video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ticket-result {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ticket-result h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.ticket-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ticket-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

.ticket-scan-note {
  margin: 0 0 12px;
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.7;
}

.ticket-used-message {
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

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

.ticket-field {
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.ticket-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--fg-faint);
  font-size: 11px;
}

.ticket-field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
}

.ticket-field.ltr strong {
  direction: ltr;
  text-align: left;
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th {
  text-align: right;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--line);
}
td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
td.serial { direction: ltr; text-align: left; letter-spacing: 0.06em; font-weight: 600; }
td.empty { text-align: center; color: var(--fg-faint); padding: 30px; }

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid rgba(255,255,255,0.35);
}
.pill.used { background: #fff; color: #000; border-color: #fff; }
.pill.soft { color: var(--fg-muted); background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.14); }
.pill.paid { color: #fff; border-color: rgba(214,76,255,0.55); background: rgba(214,76,255,0.10); }
.pill.free { color: var(--fg-muted); border-color: rgba(255,255,255,0.18); }
.pill.cancelled { color: #ffb0bd; border-color: rgba(255,92,118,0.48); background: rgba(255,92,118,0.09); }

button.danger { color: #ffb0bd; border-color: rgba(255,92,118,0.38); }
button.danger:hover { border-color: rgba(255,92,118,0.8); background: rgba(255,92,118,0.08); }

.ticket-audit {
  flex: 1;
  min-width: 200px;
  min-height: 47px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--fg-faint);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- users & permissions ---------- */
.note { margin: -8px 0 18px; font-size: 12px; line-height: 1.7; color: var(--fg-faint); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1; min-width: 170px; }
.row.tight { margin-top: 12px; }
.row.tight input { min-width: 150px; }

button.small { padding: 7px 15px; font-size: 12px; }

.perm-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0;
}

.check, .check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-muted);
  cursor: pointer;
}
.check-inline { margin-bottom: 16px; }

.check input, .check-inline input {
  width: 15px;
  height: 15px;
  accent-color: #fff;
  cursor: pointer;
}
.check input:disabled { cursor: default; opacity: 0.5; }

.user-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }

.user-row {
  padding: 16px 16px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.user-head { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.user-head button { margin-inline-start: auto; }
.user-row .perm-picker { margin: 14px 0 0; }

.redeem-row { display: flex; gap: 10px; flex-wrap: wrap; }
.redeem-row input, #redeemSerial { direction: ltr; text-align: left; letter-spacing: 0.08em; }

/* ---------- settings & content ---------- */
.field { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.field label { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--fg-muted); }
.standalone-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; font-size: 12px; color: var(--fg-muted); }

textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s var(--ease);
}
textarea:focus { border-color: rgba(255,255,255,0.55); }

select {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.mode-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.mode-segments button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
}

.mode-segments button.active {
  background: #fff;
  color: #000;
}

.issue-type-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.issue-mode-note {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border-inline-start: 2px solid rgba(214,76,255,0.75);
  background: rgba(255,255,255,0.035);
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.7;
}

.fixed-ticket-class {
  flex: 1;
  min-width: 200px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 12px;
}

.fixed-ticket-class strong { color: var(--fg); font-size: 18px; }

.event-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.event-admin-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.event-admin-item.active { border-color: rgba(255,255,255,0.55); }
.event-admin-item img { width: 58px; height: 72px; object-fit: cover; background: #050505; }
.event-admin-item h3 { margin: 0 0 4px; font-size: 13px; }
.event-admin-item p { margin: 0; color: var(--fg-faint); font-size: 10.5px; line-height: 1.6; }
.event-admin-item .event-actions { display: flex; flex-direction: column; gap: 6px; }

.ticket-types-editor { display: flex; flex-direction: column; gap: 9px; margin: 0 0 12px; }
.ticket-type-row {
  display: grid;
  grid-template-columns: 72px minmax(100px, 1fr) minmax(100px, 1fr) 92px;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.ticket-type-row label { display: flex; flex-direction: column; gap: 5px; color: var(--fg-faint); font-size: 10.5px; }
.ticket-type-row input { min-width: 0; padding: 9px 10px; font-size: 12px; }
.ticket-type-options { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.ticket-type-options label { flex-direction: row; align-items: center; color: var(--fg-muted); }
.ticket-type-options input { width: 15px; height: 15px; }
.ticket-type-inventory { grid-column: 1 / -1; color: var(--fg-faint); font-size: 10.5px; }
.ticket-type-add { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 8px; margin-bottom: 14px; }

.inventory-setting {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(105px, 0.65fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid rgba(255,255,255,0.09);
}

.inventory-setting:last-of-type { margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.09); }
.inventory-setting .check-inline { align-self: center; margin: 0; }
.inventory-setting > label:not(.check-inline) { display: flex; flex-direction: column; gap: 7px; color: var(--fg-muted); font-size: 12px; }
.inventory-setting strong { min-width: 0; padding-bottom: 12px; color: var(--fg-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }

#issueTicketResult a {
  color: #fff;
  overflow-wrap: anywhere;
  font-size: 12px;
}

input[type="file"] { padding: 10px 12px; font-size: 12px; cursor: pointer; }

.slider-label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.slider-label input[type="range"] { flex: 1; min-width: 160px; accent-color: #fff; }

.icon-only {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
}

.appearance-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 10%, #181818 0%, var(--bg) 70%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  overflow: auto;
  text-align: center;
}

.preview-brand-line {
  width: min(100%, 520px);
  min-height: 72px;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 42px);
}

.preview-mark {
  width: var(--preview-logo-size, 60px);
  max-width: 36%;
  height: auto;
  flex: 0 1 auto;
}

.preview-site-logo {
  width: auto;
  height: auto;
  max-width: min(var(--preview-logo-size, 60px), 36%);
  max-height: var(--preview-logo-size, 60px);
  object-fit: contain;
  flex: 0 1 auto;
}

.preview-event-box {
  width: var(--preview-code-size, 132px);
  max-width: 58%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 var(--preview-code-size, 132px);
}

.preview-event-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--preview-code-size, 132px);
  object-fit: contain;
}

.preview-countdown {
  color: #fff;
  font-size: var(--preview-countdown-size, 42px);
  font-weight: var(--preview-countdown-weight, 300);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.preview-site-nav {
  margin-top: 10px;
  color: var(--fg-faint);
  font-size: var(--preview-site-nav-size, 12px);
  font-weight: var(--preview-site-nav-weight, 800);
  letter-spacing: 0.16em;
}

.preview-site-title {
  margin-top: 10px;
  color: #fff;
  font-size: var(--preview-site-heading-size, 72px);
  font-weight: var(--preview-site-heading-weight, 900);
  line-height: 0.92;
}

.preview-site-text {
  color: var(--fg-muted);
  font-size: var(--preview-site-text-size, 16px);
  font-weight: var(--preview-site-text-weight, 400);
}

.preview { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.preview figure { margin: 0; text-align: center; }
.preview img, .preview video {
  display: block;
  width: 110px;
  height: 74px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}
.preview figcaption { margin-top: 7px; font-size: 11px; color: var(--fg-faint); }

.poster-preview img,
.poster-preview video {
  width: 150px;
  height: 210px;
  object-fit: cover;
}

.item-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.item .item-sub {
  color: var(--fg-faint);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
  direction: ltr;
}
.item button { margin-inline-start: auto; }

.builder-editor {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
}

.builder-editor h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.builder-list .builder-item {
  align-items: center;
}

.drag-handle {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--fg-muted);
  cursor: grab;
}

.builder-item[draggable="true"]:active .drag-handle {
  cursor: grabbing;
}

@media (max-width: 760px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 12px;
    background: rgba(9,9,9,0.97);
  }

  .bar-mark { width: 34px; }
  .mobile-nav-toggle { display: inline-flex; padding: 7px 11px; }
  .event-context { order: 5; width: 100%; margin: 2px 0 0; }
  .event-context span, .event-context b { display: none; }
  .event-context select { width: 100%; max-width: none; }
  .topbar { flex-wrap: wrap; }

  .dashboard-layout {
    grid-template-columns: 1fr;
    padding: 18px 14px 44px;
  }

  .side-nav {
    position: fixed;
    inset-inline: 10px;
    top: var(--admin-mobile-nav-top, 78px);
    z-index: 60;
    display: none;
    max-height: calc(100dvh - var(--admin-mobile-nav-top, 78px) - 10px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    box-shadow: 0 18px 55px rgba(0,0,0,.38);
  }

  .side-nav.open { display: flex; }
  .side-nav .side-link,.side-nav .side-sub button { min-height:44px; touch-action:manipulation; }

  .side-sub {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 8px;
    padding: 0;
    border: none;
  }

  .section-grid,
  .ticket-grid {
    grid-template-columns: 1fr;
  }

  .block.wide {
    grid-column: auto;
  }

  .inventory-setting {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inventory-setting strong { padding-bottom: 0; }

  .ticket-type-row { grid-template-columns: 1fr 1fr; }
  .ticket-type-options, .ticket-type-inventory { grid-column: 1 / -1; }
  .ticket-type-add { grid-template-columns: 1fr; }
  .event-admin-item { grid-template-columns: 48px minmax(0, 1fr); }
  .event-admin-item img { width: 48px; height: 60px; }
  .event-admin-item .event-actions { grid-column: 1 / -1; flex-direction: row; }

  .compact-filters { width: 100%; }
  .compact-filters select { flex: 1; min-width: 140px; }
}

/* v20.2 — unified ticket activation center */
.booking-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 16px;
}
.control-tile {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  min-height: 84px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}
.control-tile input { margin-top: 4px; flex: 0 0 auto; }
.control-tile span { display: grid; gap: 4px; }
.control-tile strong { font-size: 13px; }
.control-tile small { color: var(--muted, #999); font-size: 10px; line-height: 1.65; }
.control-tile:has(input:checked) { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.07); }
.sales-bar-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin: 13px 0;
}
.sales-bar-controls label {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  font-size: 10px;
}
.sales-bar-controls label span { color: #fff; font-weight: 800; direction: ltr; }
.subsection-title { margin: 22px 0 10px; font-size: 14px; }
@media (max-width: 760px) {
  .booking-control-grid, .sales-bar-controls { grid-template-columns: 1fr; }
}


/* v22 — serial activation and ticket commercial controls */
.serial-activation-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.serial-activation-box label { margin: 0; }
.serial-activation-box small { grid-column: 1 / -1; color: rgba(255,255,255,.46); line-height: 1.7; }
.soldout-option { color: #ff9b9b !important; }
@media (max-width: 720px) {
  .serial-activation-box { grid-template-columns: 1fr; }
  .serial-activation-box small { grid-column: auto; }
}


/* v25 — one clear paid-ticket state selector per class. */
.ticket-sale-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 2px 0 4px;
}
.ticket-sale-status .status-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.ticket-sale-status .status-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.ticket-sale-status .status-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 800;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.ticket-sale-status .status-choice--available input:checked + span {
  border-color: rgba(109,207,151,.45);
  background: rgba(47,149,92,.13);
  color: #a8e7bf;
}
.ticket-sale-status .status-choice--unavailable input:checked + span {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
}
.ticket-sale-status .status-choice--soldout input:checked + span {
  border-color: rgba(239,74,86,.48);
  background: rgba(176,28,40,.15);
  color: #ff7f88;
}


/* v27 — clearer ticket amenity library; public icons render below the confirm button. */
.ticket-amenities-editor {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.ticket-amenities-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.ticket-amenities-head strong { font-size: 11px; color: rgba(255,255,255,.88); }
.ticket-amenities-head small { color: rgba(255,255,255,.43); font-size: 9px; }
.ticket-amenities-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 7px;
}
.ticket-amenity-option {
  display: grid;
  grid-template-columns: 18px 36px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  background: rgba(255,255,255,.018);
  cursor: pointer;
}
.ticket-amenity-option:has(input:checked) {
  border-color: rgba(202,181,119,.32);
  background: rgba(202,181,119,.055);
}
.ticket-amenity-option input { width: 14px; height: 14px; margin: 0; }
.ticket-amenity-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  color: rgba(255,255,255,.78);
}
.ticket-amenity-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ticket-amenity-copy { min-width: 0; }
.ticket-amenity-copy strong { display: block; color: rgba(255,255,255,.86); font-size: 10px; }
.ticket-amenity-copy small { display: block; margin-top: 2px; color: rgba(255,255,255,.42); font-size: 8.5px; line-height: 1.45; }
@media (max-width: 900px) { .ticket-amenities-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) {
  .ticket-amenities-grid { grid-template-columns: 1fr; }
  .ticket-amenities-head { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* v28 — dynamic ticket category colors */
.ticket-color-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 220px)) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.ticket-color-controls label { display: grid; gap: 6px; font-size: 11px; color: rgba(255,255,255,.62); }
.ticket-color-controls input[type="color"] { width: 100%; min-height: 38px; padding: 3px; border-radius: 9px; cursor: pointer; }
.ticket-color-preview {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 7px 12px;
  border: 1px solid var(--preview-a, #fff);
  border-radius: 10px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--preview-a, #fff) 13%, transparent), color-mix(in srgb, var(--preview-b, #fff) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--preview-b, #fff) 16%, transparent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
@media (max-width: 720px) {
  .ticket-color-controls { grid-template-columns: 1fr 1fr; }
  .ticket-color-preview { grid-column: 1 / -1; }
}


/* v38 — clear 1–20 ticket quantity selector */
.ticket-quantity-box{width:100%;margin:14px 0 16px;padding:16px;border:1px solid rgba(255,255,255,.16);border-radius:18px;background:linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,.025));box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
.ticket-quantity-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:13px}.ticket-quantity-head>div{display:grid;gap:3px}.ticket-quantity-head strong{font-size:15px;color:#fff}.ticket-quantity-head small{font-size:10.5px;line-height:1.7;color:var(--fg-muted)}.ticket-quantity-limit{flex:0 0 auto;padding:6px 10px;border:1px solid rgba(255,255,255,.15);border-radius:999px;color:#fff;background:rgba(255,255,255,.07);font-size:10px;font-weight:800}
.ticket-quantity-control{display:grid;grid-template-columns:52px minmax(140px,220px) 52px;gap:8px;align-items:stretch;justify-content:start}.ticket-quantity-control .qty-step{min-height:52px;padding:0;border-radius:14px;font-size:25px;line-height:1}.ticket-quantity-input-wrap{position:relative;display:flex;align-items:center}.ticket-quantity-input-wrap input{height:52px!important;padding:8px 70px 8px 14px!important;text-align:center!important;direction:ltr!important;font-size:22px!important;font-weight:900!important;border-width:1.5px!important}.ticket-quantity-input-wrap span{position:absolute;right:13px;pointer-events:none;font-size:10px;font-weight:800;color:var(--fg-muted)}
.ticket-quantity-presets{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}.ticket-quantity-presets button{min-width:43px;padding:7px 12px!important;border-radius:10px!important;background:transparent!important;color:#fff!important;border:1px solid rgba(255,255,255,.16)!important;font-size:11px!important}.ticket-quantity-presets button:hover,.ticket-quantity-presets button:focus-visible{background:rgba(255,255,255,.1)!important;border-color:rgba(255,255,255,.35)!important}
@media(max-width:620px){.ticket-quantity-box{padding:13px}.ticket-quantity-head{flex-direction:column}.ticket-quantity-control{grid-template-columns:48px minmax(0,1fr) 48px;width:100%}.ticket-quantity-presets{display:grid;grid-template-columns:repeat(6,1fr)}.ticket-quantity-presets button{min-width:0;padding:7px 4px!important}}


/* v39 — clear stacked supervisor-account entry form */
.supervisor-admin-form{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;width:100%;margin:18px 0 4px;padding:18px;border:1.5px solid rgba(255,255,255,.22);border-radius:16px;background:rgba(255,255,255,.035);overflow:hidden}
.supervisor-admin-title{display:grid;gap:3px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.12)}.supervisor-admin-title strong{font-size:15px;color:#fff}.supervisor-admin-title span{font-size:11px;line-height:1.7;color:var(--fg-muted)}
.supervisor-admin-field{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;width:100%;min-width:0;margin:0;padding:12px;border:1px solid rgba(255,255,255,.18);border-radius:12px;background:rgba(0,0,0,.15);color:var(--fg-muted);font-size:11.5px}
.supervisor-admin-field>span{display:block;color:#fff;font-size:11px;font-weight:700}
.supervisor-admin-field input,.supervisor-admin-field select{display:block;width:100%;min-width:0;max-width:100%;height:46px;margin:0;padding:10px 12px;border:1.5px solid rgba(255,255,255,.26);border-radius:10px;background:rgba(255,255,255,.055);color:#fff;box-shadow:none}
.supervisor-admin-field input:focus,.supervisor-admin-field select:focus{border-color:rgba(255,255,255,.7);box-shadow:0 0 0 3px rgba(255,255,255,.06)}
.supervisor-admin-events{width:100%;min-width:0;padding:12px;border:1px solid rgba(255,255,255,.14);border-radius:12px;background:rgba(255,255,255,.025)}.supervisor-admin-events .subhead{margin:0 0 10px}.supervisor-admin-events .perm-picker{margin:0}
.supervisor-admin-submit{width:100%;min-height:48px;margin-top:2px}
@media(max-width:620px){.supervisor-admin-form{padding:13px;gap:10px}.supervisor-admin-field{padding:10px}.supervisor-admin-field input,.supervisor-admin-field select{height:48px;font-size:13px}.supervisor-admin-submit{min-height:50px}}

/* v40 ticket sponsor / organizer logo bar */
.ticket-sponsor-admin { margin: 22px 0 26px; padding: 18px; border: 1px solid rgba(255,255,255,.11); border-radius: 18px; background: rgba(255,255,255,.025); }
.subsection-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.sponsor-toggle-grid { margin: 14px 0; }
.sponsor-global-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:12px 0 16px; }
.sponsor-global-controls label { border:1px solid rgba(255,255,255,.09); border-radius:14px; padding:12px; display:grid; gap:8px; color:var(--fg-muted); font-size:11px; background:rgba(255,255,255,.02); }
.sponsor-global-controls label span { color:#fff; font-weight:800; direction:ltr; }
.ticket-sponsor-preview-wrap { border:1px dashed rgba(255,255,255,.16); border-radius:16px; padding:14px; margin:14px 0; }
.ticket-sponsor-preview-wrap > span { display:block; color:var(--fg-faint); font-size:10px; margin-bottom:10px; }
.ticket-sponsor-preview { min-height:0; display:block; align-items:center; justify-content:center; gap:0; padding:8px; border-radius:13px; background:#0b0b0b; overflow:hidden; }
.sponsor-preview-group { width:100%; min-width:0; display:grid; gap:3px; justify-items:center; padding:4px 2px; }
.sponsor-preview-group.has-divider { border-top:1px solid rgba(255,255,255,.15); }
.sponsor-preview-group > strong { font-size:9px; line-height:1.05; color:rgba(255,255,255,.62); font-weight:800; }
.sponsor-preview-logos { display:flex; flex-wrap:nowrap; justify-content:center; align-items:center; white-space:nowrap; overflow:hidden; width:100%; }
.sponsor-preview-logo { display:flex; align-items:center; justify-content:center; }
.sponsor-preview-logo img { display:block; width:auto; height:auto; object-fit:contain; }
.ticket-sponsor-editor { display:grid; gap:9px; margin:14px 0; }
.ticket-sponsor-row { display:grid; grid-template-columns:minmax(130px,1.2fr) minmax(130px,1fr) 90px auto auto auto; gap:8px; align-items:end; border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:10px; background:rgba(255,255,255,.018); }
.ticket-sponsor-row label { display:grid; gap:5px; color:var(--fg-faint); font-size:10px; }
.ticket-sponsor-row input[type="text"], .ticket-sponsor-row input[type="number"], .ticket-sponsor-row select, .ticket-sponsor-add input, .ticket-sponsor-add select { min-height:40px; border-radius:10px; }
.ticket-sponsor-row .check-inline { display:flex; gap:6px; align-items:center; padding-bottom:9px; color:var(--fg-muted); font-size:10px; }
.ticket-sponsor-row .check-inline input { width:15px; height:15px; }
.ticket-sponsor-thumb { width:64px; height:48px; object-fit:contain; background:#fff; border-radius:9px; padding:5px; }
.ticket-sponsor-add { display:grid; grid-template-columns:1fr 180px 1fr auto; gap:9px; align-items:end; margin-top:12px; }
.ticket-sponsor-add label { display:grid; gap:5px; color:var(--fg-faint); font-size:10px; }
@media (max-width:900px){ .sponsor-global-controls{grid-template-columns:1fr 1fr}.ticket-sponsor-row{grid-template-columns:1fr 1fr}.ticket-sponsor-add{grid-template-columns:1fr 1fr} }
@media (max-width:620px){ .sponsor-global-controls,.ticket-sponsor-row,.ticket-sponsor-add{grid-template-columns:1fr} }

.customer-control-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.customer-control-grid label{display:grid;gap:6px}.customer-control-grid .full{grid-column:1/-1}.customer-control-grid input,.customer-control-grid select{width:100%}.customer-admin-card{padding:18px;border:1px solid rgba(255,255,255,.12);border-radius:18px}.user-meta{display:grid;gap:4px}@media(max-width:760px){.customer-control-grid{grid-template-columns:1fr}.customer-control-grid .full{grid-column:auto}}

.operations-banner{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 15px;margin:0 0 12px;border:1px solid #d8d8d2;border-radius:14px;background:#f7f7f3}.operations-banner strong{font-size:13px}.operations-banner span{font-size:10px;color:#666;line-height:1.7}.critical-control{border-color:#b9b9b0!important;background:#fffef8!important}@media(max-width:720px){.operations-banner{align-items:flex-start;flex-direction:column}}


/* v43 — mixed Reserved/Standing pre-booking controls */
.admin-seat-box{margin:12px 0;padding:14px;border:1px solid rgba(255,255,255,.13);border-radius:15px;background:rgba(255,255,255,.035)}.admin-seat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(82px,1fr));gap:7px;max-height:310px;overflow:auto;padding:3px}.admin-seat{display:grid;gap:2px;min-height:58px;padding:8px;border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(255,255,255,.05);color:inherit;text-align:center}.admin-seat strong{font-size:10px}.admin-seat small{font-size:8px;opacity:.6}.admin-seat.selected{background:#fff;color:#111;border-color:#fff}.admin-seat.unavailable{opacity:.3;text-decoration:line-through}.admin-seat-summary{margin-top:9px;font-size:10px;font-weight:700;opacity:.75}

/* ===== v49 operations dashboard ===== */
:root{--ops-bg:#f5f5f2;--ops-panel:#fff;--ops-line:#dfdfda;--ops-text:#111;--ops-muted:#6b6b66;--ops-good:#18794e;--ops-warn:#9a6700;--ops-bad:#b42318;--ops-soft:#f0f0ec}
.dashboard-layout{align-items:flex-start}
.side-nav{background:rgba(17,17,17,.98);border:1px solid #2c2c2c;box-shadow:0 18px 50px rgba(0,0,0,.14)}
.side-title{font-size:11px;letter-spacing:.08em;color:#aaa;text-transform:uppercase;margin-bottom:8px}
.side-link{position:relative;border-radius:12px;transition:.18s ease}
.side-link:hover{background:#222}
.side-link.active{background:#fff;color:#111;font-weight:700}
.side-link.active:before{content:"";position:absolute;right:7px;top:50%;transform:translateY(-50%);width:4px;height:18px;border-radius:99px;background:#111}
.admin-section{animation:adminSectionIn .18s ease-out}
@keyframes adminSectionIn{from{opacity:.2;transform:translateY(3px)}to{opacity:1;transform:none}}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.section-head h1{margin:0 0 5px;font-size:clamp(22px,3vw,32px);letter-spacing:-.03em}
.section-head-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.compact-save{min-height:40px;padding:0 17px}
.save-strip{position:sticky;top:72px;z-index:9;display:flex;justify-content:space-between;align-items:center;gap:14px;margin:0 0 16px;padding:12px 14px;border:1px solid #d9d9d4;border-radius:14px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);box-shadow:0 10px 28px rgba(0,0,0,.06)}
.save-strip>div:first-child{display:grid;gap:2px}.save-strip strong{font-size:12px}.save-strip span{font-size:10px;color:var(--ops-muted)}
.save-strip-actions,.save-footer{display:flex;gap:10px;align-items:center;justify-content:flex-end}
.save-footer{margin-top:14px;padding-top:14px;border-top:1px solid var(--ops-line)}
.dirty-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;background:#fff4ce;color:#694100;font-size:10px;font-weight:700;border:1px solid #f0d877}
.dirty-badge:before{content:"";width:7px;height:7px;border-radius:50%;background:#d99a00;box-shadow:0 0 0 3px rgba(217,154,0,.12)}
.ops-switch-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.ops-switch{min-height:66px;border:1px solid var(--ops-line);background:#fff;border-radius:14px;padding:11px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.ops-switch span{font-size:11px;font-weight:700;line-height:1.5}.ops-switch input{width:42px;height:23px;accent-color:#111}
.ops-card{border-top:3px solid #bbb}.ops-card.ok{border-top-color:var(--ops-good)}.ops-card.warn{border-top-color:var(--ops-warn)}.ops-card.muted{border-top-color:#aaa}
.small-value{font-size:clamp(16px,2vw,22px)!important;line-height:1.25!important}
.provider-card{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:14px;border:1px solid var(--ops-line);border-radius:14px;background:#fff;margin-bottom:10px}
.provider-card>div{display:grid;gap:3px}.provider-card strong{font-size:13px}.provider-card span{font-size:10px;color:var(--ops-muted)}
.provider-card.connected{border-color:#b7dfca;background:#fbfffc}.provider-card.disconnected{border-color:#ead7ad;background:#fffdf7}
.provider-badge{font-size:9px!important;font-weight:800;letter-spacing:.06em;padding:6px 8px;border-radius:999px;border:1px solid currentColor;color:#444!important;white-space:nowrap}
.status-row{display:grid!important;grid-template-columns:auto 10px 1fr;align-items:center!important;gap:8px!important}.status-dot{width:8px;height:8px;border-radius:50%;background:#aaa}.status-dot.good{background:var(--ops-good)}.status-dot.neutral{background:#999}
.finance-item,.waitlist-row,.seat-section-row{border:1px solid var(--ops-line)!important;border-radius:13px!important;padding:12px 13px!important;background:#fff!important}
.waitlist-row{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:14px!important}.waitlist-row>div:first-child{display:grid;gap:3px}
.seat-map-admin-preview{margin:12px 0;border-radius:16px;overflow:hidden;border:1px solid var(--ops-line);background:#111;min-height:160px;max-height:440px}.seat-map-admin-preview img{display:block;width:100%;height:auto;max-height:440px;object-fit:contain;background:#111}
#seatLayoutJson{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;line-height:1.55;background:#fbfbf8}
#seatingCards,#waitlistCards,#paymentsCards,#commandCards{grid-template-columns:repeat(4,minmax(0,1fr))}
.section-grid>.block.wide{box-shadow:0 12px 34px rgba(0,0,0,.045)}
.block{border-radius:18px}
.block-head{align-items:flex-start}
.operations-banner{border-radius:14px;background:linear-gradient(135deg,#f7f7f3,#fff)}
.ticket-types-editor{display:grid;gap:10px}
#ticketSalesBlock .booking-control-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.admin-section button:not(.ghost):not(.side-link):not(.mobile-nav-toggle){font-weight:700}
.admin-section .msg.ok{border:1px solid #b7dfca;background:#f4fcf7;color:#155d3e;border-radius:12px;padding:9px 11px}
.admin-section .msg.bad{border:1px solid #efc2bd;background:#fff7f6;color:#8e1d17;border-radius:12px;padding:9px 11px}

@media(max-width:1100px){.ops-switch-grid,#ticketSalesBlock .booking-control-grid,#seatingCards,#waitlistCards,#paymentsCards,#commandCards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.section-head{align-items:stretch;flex-direction:column}.section-head-actions{width:100%}.section-head-actions button{flex:1}.save-strip{top:58px;align-items:stretch;flex-direction:column}.save-strip-actions{justify-content:space-between}.ops-switch-grid,#ticketSalesBlock .booking-control-grid,#seatingCards,#waitlistCards,#paymentsCards,#commandCards{grid-template-columns:1fr 1fr}.ops-switch{min-height:58px;padding:9px 10px}.waitlist-row{align-items:flex-start!important;flex-direction:column}.waitlist-row .row{width:100%;justify-content:flex-start}}
@media(max-width:480px){.ops-switch-grid,#ticketSalesBlock .booking-control-grid,#seatingCards,#waitlistCards,#paymentsCards,#commandCards{grid-template-columns:1fr}.save-strip-actions{flex-direction:column;align-items:stretch}.save-strip-actions button{width:100%}}

/* v49 operations dashboard */
.dashboard-layout{background:#f6f7f9}
.side-nav{background:#111214;border-left:1px solid rgba(255,255,255,.08);box-shadow:0 0 28px rgba(0,0,0,.08)}
.side-title{color:rgba(255,255,255,.42);font-size:10px;letter-spacing:.18em}
.side-link{border-radius:9px;margin:2px 0;color:rgba(255,255,255,.72);transition:.16s ease}
.side-link:hover{background:rgba(255,255,255,.07);color:#fff}.side-link.active{background:#fff;color:#101010;font-weight:800}
.admin-section>.section-head{position:sticky;top:68px;z-index:14;padding:14px 0;background:linear-gradient(#f6f7f9 72%,rgba(246,247,249,.88));backdrop-filter:blur(12px)}
.section-save-row{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid #e7e9ed}
.section-save-row button,.compact-save{min-width:150px}
.save-state-text{font-size:10px;color:#7a7f88;white-space:nowrap}
.command-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.command-shortcuts button{min-height:46px}
.contact-admin-item{align-items:flex-start!important}.contact-admin-item.unread{box-shadow:inset 3px 0 0 #111}.contact-admin-item .item-main{display:grid;gap:5px;min-width:0;flex:1}.contact-admin-item p{margin:4px 0 0;white-space:pre-wrap;line-height:1.75;color:#333}
#siteBlock h3{margin-top:26px}.site-content-manager{border-top:1px solid #eceef1;margin-top:24px;padding-top:8px}
#eventOperationsBlock,#ticketPolicyBlock,#marketingPolicyBlock{border-top:3px solid #101010}
#salesSection .section-head-actions{position:relative}
@media(max-width:900px){.command-shortcuts{grid-template-columns:1fr 1fr}.admin-section>.section-head{top:58px}}
@media(max-width:620px){.command-shortcuts{grid-template-columns:1fr}.section-save-row{align-items:stretch;flex-direction:column}.section-save-row button{width:100%}.save-state-text{display:none}}

.payment-config-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}.payment-config-grid label{display:grid;gap:6px;font-size:11px}.payment-config-grid .payment-enable{grid-column:1/-1;display:flex;align-items:center;gap:9px;padding:11px 12px;border:1px solid var(--ops-line);border-radius:12px;background:#fafaf8}.provider-badge.connected{color:#18794e!important}@media(max-width:850px){.payment-config-grid{grid-template-columns:1fr}}

/* ===== v49.2 admin UI consistency — unified control-panel system ===== */
.dashboard-layout {
  --bg: #ffffff;
  --bg-2: #ffffff;
  --fg: #16191d;
  --fg-muted: #626b76;
  --fg-faint: #858e99;
  --line: #d9dfe6;
  --panel-soft: #f7f9fb;
  --panel-softer: #fbfcfd;
  --success: #167451;
  --success-soft: #eef9f3;
  --warning: #9a6600;
  --warning-soft: #fff8e8;
  --danger: #a92525;
  --danger-soft: #fff3f3;
  color: var(--fg) !important;
  background: #f3f5f7 !important;
}

/* Every admin page uses the same visual canvas. */
.dashboard-layout .wrap,
.dashboard-layout .admin-section,
.dashboard-layout .section-grid,
.dashboard-layout .user-list,
.dashboard-layout .item-list {
  color: var(--fg) !important;
}
.dashboard-layout .admin-section {
  gap: 18px;
}
.dashboard-layout .admin-section > .section-head {
  min-height: 72px;
  padding: 14px 4px 13px !important;
  margin: 0 0 4px !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(#f3f5f7 78%, rgba(243,245,247,.94)) !important;
}
.dashboard-layout .admin-section > .section-head h1,
.dashboard-layout .admin-section > .section-head h2,
.dashboard-layout .admin-section > .section-head h3 {
  color: #101317 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
.dashboard-layout .admin-section > .section-head h1 {
  font-size: clamp(23px,2.4vw,31px) !important;
  font-weight: 800 !important;
  line-height: 1.35;
}
.dashboard-layout .section-head .note {
  margin: 4px 0 0 !important;
}

/* All content containers share one light card system. */
.dashboard-layout .block,
.dashboard-layout .card,
.dashboard-layout .user-card,
.dashboard-layout .user-row,
.dashboard-layout .customer-admin-card,
.dashboard-layout .supervisor-admin-events,
.dashboard-layout .supervisor-admin-field,
.dashboard-layout .ticket-result,
.dashboard-layout .ticket-used-message,
.dashboard-layout .builder-editor,
.dashboard-layout .admin-seat-box,
.dashboard-layout .ticket-audit,
.dashboard-layout .item {
  background: #fff !important;
  color: #171a1f !important;
  border-color: var(--line) !important;
  box-shadow: 0 6px 22px rgba(20,31,43,.045) !important;
}
.dashboard-layout .block {
  padding: 22px !important;
  border-radius: 16px !important;
}
.dashboard-layout .block.wide {
  width: 100%;
}
.dashboard-layout .block-head {
  min-height: 44px;
  padding-bottom: 12px;
  margin-bottom: 18px !important;
  border-bottom: 1px solid #edf0f3;
}
.dashboard-layout .block-head h2,
.dashboard-layout .block h2,
.dashboard-layout .block h3,
.dashboard-layout .subsection-title,
.dashboard-layout .user-meta strong {
  color: #15181c !important;
  opacity: 1 !important;
}
.dashboard-layout .block-head h2,
.dashboard-layout .block h2 {
  font-weight: 800;
}
.dashboard-layout .note,
.dashboard-layout .item span,
.dashboard-layout .item small,
.dashboard-layout .user-meta span,
.dashboard-layout .user-meta small,
.dashboard-layout .card .k,
.dashboard-layout .sync-status,
.dashboard-layout .save-state-text {
  color: #69727d !important;
  opacity: 1 !important;
}

/* Predictable form layout across every tab. */
.dashboard-layout .field {
  display: grid !important;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 14px !important;
  align-items: end;
  margin-bottom: 15px !important;
}
.dashboard-layout .field > label,
.dashboard-layout .standalone-field,
.dashboard-layout .payment-config-grid label,
.dashboard-layout .customer-control-grid > label:not(.check) {
  min-width: 0 !important;
  width: 100%;
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 7px !important;
  color: #515a65 !important;
  font-size: 11.5px !important;
  font-weight: 700;
  line-height: 1.5;
}
.dashboard-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.dashboard-layout select,
.dashboard-layout textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #171a1f !important;
  border: 1px solid #cbd2da !important;
  box-shadow: 0 1px 2px rgba(20,31,43,.025) !important;
}
.dashboard-layout textarea {
  min-height: 96px;
  line-height: 1.65;
}
.dashboard-layout input[type="file"] {
  min-height: 46px;
  padding: 7px !important;
  background: #fafbfc !important;
}
.dashboard-layout input[type="search"] {
  min-height: 42px;
}
.dashboard-layout input:focus,
.dashboard-layout select:focus,
.dashboard-layout textarea:focus {
  border-color: #56606c !important;
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(40,49,59,.09) !important;
}
.dashboard-layout input:disabled,
.dashboard-layout select:disabled,
.dashboard-layout textarea:disabled {
  background: #f1f3f5 !important;
  color: #8a929c !important;
}

/* Checkbox/switch system: readable and aligned, never loose squares. */
.dashboard-layout .perm-picker {
  display: grid !important;
  grid-template-columns: repeat(auto-fit,minmax(190px,1fr));
  gap: 10px !important;
  margin: 14px 0 !important;
}
.dashboard-layout .check,
.dashboard-layout .check-inline,
.dashboard-layout .customer-control-grid > label.check {
  min-width: 0;
  min-height: 46px;
  margin: 0 !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  border: 1px solid #d8dee5 !important;
  border-radius: 11px !important;
  background: #f9fafb !important;
  color: #3e4650 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.5;
}
.dashboard-layout .check span,
.dashboard-layout .check-inline span {
  flex: 1;
  color: inherit !important;
}
.dashboard-layout .check input[type="checkbox"],
.dashboard-layout .check-inline input[type="checkbox"],
.dashboard-layout .customer-control-grid input[type="checkbox"] {
  flex: 0 0 auto;
  width: 19px !important;
  height: 19px !important;
  margin: 0 !important;
  accent-color: #17744f !important;
}
.dashboard-layout .check:has(input:checked),
.dashboard-layout .check-inline:has(input:checked),
.dashboard-layout .customer-control-grid > label.check:has(input:checked) {
  border-color: #abd7c2 !important;
  background: #eef9f3 !important;
  color: #145d41 !important;
}
.dashboard-layout .check:has(input:disabled),
.dashboard-layout .check-inline:has(input:disabled) {
  opacity: .62;
  background: #f0f2f4 !important;
}

/* Customer accounts: proper profile card + aligned restriction controls. */
.dashboard-layout #customersSection .block {
  padding: 20px !important;
}
.dashboard-layout #customersSection .block-head {
  align-items: center;
}
.dashboard-layout #customerCards {
  display: grid;
  gap: 14px;
  margin-top: 12px !important;
}
.dashboard-layout .customer-admin-card {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 15px !important;
}
.dashboard-layout .customer-admin-card .user-meta {
  padding: 16px 18px;
  gap: 5px !important;
  background: #f7f9fb;
  border-bottom: 1px solid #e3e7eb;
}
.dashboard-layout .customer-admin-card .user-meta strong {
  font-size: 14px;
}
.dashboard-layout .customer-control-grid {
  padding: 16px 18px 4px;
  display: grid !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  gap: 12px !important;
  margin: 0 !important;
}
.dashboard-layout .customer-control-grid .full {
  grid-column: 1 / -1 !important;
}
.dashboard-layout .customer-admin-card > .row.tight {
  padding: 12px 18px 16px;
  margin: 0 !important;
  border-top: 1px solid #edf0f3;
  justify-content: flex-start;
}
.dashboard-layout .customer-admin-card [data-c-history-out] {
  margin: 0 18px 16px;
}

/* Supervisor and staff cards use the same visual language. */
.dashboard-layout .user-row {
  border-radius: 14px !important;
  padding: 16px !important;
}
.dashboard-layout .user-head {
  color: #171a1f !important;
  font-weight: 800;
}
.dashboard-layout .supervisor-admin-events {
  padding: 14px !important;
  border-radius: 12px !important;
}

/* Status and operation controls. */
.dashboard-layout .control-tile,
.dashboard-layout .ops-switch,
.dashboard-layout .provider-card,
.dashboard-layout .finance-item,
.dashboard-layout .waitlist-row,
.dashboard-layout .seat-section-row {
  background: #fff !important;
  color: #171a1f !important;
  border-color: #d8dee5 !important;
}
.dashboard-layout .control-tile:has(input:checked),
.dashboard-layout .ops-switch:has(input:checked) {
  background: #eef9f3 !important;
  border-color: #abd7c2 !important;
}
.dashboard-layout .ops-switch input {
  flex: 0 0 auto;
  width: 42px !important;
  height: 23px !important;
  accent-color: #17744f !important;
}

/* Tabs and segmented controls: same size everywhere. */
.dashboard-layout .ticket-tabs,
.dashboard-layout .mode-segments {
  min-height: 44px;
  padding: 4px !important;
  gap: 4px !important;
  border-radius: 10px !important;
  background: #eef1f4 !important;
  border: 1px solid #d5dbe2 !important;
}
.dashboard-layout .ticket-tabs button,
.dashboard-layout .mode-segments button {
  min-height: 36px !important;
  padding: 7px 13px !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #515a65 !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 11.5px;
}
.dashboard-layout .ticket-tabs button.active,
.dashboard-layout .mode-segments button.active {
  background: #171a1f !important;
  color: #fff !important;
}

/* Tables remain readable even in older modules. */
.dashboard-layout .table-scroll {
  border: 1px solid #e0e4e9;
  border-radius: 12px;
  background: #fff;
}
.dashboard-layout table {
  color: #252a30 !important;
  background: #fff;
}
.dashboard-layout th {
  background: #f6f8fa !important;
  color: #5f6873 !important;
  border-bottom: 1px solid #dce2e8 !important;
}
.dashboard-layout td {
  color: #2c3239 !important;
  border-bottom: 1px solid #edf0f3 !important;
}
.dashboard-layout tbody tr:last-child td { border-bottom: 0 !important; }
.dashboard-layout tbody tr:hover td { background: #f8fafb !important; }

/* Buttons are rectangular operation controls rather than mixed legacy pills. */
.dashboard-layout .admin-section button:not(.side-link):not(.mobile-nav-toggle),
.dashboard-layout .admin-section .button-link {
  min-height: 40px;
  border-radius: 9px !important;
  letter-spacing: 0 !important;
}
.dashboard-layout .section-save-row {
  min-height: 58px;
  margin-top: 18px !important;
  padding-top: 15px !important;
  border-top: 1px solid #e2e6eb !important;
}
.dashboard-layout .section-save-row button:not(.ghost),
.dashboard-layout .compact-save,
.dashboard-layout .save-footer button:not(.ghost) {
  min-width: 160px;
  background: #15191e !important;
  color: #fff !important;
}

/* Empty/error messages get real visual containers. */
.dashboard-layout .empty {
  margin: 8px 0;
  padding: 18px;
  border: 1px dashed #d3d9e0;
  border-radius: 10px;
  background: #fafbfc;
  color: #707984 !important;
  text-align: center;
}
.dashboard-layout .error,
.dashboard-layout .msg.bad {
  color: #9d2525 !important;
}

/* Keep the navigation/header deliberately dark and isolated from the light variables. */
.dashboard-layout .side-nav {
  --fg: #ffffff;
  --fg-muted: rgba(255,255,255,.68);
  --fg-faint: rgba(255,255,255,.42);
  --line: rgba(255,255,255,.12);
  background: #111214 !important;
  color: #fff !important;
}
.dashboard-layout .side-nav .side-title { color: rgba(255,255,255,.42) !important; }
.dashboard-layout .side-nav .side-link { color: rgba(255,255,255,.76) !important; }
.dashboard-layout .side-nav .side-link:hover { color: #fff !important; background: #202225 !important; }
.dashboard-layout .side-nav .side-link.active { color: #111 !important; background: #fff !important; }

/* Responsive consistency. */
@media (max-width: 1020px) {
  .dashboard-layout .customer-control-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .dashboard-layout .section-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 720px) {
  .dashboard-layout .block { padding: 16px !important; }
  .dashboard-layout .customer-control-grid { grid-template-columns: 1fr !important; padding: 14px !important; }
  .dashboard-layout .customer-control-grid .full { grid-column: auto !important; }
  .dashboard-layout .field { grid-template-columns: 1fr !important; }
  .dashboard-layout .perm-picker { grid-template-columns: 1fr !important; }
  .dashboard-layout .admin-section > .section-head { min-height: auto; }
}

/* v49.3 customer operation timeline */
.customer-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;letter-spacing:.03em;color:#59616c;direction:ltr;text-align:right}
.customer-operation-item{border:1px solid #d8dde5;background:#fff;border-radius:14px;padding:12px 14px;margin:8px 0;color:#15171a}
.customer-operation-item .operation-head,.customer-operation-item .operation-meta{display:flex;gap:8px 14px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.customer-operation-item .operation-meta{font-size:12px;color:#59616c;margin-top:8px}
.customer-operation-item .operation-actor{margin-top:9px;padding-top:9px;border-top:1px solid #edf0f3;font-size:12px;color:#333}
.customer-operation-item .operation-actor small{display:block;margin-top:5px;color:#737b86;direction:ltr;overflow-wrap:anywhere}
.operation-limit-fields small{display:block;margin-top:5px;color:#68717c;font-size:11px;line-height:1.6}.operation-limit-note{border-inline-start:3px solid #111;padding-inline-start:10px}

/* v51.4 — hard mobile viewport containment */
@media(max-width:760px){html,body{width:100%;max-width:100%;min-width:0;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}main,section,form,div{min-width:0}img,svg,video,canvas{max-width:100%;height:auto}input,select,textarea,button{max-width:100%}}

/* v51.5 — per-supervisor gate distribution */
.gate-assignment-card{margin:12px 0;padding:14px;border:1px solid #d9dee8;border-radius:14px;background:#f8fafc}.gate-assignment-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.gate-assignment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.gate-assignment-grid label,.gate-ticket-types{display:grid;gap:6px}.gate-ticket-types{margin:12px 0}.gate-ticket-types .field-label{font-weight:700}.gate-type-check{background:#fff;border:1px solid #e3e7ef;border-radius:10px;padding:8px 10px}.gate-type-check span{display:flex;flex-direction:column;gap:2px}.gate-type-check small{font-weight:400;color:#667085}@media(max-width:760px){.gate-assignment-grid{grid-template-columns:1fr}.gate-assignment-head{flex-direction:column}.gate-assignment-card{padding:12px}}

/* v51.5 — event gate manager */
.gate-admin-panel{margin:18px 0 22px;padding:16px;border:1px solid #d8dde5;border-radius:16px;background:#f6f8fb}.gate-definition-list{display:grid;gap:10px;margin:12px 0}.gate-definition-row{display:grid;grid-template-columns:minmax(110px,.65fr) minmax(160px,1fr) minmax(160px,1fr) 1.6fr auto;gap:10px;align-items:end;padding:12px;border:1px solid #e0e5ec;border-radius:12px;background:#fff}.gate-definition-row label,.gate-new-form label{display:grid;gap:5px}.gate-definition-row .gate-row-types{align-self:stretch}.gate-row-types .perm-picker{margin-top:5px}.gate-supervisors{grid-column:1/-1;font-size:12px;color:#5f6873;padding-top:7px;border-top:1px solid #edf0f3}.gate-new-form{display:grid;grid-template-columns:minmax(120px,.7fr) minmax(160px,1fr) minmax(160px,1fr) 1.6fr auto;gap:10px;align-items:end;margin-top:14px;padding-top:14px;border-top:1px solid #dce2e8}.gate-new-types{display:grid;gap:5px}.gate-new-types .perm-picker{margin:0}.gate-admin-panel input[type=text]{width:100%}.gate-admin-panel .gate-id-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;direction:ltr}.gate-definition-row.is-disabled{opacity:.62}.gate-definition-row .gate-remove{min-width:74px}@media(max-width:980px){.gate-definition-row,.gate-new-form{grid-template-columns:repeat(2,minmax(0,1fr))}.gate-definition-row .gate-row-types,.gate-new-types{grid-column:1/-1}.gate-definition-row .gate-remove,.gate-new-form>button{width:100%}}@media(max-width:620px){.gate-admin-panel{padding:12px}.gate-definition-row,.gate-new-form{grid-template-columns:1fr}.gate-definition-row .gate-row-types,.gate-new-types{grid-column:auto}}
/* v51.5 — event gate supervisor distribution */
.gate-supervisor-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px;margin-top:8px}
.gate-supervisor-check{min-height:48px;padding:8px 10px;border:1px solid var(--line,#dedede);border-radius:12px;background:var(--card,#fff)}
.gate-supervisor-check span{display:flex;flex-direction:column;gap:2px}.gate-supervisor-check small{opacity:.68}
@media(max-width:760px){.gate-supervisor-picker{grid-template-columns:1fr}.gate-supervisor-check{min-height:52px}}


/* =====================================================================
   v51.6 — admin mobile application layout (viewport + coarse touch)
   ===================================================================== */
@media screen and (max-width:899px), screen and (hover:none) and (pointer:coarse) and (max-width:1200px){
  html{width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:clip!important}
  body{width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:clip!important;margin:0!important;position:relative!important}
  body>*{max-width:100dvw!important;min-width:0!important}
  .topbar{
    position:sticky!important;top:0!important;z-index:80!important;width:100dvw!important;max-width:100dvw!important;min-width:0!important;
    display:grid!important;grid-template-columns:auto auto minmax(0,1fr) auto!important;align-items:center!important;
    gap:8px!important;padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left))!important;
    box-sizing:border-box!important;overflow:hidden!important;background:rgba(9,9,9,.98)!important;
  }
  .bar-mark{width:30px!important;max-width:30px!important}
  .mobile-nav-toggle{display:inline-flex!important;min-width:72px!important;min-height:40px!important;padding:7px 10px!important;justify-content:center!important}
  .who{min-width:0!important;max-width:100%!important;margin:0!important;align-items:flex-start!important;overflow:hidden!important}
  .who span{display:block!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .who .role{font-size:9px!important}
  #logoutBtn{min-width:56px!important;min-height:40px!important;padding:7px 10px!important}
  .event-context{grid-column:1/-1!important;order:initial!important;width:100%!important;max-width:100%!important;margin:0!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  .event-context[hidden]{display:none!important}
  .event-context span,.event-context b{display:none!important}
  .event-context select{width:100%!important;max-width:100%!important;min-width:0!important}

  .dashboard-layout{display:block!important;width:100%!important;max-width:100dvw!important;min-width:0!important;margin:0!important;padding:12px 10px 48px!important;overflow:visible!important}
  .dashboard-layout>.wrap,.wrap,.admin-section,.section-grid,.block,.cards,.item-list{width:100%!important;max-width:100%!important;min-width:0!important}
  .dashboard-layout .admin-section>.section-head{position:relative!important;top:auto!important;min-height:0!important;padding:8px 0 12px!important;background:transparent!important;backdrop-filter:none!important}
  .dashboard-layout .section-head,.dashboard-layout .block-head,.dashboard-layout .subsection-head{flex-direction:column!important;align-items:stretch!important;gap:8px!important}
  .dashboard-layout .section-head-actions,.dashboard-layout .block-head>*{max-width:100%!important}
  .dashboard-layout .block{padding:14px!important;border-radius:14px!important;overflow:hidden!important}
  .dashboard-layout .field,.dashboard-layout .section-grid,.dashboard-layout .cards,.dashboard-layout .ticket-grid,
  .dashboard-layout .booking-control-grid,.dashboard-layout .ticket-type-row,.dashboard-layout .ticket-type-add,
  .dashboard-layout .ticket-amenities-grid,.dashboard-layout .sales-bar-controls,.dashboard-layout .customer-control-grid,
  .dashboard-layout .sponsor-global-controls,.dashboard-layout .ticket-sponsor-row,.dashboard-layout .ticket-sponsor-add,
  .dashboard-layout .inventory-setting,.dashboard-layout .payment-config-grid,.dashboard-layout .gate-assignment-grid,
  .gate-definition-row,.gate-new-form,.gate-supervisor-picker{grid-template-columns:minmax(0,1fr)!important}
  .dashboard-layout .field>label,.dashboard-layout label,.dashboard-layout input,.dashboard-layout select,.dashboard-layout textarea{min-width:0!important;max-width:100%!important;width:100%!important}
  .dashboard-layout .row,.dashboard-layout .row.tight,.dashboard-layout .compact-filters,.dashboard-layout .section-save-row,.dashboard-layout .save-footer,.dashboard-layout .seat-designer-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;width:100%!important;max-width:100%!important}
  .dashboard-layout .row>* ,.dashboard-layout .row.tight>* ,.dashboard-layout .compact-filters>* ,.dashboard-layout .section-save-row>* ,.dashboard-layout .save-footer>*{width:100%!important;max-width:100%!important;min-width:0!important}
  .dashboard-layout .section-save-row button,.dashboard-layout .compact-save,.dashboard-layout .save-footer button{min-width:0!important;width:100%!important}

  .side-nav{
    position:fixed!important;top:var(--admin-mobile-nav-top,104px)!important;right:10px!important;left:10px!important;inset-inline:10px!important;
    width:calc(100dvw - 20px)!important;max-width:calc(100dvw - 20px)!important;min-width:0!important;
    max-height:calc(100dvh - var(--admin-mobile-nav-top,104px) - 10px)!important;margin:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;box-sizing:border-box!important;z-index:120!important;
  }
  .side-nav:not(.open){display:none!important}.side-nav.open{display:flex!important}
  .side-sub{grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important}
  .side-link,.side-sub button{width:100%!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important}

  .table-scroll,.table-wrap{display:block!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overscroll-behavior-inline:contain!important;-webkit-overflow-scrolling:touch!important}
  .table-scroll table,.table-wrap table{width:max-content!important;min-width:100%!important;max-width:none!important}
  .table-scroll th,.table-scroll td,.table-wrap th,.table-wrap td{white-space:normal!important;min-width:92px!important;max-width:220px!important;overflow-wrap:anywhere!important}

  .gate-admin-panel{padding:12px!important;overflow:hidden!important}.gate-definition-row .gate-row-types,.gate-new-types,.gate-supervisors{grid-column:auto!important}
  .gate-definition-row .gate-remove,.gate-new-form>button{width:100%!important;min-width:0!important}
  .gate-supervisor-picker{grid-template-columns:minmax(0,1fr)!important}
  .dashboard-layout .seat-builder-grid{grid-template-columns:minmax(0,1fr)!important}
  .dashboard-layout .seat-map-designer,.dashboard-layout .admin-prebook-seat-map{width:100%!important;max-width:100%!important;overflow:auto!important}
  .dashboard-layout .seat-designer-actions button{width:100%!important}
}
@media screen and (max-width:460px), screen and (hover:none) and (pointer:coarse) and (max-width:620px){
  .topbar{grid-template-columns:auto auto minmax(0,1fr) auto!important;gap:6px!important}
  .who .role{display:none!important}
  .mobile-nav-toggle{min-width:64px!important;font-size:12px!important}
  #logoutBtn{min-width:50px!important;font-size:12px!important}
  .dashboard-layout{padding-inline:8px!important}
  .dashboard-layout .block{padding:12px!important}
}

/* v51.7 — LIVE event control */
.live-side-link{font-weight:800}.live-side-link:not(.active)::before{content:'●';font-size:9px;margin-inline-end:7px;color:#16a34a}.live-section-head{align-items:center}.live-pulse{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:800}.live-pulse i{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 5px rgba(34,197,94,.12);animation:wnwLivePulse 1.5s infinite}@keyframes wnwLivePulse{50%{box-shadow:0 0 0 10px rgba(34,197,94,0)}}
.live-kpi small{display:block;margin-top:4px;color:var(--muted,#6b7280);font-size:11px}.live-supervisor-list{display:grid;gap:10px}.live-supervisor{border:1px solid #dfe4ea;border-radius:14px;padding:13px;display:grid;grid-template-columns:minmax(220px,1.15fr) minmax(180px,.9fr) minmax(220px,1fr);gap:12px;align-items:center;background:#fff}.live-supervisor.is-online{border-color:#a7dfbf;box-shadow:0 0 0 2px rgba(34,197,94,.05)}.live-supervisor-identity{display:flex;align-items:center;gap:10px;min-width:0}.live-supervisor-identity strong,.live-supervisor-identity small{display:block}.live-supervisor-identity small{color:#6b7280;margin-top:2px}.presence-dot{width:11px;height:11px;border-radius:50%;background:#9ca3af;flex:0 0 auto}.is-online .presence-dot{background:#22c55e;box-shadow:0 0 0 5px rgba(34,197,94,.12)}.live-supervisor-metrics{display:flex;gap:8px;flex-wrap:wrap}.live-supervisor-metrics span{background:#f5f7f9;border-radius:9px;padding:6px 8px;font-size:11px}.live-gate-select{margin:0}.live-gate-select select{width:100%;min-height:42px}.live-supervisor-foot{grid-column:1/-1;display:flex;gap:12px;flex-wrap:wrap;padding-top:8px;border-top:1px dashed #e5e7eb;font-size:11px;color:#5f6670}.live-gate-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.live-gate-card{border:1px solid #e0e4e8;border-radius:14px;padding:14px;background:#fff}.live-gate-head{display:flex;justify-content:space-between;gap:8px}.live-gate-head span{font-family:monospace;color:#6b7280}.live-gate-types{display:flex;gap:5px;flex-wrap:wrap;margin:10px 0}.live-gate-types i{font-style:normal;border:1px solid #dfe4ea;border-radius:999px;padding:3px 7px;font-size:10px}.live-gate-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.live-gate-stats span{background:#f7f8fa;border-radius:9px;padding:8px 5px;text-align:center;font-size:10px}.live-gate-stats b{display:block;font-size:17px}.live-table td small{display:block;color:#7b8188}.live-log{display:grid;gap:7px;max-height:620px;overflow:auto}.live-log-row{display:grid;grid-template-columns:88px minmax(0,1fr) auto;align-items:center;gap:10px;border:1px solid #e4e7ea;border-radius:11px;padding:9px 10px;background:#fff}.live-log-row.accepted{border-inline-start:4px solid #22c55e}.live-log-row.rejected{border-inline-start:4px solid #ef4444}.live-log-status{font-weight:800;font-size:11px}.live-log-row small{display:block;color:#6b7280;margin-top:2px;overflow-wrap:anywhere}.live-log-meta{display:flex;gap:8px;align-items:center;font-size:10px;color:#6b7280}.scanner-gate-create small{display:block;color:#6b7280;margin-top:5px;font-size:11px}
@media(max-width:900px){.live-supervisor{grid-template-columns:1fr}.live-supervisor-foot{grid-column:auto}.live-gate-stats{grid-template-columns:repeat(2,1fr)}.live-log-row{grid-template-columns:78px minmax(0,1fr)}.live-log-meta{grid-column:1/-1;justify-content:flex-end}.live-section-head{gap:10px}.live-section-head .section-head-actions{width:100%;justify-content:space-between}.live-table{min-width:620px}}


/* v51.12 unified ticket email designer */
.ticket-email-designer{margin:18px 0;padding:18px;border:1px solid rgba(20,28,38,.12);border-radius:16px;background:#fff;box-shadow:0 8px 30px rgba(20,28,38,.05)}
.ticket-email-upload-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.ticket-email-upload-grid label{display:grid;gap:7px;font-weight:800}.ticket-email-upload-grid small{font-weight:500;color:#69727d}.ticket-color-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:8px}.ticket-color-row input{width:100%;min-height:44px;padding:3px;border-radius:9px}
.ticket-email-preview-shell{margin:16px auto 0;width:fit-content;max-width:100%;border:0;overflow:visible;background:transparent}.ticket-email-preview-head{display:flex;justify-content:center;gap:8px;align-items:center;flex-wrap:wrap;padding:4px 6px 7px;background:transparent;font-size:11px;text-align:center}.ticket-email-preview-head strong{font-size:12px}.ticket-email-preview-head span{color:#66707b}.ticket-preview-zoom{display:flex;align-items:center;justify-content:center;gap:6px;margin:0 0 8px}.ticket-preview-zoom button{min-width:36px;height:32px;padding:4px 9px;border-radius:9px;font-weight:900}.ticket-preview-zoom #ticketPreviewZoomReset{min-width:70px;font-size:11px}.ticket-preview-stage{width:min(390px,calc(100vw - 48px));max-width:100%;max-height:620px;overflow:auto;padding:8px;border:1px solid #e5e9ee;border-radius:14px;background:#f5f7f9;text-align:center;box-sizing:border-box}.ticket-email-preview-shell iframe{display:block;width:300px;height:360px;max-width:none;margin:0 auto;border:0;border-radius:14px;background:transparent;overflow:hidden;transition:width .12s ease,height .12s ease;box-shadow:none}.ticket-email-preview-shell iframe.is-loading{width:260px!important;height:120px!important;background:linear-gradient(90deg,#f4f6f8,#e9edf1,#f4f6f8);background-size:200% 100%;animation:ticketPreviewLoading 1.1s linear infinite;border:1px solid #e4e8ec}.ticket-email-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}@keyframes ticketPreviewLoading{to{background-position:-200% 0}}
@media(max-width:820px){.ticket-email-upload-grid{grid-template-columns:1fr}.ticket-email-preview-head{align-items:center;flex-direction:column}.ticket-email-preview-shell{max-width:100%}}

/* v51.14 — category + ticket design center */
.ticket-category-quick-list{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 16px;padding:12px;border:1px solid rgba(17,24,39,.10);border-radius:16px;background:#fff;min-height:56px;align-items:center}
.ticket-category-chip{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:150px;padding:11px 14px;border:1px solid rgba(17,24,39,.12);border-radius:13px;background:#f8fafc;color:#111827;cursor:pointer}
.ticket-category-chip strong{font-size:14px}.ticket-category-chip span{font-size:11px;color:#6b7280}.ticket-category-chip.active{background:#111827;color:#fff;border-color:#111827}.ticket-category-chip.active span{color:#d1d5db}
.ticket-design-category-link{display:grid;grid-template-columns:minmax(240px,1fr) minmax(220px,1fr);gap:12px;align-items:end;margin:14px auto 10px;max-width:760px;padding:14px;border:1px solid rgba(17,24,39,.12);border-radius:14px;background:#f8fafc}
.ticket-design-category-link label{display:flex;flex-direction:column;gap:7px;font-weight:700}.ticket-design-category-link select{width:100%;min-height:44px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:8px 10px}
.ticket-design-link-status{display:flex;flex-direction:column;gap:4px;padding:9px 12px;border-radius:10px;background:#fff;border:1px solid rgba(17,24,39,.08)}.ticket-design-link-status strong{font-size:14px}.ticket-design-link-status span{font-size:11px;color:#6b7280;line-height:1.55}
#ticketTypesSection .section-grid{grid-template-columns:1fr}#ticketTypesSection .ticket-email-designer,#ticketTypesSection .ticket-sponsor-admin{margin-top:0}
@media(max-width:899px){.ticket-design-category-link{grid-template-columns:1fr}.ticket-category-chip{flex:1 1 140px}.ticket-category-quick-list{padding:9px}}
.ticket-type-row-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px dashed rgba(17,24,39,.14);border-radius:11px;background:#f8fafc}.ticket-type-row-actions span{font-size:11px;color:#66707b}.ticket-type-row-actions button{white-space:nowrap}
@media(max-width:899px){.ticket-type-row-actions{flex-direction:column;align-items:stretch}.ticket-type-row-actions button{width:100%}}

/* v51.14.2 clear design sections */
.designer-section-label{margin:18px 0 10px;padding:10px 12px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.035);display:flex;align-items:center;justify-content:space-between;gap:12px}
.designer-section-label strong{font-size:13px}.designer-section-label span{font-size:10px;color:rgba(255,255,255,.58)}
.ticket-email-designer,.ticket-sponsor-admin{border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:16px;background:rgba(255,255,255,.02)}
.ticket-sponsor-admin{margin-top:18px}
.control-tile--important{border-color:rgba(255,255,255,.28)!important;background:rgba(255,255,255,.06)!important}
#ticketDesignPageDirty:not([hidden]){display:inline-flex}
@media(max-width:760px){.designer-section-label{align-items:flex-start;flex-direction:column;gap:4px}}
