/* assets/css/main.css - EduAdmin Colombia */
@import url('_tokens.css');

/* ====== RESET ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }

/* ====== TOPBAR ====== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-context-form select {
  max-width: 190px;
  padding: 7px 10px;
  border: 1px solid var(--border, #dbe5f2);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text, #17324d);
}
.topbar-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e3a5f;
  font-size: 12px;
  font-weight: 600;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sidebar-toggle {
  background: none; border: none; font-size: 20px;
  color: var(--text-light); padding: 6px; border-radius: 6px;
}
.sidebar-toggle:hover { background: var(--bg); }
.topbar-logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.topbar-logo span { font-size: 26px; }
.topbar-logo strong { display: block; font-size: 15px; line-height: 1.2; }
.topbar-logo small { font-size: 11px; color: var(--text-light); }
.topbar-logo-img { width: 40px !important; height: 40px !important; max-width: 40px !important; max-height: 40px !important; object-fit: contain; border-radius: 6px; display: block; }
.topbar-btn {
  position: relative; background: none; border: none;
  font-size: 18px; color: var(--text-light);
  padding: 6px 8px; border-radius: 6px;
}
.topbar-btn:hover { background: var(--bg); }
.badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--white);
}
.topbar-notifications { position: relative; }
.notifications-panel {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, calc(100vw - 24px));
  max-height: 74vh;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  z-index: 360;
}
.topbar-notifications.open .notifications-panel { display: block; }
.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-bottom: 1px solid #e2e8f0;
}
.notifications-head strong { display: block; font-size: 15px; color: #0f172a; }
.notifications-head small { display: block; margin-top: 2px; font-size: 12px; color: #64748b; }
.notif-mark-all {
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.notif-mark-all:hover { background: #1e40af; }
.notifications-list {
  max-height: calc(74vh - 68px);
  overflow-y: auto;
  padding: 10px;
  display: grid;
  gap: 9px;
}
.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 26px 16px;
  color: #64748b;
  text-align: center;
}
.notifications-empty i { font-size: 26px; color: #94a3b8; }
.notification-mini {
  display: flex;
  gap: 11px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 17px;
  background: #fff;
}
.notification-mini.unread {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 78%);
}
.notification-mini-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notification-mini-body { min-width: 0; flex: 1; }
.notification-mini-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.notification-mini-title strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
}
.notification-mini-title span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 900;
}
.notification-mini p {
  margin: 5px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}
.notification-mini small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
}
.notification-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.notification-mini-actions a,
.notification-mini-actions button {
  border: 0;
  border-radius: 999px;
  padding: 6px 9px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.notification-mini-actions a { background: #e0f2fe; color: #075985; }
.notification-mini-actions button { background: #dcfce7; color: #166534; }
.topbar-user {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
}
.topbar-user:hover { background: var(--bg); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info strong { display: block; font-size: 13px; line-height: 1.3; }
.user-info small  { font-size: 11px; color: var(--text-light); }
.user-dropdown {
  display: none; position: absolute; top: 110%; right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 180px;
  box-shadow: var(--card-shadow); z-index: 300; overflow: hidden;
}
.user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text); font-size: 13px;
}
.user-dropdown a:hover { background: var(--bg); text-decoration: none; }
.topbar-user.open .user-dropdown { display: block; }

/* ====== SIDEBAR ====== */
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 100;
  transition: transform .25s;
}
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar-nav { padding: 12px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 8px;
  color: var(--text); font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg); text-decoration: none; }
