﻿:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --surface: #11161f;
  --surface-2: #161d28;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #9aa4b2;
  --gold: #d4af37;
  --green: #2fb67c;
  --red: #e05a63;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top right, rgba(212,175,55,.08), transparent 28%), var(--bg); }
body { color: var(--text); }
h1,h2,p { margin-top: 0; }

.shell { width: min(1200px, 100%); margin: 0 auto; padding: 20px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; }
.card {
  background: rgba(17,22,31,.96);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  padding: 18px;
}
.auth-card { width: min(420px,100%); padding: 28px; }
.brand-logo {
  width: 58px;
  height: 58px;
  display: block;
  margin-bottom: 18px;
}
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing:.12em; font-size:.75rem; margin-bottom:6px; }
.muted { color: var(--muted); }
.stack { display:grid; gap:16px; }
.grid { display:grid; gap:14px; }
.two { grid-template-columns: 1fr; }
.actions { grid-template-columns: 1fr; margin: 16px 0; }
.kpis { grid-template-columns: repeat(2,1fr); margin-bottom:16px; }
.kpi strong { font-size: 1.9rem; }
.topbar { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:18px; }
label { display:grid; gap:8px; color:var(--muted); font-size:.92rem; }
.check-row { display:flex; align-items:center; gap:10px; }
.check-row input { width:auto; margin:0; }
input,textarea,select {
  width:100%; border:1px solid var(--border); border-radius:14px; background:var(--surface-2);
  color:var(--text); padding:14px 15px; font:inherit;
}
textarea { min-height:110px; resize:vertical; }
button, .button {
  border:0; border-radius:16px; padding:14px 18px; font:inherit; font-weight:650; cursor:pointer;
  display:inline-flex; justify-content:center; align-items:center; text-decoration:none;
}
button:disabled { opacity:.45; cursor:not-allowed; }
.primary { background:var(--gold); color:#111; }
.secondary { background:#202938; color:var(--text); }
.ghost { background:transparent; border:1px solid var(--border); color:var(--text); }
.danger { background:rgba(224,90,99,.16); color:#ffd9dd; border:1px solid rgba(224,90,99,.28); }
.xl { min-height:72px; }
.small { padding:9px 12px; border-radius:12px; }
.alert {
  margin:14px 0; padding:14px 16px; border-radius:16px;
  background:rgba(212,175,55,.12); border:1px solid rgba(212,175,55,.25);
}
.alert.error { background:rgba(224,90,99,.12); border-color:rgba(224,90,99,.28); }
.badge {
  display:inline-flex; border-radius:999px; padding:5px 10px; font-size:.76rem; font-weight:700;
  background:rgba(212,175,55,.16); color:#f7e3a0;
}
.badge.valid { color:#b8f5dc; background:rgba(47,182,124,.16); }
.badge.bad { color:#ffd3d7; background:rgba(224,90,99,.16); }
.list { display:grid; gap:12px; }
.item { display:flex; justify-content:space-between; gap:16px; border-top:1px solid var(--border); padding-top:12px; }
.right { text-align:right; }
.table-wrap { overflow-x:auto; }
table { width:100%; min-width:720px; border-collapse:collapse; }
th,td { text-align:left; padding:14px 10px; border-top:1px solid var(--border); vertical-align:top; }
th { color:var(--muted); font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; }
.nav { display:flex; gap:10px; overflow-x:auto; margin-bottom:18px; }
.nav button.active { color:#111; background:var(--gold); border-color:transparent; }
.qr img { width:min(260px,100%); background:white; border-radius:16px; }
.inline { display:flex; gap:10px; flex-wrap:wrap; }
.dense-grid { display:grid; gap:14px; grid-template-columns:1fr; }
.metric { display:grid; gap:6px; }
.metric strong { font-size:1.5rem; }
.map-board,
#google-track-map {
  position: relative;
  min-height: 420px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(212,175,55,.08), transparent 55%),
    #0f141d;
  background-size: 40px 40px, 40px 40px, auto, auto;
  overflow: hidden;
}
#google-track-map {
  background: #0f141d;
}
.map-layout {
  display: grid;
  gap: 16px;
}
.map-form {
  display: grid;
  gap: 14px;
}
.readonly-note {
  font-size: .86rem;
  color: var(--muted);
}
.marker {
  position:absolute;
  transform:translate(-50%, -50%);
  min-width: 12px;
  min-height: 12px;
  border-radius:999px;
}
.marker.site { width:16px; height:16px; background:var(--gold); }
.marker.qr { width:12px; height:12px; background:#5c86ff; }
.marker.guard { width:18px; height:18px; background:var(--green); box-shadow:0 0 0 8px rgba(47,182,124,.12); }
.marker.check { width:10px; height:10px; background:var(--red); }
.marker-label {
  position:absolute;
  transform:translate(-50%, calc(-100% - 10px));
  padding:5px 8px;
  border-radius:999px;
  background:rgba(10,13,18,.9);
  border:1px solid var(--border);
  font-size:.72rem;
  white-space:nowrap;
}
.legend { display:flex; gap:12px; flex-wrap:wrap; }
.legend span { display:inline-flex; gap:7px; align-items:center; color:var(--muted); }
.legend i { width:10px; height:10px; border-radius:999px; display:inline-block; }
.photo-thumb { width:72px; height:72px; object-fit:cover; border-radius:14px; border:1px solid var(--border); }
.report { display:grid; gap:14px; }
.report-section { border-top:1px solid var(--border); padding-top:14px; }
.muted-box {
  border:1px dashed var(--border);
  border-radius:16px;
  padding:14px;
  color:var(--muted);
}
.scanner-shell {
  overflow: hidden;
}
.scanner-note {
  margin-bottom: 0;
}
#qr-reader {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
}
#qr-reader video {
  border-radius: 18px;
}
.scan-result {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(47,182,124,.12);
  border: 1px solid rgba(47,182,124,.24);
  overflow-wrap: anywhere;
}
.qr-location-card {
  display: grid;
  gap: 14px;
}
.qr-location-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
#guard-check-map {
  min-height: 280px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0f141d;
}
.sos {
  position: fixed; right:20px; bottom:20px; width:68px; height:68px; border-radius:50%;
  background:rgba(224,90,99,.96); color:white; box-shadow:0 18px 35px rgba(224,90,99,.3);
}

@media (min-width:720px) {
  .shell { padding:28px; }
  .two { grid-template-columns:repeat(2,1fr); }
  .actions { grid-template-columns: 1fr 1fr; }
  .qr-location-summary { grid-template-columns:repeat(2,1fr); }
  .kpis { grid-template-columns:repeat(3,1fr); }
  .dense-grid { grid-template-columns:repeat(2,1fr); }
  .map-layout { grid-template-columns:minmax(0, 1.7fr) minmax(320px, .9fr); align-items:start; }
}

@media (max-width: 480px) {
  .shell { padding: 14px; }
  .card { padding: 16px; border-radius: 18px; }
  .topbar h1 { font-size: 1.7rem; }
  .xl { min-height: 60px; }
  .sos { width: 58px; height: 58px; right: 14px; bottom: 14px; }
}
@media (min-width:980px) {
  .kpis { grid-template-columns:repeat(6,1fr); }
}


.menu-toggle { margin-bottom: 12px; }
.admin-nav { display:none; flex-direction:column; align-items:stretch; }
.admin-nav.open { display:flex; }
.admin-nav button { justify-content:flex-start; }
@media (min-width: 900px) {
  .menu-toggle { display:none; }
  .admin-nav { display:flex; position:fixed; left:20px; top:20px; width:220px; max-height:calc(100vh - 40px); overflow:auto; padding:14px; border:1px solid var(--border); border-radius:22px; background:rgba(17,22,31,.96); flex-direction:column; z-index:5; }
  main.shell:has(.admin-nav) { padding-left:270px; }
}

#site-picker-map { min-height: 280px; border-radius: 18px; border:1px solid var(--border); background:#0f141d; grid-column:1 / -1; }
