* {
  box-sizing: border-box;
}

:root {
  --background: #030607;
  --panel-top: rgba(28, 22, 10, 0.98);
  --panel-bottom: rgba(6, 10, 12, 0.99);
  --panel-blue: rgba(9, 31, 43, 0.96);

  --gold: #ffd84a;
  --orange: #ff9f1a;
  --teal: #72f7df;
  --blue: #38bdf8;
  --green: #22c55e;
  --red: #ff5570;
  --purple: #c084fc;

  --text: #ffffff;
  --muted: #98a4b5;
  --border: rgba(255, 216, 74, 0.18);
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(
      circle at 50% -8%,
      rgba(255, 216, 74, 0.14),
      transparent 34%
    ),
    radial-gradient(
      circle at 95% 18%,
      rgba(255, 159, 26, 0.07),
      transparent 27%
    ),
    linear-gradient(
      180deg,
      #151006 0%,
      #060807 42%,
      #020506 100%
    );
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

body {
  padding-bottom: 106px;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

#alerts-app {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 14px 38px;
}

.premium-card {
  border: 1px solid var(--border);
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 216, 74, 0.08),
      transparent 35%
    ),
    linear-gradient(
      180deg,
      var(--panel-top),
      var(--panel-bottom)
    );
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.alerts-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  padding: 20px;
  border-radius: 25px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.28em;
  line-height: 1.4;
}

h1 {
  margin: 8px 0 8px;
  font-size: clamp(31px, 9vw, 45px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.alerts-hero p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.refresh-button {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 12px 15px;
  border: 0;
  border-radius: 17px;
  color: #211600;
  background:
    linear-gradient(
      135deg,
      var(--gold),
      var(--orange)
    );
  box-shadow:
    0 10px 28px rgba(255, 159, 26, 0.2);
  font-size: 13px;
  font-weight: 1000;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
  padding: 13px 15px;
  border-radius: 19px;
}

.status-dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  box-shadow:
    0 0 15px rgba(34, 197, 94, 0.75);
}

.status-strip strong {
  display: block;
  font-size: 13px;
  font-weight: 1000;
}

.status-strip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.alerts-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 12px;
  padding: 13px;
  border-radius: 22px;
}

.summary-tile {
  min-height: 78px;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      rgba(15, 46, 63, 0.94),
      rgba(5, 18, 27, 0.99)
    );
}

.summary-tile span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.summary-tile strong {
  display: block;
  font-size: 25px;
  line-height: 1;
  font-weight: 1000;
}

.summary-tile.unread strong {
  color: var(--gold);
}

.summary-tile.critical strong {
  color: var(--red);
}

.summary-tile.delivered strong {
  color: var(--green);
}

.filter-card {
  margin-bottom: 12px;
  padding: 13px;
  border-radius: 21px;
}

.filter-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(255, 216, 74, 0.14);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10px;
  font-weight: 1000;
}

.filter.active {
  color: #211600;
  border-color: rgba(255, 216, 74, 0.56);
  background:
    linear-gradient(
      135deg,
      var(--gold),
      var(--orange)
    );
}

.filter-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

#timeframe-filter {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 216, 74, 0.14);
  border-radius: 15px;
  color: var(--text);
  background: #111207;
  font-size: 12px;
  font-weight: 900;
}

.secondary-button {
  padding: 11px 12px;
  border: 1px solid rgba(255, 216, 74, 0.2);
  border-radius: 15px;
  color: var(--gold);
  background: rgba(255, 216, 74, 0.07);
  font-size: 10px;
  font-weight: 1000;
}

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

.alert-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(255, 216, 74, 0.14);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(
      180deg,
      rgba(8, 31, 43, 0.98),
      rgba(4, 13, 20, 0.995)
    );
  box-shadow:
    0 15px 42px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.alert-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--blue);
}

.alert-card.priority-critical::before {
  background: var(--red);
  box-shadow:
    0 0 14px rgba(255, 85, 112, 0.5);
}

.alert-card.priority-high::before {
  background: var(--gold);
}

.alert-card.priority-normal::before {
  background: var(--blue);
}

.alert-card.is-unread {
  border-color: rgba(255, 216, 74, 0.31);
}

.alert-card.is-unread::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 11px rgba(255, 216, 74, 0.72);
}

.alert-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 216, 74, 0.18);
  border-radius: 14px;
  color: var(--gold);
  background: rgba(255, 216, 74, 0.08);
  font-size: 18px;
  font-weight: 1000;
}

.alert-content {
  min-width: 0;
}

.alert-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.alert-title {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.18;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.priority-pill {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.17);
  font-size: 7px;
  font-weight: 1000;
  letter-spacing: 0.11em;
}

.priority-pill.critical {
  color: var(--red);
  border-color: rgba(255, 85, 112, 0.23);
  background: rgba(255, 85, 112, 0.09);
}

.priority-pill.high {
  color: var(--gold);
  border-color: rgba(255, 216, 74, 0.23);
  background: rgba(255, 216, 74, 0.08);
}

.alert-detail {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.4;
}

.alert-reason {
  margin: 5px 0 0;
  color: #d2dae5;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.4;
}

.alert-meta {
  min-width: 58px;
  padding-right: 3px;
  text-align: right;
}

.alert-score {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
}

.alert-time {
  display: block;
  margin-top: 7px;
  color: #758295;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.alert-actions {
  grid-column: 2 / -1;
  display: flex;
  gap: 7px;
  margin-top: -2px;
}

.alert-action {
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 950;
}

.alert-action.open {
  color: var(--gold);
  border-color: rgba(255, 216, 74, 0.2);
}

.loading-state,
.empty-state,
.error-state {
  padding: 25px 18px;
  border-radius: 21px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.error-state {
  color: #ff8799;
  border-color: rgba(255, 85, 112, 0.28);
}

.atlas-nav {
  position: fixed;
  z-index: 9999;
  right: 12px;
  bottom: 10px;
  left: 12px;
  width: auto;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(255, 216, 74, 0.16);
  border-radius: 22px;
  background: rgba(7, 7, 5, 0.97);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(18px);
}

.atlas-nav a {
  flex: 1;
  min-width: 0;
  padding: 7px 1px;
  border-radius: 15px;
  color: #c6ceda;
  text-align: center;
  text-decoration: none;
  font-size: 8px;
  font-weight: 950;
  white-space: nowrap;
}

.atlas-nav a span {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
  line-height: 1;
}

.atlas-nav a.active {
  color: var(--gold);
  border: 1px solid rgba(255, 216, 74, 0.25);
  background:
    linear-gradient(
      180deg,
      rgba(255, 216, 74, 0.18),
      rgba(255, 216, 74, 0.05)
    );
}

.atlas-toast {
  position: fixed;
  z-index: 10000;
  right: 18px;
  bottom: 104px;
  left: 18px;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(255, 216, 74, 0.2);
  border-radius: 16px;
  color: var(--text);
  background: rgba(5, 12, 17, 0.97);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 420px) {
  .alerts-hero {
    padding: 17px;
  }

  .refresh-button {
    min-width: 82px;
    padding: 11px 12px;
  }

  .filter-controls {
    grid-template-columns: 1fr;
  }

  .secondary-button {
    width: 100%;
  }

  .alert-card {
    grid-template-columns: 39px minmax(0, 1fr) auto;
    padding: 13px;
  }

  .alert-icon {
    width: 37px;
    height: 37px;
  }
}
