/* ═══════════════════════════════════════════════════════════════════════════
   edupuc — Estilos globales (mismo sistema de diseño que SIGECO Admin)
   Paleta: índigo #3B52C0 → verde #3EA56E
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --sg-blue:       #3B52C0;
    --sg-teal:       #2A7BA0;
    --sg-green:      #3EA56E;
    --sg-navy:       #305F91;
    --sg-dark:       #1a2636;
    --sg-dark2:      #233045;
    --sg-grad:       linear-gradient(135deg, #3B52C0 0%, #2A7BA0 50%, #3EA56E 100%);
    --sg-grad-h:     linear-gradient(135deg, #3242a8 0%, #235e7e 50%, #319059 100%);
    --color-bg:      #f0f3f9;
    --color-surface: #ffffff;
    --color-border:  #e2e8f0;
    --color-text:    #1a202c;
    --color-muted:   #718096;
    --color-muted2:  #a0aec0;
    --color-danger:  #e53e3e;
    --color-success: #38a169;
    --color-warn:    #d69e2e;
    --topbar-h:      56px;
    --rail-w:        76px;
    --sidebar-w:     220px;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-md:     0 4px 12px rgba(0,0,0,.10), 0 8px 32px rgba(0,0,0,.08);
    --transition:    .18s cubic-bezier(.4,0,.2,1);
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Loader ────────────────────────────────────────────────────────────────── */
#sg-loader {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--sg-dark);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    transition: opacity .45s ease, visibility .45s ease;
}
#sg-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.sg-loader-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: sgLoaderFadeIn .5s ease both; }
.sg-loader-mark { display: flex; align-items: center; justify-content: center; animation: sgLogoPulse 1.6s ease-in-out infinite; }
.sg-loader-badge {
    display: inline-block; background: var(--sg-grad); color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
    padding: 3px 12px; border-radius: 20px; margin-top: 4px;
}
.sg-loader-ring {
    width: 44px; height: 44px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #3EA56E; border-right-color: #2A7BA0;
    border-radius: 50%; margin-top: 24px;
    animation: sgSpin .8s linear infinite;
}
.sg-loader-text { color: rgba(255,255,255,.4); font-size: 12px; font-weight: 500; letter-spacing: 1px; margin-top: 12px; animation: sgLoaderFadeIn .6s .2s ease both; }
@keyframes sgSpin { to { transform: rotate(360deg); } }
@keyframes sgLoaderFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sgLogoPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .8; } }

/* ── Skeleton (carga de contenido dentro de una sección) ─────────────────────── */
.skeleton { background: linear-gradient(90deg, #e9edf5 25%, #f4f6fa 37%, #e9edf5 63%); background-size: 400% 100%; animation: sgSkeleton 1.4s ease infinite; border-radius: 6px; }
@keyframes sgSkeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-curso-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.skeleton-curso-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.skeleton-curso-card .curso-card-top { height: 6px; }
.skeleton-curso-card-body { padding: 18px; }
.skeleton-curso-card-body .skeleton + .skeleton { margin-top: 10px; }
.skeleton-table th { background: #f7fafc; }
.skeleton-table td { padding: 12px; }

/* ── Login / auth (pantalla partida, tipo Canvas) ─────────────────────────── */
.auth-page { min-height: 100vh; display: flex; background: var(--color-surface); }
.auth-brand {
    flex: 1 1 46%; max-width: 540px; position: relative; overflow: hidden;
    background: var(--sg-dark); color: #fff;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 52px;
}
.auth-brand::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 18% 15%, rgba(59,82,192,.38) 0%, transparent 55%),
                radial-gradient(ellipse at 82% 88%, rgba(62,165,110,.28) 0%, transparent 55%);
}
.auth-brand::after {
    content: ''; position: absolute; inset: 0; opacity: .12; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.6) 1px, transparent 1px);
    background-size: 22px 22px;
}
.auth-brand-top, .auth-brand-mid, .auth-brand-foot { position: relative; z-index: 1; }
.auth-brand-logo { display: flex; align-items: center; gap: 12px; }
.auth-brand-logo .sg-loader-mark { animation: none; }
.auth-brand-logo .sg-loader-mark svg { width: 36px; height: 36px; }
.auth-brand-name { font-size: 18px; font-weight: 800; }
.auth-brand-tag { font-size: 11.5px; color: rgba(255,255,255,.4); margin-top: 1px; }
.auth-brand-headline { font-size: 27px; font-weight: 800; line-height: 1.3; margin-top: 52px; max-width: 380px; }
.auth-brand-sub { font-size: 13.5px; color: rgba(255,255,255,.55); margin-top: 12px; max-width: 360px; line-height: 1.6; }
.auth-features { list-style: none; margin-top: 34px; display: flex; flex-direction: column; gap: 16px; }
.auth-features li { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: rgba(255,255,255,.72); }
.auth-feature-ico { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-feature-ico svg { width: 15px; height: 15px; }
.auth-brand-foot { font-size: 11px; color: rgba(255,255,255,.28); }

.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form-card { width: 100%; max-width: 372px; }
.auth-form-mobile-logo { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-form-mobile-logo .sg-loader-mark svg { width: 30px; height: 30px; }
.auth-form-mobile-logo strong { font-size: 16px; font-weight: 800; }
.auth-form-title { font-size: 21px; font-weight: 800; color: var(--color-text); }
.auth-form-sub { font-size: 13px; color: var(--color-muted); margin-top: 4px; margin-bottom: 26px; }
.auth-back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--color-muted); text-decoration: none; margin-top: 16px; }
.auth-back-link:hover { color: var(--sg-blue); }

