:root {
  --bg: #09131f;
  --bg-soft: #0f1d2d;
  --panel: rgba(15, 29, 45, 0.92);
  --panel-2: rgba(14, 25, 40, 0.86);
  --card: #122235;
  --line: rgba(255,255,255,0.09);
  --text: #eaf2ff;
  --muted: #96a8c4;
  --primary: #3b82f6;
  --primary-2: #60a5fa;
  --accent: #14b8a6;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 20px 60px rgba(0,0,0,.28);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.16), transparent 28%),
    radial-gradient(circle at top left, rgba(20,184,166,.12), transparent 24%),
    linear-gradient(180deg, #07111c 0%, #0a1523 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.container {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.page-wrapper { padding: 32px 0 60px; }
.section { padding: 28px 0; }
.section-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}
.section-copy {
  margin: 0 auto;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.75;
}
.center { text-align: center; }

.main-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(6, 12, 21, .82);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(20,184,166,.18));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-title { font-weight: 800; letter-spacing: .06em; }
.logo-subtitle { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.main-nav a,
.main-nav button,
.mobile-nav a {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: .2s ease;
  background: transparent;
}
.main-nav a:hover,
.main-nav button:hover,
.mobile-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
}
.mobile-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.mobile-nav {
  display: none;
  padding: 0 16px 16px;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.05);
}
.mobile-nav.open { display: flex; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center;
  padding: 42px 0 20px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #cfe0ff;
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(96,165,250,.18);
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4.8vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -.03em;
}
.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.85;
  margin: 18px 0 0;
}
.hero-actions,
.hero-badges,
.inline-list,
.filters-row,
.card-actions,
.export-actions,
.tab-actions,
.report-toolbar,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-actions { margin-top: 26px; }
.hero-badges { margin-top: 22px; }
.hero-badge,
.pill,
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--muted);
}
.hero-panel,
.glass-card,
.form-card,
.content-card,
.card,
.metric-card,
.sidebar,
.topbar,
.map-card,
.tabs,
.table-wrap,
.empty-state,
.camera-shell,
.receipt-card,
.footer {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-panel,
.glass-card,
.form-card,
.content-card,
.card,
.metric-card,
.map-card,
.tabs,
.empty-state,
.camera-shell,
.receipt-card {
  border-radius: var(--radius);
}
.hero-panel,
.form-card,
.content-card,
.card,
.map-card,
.empty-state,
.camera-shell,
.receipt-card,
.tabs { padding: 24px; }
.glass-card {
  padding: 28px;
  border-radius: 26px;
}
.metric-card {
  padding: 18px;
  background: rgba(255,255,255,.035);
}
.metric-label,
.kpi-label { color: var(--muted); font-size: .94rem; }
.metric-value,
.kpi-value {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-top: 10px;
}
.metric-trend,
.kpi-trend { color: #bfd2f6; margin-top: 8px; font-size: .92rem; }
.grid-2,
.cards-grid,
.feature-grid,
.sites-grid,
.kpi-grid,
.admin-grid,
.phone-card-grid,
.form-grid,
.panel-list,
.summary-grid {
  display: grid;
  gap: 16px;
}
.grid-2,
.kpi-grid,
.admin-grid,
.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sites-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.phone-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-list { grid-template-columns: 1fr; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.stat-pill { border-radius: 18px; padding: 16px; justify-content: space-between; }
.stat-pill strong { color: #d6e6ff; font-size: 1.1rem; }
.icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, rgba(59,130,246,.35), rgba(20,184,166,.35));
  border: 1px solid rgba(255,255,255,.09);
  margin-bottom: 14px;
}
.card h3,
.content-card h2,
.form-title,
.topbar h1 {
  margin: 0 0 12px;
}
.card p,
.content-card p,
.topbar p,
.card li,
.empty-state p { color: var(--muted); line-height: 1.75; }
.card ul { margin: 0; padding-left: 18px; }
.card li + li { margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  font-weight: 700;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.btn-secondary {
  color: #dff7ff;
  background: linear-gradient(135deg, rgba(20,184,166,.28), rgba(59,130,246,.2));
  border-color: rgba(20,184,166,.22);
}
.btn-outline {
  color: var(--text);
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
}
.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316);
}
.btn-success {
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.form-card { max-width: 780px; margin: 0 auto; }
.form-card-wide { max-width: 960px; }
.form-title { font-size: 1.9rem; font-weight: 800; }
.form-subtitle { color: var(--muted); line-height: 1.8; margin: 0 0 18px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.hidden { display: none; }
.form-control {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text);
  outline: none;
}
.form-control::placeholder { color: rgba(255,255,255,.34); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-control:focus {
  border-color: rgba(96,165,250,.58);
  box-shadow: 0 0 0 4px rgba(59,130,246,.14);
}
label { font-weight: 600; color: #dbe9ff; }
.required { color: #fca5a5; }
.form-hint { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #d7e6ff;
  border: 1px solid rgba(255,255,255,.08);
}
.form-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 26px 0;
}

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
}
.alert i { margin-top: 2px; }
.alert-success { background: rgba(34,197,94,.12); color: #d9ffe5; border-color: rgba(34,197,94,.2); }
.alert-error { background: rgba(239,68,68,.12); color: #ffe0e0; border-color: rgba(239,68,68,.2); }
.alert-warning { background: rgba(245,158,11,.12); color: #fff4d7; border-color: rgba(245,158,11,.2); }
.alert-info { background: rgba(59,130,246,.12); color: #dcecff; border-color: rgba(96,165,250,.22); }

.dashboard-shell { padding: 28px 0 54px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
}
.sidebar {
  padding: 22px;
  position: sticky;
  top: 96px;
  height: fit-content;
}
.sidebar-user {
  margin: 22px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.sidebar-user strong { display: block; margin-bottom: 4px; }
.sidebar-user span { color: var(--muted); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-nav a,
.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-nav button:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.07);
}
.content-area {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
}
.topbar h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.topbar p { margin: 0; max-width: 760px; }

.tabs { padding: 14px; }
.tab-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.tab-button {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 700;
}
.tab-button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59,130,246,.24), rgba(20,184,166,.22));
  border-color: rgba(96,165,250,.35);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.table-wrap { overflow: auto; padding: 0; }
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table th,
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-align: left;
  vertical-align: top;
}
.table th { color: #d9e7ff; font-size: .92rem; background: rgba(255,255,255,.03); }
.table td { color: var(--muted); }
.table tr:hover td { background: rgba(255,255,255,.02); }

.status-badge,
.role-badge,
.city-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.status-pending { background: rgba(245,158,11,.14); color: #ffe9b5; border-color: rgba(245,158,11,.25); }
.status-active { background: rgba(34,197,94,.14); color: #d9ffe8; border-color: rgba(34,197,94,.25); }
.status-suspended { background: rgba(239,68,68,.14); color: #ffdede; border-color: rgba(239,68,68,.25); }
.role-badge { background: rgba(59,130,246,.14); color: #ddecff; border-color: rgba(96,165,250,.25); }
.city-badge { background: rgba(20,184,166,.12); color: #dcfff9; border-color: rgba(20,184,166,.2); }

.dashboard-section,
.report-card,
.user-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.report-card .muted,
.user-card .muted,
small.muted,
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.map-box,
.map-view {
  width: 100%;
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}
.custom-marker {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

.camera-shell { position: relative; overflow: hidden; }
.camera-reader {
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
}
.receipt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.receipt-item {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
}
.receipt-item strong { display: block; margin-bottom: 8px; color: #dceaff; }

.footer {
  margin: 42px auto 0;
  border-radius: 28px 28px 0 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: rgba(9, 16, 28, .96);
}
.footer-inner {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.footer-links a:hover { color: var(--text); }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(3, 8, 15, .76);
  z-index: 50;
  padding: 16px;
}
.modal {
  width: min(720px, 100%);
  border-radius: 24px;
  background: #0c1725;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  padding: 24px;
  max-height: 90vh;
  overflow: auto;
}

.empty-state {
  text-align: center;
  padding: 34px 24px;
}
.empty-state i {
  font-size: 2rem;
  margin-bottom: 12px;
  color: #9ec3ff;
}

.phone-preview {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
}
.phone-shell {
  max-width: 340px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 42px;
  background: linear-gradient(180deg, #0a1220, #08101a);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 30px 80px rgba(0,0,0,.38);
}
.phone-screen {
  border-radius: 30px;
  overflow: hidden;
  background: linear-gradient(180deg, #13243a 0%, #0d1725 100%);
  padding: 18px;
}
.phone-notch {
  width: 110px;
  height: 24px;
  background: #060b12;
  border-radius: 20px;
  margin: 0 auto 18px;
}
.phone-header,
.phone-app,
.phone-mini-grid,
.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phone-widget,
.phone-mini {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
}
.phone-widget { padding: 16px; }
.phone-mini-grid { margin-top: 14px; }
.phone-mini {
  flex: 1;
  padding: 14px;
  flex-direction: column;
  align-items: flex-start;
}
.phone-mini span { color: #b9cae6; font-size: .85rem; }
.phone-mini strong { color: #fff; font-size: 1.4rem; margin-top: 6px; }
.phone-logo { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--success);
  margin-top: 5px;
}
.timeline-dot.orange { background: var(--warning); }
.timeline-content { display: flex; flex-direction: column; gap: 4px; color: #b9cae6; }
.timeline-content strong { color: #fff; }

.helper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.helper-item {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0f1c2d;
  color: #e6f0ff;
}
.leaflet-control-attribution,
.leaflet-container a { color: #d5e6ff !important; }

@media (max-width: 1080px) {
  .hero,
  .phone-preview,
  .dashboard-grid,
  .cards-grid,
  .feature-grid,
  .sites-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: inline-grid; place-items: center; }
  .grid-2,
  .kpi-grid,
  .admin-grid,
  .summary-grid,
  .stats-row,
  .form-grid,
  .receipt-grid,
  .phone-card-grid,
  .helper-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner,
  .container { width: min(calc(100% - 20px), var(--container)); }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: 2.2rem; }
  .glass-card,
  .hero-panel,
  .form-card,
  .content-card,
  .card,
  .map-card,
  .tabs,
  .empty-state,
  .camera-shell,
  .receipt-card,
  .topbar,
  .sidebar { padding: 18px; }
  .logo-subtitle { display: none; }
  .footer-inner { align-items: flex-start; }
}
