:root {
  color-scheme: light;
  --green: #18864b;
  --yellow: #b7791f;
  --red: #c53030;
  --blue: #2b6cb0;
  --gray-50: #f8fafc;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  letter-spacing: 0;
}

.brand small {
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav a,
.link-button {
  border: 0;
  background: transparent;
  color: var(--gray-700);
  cursor: pointer;
  font: inherit;
  padding: 6px 0;
}

.nav a:hover,
.link-button:hover {
  color: var(--gray-900);
}

.language {
  display: flex;
  justify-content: flex-end;
}

.language select {
  appearance: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  color: var(--gray-700);
  font-size: 14px;
  min-width: 180px;
  padding: 8px 10px;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px;
}

.auth-shell {
  align-items: center;
  display: grid;
  min-height: calc(100vh - 64px);
}

.auth-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin: 0 auto;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 0 14px;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
  margin-top: 28px;
}

h3 {
  font-size: 16px;
}

.muted {
  color: var(--gray-500);
}

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

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

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

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 18px;
}

.metric {
  color: var(--gray-500);
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.metric-value {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

table {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

th {
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 9px;
  white-space: nowrap;
}

.GREEN,
.operational {
  background: #e6f6ee;
  color: var(--green);
}

.YELLOW,
.degraded {
  background: #fff7df;
  color: var(--yellow);
}

.RED,
.major_outage,
.partial_outage {
  background: #fdeaea;
  color: var(--red);
}

.maintenance {
  background: #e8f1fb;
  color: var(--blue);
}

.UNKNOWN {
  background: var(--gray-100);
  color: var(--gray-700);
}

form.stack {
  display: grid;
  gap: 12px;
}

label {
  color: var(--gray-700);
  display: grid;
  font-weight: 700;
  gap: 6px;
}

input,
textarea,
select {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  color: var(--gray-900);
  font: inherit;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

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

.check-row input {
  width: auto;
}

button,
.button {
  align-items: center;
  background: var(--gray-900);
  border: 1px solid var(--gray-900);
  border-radius: 6px;
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
}

button.secondary,
.button.secondary {
  background: var(--white);
  color: var(--gray-900);
}

.flash {
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.flash.error {
  background: #fdeaea;
  color: var(--red);
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

pre {
  background: #101827;
  border-radius: 8px;
  color: #e5edf6;
  overflow: auto;
  padding: 14px;
}

.public-hero {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 22px;
}

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

.sla-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 12px;
}

.sla-cell {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 9px;
}

.sla-cell strong {
  display: block;
}

.problem-detail {
  min-width: 180px;
}

.package-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.package-list li {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  color: var(--gray-700);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 4px 6px;
}

@media (max-width: 760px) {
  .topbar,
  .public-hero,
  .service-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  main {
    padding: 18px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .sla-strip {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