@media (max-width: 860px) {
    .auth-brand { display: none; }
    .auth-form-mobile-logo { display: flex; }
    .auth-form-side { padding: 32px 20px; }
}

/* ── Riel global (íconos, tipo Canvas) ─────────────────────────────────────── */
.global-rail {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail-w);
    background: var(--sg-dark); z-index: 300;
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 0 18px; gap: 4px;
}
.rail-brand { display: flex; align-items: center; justify-content: center; padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); width: 100%; text-decoration: none; }
.rail-brand .sg-loader-mark { animation: none; }
.rail-brand .sg-loader-mark svg { width: 32px; height: 32px; }
.rail-nav { display: flex; flex-direction: column; gap: 3px; width: 100%; align-items: center; flex: 1; }
.rail-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    width: 60px; padding: 8px 2px 7px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.55); text-decoration: none;
    font-size: 10px; font-weight: 600; letter-spacing: .2px; text-align: center;
    transition: background var(--transition), color var(--transition);
    position: relative; cursor: pointer; border: none; background: none; font-family: inherit;
}
.rail-item svg { width: 22px; height: 22px; opacity: .85; }
.rail-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-item:hover svg { opacity: 1; }
.rail-item.active { color: #fff; }
.rail-item.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sg-green); }
.rail-item.active svg { opacity: 1; }
.rail-item.is-disabled { opacity: .35; cursor: default; }
.rail-item.is-disabled:hover { background: none; color: rgba(255,255,255,.55); }
.rail-divider { width: 32px; height: 1px; background: rgba(255,255,255,.08); margin: 8px 0; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rail-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sg-grad); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }

