/* ===== LAANTICLASE — CSS GLOBAL (login, header móvil, bottom-nav, cards, perfil) ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono&display=swap');

:root {
  /* Marca (negro) */
  --verde:        #111111;
  --verde-dark:   #000000;
  --verde-mid:    #333333;
  --verde-light:  #ebebeb;
  /* Café tierra */
  --cafe:         #6f5a3e;
  --cafe-dark:    #52412b;
  --cafe-light:   #efe8dc;
  /* Arena / caqui (neutros cálidos) */
  --arena:        #c9bfa6;
  --arena-light:  #f4f1ea;
  /* Estados */
  --ok:           #3f6b3a;   --ok-light:    #e3efe1;
  --warn:         #9a6b1f;   --warn-light:  #f7ecd6;
  --error:        #9c4f3f;   --error-light: #f7e9e4;
  --info:         #4d5f6e;   --info-light:  #e3e9ee;
  /* Grises cálidos */
  --gray-50:  #f4f1ea;  --gray-100: #e7e2d6;  --gray-200: #d3ccbd;
  --gray-400: #8a8577;  --gray-500: #5f5b52;  --gray-900: #1f1d19;
  --white: #ffffff;
  --font: 'DM Sans', sans-serif;  --mono: 'DM Mono', monospace;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* Al apretar con el mouse o el dedo no se dibuja el recuadro de foco del navegador,
   que no combina con el diseno. Con el teclado (Tab) si se muestra: ahi es la unica
   senal de donde esta parado el usuario. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }

