:root {
  color-scheme: light;
  --vb-page: #f5f7fb;
  --vb-page-soft: #eef4ff;
  --vb-surface: rgba(255, 255, 255, 0.86);
  --vb-surface-solid: #ffffff;
  --vb-surface-muted: #f1f5f9;
  --vb-border: rgba(15, 23, 42, 0.1);
  --vb-border-strong: rgba(15, 23, 42, 0.16);
  --vb-ink: #0f172a;
  --vb-muted: #475569;
  --vb-subtle: #64748b;
  --vb-brand: #1f5bff;
  --vb-brand-strong: #1545e5;
  --vb-cyan: #0891b2;
  --vb-success: #047857;
  --vb-warning: #b45309;
  --vb-danger: #be123c;
  --vb-shadow: 0 24px 70px -44px rgba(15, 23, 42, 0.36);
}

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 91, 255, 0.12), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(8, 145, 178, 0.11), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--vb-page) 44%, #eef4ff 100%);
  color: var(--vb-ink);
}

::selection {
  background-color: rgba(79, 96, 255, 0.35);
  color: #f8fafc;
}

.form-control::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.glass-surface {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78));
  border: 1px solid var(--vb-border);
  box-shadow: var(--vb-shadow);
  backdrop-filter: blur(18px);
}

/* Identity UI theming */
.identity-shell h1, .identity-shell h2, .identity-shell h3 {
  color: #e2e8f0;
  margin-bottom: 0.65rem;
}

.identity-shell p {
  color: #cbd5e1;
}

.identity-shell hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.75rem 0;
}

.identity-shell .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.identity-shell .row > [class*="col-"] {
  flex: 1 1 280px;
}

.identity-shell .row > .col-md-3 {
  max-width: 16rem;
}

.identity-shell .row > .col-md-4 {
  max-width: 22rem;
}

.identity-shell .row > .col-md-6 {
  max-width: 32rem;
}

.identity-shell .row > .col-md-9 {
  flex: 2 1 460px;
}

.identity-shell .row section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 10px 40px -28px rgba(15, 23, 42, 0.75);
}

.identity-shell form,
.app-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.identity-shell .form-floating,
.app-form .form-floating {
  position: relative;
  margin-bottom: 0.9rem;
}

.identity-shell .form-control,
.app-form .form-control {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  padding: 1.35rem 1rem 0.55rem;
  min-height: 3.1rem;
  transition: all 0.15s ease;
}

.identity-shell .form-control:focus,
.app-form .form-control:focus {
  outline: none;
  border-color: #4e8aff;
  box-shadow: 0 0 0 4px rgba(79, 96, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.07);
}

.identity-shell .form-control::placeholder,
.app-form .form-control::placeholder {
  color: #64748b;
}

.identity-shell .form-floating > label,
.app-form .form-floating > label {
  position: absolute;
  top: 0.32rem;
  left: 1rem;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1;
  transition: color 0.15s ease;
  pointer-events: none;
  z-index: 1;
  background-color: #0f172a;
  padding: 0 0.35rem;
  border-radius: 999px;
}

.identity-shell .form-floating > input:focus + label,
.identity-shell .form-floating > textarea:focus + label,
.identity-shell .form-floating > select:focus + label,
.app-form .form-floating > input:focus + label,
.app-form .form-floating > textarea:focus + label,
.app-form .form-floating > select:focus + label {
  color: #cbd5e1;
}

.identity-shell .form-check,
.app-form .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.identity-shell .form-check-input,
.app-form .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.35rem;
  background-color: rgba(255, 255, 255, 0.05);
  accent-color: #1f5bff;
}

.identity-shell .form-check-label,
.identity-shell .form-label,
.app-form .form-check-label,
.app-form .form-label {
  color: #cbd5e1;
  font-weight: 500;
}

.identity-shell .checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mb-3 { margin-bottom: 0.9rem; }
.mb-4 { margin-bottom: 1.2rem; }
.mt-3 { margin-top: 0.9rem; }
.mt-4 { margin-top: 1.2rem; }
.w-100 { width: 100%; }
.col-md-offset-2 { margin-left: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--vb-brand), #0891b2);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 44px -24px rgba(31, 91, 255, 0.56);
}

