/* =========================================================================
   Panel administrativo de referidos — Universidad Potosina
   ========================================================================= */

:root {
  --navy: #00214b;
  --navy-600: #0a3a74;
  --sky: #35a8e0;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e7ee;
  --border-strong: #cbd3de;
  --text: #15233a;
  --muted: #5d6a7c;
  --faint: #8a95a5;
  --focus: rgba(53, 168, 224, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 32, 60, .05), 0 4px 16px rgba(16, 32, 60, .05);
  --shadow-lg: 0 24px 60px rgba(16, 32, 60, .22);

  --pendiente: #a15c07;     --pendiente-bg: #fef3c7;   --pendiente-line: #f59e0b;
  --informes: #1d4ed8;      --informes-bg: #dbeafe;    --informes-line: #3b82f6;
  --inscrito: #15803d;      --inscrito-bg: #dcfce7;    --inscrito-line: #22c55e;
  --no_interesado: #475569; --no_interesado-bg: #e9edf2; --no_interesado-line: #94a3b8;
  --danger: #b91c1c;        --danger-bg: #fee2e2;
  --success: #15803d;       --success-bg: #dcfce7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
a { color: var(--navy-600); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--navy);
  flex-shrink: 0;
}
.topbar-brand img { height: 34px; width: auto; display: block; }
.topbar-brand span {
  padding-left: 14px;
  border-left: 1px solid var(--border-strong);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.topbar-nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.topbar-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-nav a svg { width: 18px; height: 18px; }
.topbar-nav a:hover { background: var(--surface-2); color: var(--text); }
.topbar-nav a.is-active { background: #e8eef7; color: var(--navy); }

.user-menu { position: relative; flex-shrink: 0; }
.user-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--surface-2); }
.user-menu .user-text { display: grid; line-height: 1.25; text-align: left; }
.user-menu .user-text strong { font-size: 14px; }
.user-menu .user-text small { color: var(--muted); font-size: 12px; }
.user-menu .chevron { width: 16px; height: 16px; color: var(--faint); }
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.user-menu-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.user-menu-panel a:hover { background: var(--surface-2); }
.user-menu-panel a.danger { color: var(--danger); }
.user-menu-panel svg { width: 18px; height: 18px; }

