/* ============================================================
   IBC Rebooking — app.css
   Brand per show.ibc.org: red #E30613, black, white, Avenir.
   Mobile-first; single stylesheet; no framework.
   ============================================================ */

:root {
  --red: #E30613;
  --red-dark: #BA0D1B;
  --black: #0b0b0d;
  --ink: #111111;
  --grey: #707070;
  --bg: #F4F4F4;
  --line: #e5e5e5;
  --radius: 10px;
}

/* ascent/descent overrides pin the baseline maths to one set of values:
   Firefox reads this font's hhea table (756/-244 + lineGap 200) while
   Chrome/Edge read usWin (953/250), which shifted glyphs ~1px vertically
   between browsers. These overrides make every engine render identically. */
@font-face {
  font-family: 'Avenir';
  src: url('AvenirLTStd-Book.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
  ascent-override: 95.3%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Avenir';
  src: url('AvenirLTStd-Black.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
  ascent-override: 95.3%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Avenir';
  src: url('AvenirLTStd-Light.otf') format('opentype');
  font-weight: 300;
  font-display: swap;
  ascent-override: 95.3%;
  descent-override: 25%;
  line-gap-override: 0%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Avenir', 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; }
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0 0 8px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  flex-wrap: wrap;
}
.topbar-logo { height: 44px; display: block; }
.topbar-user {
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-user a { color: #fff; font-weight: 800; }

/* ---------- Layout ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}
/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tab {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--grey);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--red); }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card-title {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 4px;
  margin: 0 0 14px;
}

/* ---------- Page header (company + key stats) ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.page-company { font-size: 32px; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.page-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-mini {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.stat-mini-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--grey);
}
.stat-mini-value { font-size: 20px; font-weight: 800; line-height: 1.2; }
.points-link-row { margin: 0 0 16px; }
.points-link { font-size: 14px; font-weight: 800; }

/* ---------- Queue card ---------- */
.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.queue-slot { font-size: 14px; font-weight: 800; }
.queue-slot-label { color: var(--grey); font-weight: 400; }
.queue-update { font-size: 12px; color: var(--grey); margin-top: 8px; }
.note {
  font-size: 12px;
  color: var(--grey);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- Queue chips (rendered by ajax.php) ---------- */
.queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #efefef;
  border-radius: 6px;
  padding: 9px 13px;
  margin: 0 8px 8px 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.queue-chip--serving { background: var(--black); color: #fff; }
.queue-chip--you { background: var(--red); color: #fff; }
.chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

/* ---------- Zoom banner ---------- */
.banner {
  background: var(--black);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.banner-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.zoom-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 14px 0 0;
  font-size: 14px;
}
.zoom-details dt { color: #9a9aa0; }
.zoom-details dd { margin: 0; overflow-wrap: anywhere; }
.zoom-details a { color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  background: var(--red);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--red-dark); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
}
.field input:focus, .field select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 800; margin: 12px 0; }
.checkline input { width: 18px; height: 18px; margin-top: 3px; flex: none; }

/* Hall selector: a <details> styled like a select box */
.hall-select { position: relative; }
.hall-select > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 12px 34px 12px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hall-select > summary::-webkit-details-marker { display: none; }
.hall-select > summary::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -7px;
  border-right: 2px solid var(--grey);
  border-bottom: 2px solid var(--grey);
  transform: rotate(45deg);
}
.hall-select[open] > summary {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.hall-select > summary:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.hall-select-panel {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 2px;
  padding: 10px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.field label.hall-option {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
  padding: 6px 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.field label.hall-option:hover { background: var(--bg); }
.field label.hall-option input { width: 16px; height: 16px; flex: none; }
.field label.hall-option input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  box-shadow: none;
}

/* ---------- Alerts & badges ---------- */
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fbe7e8; color: #8f0c14; border: 1px solid #f2c2c5; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c6e6c8; }
.field .alert { margin: 6px 0 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 2px 10px;
  vertical-align: middle;
}
.badge-on { background: var(--red); color: #fff; }
.badge-off { background: #efefef; color: var(--grey); }

/* ---------- Table (points list) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  background: var(--black);
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table tbody tr:nth-child(even) { background: #fafafa; }
.table tbody tr.is-you { background: var(--red); color: #fff; }
.table tbody tr.is-you td { border-bottom-color: var(--red); }

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.login-card {
  width: 100%;
  max-width: 880px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  display: grid;
}
@media (min-width: 760px) { .login-card { grid-template-columns: 5fr 6fr; } }
.login-brand {
  background: linear-gradient(160deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.login-brand img { width: 200px; }
.login-brand a { color: #fff; }
.login-brand-text { font-size: 14px; line-height: 1.65; }
.login-closed {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}
.login-form { padding: 36px 32px; }
.login-form h1 { font-size: 22px; margin-bottom: 2px; }
.login-form .sub { color: var(--grey); font-size: 14px; margin: 0 0 20px; }

/* ---------- Page head (list page) ---------- */
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 { font-size: 20px; margin: 0; }
