:root {
  --navy: #0d1b2a;
  --gold: #c9a227;
  --line: #e2e5e9;
  --bg: #f7f8fa;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--navy);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(13, 27, 42, 0.08);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}

.card h1 {
  font-size: 22px;
  margin: 0 0 6px;
}

.card p.subtitle {
  margin: 0 0 24px;
  color: #5b6472;
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}

input:focus {
  outline: none;
  border-color: var(--navy);
}

button, .btn {
  display: inline-block;
  width: 100%;
  margin-top: 22px;
  padding: 12px 18px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .btn:hover { opacity: 0.92; }

.links {
  margin-top: 18px;
  font-size: 13px;
  text-align: center;
}

.links a { color: var(--navy); }

.error {
  background: #fdecec;
  border: 1px solid #f3b7b7;
  color: #a33;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 4px;
}

.success {
  background: #eaf6ec;
  border: 1px solid #b9ddc0;
  color: #2a6b37;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 4px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--navy);
  color: #fff;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar a { color: #fff; text-decoration: none; font-size: 14px; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-back {
  font-weight: 700;
  opacity: 0.9;
}
.topbar-back:hover { opacity: 1; }

/* Dashboard del Panel: cuadrícula de tarjetas cuadradas (una por sección),
   mismo lenguaje visual que el resto de la web (fondo blanco, borde fino,
   sombra suave, acento dorado) en vez del típico menú de enlaces de admin. */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 980px;
}

.admin-dashboard-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(13, 27, 42, 0.06);
  text-decoration: none;
  color: var(--navy);
  text-align: center;
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.admin-dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(13, 27, 42, 0.12);
  border-color: var(--gold);
}

.admin-dashboard-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #0d1b2a, #16293e);
  font-size: 24px;
}

.admin-dashboard-card-label {
  font-size: 14px;
  font-weight: 700;
}

.admin-dashboard-card-sub {
  font-size: 12px;
  color: #5b6472;
  margin-top: -6px;
}

.wide-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(13, 27, 42, 0.08);
  padding: 28px 32px;
  width: 100%;
  max-width: 1040px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

.toolbar button {
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
  font-size: 14px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5b6472;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
}

table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data tr:hover td { background: #fafbfc; }

table.data a.row-link { color: var(--navy); font-weight: 600; text-decoration: none; }
table.data a.row-link:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.activo { background: #eaf6ec; color: #2a6b37; }
.badge.inactivo, .badge.caducado { background: #f1f2f4; color: #5b6472; }
.badge.antiguo { background: #fdf3e3; color: #8a6116; }

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 13px;
  color: #5b6472;
  text-decoration: none;
}

.back-link:hover { color: var(--navy); }

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  font-size: 14px;
}

.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--navy);
  text-decoration: none;
}

.pagination span.current {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 24px;
  margin: 18px 0 28px;
}

.field-grid div label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5b6472;
  margin: 0 0 4px;
}

.field-grid div .value {
  font-size: 15px;
}

/* ============================================================
   Sesiones de prácticas (admin/sesiones.php) — tarjetas por sesión,
   al estilo del panel que ya se usaba en producción.
   ============================================================ */

.ses-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 18px;
}

.ses-tabs a {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
  background: #f1f2f4;
}

.ses-tabs a.active {
  background: var(--navy);
  color: #fff;
}

.ses-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.ses-toolbar-filter, .ses-toolbar-default {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ses-toolbar label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6472;
}

.ses-toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  min-width: 220px;
}

.ses-toolbar input[type="number"] {
  width: 64px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
}

.ses-toolbar button {
  width: auto;
  margin: 0;
  padding: 9px 16px;
  font-size: 13px;
}

.ses-count {
  margin: 0 0 16px;
  font-size: 13px;
  color: #5b6472;
}

.ses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.ses-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.05);
}

.ses-card.is-cancelada { opacity: 0.55; }

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

.ses-card-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.ses-source {
  display: block;
  font-size: 11px;
  color: #5b6472;
  margin-top: 3px;
}

.ses-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.ses-card-actions form { margin: 0; }

.ses-capacity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ses-capacity i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.ses-capacity-libre { background: #eaf6ec; color: #2a6b37; }
.ses-capacity-libre i { background: #2a6b37; }
.ses-capacity-casi { background: #fdf3e3; color: #8a6116; }
.ses-capacity-casi i { background: #c9a227; }
.ses-capacity-lleno { background: #fdecec; color: #a33; }
.ses-capacity-lleno i { background: #a33; }

.ses-icon-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eaf6ec;
  color: #2a6b37;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.ses-icon-btn-danger { background: #fdecec; color: #a33; }

.ses-meta {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 4px;
}

.ses-meta-location {
  font-size: 13px;
  color: #5b6472;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ses-progress {
  height: 6px;
  border-radius: 999px;
  background: #f1f2f4;
  overflow: hidden;
  margin-bottom: 10px;
}

.ses-progress-bar { height: 100%; }

.ses-aforo-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ses-aforo-form input {
  width: 64px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.ses-aforo-form button {
  width: auto;
  margin: 0;
  padding: 7px 14px;
  font-size: 12px;
}

.ses-group-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ses-group-btn {
  flex: 1 0 auto;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.ses-group-email { background: #e8f0fe; color: #1a56b0; }
.ses-group-whatsapp { background: #dcf8e3; color: #1d7a3b; }

.ses-reservas summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  list-style: none;
}
.ses-reservas summary::-webkit-details-marker { display: none; }
.ses-reservas summary::after { content: ' ▾'; }
.ses-reservas[open] summary::after { content: ' ▴'; }

.ses-reservas ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 12.5px;
}

.ses-reservas li {
  padding: 5px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ses-reservas li a:first-child { color: var(--navy); font-weight: 600; text-decoration: none; }
.ses-reservas li a:first-child:hover { text-decoration: underline; }

.ses-wa-individual {
  margin-left: auto;
  background: #dcf8e3;
  color: #1d7a3b;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.ses-sin-reservas {
  font-size: 12.5px;
  color: #5b6472;
  margin: 0;
}

.ses-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}

.ses-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
