/* ════════════════════════════════════════════════════════════
   Emergency Preparedness (EPP) module styling
   ─────────────────────────────────────────────────────────────
   Extracted from inline styles in emergency.js so the module
   tracks the design system and adapts to dark mode via tokens.
   ════════════════════════════════════════════════════════════ */

/* ── Hero stat strip (above the tabs) ──
   Uses the plain .stat-card pattern shared by every other module —
   label / value / .stat-sub(.up|.dn). No icons, no custom colors. */
#emergency-hero { margin-bottom: 18px; }
#emergency-hero .stat-label { min-height: 0; }

/* ── Readiness panel ── */
.em-readiness { padding: 16px 18px; margin-bottom: 18px; }
.em-readiness.is-ok   { border-left: 3px solid var(--success); }
.em-readiness.is-warn { border-left: 3px solid var(--amber); }
.em-readiness-head { display: flex; align-items: center; gap: 14px; }
.em-ring { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.em-ring svg { transform: rotate(-90deg); }
.em-ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--text);
}
.em-readiness-title { font-size: 14.5px; font-weight: 800; color: var(--text); }
.em-readiness-sub   { font-size: 12.5px; color: var(--text3); margin-top: 1px; }
.em-readiness-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text3); margin: 14px 0 6px;
}
.em-check { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13px; }
.em-check svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.em-check.is-warn { color: var(--text); }
.em-check.is-warn svg { color: var(--amber); }
.em-check.is-ok { color: var(--text2); }
.em-check.is-ok svg { color: var(--success); }
.em-readiness-toggle {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none;
  font-size: 12px; font-weight: 600; color: var(--text3); margin-top: 12px;
}
.em-readiness-toggle svg { width: 14px; height: 14px; }

/* ── Section cards (A–D accordions) ── */
.em-section-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer;
}
.em-section-head.is-open { border-bottom: 1px solid var(--border); }
.em-section-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
}
.em-section-badge svg { width: 14px; height: 14px; }
.em-section-badge.is-done { background: var(--success); color: #fff; }
.em-section-badge.is-todo { background: var(--bg3); color: var(--text3); }
.em-section-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.em-section-sub   { font-size: 12.5px; color: var(--text3); margin-top: 2px; }
.em-section-caret { color: var(--text3); display: flex; }
.em-section-caret svg { width: 18px; height: 18px; }

/* ── Scenario rows ── */
.em-scenario {
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 10px;
  margin-bottom: 8px; background: var(--bg2); overflow: hidden;
}
.em-scenario.is-active  { border-left-color: var(--navy); }
.em-scenario.is-missing { border-left-color: var(--amber); }
.em-scenario.is-inactive { border-left-color: var(--border); }
.em-scenario-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none;
}
.em-scenario-ico { width: 18px; height: 18px; flex-shrink: 0; }
.em-scenario.is-active  .em-scenario-ico { color: var(--navy); }
.em-scenario.is-inactive .em-scenario-ico { color: var(--text3); }
.em-scenario-name {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.em-scenario-custom { color: var(--text3); font-size: 11px; font-weight: 500; margin-left: 6px; }
.em-scenario-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.em-scenario-caret { color: var(--text3); flex-shrink: 0; width: 16px; display: flex; justify-content: center; }
.em-scenario-caret svg { width: 15px; height: 15px; }
.em-scenario-body {
  padding: 14px 16px; border-top: 1px solid var(--border); background: var(--bg);
}

/* Chips */
.em-chip {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--bg3); color: var(--text2); border: 1px solid var(--border); white-space: nowrap;
}
.em-chip.is-active { background: var(--navy-l); color: var(--navy); border-color: var(--navy-m); }
.em-chip.is-chem   { background: var(--navy-l); color: var(--navy); border-color: var(--navy-m); }
.em-scenario-warn { color: var(--amber); display: inline-flex; }
.em-scenario-warn svg { width: 15px; height: 15px; }
.em-scenario-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }

/* ── Banners ── */
.em-banner-warn {
  background: var(--amber-l); border: 1px solid var(--amber-m); color: var(--amber);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.em-banner-warn svg { width: 18px; height: 18px; flex-shrink: 0; }
.em-banner-warn .em-banner-title { font-weight: 700; font-size: 13.5px; }
.em-banner-warn .em-banner-sub   { font-size: 12.5px; opacity: .9; }

/* ════════════════════════════════════════════════
   Mobile — give the EPP record tables labeled cards.
   The global rule (mobile.css) stacks every .tbl row into a
   labelless card. For these key/value lists we re-introduce the
   column label above each value so cards are readable.
   ════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .em-tbl tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    color: var(--text3); margin-bottom: 1px;
  }
  /* Title cell + the trailing actions cell carry no label */
  .em-tbl tbody td:first-child::before,
  .em-tbl tbody td:last-child::before { content: none; }
  /* Cards read top-to-bottom — left-align every cell even if the
     desktop column was centered (Participants / Duration / Capacity). */
  .em-tbl tbody td { padding: 5px 0 !important; text-align: left !important; }
  .em-tbl tbody td:first-child { padding-bottom: 6px !important; }

  /* Tap-to-call phone on the emergency contact card */
  .em-tel { color: var(--navy); font-weight: 600; text-decoration: none; }
}
