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

:root {
  --primary:   #6c3fc5;
  --primary-d: #4f2d9e;
  --accent:    #f59e0b;
  --success:   #10b981;
  --danger:    #ef4444;
  --info:      #3b82f6;
  --bg:        #0f0c29;
  --bg2:       #1a1535;
  --bg3:       #231f45;
  --card:      rgba(255,255,255,0.06);
  --border:    rgba(255,255,255,0.10);
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --radius:    14px;
  --shadow:    0 8px 32px rgba(0,0,0,0.4);
}

html { font-size: 16px; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p  { color: var(--muted); font-size: .9rem; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
nav .logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
nav .nav-links { margin-left: auto; display: flex; gap: .5rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .4rem .8rem;
  border-radius: 8px;
  font-size: .85rem;
  transition: all .2s;
}
nav a:hover, nav a.active { background: var(--card); color: var(--text); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
}
.card-title {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  justify-content: center;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-d); }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover  { background: #059669; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-ghost    { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--bg3); }
.btn-full     { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
input, select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .65rem 1rem;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--primary); }
select option { background: var(--bg2); }

/* ── Badge ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-success { background: rgba(16,185,129,.2); color: #34d399; }
.badge-warning { background: rgba(245,158,11,.2); color: #fbbf24; }
.badge-danger  { background: rgba(239,68,68,.2);  color: #f87171; }
.badge-info    { background: rgba(59,130,246,.2); color: #60a5fa; }
.badge-purple  { background: rgba(108,63,197,.2); color: #a78bfa; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 9999;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: .8rem 1.2rem;
  font-size: .85rem;
  min-width: 240px;
  animation: slideIn .3s ease;
  box-shadow: var(--shadow);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
  background: var(--bg3);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .7rem 1rem;
  text-align: left;
}
td { padding: .75rem 1rem; border-top: 1px solid var(--border); }
tr:hover td { background: rgba(255,255,255,.03); }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: .75rem; color: var(--muted); margin-top: .2rem; }

/* ── Scan page specifics ──────────────────────────────────────────────────── */
.scan-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at top, #1e1050 0%, var(--bg) 70%);
}
.scan-logo {
  font-size: 2.5rem;
  margin-bottom: .5rem;
}
.scan-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}
.profile-block {
  background: var(--bg3);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-info .name { font-size: 1rem; font-weight: 700; }
.profile-info .meta { font-size: .8rem; color: var(--muted); }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .lbl { color: var(--muted); }
.info-row .val { font-weight: 600; }

.gps-indicator {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 8px;
  padding: .5rem .8rem;
  font-size: .8rem;
  color: #34d399;
  margin-top: 1rem;
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.4; transform:scale(1.4); }
}

/* ── Dashboard specifics ─────────────────────────────────────────────────── */
.dash-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - 57px);
}
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; height: auto; }
}
#map { width: 100%; height: 100%; min-height: 400px; border-radius: var(--radius); overflow: hidden; }
.sidebar { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }

/* ── Admin grid ──────────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 1.5rem; }
@media (max-width: 800px) { .admin-layout { grid-template-columns: 1fr; } }
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qr-box img { border-radius: 12px; border: 4px solid white; }

/* ── Loader ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Step indicator ──────────────────────────────────────────────────────── */
.steps { display: flex; justify-content: center; gap: .5rem; margin-bottom: 1.5rem; }
.step {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all .3s;
}
.step.active { background: var(--primary); width: 24px; border-radius: 4px; }

/* ── Team tag ────────────────────────────────────────────────────────────── */
.team-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .4rem;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty .icon { font-size: 2.5rem; margin-bottom: .5rem; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ── Hostess list item ───────────────────────────────────────────────────── */
.hostess-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem .5rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.hostess-item:last-child { border-bottom: none; }
.hostess-item:hover { background: rgba(255,255,255,.03); border-radius: 8px; }
.hostess-avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
  color: #fff;
}
.hostess-details { flex: 1; min-width: 0; }
.hostess-details .hname { font-size: .88rem; font-weight: 600; }
.hostess-details .hmeta { font-size: .75rem; color: var(--muted); }
.online-ring { box-shadow: 0 0 0 2px var(--success); }
