:root {
  --bg0: #0f1412;
  --bg1: #17201c;
  --ink: #e7efe9;
  --muted: #8fa097;
  --line: #2a3831;
  --accent: #6db38a;
  --danger: #d07070;
  --ok: #6db38a;
  --down: #a07060;
  --radius: 10px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #1e3a2f 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #243028 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
}

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

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(900px, 92vw);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 20, 18, 0.72);
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.who {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
}

a.who:hover {
  color: var(--accent);
  text-decoration: underline;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  font-weight: 600;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.auth-card {
  width: min(380px, 100%);
  margin: 4rem auto 0;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 32, 28, 0.85);
}

.auth-card.wide {
  width: min(420px, 100%);
}

.password-reset {
  gap: 0.4rem;
  min-width: 11rem;
}

.password-reset input {
  font-size: 0.85rem;
  padding: 0.4rem 0.55rem;
}

.profile-section-title {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.05rem;
}

.profile-logout {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.btn.danger-btn {
  width: 100%;
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
  background: color-mix(in srgb, var(--danger) 18%, var(--bg0));
}

.btn.danger-btn:hover {
  background: color-mix(in srgb, var(--danger) 32%, var(--bg0));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.panel {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 32, 28, 0.65);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select {
  font: inherit;
  color: var(--ink);
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

input:focus,
select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 22%, var(--bg0));
  color: var(--ink);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  text-decoration: none;
}

.btn:hover {
  background: color-mix(in srgb, var(--accent) 35%, var(--bg0));
  text-decoration: none;
}

.btn.small {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.inline {
  display: inline;
  margin: 0;
}

.linkish {
  font: inherit;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

.linkish.danger {
  color: var(--danger);
}

.flash {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.flash.error {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
}

.flash.ok {
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line));
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 32, 28, 0.7);
}

.service-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.service-name {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.service-name:hover {
  color: var(--accent);
}

.status {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status.up {
  color: var(--ok);
}

.status.down {
  color: var(--down);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.table th {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 560px) {
  .service-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

.access-form {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 32, 28, 0.65);
}

.access-matrix {
  margin-top: 0;
  min-width: 420px;
}

.access-matrix .svc-col {
  text-align: center;
  white-space: nowrap;
}

.access-matrix .check-cell {
  text-align: center;
}

.access-matrix input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.who-cell {
  font-weight: 600;
}

.tiny {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
}
