:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d9e0ea;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: #111827;
  color: white;
}

.brand {
  font-weight: 700;
  letter-spacing: .2px;
}

nav {
  display: flex;
  gap: 14px;
}

nav a {
  color: #dbeafe;
  text-decoration: none;
}

nav a:hover {
  color: white;
}

.page {
  padding: 22px;
  max-width: 100%;
  overflow-x: hidden;
}

h1 {
  margin: 0 0 16px;
  font-size: 24px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.card .label {
  color: var(--muted);
  font-size: 12px;
}

.card .value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.form-grid .wide {
  grid-column: span 2;
}

input, select, button {
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 10px;
  font: inherit;
  max-width: 100%;
}

button {
  border: 0;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(.95);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

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

th {
  background: #eef2f7;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
}

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

.mono {
  font-family: Consolas, "Courier New", monospace;
}

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

.actions form {
  display: flex;
  gap: 5px;
}

.actions button {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-weight: 700;
  font-size: 12px;
}

.pill.active, .pill.ok, .pill.allowed {
  background: #dcfce7;
  color: var(--green);
}

.pill.trial {
  background: #dbeafe;
  color: var(--primary);
}

.pill.blocked, .pill.revoked, .pill.denied, .pill.error {
  background: #fee2e2;
  color: var(--red);
}

.pill.deprecated, .pill.expired {
  background: #fef3c7;
  color: var(--amber);
}

.login-box {
  width: min(380px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
  display: grid;
  gap: 10px;
}

.login-box h1 {
  margin-bottom: 6px;
  text-align: center;
}

.login-box label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.login-box input,
.login-box button {
  width: 100%;
  height: 40px;
}

.error {
  color: var(--red);
  font-weight: 600;
}

.alert {
  padding: 9px 10px;
  border-radius: 6px;
  background: #fee2e2;
  color: var(--red);
  font-weight: 600;
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  nav {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  nav a {
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
  }

  .page {
    padding: 14px;
  }

  h1 {
    font-size: 20px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card, .panel {
    padding: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    padding: 8px;
  }

  .actions {
    min-width: 240px;
  }
}

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

  .login-box {
    padding: 18px;
  }
}
