* {
  box-sizing: border-box;
}

:root {
  --bg: #07111f;
  --card: rgba(17, 31, 50, 0.78);
  --card-hover: rgba(24, 42, 66, 0.92);
  --border: rgba(255,255,255,0.08);
  --text: #f5f7fa;
  --muted: #8592a3;
  --green: #31d17c;
  --orange: #f4b942;
  --red: #ff5c6c;
  --blue: #5294ff;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -1;

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(43, 92, 170, .32),
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 10%,
      rgba(133, 41, 107, .22),
      transparent 30%
    ),
    radial-gradient(
      circle at 65% 85%,
      rgba(26, 104, 94, .18),
      transparent 35%
    );

  filter: blur(25px);
}

.dashboard {
  width: min(1500px, 94%);
  margin: auto;
  padding: 45px 0 80px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 45px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  letter-spacing: 4px;
  font-weight: 700;
}

h1 {
  margin: 4px 0;
  font-size: clamp(32px, 4vw, 54px);
  letter-spacing: -2px;
}

.subtitle {
  color: var(--muted);
  margin: 8px 0 0;
}

.header-right {
  display: flex;
  gap: 35px;
  align-items: center;
  text-align: right;
}

.clock {
  font-size: 28px;
  font-weight: 700;
}

.date {
  color: var(--muted);
  margin-top: 4px;
}

.global-status {
  display: flex;
  align-items: center;
  gap: 9px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;

  padding: 11px 16px;
  backdrop-filter: blur(14px);
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 13px var(--green);
}

.section {
  margin-top: 38px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;

  color: #b3bfd0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.section-line {
  height: 1px;
  flex: 1;
  background: var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card,
.service-card,
.events {
  background: var(--card);
  border: 1px solid var(--border);

  box-shadow:
    0 20px 50px rgba(0,0,0,.15);

  backdrop-filter: blur(18px);
}

.stat-card {
  border-radius: 18px;
  padding: 20px;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.progress {
  height: 7px;
  margin-top: 20px;

  border-radius: 999px;
  background: rgba(255,255,255,.07);

  overflow: hidden;
}

.progress div {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #5294ff,
    #49d5ae
  );

  transition: width .5s ease;
}

.stat-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.uptime-icon {
  margin-top: 15px;
  font-size: 24px;
}

.cards-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(320px, 1fr));

  gap: 18px;
}

.service-card {
  position: relative;
  padding: 22px;
  border-radius: 20px;

  transition:
    transform .2s ease,
    border .2s ease,
    background .2s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: rgba(255,255,255,.14);
}

.service-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.service-icon {
  display: grid;
  place-items: center;

  width: 50px;
  height: 50px;

  border-radius: 14px;
  background: rgba(255,255,255,.07);

  font-size: 25px;
}

.service-header h2 {
  margin: 0;
  font-size: 18px;
}

.service-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
}

.badge.online {
  color: var(--green);
  background: rgba(49,209,124,.11);
}

.badge.offline {
  color: var(--red);
  background: rgba(255,92,108,.11);
}

.badge.warning {
  color: var(--orange);
  background: rgba(244,185,66,.11);
}

.service-info {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;

  border-bottom: 1px solid rgba(255,255,255,.045);

  font-size: 14px;
}

.service-info span {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: 22px;
}

button,
.actions a {
  border: 0;
  outline: 0;

  border-radius: 10px;

  padding: 9px 13px;

  background: rgba(82,148,255,.12);
  color: #bcd5ff;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
  text-decoration: none;

  transition:
    background .15s ease,
    transform .15s ease;
}

button:hover,
.actions a:hover {
  transform: translateY(-1px);
  background: rgba(82,148,255,.2);
}

button.warning {
  color: #f7ce72;
  background: rgba(244,185,66,.11);
}

button.danger {
  color: #ff8b96;
  background: rgba(255,92,108,.10);
}

.events {
  padding: 18px;
  border-radius: 18px;
}

.event {
  padding: 10px 5px;
  font-size: 13px;
  color: #aeb9c7;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.event:last-child {
  border-bottom: none;
}

.toast {
  position: fixed;

  right: 25px;
  bottom: 25px;

  max-width: 360px;

  padding: 14px 18px;

  border-radius: 12px;

  background: #151f2d;
  border: 1px solid var(--border);

  color: white;

  opacity: 0;
  pointer-events: none;

  transform: translateY(20px);

  transition: .25s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {

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

  .header {
    align-items: flex-start;
  }

  .header-right {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
  }
}

@media (max-width: 600px) {

  .dashboard {
    width: 92%;
    padding-top: 25px;
  }

  .header {
    flex-direction: column;
    gap: 25px;
  }

  .header-right {
    width: 100%;
    align-items: flex-start;
    text-align: left;
  }

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

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