:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --panel: #ffffff;
  --page: #f5f7fb;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
}

body {
  background: var(--page);
  color: var(--ink);
}

[id="appShell"] > .navbar .container-fluid {
  gap: 12px;
}

[hidden] {
  display: none !important;
}

.login-page {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(23, 32, 51, 0.08);
  display: grid;
  gap: 28px;
  margin: 0 auto;
  max-width: 520px;
  padding: 28px;
  width: 100%;
}

.login-brand {
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.login-panel h1 {
  font-size: 1.75rem;
  margin: 0 0 8px;
}

.login-panel p {
  color: var(--muted);
  margin: 0;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 0.875rem;
}

.login-fields {
  display: grid;
  gap: 10px;
}

.login-error {
  color: #b42318;
  min-height: 20px;
  font-size: 0.875rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  min-height: 96px;
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 0.875rem;
}

.metric strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  margin-top: 12px;
}

.panel {
  padding: 16px;
}

.panel-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h1,
.panel-header h2 {
  font-size: 1rem;
  margin: 0;
}

.map-surface {
  aspect-ratio: 16 / 9;
  background: #e6edf5;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 320px;
  overflow: hidden;
  position: relative;
}

.live-map {
  height: 100%;
  min-height: 320px;
  width: 100%;
}

.map-empty {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  left: 50%;
  padding: 10px 12px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
}

.map-grid {
  background-image:
    linear-gradient(rgba(23, 32, 51, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  inset: 0;
  position: absolute;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
}

.map-pin span {
  background: var(--blue);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  display: block;
  height: 20px;
  width: 20px;
}

.map-pin.secondary span {
  background: var(--amber);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
}

.map-pin label {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.75rem;
  margin-top: 6px;
  padding: 3px 6px;
  white-space: nowrap;
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.timeline-item strong {
  display: block;
  font-size: 0.875rem;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.policy-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.policy-grid label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.management-form,
.assignment-form {
  display: grid;
  gap: 12px;
}

.management-form label,
.assignment-form label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.assignment-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assignment-form button,
.assignment-form .form-status {
  align-self: end;
}

.form-status {
  color: var(--muted);
  font-size: 0.875rem;
  min-height: 24px;
}

code {
  color: var(--ink);
}

@media (max-width: 700px) {
  [id="appShell"] > .navbar .container-fluid {
    align-items: flex-start;
    flex-direction: column;
  }

  .assignment-form {
    grid-template-columns: 1fr;
  }

  .policy-grid {
    grid-template-columns: 1fr;
  }
}