.btn-primary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 50px -22px rgba(79, 96, 255, 0.85);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-sm {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

.btn-link {
  color: #93c5fd;
  background: transparent;
  border: none;
  padding: 0.1rem;
  box-shadow: none;
}

.btn-link:hover {
  color: #cbd5e1;
  background: transparent;
}

.btn-lg {
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  border-radius: 0.95rem;
}

.btn-close {
  appearance: none;
  -webkit-appearance: none;
  height: 2rem;
  width: 2rem;
  border: none;
  border-radius: 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-close::before {
  content: "✕";
  font-size: 0.95rem;
}

.btn-close:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.text-danger { color: #f87171; }
.text-success { color: #34d399; }
.text-info { color: #67e8f9; }
.text-dark { color: #e2e8f0; }

.alert {
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  color: #d1fae5;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fee2e2;
}

.alert-dismissible {
  justify-content: space-between;
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.nav-link:hover {
  color: #fff;
}

.identity-nav-link {
  display: block;
  padding: 0.65rem 0.9rem;
  border-radius: 0.9rem;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.identity-nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.identity-nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #1f5bff, #a855f7);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 40px -22px rgba(79, 96, 255, 0.75);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  overflow: hidden;
}

.table th, .table td {
  padding: 0.75rem 0.9rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table th {
  text-align: left;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}

.table tr:last-child td {
  border-bottom: none;
}

.tracker-map-canvas {
  min-height: 540px;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tracker-map-panel-surface {
  position: relative;
}

.tracker-map-panel-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.82);
}

.tracker-map-panel-empty.hidden,
.tracker-map-wallboard__empty.hidden {
  display: none !important;
}

.tracker-map-wallboard {
  position: relative;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 15% 15%, rgba(34, 211, 238, 0.12), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(59, 130, 246, 0.12), transparent 26%),
    #020617;
}

.tracker-map-wallboard__surface {
  position: relative;
  width: 100%;
  height: 100%;
}

.tracker-map-wallboard__canvas,
.tracker-map-wallboard__empty {
  position: absolute;
  inset: 0;
}

.tracker-map-wallboard__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.tracker-map-wallboard__overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  gap: 1rem;
}

.tracker-map-wallboard__panel,
.tracker-map-wallboard__legend {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px -40px rgba(15, 23, 42, 0.95);
}

.tracker-map-wallboard__panel {
  border-radius: 1.5rem;
  padding: 1.1rem 1.2rem;
}

.tracker-map-wallboard__legend {
  align-self: flex-end;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(44vh, 420px);
  border-radius: 1.5rem;
  padding: 1rem 1.1rem;
  overflow: hidden;
}

.tracker-map-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 35px -18px rgba(15, 23, 42, 0.9);
  font-weight: 700;
  color: #fff;
}

.tracker-map-cluster span {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.45), rgba(15, 23, 42, 0.95));
  backdrop-filter: blur(8px);
}

.tracker-map-cluster--small {
  width: 42px !important;
  height: 42px !important;
  margin-left: -21px !important;
  margin-top: -21px !important;
  font-size: 0.82rem;
}

.tracker-map-cluster--medium {
  width: 48px !important;
  height: 48px !important;
  margin-left: -24px !important;
  margin-top: -24px !important;
  font-size: 0.9rem;
}

.tracker-map-cluster--large {
  width: 56px !important;
  height: 56px !important;
  margin-left: -28px !important;
  margin-top: -28px !important;
  font-size: 1rem;
}

.tracker-map-legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  border-radius: 9999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.tracker-map-popup {
  min-width: 200px;
}

.tracker-map-popup__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.tracker-map-popup__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  color: #0f172a;
}

.tracker-map-popup__meta {
  margin: 0.9rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.tracker-map-popup__meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
}

.tracker-map-popup__meta dt {
  color: #475569;
  font-weight: 600;
}

.tracker-map-popup__meta dd {
  margin: 0;
  color: #0f172a;
  text-align: right;
}

@media (max-width: 960px) {
  .tracker-map-wallboard__overlay {
    justify-content: flex-start;
  }

  .tracker-map-wallboard__legend {
    align-self: stretch;
    width: auto;
    max-height: 32vh;
  }
}

/* Shared light theme compatibility layer.
   Many MVC views use Tailwind utilities directly. These overrides keep one
   centralized light theme without rewriting every view in one pass. */
.bg-slate-950,
.bg-slate-950\/90,
.bg-slate-950\/80,
.bg-slate-950\/70,
.bg-slate-950\/60,
.bg-slate-950\/50,
.bg-slate-950\/45,
.bg-slate-950\/40,
.bg-slate-950\/35 {
  background-color: rgba(248, 250, 252, 0.92) !important;
}

.bg-slate-900\/95,
.bg-slate-900\/70,
.bg-slate-900\/60,
.bg-white\/10,
.bg-white\/5 {
  background-color: rgba(255, 255, 255, 0.78) !important;
}

.bg-brand-500\/10,
.bg-brand-500\/20,
.bg-brand-500\/25,
.bg-brand-500\/30,
.bg-cyan-500\/10,
.bg-cyan-500\/20,
.bg-sky-500\/10,
.bg-sky-500\/20,
.bg-indigo-500\/20,
.bg-fuchsia-500\/20 {
  background-color: rgba(31, 91, 255, 0.08) !important;
}

.bg-emerald-500\/10,
.bg-emerald-500\/15,
.bg-emerald-500\/20 {
  background-color: rgba(4, 120, 87, 0.08) !important;
}

.bg-amber-400\/10,
.bg-amber-500\/10,
.bg-amber-500\/15,
.bg-amber-500\/20 {
  background-color: rgba(180, 83, 9, 0.08) !important;
}

.bg-rose-500\/10,
.bg-rose-500\/15,
.bg-rose-500\/20 {
  background-color: rgba(190, 18, 60, 0.08) !important;
}

.text-white,
.text-slate-100,
.text-slate-200,
.text-slate-300 {
  color: var(--vb-ink) !important;
}

.text-slate-400,
.text-slate-500,
.text-slate-600,
.text-slate-200\/70,
.text-slate-200\/80,
.text-slate-300\/70 {
  color: var(--vb-muted) !important;
}

.text-brand-100,
.text-brand-100\/70,
.text-brand-100\/75,
.text-brand-100\/80,
.text-brand-200,
.text-brand-300,
.text-brand-400,
.hover\:text-brand-100:hover,
.hover\:text-brand-200:hover {
  color: var(--vb-brand-strong) !important;
}

.text-cyan-100,
.text-cyan-200,
.text-cyan-50,
.text-sky-100 {
  color: var(--vb-cyan) !important;
}

.text-emerald-100,
.text-emerald-200,
.text-emerald-300,
.text-emerald-50,
.text-success {
  color: var(--vb-success) !important;
}

.text-amber-100,
.text-amber-200,
.text-amber-300,
.text-amber-50 {
  color: var(--vb-warning) !important;
}

.text-rose-100,
.text-rose-200,
.text-rose-300,
.text-rose-50,
.text-danger {
  color: var(--vb-danger) !important;
}

.border-white\/5,
.border-white\/10,
.border-white\/15,
.border-white\/20,
.border-slate-300\/20,
.divide-white\/5 > :not([hidden]) ~ :not([hidden]),
.divide-white\/10 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--vb-border) !important;
}

