/*
 * Crisis Simulation Portal - Facilitator Dashboard
 * Component-owned presentation for WordPress Multisite customer sites.
 * Version 0.4.3
 */

body.csp-facilitator-dashboard-page {
  --csp-navy: #142746;
  --csp-navy-2: #203858;
  --csp-blue: #2563eb;
  --csp-blue-dark: #1d4ed8;
  --csp-green: #16a34a;
  --csp-amber: #e78300;
  --csp-red: #dc2626;
  --csp-border: #d9dee7;
  --csp-surface: #ffffff;
  --csp-surface-soft: #f7f8fa;
  --csp-text: #161b22;
  --csp-muted-text: #5f6672;
}

/* Break the application out of a narrow theme content column. */
body.csp-facilitator-dashboard-page #csp-fac-root {
  box-sizing: border-box;
  position: relative;
  left: auto;
  width: min(1180px, calc(100vw - 40px));
  max-width: none;
  margin: 34px 0 56px;
  transform: translateX(var(--csp-viewport-shift, 0px));
  color: var(--csp-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body.csp-facilitator-dashboard-page #csp-fac-root,
body.csp-facilitator-dashboard-page #csp-fac-root * {
  box-sizing: border-box;
}


body.csp-facilitator-dashboard-page #csp-fac-root h1,
body.csp-facilitator-dashboard-page #csp-fac-root h2,
body.csp-facilitator-dashboard-page #csp-fac-root h3,
body.csp-facilitator-dashboard-page #csp-fac-root h4,
body.csp-facilitator-dashboard-page #csp-fac-root h5,
body.csp-facilitator-dashboard-page #csp-fac-root h6 {
  font-family: inherit !important;
}

body.csp-facilitator-dashboard-page #csp-fac-root h3 {
  font-size: 21px;
  line-height: 1.25;
}

/* Outer dashboard sections. Inline loading styles are intentionally overridden. */
body.csp-facilitator-dashboard-page #csp-fac-exercise,
body.csp-facilitator-dashboard-page #csp-fac-injects {
  width: 100%;
  margin: 0 0 14px !important;
  padding: 11px !important;
  border: 1px solid var(--csp-border) !important;
  border-radius: 10px !important;
  background: var(--csp-surface-soft);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
}

body.csp-facilitator-dashboard-page #csp-fac-exercise > .csp-card {
  padding: 24px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--csp-navy) 0%, #183253 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(20, 39, 70, 0.12);
}

body.csp-facilitator-dashboard-page #csp-fac-injects {
  background: #fff;
}

/* Generic cards */
body.csp-facilitator-dashboard-page .csp-card {
  margin: 0 0 12px;
  padding: 15px 16px;
  border: 1px solid var(--csp-border);
  border-radius: 12px;
  background: var(--csp-surface);
  color: var(--csp-text);
}

/* Exercise controls */
body.csp-facilitator-dashboard-page .csp-headbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

body.csp-facilitator-dashboard-page .csp-titlebar h3 {
  margin: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 600;
}

body.csp-facilitator-dashboard-page .csp-controls {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

body.csp-facilitator-dashboard-page .csp-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 0;
  border-radius: 2px;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.05em;
}

body.csp-facilitator-dashboard-page .csp-pill--green {
  background: #26785c;
  color: #fff;
}

body.csp-facilitator-dashboard-page .csp-pill--amber {
  background: #b86a00;
  color: #fff;
}