/* ── Topbar (breadcrumb + usuario) ─────────────────────────────────────────── */
.topbar {
    position: fixed; top: 0; left: var(--rail-w); right: 0; height: var(--topbar-h);
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; z-index: 200; transition: left var(--transition);
}
body.has-curso-nav .topbar { left: calc(var(--rail-w) + var(--sidebar-w)); }
.topbar-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-muted); min-width: 0; }
.topbar-crumb a { color: var(--color-muted); text-decoration: none; }
.topbar-crumb a:hover { color: var(--sg-blue); }
.topbar-crumb strong { color: var(--color-text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-crumb-sep { color: var(--color-muted2); }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.topbar-user-info { display: flex; align-items: center; gap: 8px; }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sg-grad); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.topbar-name { font-size: 13px; font-weight: 500; color: var(--color-text); }
.topbar-rol { font-size: 10px; color: var(--color-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Nav de curso (secundario, aparece dentro de un curso) ─────────────────── */
.curso-nav {
    position: fixed; top: 0; left: var(--rail-w); bottom: 0; width: var(--sidebar-w);
    background: var(--color-surface); border-right: 1px solid var(--color-border);
    padding-top: var(--topbar-h); overflow-y: auto; z-index: 150;
}
.curso-nav-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--color-border); margin-bottom: 6px; }
.curso-nav-head a { font-size: 11px; color: var(--color-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.curso-nav-head a:hover { color: var(--sg-blue); }
.curso-nav-head strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.curso-nav ul { list-style: none; padding: 8px 10px; }
.curso-nav li a, .curso-nav li span { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background var(--transition); }
.curso-nav li a:hover { background: var(--color-bg); }
.curso-nav li.active a { background: rgba(59,82,192,.10); color: var(--sg-blue); font-weight: 700; }
.curso-nav li.is-disabled span { color: var(--color-muted2); cursor: default; }
.curso-nav li .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.curso-nav-soon { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted2); background: var(--color-bg); padding: 2px 6px; border-radius: 4px; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.panel-body { background: var(--color-bg); }
.content { margin-left: var(--rail-w); margin-top: var(--topbar-h); padding: 28px; min-height: calc(100vh - var(--topbar-h)); transition: margin-left var(--transition); }
body.has-curso-nav .content { margin-left: calc(var(--rail-w) + var(--sidebar-w)); }

/* ── KPI Grid ───────────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; display: flex; align-items: flex-start; gap: 14px; position: relative; overflow: hidden; border: 1px solid var(--color-border); transition: transform var(--transition), box-shadow var(--transition); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--kpi-color, var(--sg-grad)); border-radius: var(--radius) var(--radius) 0 0; }
.kpi-card-blue   { --kpi-color: linear-gradient(90deg, #3B52C0, #2A7BA0); }
.kpi-card-green  { --kpi-color: linear-gradient(90deg, #2A7BA0, #3EA56E); }
.kpi-card-danger { --kpi-color: linear-gradient(90deg, #e53e3e, #c53030); }
.kpi-card-warn   { --kpi-color: linear-gradient(90deg, #d69e2e, #b7791f); }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-icon-blue   { background: rgba(59,82,192,.1); color: #3B52C0; }
.kpi-icon-green  { background: rgba(62,165,110,.1); color: #3EA56E; }
.kpi-icon-danger { background: rgba(229,62,62,.1);  color: #e53e3e; }
.kpi-icon-warn   { background: rgba(214,158,46,.1); color: #d69e2e; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--color-text); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--color-muted); text-transform: uppercase; letter-spacing: .5px; }
.kpi-sub { font-size: 11px; color: var(--color-muted2); margin-top: 4px; }

/* ── Cards genéricos ────────────────────────────────────────────────────────── */
.sg-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--color-border); overflow: hidden; margin-bottom: 18px; }
.sg-card-header { padding: 14px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.sg-card-body { padding: 20px; }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h2 { font-size: 20px; font-weight: 700; }
.page-header-sub { font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.breadcrumb { font-size: 12px; color: var(--color-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--sg-blue); text-decoration: none; }

/* ── Tabla ──────────────────────────────────────────────────────────────────── */
.sg-table-wrap { overflow-x: auto; width: 100%; }
table, .sg-table { width: 100%; border-collapse: collapse; }
thead th { background: #f7fafc; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--color-muted); padding: 9px 12px; text-align: left; border-bottom: 2px solid var(--color-border); white-space: nowrap; }
tbody td { padding: 9px 12px; border-bottom: 1px solid #f0f4f8; font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7fafc; }

/* ── Buscador + "mostrar N registros" (estilo DataTables) ─────────────────────── */
.sg-search-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sg-search-left { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-muted); flex-wrap: wrap; }
.sg-porpag-sel { height: 32px; padding: 0 8px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font-size: 13px; cursor: pointer; outline: none; font-family: inherit; }
.sg-porpag-sel:focus { border-color: var(--sg-blue); }
.sg-search-input-wrap { position: relative; flex: 0 1 260px; min-width: 200px; max-width: 320px; margin-left: auto; }
.sg-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--color-muted2); pointer-events: none; }
.sg-search-input { width: 100%; padding: 8px 34px 8px 34px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit; outline: none; background: var(--color-surface); color: var(--color-text); transition: border-color var(--transition), box-shadow var(--transition); }
.sg-search-input:focus { border-color: var(--sg-blue); box-shadow: 0 0 0 3px rgba(59,82,192,.10); }
.sg-search-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--color-muted2); font-size: 14px; line-height: 1; display: flex; align-items: center; padding: 2px; border-radius: 3px; }
.sg-search-clear:hover { color: var(--color-danger); }
.sg-search-count { font-size: 12px; color: var(--color-muted); white-space: nowrap; font-weight: 500; }

