/* Shared Blue Shield chrome for the five protected platform routes. */
body[data-shell="platform"] {
  --blue-shield-brand: #0F5FBF;
  --blue-shield-page: #F4F7FB;
  --blue-shield-surface: #FFFFFF;
  --blue-shield-text: #14213D;
  --blue-shield-muted: #607089;
  --blue-shield-muted-strong: #344A66;
  --blue-shield-border: #D8E2EF;
  --blue-shield-success: #14866D;
  --blue-shield-warning: #C77B12;
  --blue-shield-danger: #C74444;
  background: var(--blue-shield-page);
  color: var(--blue-shield-text);
}

body[data-shell="platform"] .platform-shell {
  --sidebar-width: 240px;
}

body[data-shell="platform"] .sidebar {
  background: var(--blue-shield-brand);
  border-right-color: rgba(255, 255, 255, 0.12);
  box-shadow: 8px 0 28px rgba(15, 95, 191, 0.14);
  height: calc(100vh - 64px);
  padding: 18px 12px;
  top: 64px;
}

body[data-shell="platform"] .topbar {
  align-items: center;
  bottom: auto;
  background: var(--blue-shield-brand);
  border-bottom-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 12px rgba(8, 47, 95, 0.18);
  color: #FFFFFF;
  gap: 0;
  height: 64px;
  inset: 0 0 auto 0;
  min-height: 64px;
  padding: 0;
  position: fixed;
  width: auto;
  z-index: 60;
}

body[data-shell="platform"] .topbar h2 {
  color: #FFFFFF;
}

body[data-shell="platform"] .topbar .breadcrumb {
  color: rgba(255, 255, 255, 0.76);
}

body[data-shell="platform"] .brand-row.compact {
  display: none;
}

body[data-shell="platform"] .platform-topbar-brand {
  align-items: center;
  display: flex;
  gap: 11px;
  align-self: stretch;
  background: var(--blue-shield-brand);
  flex: 0 0 240px;
  order: -1;
  padding: 0 22px;
}

body:not([data-shell="platform"]) .platform-topbar-brand,
body:not([data-shell="platform"]) .platform-mobile-scrim {
  display: none;
}

