/* =========================================================
   CIADAL — Panel de Servidores (admin.css)
   Requiere que css/style.css se cargue antes (usa sus variables)
   ========================================================= */

.admin-body { background: var(--bg); }

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

/* ---- Sidebar ---- */
.admin-sidebar {
  background: var(--azul-900);
  color: rgba(255,255,255,.85);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; padding: 0 6px; }
.admin-brand img { height: 30px; }
.admin-brand span { font-weight: 800; font-size: .95rem; color: #fff; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .92rem;
  color: rgba(255,255,255,.72);
  transition: background .15s ease, color .15s ease;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.is-active { background: rgba(255,255,255,.12); color: #fff; }

.admin-user {
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 18px;
  margin-top: 18px;
}
.admin-user-name { font-weight: 800; color: #fff; font-size: .92rem; }
.admin-user-role { font-size: .78rem; color: rgba(255,255,255,.55); margin-top: 2px; }
.admin-logout {
  display: inline-block;
  margin-top: 12px;
  font-size: .82rem;
  font-weight: 700;
  color: #ffb5b5;
}
.admin-logout:hover { text-decoration: underline; }

/* ---- Main ---- */
.admin-main { min-width: 0; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--blanco);
  border-bottom: 1px solid rgba(3,27,58,.07);
}
.admin-topbar-link { font-size: .85rem; font-weight: 700; color: var(--azul); }
.admin-burger {
  display: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  position: relative;
}
.admin-burger span, .admin-burger span::before, .admin-burger span::after {
  content: "";
  position: absolute;
  height: 2px;
  background: var(--azul-900);
}
.admin-burger span { left: 9px; right: 9px; top: 18px; }
.admin-burger span::before { left: 0; right: 0; top: -6px; }
.admin-burger span::after { left: 0; right: 0; top: 6px; }

.admin-content { padding: 32px; max-width: 1180px; }

/* ---- Encabezado de sección ---- */
.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}
.admin-page-head h1 { font-size: 1.6rem; margin: 0; }
.admin-page-head p { color: var(--gris); margin: 4px 0 0; font-size: .95rem; }

/* ---- Tarjetas de estadística ---- */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.admin-stat-card {
  background: var(--blanco);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 8px 22px -14px rgba(3,27,58,.2);
}
.admin-stat-card .n { font-size: 1.9rem; font-weight: 900; color: var(--azul-900); }
.admin-stat-card .l { font-size: .82rem; color: var(--gris); font-weight: 700; }

/* ---- Tabla ---- */
.admin-table-wrap {
  background: var(--blanco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 22px -14px rgba(3,27,58,.2);
}
table.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.admin-table th, table.admin-table td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid #eef0f2;
}
table.admin-table th {
  background: var(--bg);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gris);
  font-weight: 800;
}
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table td.actions { display: flex; gap: 8px; white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 800;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; }
.badge-on { background: #e5f6ec; color: #1a7a44; }
.badge-off { background: #f1f2f3; color: #71747a; }

.btn-xs {
  padding: 7px 14px;
  font-size: .8rem;
  border-radius: 100px;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-xs.edit { background: var(--bg); color: var(--azul-900); }
.btn-xs.edit:hover { background: #e6e9ec; }
.btn-xs.danger { background: #fdeaea; color: #b3261e; }
.btn-xs.danger:hover { background: #fbdada; }

/* ---- Formularios en tarjeta ---- */
.admin-card {
  background: var(--blanco);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 8px 22px -14px rgba(3,27,58,.2);
  margin-bottom: 28px;
}
.admin-card h3 { margin-top: 0; font-size: 1.15rem; }

.admin-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--gris);
}
.admin-empty h2 { color: var(--negro); }

/* ---- Lista de asistencia (checklist) ---- */
.attendance-list { display: grid; gap: 10px; }
.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--blanco);
  border: 1.5px solid #eef0f2;
  border-radius: 14px;
  padding: 14px 18px;
  transition: border-color .15s ease, background .15s ease;
}
.attendance-row:has(input:checked) { border-color: var(--azul); background: #eef5ff; }
.attendance-row label { display: flex; align-items: center; gap: 14px; font-weight: 700; cursor: pointer; flex: 1; }
.attendance-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--azul); cursor: pointer; }
.attendance-meta { font-size: .82rem; color: var(--gris); font-weight: 500; }

.visitor-row { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr auto; gap: 10px; margin-bottom: 10px; align-items: center; }
.visitor-row button { flex: none; }

/* ---- Login / instalar (pantalla completa) ---- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--azul);
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.auth-screen .blob {
  position: absolute;
  border-radius: 44% 56% 61% 39% / 45% 40% 60% 55%;
}
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: var(--blanco);
  border-radius: 22px;
  padding: 40px 36px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4);
}
.auth-card img { height: 40px; margin-bottom: 18px; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-card p.sub { color: var(--gris); margin-bottom: 26px; font-size: .92rem; }
.auth-card .btn { width: 100%; margin-top: 10px; }
.auth-card .field { margin-bottom: 16px; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    inset: 0 30% 0 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 20px 0 40px rgba(0,0,0,.2);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-burger { display: block; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 20px; }
  .visitor-row { grid-template-columns: 1fr 1fr; }
  table.admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
