body {
  font-family: Arial, sans-serif;
  background: #0b1220;
  color: white;
  margin: 0;
  padding: 0;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #162033;
  padding: 20px;
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.app-shell {
  padding: 16px;
}

.topbar {
  background: #162033;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.topbar h2 {
  margin: 0 0 6px 0;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.secondary-btn {
  background: #30415f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.small {
  color: #9bb0c9;
  font-size: 14px;
}

input, button, select {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  border: none;
  box-sizing: border-box;
}

button {
  background: #2b6cff;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

#message {
  margin-top: 12px;
  color: #9cc0ff;
  min-height: 20px;
}

.dispatch-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 14px;
  align-items: start;
}

.cad-panel {
  background: #162033;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.cad-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #1d2940;
  font-weight: 700;
  font-size: 14px;
}

.cad-panel-actions {
  display: flex;
  gap: 6px;
}

.panel-min-btn {
  width: 32px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #2b6cff;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.cad-panel-body {
  padding: 12px;
}

.cad-panel.minimized .cad-panel-body {
  display: none;
}

.cad-panel.minimized {
  min-height: 46px;
}

.protocol-box,
.layer-placeholder,
.dispatch-log {
  background: #0f1728;
  border-radius: 10px;
  padding: 12px;
  color: #c7d4e8;
}

.incident-card {
  background: #0f1728;
  padding: 12px;
  margin-top: 12px;
  border-radius: 8px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.status-btn {
  background: #30415f;
}

.unit-group {
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px;
  background: #0f1728;
}

.unit-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #9cc0ff;
  margin-bottom: 8px;
}

.unit-subgroup-title {
  font-size: 12px;
  font-weight: 700;
  color: #b9c8e3;
  margin: 8px 0 6px;
}

.unit-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.unit-pill {
  background: #1b2436;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid rgba(255,255,255,0.06);
}

.unit-pill .unit-name {
  font-weight: 700;
}

.unit-pill .unit-status {
  margin-top: 4px;
  font-size: 11px;
  color: #b8c6df;
}

.unit-pill.available { border-left: 4px solid #2ecc71; }
.unit-pill.assigned,
.unit-pill.dispatched { border-left: 4px solid #f1c40f; }
.unit-pill.enroute { border-left: 4px solid #ff9f43; }
.unit-pill.onscene { border-left: 4px solid #ff5c5c; }
.unit-pill.enroute_hospital { border-left: 4px solid #3b82f6; }
.unit-pill.at_hospital { border-left: 4px solid #8b5cf6; }
.unit-pill.clear { border-left: 4px solid #95a5a6; }

@media (max-width: 1200px) {
  .dispatch-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .dispatch-grid {
    grid-template-columns: 1fr;
  }

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

.quick-dispatch-wrap {
  margin-top: 14px;
  background: #0f1728;
  border-radius: 10px;
  padding: 10px;
}

.quick-dispatch-title {
  font-size: 13px;
  font-weight: 700;
  color: #9cc0ff;
  margin-bottom: 8px;
}

.quick-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}

.quick-unit {
  background: #30415f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.incident-card.priority-1 {
  border-left: 5px solid #ff4d4d;
}

.incident-card.priority-2 {
  border-left: 5px solid #ffb020;
}

.incident-card.priority-3 {
  border-left: 5px solid #2ecc71;
}

.incident-meta-line {
  margin-top: 4px;
}

.timer-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #253552;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.timer-badge.warn {
  background: #ffb020;
  color: #1d1300;
}

.timer-badge.critical {
  background: #ff4d4d;
  color: #fff;
}

.wallboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.wallboard-card {
  background: #162033;
  border-radius: 12px;
  padding: 14px;
}

.wallboard-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #9cc0ff;
}

.wallboard-list {
  display: grid;
  gap: 8px;
}

.wallboard-item {
  background: #0f1728;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .wallboard-grid {
    grid-template-columns: 1fr;
  }
}