.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.admin-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.admin-card {
  background: linear-gradient(180deg, #111218, #0b0c10);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-card-head h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.admin-card-head p {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 60ch;
}

.cred-card {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 13px 14px;
  background: #0d0f14;
  display: grid;
  gap: 10px;
}

.cred-card + .cred-card { margin-top: 10px; }

.cred-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cred-name { font-size: 13px; font-weight: 700; }
.cred-source { display: flex; gap: 6px; align-items: center; }

.cred-fields { display: grid; gap: 8px; }

.cred-field { display: grid; gap: 4px; }
.cred-field label { font-size: 9px; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 800; text-transform: uppercase; }
.cred-field .current { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

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

.cred-docs { font-size: 10px; color: var(--text-muted); line-height: 1.5; }
.cred-docs a { color: var(--red); text-decoration: none; }

.cred-result {
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0a0b0f;
  line-height: 1.45;
}
.cred-result.is-ok { color: var(--ok); border-color: rgba(53,208,127,0.3); }
.cred-result.is-error { color: var(--red); border-color: rgba(255,43,43,0.35); }

/* access */
.access-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d0f14;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #1a1d26;
  transition: background 0.15s, border-color 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #9aa0ad;
  transition: transform 0.15s, background 0.15s;
}
.switch.is-on { background: var(--red); border-color: var(--red); }
.switch.is-on::after { transform: translateX(20px); background: #fff; }

.access-copy { display: grid; gap: 3px; }
.access-copy b { font-size: 12px; }
.access-copy span { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* users */
.user-table .track-actions { flex-wrap: nowrap; justify-content: flex-end; }
.user-table .icon-btn { font-size: 13px; }
.user-table td { white-space: nowrap; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 800;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}
.user-table td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); font-size: 12px; vertical-align: middle; }
.user-table tr:last-child td { border-bottom: none; }
.user-name { display: grid; gap: 1px; }
.user-name b { font-weight: 650; font-size: 12px; }
.user-name span { font-size: 10px; color: var(--text-muted); }

.role-select {
  background: #0d0f14;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 10px;
  padding: 4px 6px;
}

.you-badge {
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 5px;
}

.admin-locked {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  height: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius-l);
  color: var(--text-muted);
  padding: 30px;
}
.admin-locked b { color: var(--text); font-size: 16px; }
.admin-locked p { max-width: 420px; line-height: 1.6; font-size: 12px; }

/* auth gate */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 380px at 50% 0%, rgba(255, 43, 43, 0.16), transparent 65%),
    #07070a;
}

.auth-gate-card {
  width: min(420px, 92vw);
  background: #0f1015;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  display: grid;
  gap: 14px;
}

.auth-gate-brand { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.auth-gate-brand span { color: var(--red); }
.auth-gate-card h2 { font-size: 15px; font-weight: 700; }
.auth-gate-card p { font-size: 12px; color: var(--text-muted); line-height: 1.55; }

@media (max-width: 1320px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 1080px) {
  .admin-layout { grid-template-columns: 1fr; overflow: auto; }
}
