:root {
  --bg-base: #0a0e12;
  --bg-raised: #111a22;
  --bg-panel: rgba(14, 20, 26, 0.78);
  --bg-panel-strong: rgba(17, 25, 33, 0.95);

  --steel-100: #d9e1e8;
  --steel-200: #b0beca;
  --steel-300: #8e9ca9;
  --steel-400: #667786;

  --amber-300: #ffd05b;
  --amber-400: #ffbf2f;
  --amber-500: #f59c1a;
  --amber-600: #d57907;

  --critical-bg: rgba(173, 34, 45, 0.2);
  --critical-text: #ff9ca7;
  --critical-border: rgba(255, 125, 138, 0.45);

  --high-bg: rgba(158, 78, 6, 0.2);
  --high-text: #ffc887;
  --high-border: rgba(255, 188, 108, 0.4);

  --medium-bg: rgba(136, 94, 8, 0.2);
  --medium-text: #ffe08b;
  --medium-border: rgba(255, 221, 128, 0.4);

  --low-bg: rgba(22, 101, 52, 0.2);
  --low-text: #9de3b1;
  --low-border: rgba(122, 207, 145, 0.35);

  --border-subtle: rgba(208, 221, 234, 0.14);
  --border-bold: rgba(255, 191, 47, 0.42);

  --shadow-panel: 0 18px 40px -22px rgba(0, 0, 0, 0.95);
  --shadow-elevated: 0 18px 30px -18px rgba(0, 0, 0, 0.82);

  --radius-lg: 22px;
  --radius-md: 14px;

  --transition-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Barlow", "Trebuchet MS", sans-serif;
  color: var(--steel-100);
  line-height: 1.45;
  background:
    linear-gradient(130deg, rgba(245, 156, 26, 0.08), transparent 42%),
    radial-gradient(circle at 88% 20%, rgba(245, 156, 26, 0.2), transparent 36%),
    radial-gradient(circle at 12% 82%, rgba(44, 111, 168, 0.15), transparent 34%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 12px),
    var(--bg-base);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: "Archivo Black", Impact, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

p {
  margin: 0;
}

code,
pre,
.font-mono {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

.container {
  width: min(1240px, calc(100vw - 40px));
  margin: 30px auto 56px;
  position: relative;
}

.container::before,
.container::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.container::before {
  top: 6vh;
  right: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 191, 47, 0.26), transparent 66%);
}

.container::after {
  left: -180px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 136, 196, 0.18), transparent 68%);
}

.header {
  margin-bottom: 24px;
  animation: riseIn 0.7s var(--transition-medium) backwards;
}

.header-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.header-kicker {
  margin-bottom: 10px;
  color: var(--amber-300);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 600;
}

.title {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  color: #f4f7fa;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.62);
  line-height: 1;
}

.subtitle {
  color: var(--steel-200);
  margin-top: 10px;
  max-width: 700px;
  letter-spacing: 0.02em;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(14, 20, 26, 0.78);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--steel-200);
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6deb94;
  box-shadow: 0 0 0 0 rgba(109, 235, 148, 0.62);
  animation: livePulse 2s infinite;
}

.panel {
  background: linear-gradient(145deg, rgba(18, 25, 32, 0.9), rgba(13, 18, 23, 0.78));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-panel);
}

.glass-panel {
  backdrop-filter: blur(12px);
}

.filter-panel {
  position: relative;
  overflow: hidden;
}

.filter-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, transparent 0%, rgba(255, 191, 47, 0.08) 46%, transparent 90%);
  pointer-events: none;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  align-items: end;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--steel-200);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}

input,
select,
button {
  width: 100%;
  font: inherit;
  color: var(--steel-100);
  border-radius: 10px;
  border: 1px solid rgba(158, 175, 190, 0.32);
  background: rgba(8, 12, 16, 0.84);
  padding: 12px 14px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--amber-300) 50%),
    linear-gradient(135deg, var(--amber-300) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
button:focus-visible {
  outline: none;
  border-color: var(--amber-400);
  box-shadow: 0 0 0 3px rgba(255, 191, 47, 0.26);
}

button {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(120deg, var(--amber-600), var(--amber-500));
  color: #201102;
  border: 1px solid rgba(255, 200, 96, 0.56);
}

button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(245, 156, 26, 0.9);
}

