:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --ink: #17202a;
  --muted: #607084;
  --line: #d8dee7;
  --panel: #ffffff;
  --accent: #146c94;
  --accent-2: #2f7d57;
  --danger: #b42318;
  --warn: #a15c07;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Segoe UI, system-ui, -apple-system, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button.secondary {
  background: #e9eef5;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
}

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

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login form {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(25, 35, 45, 0.08);
}

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

.sidebar {
  background: #182734;
  color: white;
  padding: 22px 16px;
}

.brand {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 22px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  background: transparent;
  color: #dbe7f1;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.content {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

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

.stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 20px;
}

.stat,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  padding: 16px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span,
.muted {
  color: var(--muted);
}

.panel {
  padding: 16px;
  overflow: hidden;
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
}

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  background: #e9eef5;
}

.badge.ACTIVE,
.badge.SUPERADMIN {
  background: #dff3e8;
  color: var(--accent-2);
}

.badge.SUSPENDED,
.badge.PENDING {
  background: #fff1d6;
  color: var(--warn);
}

.badge.REVOKED,
.badge.CANCELLED {
  background: #ffe4e1;
  color: var(--danger);
}

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

.local-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.check input {
  width: auto;
  min-height: auto;
}

.notice {
  border-left: 4px solid var(--accent);
  background: #edf7fb;
  padding: 12px;
  border-radius: 6px;
}

.error {
  color: var(--danger);
  margin-top: 10px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

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

  .content {
    padding: 16px;
  }
}
