/* Administración por grupos: menú lateral (PC) o desplegable (móvil), Personas con su ficha, Facturación y claves de API. */
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-main { min-width: 0; }
.admin-side { display: none; }
.admin-menu-select { display: grid; gap: 4px; margin-bottom: 16px; }
.admin-menu-select select { width: 100%; }
@media (min-width: 900px) {
  .admin-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
  .admin-side { display: grid; gap: 18px; position: sticky; top: 16px; align-content: start; }
  .admin-menu-select { display: none; }
}
.admin-group-title { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.admin-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.admin-group a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
.admin-group a:hover { background: var(--fill); }
.admin-group a[aria-current="page"] { background: var(--fill); color: var(--accent); font-weight: 600; }
.admin-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: var(--bg); font-size: 12px; font-weight: 700; }
.admin-hero .titlebar { margin-bottom: 0; }

.admin-search { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.admin-search input { flex: 1; min-width: 0; }
.admin-filters { margin: 8px 0 12px; }
.admin-people { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-people .admin-table table { min-width: 640px; }
.admin-person-row { cursor: pointer; }
.admin-person-row:hover { background: var(--fill); }
.admin-person-row[aria-selected="true"] { background: var(--fill); box-shadow: inset 3px 0 0 var(--accent); }
.admin-people .tag { display: inline-block; margin: 2px 6px 0 0; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 12px; }
.admin-people .tag.warn { color: var(--orange); }
.person-open { text-align: left; font-weight: 600; padding: 0; }
@media (min-width: 1100px) {
  .admin-people.has-sheet { grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); }
  .admin-people.has-sheet .admin-sheet { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
}
.admin-sheet { background: var(--card); border-radius: 16px; padding: 16px; box-sizing: border-box; min-width: 0; }
.admin-sheet[hidden] { display: none; }
/* In the phone and the tablet the sheet takes the whole screen. */
@media (max-width: 1099px) {
  .admin-sheet { position: fixed; inset: 0; z-index: 70; overflow: auto; overflow-x: hidden; border-radius: 0; padding: 16px 16px 32px; background: var(--bg); }
}
/* The navigation (z-index 1000) is fixed: a rail on the left from 640px, a bar at the bottom on a phone. The full-screen sheet starts where it ends,
   or its first 64px (rail) or last row (bar) stay hidden underneath. */
@media (min-width: 640px) and (max-width: 1099px) {
  body.has-navigation .admin-sheet { left: var(--sidebar-width, 0px); }
}
@media (max-width: 639px) {
  body.has-navigation .admin-sheet { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
.admin-sheet-head { display: flex; align-items: center; gap: 12px; }
.admin-sheet-head h3 { margin: 0; overflow-wrap: anywhere; }
.admin-sheet-head p { margin: 2px 0 0; overflow-wrap: anywhere; }
.avatar-initials { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--accent); font-weight: 700; }
.admin-sheet-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.admin-sheet-panel .card { margin: 0 0 12px; box-shadow: none; background: var(--raised); }
.admin-sheet-panel h4 { margin: 0 0 8px; }
.admin-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.admin-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-list li > span { flex: 1; min-width: 120px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; }
.role-options { display: grid; gap: 8px; }
.role-option { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--sep); border-radius: 12px; background: transparent; }
.role-option[aria-checked="true"] { border-color: var(--accent); background: var(--fill); }
.admin-figures .tile { flex: 1 1 200px; display: grid; gap: 2px; }
.admin-figures .tile .value { font-size: 24px; }
.admin-figures .tile .label { color: var(--muted); font-size: 13px; }
.admin-billing .titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-billing .admin-table table { min-width: 680px; }
.admin-more > summary { cursor: pointer; font-weight: 600; margin: 8px 0; }

/* Claves de API de la persona, visibles en Perfil › Integraciones › Para desarrolladores. */
.api-keys { display: grid; gap: 12px; }
.api-keys .api-key { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--sep); border-radius: 12px; }
.api-keys .api-key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.api-keys .api-key-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 12px; align-items: end; }
.api-keys .secret { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--fill); }
.api-keys .secret input { width: 100%; font-family: ui-monospace, monospace; }