.border-brand-300,
.border-brand-300\/30,
.border-brand-300\/40,
.border-brand-400\/20,
.border-brand-400\/40,
.border-brand-400\/50,
.border-cyan-400\/20,
.border-cyan-400\/30,
.border-cyan-400\/40,
.border-sky-400\/30 {
  border-color: rgba(31, 91, 255, 0.18) !important;
}

.rounded-3xl {
  border-radius: 1.15rem !important;
}

.rounded-2xl {
  border-radius: 0.9rem !important;
}

.shadow-card,
.shadow-glow-brand {
  box-shadow: var(--vb-shadow) !important;
}

.btn,
.identity-nav-link,
.table,
.tracker-map-panel-empty,
.tracker-map-wallboard__panel,
.tracker-map-wallboard__legend {
  border-color: var(--vb-border) !important;
}

.btn-primary,
.btn-primary *,
.bg-brand-500,
.bg-brand-500 *,
.bg-rose-500,
.bg-rose-500 * {
  color: #ffffff !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--vb-brand), #0891b2) !important;
}

.btn-link {
  color: var(--vb-brand-strong) !important;
}

.identity-shell .row section,
.table {
  background: var(--vb-surface) !important;
  box-shadow: var(--vb-shadow);
}

.identity-shell .form-control,
.app-form .form-control,
input,
select,
textarea {
  color: var(--vb-ink) !important;
}

.identity-shell .form-control,
.app-form .form-control,
.rounded-xl.border,
.rounded-lg.border {
  background-color: rgba(255, 255, 255, 0.82) !important;
  border-color: var(--vb-border) !important;
}

.identity-shell .form-floating > label,
.app-form .form-floating > label {
  background-color: #ffffff;
  color: var(--vb-muted);
}

.alert-success {
  color: var(--vb-success);
  background: rgba(4, 120, 87, 0.08);
  border-color: rgba(4, 120, 87, 0.18);
}

.alert-danger {
  color: var(--vb-danger);
  background: rgba(190, 18, 60, 0.08);
  border-color: rgba(190, 18, 60, 0.18);
}

.vb-public-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.86)),
    radial-gradient(circle at 78% 16%, rgba(31, 91, 255, 0.14), transparent 28%);
  border: 1px solid var(--vb-border);
  box-shadow: var(--vb-shadow);
}

.vb-public-band {
  background: rgba(255, 255, 255, 0.72);
  border-block: 1px solid rgba(15, 23, 42, 0.07);
}

.vb-soft-grid {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
}