button.danger {
  background: linear-gradient(120deg, #8e2129, #c02a33);
  color: #ffe3e5;
  border: 1px solid rgba(255, 149, 157, 0.38);
}

button.danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(192, 42, 51, 0.92);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.metric-grid {
  margin-bottom: 30px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(16, 23, 30, 0.85), rgba(15, 21, 26, 0.55));
  border: 1px solid rgba(208, 221, 234, 0.14);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium);
  box-shadow: var(--shadow-elevated);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber-300), transparent);
  opacity: 0.68;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-bold);
}

.metric-label {
  color: var(--steel-300);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.metric-value {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.05;
  font-family: "Archivo Black", Impact, sans-serif;
  color: #f8fafc;
}

.text-brand {
  color: var(--amber-400);
  filter: drop-shadow(0 0 10px rgba(255, 191, 47, 0.28));
}

.events-section {
  margin-top: 6px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h3 {
  color: #f1f5f9;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-row {
  background: linear-gradient(145deg, rgba(18, 25, 32, 0.9), rgba(13, 18, 23, 0.78));
  border: 1px solid rgba(187, 202, 215, 0.14);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-medium), transform var(--transition-medium);
  animation: riseIn 0.7s var(--transition-medium) backwards;
}

.event-row:hover {
  border-color: rgba(255, 191, 47, 0.42);
  transform: translateY(-2px);
}

.event-summary {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}

.event-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f5f9fc;
  letter-spacing: 0.02em;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--steel-300);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chevron {
  transition: transform var(--transition-fast);
}

.rotate-180 {
  transform: rotate(180deg);
}

.event-details {
  background: rgba(6, 10, 14, 0.68);
  padding: 18px;
  border-top: 1px solid rgba(166, 182, 198, 0.14);
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.detail-group {
  margin-bottom: 14px;
}

.detail-label {
  margin-bottom: 8px;
  color: var(--amber-300);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.badge.critical {
  background: var(--critical-bg);
  color: var(--critical-text);
  border: 1px solid var(--critical-border);
}

.badge.high {
  background: var(--high-bg);
  color: var(--high-text);
  border: 1px solid var(--high-border);
}

.badge.medium {
  background: var(--medium-bg);
  color: var(--medium-text);
  border: 1px solid var(--medium-border);
}

.badge.low {
  background: var(--low-bg);
  color: var(--low-text);
  border: 1px solid var(--low-border);
}

.message-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-notice {
  border-color: rgba(122, 207, 145, 0.55);
  background: rgba(22, 101, 52, 0.2);
  color: #c5f2d3;
}

.panel-error {
  border-color: var(--critical-border);
  background: var(--critical-bg);
  color: var(--critical-text);
}

.code-block {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  background: #06090d;
  color: #f6c45b;
  border: 1px solid rgba(255, 191, 47, 0.18);
  font-size: 0.78rem;
}

.empty-state {
  text-align: center;
  color: var(--steel-200);
  padding: 52px 16px;
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(118, 136, 150, 0.2), rgba(190, 203, 216, 0.28), rgba(118, 136, 150, 0.2));
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
}

.text-sm {
  font-size: 0.85rem;
  color: var(--steel-200);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(109, 235, 148, 0.6);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(109, 235, 148, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(109, 235, 148, 0);
  }
}

@media (max-width: 980px) {
  .grid.filters {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .grid.metrics {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .status-indicator {
    align-self: flex-start;
  }
}

@media (max-width: 700px) {
  .container {
    width: calc(100vw - 24px);
    margin-top: 20px;
  }

  .panel {
    padding: 16px;
  }

  .header-top,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid.filters,
  .grid.metrics,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .event-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .badge {
    min-height: 24px;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #43525e;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
