/* =========================================================
   Rescue-Net War Room Workspace
   Dashboard and Live Map
   ========================================================= */

.rn-war-room-workspace {
  display: block;
  width: 100%;
}

.rn-war-room-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  margin: 0 0 18px;
  padding: 7px;

  background: #f4f7fb;
  border: 1px solid #d7e1ec;
  border-radius: 12px;

  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.rn-war-room-tabs::-webkit-scrollbar {
  height: 5px;
}

.rn-war-room-tabs::-webkit-scrollbar-thumb {
  background: #bcc9d8;
  border-radius: 999px;
}

.rn-war-room-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 16px;

  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #405064;

  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;

  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.rn-war-room-tab:hover {
  background: #e7eef7;
  color: #172334;
}

.rn-war-room-tab:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.rn-war-room-tab.active,
.rn-war-room-tab[aria-selected="true"] {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
}

.rn-war-room-panel[hidden] {
  display: none !important;
}

.rn-war-room-map-panel {
  min-height: 620px;
}

.rn-war-room-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.rn-war-room-map-toolbar h2 {
  margin: 0 0 5px;
}

.rn-war-room-map-toolbar p {
  margin: 0;
  opacity: 0.8;
}

.rn-war-room-map-frame {
  display: block;
  width: 100%;
  min-height: 620px;
  height: calc(100vh - 260px);
  max-height: 820px;

  border: 0;
  border-radius: 12px;
  background: #ffffff;
}

/* Map embedded inside War Room */

html.rn-map-embedded,
html.rn-map-embedded body {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

html.rn-map-embedded .rn-public-header,
html.rn-map-embedded .welcome-nav,
html.rn-map-embedded header,
html.rn-map-embedded aside,
html.rn-map-embedded nav,
html.rn-map-embedded .rn-page-mobile-title,
html.rn-map-embedded .rn-nav-v2 {
  display: none !important;
}

html.rn-map-embedded main,
html.rn-map-embedded .app-shell,
html.rn-map-embedded .page-shell,
html.rn-map-embedded .content-shell,
html.rn-map-embedded .layout,
html.rn-map-embedded .main-layout {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.rn-map-embedded .page-header,
html.rn-map-embedded .section-header {
  margin-top: 0 !important;
}

html.rn-map-embedded .panel,
html.rn-map-embedded .content-grid {
  max-width: none !important;
}

html.rn-map-embedded body {
  overflow-x: hidden !important;
}

/* Mobile */

@media (max-width: 760px) {
  .rn-war-room-tabs {
    gap: 6px;
    margin: 0 -4px 14px;
    padding: 6px;
    border-radius: 10px;
  }

  .rn-war-room-tab {
    min-height: 46px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .rn-war-room-map-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .rn-war-room-map-toolbar .btn {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }

  .rn-war-room-map-frame {
    width: 100%;
    min-height: 560px;
    height: calc(100vh - 230px);
    border-radius: 10px;
  }
}

@media (max-width: 420px) {
  .rn-war-room-tab {
    padding: 9px 12px;
    font-size: 12.5px;
  }

  .rn-war-room-map-frame {
    min-height: 500px;
    height: calc(100vh - 210px);
  }
}

/* War Room live panel helpers */

.rn-war-room-panel {
  width: 100%;
}

.rn-war-room-panel.active {
  animation: rnWarPanelIn 150ms ease-out;
}

.rn-war-room-empty {
  padding: 20px;
}

.rn-war-room-empty h3 {
  margin-top: 0;
}

@keyframes rnWarPanelIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rn-war-room-panel.active {
    animation: none;
  }
}

/* War Room categorized live panels */

.rn-war-room-panel-heading {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: #f4f7fb;
  border: 1px solid #d7e1ec;
  border-radius: 12px;
}

.rn-war-room-panel-heading h2 {
  margin: 0 0 5px;
  color: #172334;
  font-size: 20px;
}

.rn-war-room-panel-heading p {
  margin: 0;
  color: #5b6878;
}

.rn-war-room-panel > section {
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .rn-war-room-panel-heading {
    padding: 14px;
  }

  .rn-war-room-panel-heading h2 {
    font-size: 18px;
  }
}

/* =========================================================
   War Room Tabs v3 - visibility only
   ========================================================= */

main > section[hidden],
.rn-war-room-map-panel[hidden] {
  display: none !important;
}

main > section.rn-war-section-active {
  display: grid;
}

main > section.panel.rn-war-section-active,
main > section.hero-command.rn-war-section-active {
  display: block;
}

.rn-war-room-map-panel.rn-war-section-active {
  display: block;
}

@media (max-width: 760px) {
  main > section.rn-war-section-active {
    width: 100%;
  }
}


/* ==========================================================
   Active Disaster — integrated Control Centre switcher
   ========================================================== */

.rn-active-disaster-switcher {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(
    --border,
    rgba(127, 127, 127, 0.22)
  );
}

.rn-active-disaster-switcher__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.rn-active-disaster-switcher__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rn-active-disaster-switcher__count {
  font-size: 11px;
  opacity: .65;
}

.rn-active-disaster-switcher__control {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.rn-active-disaster-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(
    --border,
    rgba(127, 127, 127, .28)
  );
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  background: var(
    --surface,
    transparent
  );
  color: inherit;
}

.rn-active-disaster-status {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  opacity: .72;
}

@media (max-width: 720px) {
  .rn-active-disaster-switcher__control {
    grid-template-columns: 1fr;
  }

  .rn-active-disaster-status {
    white-space: normal;
  }
}
