:root {
  color-scheme: dark;
  --bg: #081018;
  --panel: #101c28;
  --panel-2: #142535;
  --text: #f5f7fb;
  --muted: #94a6b8;
  --line: rgba(148, 166, 184, 0.22);
  --cyan: #38d5ff;
  --orange: #ffb347;
  --bad: #ff6b6b;
  --ok: #69e6a3;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 213, 255, 0.12), transparent 34rem),
    linear-gradient(135deg, #070d14, var(--bg));
  color: var(--text);
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

h2 {
  font-size: 1.25rem;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 28, 40, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.auth-panel {
  max-width: 520px;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #09131e;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(56, 213, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(56, 213, 255, 0.12);
}

button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd36b, var(--orange));
  color: #17100a;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.small {
  height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.note,
.security-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.security-note {
  margin-top: 12px;
}

.status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
}

.status[data-kind="ok"] {
  color: var(--ok);
}

.status[data-kind="bad"] {
  color: var(--bad);
}

.status[data-kind="working"] {
  color: var(--cyan);
}

.meta-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 14px 0 0;
  color: var(--muted);
}

.meta-grid dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.search {
  display: flex;
  gap: 10px;
  min-width: min(100%, 430px);
}

.table-wrap {
  width: 100%;
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

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

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

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(56, 213, 255, 0.12);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.revoked {
  background: rgba(255, 107, 107, 0.14);
  color: var(--bad);
}

@media (max-width: 760px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .search {
    width: 100%;
  }
}
