/* CraDet Monitoring Dashboard | style.new.css */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: #eef4fb;
  color: #1f2937;
}

body {
  display: flex;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: fixed;
  inset: 0 auto 0 0;
}

.sidebar-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.35rem;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: #475569;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  color: #334155;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar-footer {
  margin-top: auto;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.6;
}

.dashboard-frame {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  padding: 26px 28px 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}

.topbar-left {
  max-width: 820px;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.topbar p {
  margin: 12px 0 0;
  font-size: 0.96rem;
  color: #475569;
  max-width: 760px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-simulate,
.btn-reset,
.btn-add-contact,
.contact-remove {
  cursor: pointer;
  border: none;
  border-radius: 14px;
  padding: 13px 20px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-simulate {
  background: linear-gradient(135deg, #ea4335, #d93025);
  color: #ffffff;
}

.btn-simulate:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(234, 67, 53, 0.16);
}

.btn-reset,
.btn-add-contact {
  background: #f8fafc;
  color: #1f2937;
  border: 1px solid #cbd5e1;
}

.btn-reset:hover,
.btn-add-contact:hover,
.contact-remove:hover {
  transform: translateY(-1px);
  background: #eff4ff;
}

.summary-grid,
.analytics-grid,
.content-grid {
  display: grid;
  gap: 20px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.analytics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.content-grid {
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
}

.main-column,
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.card-icon {
  font-size: 1.4rem;
}

.card h2,
.overview-card-title,
.contact-card .section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.overview-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.overview-card-subtitle {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill {
  background: #eaf8ff;
  color: #0c4a6e;
}

.alert-pill {
  background: #fef3c7;
  color: #92400e;
}

.info-pill {
  background: #eef2ff;
  color: #3730a3;
}

.overview-metrics,
.health-grid .grid,
.map-tile,
.alerts-list,
.contact-list,
.progress-section {
  display: grid;
  gap: 16px;
}

.metric-item,
.location-summary,
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 16px;
  color: #334155;
  font-size: 0.95rem;
}

.metric-item strong,
.location-summary strong,
.progress-row strong {
  color: #0f172a;
}

.chart-card {
  padding: 18px 18px 14px;
}

.chart-card canvas {
  width: 100% !important;
  height: 220px !important;
}

.health-card {
  background: #f8fafc;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.health-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.health-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.health-value {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 10px 0 6px;
}

.health-unit {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.health-bar-track,
.bar-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.health-bar,
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.health-bar.green,
.bar-fill {
  background: linear-gradient(135deg, #22c55e, #10b981);
}

.health-bar.blue {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.health-bar.orange {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.map-card,
.ambulance-card,
.contact-card,
.alerts-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.map-text,
.ambulance-footnote {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.6;
}

.map-tile {
  min-height: 220px;
  border-radius: 22px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px dashed #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-placeholder {
  color: #334155;
  font-size: 0.96rem;
  text-align: center;
  padding: 22px;
}

.progress-section {
  gap: 14px;
}

.progress-row {
  border-radius: 16px;
}

.progress-bar {
  width: 100%;
  height: 16px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  transition: width 0.6s ease;
}

.contact-form {
  display: grid;
  gap: 12px;
}

.input-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
}

.contact-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #0f172a;
}

.contact-list,
.alerts-list {
  display: grid;
  gap: 12px;
}

.contact-item,
.alert-pill-card {
  border-radius: 18px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.contact-item {
  display: grid;
  gap: 12px;
}

.contact-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contact-name {
  font-weight: 700;
  color: #0f172a;
}

.contact-phone,
.contact-relationship {
  color: #475569;
  font-size: 0.92rem;
}

.contact-remove {
  width: fit-content;
  justify-self: end;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 14px;
  color: #0f172a;
}

.contact-note {
  font-size: 0.88rem;
  color: #475569;
  min-height: 20px;
}

.footer {
  margin-top: 24px;
  padding: 18px 0 6px;
  font-size: 0.85rem;
  color: #64748b;
}

.alert-pill-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 1180px) {
  .dashboard-frame {
    margin-left: 0;
    width: 100%;
  }

  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid,
  .analytics-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar {
    padding: 18px 16px;
  }

  .dashboard-frame {
    padding: 18px 16px 24px;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .btn-simulate,
  .btn-reset {
    width: 100%;
  }
}
