@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #08111f;
  --panel: #0e1a2f;
  --panel-soft: #0d1a2b;
  --line: #1e3552;
  --text: #dcecff;
  --muted: #8ea8ca;
  --primary: #28c9ff;
  --primary-2: #0fa2d6;
  --up: #34d48f;
  --down: #ff6f79;
  --maintenance: #ffc44d;
  --unknown: #8fa4c4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Sora, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at -10% -20%, #3a84c933, transparent 70%),
    radial-gradient(950px 430px at 120% -10%, #2dd0a633, transparent 70%),
    var(--bg);
}

a {
  color: #a5deff;
  text-decoration: none;
}

a:hover {
  color: #d9f2ff;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem 0.8rem;
  border-right: 1px solid #173251;
  background: linear-gradient(180deg, #0a1528, #0a1321);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #ecf8ff;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  padding: 0.45rem 0.6rem;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #26c7ff, #37e592);
  box-shadow: 0 0 0 5px #25c8ff2b;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
}

.side-nav a {
  display: block;
  padding: 0.56rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #d2e9ff;
  font-weight: 600;
}

.side-nav a:hover {
  border-color: #2f4f74;
  background: #13243c;
}

.sidebar-logout {
  margin-top: 1rem;
}

.main-shell {
  min-width: 0;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid #173050;
  background: #091324df;
  backdrop-filter: blur(8px);
}

.toolbar-title {
  display: grid;
  gap: 0.12rem;
}

.toolbar-title strong {
  font-size: 1rem;
}

.toolbar-title span {
  font-size: 0.8rem;
  color: var(--muted);
}

.layout {
  width: min(1180px, calc(100vw - 290px));
  margin: 1rem auto 2rem;
}

.auth-layout {
  width: min(460px, 92vw);
  margin: 4.5rem auto;
}

.auth-card,
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #0f1c30, #0d1829);
  box-shadow: 0 12px 24px rgba(2, 8, 18, 0.5);
  padding: 1rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

p {
  margin: 0.25rem 0;
  color: var(--muted);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.hero-actions,
.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

button,
.primary-btn,
.ghost-btn,
.danger-btn {
  border: none;
  border-radius: 999px;
  padding: 0.47rem 0.88rem;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  color: #001420;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.ghost-btn {
  color: #d9ecff;
  background: #15273f;
  border: 1px solid #284567;
}

.danger-btn {
  color: #ffdde0;
  background: #4d2128;
  border: 1px solid #7f4049;
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.52rem 0.7rem;
  font-weight: 600;
}

.flash-success {
  border-color: #2c6f52;
  background: #174030;
  color: #baf5d6;
}

.flash-error {
  border-color: #7a3e47;
  background: #502328;
  color: #ffd6da;
}

.flash-info {
  border-color: #2f567d;
  background: #142e49;
  color: #d2ebff;
}

.inline-form {
  margin-top: 0.45rem;
}

.top-gap {
  margin-top: 0.9rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.split-2,
.split-3 {
  display: grid;
  gap: 0.75rem;
}

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

.split-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label,
legend {
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 0.32rem;
  border-radius: 9px;
  border: 1px solid #2c4a6f;
  background: #0a1627;
  color: var(--text);
  font: inherit;
  padding: 0.56rem 0.65rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #34cdfd;
  box-shadow: 0 0 0 2px #25c8ff33;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.35rem;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.checkline input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.stat-card h3 {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.stat-card strong {
  font-size: 1.45rem;
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.monitor-card {
  border-radius: 12px;
  border: 1px solid #294765;
  border-left: 6px solid var(--unknown);
  background: linear-gradient(180deg, #13233a, #101d31);
  padding: 0.85rem;
}

.monitor-card.status-up,
.public-header.status-up {
  border-left-color: var(--up);
}

.monitor-card.status-down,
.incident-open,
.public-header.status-down {
  border-left-color: var(--down);
}

.monitor-card.status-maintenance,
.public-header.status-maintenance {
  border-left-color: var(--maintenance);
}

.monitor-card.status-unknown,
.public-header.status-unknown {
  border-left-color: var(--unknown);
}

.monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.56rem;
}

.pill-up {
  background: #134432;
  color: #95f5c7;
}

.pill-down {
  background: #4f2329;
  color: #ffd5d9;
}

.pill-maintenance,
.pill-unknown {
  background: #4d3d1e;
  color: #ffdda2;
}

.url,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #a4dbff;
  word-break: break-all;
}

.availability-grid {
  margin: 0.4rem 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.availability-grid span {
  border: 1px solid #2b486a;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  color: #bdd6f2;
  background: #11213a;
}

.availability-grid strong {
  color: #e3f2ff;
}

.availability-grid-wide {
  margin-top: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.history-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0.45rem 0 0.6rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4f6587;
}

.dot-up {
  background: var(--up);
}

.dot-down {
  background: var(--down);
}

.dot-maintenance {
  background: var(--maintenance);
}

.dot-unknown {
  background: var(--unknown);
}

.error-text {
  color: #ffd6da;
  background: #54272d;
  border: 1px solid #7c424b;
  border-radius: 9px;
  padding: 0.45rem 0.6rem;
}

.list-grid {
  display: grid;
  gap: 0.65rem;
}

.list-grid.compact {
  gap: 0.5rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  border: 1px solid #2a4767;
  border-radius: 11px;
  background: #101d33;
  padding: 0.7rem;
}

.maintenance-item {
  border-left: 6px solid var(--maintenance);
}

.maintenance-notice {
  border-left: 6px solid var(--maintenance);
}

.notice-planned {
  border-left-color: #6fc8ff;
}

.notice-active {
  border-left-color: var(--maintenance);
}

.notice-ended {
  border-left-color: #7fa2c8;
}

.status-note {
  border-left: 6px solid #6fc8ff;
}

.note-info {
  border-left-color: #6fc8ff;
}

.note-warning {
  border-left-color: var(--maintenance);
}

.note-danger {
  border-left-color: #ff7a86;
}

.note-incident {
  border-left-color: #ffad3d;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #26425f;
  padding: 0.5rem;
  vertical-align: top;
}

th {
  font-size: 0.76rem;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: #9cc5e6;
}

.hint {
  font-size: 0.86rem;
}

.hidden {
  display: none !important;
}

.payload-image-meta {
  justify-content: space-between;
  align-items: center;
}

.public-body {
  min-height: 100vh;
}

.public-shell {
  width: min(1020px, 95vw);
  margin: 1rem auto 2rem;
}

.announcement {
  border: 1px solid #365374;
  border-radius: 9px;
  padding: 0.5rem 0.65rem;
  background: #112338;
  color: #cfe8ff;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #173251;
  }

  .layout {
    width: min(980px, 95vw);
  }
}

@media (max-width: 860px) {
  .split-2,
  .split-3,
  .stats-grid,
  .availability-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .row-head,
  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