.nav-item.active { background: #eff6ff; color: var(--primary); font-weight: 700; }
.nav-item i { width: 18px; text-align: center; color: var(--text-light); }
.nav-item.active i { color: var(--primary); }

/* Grupos colapsables */
.nav-group { margin-bottom: 2px; }
.nav-group-header {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 8px; border: none;
  background: none; font-size: 13.5px; font-weight: 500;
  color: var(--text); text-align: left;
}
.nav-group-header:hover { background: var(--bg); }
.nav-group-header i:first-child { width: 18px; text-align: center; color: var(--text-light); }
.nav-group-header span { flex: 1; }
.nav-arrow { font-size: 11px; color: var(--text-light); transition: transform .2s; }
.nav-group.open .nav-arrow { transform: rotate(90deg); }
.nav-group-body { display: none; padding-left: 36px; }
.nav-group.open .nav-group-body { display: block; }
.nav-subitem {
  display: block; padding: 7px 12px; border-radius: 6px;
  font-size: 13px; color: var(--text-light); margin-bottom: 1px;
}
.nav-subitem:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-subitem.active { color: var(--primary); font-weight: 600; background: #eff6ff; }

/* ====== MAIN CONTENT ====== */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 16px 20px 24px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left .25s;
}

.main-content:has(.page-header) {
  padding-top: 12px;
}
.main-content.full { margin-left: 0; }
.container { max-width: 1280px; margin: 0 auto; }

/* Login / auth: ver assets/css/auth.css */

/* ====== FORMULARIOS ====== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: var(--font);
  background: var(--white); color: var(--text);
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .col-full { grid-column: 1 / -1; }

/* ====== FILTROS DE BUSQUEDA (GET) ====== */
form.form-grid[method="GET"],
form.form-grid[method="get"] {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  gap: 8px 12px;
  align-items: end;
  justify-content: flex-start;
}

form.form-grid[method="GET"] .form-group,
form.form-grid[method="get"] .form-group {
  margin-bottom: 0;
  width: fit-content;
  min-width: 140px;
}

form.form-grid[method="GET"] .form-group label,
form.form-grid[method="get"] .form-group label {
  white-space: nowrap;
}

form.form-grid[method="GET"] .form-group input,
form.form-grid[method="GET"] .form-group select,
form.form-grid[method="get"] .form-group input,
form.form-grid[method="get"] .form-group select {
  width: auto;
  min-width: 130px;
  max-width: 260px;
}

form[method="GET"] select,
form[method="GET"] input:not([type="hidden"]),
form[method="get"] select,
form[method="get"] input:not([type="hidden"]) {
  width: auto;
  min-width: 130px;
  max-width: 320px;
}

/* ====== BOTONES ====== */
.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 8px; border: none;
  font-size: 13.5px; font-weight: 600; transition: background .15s, transform .1s;
}
.btn-primary  { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary{ background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger   { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #991b1b; }
.btn-success  { background: var(--success); color: var(--white); }
.btn-success:hover { background: #065f46; }
.btn-warning  { background: var(--warning); color: var(--white); }
.btn-sm       { padding: 5px 12px; font-size: 12px; }
.btn-full     { width: 100%; justify-content: center; }

/* ====== CARDS ====== */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--card-shadow); border: 1px solid var(--border);
  padding: 24px; margin-bottom: 20px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--text); }

/* ====== STATS ====== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--card-shadow); border: 1px solid var(--border);
  padding: 20px 18px; text-align: center;
  border-top: 4px solid var(--primary);
}
.stat-card.verde  { border-top-color: var(--success); }
.stat-card.rojo   { border-top-color: var(--danger);  }
.stat-card.naranja{ border-top-color: var(--warning); }
.stat-icon { font-size: 30px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ====== TABLA ====== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { background: #f8fafc; }
th {
  padding: 10px 14px; text-align: left; font-size: 11px;
  font-weight: 700; color: var(--text-light); text-transform: uppercase;
  letter-spacing: .5px; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
th.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 26px;
  transition: color .18s, background .18s;
}
th.sortable-th:hover {
  color: var(--primary);
  background: #eef4ff;
}
th.sortable-th::after {
  content: '↕';
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #94a3b8;
}
th.sortable-th.sorted-asc,
th.sortable-th.sorted-desc {
  color: var(--primary);
  background: #eff6ff;
}
th.sortable-th.sorted-asc::after {
  content: '↑';
  color: var(--primary);
}
th.sortable-th.sorted-desc::after {
  content: '↓';
  color: var(--primary);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
.td-bold { font-weight: 600; color: var(--text); }

/* ====== BADGES ====== */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #64748b; }

/* ====== ALERTAS ====== */
.alert {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 18px;
  font-size: 13.5px; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ====== PAGE HEADER ====== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 20px 22px 20px 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, #6366f1 100%);
  border-radius: 18px 0 0 18px;
}

.page-header > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
}

