/* ============================================================
 *  CAMPUS SIPLG · Hoja de estilos
 * ============================================================ */

:root {
  --navy:        #1f5fa8;
  --navy-dark:   #16467c;
  --navy-soft:   #e8f0fa;
  --green:       #2f9e44;
  --green-soft:  #e7f6ec;
  --amber:       #b9770e;
  --amber-soft:  #fcf2dd;
  --red:         #c0392b;
  --red-soft:    #fbeae8;

  --bg:          #f4f6fa;
  --card:        #ffffff;
  --text:        #1a2230;
  --muted:       #5b6675;
  --hint:        #8a93a3;
  --border:      #e2e8f0;
  --border-2:    #cdd6e4;

  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 1px 3px rgba(20,40,80,.06), 0 1px 2px rgba(20,40,80,.04);
  --shadow-lg:   0 8px 28px rgba(20,40,80,.10);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.hamburger { background: none; border: 1px solid var(--border); border-radius: var(--radius); width: 38px; height: 38px; cursor: pointer; color: var(--navy); font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hamburger:hover { background: var(--bg); }
.brand { display: flex; align-items: center; gap: 11px; }

/* Panel lateral deslizable */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 264px; background: var(--navy); color: #fff; transform: translateX(-100%); transition: transform .25s ease; z-index: 100; display: flex; flex-direction: column; padding: 18px 14px; }
.sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
.sidebar-head { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 12px; }
.sidebar-logo { width: 42px; height: 42px; border-radius: var(--radius); background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.sidebar-head b { display: block; font-size: 1rem; font-weight: 700; }
.sidebar-head span { font-size: .76rem; color: rgba(255,255,255,.72); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a { display: flex; align-items: center; gap: 13px; color: #fff; text-decoration: none; padding: 11px 12px; border-radius: var(--radius); font-weight: 600; font-size: .92rem; }
.sidebar-nav a i { width: 20px; text-align: center; opacity: .9; }
.sidebar-nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; font-size: .74rem; color: rgba(255,255,255,.6); border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(15,30,60,.45); opacity: 0; visibility: hidden; transition: .25s; z-index: 90; }
.sidebar-overlay.show { opacity: 1; visibility: visible; }

/* Calendario */
.cal-list { display: flex; flex-direction: column; gap: 8px; }
.cal-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); text-decoration: none; color: inherit; }
.cal-item:hover { border-color: var(--navy); background: var(--navy-soft); text-decoration: none; }
.cal-date { width: 54px; height: 54px; border-radius: var(--radius); background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-date .d { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.cal-date .m { font-size: .62rem; letter-spacing: .05em; margin-top: 2px; }
.cal-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .cal-tags { display: none; } }

/* Panel lateral fijo en la página de inicio (escritorio) */
@media (min-width: 980px) {
  .home-sidebar .sidebar { transform: translateX(0); box-shadow: none; }
  .home-sidebar .sidebar-overlay { display: none; }
  .home-sidebar .hamburger { display: none; }
  .home-sidebar .wrap { margin-left: 264px; max-width: 1400px; margin-right: 0; padding-right: 40px; }
  .home-sidebar .topbar, .home-sidebar .footer { margin-left: 264px; }
  .home-sidebar .sidebar { overflow-y: auto; }
}
.brand-badge {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.brand-name { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub  { font-size: .74rem; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted); font-size: .9rem; font-weight: 600;
  padding: 8px 13px; border-radius: var(--radius); text-decoration: none;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { color: var(--navy); background: var(--navy-soft); }

.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-soft); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}
.user-meta { font-size: .8rem; line-height: 1.2; }
.user-meta b { display: block; font-weight: 700; }
.user-meta span { color: var(--muted); }

/* ---------- Contenedor ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.page-head p  { color: var(--muted); font-size: .92rem; margin-top: 3px; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 28px 0 13px;
}
.section-title h2 { font-size: 1.08rem; font-weight: 700; }
.section-title .meta { font-size: .82rem; color: var(--hint); }

/* ---------- Indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .label { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }
.kpi.accent .value { color: var(--navy); }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.card .desc { font-size: .86rem; color: var(--muted); margin-top: 7px; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }

.card-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

/* ---------- Badges ---------- */
.badge { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.info    { background: var(--navy-soft); color: var(--navy-dark); }
.badge.amber   { background: var(--amber-soft); color: var(--amber); }
.badge.red     { background: var(--red-soft); color: var(--red); }
.badge.muted   { background: var(--bg); color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: .88rem; font-weight: 700; cursor: pointer;
  padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border-2);
  background: var(--card); color: var(--text); text-decoration: none; transition: .15s;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-dark); }
.btn.sm { padding: 7px 12px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn-group { display: flex; gap: 8px; }
.btn-group .btn { flex: 1; }

/* ---------- Estado vacío ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; background: var(--card); border: 1px dashed var(--border-2); border-radius: var(--radius-lg); }
.empty .ico { font-size: 30px; opacity: .4; }

/* ---------- Certificado en lista ---------- */
.cert-ico { font-size: 22px; color: var(--navy); }

/* ---------- Imagen de curso ---------- */
.card-img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--border); }
/* Mismo tamaño que la miniatura del catálogo (columna de 300 px × 150 px de alto). */
.course-banner { display: block; width: 100%; max-width: 300px; height: 150px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 16px; border: 1px solid var(--border); }

/* ============================================================
 *  Login
 * ============================================================ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 400px; }
.login-head { text-align: center; margin-bottom: 26px; }
.login-head .brand-badge { width: 60px; height: 60px; font-size: 30px; margin: 0 auto 14px; border-radius: var(--radius-lg); }
.login-head h1 { font-size: 1.35rem; font-weight: 800; }
.login-head p { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; font-family: inherit; font-size: .95rem;
  border: 1px solid var(--border-2); border-radius: var(--radius); background: #fbfcfe; color: var(--text); outline: none; transition: .15s;
}
.field input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); background: #fff; }
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: .85rem; margin-bottom: 16px; }
.alert.error { background: var(--red-soft); color: var(--red); border: 1px solid #f1c9c4; }
.alert.success { background: var(--green-soft); color: var(--green); border: 1px solid #bfe6c9; }
.alert.warning { background: var(--amber-soft); color: var(--amber); border: 1px solid #e9d8a6; }
.login-foot { text-align: center; margin-top: 20px; font-size: .8rem; color: var(--muted); }

/* ============================================================
 *  Portada pública / acceso (landing)
 * ============================================================ */
body.lp { background: var(--bg); }
.lp-nav { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.lp-nav-inner { max-width: 1160px; margin: 0 auto; padding: 11px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lp-brand { display: flex; align-items: center; gap: 11px; color: var(--navy-dark); }
.lp-brand .brand-badge { width: 40px; height: 40px; font-size: 21px; border-radius: var(--radius); flex: none; }
.lp-brand .nm { font-weight: 800; font-size: 1.02rem; line-height: 1.1; }
.lp-brand .sub { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }

.lp-hero { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%); color: #fff; }
.lp-hero-inner { max-width: 1160px; margin: 0 auto; padding: 56px 20px 64px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.lp-eyebrow { display: inline-block; background: rgba(255,255,255,.14); padding: 5px 13px; border-radius: 999px; font-size: .76rem; font-weight: 600; margin-bottom: 16px; }
.lp-hero-text h1 { font-size: 2.15rem; line-height: 1.14; font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.lp-hero-text p { color: rgba(255,255,255,.86); font-size: 1.02rem; line-height: 1.6; max-width: 540px; }
.lp-stats { display: flex; gap: 30px; margin-top: 28px; }
.lp-stat b { font-size: 1.6rem; font-weight: 800; display: block; }
.lp-stat span { font-size: .76rem; color: rgba(255,255,255,.75); }

.lp-login { background: #fff; color: var(--text); border-radius: var(--radius-lg); padding: 26px; box-shadow: 0 20px 55px rgba(8,22,52,.30); }
.lp-login h2 { font-size: 1.08rem; font-weight: 800; }
.lp-login .lp-login-sub { color: var(--muted); font-size: .82rem; margin: 2px 0 18px; }
.lp-login .field { margin-bottom: 14px; }

.lp-courses { max-width: 1160px; margin: 0 auto; padding: 46px 20px 8px; }
.lp-section-head { display: flex; align-items: center; gap: 13px; margin: 28px 0 16px; }
.lp-section-head h2 { font-size: 1.18rem; font-weight: 800; color: var(--navy-dark); white-space: nowrap; }
.lp-section-head .line { flex: 1; height: 1px; background: var(--border); }
.lp-section-head .count { font-size: .8rem; color: var(--hint); white-space: nowrap; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }
.lp-ccard { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; text-decoration: none; color: inherit; }
.lp-ccard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.lp-ccard-img { height: 132px; width: 100%; object-fit: cover; display: block; }
.lp-ccard-ph { height: 132px; background: linear-gradient(135deg, var(--navy-soft), #d6e6f7); display: flex; align-items: center; justify-content: center; color: var(--navy); font-size: 32px; }
.lp-ccard-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.lp-ccard-body h3 { font-size: .92rem; font-weight: 700; line-height: 1.32; }
.lp-ccard-body .desc { font-size: .8rem; color: var(--muted); line-height: 1.45; flex: 1; }
.lp-ccard-foot { display: flex; align-items: center; justify-content: space-between; font-size: .75rem; color: var(--hint); padding-top: 2px; }
.lp-empty { color: var(--muted); font-size: .9rem; padding: 8px 2px 4px; }
.lp-foot { text-align: center; padding: 36px 20px; color: var(--muted); font-size: .82rem; }
.lp-foot a { color: var(--navy); }

@media (max-width: 860px) {
  .lp-hero-inner { grid-template-columns: 1fr; gap: 28px; padding: 34px 18px 44px; }
  .lp-hero-text h1 { font-size: 1.62rem; }
  .lp-hero-text { order: 1; }
  .lp-login { order: 2; }
}

/* ============================================================
 *  Refresco visual institucional (capa adicional, no estructural)
 * ============================================================ */
:root { --gold: #c79a3a; }

/* Barra superior: filo de acento (azul→dorado) y sombra suave */
.topbar { border-bottom: 0; box-shadow: 0 1px 0 var(--border), 0 6px 16px rgba(20,40,80,.05); }
.topbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 60%, var(--gold) 100%); }
.nav a.active { color: var(--navy-dark); position: relative; }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--navy); border-radius: 2px; }

/* Títulos de sección con barra de acento a la izquierda */
.section-title h2 { position: relative; padding-left: 14px; }
.section-title h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 1.05em; border-radius: 3px; background: var(--navy); }

/* Tarjetas: esquinas y elevación más cuidadas */
.card { border-radius: 14px; transition: box-shadow .14s ease; }
.card:hover { box-shadow: 0 8px 24px rgba(20,40,80,.09); }
.grid.cols-2 > .card, .grid.cols-3 > .card { transition: transform .14s ease, box-shadow .14s ease; }
.grid.cols-2 > .card:hover, .grid.cols-3 > .card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20,40,80,.12); }
.card-img { height: 150px; }

/* Indicadores con franja de acento superior */
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--navy); opacity: .9; }
.kpi.accent::before { background: var(--gold); }