html, body {
  font-family: var(--font);
  background: var(--arena-light);
  color: var(--gray-900);
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER MÓVIL (alumno) ===== */
.app-header {
  background: linear-gradient(135deg, var(--verde), var(--verde-mid));
  padding: 14px 18px 20px;
}
.app-header .title { font-size: 18px; font-weight: 600; color: #fff; }
.app-header .subtitle { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.header-row { display: flex; justify-content: space-between; align-items: center; }

.avatar {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
  cursor: pointer; flex-shrink: 0;
}
.avatar.oscuro { background: var(--verde-light); color: var(--verde); }

/* ===== SCREEN CONTAINER (alumno, app.php) ===== */
.screen {
  display: none;
  padding-bottom: 90px;
  min-height: calc(100vh - 140px);
  animation: fadeIn .2s ease;
}
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== BOTTOM NAV (alumno) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  display: flex;
  padding: 8px 0 12px;
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; color: var(--gray-400);
  text-decoration: none;
  transition: color .15s;
  background: none; border: none; font-family: inherit;
}
.nav-item i { font-size: 22px; width: 46px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; transition: background .15s, color .15s; }
.nav-item span { font-size: 10px; font-weight: 500; }
.nav-item.active { color: var(--verde); }
.nav-item.active i { background: var(--verde); color: #fff; }
.nav-item.active span { font-weight: 700; }

/* ===== CLI SIDEBAR (alumno, escritorio) ===== */
.cli-sidebar {
  display: none;
  position: fixed; top: 0; left: 0; bottom: 0; width: 220px;
  background: linear-gradient(180deg, var(--verde), var(--verde-dark));
  flex-direction: column;
  z-index: 200;
}
.cli-sidebar .cli-top { padding: 22px 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.cli-sidebar .cli-eyebrow { font-size: 9px; color: rgba(255,255,255,0.45); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.cli-sidebar .cli-nombre { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; }
.cli-sidebar .cli-curso { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-sidebar .cli-cargo {
  display: inline-block; font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(255,255,255,0.18); padding: 2px 8px; border-radius: 20px; margin-top: 6px;
}
.cli-nav { padding: 10px; flex: 1; overflow-y: auto; }
.cli-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 2px;
  color: rgba(255,255,255,0.7); text-decoration: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.cli-nav-item i { font-size: 17px; width: 20px; text-align: center; }
.cli-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.cli-nav-item.active { background: rgba(255,255,255,0.16); color: #fff; font-weight: 700; }
.cli-bottom { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,0.12); }

/* Franja "viendo como" (banner ancho, usado en el portal del alumno) */
.viendo-como {
  background: linear-gradient(135deg, var(--cafe), var(--cafe-dark));
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.viendo-como-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 20px;
  border: none; cursor: pointer; font-family: var(--font);
  transition: background .15s;
}
.viendo-como-btn:hover { background: rgba(255,255,255,0.34); }

/* Escritorio: sidebar del alumno reemplaza header móvil + bottom-nav */
@media (min-width: 768px) {
  html, body { max-width: 100% !important; margin: 0 !important; overflow-x: hidden; }
  body { background: var(--arena-light); }
  .cli-sidebar { display: flex !important; }
  .app-header { display: none !important; }
  .bottom-nav { display: none !important; }
  .screen { margin-left: 220px; padding: 24px; box-sizing: border-box; min-height: 100vh; }
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
  padding: 14px;
  margin-bottom: 10px;
}
.section-title {
  font-size: 11px; font-weight: 600; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 14px 16px 8px;
}

/* ===== STATUS CARD (alumno, inicio) ===== */
.status-card {
  margin: 14px 14px 0;
  background: rgba(255,255,255,0.13);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}
.status-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.status-dot.ok { background: #7fd68a; }
.status-dot.warn { background: #f2c14e; }
.status-info { flex: 1; }
.status-label { font-size: 11px; color: rgba(255,255,255,0.6); }
.status-val { font-size: 14px; font-weight: 600; color: #fff; }
.status-badge {
  font-size: 10px; background: rgba(255,255,255,0.18);
  color: #fff; padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}

/* ===== LISTAS (notificaciones, documentos, calendario, accesos) ===== */
.notif-list, .doc-list, .link-list, .cal-list { padding: 0 14px; display: flex; flex-direction: column; gap: 8px; }
.notif-item, .doc-item, .link-item, .cal-item {
  background: var(--white); border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
  padding: 12px 13px; display: flex; align-items: center; gap: 11px;
}
.link-item, .doc-item { cursor: pointer; transition: background .15s; }
.link-item:active, .doc-item:active { background: var(--gray-50); }
.notif-icon, .doc-icon, .link-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.notif-body, .doc-body, .link-body { flex: 1; min-width: 0; }
.notif-title, .doc-title, .link-title { font-size: 13px; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-sub, .doc-meta, .link-req { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.notif-time { font-size: 10px; color: var(--gray-200); flex-shrink: 0; }
.doc-dl, .link-arr { font-size: 18px; color: var(--verde); cursor: pointer; flex-shrink: 0; }
.badge-new {
  background: var(--verde); color: #fff;
  font-size: 9px; padding: 2px 6px; border-radius: 8px; margin-left: 5px;
}

/* ===== QUICK GRID (accesos rápidos) ===== */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 14px; }
.quick-item {
  background: var(--white); border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
  padding: 13px 12px; cursor: pointer; transition: background .15s;
}
.quick-item:active { background: var(--gray-50); }
.quick-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 9px;
}
.quick-label { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.quick-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ===== FILTER CHIPS ===== */
.chip-row {
  display: flex; gap: 7px; padding: 10px 14px 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  font-weight: 500; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--gray-100); background: var(--white);
  color: var(--gray-500); transition: all .15s;
}
.chip.active { background: var(--verde); color: #fff; border-color: var(--verde); }

/* ===== CALENDARIO ===== */
.cal-date {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--verde-light); color: var(--verde);
}
.cal-day { font-size: 18px; font-weight: 700; line-height: 1; }
.cal-month { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cal-body { flex: 1; }
.cal-title { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.cal-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ===== MODAL (uso puntual, no confirm/alert) ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: flex-end; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: 24px 24px 0 0;
  padding: 24px 20px 36px; width: 100%; max-width: 430px;
}

/* ===== SHEET (hoja deslizante inferior) ===== */
.sheet-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 300;
  align-items: flex-end; justify-content: center;
}
.sheet-overlay.show { display: flex; }
.sheet {
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 8px 0 24px; width: 100%; max-width: 430px;
  max-height: 85vh; overflow-y: auto;
}
.sheet-handle { width: 36px; height: 4px; background: var(--gray-200); border-radius: 2px; margin: 6px auto 10px; }

/* ===== LOGIN ===== */
.login-screen { min-height: 100vh; background: var(--verde); display: flex; flex-direction: column; }
.login-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 28px; }
.login-logo-img { width: 100%; max-width: 190px; height: auto; margin-bottom: 8px; }
.login-logo-chico { max-width: 120px; margin-bottom: 14px; }
.login-name { font-size: 20px; font-weight: 600; color: #fff; text-align: center; }
.login-sub { font-size: 12px; color: rgba(255,255,255,0.65); text-align: center; margin-top: 4px; }
.login-sheet { background: var(--arena-light); border-radius: 28px 28px 0 0; padding: 28px 20px 40px; }
.login-badge { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 22px; }
.login-badge span {
  font-size: 11px; color: var(--verde); font-weight: 600;
  background: var(--verde-light); padding: 4px 11px; border-radius: 20px;
}
.field-wrap { margin-bottom: 14px; }
.field-label { display: block; font-size: 11px; font-weight: 600; color: var(--gray-400); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .03em; }
.field-inner { position: relative; }
.field-inner i.lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--gray-400); pointer-events: none; }
.field-inner input {
  width: 100%; height: 50px; border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-md); padding: 0 44px 0 42px;
  font-size: 15px; color: var(--gray-900); background: var(--white);
  outline: none; font-family: var(--font);
  transition: border-color .15s;
}
.field-inner input:focus { border-color: var(--verde); }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  font-size: 18px; display: flex; align-items: center; padding: 4px;
}
.help-text { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.btn-login {
  width: 100%; height: 52px; background: var(--verde); color: #fff;
  border: none; border-radius: var(--radius-md); font-size: 16px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px; font-family: var(--font);
  transition: background .15s, transform .1s;
}
.btn-login:active { background: var(--verde-dark); transform: scale(0.98); }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 18px; }
.login-footer span { font-size: 11px; color: var(--gray-400); }
.error-box {
  background: var(--error-light); border-radius: 10px;
  padding: 10px 13px; font-size: 13px; color: var(--error);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}

/* Split-screen escritorio (>=900px) */
.desk-brand { display: none; }
@media (min-width: 900px) {
  html, body { overflow: auto !important; max-width: none !important; width: 100% !important; margin: 0 !important; }
  .login-screen { height: 100vh !important; flex-direction: row !important; max-width: none !important; width: 100% !important; margin: 0 !important; }
  .desk-brand {
    display: flex !important; flex-direction: column; justify-content: center; align-items: center;
    flex: 1 !important; background: linear-gradient(150deg, var(--verde), var(--verde-mid));
    color: #fff; padding: 40px; text-align: center;
  }
  .desk-brand .desk-logo-img { width: 100%; max-width: 260px; height: auto; margin-bottom: 20px; }
  .desk-brand p { font-size: 15px; opacity: 0.85; margin: 0; max-width: 340px; line-height: 1.6; }
  .desk-feats { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
  .desk-feat { display: flex; align-items: center; gap: 10px; font-size: 14px; opacity: 0.92; }
  .desk-feat i { font-size: 20px; }
  .login-screen > .login-top { display: none; }
  .login-sheet {
    flex: 0 0 460px !important; max-width: 460px !important; width: 460px !important;
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 56px !important; background: var(--arena-light); overflow-y: auto; margin: 0 !important;
    border-radius: 0 !important;
  }
  .desk-form-title { display: block; font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; text-align: center; }
  .desk-form-sub { display: block; font-size: 13px; color: var(--gray-400); margin-bottom: 24px; text-align: center; }
}
@media (max-width: 899px) { .desk-form-title, .desk-form-sub { display: none; } }

/* ===== PERFIL ===== */
.profile-header { background: var(--verde); padding: 20px 18px 28px; text-align: center; }
.profile-avatar {
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,0.2); margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
}
.profile-name { font-size: 17px; font-weight: 600; color: #fff; }
.profile-id { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 3px; }
.info-row { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--gray-100); }
.info-row:last-child { border-bottom: none; }
.info-row i { font-size: 18px; color: var(--verde); width: 22px; flex-shrink: 0; }
.info-label { font-size: 11px; color: var(--gray-400); }
.info-val { font-size: 13px; font-weight: 500; color: var(--gray-900); margin-top: 1px; }
.logout-btn {
  margin: 16px 14px 0; width: calc(100% - 28px); height: 48px;
  background: var(--error-light); color: var(--error); border: none;
  border-radius: var(--radius-md); font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: var(--font); display: flex;
  align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}

/* ===== BOTONES, BADGES, TABLA, KPI, PROGRESO ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  border: none; cursor: pointer; text-decoration: none; transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn-primario { background: var(--verde); color: #fff; }
.btn-secundario { background: var(--gray-100); color: var(--gray-900); }
.btn-peligro { background: var(--error-light); color: var(--error); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}

.tabla { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-md); overflow: hidden; }
.tabla th {
  background: var(--gray-50); color: var(--gray-500); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 14px;
}
.tabla td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--gray-100); }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: var(--gray-50); }

.kpi { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-md); padding: 14px; }
.kpi-label { font-size: 11px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .04em; }
.kpi-val { font-size: 22px; font-weight: 700; color: var(--gray-900); font-family: var(--mono); margin-top: 4px; }

.progress { height: 8px; border-radius: 20px; background: var(--gray-100); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--verde); border-radius: 20px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state i { font-size: 40px; color: var(--gray-200); margin-bottom: 10px; display: block; }
.empty-state p { font-size: 13px; }

/* ===== COLORES ===== */
.bg-verde { background: var(--verde-light); color: var(--verde); }
.bg-cafe { background: var(--cafe-light); color: var(--cafe); }
.bg-ok { background: var(--ok-light); color: var(--ok); }
.bg-warn { background: var(--warn-light); color: var(--warn); }
.bg-error { background: var(--error-light); color: var(--error); }
.bg-info { background: var(--info-light); color: var(--info); }

/* ===== UTILIDADES ===== */
.mobile-only { display: block; }
.desktop-only { display: none; }
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: block !important; }
}

/* En escritorio las listas ya tienen el padding del wrapper, no se suma el del móvil */
@media (min-width: 768px) {
  .screen .notif-list, .screen .doc-list, .screen .link-list,
  .screen .chip-row, .screen .section-title, .screen .quick-grid,
  .screen .cal-list, .screen .clase-lista { padding-left: 0; padding-right: 0; }
}

/* ===== CLASES (alumno) ===== */
.clase-lista { padding: 0 14px; display: flex; flex-direction: column; gap: 10px; }
.clase-item {
  display: flex; gap: 12px; background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius-md); padding: 10px; cursor: pointer;
}
.clase-item:active { background: var(--gray-50); }
.clase-item.actual { border-color: var(--verde); border-width: 2px; }
.clase-item-thumb {
  width: 88px; height: 66px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--arena-light); display: flex; align-items: center; justify-content: center;
  color: var(--gray-200); font-size: 22px;
}
.clase-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.clase-item-body { flex: 1; min-width: 0; }
.clase-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clase-item-num { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--gray-400); letter-spacing: .04em; }
.clase-item-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; background: var(--verde); color: #fff; padding: 2px 7px; border-radius: 20px; }
.clase-item-titulo { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-top: 1px; }
.clase-item-meta { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.clase-item-meta span { font-size: 10px; color: var(--gray-400); display: flex; align-items: center; gap: 3px; }
.clase-item-estado { margin-top: 6px; }
.clase-item-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.clase-item-pill.no-vista { background: var(--gray-100); color: var(--gray-500); }
.clase-item-pill.completada { background: var(--ok-light); color: var(--ok); }
.clase-item-progreso { display: flex; align-items: center; gap: 8px; }
.clase-item-progreso .progress { flex: 1; }
.clase-item-progreso-texto { font-size: 10px; color: var(--gray-400); font-weight: 600; white-space: nowrap; }

/* ===== VISOR DE CLASE (alumno) ===== */
.cv-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400;
  align-items: center; justify-content: center;
}
.cv-overlay.show { display: flex; }
.cv-caja { background: #000; width: 100%; height: 100%; display: flex; flex-direction: column; }
.cv-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; color: #fff; }
.cv-titulo { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-cerrar {
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 34px; height: 34px;
  border-radius: 50%; font-size: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cv-imagen-wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cv-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cv-zona { position: absolute; top: 0; bottom: 0; width: 35%; }
.cv-zona-izq { left: 0; }
.cv-zona-der { right: 0; }
.cv-pie { padding: 12px 16px 18px; background: rgba(0,0,0,.55); flex-shrink: 0; }
.cv-progreso { margin-bottom: 10px; }
.cv-controles { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.cv-contador { color: #fff; font-family: var(--mono); font-size: 13px; }
.cv-acciones { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.cv-video-btn {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5;
  display: none; align-items: center; gap: 8px; background: rgba(20,20,20,.8); color: #fff;
  border: none; padding: 11px 18px; border-radius: 30px; font-family: var(--font); font-size: 13px;
  font-weight: 600; cursor: pointer;
}
.cv-video-btn.show { display: flex; }
.cv-video-btn i { font-size: 18px; color: var(--verde-light); }

.cv-audio-btn {
  position: absolute; right: 14px; bottom: 14px; z-index: 5;
  display: none; align-items: center; justify-content: center; background: rgba(20,20,20,.75);
  color: #fff; border: none; width: 38px; height: 38px; border-radius: 50%; font-size: 17px; cursor: pointer;
}
.cv-audio-btn.show { display: flex; }
.cv-audio-btn.pausado { color: var(--gray-200); }

.cv-video-lightbox {
  display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
}
.cv-video-lightbox.show { display: flex; }
.cv-video-lightbox video { max-width: 92vw; max-height: 82vh; background: #000; }
.cv-video-cerrar {
  position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.15); border: none;
  color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 17px; cursor: pointer;
}

@media (min-width: 768px) {
  .cv-caja { width: min(880px, 92vw); height: min(85vh, 700px); border-radius: var(--radius-lg); overflow: hidden; }
}

/* ===== PWA: invitación a instalar ===== */
.pwa-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  display: flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 8px 12px;
  background: var(--verde); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
}
.pwa-banner[hidden] { display: none; }
.pwa-banner > i { font-size: 18px; flex-shrink: 0; opacity: .9; }
.pwa-banner-txt { flex: 1; line-height: 1.35; }
.pwa-banner-btn {
  flex-shrink: 0; background: #fff; color: var(--verde);
  border: none; border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
}
.pwa-banner-btn:active { transform: scale(0.97); }
.pwa-banner-x {
  flex-shrink: 0; background: none; border: none; color: rgba(255,255,255,0.65);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}

/* El banner es fijo: se le hace sitio empujando el contenido hacia abajo. */
/* En pantalla ancha el texto y el boton se agrupan al centro; la X queda al borde. */
@media (min-width: 900px) {
  .pwa-banner { justify-content: center; }
  .pwa-banner-txt { flex: 0 1 auto; }
  .pwa-banner-x { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
}

body.con-pwa-banner { padding-top: 46px; }
body.con-pwa-banner .login-screen { min-height: calc(100vh - 46px); }
@media (min-width: 900px) {
  body.con-pwa-banner .login-screen { height: calc(100vh - 46px) !important; }
}

/* Tarjeta con los pasos manuales de iOS (Safari no permite instalar por código) */
.pwa-ios { position: fixed; inset: 0; z-index: 500; }
.pwa-ios[hidden] { display: none; }
.pwa-ios-fondo { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.pwa-ios-card {
  position: absolute; left: 14px; right: 14px; bottom: 18px;
  background: var(--white); border-radius: var(--radius-lg);
  padding: 18px 18px 14px; max-width: 402px; margin: 0 auto;
}
.pwa-ios-x {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 24px; line-height: 1;
  color: var(--gray-400); cursor: pointer;
}
.pwa-ios-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pwa-ios-top img { width: 46px; height: 46px; border-radius: 11px; }
.pwa-ios-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.pwa-ios-sub { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.pwa-ios-pasos { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pwa-ios-pasos li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--gray-900); }
.pwa-ios-pasos i { font-size: 16px; color: var(--verde-mid); }
.pwa-ios-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--verde-light); color: var(--verde);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.pwa-ios-flecha {
  text-align: center; font-size: 18px; color: var(--verde-mid);
  margin-top: 10px; animation: pwa-rebote 1.4s ease-in-out infinite;
}
@keyframes pwa-rebote { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