body.csp-facilitator-dashboard-page .csp-pill--grey {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

/* Buttons */
body.csp-facilitator-dashboard-page .csp-btn,
body.csp-facilitator-dashboard-page #csp-fac-root button.csp-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

body.csp-facilitator-dashboard-page .csp-btn:hover {
  transform: translateY(-1px);
}

body.csp-facilitator-dashboard-page .csp-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

body.csp-facilitator-dashboard-page .csp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

body.csp-facilitator-dashboard-page .csp-btn--primary {
  background: var(--csp-blue);
  border-color: var(--csp-blue);
  color: #fff;
}

body.csp-facilitator-dashboard-page .csp-btn--primary:hover {
  background: var(--csp-blue-dark);
  border-color: var(--csp-blue-dark);
}

body.csp-facilitator-dashboard-page .csp-btn--warning {
  background: var(--csp-amber);
  border-color: var(--csp-amber);
  color: #fff;
}

body.csp-facilitator-dashboard-page .csp-btn--success {
  background: var(--csp-green);
  border-color: var(--csp-green);
  color: #fff;
}

body.csp-facilitator-dashboard-page .csp-btn--danger {
  background: #fff;
  border-color: #ff7f87;
  color: #e0232b;
}

body.csp-facilitator-dashboard-page .csp-btn--danger:hover {
  background: #fff1f2;
}

body.csp-facilitator-dashboard-page .csp-btn--ghost {
  background: #fff;
  border-color: #d5dbe4;
  color: #4c5664;
}

body.csp-facilitator-dashboard-page .csp-btn--ghost:hover {
  background: #f6f7f9;
  border-color: #bcc5d1;
}

/* KPI strip */
body.csp-facilitator-dashboard-page .csp-kpi {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  margin: 16px 0 14px;
}

body.csp-facilitator-dashboard-page .csp-kpi-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.csp-facilitator-dashboard-page .csp-kpi-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body.csp-facilitator-dashboard-page .csp-kpi-value {
  color: #fff;
  font-size: 23px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.csp-facilitator-dashboard-page .csp-timezone-control {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

body.csp-facilitator-dashboard-page .csp-timezone-field {
  display: grid;
  gap: 5px;
  min-width: 230px;
}

body.csp-facilitator-dashboard-page .csp-timezone-field label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.csp-facilitator-dashboard-page .csp-timezone-field select {
  min-height: 36px;
  padding: 7px 34px 7px 10px;
  border: 1px solid #d5dbe4;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
}

body.csp-facilitator-dashboard-page .csp-timezone-field select:disabled {
  opacity: 0.68;
}

body.csp-facilitator-dashboard-page .csp-timezone-status {
  flex: 1 1 280px;
  align-self: center;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.4;
}

/* Broadcast control */
body.csp-facilitator-dashboard-page #csp-system-msg-box {
  margin: 4px 0 14px;
  color: #fff;
}

body.csp-facilitator-dashboard-page .csp-broadcast-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

body.csp-facilitator-dashboard-page .csp-broadcast-label {
  min-width: 96px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

body.csp-facilitator-dashboard-page .csp-broadcast-input,
body.csp-facilitator-dashboard-page .csp-broadcast-duration {
  min-height: 34px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: #fff;
  color: #111827;
  font-size: 13px;
}

body.csp-facilitator-dashboard-page .csp-broadcast-input {
  flex: 1 1 260px;
  min-width: 220px;
}

body.csp-facilitator-dashboard-page .csp-broadcast-duration {
  width: 140px;
}

body.csp-facilitator-dashboard-page #csp-system-msg-status,
body.csp-facilitator-dashboard-page #csp-fac-ex-msg {
  color: rgba(255, 255, 255, 0.78);
}

/* Scenario library and export */
body.csp-facilitator-dashboard-page .csp-librarybox {
  margin-top: 14px !important;
  padding: 15px 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.095) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.csp-facilitator-dashboard-page .csp-librarybox__head,
body.csp-facilitator-dashboard-page .csp-excelbox,
body.csp-facilitator-dashboard-page .csp-auditbox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

body.csp-facilitator-dashboard-page .csp-librarybox__title {
  margin: 0 0 3px !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 800 !important;
}

body.csp-facilitator-dashboard-page .csp-librarybox__sub,
body.csp-facilitator-dashboard-page .csp-excelbox__sub {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

body.csp-facilitator-dashboard-page .csp-librarybox__msg,
body.csp-facilitator-dashboard-page .csp-excelbox__msg {
  color: rgba(255, 255, 255, 0.88) !important;
}

body.csp-facilitator-dashboard-page .csp-excelbox {
  margin-top: 13px !important;
  padding-top: 13px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
}

body.csp-facilitator-dashboard-page .csp-auditbox {
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.095);
}

body.csp-facilitator-dashboard-page .csp-auditbox > div {
  min-width: 220px;
}

/* Reset warning within dark controls */
body.csp-facilitator-dashboard-page .csp-resetbox {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(239, 68, 68, 0.48);
  border-radius: 9px;
  background: rgba(127, 29, 29, 0.18);
}

body.csp-facilitator-dashboard-page .csp-resetbox .csp-reset-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #ffb4b8;
  font-size: 12px;
  line-height: 1.55;
}

body.csp-facilitator-dashboard-page .csp-resetbox .csp-warn-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #ffd84d;
  font-size: 15px;
}

