/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --brand:         #e00000;
  --brand-dark:    #c80000;
  --brand-light:   #ffeaea;
  --brand-tint:    #fff5f5;

  --success:       #2c7a5b;
  --success-bg:    #f0faf5;
  --success-light: #e8f5e9;

  --bg:            #f5f5f5;
  --surface:       #fff;
  --border:        #e8e8e8;
  --border-dark:   #ccc;

  --text:          #111;
  --text-muted:    #666;
  --text-subtle:   #888;
  --text-faint:    #aaa;
}

/* ─── RESET ─────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ─── NAVBAR ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
}
.navbar-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--surface);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
  margin-right: 12px;
  white-space: nowrap;
}
.navbar-brand i { color: var(--brand); font-size: 1.2rem; }
.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.navbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.navbar-link:hover { background: rgba(255,255,255,0.1); color: var(--surface); }
.navbar-link--active { background: var(--brand); color: var(--surface) !important; }
.navbar-link--active:hover { background: var(--brand-dark); }
.navbar-link--danger { margin-left: auto; color: #ff6b6b; }
.navbar-link--danger:hover { background: rgba(220,53,69,0.15); color: #ff4444; }

/* Burger – hidden on desktop */
.navbar-burger {
  display: none;
  background: none;
  border: none;
  color: var(--surface);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px 8px;
  margin-left: auto;
}

/* ─── NAVBAR MOBILE ─────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-burger { display: block; }
  .navbar-link--danger { margin-left: 0; }
  .navbar-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: #111;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  .navbar-links--open { display: flex; }
  .navbar-link { padding: 10px 14px; border-radius: 8px; }
}

/* ─── LAYOUT ────────────────────────────────────────────── */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-header  { margin-bottom: 24px; }
.page-title   { font-size: 1.6rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-title i { color: var(--brand); }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 0.9rem; }

/* ─── SECTIONS ──────────────────────────────────────────── */
.admin-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}
.admin-section h2 i { color: var(--brand); }

/* ─── SPOTS GRID ────────────────────────────────────────── */
.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.spot-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.spot-card:hover {
  border-color: var(--border-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.spot-card--active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(224,0,0,0.1);
}
.spot-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.spot-card__icon {
  width: 42px; height: 42px;
  background: var(--brand-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--brand);
  flex-shrink: 0;
}
.spot-card__info { flex: 1; min-width: 0; }
.spot-card__name { font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-card__id   { font-size: 0.8rem; color: var(--text-subtle); }
.spot-card__actions { display: flex; flex-direction: column; gap: 8px; }
.spot-card__btn { width: 100%; text-align: center; justify-content: center; }
.spot-card__copy-row {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 8px;
}
.spot-card__copy-row code {
  flex: 1;
  font-size: 0.75rem;
  color: #555;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spot-card__copy-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-subtle);
  white-space: nowrap;
  min-width: 48px;
}
.spot-card__copy-btn { padding: 6px 10px; font-size: 0.8rem; }

/* ─── ACCOUNT INFO ROW ──────────────────────────────────── */
.account-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.account-info-row--mt { margin-top: 8px; }
.account-info-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-subtle);
  min-width: 48px;
}
.account-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* ─── SPOT / SETTINGS TABS ──────────────────────────────── */
.spot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.spot-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: #444;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.spot-tab:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-tint);
}
.spot-tab--active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--surface);
}
.spot-tab--active:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--surface);
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}
.settings-tab {
  border-radius: 8px 8px 0 0;
  margin-bottom: -2px;
  border-bottom: none;
}
.settings-tab--active {
  border-bottom: 2px solid var(--surface);
}
.settings-tab-panel {
  border-top: none;
  border-radius: 0 0 12px 12px;
  margin-top: 0;
}

/* ─── FORMS ─────────────────────────────────────────────── */
.admin-form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-input {
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  flex: 1;
  font-size: 1rem;
  min-width: 0;
  transition: border-color 0.15s;
}
.admin-input:focus { outline: none; border-color: var(--brand); }

/* ─── BUTTONS ───────────────────────────────────────────── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, transform 0.05s;
  white-space: nowrap;
}
.admin-btn:active { transform: translateY(1px); }
.admin-btn-primary { background: var(--brand); color: var(--surface); }
.admin-btn-primary:hover { background: var(--brand-dark); }
.admin-btn-outline { background: var(--surface); border: 2px solid var(--brand); color: var(--brand); }
.admin-btn-outline:hover { background: var(--brand-tint); }

/* ─── STATUS / BADGES ───────────────────────────────────── */
.admin-status-wrapper { display: flex; flex-direction: column; gap: 10px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--success-light);
  color: #2e7d32;
  border-radius: 8px;
  font-weight: 700;
}

