:root {
  --black: #111214;
  --red: #e31c2b;
  --paper: #f4f4f2;
  --line: #e3e4e5;
  --muted: #74777d;
  --green: #147f50;
  --amber: #b7720b;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--black);
  font-family: Arial, Helvetica, sans-serif;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(145deg, #0f1011, #252628);
}
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 25px 70px #0007;
}
.login-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  letter-spacing: 0.08em;
}
.login-brand span,
.brand span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--red);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  font-style: italic;
}
.kicker {
  margin: 32px 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.login-card h1 {
  margin: 0;
  font-size: 34px;
}
.muted {
  color: var(--muted);
  line-height: 1.5;
}
.login-card label,
.manual-token {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 18px 0;
  color: #484b50;
  font-size: 12px;
  font-weight: 700;
}
.login-card input,
.manual-token input,
#booking-search {
  width: 100%;
  padding: 13px;
  border: 1px solid #d7d8da;
  border-radius: 6px;
  outline: none;
}
.primary,
.secondary {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}
.turnstile-wrap {
  min-height: 65px;
  margin: 4px 0 12px;
}
.form-error,
.action-error {
  min-height: 16px;
  color: #b42318;
  font-size: 12px;
}
.console header {
  height: 70px;
  padding: 0 max(18px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--black);
  color: #fff;
}
.brand strong {
  font-size: 16px;
}
.brand i {
  color: #a7a9ad;
  font-style: normal;
}
.operator {
  display: flex;
  align-items: center;
  gap: 14px;
}
.operator div {
  display: flex;
  flex-direction: column;
  text-align: right;
}
.operator small {
  margin-top: 3px;
  color: #a9abb0;
  font-size: 10px;
}
.operator button {
  padding: 8px 11px;
  border: 1px solid #555;
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.console main {
  width: min(1160px, calc(100% - 28px));
  margin: auto;
  padding: 24px 0 70px;
}
.sync-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: #777b80;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.sync-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #20a967;
  box-shadow: 0 0 0 3px #d8f1e4;
}
.sync-bar span.offline {
  background: #f0a11b;
  box-shadow: 0 0 0 3px #ffedc9;
}
.sync-bar small {
  margin-left: auto;
  letter-spacing: 0;
}
.page-title,
.event-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}
.page-title p,
.event-head p {
  margin: 0 0 7px;
  color: #777;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.page-title h1,
.event-head h1 {
  margin: 0;
  font-size: 29px;
}
.refresh,
.back {
  padding: 10px 13px;
  border: 1px solid #d4d5d6;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}
.back {
  margin-bottom: 18px;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.event-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.event-card:hover {
  border-color: #999;
}
.event-card .date {
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.event-card h2 {
  margin: 8px 0;
  font-size: 18px;
}
.event-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.event-counts {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}
.event-counts span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #8a8c90;
  font-size: 9px;
}
.event-counts b {
  color: #222;
  font-size: 17px;
}
.event-head span {
  color: var(--muted);
  font-size: 13px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stats article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.stats small {
  display: block;
  margin-bottom: 7px;
  color: #777;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.stats strong {
  font-size: 26px;
}
.stats .amber {
  background: #fff6e7;
  color: var(--amber);
}
.stats .green {
  background: #e6f6ee;
  color: var(--green);
}
.scan {
  width: 100%;
  margin: 14px 0;
  padding: 17px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.list-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.list-head {
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.list-head h2 {
  margin: 0;
  font-size: 16px;
}
.list-head p {
  margin: 3px 0 0;
  color: #888;
  font-size: 10px;
}
.list-head input {
  max-width: 280px;
}
.booking-row {
  width: 100%;
  min-height: 72px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 42px 1fr 150px 22px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
  text-align: left;
}
.booking-row:hover {
  background: #fafafa;
}
.booking-row:last-child {
  border-bottom: 0;
}
.initials,
.booking-person > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eee;
  font-size: 11px;
  font-weight: 800;
}
.booking-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.booking-info b {
  font-size: 13px;
}
.booking-info small {
  color: #85888c;
  font-size: 10px;
}
.pill {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 99px;
  background: #f0f1f2;
  color: #666;
  font-size: 9px;
  font-weight: 800;
}
.pill.parking {
  background: #fff0d5;
  color: #936008;
}
.pill.entered {
  background: #dff4e9;
  color: #087747;
}
.chevron {
  font-size: 22px;
  color: #999;
}
.empty {
  padding: 38px;
  text-align: center;
  color: #888;
}
.console footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  padding: 0 max(18px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #888;
  font-size: 9px;
}
.modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #000b;
  backdrop-filter: blur(3px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 25px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 25px 70px #0008;
}
.close {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eee;
  font-size: 22px;
}
.booking-person {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 0 22px;
}
.booking-person > span {
  width: 56px;
  height: 56px;
}
.booking-person small {
  color: #888;
  font-size: 10px;
}
.booking-person h2 {
  margin: 3px 0;
  font-size: 21px;
}
.booking-person p {
  margin: 0;
  color: #777;
  font-size: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.detail-grid div {
  padding: 12px;
  border-radius: 6px;
  background: #f1f1f0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.detail-grid small {
  color: #888;
  font-size: 8px;
}
.detail-grid strong {
  font-size: 11px;
}
.mail-history {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}
.mail-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.mail-history-head h3 {
  margin: 0;
}
.mail-history-head button {
  padding: 7px 10px;
  border: 1px solid #bbb;
  border-radius: 5px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}
.mail-history-item {
  margin-top: 9px;
  padding: 10px;
  border-left: 4px solid #999;
  border-radius: 5px;
  background: #f5f5f4;
}
.mail-history-item.sent { border-left-color: #147f50; }
.mail-history-item.queued { border-left-color: #c77a09; }
.mail-history-item.failed { border-left-color: #b42318; }
.mail-history-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}
.mail-status {
  white-space: nowrap;
  font-weight: 900;
}
.mail-history-item.sent .mail-status { color: #147f50; }
.mail-history-item.queued .mail-status { color: #9a5c00; }
.mail-history-item.failed .mail-status { color: #b42318; }
.mail-history-meta,
.mail-history-error {
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.35;
}
.mail-history-error { color: #b42318; }
.action {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 800;
}
.action.parking {
  background: #c77a09;
}
.action.entry {
  background: #111;
}
.action:disabled {
  background: #ddd;
  color: #888;
  cursor: not-allowed;
}
.camera-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: 8px;
  background: #111;
}
.camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-frame {
  position: absolute;
  inset: 16%;
  border: 3px solid #fff;
  border-radius: 13px;
  box-shadow: 0 0 0 999px #0005;
}
.secondary {
  background: #111;
}
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  padding: 13px 18px;
  border-radius: 7px;
  background: #147f50;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 30px #0005;
}
@media (max-width: 680px) {
  .console header {
    height: 62px;
    padding: 0 13px;
  }
  .brand strong {
    font-size: 13px;
  }
  .brand span {
    width: 34px;
    height: 34px;
  }
  .operator div {
    display: none;
  }
  .console main {
    width: calc(100% - 20px);
    padding-top: 16px;
  }
  .event-grid {
    grid-template-columns: 1fr;
  }
  .page-title h1,
  .event-head h1 {
    font-size: 23px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .stats article {
    padding: 13px;
  }
  .list-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .list-head input {
    max-width: none;
  }
  .booking-row {
    grid-template-columns: 40px 1fr 20px;
    padding: 11px;
  }
  .pill {
    grid-column: 2;
  }
  .chevron {
    grid-column: 3;
    grid-row: 1/3;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 27px 22px;
  }
}

.head-actions,
.list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats .wait {
  background: #fff8df;
  color: #8c6500;
}
.filter-tabs {
  display: flex;
  gap: 7px;
  padding: 10px 18px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}
.filter-tabs button {
  padding: 8px 11px;
  border: 0;
  border-radius: 99px;
  color: #666;
  background: #eee;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.filter-tabs button.active {
  color: #fff;
  background: #111;
}
.filter-tabs b {
  margin-left: 4px;
}
.action.promote {
  background: #16704a;
}
.action.resend {
  background: #354052;
}
.action.cancel {
  border: 1px solid #efb2ad;
  color: #b42318;
  background: #fff;
}
.action.delete {
  border: 1px solid #7f100b;
  color: #fff;
  background: #9d1610;
}
.manager-actions {
  margin-top: 13px;
  padding-top: 3px;
  border-top: 1px solid #eee;
}
.manager-actions .action {
  font-size: 11px;
}
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff8f7;
  font-size: 12px;
}
.bulk-actions label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.bulk-actions button {
  margin-left: auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: #9d1610;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.bulk-actions button:disabled {
  background: #ccc;
}
.booking-select-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid #eee;
}
.booking-select-row .bulk-booking-check {
  margin: auto;
  width: 18px;
  height: 18px;
}
.booking-select-row .booking-row {
  border-bottom: 0;
}
.global-search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  margin: 18px 0 8px;
}
.global-search-form input {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #d4d4d4;
  border-radius: 5px;
  font-size: 15px;
  text-transform: uppercase;
}
.home-event-search {
  margin: 0 0 18px;
}
.statistics-card {
  width: min(1100px, calc(100vw - 28px));
  max-width: none;
}
.statistics-table-wrap {
  overflow: auto;
  max-height: 56vh;
  margin-top: 16px;
}
.statistics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.statistics-table th,
.statistics-table td {
  padding: 9px;
  border-bottom: 1px solid #e3e3e3;
  text-align: left;
  white-space: nowrap;
}
.wide-search {
  width: 100%;
  margin: 12px 0 2px;
  padding: 12px;
  border: 1px solid #d7d8da;
  border-radius: 5px;
}
.whitelist-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.whitelist-filters select {
  padding: 10px;
  border: 1px solid #d7d8da;
  border-radius: 5px;
  background: #fff;
}
.whitelist-status {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}
.whitelist-status.approved {
  color: #067647;
  background: #ecfdf3;
}
.whitelist-status.pending {
  color: #9a6700;
  background: #fffaeb;
}
.whitelist-status.blocked {
  color: #b42318;
  background: #fef3f2;
}
.row-actions {
  display: flex;
  gap: 5px;
}
.row-actions button {
  padding: 7px 8px;
  border: 1px solid #d7d8da;
  border-radius: 4px;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
#booking-edit-form h3 {
  margin: 20px 0 10px;
  font-size: 13px;
}
.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 11px;
}
.edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #666;
  font-size: 9px;
  font-weight: 800;
}
.edit-grid input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d7d8da;
  border-radius: 5px;
  outline: none;
}
.edit-grid .wide {
  grid-column: 1/-1;
}
.edit-grid .check {
  flex-direction: row;
  align-items: center;
  font-size: 11px;
}
.edit-grid .check input {
  width: auto;
}
@media (max-width: 680px) {
  .list-tools,
  .head-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .whitelist-filters {
    grid-template-columns: 1fr;
  }
}