/* ---------- Avatares ---------- */
.avatar {
  --avatar: var(--navy);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

/* ---------- Página ---------- */
.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 28px; color: var(--navy); }
.page-header p { margin-top: 6px; color: var(--muted); max-width: 640px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { color: var(--navy); }
.back-link svg { width: 18px; height: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body { padding: 24px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 17px; }
.card-header p { color: var(--muted); font-size: 14px; }

/* ---------- Tarjetas de resumen (filtran la tabla) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  --line: var(--navy);
  position: relative;
  display: grid;
  gap: 2px;
  padding: 16px 18px 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--line);
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat.is-active { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy), var(--shadow); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.stat small { color: var(--faint); font-size: 12px; }
.stat.pendiente { --line: var(--pendiente-line); }
.stat.informes { --line: var(--informes-line); }
.stat.inscrito { --line: var(--inscrito-line); }
.stat.no_interesado { --line: var(--no_interesado-line); }

/* ---------- Barra de búsqueda y filtros ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.search-field {
  position: relative;
  flex: 1 1 320px;
}
.search-field svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}
.search-field input[type="search"] { padding-left: 42px; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .15s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--navy); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

.results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 4px 10px;
  color: var(--muted);
  font-size: 14px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  background: #e8eef7;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
}
.filter-chip a {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--navy);
  text-decoration: none;
}
.filter-chip a:hover { background: rgba(0, 33, 75, .1); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-weight: 600; font-size: 14px; color: var(--text); }
.field small, .field-hint { color: var(--muted); font-size: 13px; }
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
}
.password-toggle:hover { background: var(--surface-2); color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { background: var(--navy-600); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #f3c4c4; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.whatsapp { background: #1f9d55; }
.btn.whatsapp:hover { background: #188046; }
.btn.sm { min-height: 36px; padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- Tabla ---------- */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }
.table .actions { text-align: right; white-space: nowrap; }
.cell-main { display: block; font-weight: 600; color: var(--text); }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
a.cell-main { text-decoration: none; }
a.cell-main:hover { color: var(--navy-600); text-decoration: underline; }
.person { display: flex; align-items: flex-start; gap: 12px; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: #188046;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.contact-link:hover { text-decoration: underline; }
.contact-link svg { width: 16px; height: 16px; }
.note-preview {
  display: -webkit-box;
  max-width: 240px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- Etiquetas ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.plain::before { display: none; }
.badge.pendiente { background: var(--pendiente-bg); color: var(--pendiente); }
.badge.informes { background: var(--informes-bg); color: var(--informes); }
.badge.inscrito { background: var(--inscrito-bg); color: var(--inscrito); }
.badge.no_interesado { background: var(--no_interesado-bg); color: var(--no_interesado); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.navy { background: #e8eef7; color: var(--navy); }
.advisor { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.advisor.none { color: var(--faint); font-style: italic; font-weight: 400; }

/* ---------- Estado vacío ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 44px; height: 44px; color: var(--border-strong); }
.empty strong { color: var(--text); font-size: 16px; }

/* ---------- Paginación ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.pagination .pages { display: flex; gap: 6px; }

/* ---------- Ficha del alumno ---------- */
.profile {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px;
  margin-bottom: 20px;
}
.profile-main { flex: 1 1 320px; min-width: 0; }
.profile-main h1 { font-size: 26px; color: var(--navy); }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-meta svg { width: 16px; height: 16px; color: var(--faint); }
.profile-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stat {
  min-width: 108px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.mini-stat strong { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.mini-stat span { color: var(--muted); font-size: 13px; }
.mini-stat.inscrito strong { color: var(--inscrito); }

/* ---------- Ventanas (dialog) ---------- */
dialog.modal {
  width: min(600px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(10, 22, 44, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 20px; color: var(--navy); }
.modal-header p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.modal-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { display: grid; gap: 18px; padding: 20px 24px; overflow-y: auto; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 18px 18px;
}
.modal-footer .spacer { flex: 1; }
.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.details div { min-width: 0; }
.details dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.details dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }

.status-picker { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.status-picker legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: 14px; }
.status-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.status-option { position: relative; }
.status-option input { position: absolute; opacity: 0; pointer-events: none; }
.status-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.status-option span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.status-option span:hover { border-color: var(--c); }
.status-option input:checked + span { border-color: var(--c); background: var(--bgc); color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.status-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.status-option input:disabled + span { cursor: not-allowed; opacity: .6; }
.status-option.pendiente { --c: var(--pendiente); --bgc: var(--pendiente-bg); }
.status-option.informes { --c: var(--informes); --bgc: var(--informes-bg); }
.status-option.inscrito { --c: var(--inscrito); --bgc: var(--inscrito-bg); }
.status-option.no_interesado { --c: var(--no_interesado); --bgc: var(--no_interesado-bg); }

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eef4fb;
  color: var(--navy);
  font-size: 14px;
}
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.notice.warning { background: var(--pendiente-bg); color: #7c4a03; }
.notice.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Avisos flotantes ---------- */
.toast-stack { position: fixed; top: 84px; right: 20px; z-index: 100; display: grid; gap: 10px; width: min(400px, calc(100% - 32px)); }
.toast {
  display: grid;
  grid-template-columns: 32px 1fr 28px;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease-out;
}
.toast .toast-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; font-weight: 800; }
.toast.success .toast-icon { background: #16a34a; }
.toast.error .toast-icon { background: #dc2626; }
.toast strong { display: block; font-size: 14px; }
.toast p { color: var(--muted); font-size: 14px; }
.toast button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 16px; cursor: pointer; }
.toast.is-hiding { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Importar ---------- */
.upload {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload:hover, .upload.is-dragging { border-color: var(--sky); background: #f0f8fd; }
.upload svg { width: 42px; height: 42px; color: var(--navy); }
.upload strong { font-size: 16px; }
.upload span { color: var(--muted); font-size: 14px; }
.upload input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.columns-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.columns-list code { padding: 3px 8px; border-radius: 6px; background: #e8eef7; color: var(--navy); font-size: 13px; }
.steps { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: var(--muted); }
.steps li::marker { color: var(--navy); font-weight: 700; }

/* ---------- Acceso (login / instalación) ---------- */
.auth-page { justify-content: center; background: radial-gradient(1200px 500px at 50% -10%, #dfe9f6 0%, var(--bg) 60%); }
.auth {
  width: min(440px, calc(100% - 32px));
  margin: 48px auto;
}
.auth-logo { display: block; width: 220px; margin: 0 auto 24px; }
.auth .card-body { padding: 32px; }
.auth h1 { font-size: 24px; color: var(--navy); }
.auth .lead { margin: 6px 0 24px; color: var(--muted); }
.auth form { display: grid; gap: 18px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 14px; }
.auth-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { color: var(--navy); }

.site-footer { padding: 18px 24px; color: var(--faint); font-size: 13px; text-align: center; }

/* ---------- Pantallas medianas y chicas ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats .stat:first-child { grid-column: span 3; }
}
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 0 12px; padding: 10px 16px 0; }
  .topbar-brand span { display: none; }
  .topbar-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding: 8px 0; margin: 0 -4px; scrollbar-width: none; }
  .user-menu { margin-left: auto; }
  .user-menu .user-text { display: none; }
  .page { padding: 24px 16px 48px; }

  /* La tabla se convierte en tarjetas */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { padding: 6px 0; border: 0; }
  .table.responsive td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .table.responsive .actions { text-align: left; padding-top: 10px; }
  .table.responsive tbody tr:hover td { background: transparent; }
  .note-preview { max-width: none; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats .stat:first-child { grid-column: span 2; }
  .stat { padding: 12px 14px 12px 16px; }
  .stat strong { font-size: 24px; }
  .page-header h1 { font-size: 23px; }
  .form-grid.two, .details { grid-template-columns: 1fr; }
  .status-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-header, .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal-footer .btn { flex: 1; }
  .modal-footer .spacer { display: none; }
  .profile { padding: 18px; }
  .auth .card-body { padding: 24px; }
}
