:root {
  --bg: #f5f7fb;
  --surface: rgba(255,255,255,.9);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-2: #7c3aed;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --sidebar: #0f172a;
  --sidebar-2: #162032;
  --shadow: 0 20px 50px rgba(15, 23, 42, .08);
}
html, body { min-height: 100%; }
body {
  background: linear-gradient(180deg, #f8fafc 0%, #eef3ff 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.topbar {
  background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
  box-shadow: 0 10px 30px rgba(37, 99, 235, .18);
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
}
.hero-card, .panel-card, .stat-card, .glass-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.hero-card { overflow: hidden; }
.gradient-bg {
  background: radial-gradient(circle at top right, rgba(59,130,246,.18), transparent 40%),
              radial-gradient(circle at bottom left, rgba(168,85,247,.18), transparent 40%),
              white;
}
.stat-card {
  padding: 1.15rem;
  height: 100%;
}
.stat-card .icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(168,85,247,.14));
  color: #1d4ed8;
  font-size: 1.35rem;
}
.panel-card { padding: 1.25rem; }
.sidebar-chip, .soft-chip {
  padding: .45rem .8rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  display: inline-block;
}
.success-chip { background: #ecfdf5; color: #047857; }
.table thead th {
  white-space: nowrap;
  color: #64748b;
  font-size: .79rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom-width: 1px;
}
.table tbody td { vertical-align: middle; }
.table > :not(caption) > * > * {
  background: transparent;
  border-color: rgba(226,232,240,.9);
}
.table tbody tr:hover { background: rgba(248,250,252,.75); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border: none;
  box-shadow: 0 12px 25px rgba(37, 99, 235, .18);
}
.btn-primary:hover { opacity: .95; }
.btn-outline-primary {
  border-color: #c7d2fe;
  color: #4338ca;
}
.btn-outline-primary:hover { background: #eef2ff; color: #3730a3; }
.form-control, .form-select, .input-group-text, textarea.form-control {
  border-radius: 14px;
  border-color: #dbe4ff;
  padding-top: .72rem;
  padding-bottom: .72rem;
  background: rgba(255,255,255,.95);
}
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 .2rem rgba(59,130,246,.12);
}
.footer-mini { color: #64748b; }
.login-shell { min-height: calc(100vh - 72px); }
.map-frame {
  border: 0;
  width: 100%;
  min-height: 280px;
  border-radius: 24px;
}
.qr-box {
  background: white;
  border-radius: 22px;
  padding: 1rem;
  display: inline-block;
  box-shadow: 0 15px 30px rgba(15,23,42,.08);
}
.card-kpi {
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1;
}
.small-muted { color: var(--muted); font-size: .92rem; }

/* Modern admin shell */
.admin-body {
  background: linear-gradient(180deg, #f8fbff 0%, #eef2ff 100%);
}
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand-wrap { margin-bottom: 1.4rem; }
.sidebar-brand {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .95rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand:hover { color: #fff; }
.sidebar-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(96,165,250,.35), rgba(168,85,247,.45));
}
.sidebar-brand small { color: rgba(255,255,255,.68); }
.sidebar-section-label {
  color: rgba(255,255,255,.62);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 1rem .55rem .65rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.sidebar-link {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  transition: .18s ease;
}
.sidebar-link i {
  width: 22px;
  font-size: 1.05rem;
}
.sidebar-link:hover,
.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.sidebar-cta {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
  border-radius: 24px;
  padding: 1rem;
  box-shadow: none;
}
.sidebar-cta .small-muted { color: rgba(255,255,255,.72); }
.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248,250,252,.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226,232,240,.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}
.admin-eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 800;
}
.admin-page-title {
  font-size: 1.45rem;
  font-weight: 800;
}
.admin-content {
  padding: 1.5rem;
}
.admin-footer {
  margin: 0 1.5rem 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(226,232,240,.85);
  color: var(--muted);
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem .55rem;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226,232,240,.95);
}
.user-pill-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.user-pill-text {
  line-height: 1.05;
}
.user-pill-text strong {
  display: block;
  font-size: .92rem;
}
.user-pill-text small {
  color: var(--muted);
}
.topbar-ghost-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  text-decoration: none;
  padding: .65rem .9rem;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226,232,240,.95);
}
.topbar-ghost-link:hover { color: var(--primary); }
.sidebar-toggle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}
.metric-card {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.9));
  border: 1px solid rgba(226,232,240,.85);
  border-radius: 24px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
  height: 100%;
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.metric-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(37,99,235,.11), rgba(124,58,237,.14));
}
.metric-trend {
  font-size: .8rem;
  color: #0f766e;
  background: #ecfeff;
  border: 1px solid #cffafe;
  padding: .3rem .6rem;
  border-radius: 999px;
}
.section-title {
  font-size: 1.08rem;
  font-weight: 800;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 1.25rem;
}
.mini-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.mini-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  background: rgba(248,250,252,.95);
  border: 1px solid rgba(226,232,240,.85);
}
.progress-soft {
  height: .7rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-soft > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
@media (max-width: 1199.98px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 290px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 1200;
  }
  body.sidebar-open .admin-sidebar { transform: translateX(0); }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.35);
    z-index: 1100;
  }
}
@media (max-width: 991.98px) {
  .grid-2 { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
  .admin-topbar { padding: .9rem 1rem; }
  .admin-footer { margin: 0 1rem 1rem; }
}