body.csp-facilitator-dashboard-page .csp-resetbox .csp-btn--danger {
  margin-top: 9px;
  background: #fff;
}

/* Editor accordion */
body.csp-facilitator-dashboard-page #csp-editor {
  margin: 0 0 14px !important;
  border: 1px solid var(--csp-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 17px;
  cursor: pointer;
  user-select: none;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle:hover {
  background: #fafbfc;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle__icon {
  font-size: 18px;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle__title {
  color: #171b22;
  font-size: 15px;
  font-weight: 800;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle__sub {
  margin-top: 2px;
  color: #6b7280;
  font-size: 13px;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle__chevron {
  color: #8a9099;
  font-size: 21px;
  transition: transform 0.18s ease;
}

body.csp-facilitator-dashboard-page .csp-editor-toggle__chevron--open {
  transform: rotate(180deg);
}

body.csp-facilitator-dashboard-page .csp-editor-body {
  display: none;
  padding: 18px;
  border-top: 1px solid var(--csp-border);
  background: #fbfcfd;
}

body.csp-facilitator-dashboard-page .csp-editor-body--open {
  display: block;
}

body.csp-facilitator-dashboard-page #csp-inject-form input[type="text"],
body.csp-facilitator-dashboard-page #csp-inject-form input[type="number"],
body.csp-facilitator-dashboard-page #csp-inject-form textarea,
body.csp-facilitator-dashboard-page #csp-inject-form select,
body.csp-facilitator-dashboard-page .csp-modal input[type="text"],
body.csp-facilitator-dashboard-page .csp-modal input[type="number"] {
  border-color: #cfd6df !important;
  background: #fff !important;
  color: #111827 !important;
  box-shadow: none !important;
}

body.csp-facilitator-dashboard-page #csp-inject-form input:focus,
body.csp-facilitator-dashboard-page #csp-inject-form textarea:focus,
body.csp-facilitator-dashboard-page #csp-inject-form select:focus,
body.csp-facilitator-dashboard-page .csp-modal input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.15);
  border-color: #5b8def !important;
}

/* Draft / running-order columns */
body.csp-facilitator-dashboard-page .csp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

body.csp-facilitator-dashboard-page #csp-lists h3 {
  margin: 0 0 4px !important;
  color: #171b22;
  font-size: 20px;
  font-weight: 500;
}

body.csp-facilitator-dashboard-page .csp-muted {
  color: var(--csp-muted-text);
  opacity: 1;
}

body.csp-facilitator-dashboard-page .csp-small {
  font-size: 12px;
}

body.csp-facilitator-dashboard-page #csp-lists .csp-card {
  padding: 14px 15px;
  border-color: #d8dee7;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
}

body.csp-facilitator-dashboard-page .csp-inject-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

body.csp-facilitator-dashboard-page .csp-inject-head > div:first-child {
  min-width: 0;
  flex: 1 1 250px;
}

body.csp-facilitator-dashboard-page .csp-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 0;
  color: #69717d;
  font-size: 11px;
  line-height: 1.35;
}

body.csp-facilitator-dashboard-page .csp-title {
  margin-top: 9px;
  color: #111418;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
  overflow-wrap: anywhere;
}

