:root {
  --bg: #07111f;
  --panel: rgba(15, 27, 47, 0.86);
  --panel-strong: #101b31;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(180, 211, 255, 0.16);
  --line-strong: rgba(180, 211, 255, 0.28);
  --text: #f4f8ff;
  --muted: #9badc7;
  --soft: #dce8ff;
  --blue: #5d7cff;
  --green: #36e58b;
  --yellow: #ffd166;
  --red: #ff647c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(54, 229, 139, 0.16), transparent 28rem),
    radial-gradient(circle at top right, rgba(93, 124, 255, 0.18), transparent 30rem),
    linear-gradient(135deg, #050b15 0%, #091426 44%, #07111f 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.boot-card,
.login-card {
  width: min(460px, calc(100vw - 32px));
  margin: 11vh auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(16, 27, 49, 0.92), rgba(7, 17, 31, 0.94));
  box-shadow: var(--shadow);
}

.boot-orb,
.brand-orb {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 18px 40px rgba(54, 229, 139, 0.28);
}

.login-card h1 {
  margin: 22px 0 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.login-card p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.field input:focus {
  border-color: rgba(54, 229, 139, 0.58);
  box-shadow: 0 0 0 4px rgba(54, 229, 139, 0.1);
}

.primary-btn,
.ghost-btn,
.tab-btn {
  border: 0;
  border-radius: 16px;
  font-weight: 900;
}

.primary-btn {
  width: 100%;
  padding: 15px 18px;
  color: #061423;
  background: linear-gradient(135deg, var(--green), #82f7b9);
}

.primary-btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.login-error,
.error-box {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 100, 124, 0.36);
  border-radius: 14px;
  color: #ffd6de;
  background: rgba(255, 100, 124, 0.12);
}

.dashboard {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(5, 11, 21, 0.74);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-orb {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tab-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-bottom: 12px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.tab-btn.active,
.tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(93, 124, 255, 0.16);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.session-chip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.session-chip strong {
  display: block;
  color: var(--text);
}

.ghost-btn {
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.content {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.topbar .meta {
  margin: 10px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  padding: 11px 14px;
  border: 1px solid rgba(54, 229, 139, 0.28);
  border-radius: 999px;
  color: #b9ffd9;
  background: rgba(54, 229, 139, 0.1);
  font-weight: 900;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.alert-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.alert-strip.critical {
  border-color: rgba(255, 100, 124, 0.5);
  background: linear-gradient(135deg, rgba(255, 100, 124, 0.2), rgba(16, 27, 49, 0.92));
}

.alert-strip.warning {
  border-color: rgba(255, 209, 102, 0.48);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(16, 27, 49, 0.92));
}

.alert-strip.ok {
  border-color: rgba(54, 229, 139, 0.34);
}

.alert-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
}

.alert-strip p,
.alert-last {
  margin: 7px 0 0;
  color: var(--muted);
}

.alert-last {
  max-width: 360px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.alert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.alert-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.alert-item.critical {
  border-color: rgba(255, 100, 124, 0.38);
}

.alert-item.warning {
  border-color: rgba(255, 209, 102, 0.34);
}

.alert-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.alert-item strong {
  display: block;
  margin-top: 7px;
}

.alert-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.executive-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.executive-status.critical {
  border-color: rgba(255, 100, 124, 0.52);
  background: linear-gradient(135deg, rgba(255, 100, 124, 0.22), rgba(16, 27, 49, 0.94));
}

.executive-status.warning {
  border-color: rgba(255, 209, 102, 0.5);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(16, 27, 49, 0.94));
}

.executive-status.ok {
  border-color: rgba(54, 229, 139, 0.36);
}

.executive-status span,
.incident-head span,
.timeline-item span,
.safe-action-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.executive-status strong {
  display: block;
  font-size: 31px;
}

.executive-status p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
}

.incident-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.incident-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.incident-card.critical {
  border-color: rgba(255, 100, 124, 0.42);
}

.incident-card.warning {
  border-color: rgba(255, 209, 102, 0.38);
}

.incident-head strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.incident-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.incident-card dt {
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.incident-card dd {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.incident-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.incident-foot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.incident-action,
.safe-action-row {
  border: 0;
  border-radius: 14px;
  color: #061423;
  background: linear-gradient(135deg, var(--green), #82f7b9);
  font-weight: 900;
}

.incident-action {
  padding: 11px 14px;
}

.incident-action:disabled,
.safe-action-row:disabled {
  opacity: 0.55;
  cursor: wait;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.timeline-item.active.critical {
  border-color: rgba(255, 100, 124, 0.38);
}

.timeline-item strong {
  display: block;
  margin-top: 6px;
}

.timeline-item p {
  margin: 7px 0;
  color: var(--muted);
}

.timeline-item small {
  color: var(--soft);
  font-weight: 800;
}

.safe-action-list {
  display: grid;
  gap: 10px;
}

.safe-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
}

.safe-action-row span {
  color: rgba(6, 20, 35, 0.72);
}

.metric-card,
.panel,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--blue);
}

.metric-card.ok::after {
  background: var(--green);
}

.metric-card.warning::after {
  background: var(--yellow);
}

.metric-card.critical::after {
  background: var(--red);
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.metric-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel-body {
  padding: 18px 20px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mini-card {
  padding: 15px;
  background: var(--card);
  box-shadow: none;
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-card strong {
  display: block;
  margin-top: 8px;
  font-size: 19px;
}

.progress {
  overflow: hidden;
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.raw-block {
  overflow: auto;
  max-height: 420px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: #d7e6ff;
  background: rgba(0, 0, 0, 0.22);
  font: 12px/1.55 "Cascadia Code", "Fira Code", Consolas, monospace;
  white-space: pre-wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.warning {
  background: var(--yellow);
}

.status-dot.critical {
  background: var(--red);
}

.loading {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-footer {
    position: static;
    margin-top: 22px;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .alert-strip {
    display: grid;
  }

  .alert-last {
    max-width: none;
    text-align: left;
  }

  .executive-status,
  .incident-foot,
  .safe-action-row {
    display: grid;
  }
}