body[data-shell="platform"] .platform-topbar-brand-name {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

body[data-shell="platform"] .platform-topbar-brand-mark {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9px;
  display: grid;
  flex: 0 0 auto;
  font-weight: 850;
  height: 32px;
  justify-content: center;
  width: 32px;
}

body[data-shell="platform"] .platform-menu-toggle {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #FFFFFF;
  display: none;
  font-size: 22px;
  height: 42px;
  padding: 0;
  place-items: center;
  width: 42px;
}

body[data-shell="platform"] .platform-mobile-scrim {
  display: none;
}

body[data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-box {
  gap: 5px;
}

body[data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-box > button {
  align-items: center;
  color: #DCEAFF;
  display: grid;
  font-size: 13px;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  justify-items: start;
  min-height: 46px;
  padding: 10px 12px;
  text-align: left;
}

body[data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-box > button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

body[data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-box > button.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(0, 37, 91, 0.24);
  color: #FFFFFF;
}

body[data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-box > button.active::before {
  content: none;
}

body[data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-icon {
  font-size: 18px;
  justify-self: center;
}

body[data-shell="platform"][data-platform-admin="true"] .platform-return-group {
  border-top-color: rgba(255, 255, 255, 0.16);
}

body[data-shell="platform"] .platform-return-group .gate-link {
  color: #DCEAFF;
}

body[data-shell="platform"] .platform-return-group .gate-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

body[data-shell="platform"] .view-host {
  background: var(--blue-shield-page);
}

body[data-shell="platform"] .main {
  padding-top: 64px;
}

body[data-shell="platform"] .platform-blue-shield {
  color: var(--blue-shield-text);
  display: grid;
  gap: 16px;
  min-width: 0;
}

body[data-shell="platform"] .platform-status-beam {
  align-items: center;
  background: rgba(4, 24, 54, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 12px;
  font-weight: 650;
  gap: 8px;
  max-width: 360px;
  min-height: 34px;
  padding: 7px 12px;
}

body[data-shell="platform"] .platform-title-stack {
  align-items: center;
  display: grid;
  flex: 1 1 auto;
  gap: 2px 12px;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  min-width: 0;
  padding: 0 24px;
}

body[data-shell="platform"] .platform-title-stack .breadcrumb {
  grid-column: 1;
}

body[data-shell="platform"] .platform-topbar-status {
  grid-column: 2;
  grid-row: 1 / span 2;
}

body[data-shell="platform"] .topbar-actions {
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  padding-right: 22px;
  scrollbar-width: thin;
}

body:not([data-shell="platform"]) #platformTopbarStatus {
  display: none !important;
}

body[data-shell="platform"] .platform-status-beam-light {
  background: #D8E2EF;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(216, 226, 239, 0.15);
  height: 8px;
  width: 8px;
}

body[data-shell="platform"] .platform-status-beam[data-tone="success"] .platform-status-beam-light {
  background: #14866D;
  box-shadow: 0 0 0 4px rgba(20, 134, 109, 0.22);
}

body[data-shell="platform"] .platform-status-beam[data-tone="unknown"] .platform-status-beam-light {
  background: #C77B12;
  box-shadow: 0 0 0 4px rgba(199, 123, 18, 0.22);
}

body[data-shell="platform"] .platform-status-beam[data-tone="degraded"] .platform-status-beam-light {
  background: #C74444;
  box-shadow: 0 0 0 4px rgba(199, 68, 68, 0.22);
}

body[data-shell="platform"] .platform-secondary-nav {
  display: grid;
  gap: 3px;
  margin: 5px 0 10px 36px;
  min-width: 0;
  padding: 0;
}

body[data-shell="platform"] .platform-secondary-nav button {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: #BCD6F2;
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 13px;
  min-height: 38px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}

body[data-shell="platform"] .platform-secondary-nav button:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
}

body[data-shell="platform"] .platform-secondary-nav button.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue-shield-brand);
  font-weight: 750;
}

body[data-shell="platform"] .platform-permission-notice {
  align-items: flex-start;
  background: #FFF8E8;
  border: 1px solid rgba(199, 123, 18, 0.36);
  border-radius: 9px;
  color: var(--blue-shield-text);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 3px;
  padding: 10px 12px;
}

body[data-shell="platform"] .platform-permission-notice span {
  color: var(--blue-shield-muted);
}

body[data-shell="platform"] .platform-secondary-nav button:focus-visible,
body[data-shell="platform"] [data-platform-section]:focus-visible {
  outline: 3px solid rgba(15, 95, 191, 0.34);
  outline-offset: 2px;
}

body[data-shell="platform"] .platform-blue-shield-content,
body[data-shell="platform"] .platform-blue-shield-content .platform-page {
  min-width: 0;
}

body[data-shell="platform"] .platform-blue-shield-content .panel,
body[data-shell="platform"] .platform-blue-shield-content .kpi {
  background: var(--blue-shield-surface);
  border-color: var(--blue-shield-border);
  box-shadow: 0 3px 12px rgba(20, 33, 61, 0.05);
}

body[data-shell="platform"] .platform-blue-shield-content .panel-title h2,
body[data-shell="platform"] .platform-blue-shield-content .kpi-value {
  color: var(--blue-shield-text);
}

body[data-shell="platform"] .platform-blue-shield-content .sub,
body[data-shell="platform"] .platform-blue-shield-content .kpi-note {
  color: var(--blue-shield-muted);
}

body[data-shell="platform"] [data-platform-section] {
  scroll-margin-top: 92px;
}

body[data-shell="platform"] .audit-row {
  grid-template-columns: minmax(132px, max-content) minmax(0, 1fr) max-content;
}

body[data-shell="platform"] .audit-row .row-meta,
body[data-shell="platform"] .audit-row .row-main,
body[data-shell="platform"] .ops-incident-row .row-main,
body[data-shell="platform"] .ops-incident-row .row-meta {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

body[data-shell="platform"] .ops-incident-row {
  grid-template-columns: minmax(72px, max-content) minmax(0, 1fr) minmax(160px, 0.55fr) max-content;
}

body[data-shell="platform"] .ops-incident-row .row-actions {
  justify-self: end;
  white-space: nowrap;
}

body[data-shell="platform"] .ops-incident-row .row-meta {
  color: var(--blue-shield-muted-strong);
  font-weight: 600;
  line-height: 1.45;
}

body[data-shell="platform"] .ops-incident-row .row-actions .btn {
  min-width: 88px;
  white-space: nowrap;
}

body[data-shell="platform"] .confirmed-platform-plans .todo-row {
  grid-template-columns: 76px minmax(0, 1fr) minmax(220px, 28%);
}

body[data-shell="platform"] .confirmed-platform-plans .todo-row .row-meta {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

body[data-shell="platform"] .confirmed-platform-plans .todo-row .row-meta strong,
body[data-shell="platform"] .confirmed-platform-plans .todo-row .row-meta small {
  display: block;
}

@media (min-width: 1101px) {
  body[data-shell="platform"] .audit-row .row-meta {
    color: var(--blue-shield-muted-strong);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
}

@media (min-width: 1101px) {
  body[data-responsive="real"][data-shell="platform"] .platform-shell {
    --sidebar-width: 240px;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: none;
    height: 100vh;
  }

  body[data-responsive="real"][data-shell="platform"] .sidebar {
    align-items: initial;
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    display: block;
    gap: 0;
    grid-template-columns: none;
    height: calc(100vh - 64px);
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 12px;
    position: sticky;
    top: 64px;
  }

  body[data-responsive="real"][data-shell="platform"] .side-nav {
    align-items: initial;
    display: grid;
    gap: 10px;
    min-width: 0;
    overflow: visible;
    padding: 0;
    width: auto;
  }

  body[data-responsive="real"][data-shell="platform"] .nav-group,
  body[data-responsive="real"][data-shell="platform"] .nav-box,
  body[data-responsive="real"][data-shell="platform"][data-platform-admin="true"] #platformNavGroup,
  body[data-responsive="real"][data-shell="platform"][data-platform-admin="true"] #customerDeliveryNavGroup,
  body[data-responsive="real"][data-shell="platform"][data-platform-admin="true"] #protocolTestLabNavGroup,
  body[data-responsive="real"][data-shell="platform"][data-platform-admin="true"] .platform-return-group {
    align-items: initial;
    display: grid;
    gap: 5px;
    margin: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  body[data-responsive="real"][data-shell="platform"] :is(#platformNavGroup, #customerDeliveryNavGroup, #protocolTestLabNavGroup) .nav-box > button {
    min-width: 0;
    padding: 10px 12px;
    white-space: normal;
    width: 100%;
  }

  body[data-responsive="real"][data-shell="platform"] .topbar {
    align-items: center;
    flex-wrap: nowrap;
    height: 64px;
    min-height: 64px;
    padding: 0;
  }

  body[data-responsive="real"][data-shell="platform"] .breadcrumb {
    display: block;
  }

  body[data-responsive="real"][data-shell="platform"] .topbar-actions {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    width: auto;
  }
}

@media (min-width: 1101px) and (max-width: 1180px) {
  body[data-shell="platform"] .ops-incident-row {
    grid-template-columns: minmax(72px, max-content) minmax(0, 1fr) max-content;
  }

  body[data-shell="platform"] .ops-incident-row .row-meta {
    grid-column: 2;
    grid-row: 2;
  }

  body[data-shell="platform"] .ops-incident-row .row-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 1100px) {
  body[data-shell="platform"] .platform-shell {
    display: block;
    min-height: 100vh;
  }

  body[data-shell="platform"] .main {
    padding-top: 60px;
  }

  body[data-shell="platform"] .topbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    height: 60px;
    min-height: 60px;
  }

  body[data-shell="platform"] .platform-topbar-brand {
    flex-basis: auto;
    padding: 0 10px;
  }

  body[data-shell="platform"] .platform-topbar-brand-name {
    display: none;
  }

  body[data-shell="platform"] .confirmed-platform-plans .todo-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  body[data-shell="platform"] .confirmed-platform-plans .todo-row .row-meta {
    grid-column: 2;
    text-align: left;
  }

  body[data-shell="platform"] .platform-menu-toggle {
    display: grid;
  }

  body[data-shell="platform"] .platform-title-stack {
    flex: 0 0 auto;
    padding: 0 8px;
  }

  body[data-shell="platform"] .topbar-actions {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    max-height: 60px;
    overflow-y: hidden;
    width: auto;
  }

  body[data-shell="platform"] .breadcrumb {
    display: none;
  }

  body[data-responsive="real"][data-shell="platform"] .sidebar {
    bottom: 0;
    display: block;
    height: auto;
    left: 0;
    overflow-y: auto;
    padding: 18px 12px;
    position: fixed;
    right: auto;
    top: 60px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    width: 260px;
    z-index: 55;
  }

  body[data-shell="platform"].platform-mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body[data-shell="platform"].platform-mobile-nav-open .platform-mobile-scrim {
    background: rgba(11, 29, 52, 0.28);
    border: 0;
    display: block;
    inset: 60px 0 0 260px;
    padding: 0;
    position: fixed;
    z-index: 50;
  }

  body[data-shell="platform"] #platformNavGroup .nav-box {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-shell="platform"] #platformNavGroup .nav-box > button {
    min-height: 46px;
  }

  body[data-shell="platform"] .platform-status-beam {
    max-width: 100%;
  }

  body[data-shell="platform"] .audit-row,
  body[data-shell="platform"] .ops-incident-row {
    grid-template-columns: minmax(64px, max-content) minmax(0, 1fr);
  }

  body[data-shell="platform"] .audit-row .row-main,
  body[data-shell="platform"] .audit-row .row-type,
  body[data-shell="platform"] .ops-incident-row .row-main,
  body[data-shell="platform"] .ops-incident-row .row-meta,
  body[data-shell="platform"] .ops-incident-row .row-actions {
    grid-column: 2;
    justify-self: start;
  }

}

@media (max-width: 520px) {
  body[data-shell="platform"] .platform-blue-shield {
    gap: 12px;
  }

  body[data-shell="platform"] .platform-title-stack {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-shell="platform"] .platform-topbar-status {
    display: none;
  }

  body[data-shell="platform"] .topbar-actions {
    padding-right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-shell="platform"] *,
  body[data-shell="platform"] *::before,
  body[data-shell="platform"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