/* Botón primario con profundidad sutil */
.btn.primary { box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.btn.primary:hover { box-shadow: 0 4px 12px rgba(20,40,80,.22); }

/* Sidebar: estado activo e icono del logo dorado */
.sidebar-nav a.active { background: rgba(255,255,255,.16); }
.sidebar-logo { color: var(--gold) !important; }

/* Progreso y avatar con degradado institucional */
.progress-bar { background: linear-gradient(90deg, var(--navy), #3b82c4); }
.user-chip .avatar { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); color: #fff; }

/* Listado de actividades: borde izquierdo de acento al pasar */
.act-item { border-left: 3px solid transparent; }
.act-item:hover { border-left-color: var(--navy); }

/* ============================================================
 *  Página de verificación pública
 * ============================================================ */
.verify-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.verify-box { width: 100%; max-width: 480px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.verify-banner { padding: 22px; text-align: center; color: #fff; }
.verify-banner.ok { background: var(--green); }
.verify-banner.bad { background: var(--red); }
.verify-banner .ico { font-size: 40px; }
.verify-banner h1 { font-size: 1.2rem; font-weight: 800; margin-top: 6px; }
.verify-body { padding: 24px; }
.verify-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.verify-row:last-child { border-bottom: 0; }
.verify-row .k { color: var(--muted); }
.verify-row .v { font-weight: 700; text-align: right; }

/* ---------- Botón hamburguesa (admin, solo móvil) ---------- */
.nav-burger { display: none; background: none; border: 1px solid var(--border-2); border-radius: var(--radius); width: 36px; height: 36px; font-size: 18px; color: var(--text); cursor: pointer; align-items: center; justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .nav { display: none; flex-direction: column; width: 100%; gap: 2px; order: 10; padding-top: 8px; border-top: 1px solid var(--border); }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; border-radius: var(--radius); }
  .nav-burger { display: inline-flex; }
  .wrap { padding: 20px 16px 50px; }
  .user-meta { display: none; }
  .page-head h1 { font-size: 1.3rem; }
  .adm-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .btn-group { flex-wrap: wrap; }
  .bot-wrap { height: 76vh; }
  .lp-login { padding: 20px; }
  .user-chip .btn.sm { display: none; }
}

/* ---------- Pie ---------- */
.footer { text-align: center; color: var(--hint); font-size: .78rem; padding: 30px 20px 40px; }
.footer a { color: var(--muted); }

/* ============================================================
 *  Fases 2 y 3
 * ============================================================ */

/* Barra de progreso */
.progress { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--navy); border-radius: 99px; }

/* Listado de actividades (alumno) */
.act-list { display: flex; flex-direction: column; gap: 8px; }
.act-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--card); }
.act-item:hover { border-color: var(--navy); background: var(--navy-soft); text-decoration: none; }
.act-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--navy-soft); color: var(--navy-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.act-main { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.act-type { font-size: .76rem; color: var(--muted); }
.act-state { font-size: 20px; }
.act-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

/* Vídeo embebido (16:9) */
.embed { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 10px; overflow: hidden; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Visores en línea (PDF / imagen) */
.doc-frame { width: 100%; height: 72vh; min-height: 460px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.doc-img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); display: block; }

/* Cuestionario */
.quiz-timer { display: inline-flex; align-items: center; gap: 7px; background: var(--amber-soft); color: var(--amber); font-weight: 700; padding: 7px 14px; border-radius: 99px; margin-bottom: 14px; }
.quiz-info { display: flex; gap: 18px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.quiz-q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.quiz-q:last-of-type { border-bottom: 0; }
.quiz-q-text { margin-bottom: 10px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 7px; cursor: pointer; }
.quiz-opt:hover { background: var(--bg); }
.quiz-result { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--radius); }
.quiz-result.ok  { background: var(--green-soft); }
.quiz-result.bad { background: var(--red-soft); }
.quiz-result .score { font-size: 2rem; font-weight: 800; }
.quiz-result.ok  .score { color: var(--green); }
.quiz-result.bad .score { color: var(--red); }

/* ---------- Formularios de administración ---------- */
.adm-label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.adm-input { width: 100%; padding: 9px 11px; font-family: inherit; font-size: .92rem; border: 1px solid var(--border-2); border-radius: var(--radius); background: #fbfcfe; color: var(--text); outline: none; transition: .15s; }
.adm-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); background: #fff; }
textarea.adm-input { resize: vertical; line-height: 1.5; }
.adm-check { display: flex; align-items: center; gap: 7px; font-size: .88rem; margin-bottom: 8px; }
.adm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .adm-grid { grid-template-columns: 1fr; } }

/* ---------- Tablas de administración ---------- */
.adm-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; font-size: .9rem; }
.adm-table th { text-align: left; font-size: .73rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.adm-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: 0; }