/* ─── COPY ROW ──────────────────────────────────────────── */
.admin-copy-row {
  display: flex;
  align-items: center;
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  gap: 10px;
}
.admin-copy-row code {
  flex: 1;
  font-family: monospace;
  color: #c00000;
  font-size: 0.85rem;
  word-break: break-all;
}

/* ─── ORDERS COLUMNS ────────────────────────────────────── */
.admin-columns { display: flex; gap: 20px; }
.admin-columns section { flex: 1; }
@media (max-width: 600px) { .admin-columns { flex-direction: column; } }

.admin-ticket {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--surface);
}
.admin-ticket.ready { border-color: var(--success); background: var(--success-bg); }
.admin-ticket-number { font-size: 2.2rem; font-weight: 900; }

/* ─── ALERTS ────────────────────────────────────────────── */
.admin-alert {
  padding: 14px 18px;
  background: #fff3cd;
  color: #856404;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #ffeeba;
}
.admin-alert--info { background: #f0f7ff; color: #1a4f8a; border-color: #c3d9f5; margin-top: 16px; }
.admin-text-muted { color: var(--text-muted); font-size: 0.9rem; }
.admin-mt-sm { margin-top: 14px; }

/* ─── TIMER SETTINGS ────────────────────────────────────── */
.settings-timer-form { max-width: 540px; }
.timer-row { display: flex; gap: 16px; align-items: flex-start; }
.timer-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.timer-icon--preparing { background: var(--brand-light); color: var(--brand); }
.timer-icon--ready     { background: var(--success-light); color: var(--success); }
.timer-body { flex: 1; }
.timer-label { display: block; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.timer-hint  { margin: 4px 0 10px; }
.timer-input-row { display: flex; align-items: center; gap: 8px; }
.timer-input { flex: 0 0 90px; text-align: center; font-size: 1.1rem; font-weight: 700; }
.timer-unit  { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.timer-save-row { margin-top: 24px; }

/* ─── SETTINGS PAGE MISC ────────────────────────────────── */
.poster-connect-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid #eee; }
.poster-connect-section > h2 { margin-bottom: 12px; }

/* ─── SETTINGS FOOTER ───────────────────────────────────── */
.settings-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.settings-footer__health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-subtle);
  text-decoration: none;
}
.settings-footer__health i { color: var(--brand); }
.settings-footer__health:hover { color: #333; }

/* ─── BOARD (PUBLIC) ────────────────────────────────────── */
.board-body { background: #000; overflow: hidden; height: 100vh; color-scheme: only light; }
.board-container { display: flex; height: 100%; width: 100%; }
.board-title {
  font-family: "Montserrat", sans-serif;
  font-size: 4.5vw;
  font-weight: 800;
  margin-bottom: 2.5vw;
  text-transform: capitalize;
  text-align: left;
  flex-shrink: 0;
}
.column {
  flex: 1;
  padding: 1.5vw;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.column.left  { background: var(--brand); color: var(--surface); }
.column.right { background: var(--surface); color: var(--success); }
.order-grid {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  grid-template-columns: repeat(3, 1fr);
  grid-auto-columns: 0;
  grid-auto-flow: column;
  align-items: center;
  column-gap: 0;
  row-gap: 0;
  flex: 1;
  min-height: 0;
  height: 0;
  overflow: hidden;
}
.order-number {
  font-family: "Montserrat", sans-serif;
  font-size: 5.5vw;
  font-weight: 800;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  white-space: nowrap;
}

/* ─── SSE STATUS DOT ────────────────────────────────────── */
.sse-dot {
  position: fixed;
  bottom: 14px;
  right: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 9999;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
  transition: background-color 0.4s;
}
.sse-dot--green { background: #2ecc71; }
.sse-dot--red   { background: #e00000; }

/* ─── AUTH / LANDING PAGE ───────────────────────────────── */
.auth-body { background: #f0f0f0; }
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  text-align: center;
}
.auth-logo     { font-size: 2.4rem; color: var(--brand); margin-bottom: 8px; }
.auth-title    { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-subtle); font-size: 0.9rem; margin-bottom: 24px; }
.auth-form     { text-align: left; }
.auth-field    { margin-bottom: 14px; }
.auth-label    { display: block; font-size: 0.85rem; font-weight: 600; color: #444; margin-bottom: 5px; }
.auth-input    { width: 100%; }
.auth-submit   { width: 100%; justify-content: center; margin-top: 6px; }

/* ─── UPDATE OVERLAY ────────────────────────────────────── */
.update-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s;
  opacity: 1;
}
.update-overlay--hidden {
  opacity: 0;
  pointer-events: none;
}
.update-overlay__box {
  text-align: center;
  color: #fff;
}
.update-overlay__icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(224, 0, 0, 0.7));
}
.update-overlay__title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.update-overlay__sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
}