.page-header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.page-header-nav .breadcrumb {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.page-header .btn-back,
.page-header-back {
  margin: 0;
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.page-header .btn-back:hover,
.page-header-back:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.container > .btn-back {
  margin-bottom: 12px;
}

/* El botón Volver se integra en .page-header vía main.js — no reservar fila aparte */
.container:has(.page-header) > .btn-back {
  display: none;
}

.page-header > .btn-primary,
.page-header > .btn-secondary,
.page-header > .btn,
.page-header > a.btn-primary,
.page-header > a.btn-secondary,
.page-header > button:not(.btn-back),
.page-header > .page-header-actions,
.page-header > [class*="-header-actions"],
.page-header > div:not(:first-child) {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-header-actions,
[class*="-header-actions"] {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

.breadcrumb a {
  color: var(--text-light);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.breadcrumb a:hover {
  color: var(--primary);
  background: #eff6ff;
  text-decoration: none;
}

.breadcrumb span {
  margin: 0 2px;
  opacity: 0.45;
  font-size: 10px;
  line-height: 1;
}

.page-title {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-title i {
  color: var(--primary);
  margin-right: 8px;
  font-size: 0.92em;
  vertical-align: -1px;
}

.page-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55;
  margin: 0;
  max-width: 760px;
}

.page-desc a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-desc a:hover {
  color: var(--primary-dk);
}

.page-header .btn-primary,
.page-header .btn-secondary,
.page-header .btn {
  white-space: nowrap;
}

.page-header-compact {
  padding: 16px 18px 16px 22px;
}

.page-header-compact .page-title {
  font-size: 20px;
  margin-bottom: 4px;
}

.page-header-compact .page-desc {
  font-size: 12px;
}

.page-header-compact .breadcrumb {
  margin-bottom: 6px;
}

/* ====== BOTON VOLVER ====== */
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: all 0.2s;
}
.btn-back:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-back i { font-size: 12px; }

/* ====== BUSCADOR ====== */
.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--white);
}
.search-box input { border: none; outline: none; font-size: 13px; background: transparent; min-width: 200px; }
.search-box i { color: var(--text-light); }

/* ====== UPLOAD ZONE ====== */
.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 36px; text-align: center; cursor: pointer;
  transition: border-color .2s;
}
.upload-zone:hover { border-color: var(--primary); }
.upload-zone i { font-size: 36px; color: var(--text-light); display: block; margin-bottom: 12px; }
.upload-zone p { color: var(--text-light); font-size: 13px; }

/* ====== PAGINACIÓN ====== */
.paginacion { display: flex; gap: 6px; margin-top: 20px; justify-content: center; }
.pag-btn {
  padding: 6px 12px; border-radius: 6px; font-size: 13px;
  border: 1px solid var(--border); color: var(--text); background: var(--white);
}
.pag-btn:hover { background: var(--bg); text-decoration: none; }
.pag-btn.activo { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ====== RECIBO ====== */
.recibo {
  max-width: 520px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  font-family: 'Courier New', monospace;
}
.recibo-header { background: var(--primary); color: var(--white); padding: 20px; text-align: center; }
.recibo-header h2 { font-size: 16px; }
.recibo-header p  { font-size: 12px; margin-top: 4px; opacity: .85; }
.recibo-body { padding: 20px; }
.recibo-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.recibo-row:last-child { border-bottom: none; }
.recibo-row .label { color: var(--text-light); }
.recibo-row .valor { font-weight: 600; }
.recibo-total {
  background: #f8fafc; padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.recibo-total .etiqueta { font-weight: 700; font-size: 14px; }
.recibo-total .monto    { font-weight: 800; font-size: 20px; color: var(--primary); }

/* ====== FOOTER ====== */
.app-footer {
  text-align: center; padding: 16px;
  font-size: 12px; color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-left: var(--sidebar-w);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .app-footer { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  form.form-grid[method="GET"],
  form.form-grid[method="get"] { grid-template-columns: 1fr; }
  form.form-grid[method="GET"] .form-group,
  form.form-grid[method="get"] .form-group { width: 100%; min-width: 0; }
  form.form-grid[method="GET"] .form-group input,
  form.form-grid[method="GET"] .form-group select,
  form.form-grid[method="get"] .form-group input,
  form.form-grid[method="get"] .form-group select { width: 100%; max-width: none; }
  form[method="GET"] select,
  form[method="GET"] input:not([type="hidden"]),
  form[method="get"] select,
  form[method="get"] input:not([type="hidden"]) { width: 100%; max-width: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 16px 16px 20px;
    border-radius: 16px;
  }
  .page-header > .btn-primary,
  .page-header > .btn-secondary,
  .page-header > .btn,
  .page-header > a.btn-primary,
  .page-header > a.btn-secondary,
  .page-header > button:not(.btn-back),
  .page-header > .page-header-actions,
  .page-header > [class*="-header-actions"],
  .page-header > div:not(:first-child) {
    align-self: stretch;
    width: 100%;
    justify-content: stretch;
  }
  .page-header > .btn-primary,
  .page-header > .btn-secondary,
  .page-header > .btn,
  .page-header > a.btn-primary,
  .page-header > a.btn-secondary {
    justify-content: center;
  }
  .page-header-actions,
  [class*="-header-actions"] {
    width: 100%;
  }
  .page-header-actions .btn-primary,
  .page-header-actions .btn-secondary,
  [class*="-header-actions"] .btn-primary,
  [class*="-header-actions"] .btn-secondary,
  [class*="-header-actions"] a.btn-primary {
    flex: 1 1 auto;
    justify-content: center;
  }
  .btn-back { width: 100%; justify-content: center; }
  .topbar-logo strong { display: none; }
  .topbar-logo-img { width: 32px !important; height: 32px !important; max-width: 32px !important; max-height: 32px !important; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .user-info { display: none; }
  .topbar-logo-img { width: 28px !important; height: 28px !important; max-width: 28px !important; max-height: 28px !important; }
}

/* ====== PRINT ====== */
@media print {
  .topbar, .sidebar, .app-footer, .btn-primary, .btn-secondary { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .recibo { border: 1px solid #000; }
}

/* ====== TEMA NAVEGACIÓN EDUADMIN ====== */
:root {
  --sidebar-w: 268px;
  --nav-bg: #ffffff;
  --nav-border: #e2e8f0;
  --nav-section: #64748b;
  --nav-text: #334155;
  --nav-text-soft: #64748b;
  --nav-hover: #f1f5f9;
  --nav-active-bg: #eff6ff;
  --nav-active-text: #1e40af;
  --nav-accent: #2563eb;
  --nav-accent-soft: #dbeafe;
  --nav-icon-bg: #f8fafc;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
}

.topbar-logo {
  padding: 6px 10px;
  border-radius: 12px;
  transition: background .2s ease;
}

.topbar-logo:hover {
  background: var(--nav-hover);
  text-decoration: none;
}

.topbar-logo strong { color: #0f172a; }
.topbar-logo small { color: #64748b; }

.sidebar {
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  box-shadow: 4px 0 24px rgba(15, 23, 42, .05);
}

.sidebar-nav {
  padding: 14px 0 28px;
}

.nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 16px 6px;
  padding: 0 4px;
  color: var(--nav-section);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-section-title:first-child {
  margin-top: 6px;
}

.nav-section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--nav-accent);
  box-shadow: 0 0 0 3px var(--nav-accent-soft);
  flex-shrink: 0;
}

.nav-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #e2e8f0, transparent);
}

.nav-item,
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  margin: 0 10px 3px;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.nav-item i,
.nav-group-header i:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--nav-icon-bg);
  color: #64748b;
  font-size: 13px;
  transition: background .18s ease, color .18s ease;
}

.nav-item span,
.nav-group-header span,
.nav-subitem span {
  color: inherit;
  line-height: 1.3;
}

.nav-group-header span {
  flex: 1;
  text-align: left;
}

.nav-arrow {
  font-size: 10px;
  color: #94a3b8;
  transition: transform .2s ease, color .18s ease;
}

.nav-item:hover,
.nav-group-header:hover {
  background: var(--nav-hover);
  transform: none;
  box-shadow: none;
}

.nav-item:hover i,
.nav-group-header:hover i:first-child {
  background: #eef2ff;
  color: var(--nav-accent);
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  box-shadow: inset 3px 0 0 var(--nav-accent);
}

.nav-item.active i {
  background: var(--nav-accent-soft);
  color: var(--nav-accent);
}

.nav-group.open .nav-group-header {
  background: #f8fafc;
  color: var(--nav-active-text);
  box-shadow: inset 3px 0 0 #93c5fd;
}

.nav-group.open .nav-group-header i:first-child {
  background: var(--nav-accent-soft);
  color: var(--nav-accent);
}

.nav-group.open .nav-arrow {
  transform: rotate(90deg);
  color: var(--nav-accent);
}

.nav-group-body {
  display: none;
  margin: 2px 10px 10px 24px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid #e2e8f0;
}

.nav-group.open .nav-group-body {
  display: block;
}

.nav-subtitle {
  margin: 10px 0 4px;
  padding: 0 8px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 2px 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--nav-text-soft);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav-subitem i {
  width: 18px;
  min-width: 18px;
  height: auto;
  background: transparent !important;
  font-size: 12px;
  color: #94a3b8;
}

.nav-subitem:hover {
  background: var(--nav-hover);
  border-color: transparent;
  color: var(--nav-text);
  box-shadow: none;
}

.nav-subitem:hover i {
  color: var(--nav-accent);
}

.nav-subitem.active {
  background: var(--nav-active-bg);
  border-color: #bfdbfe;
  color: var(--nav-active-text);
  font-weight: 700;
}

.nav-subitem.active i {
  color: var(--nav-accent);
}

.nav-group:nth-of-type(4n + 1) .nav-group-header i:first-child { color: #2563eb; background: #eff6ff; }
.nav-group:nth-of-type(4n + 2) .nav-group-header i:first-child { color: #059669; background: #ecfdf5; }
.nav-group:nth-of-type(4n + 3) .nav-group-header i:first-child { color: #d97706; background: #fffbeb; }
.nav-group:nth-of-type(4n + 4) .nav-group-header i:first-child { color: #db2777; background: #fdf2f8; }

.nav-group:nth-of-type(4n + 1) .nav-subitem.active i { color: #2563eb; }
.nav-group:nth-of-type(4n + 2) .nav-subitem.active i { color: #059669; }
.nav-group:nth-of-type(4n + 3) .nav-subitem.active i { color: #d97706; }
.nav-group:nth-of-type(4n + 4) .nav-subitem.active i { color: #db2777; }

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #ffffff;
}

.main-content {
  margin-left: var(--sidebar-w);
}

.app-footer {
  margin-left: var(--sidebar-w);
}

.main-content.full,
.app-footer.full {
  margin-left: 0;
}

@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }
  .sidebar {
    width: min(var(--sidebar-w), 86vw);
    box-shadow: 8px 0 32px rgba(15, 23, 42, .12);
  }
  .main-content,
  .app-footer { margin-left: 0; }
}

/* ====== MODAL VER COMO ====== */
.vc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  backdrop-filter: blur(2px);
}
.vc-modal-backdrop.open { display: flex; }
.vc-modal {
  width: min(760px, 100%);
  max-height: min(90vh, calc(100dvh - 32px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f8fbff);
  flex-shrink: 0;
}
.vc-modal-head-text {
  flex: 1;
  min-width: 0;
}
.vc-modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f2744;
}
.vc-modal-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.45;
}
.vc-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.vc-modal-close:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}
.vc-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  flex-shrink: 0;
}
.vc-modal-toolbar .vc-search {
  flex: 1 1 220px;
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.vc-modal-toolbar .vc-stats {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-light);
}
.vc-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 20px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}
.vc-modal-loading,
.vc-modal-error,
.vc-modal-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}
.vc-modal-error { color: var(--danger); }
.vc-modal-body .vc-role {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.vc-modal-body .vc-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.vc-modal-body .vc-role-head > div:first-child {
  flex: 1;
  min-width: 0;
}
.vc-modal-body .vc-role-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.vc-modal-body .vc-role-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}
.vc-modal-body .vc-role-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.vc-modal-body .vc-users {
  display: flex;
  flex-direction: column;
}
.vc-modal-body .vc-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.vc-modal-body .vc-user:last-child { border-bottom: 0; }
.vc-modal-body .vc-user-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.vc-modal-body .vc-user-text {
  flex: 1;
  min-width: 0;
}
.vc-modal-body .vc-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.vc-modal-body .vc-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vc-modal-body .vc-user-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}
.vc-modal-body .vc-user-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.35;
  word-break: break-word;
}
.vc-modal-body .vc-user [data-vc-start] {
  white-space: nowrap;
  flex-shrink: 0;
}
.vc-modal-body .vc-empty-role {
  padding: 14px 16px;
  color: var(--text-light);
  font-size: 13px;
  font-style: italic;
}
.vc-hidden { display: none !important; }

@media (max-width: 560px) {
  .vc-modal-backdrop { padding: 8px; }
  .vc-modal {
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .vc-modal-head,
  .vc-modal-toolbar,
  .vc-modal-body { padding-left: 14px; padding-right: 14px; }
  .vc-modal-body .vc-user {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .vc-modal-body .vc-user [data-vc-start] {
    width: 100%;
    justify-content: center;
  }
}

/* Dashboard hero — fallback en main.css (siempre cargado) */
.db-hero {
  color: #fff;
  background: linear-gradient(135deg, #1440a8 0%, #1e3a8a 100%);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary-dk, #1440a8) 82%, #0f172a) 0%,
    color-mix(in srgb, var(--primary, #1a56db) 48%, #1e3a8a) 100%
  );
}