body.csp-facilitator-dashboard-page .csp-content {
  margin-top: 12px;
  color: #343a43;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.csp-facilitator-dashboard-page .csp-control-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid #d69e2e;
  border-radius: 6px;
  background: #fff8df;
  color: #5b4715;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.csp-facilitator-dashboard-page .csp-control-note strong {
  color: #49370d;
  font-size: 11px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

body.csp-facilitator-dashboard-page .csp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

body.csp-facilitator-dashboard-page .csp-actions .csp-btn {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Status and channel badges */
body.csp-facilitator-dashboard-page .csp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  vertical-align: middle;
}

body.csp-facilitator-dashboard-page .csp-dot--red { background: #d63638; }
body.csp-facilitator-dashboard-page .csp-dot--green { background: #43b76e; }
body.csp-facilitator-dashboard-page .csp-dot--amber { background: #f0ad4e; }
body.csp-facilitator-dashboard-page .csp-dot--grey { background: #a2a8b0; }

body.csp-facilitator-dashboard-page .csp-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

body.csp-facilitator-dashboard-page .csp-badge--social {
  background: #eaf5ff;
  border-color: #cce7fb;
  color: #377aa2;
}

body.csp-facilitator-dashboard-page .csp-badge--messages {
  background: #f2edfc;
  border-color: #ddd0f5;
  color: #7658a7;
}

body.csp-facilitator-dashboard-page .csp-badge--news {
  background: #fff3d6;
  border-color: #ffe0a0;
  color: #835b0b;
}

body.csp-facilitator-dashboard-page .csp-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #dce1e8;
  border-radius: 8px;
  background: #f7f8fa;
  color: #555e69;
  font-size: 12px;
  font-weight: 700;
}

/* Modals */
body.csp-facilitator-dashboard-page .csp-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  background: rgba(10, 18, 31, 0.52);
}

body.csp-facilitator-dashboard-page .csp-modal {
  width: min(540px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid #d8dee7;
  border-radius: 14px;
  background: #fff;
  color: var(--csp-text);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.24);
}

body.csp-facilitator-dashboard-page .csp-modal h3 {
  margin: 0 0 10px;
}

body.csp-facilitator-dashboard-page .csp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body.csp-facilitator-dashboard-page .csp-modal .csp-row {
  justify-content: flex-end;
  margin-top: 14px;
}

body.csp-facilitator-dashboard-page .csp-autostart-notice {
  display: none;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #8ad39d;
  border-radius: 8px;
  background: #effff2;
  color: #1a5e30;
  font-size: 13px;
}

/* The dashboard help popup is intentionally not redesigned here. */

@media (max-width: 980px) {
  body.csp-facilitator-dashboard-page #csp-fac-root {
    width: min(calc(100% - 24px), 1180px);
  }

  body.csp-facilitator-dashboard-page .csp-grid {
    grid-template-columns: 1fr;
  }

  body.csp-facilitator-dashboard-page .csp-kpi {
    gap: 28px;
  }
}

@media (max-width: 680px) {
  body.csp-facilitator-dashboard-page #csp-fac-root {
    width: calc(100vw - 20px);
    margin-top: 22px;
  }


  body.csp-facilitator-dashboard-page #csp-fac-exercise,
  body.csp-facilitator-dashboard-page #csp-fac-injects {
    padding: 7px !important;
  }

  body.csp-facilitator-dashboard-page #csp-fac-exercise > .csp-card {
    padding: 18px;
  }

  body.csp-facilitator-dashboard-page .csp-controls,
  body.csp-facilitator-dashboard-page .csp-actions {
    justify-content: flex-start;
  }

  body.csp-facilitator-dashboard-page .csp-kpi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 22px;
  }

  body.csp-facilitator-dashboard-page .csp-broadcast-label {
    flex-basis: 100%;
  }

  body.csp-facilitator-dashboard-page .csp-broadcast-input {
    flex-basis: 100%;
    min-width: 0;
  }

  body.csp-facilitator-dashboard-page .csp-broadcast-duration {
    width: 88px;
  }

  body.csp-facilitator-dashboard-page .csp-librarybox__head,
  body.csp-facilitator-dashboard-page .csp-excelbox,
  body.csp-facilitator-dashboard-page .csp-auditbox {
    align-items: flex-start;
  }

  body.csp-facilitator-dashboard-page .csp-librarybox__head > div,
  body.csp-facilitator-dashboard-page .csp-excelbox > div,
  body.csp-facilitator-dashboard-page .csp-auditbox > div {
    min-width: 0 !important;
    flex: 1 1 100%;
  }

  body.csp-facilitator-dashboard-page .csp-editor-toggle {
    padding: 13px;
  }

  body.csp-facilitator-dashboard-page .csp-editor-body {
    padding: 14px;
  }
}
