:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #667085;
  --line: #d9e0e7;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button, input, select {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
  font: inherit;
}
button {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
button:hover { background: var(--brand-dark); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #101820;
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar strong { font-size: 18px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a, .sidebar button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d7dee7;
  padding: 10px 12px;
  text-align: left;
}
.sidebar a:hover, .sidebar button:hover { background: #1f2a36; color: #fff; }

.content { margin-left: 240px; padding: 28px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 24px; }
.topbar span { color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metrics article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.metrics span { display: block; color: var(--muted); margin-bottom: 10px; }
.metrics strong { font-size: 28px; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.grid-form.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { display: grid; gap: 5px; color: var(--muted); font-weight: 700; }
label input, label select { width: 100%; color: var(--ink); font-weight: 400; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 6px;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.check { display: inline-flex; grid-auto-flow: column; align-items: center; gap: 6px; color: var(--ink); }
.check input { min-height: auto; }

table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
code {
  background: #eef2f6;
  border-radius: 4px;
  padding: 2px 5px;
}
.badge {
  border-radius: 999px;
  display: inline-block;
  padding: 4px 9px;
  background: #eef2f6;
  color: var(--ink);
  font-weight: 700;
}
.badge.ok, .badge.active { background: #dcfae6; color: var(--ok); }
.badge.denied, .badge.revoked { background: #fee4e2; color: var(--danger); }
.badge.suspended, .badge.expired { background: #fef0c7; color: var(--warn); }
.inline-form, .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form input { width: 130px; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.login-card h1 { margin: 0 0 6px; }
.login-card p { margin: 0 0 20px; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.alert {
  background: #fee4e2;
  color: var(--danger);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .content { margin-left: 0; padding: 18px; }
  .metrics, .split, .grid-form, .grid-form.wide { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
