@layer components {
  body.executive-mode {
    background-color: #03040a;
    background-image:
      radial-gradient(circle at 20% 10%, rgb(59 130 246 / 14%), transparent 38%),
      radial-gradient(circle at 80% 90%, rgb(16 185 129 / 10%), transparent 38%),
      linear-gradient(180deg, rgb(2 6 23 / 88%), rgb(2 6 23 / 94%)),
      var(--executive-bg-image, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-blend-mode: screen, screen, multiply, normal;
  }

  body.executive-mode .header {
    background: rgb(2 6 23 / 78%);
    border-bottom: 1px solid rgb(148 163 184 / 18%);
    backdrop-filter: blur(14px);
  }

  body.executive-mode .header__link,
  body.executive-mode .header__logo,
  body.executive-mode .header__user {
    color: #e2e8f0;
  }

  body.executive-mode .header__logo--cta {
    background: var(--color-positive);
    border-color: oklch(var(--lch-green-dark) / 85%);
    color: #02130d;
  }

  body.executive-mode .header__logo--cta:hover {
    color: #02130d;
  }

  body.executive-mode .header__divider {
    background: rgb(148 163 184 / 30%);
  }

  .executive-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-inline: auto;
    max-width: min(1820px, 100vw - 1.75rem);
    padding-top: 1.5rem;
    color: #f8fafc;
    font-family: var(--font-mono) !important;
    font-synthesis: none;
  }

  .executive-dashboard :is(
    p, span, strong, small, a, td, th, div, code, li, label, button, input, select
  ) {
    font-family: var(--font-mono) !important;
  }

  .executive-dashboard h1,
  .executive-dashboard h2,
  .executive-dashboard h3 {
    font-family: var(--font-display) !important;
    letter-spacing: -0.01em;
  }

  .executive-topbar {
    align-items: end;
    border-bottom: 1px solid rgb(148 163 184 / 16%);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
  }

  .executive-topbar__title {
    display: flex;
    gap: 0.9rem;
    align-items: center;
  }

  .executive-logo-badge {
    align-items: center;
    background: linear-gradient(145deg, rgb(30 64 175 / 42%), rgb(15 23 42 / 84%));
    border: 1px solid rgb(96 165 250 / 35%);
    border-radius: 0.75rem;
    box-shadow: 0 0 0 1px rgb(96 165 250 / 20%), 0 10px 20px -8px rgb(14 165 233 / 36%);
    display: flex;
    height: 3rem;
    justify-content: center;
    width: 3rem;
  }

  .executive-logo-badge svg {
    fill: #60a5fa;
    height: 1.7rem;
    width: 1.7rem;
  }

  .executive-topbar h1 {
    color: #f8fafc;
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    line-height: 1;
    margin: 0;
  }

  .executive-topbar__meta {
    align-items: center;
    color: rgb(148 163 184 / 88%);
    display: flex;
    font-size: 0.98rem;
    gap: 0.55rem;
    margin: 0.42rem 0 0;
  }

  .executive-pill {
    background: rgb(15 23 42 / 88%);
    border: 1px solid rgb(148 163 184 / 22%);
    border-radius: 0.45rem;
    color: rgb(148 163 184 / 98%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.015em;
    padding: 0.3rem 0.5rem;
  }

  .executive-refresh {
    align-items: center;
    background: rgb(15 23 42 / 74%);
    border: 1px solid rgb(148 163 184 / 24%);
    border-radius: 0.72rem;
    color: #e2e8f0;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 500;
    gap: 0.45rem;
    line-height: 1;
    padding: 0.72rem 1rem;
    text-decoration: none;
  }

  .executive-refresh svg {
    fill: currentcolor;
    height: 1rem;
    width: 1rem;
  }

  .executive-refresh:hover {
    background: rgb(30 41 59 / 78%);
    border-color: rgb(148 163 184 / 40%);
    text-decoration: none;
  }

  .executive-error {
    background: rgb(225 29 72 / 13%);
    border: 1px solid rgb(251 113 133 / 30%);
    border-radius: 0.9rem;
    color: rgb(251 113 133 / 96%);
    padding: 0.85rem 1rem;
  }

  .executive-kpis {
    display: grid;
    gap: 0.95rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .executive-kpi {
    background: linear-gradient(180deg, rgb(7 9 17 / 87%), rgb(4 6 14 / 94%));
    border: 1px solid rgb(148 163 184 / 16%);
    border-radius: 1rem;
    box-shadow: 0 16px 30px -24px rgb(15 23 42 / 80%);
    min-height: 8.2rem;
    overflow: hidden;
    padding: 1rem 1.05rem 1rem;
    position: relative;
  }

  .executive-kpi::after {
    content: "";
    position: absolute;
    right: -2.8rem;
    top: -2.5rem;
    width: 10rem;
    height: 10rem;
    border-radius: 999px;
    filter: blur(36px);
    opacity: 0.22;
  }

  .executive-kpi--success::after {
    background: rgb(16 185 129 / 78%);
  }

  .executive-kpi--warning::after {
    background: rgb(245 158 11 / 78%);
  }

  .executive-kpi--danger::after {
    background: rgb(244 63 94 / 74%);
  }

  .executive-kpi--neutral::after {
    background: rgb(96 165 250 / 68%);
  }

  .executive-kpi h2 {
    color: rgb(203 213 225 / 92%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.11em;
    margin: 0 0 0.6rem;
    text-transform: uppercase;
  }

  .executive-kpi__value {
    color: #f8fafc;
    font-family: var(--font-display);
    font-size: clamp(2rem, 2.9vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0;
    position: relative;
    z-index: 1;
  }

  .executive-kpi__value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
  }

  .executive-kpi__meta {
    color: rgb(148 163 184 / 88%);
    font-size: 0.95rem;
    margin-top: 0.6rem;
    position: relative;
    z-index: 1;
  }

  .executive-kpi__icon {
    align-items: center;
    border-radius: 0.9rem;
    border: 1px solid rgb(148 163 184 / 28%);
    display: inline-flex;
    height: 3.05rem;
    justify-content: center;
    position: absolute;
    right: 1rem;
    top: 1.1rem;
    width: 3.05rem;
    z-index: 1;
  }

  .executive-kpi--success .executive-kpi__icon {
    color: #34d399;
    border-color: rgb(16 185 129 / 35%);
    background: rgb(16 185 129 / 12%);
  }

  .executive-kpi--warning .executive-kpi__icon {
    color: #fbbf24;
    border-color: rgb(245 158 11 / 35%);
    background: rgb(245 158 11 / 13%);
  }

  .executive-kpi--danger .executive-kpi__icon {
    color: #fb7185;
    border-color: rgb(244 63 94 / 38%);
    background: rgb(244 63 94 / 14%);
  }

  .executive-kpi--neutral .executive-kpi__icon {
    color: #60a5fa;
    border-color: rgb(96 165 250 / 36%);
    background: rgb(96 165 250 / 12%);
  }

  .executive-kpi__icon svg {
    fill: none;
    height: 1.34rem;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1.34rem;
  }

  .executive-trend {
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.28rem 0.55rem;
    white-space: nowrap;
  }

  .executive-trend.trend--up {
    background: rgb(16 185 129 / 13%);
    border: 1px solid rgb(16 185 129 / 25%);
    color: #34d399;
  }

  .executive-trend.trend--down {
    background: rgb(244 63 94 / 13%);
    border: 1px solid rgb(244 63 94 / 27%);
    color: #fb7185;
  }

  .executive-panel {
    background: linear-gradient(180deg, rgb(4 6 14 / 89%), rgb(4 6 14 / 96%));
    border: 1px solid rgb(148 163 184 / 15%);
    border-radius: 1rem;
    box-shadow: 0 18px 32px -24px rgb(2 6 23 / 88%);
    overflow: hidden;
    position: relative;
  }

  .executive-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 18% 10%, rgb(16 185 129 / 6%), transparent 28%),
      radial-gradient(circle at 82% 85%, rgb(96 165 250 / 7%), transparent 30%);
  }

  .executive-panel__header {
    align-items: center;
    border-bottom: 1px solid rgb(148 163 184 / 14%);
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.15rem 0.9rem;
    position: relative;
    z-index: 1;
  }

  .executive-panel__header h2 {
    align-items: center;
    color: #f8fafc;
    display: inline-flex;
    font-size: 2rem;
    font-weight: 600;
    gap: 0.45rem;
    line-height: 1.1;
    margin: 0;
  }

  .executive-panel__header svg {
    fill: none;
    height: 1rem;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1rem;
  }

  .executive-panel__header--alert h2 {
    color: #fb7185;
  }

  .executive-panel__header--calm h2 {
    color: rgb(148 163 184 / 88%);
    font-size: 1.45rem;
    font-weight: 500;
  }

  .executive-panel__header--calm svg {
    stroke: rgb(148 163 184 / 82%);
  }

  .executive-panel__header--map {
    position: absolute;
    width: 100%;
    border: 0;
    z-index: 4;
    background: linear-gradient(180deg, rgb(2 6 23 / 78%), rgb(2 6 23 / 0%));
  }

  .executive-focus-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }

  .executive-panel--failing,
  .executive-panel--map {
    min-height: 27rem;
  }

  .executive-empty-state {
    align-items: center;
    color: rgb(148 163 184 / 90%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(27rem - 3.8rem);
    padding: 1.2rem;
    position: relative;
    text-align: center;
    z-index: 1;
  }

  .executive-empty-state__icon {
    align-items: center;
    background: rgb(16 185 129 / 15%);
    border: 1px solid rgb(16 185 129 / 38%);
    border-radius: 999px;
    box-shadow: 0 0 30px -8px rgb(16 185 129 / 66%);
    color: #34d399;
    display: inline-flex;
    height: 3.5rem;
    justify-content: center;
    margin-bottom: 0.9rem;
    width: 3.5rem;
  }

  .executive-panel--failing-ok .executive-empty-state__icon {
    background: rgb(16 185 129 / 9%);
    border-color: rgb(16 185 129 / 26%);
    box-shadow: 0 0 14px -8px rgb(16 185 129 / 45%);
    height: 3rem;
    width: 3rem;
  }

  .executive-empty-state__icon svg {
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1.8rem;
    height: 1.8rem;
  }

  .executive-empty-state p {
    color: #34d399;
    font-size: 1.08rem;
    margin: 0;
    font-weight: 600;
  }

  .executive-panel--failing-ok .executive-empty-state p {
    color: rgb(74 222 128 / 86%);
    font-size: 0.96rem;
    font-weight: 500;
  }

  .executive-empty-state span {
    margin-top: 0.35rem;
    color: rgb(148 163 184 / 88%);
    font-size: 0.9rem;
  }

  .executive-panel--failing-ok .executive-empty-state span {
    color: rgb(148 163 184 / 76%);
    font-size: 0.82rem;
  }

  .executive-failing-list {
    list-style: none;
    margin: 0;
    max-height: calc(27rem - 3.8rem);
    overflow-y: auto;
    padding: 0;
    position: relative;
    z-index: 1;
  }

  .executive-failing-list li {
    border-top: 1px solid rgb(148 163 184 / 10%);
    padding: 0.85rem 1.15rem;
  }

  .executive-failing-list__head {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
  }

  .executive-failing-dot {
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 999px;
    background: #fb7185;
    box-shadow: 0 0 0 5px rgb(244 63 94 / 22%);
    flex-shrink: 0;
  }

  .executive-failing-list a {
    color: #f8fafc;
    font-weight: 600;
    text-decoration: none;
  }

  .executive-failing-list a:hover {
    color: #fb7185;
    text-decoration: none;
  }

  .executive-failing-list code {
    color: #94a3b8;
    display: block;
    font-family: var(--font-mono);
    font-size: 0.77rem;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .executive-failing-list small {
    color: rgb(148 163 184 / 83%);
    font-size: 0.78rem;
  }

  .executive-panel--map {
    padding-top: 0;
  }

  #sites-map.sites-map--executive {
    border-radius: 1rem;
    height: 100%;
    margin: 0;
    min-height: 27rem;
    overflow: hidden;
    width: 100%;
  }

  .executive-panel--map .leaflet-control-container {
    display: none;
  }

  .executive-panel--map .leaflet-pane {
    z-index: 2;
  }

  .executive-panel--map .leaflet-tile-pane {
    filter: saturate(1) brightness(1.02) contrast(1.24);
  }

  .executive-panel--map .leaflet-container {
    background: #1a2638;
  }

  .executive-map-pin {
    align-items: center;
    display: flex;
    justify-content: center;
  }

  .executive-map-pin__dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: #ef4444;
    border: 2px solid rgb(255 255 255 / 96%);
    box-shadow: 0 0 0 9px rgb(239 68 68 / 22%);
    display: block;
  }

  .executive-map-tooltip {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #f8fafc;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    text-shadow: 0 2px 8px rgb(2 6 23 / 88%);
    padding: 0;
  }

  .executive-map-tooltip::before {
    display: none;
  }

  .executive-table-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 1.2rem;
  }

  .executive-panel--table {
    min-height: 24.5rem;
  }

  .executive-panel--table-wide {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .executive-panel--table .executive-panel__header h2 {
    font-size: 1.95rem;
  }

  .executive-data-table {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    position: relative;
    z-index: 1;
  }

  .executive-data-table thead {
    background: rgb(15 23 42 / 42%);
  }

  .executive-data-table th,
  .executive-data-table td {
    border-top: 1px solid rgb(148 163 184 / 10%);
    color: #e2e8f0;
    padding: 0.82rem 1.05rem;
    vertical-align: middle;
  }

  .executive-data-table th {
    border-top: 0;
    color: rgb(148 163 184 / 88%);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .executive-data-table tbody tr:hover {
    background: rgb(255 255 255 / 2%);
  }

  .executive-data-table code {
    color: rgb(148 163 184 / 82%);
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
  }

  .executive-target-wrap {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    max-width: 100%;
  }

  .executive-target-wrap code {
    min-width: 0;
  }

  .executive-target-external {
    align-items: center;
    color: rgb(148 163 184 / 90%);
    display: inline-flex;
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.18s ease;
  }

  .executive-target-external:hover {
    color: #fad801;
  }

  .executive-target-external svg {
    height: 1rem;
    width: 1rem;
  }

  .executive-data-table .probe-name {
    color: #f8fafc;
    font-weight: 600;
  }

  .executive-data-table .text-right {
    text-align: right;
  }

  .executive-table-empty {
    color: rgb(148 163 184 / 88%);
    font-style: italic;
    text-align: center;
    padding: 1.4rem 1rem;
  }

  .executive-heartbeat {
    color: rgb(148 163 184 / 88%);
    font-size: 0.8rem;
  }

  .executive-badge {
    align-items: center;
    border-radius: 999px;
    border: 1px solid transparent;
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.4rem 0.68rem;
    white-space: nowrap;
  }

  .executive-badge.badge--critical {
    background: rgb(244 63 94 / 13%);
    border-color: rgb(244 63 94 / 35%);
    color: #fb7185;
  }

  .executive-badge.badge--warning {
    background: rgb(245 158 11 / 14%);
    border-color: rgb(245 158 11 / 35%);
    color: #fbbf24;
  }

  .executive-badge.badge--ok {
    background: rgb(16 185 129 / 13%);
    border-color: rgb(16 185 129 / 35%);
    color: #34d399;
  }

  .latency-cell {
    align-items: center;
    display: flex;
    gap: 0.65rem;
  }

  .latency-value {
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 3.6rem;
    text-align: right;
  }

  .latency-bar {
    background: rgb(148 163 184 / 18%);
    border-radius: 999px;
    display: inline-flex;
    height: 0.48rem;
    overflow: hidden;
    width: min(12.5rem, 100%);
  }

  .latency-bar span {
    border-radius: inherit;
    display: block;
    height: 100%;
  }

  .latency-bar .latency-bar--critical {
    background: linear-gradient(90deg, #f43f5e, #ef4444);
  }

  .latency-bar .latency-bar--warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
  }

  .latency-bar .latency-bar--ok {
    background: linear-gradient(90deg, #10b981, #34d399);
  }

  @media (max-width: 120ch) {
    .executive-kpis {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .executive-focus-grid,
    .executive-table-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 85ch) {
    body.executive-mode {
      background-attachment: scroll;
    }

    .executive-dashboard {
      max-width: calc(100vw - 1rem);
      padding-top: 1rem;
    }

    .executive-topbar {
      align-items: flex-start;
      flex-direction: column;
      padding-bottom: 0.9rem;
    }

    .executive-kpis {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .executive-panel--failing,
    .executive-panel--map,
    .executive-panel--table {
      min-height: auto;
    }

    #sites-map.sites-map--executive {
      min-height: 22rem;
    }
  }

  @media (max-width: 60ch) {
    .executive-kpis {
      grid-template-columns: 1fr;
    }

    .executive-topbar__meta {
      align-items: flex-start;
      flex-direction: column;
      gap: 0.35rem;
    }

    .executive-data-table th,
    .executive-data-table td {
      padding: 0.68rem 0.78rem;
    }

    .latency-bar {
      width: 8rem;
    }
  }
}