/* ---------- Constructor de curso ---------- */
.build-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.build-actions { display: flex; gap: 4px; align-items: center; }
.build-actions form { margin: 0; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--card); color: var(--muted); cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.iconbtn.danger:hover { color: var(--red); border-color: #f1c9c4; }

.inline-details { display: inline-block; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }

/* ---------- Editor visual (Quill) ---------- */
.ql-host { background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.ql-toolbar.ql-snow { border-color: var(--border-2); border-radius: var(--radius) var(--radius) 0 0; background: #fff; }
.ql-container.ql-snow { border-color: var(--border-2); border-radius: 0 0 var(--radius) var(--radius); font-family: inherit; font-size: .95rem; }
/* El editor tiene fondo blanco SIEMPRE → texto oscuro fijo (si no, en modo oscuro saldría blanco sobre blanco). */
.ql-editor { min-height: 160px; color: #1a2230; }
.ql-editor.ql-blank::before { color: #8a93a3; }
/* Iconos/etiquetas de la barra del editor legibles en cualquier tema. */
.ql-snow .ql-stroke { stroke: #44506a; }
.ql-snow .ql-fill { fill: #44506a; }
.ql-snow .ql-picker { color: #44506a; }

/* ---------- Página de comprobación del sistema ---------- */
.check-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--card); }
.check-row .ico { font-size: 22px; flex-shrink: 0; }
.check-row .ico.ok { color: var(--green); }
.check-row .ico.warn { color: var(--amber); }
.check-row .ico.fail { color: var(--red); }
.check-row .body { flex: 1; }
.check-row .body b { display: block; font-size: .95rem; }
.check-row .body span { font-size: .82rem; color: var(--muted); }

/* ============================================================
 *  Conmutador de tema claro / oscuro
 * ============================================================ */
.theme-toggle {
  background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius);
  width: 36px; height: 36px; cursor: pointer; color: var(--navy); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .15s;
}
.theme-toggle:hover { background: var(--bg); color: var(--navy-dark); }
.theme-toggle.floating { position: fixed; top: 16px; right: 16px; z-index: 60; box-shadow: var(--shadow); }

/* Logo institucional en la marca (sustituye al icono escudo) */
.brand-logo { height: 40px; width: auto; display: block; }
@media (max-width: 640px) { .brand-logo { height: 34px; } }

/* Crédito del pie con logo de USPLBE a la izquierda */
.footer-credit { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.footer-logo { height: 30px; width: auto; flex-shrink: 0; }

/* ============================================================
 *  Asistente virtual (chatbot de soporte)
 * ============================================================ */
.bot-wrap  { display: flex; flex-direction: column; height: min(70vh, 620px); }
.bot-msgs  { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 12px; }
.bot-msg   { max-width: 80%; padding: 11px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.bot-msg.user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.bot-msg.bot  { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bot-msg.bot a { color: var(--navy); text-decoration: underline; }
.bot-typing { align-self: flex-start; color: var(--muted); font-size: .85rem; padding: 2px 6px; }
.bot-form   { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.bot-form textarea { flex: 1; resize: none; }
.bot-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border-2); border-radius: 99px; background: var(--card); color: var(--text); font-size: .82rem; cursor: pointer; }
.bot-chip:hover { background: var(--bg); }

/* ---------- Pop-up de notificaciones (novedades al entrar) ---------- */
.notif-pop { position: fixed; right: 20px; bottom: 20px; z-index: 120; width: 330px; max-width: calc(100vw - 40px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: notifIn .25s ease; }
:root[data-theme="dark"] .notif-pop { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--navy); color: #fff; font-size: .92rem; }
.notif-x { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.notif-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .88rem; }
.notif-item:hover { background: var(--bg); text-decoration: none; }
.notif-item i { color: var(--navy); font-size: 18px; flex-shrink: 0; }
@keyframes notifIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================
 *  MODO OSCURO + GLASSMORPHISM
 *  (todo por variables: el diseño claro queda intacto)
 * ============================================================ */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy:        #5b9ae6;   /* enlaces y acentos, más claros para leer sobre oscuro */
  --navy-dark:   #8fc0ff;
  --navy-soft:   rgba(91,154,230,.16);
  --green:       #4cc06a;
  --green-soft:  rgba(47,158,68,.18);
  --amber:       #e0ad4e;
  --amber-soft:  rgba(185,119,14,.20);
  --red:         #ef7d72;
  --red-soft:    rgba(192,57,43,.20);

  --bg:          #0d1626;
  --card:        rgba(23,34,56,.55);   /* translúcido para el efecto cristal */
  --text:        #e8eef9;
  --muted:       #a3b1c9;
  --hint:        #7f8da3;
  --border:      rgba(255,255,255,.10);
  --border-2:    rgba(255,255,255,.17);
  --gold:        #d8b154;

  --shadow:      0 1px 3px rgba(0,0,0,.45);
  --shadow-lg:   0 18px 50px rgba(0,0,0,.60);
}

/* Fondo con profundidad para que el cristal tenga algo detrás */
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 720px at 82% -12%, #1c3158 0%, rgba(28,49,88,0) 55%),
    radial-gradient(900px 640px at -10% 8%, #12243f 0%, rgba(18,36,63,0) 50%),
    linear-gradient(180deg, #0d1626 0%, #0a111d 100%);
  background-attachment: fixed;
}

/* Superficies con cristal esmerilado */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .kpi,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .adm-table,
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .lp-login,
:root[data-theme="dark"] .lp-ccard,
:root[data-theme="dark"] .verify-box,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .act-item,
:root[data-theme="dark"] .build-item,
:root[data-theme="dark"] .cal-item,
:root[data-theme="dark"] .check-row {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  background: var(--card);
  border-color: var(--border);
}

/* Barra superior translúcida */
:root[data-theme="dark"] .topbar { background: rgba(13,22,38,.72); box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(0,0,0,.45); }

/* Panel lateral: cristal oscuro (no el azul claro de --navy) */
:root[data-theme="dark"] .sidebar {
  background: rgba(11,18,32,.92);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
}

/* Campos de formulario */
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .adm-input {
  background: rgba(255,255,255,.05); color: var(--text); border-color: var(--border-2);
}
:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .adm-input:focus {
  background: rgba(255,255,255,.09); border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(91,154,230,.25);
}
:root[data-theme="dark"] select.adm-input option { background: #16223a; color: var(--text); }
:root[data-theme="dark"] .adm-table th { background: rgba(255,255,255,.04); }

/* Botones */
:root[data-theme="dark"] .btn { background: rgba(255,255,255,.05); border-color: var(--border-2); color: var(--text); }
:root[data-theme="dark"] .btn:hover { background: rgba(255,255,255,.10); }
:root[data-theme="dark"] .btn.primary { background: var(--navy); border-color: var(--navy); color: #06121f; }
:root[data-theme="dark"] .btn.primary:hover { background: var(--navy-dark); }
:root[data-theme="dark"] .iconbtn { background: rgba(255,255,255,.05); border-color: var(--border-2); color: var(--muted); }

/* Distintivos (chips) con buen contraste */
:root[data-theme="dark"] .badge.success { background: rgba(76,192,106,.16); color: #6fe08a; }
:root[data-theme="dark"] .badge.info    { background: rgba(91,154,230,.20); color: #9cc6ff; }
:root[data-theme="dark"] .badge.amber   { background: rgba(224,173,78,.18); color: #ecc170; }
:root[data-theme="dark"] .badge.red     { background: rgba(239,125,114,.18); color: #f6a59c; }
:root[data-theme="dark"] .badge.muted   { background: rgba(255,255,255,.08); color: var(--muted); }

/* Avisos y resultados translúcidos */
:root[data-theme="dark"] .alert.error   { background: rgba(239,125,114,.15); color: #f6a59c; border-color: rgba(239,125,114,.4); }
:root[data-theme="dark"] .alert.success { background: rgba(76,192,106,.14); color: #6fe08a; border-color: rgba(76,192,106,.35); }
:root[data-theme="dark"] .alert.warning { background: rgba(224,173,78,.15); color: #ecc170; border-color: rgba(224,173,78,.35); }
:root[data-theme="dark"] .quiz-result.ok  { background: rgba(76,192,106,.14); }
:root[data-theme="dark"] .quiz-result.bad { background: rgba(239,125,114,.14); }
:root[data-theme="dark"] .quiz-opt:hover { background: rgba(255,255,255,.06); }

/* Portada pública */
:root[data-theme="dark"] .lp-nav { background: rgba(13,22,38,.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-color: var(--border); }
:root[data-theme="dark"] .lp-brand { color: var(--text); }
:root[data-theme="dark"] .lp-ccard { color: inherit; }
/* Hero: navy profundo (no el azul claro de las variables) para que el texto blanco contraste */
:root[data-theme="dark"] .lp-hero {
  background:
    radial-gradient(900px 520px at 80% -30%, rgba(52,98,170,.55) 0%, rgba(52,98,170,0) 60%),
    linear-gradient(135deg, #15294b 0%, #0f1f38 55%, #0c1830 100%);
}
:root[data-theme="dark"] .lp-hero-text p { color: rgba(232,238,249,.82); }
/* Tarjeta de acceso: cristal algo más sólido para que el formulario se lea bien */
:root[data-theme="dark"] .lp-login {
  color: var(--text);
  background: rgba(18,29,49,.72);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

/* El diploma y los visores de documento se mantienen claros (son para imprimir/leer) */
:root[data-theme="dark"] .doc-frame { background: #fff; }

/* ------------------------------------------------------------
 *  Catálogo de cursos
 *  auto-fill (no auto-fit): las columnas vacías NO se colapsan,
 *  así una sección con 1 curso pinta la tarjeta del mismo tamaño
 *  que una con 19 y la portada se recorta igual en todas.
 * ------------------------------------------------------------ */
.grid.catalogo { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.catalogo > .card { transition: transform .14s ease, box-shadow .14s ease; }
.grid.catalogo > .card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20,40,80,.12); }

/* Rótulo de la organización bajo "Campus SIPLG" en el panel de administración.
 * El logo de USPLBE es transparente con letras azul marino: sobre la barra
 * lateral oscura no se leería, por eso va sobre una pastilla blanca. */
.org-sub  { display: inline-flex; align-items: center; gap: 5px; }
.org-logo { height: 18px; width: auto; background: #fff; border-radius: 4px; padding: 1px 2px; }

/* ============================================================
 *  Mejoras de interfaz (fase 1): rendimiento, accesibilidad y móvil
 * ============================================================ */
:root { --gold: #b8923a; }                     /* dorado del escudo (el tema oscuro lo aclara) */
picture { display: contents; }                 /* <picture> no altera el layout de la tarjeta */

/* Foco visible para quien navega con teclado (antes no había ninguno) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--navy); outline-offset: 2px;
}
:root[data-theme="dark"] :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: var(--gold); }

/* Respeta la preferencia de "reducir movimiento" del sistema */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Cifras alineadas y filete dorado institucional bajo los títulos de página */
.kpi .value, .score, .cal-date .d { font-variant-numeric: tabular-nums; }
.page-head h1::after { content: ""; display: block; width: 44px; height: 3px; border-radius: 2px; background: var(--gold); margin-top: 8px; }

/* Cabecera en móvil: la marca cabe en una línea y no empuja el botón */
@media (max-width: 480px) {
  .lp-brand .sub, .brand-sub { display: none; }
  .lp-brand .nm, .brand-name { white-space: nowrap; }
  .topbar-inner, .lp-nav-inner { gap: 8px; }
  .user-meta { display: none; }
}

/* ============================================================
 *  Fase 2: escala de espaciado y utilidades (sustituyen estilos en línea repetidos).
 *  !important para conservar la precedencia que tenía el atributo style="".
 * ============================================================ */
:root { --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; }
.u-mb-8 { margin-bottom: 8px !important; }   .u-mb-10 { margin-bottom: 10px !important; }
.u-mb-12 { margin-bottom: 12px !important; } .u-mb-14 { margin-bottom: 14px !important; }
.u-mb-16 { margin-bottom: 16px !important; } .u-mb-18 { margin-bottom: 18px !important; }
.u-mt-4 { margin-top: 4px !important; }      .u-mt-6 { margin-top: 6px !important; }
.u-mt-8 { margin-top: 8px !important; }      .u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }    .u-mt-14 { margin-top: 14px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-col-all { grid-column: 1 / -1 !important; }
.u-c-navy { color: var(--navy) !important; } .u-c-amber { color: var(--amber) !important; }
.u-va-top { vertical-align: top !important; }
.u-ta-r { text-align: right !important; }    .u-ta-c { text-align: center !important; }
.u-nowrap { white-space: nowrap !important; } .u-d-inline { display: inline !important; }
.u-py-6 { padding-top: 6px !important; padding-bottom: 6px !important; }
.u-link-plain { text-decoration: none !important; color: inherit !important; }
.u-row-end { display: flex !important; gap: 10px !important; align-items: flex-end !important; flex-wrap: wrap !important; }
.u-chip-link { text-decoration: none !important; color: inherit !important; padding: 8px 12px !important; border-radius: 8px !important; background: var(--bg-card) !important; border: 1px solid var(--border) !important; display: flex !important; align-items: center !important; gap: 8px !important; }

/* Menú lateral: un solo juego de iconos (Tabler) con acento dorado en la sección activa */
.sidebar-nav a i { font-size: 1.15rem; }
.sidebar-nav a.active { box-shadow: inset 3px 0 0 #e6c36a; }
.sidebar-nav a.active i { color: #e6c36a; opacity: 1; }

/* ============================================================
 *  Fase 3: tarjetas de curso y navegación inferior en móvil
 * ============================================================ */

/* Tarjeta con portada a sangre (16:9), pie separado y acento dorado al pasar el ratón */
.card:has(.card-img) { overflow: hidden; }
.card .card-img {
  width: calc(100% + 40px); max-width: none; height: auto; aspect-ratio: 16 / 9;
  margin: -18px -20px 14px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
}
.grid > .card:hover { border-color: var(--gold); }
.grid > .card > h3, .grid > .card > .desc {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.grid > .card > h3 { -webkit-line-clamp: 3; }
.grid > .card > .desc { -webkit-line-clamp: 3; }
.grid > .card > .foot { border-top: 1px solid var(--border); padding-top: 12px; }

/* Barra de navegación inferior (solo móvil) */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(20, 40, 80, .08);
  }
  :root[data-theme="dark"] .bottom-nav { background: rgba(13, 22, 38, .93); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font: inherit; font-size: .68rem; font-weight: 600; color: var(--muted);
    background: none; border: 0; border-radius: 10px; padding: 7px 2px; text-decoration: none; cursor: pointer;
  }
  .bottom-nav i { font-size: 1.35rem; }
  .bottom-nav a.active { color: var(--navy); background: var(--navy-soft); box-shadow: inset 0 2px 0 var(--gold); }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .notif-pop { bottom: 84px; }
}

/* Botón «Atrás» de la barra superior */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 38px; padding: 0 12px; font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--navy); background: none; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.back-btn:hover { background: var(--navy-soft); }
.back-btn[hidden] { display: none; }
.back-btn i { font-size: 1.1rem; }
@media (max-width: 480px) { .back-btn span { display: none; } .back-btn { padding: 0 10px; } }

/* «Atrás»: borde amarillo policía con pulso suave y visible */
.back-btn { border: 2px solid #f5c400; font-weight: 700; animation: back-pulso 1.8s ease-in-out infinite; }
@keyframes back-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 196, 0, .65); border-color: #f5c400; }
  50%      { box-shadow: 0 0 0 6px rgba(245, 196, 0, 0); border-color: #ffe14d; }
}


/* ============================================================
 *  Sindicato organizador por curso (SIPLG / USPLBE)
 *  Insignia en catálogo/portada y selector grande con logo en admin
 * ============================================================ */
.sind-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 4px; border-radius: 99px; font-size: .73rem; line-height: 1.2;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.sind-badge img {
  height: 18px; width: 18px; object-fit: contain;
  background: #fff; border-radius: 50%; padding: 1px; flex-shrink: 0;
}
.sind-badge.siplg { border-color: rgba(59, 130, 246, .45); background: rgba(59, 130, 246, .12); color: #60a5fa; }
.sind-badge.usplbe { border-color: rgba(216, 177, 84, .55); background: rgba(216, 177, 84, .14); color: #f5c400; }
:root:not([data-theme="dark"]) .sind-badge.siplg { color: #16467c; background: #eaf2fd; }
:root:not([data-theme="dark"]) .sind-badge.usplbe { color: #7a5200; background: #fdf4db; }

.sind-picker {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px;
}
.sind-option { cursor: pointer; display: block; margin: 0; }
.sind-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.sind-box {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 2px solid var(--border); border-radius: 12px; background: var(--bg);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.sind-option:hover .sind-box { border-color: var(--navy); transform: translateY(-1px); }
.sind-logo-wrap {
  width: 58px; height: 58px; padding: 6px; border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.sind-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.sind-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sind-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 1.02rem; color: var(--text); }
.sind-desc { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.sind-check {
  font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: #16a34a; color: #fff; opacity: 0; transform: scale(.9); transition: .15s;
}
.sind-option input[type="radio"]:checked + .sind-box {
  border-color: var(--gold, #d8b154);
  background: var(--navy-soft);
  box-shadow: 0 0 0 3px rgba(216, 177, 84, .25);
}
.sind-option input[type="radio"]:checked + .sind-box .sind-check {
  opacity: 1; transform: scale(1);
}

/* ============================================================
 *  Separador tipo damero policial (USPLBE / SIPLG)
 * ============================================================ */
.sind-damero-sep {
  margin: 28px 0 18px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 6px 20px rgba(8, 18, 38, .22);
}
.sind-damero-sep:first-child { margin-top: 8px; }

/* Franja damero policial (2 filas de cuadros alternos estilo Policía Local) */
.sind-damero-sep .damero-strip {
  height: 12px;
  width: 100%;
  background-image: repeating-conic-gradient(#12418a 0% 25%, #f8fafc 0% 50%);
  background-size: 12px 12px;
}
.sind-damero-sep.usplbe .damero-strip {
  background-image: repeating-conic-gradient(#0f3878 0% 25%, #f5c400 0% 50%);
  background-size: 12px 12px;
}
.sind-damero-sep.siplg .damero-strip {
  background-image: repeating-conic-gradient(#164e9f 0% 25%, #f8fafc 0% 50%);
  background-size: 12px 12px;
}

.sind-damero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(15, 56, 120, .24) 0%, rgba(15, 56, 120, .06) 100%);
}
.sind-damero-sep.usplbe .sind-damero-body {
  background: linear-gradient(90deg, rgba(216, 177, 84, .16) 0%, rgba(15, 56, 120, .14) 55%, transparent 100%);
}
.sind-damero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.sind-damero-logo {
  width: 52px;
  height: 52px;
  padding: 5px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
.sind-damero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sind-damero-titles h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--text);
}
.sind-damero-sep.usplbe .sind-damero-titles h2 { color: #f5c400; }
:root:not([data-theme="dark"]) .sind-damero-sep.usplbe .sind-damero-titles h2 { color: #0f3878; }
.sind-damero-titles p {
  margin: 2px 0 0;
  font-size: .8rem;
  color: var(--muted);
}
.sind-damero-sep .damero-mid {
  flex: 1;
  height: 16px;
  min-width: 48px;
  border-radius: 4px;
  opacity: .85;
  background-image: repeating-conic-gradient(#12418a 0% 25%, #f8fafc 0% 50%);
  background-size: 16px 16px;
}
.sind-damero-sep.usplbe .damero-mid {
  background-image: repeating-conic-gradient(#0f3878 0% 25%, #f5c400 0% 50%);
  background-size: 16px 16px;
}
.sind-damero-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sind-damero-count {
  font-size: .8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--navy-soft);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
@media (max-width: 680px) {
  .sind-damero-sep .damero-mid { display: none; }
  .sind-damero-body { flex-wrap: wrap; padding: 10px 14px; }
  .sind-damero-logo { width: 42px; height: 42px; }
  .sind-damero-titles h2 { font-size: 1rem; }
}
