/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #0f2027;
  --ocean:   #203a43;
  --teal:    #2c5364;
  --accent:  #e67e22;
  --green:   #27ae60;
  --red:     #c0392b;
  --blue:    #2980b9;
  --bg:      #f0f4f8;
  --white:   #ffffff;
  --border:  #e2e8f0;
  --muted:   #6b7280;
  --text:    #1a202c;
  --shadow:  0 2px 12px rgba(0,0,0,.08);
  --radius:  12px;
  --font:    'DM Sans', system-ui, sans-serif;
  --serif:   'DM Serif Display', Georgia, serif;
}

html { font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3 { font-family: var(--serif); line-height: 1.15; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

/* ── Layout ──────────────────────────────────────────────── */
.wrap  { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.wrap--sm { max-width: 500px; }
.wrap--md { max-width: 780px; }

/* ── Top Nav ─────────────────────────────────────────────── */
.topnav {
  background: linear-gradient(135deg, var(--navy), var(--teal));
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 62px; gap: 16px;
}
.topnav__brand { font-family: var(--serif); color: #fff; font-size: 1.3rem; display:flex; align-items:center; gap:10px; white-space:nowrap; }
.topnav__links { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.topnav a { color: rgba(255,255,255,.75); font-size:.9rem; padding:6px 12px; border-radius:8px; transition: background .15s; }
.topnav a:hover, .topnav a.active { background: rgba(255,255,255,.15); color:#fff; text-decoration:none; }
.topnav__badge { background:rgba(255,255,255,.18); color:#fff; border-radius:20px; padding:2px 10px; font-size:.75rem; font-weight:600; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }
.card__title { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 14px; color: var(--navy); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display:block; font-size:.85rem; font-weight:600; color:var(--muted); margin-bottom:5px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-family: var(--font); font-size: .95rem;
  outline: none; transition: border-color .15s;
  background: var(--white); color: var(--text);
}
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(44,83,100,.1); }
.form-control--sm { padding: 7px 10px; font-size: .85rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 9px;
  font-family: var(--font); font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .1s; white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); text-decoration:none; }
.btn:active { transform: translateY(0); }
.btn--primary   { background: var(--teal);   color: #fff; }
.btn--navy      { background: var(--navy);   color: #fff; }
.btn--accent    { background: var(--accent); color: #fff; }
.btn--green     { background: var(--green);  color: #fff; }
.btn--red       { background: var(--red);    color: #fff; }
.btn--blue      { background: var(--blue);   color: #fff; }
.btn--ghost     { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.btn--sm        { padding: 6px 13px; font-size: .8rem; }
.btn--full      { width: 100%; }

/* ── Badges / Status ─────────────────────────────────────── */
.badge { display:inline-block; padding:3px 11px; border-radius:20px; font-size:.75rem; font-weight:700; }
.badge--waiting   { background:#FFF3CD; color:#856404; }
.badge--arriving  { background:#CCE5FF; color:#004085; }
.badge--ready     { background:#D4EDDA; color:#155724; }
.badge--completed { background:#E2E3E5; color:#383D41; }
.badge--absent    { background:#F8D7DA; color:#721C24; }
.badge--cancelled { background:#F8D7DA; color:#721C24; }
.badge--verified  { background:#D4EDDA; color:#155724; }
.badge--pending   { background:#FFF3CD; color:#856404; }

/* ── Alert / Flash ───────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 9px; font-size: .9rem; font-weight: 500; margin-bottom: 14px; }
.alert--success { background: #D4EDDA; color: #155724; }
.alert--error   { background: #F8D7DA; color: #721C24; }
.alert--info    { background: #CCE5FF; color: #004085; }
.alert--warning { background: #FFF3CD; color: #856404; }

/* ── Stats grid ──────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); text-align: center; }
.stat-card__icon { font-size: 1.8rem; }
.stat-card__num  { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; margin: 4px 0; }
.stat-card__lbl  { font-size: .75rem; color: var(--muted); font-weight: 600; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th { background: #f7fafc; padding: 10px 12px; text-align: left; font-size: .78rem; font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7fafc; }

/* ── Queue Card ──────────────────────────────────────────── */
.q-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
  margin-bottom: 10px; border-left: 4px solid var(--teal);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.q-card--pickup  { border-left-color: var(--teal); }
.q-card--dropoff { border-left-color: var(--accent); }
.q-card__info { flex: 1; min-width: 180px; }
.q-card__name { font-weight: 700; font-size: 1rem; }
.q-card__sub  { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.q-card__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-box { background: var(--white); border-radius: 20px; padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-box__icon   { font-size: 3rem; margin-bottom: 8px; }
.login-box__title  { font-family: var(--serif); font-size: 1.8rem; margin-bottom: 4px; }
.login-box__sub    { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }

/* ── QR Card ─────────────────────────────────────────────── */
.qr-card { display:flex; align-items:center; gap:16px; background:#f7fafc; border:1.5px solid var(--border); border-radius:12px; padding:14px 18px; margin-bottom:20px; }
.qr-card__svg svg { border-radius:6px; border:2px solid var(--border); }
.qr-card__info { flex:1; }
.qr-card__name { font-weight:700; font-size:1rem; }
.qr-card__meta { font-size:.82rem; color:var(--muted); margin-top:4px; line-height:1.6; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:18px; }
.tab-btn { padding:8px 16px; background:var(--white); color:var(--muted); border:1.5px solid var(--border); border-radius:20px; cursor:pointer; font-weight:600; font-size:.85rem; transition:all .15s; }
.tab-btn.active, .tab-btn:hover { background:var(--teal); color:#fff; border-color:var(--teal); }

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.filter-bar input { flex:1; min-width:180px; }

/* ── Page header ─────────────────────────────────────────── */
.page-header { padding: 20px 0 16px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; }
.page-header h1 { font-size:1.6rem; color:var(--navy); }
.page-header__sub { font-size:.85rem; color:var(--muted); }

/* ── Utils ───────────────────────────────────────────────── */
.mt-1 { margin-top:8px; }  .mt-2 { margin-top:16px; } .mt-3 { margin-top:24px; }
.mb-1 { margin-bottom:8px; } .mb-2 { margin-bottom:16px; }
.text-muted { color:var(--muted); } .text-center { text-align:center; }
.flex { display:flex; } .gap-1 { gap:8px; } .gap-2 { gap:16px; }
.items-center { align-items:center; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:900; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { background:var(--white); border-radius:16px; padding:28px; width:100%; max-width:420px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.modal__title { font-family:var(--serif); font-size:1.3rem; margin-bottom:16px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty { text-align:center; padding:60px 20px; color:var(--muted); }
.empty__icon { font-size:3rem; margin-bottom:12px; }
.empty__title { font-weight:700; font-size:1.1rem; color:var(--text); }

/* ── Responsive ──────────────────────────────────────────── */
@media(max-width:600px){
  .grid-2 { grid-template-columns:1fr; }
  .topnav { padding: 0 14px; }
  .card { padding: 16px; }
  .q-card__actions { width:100%; }
  h1 { font-size:1.4rem; }
}

/* ── Home portal selector ────────────────────────────────── */
.portal-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:20px; margin-top:40px; }
.portal-card {
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.15);
  border-radius:18px; padding:32px 24px; text-align:center; cursor:pointer;
  transition:transform .15s, box-shadow .15s; color:white; text-decoration:none; display:block;
}
.portal-card:hover { transform:translateY(-5px); box-shadow:0 20px 50px rgba(0,0,0,.35); background:rgba(255,255,255,.12); text-decoration:none; color:white; }
.portal-card__icon  { font-size:2.8rem; margin-bottom:12px; }
.portal-card__title { font-family:var(--serif); font-size:1.3rem; margin-bottom:8px; }
.portal-card__desc  { font-size:.85rem; color:rgba(255,255,255,.65); line-height:1.5; }

/* ── Live indicator ──────────────────────────────────────── */
.live-dot { width:9px; height:9px; border-radius:50%; background:#27ae60; display:inline-block; animation:pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.5; transform:scale(1.3);} }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .topnav, .btn, .filter-bar { display:none; }
  body { background:white; }
  .card { box-shadow:none; border:1px solid #ccc; }
}