/* ── Dropzone (subir imagen con arrastrar y soltar) ───────────────────────────── */
.sg-dropzone {
    position: relative; border: 2px dashed var(--color-border); border-radius: var(--radius);
    background: var(--color-bg); min-height: 150px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: border-color var(--transition), background var(--transition);
}
.sg-dropzone:hover { border-color: var(--sg-blue); background: rgba(59,82,192,.03); }
.sg-dropzone.is-dragover { border-color: var(--sg-green); background: rgba(62,165,110,.06); }
.sg-dropzone-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--color-muted); padding: 24px; text-align: center; pointer-events: none; }
.sg-dropzone-empty svg { opacity: .45; }
.sg-dropzone-empty strong { color: var(--color-text); font-weight: 600; font-size: 13px; }
.sg-dropzone-empty span { font-size: 12px; }
.sg-dropzone-preview { position: relative; width: 100%; line-height: 0; }
.sg-dropzone-preview img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.sg-dropzone-remove {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(15,20,30,.6); color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background var(--transition);
}
.sg-dropzone-remove:hover { background: rgba(197,48,48,.9); }

/* ── Paginación ─────────────────────────────────────────────────────────────── */
.sg-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--color-border); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); font-size: 13px; color: var(--color-muted); flex-wrap: wrap; gap: 8px; }
.sg-pagination-pages { display: flex; gap: 4px; align-items: center; }
.sg-page-btn { min-width: 32px; height: 32px; border-radius: 6px; border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 6px; transition: all var(--transition); font-family: inherit; }
.sg-page-btn:hover:not(:disabled) { border-color: var(--sg-blue); color: var(--sg-blue); }
.sg-page-btn.active { background: var(--sg-blue); border-color: var(--sg-blue); color: #fff; font-weight: 700; }
.sg-page-btn:disabled { opacity: .35; cursor: not-allowed; }
.sg-page-ellipsis { padding: 0 4px; color: var(--color-muted2); }

/* ── Grid de cursos (tarjetas) ─────────────────────────────────────────────── */
.curso-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.curso-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform var(--transition), box-shadow var(--transition); }
.curso-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.curso-card-top { height: 6px; background: var(--sg-grad); }
.curso-card-body { padding: 18px; flex: 1; }
.curso-card-body h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.curso-card-body .docente { font-size: 12px; color: var(--color-muted); margin-bottom: 10px; }
.curso-card-body p { font-size: 12.5px; color: var(--color-muted); }
.curso-card-footer { padding: 12px 18px; border-top: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; gap: 4px; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: #f0fff4; color: #2f855a; }
.badge-danger  { background: #fff5f5; color: #c53030; }
.badge-warn    { background: #fffbeb; color: #b7791f; }
.badge-muted   { background: #f7fafc; color: #718096; }

/* ── Dashboard (grid de cursos + panel "Por hacer") ────────────────────────── */
.dashboard-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .dashboard-layout { grid-template-columns: 1fr; } }
.dash-panel-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dash-panel-title svg { width: 16px; height: 16px; color: var(--color-muted); }
.dash-todo-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.dash-todo-item:last-child { border-bottom: none; }
.dash-todo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sg-blue); margin-top: 5px; flex-shrink: 0; }
.dash-todo-body { min-width: 0; }
.dash-todo-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-todo-sub { font-size: 11.5px; color: var(--color-muted); margin-top: 2px; }

/* ── Módulos (dentro de un curso) ───────────────────────────────────────────── */
.modulo-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.modulo-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: #fafbfc; border-bottom: 1px solid var(--color-border); }
.modulo-head h3 { font-size: 14.5px; font-weight: 700; flex: 1; min-width: 0; }
.modulo-head .badge { flex-shrink: 0; }
.modulo-actions { display: flex; gap: 6px; flex-shrink: 0; }
.modulo-items { list-style: none; }
.modulo-item-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid #f0f4f8; }
.modulo-item-row:last-child { border-bottom: none; }
.modulo-item-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--color-bg); display: flex; align-items: center; justify-content: center; color: var(--sg-blue); flex-shrink: 0; }
.modulo-item-icon svg { width: 16px; height: 16px; }
.modulo-item-body { flex: 1; min-width: 0; }
.modulo-item-title { font-size: 13.5px; font-weight: 600; }
.modulo-item-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--color-border); background: var(--color-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; transition: all var(--transition); padding: 0; }
.modulo-item-check.is-done { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.modulo-item-check svg { width: 13px; height: 13px; }
.modulo-item-empty { padding: 16px; text-align: center; color: var(--color-muted); font-size: 12.5px; }

/* ── Formularios ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--color-muted); text-transform: uppercase; letter-spacing: .4px; }
.form-control { width: 100%; padding: 9px 12px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; outline: none; transition: border-color var(--transition), box-shadow var(--transition); background: var(--color-surface); color: var(--color-text); }
.form-control:focus { border-color: var(--sg-blue); box-shadow: 0 0 0 3px rgba(59,82,192,.12); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Mostrar/ocultar contraseña ────────────────────────────────────────────── */
.pwd-wrap { position: relative; }
.pwd-wrap .form-control { padding-right: 40px; }
.pwd-toggle {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px;
    color: var(--color-muted2); display: flex; align-items: center; justify-content: center;
    transition: color var(--transition), background var(--transition);
}
.pwd-toggle:hover { color: var(--color-text); background: var(--color-bg); }

/* ── Combo buscable (autocompletado sobre una lista cacheada, sin librería) ───── */
.sg-combo { position: relative; }
.sg-combo-list {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
    background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto;
}
.sg-combo-item { padding: 8px 12px; font-size: 13.5px; cursor: pointer; }
.sg-combo-item:hover, .sg-combo-item.is-active { background: rgba(59,82,192,.08); }
.sg-combo-empty { padding: 10px 12px; font-size: 12.5px; color: var(--color-muted); font-style: italic; }

/* ── Botones ────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: var(--radius-sm); padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap; line-height: 1.4; font-family: inherit; }
.btn-primary { background: var(--sg-grad); color: #fff; box-shadow: 0 2px 8px rgba(59,82,192,.25); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(59,82,192,.35); }
.btn-danger  { background: var(--color-danger); color: #fff; }
.btn-danger:hover { filter: brightness(.9); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { filter: brightness(.9); }
.btn-ghost { background: transparent; color: var(--color-muted); border: 1.5px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }
.btn-outline { background: var(--color-surface); color: var(--sg-blue); border: 1.5px solid var(--sg-blue); }
.btn-outline:hover { background: rgba(59,82,192,.08); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn-logout { color: rgba(255,255,255,.65); text-decoration: none; font-size: 12px; font-weight: 500; padding: 5px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; transition: all var(--transition); }
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.sg-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-muted); cursor: pointer; transition: all var(--transition); padding: 0; }
.sg-icon-btn:hover { border-color: var(--sg-blue); color: var(--sg-blue); background: rgba(59,82,192,.06); }
.sg-icon-btn.sg-icon-btn-danger { color: var(--color-danger); border-color: rgba(229,62,62,.35); }
.sg-icon-btn.sg-icon-btn-danger:hover { background: rgba(229,62,62,.08); border-color: var(--color-danger); }

/* ── Alertas ────────────────────────────────────────────────────────────────── */
.alert { padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border-left: 3px solid; }
.alert-error   { background: #fff5f5; color: var(--color-danger); border-color: var(--color-danger); }
.alert-success { background: #f0fff4; color: var(--color-success); border-color: var(--color-success); }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(15,20,30,.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--color-surface); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.25); width: 100%; max-width: 480px; max-height: 90vh; overflow: visible; animation: sgModalIn .2s cubic-bezier(.4,0,.2,1); }
@keyframes sgModalIn { from { opacity:0; transform: scale(.95) translateY(8px); } to { opacity:1; transform:none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--color-border); font-weight: 700; font-size: 15px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--color-muted); width: 28px; height: 28px; display:flex; align-items:center; justify-content:center; border-radius:50%; }
.modal-close:hover { background: var(--color-bg); }
.modal-body { padding: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ── Loader de acción (guardar/eliminar/matricular/calificar, etc.) ──────────── */
.action-loader-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(240,243,249,.6); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
}
.action-loader-overlay .sg-loader-mark { filter: drop-shadow(0 8px 20px rgba(59,82,192,.35)); }

/* ── Progreso ───────────────────────────────────────────────────────────────── */
.progreso-track { height: 8px; background: var(--color-border); border-radius: 99px; overflow: hidden; }
.progreso-fill { height: 100%; border-radius: 99px; background: var(--sg-grad); transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.loading-text { color: var(--color-muted); font-style: italic; padding: 24px 0; text-align: center; }
.text-muted { color: var(--color-muted); }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--color-muted); }
.empty-state svg { width: 40px; height: 40px; opacity: .3; margin-bottom: 10px; }
