/* =====================================================================
   FEINT Campus Virtual — sistema de diseño
   Fundación Emprender Internacional
   Paleta derivada del logo institucional.
   ===================================================================== */

:root {
    --brand-50:  #EAF7FD;
    --brand-100: #D2EEFA;
    --brand-200: #A7DDF3;
    --brand-300: #71C9EC;
    --brand-400: #3BB7E6;
    --brand-500: #12ADE5;
    --brand-600: #0D8FBF;
    --brand-700: #0D78A6;
    --brand-800: #105F83;
    --brand-900: #324C71;
    --navy:      #0B1B2B;
    --ink:       #12263A;
    --text:      #26384C;
    --muted:     #5F7183;
    --line:      #E3EAF2;
    --line-strong: #D3DEE9;
    --bg:        #F4F7FB;
    --surface:   #FFFFFF;
    --success:   #15803D;
    --success-bg:#ECFDF3;
    --success-line:#BBF7D0;
    --warning:   #B45309;
    --warning-bg:#FFFBEB;
    --warning-line:#FDE68A;
    --danger:    #B91C1C;
    --danger-bg: #FEF2F2;
    --danger-line:#FECACA;
    --info:      #0B5B7F;
    --info-bg:   #EFF8FF;
    --info-line: #BFE3F7;

    --grad-brand: linear-gradient(135deg, #12ADE5 0%, #0D78A6 100%);
    --grad-navy: linear-gradient(150deg, #0B2438 0%, #0D5C86 55%, #0D78A6 100%);
    --grad-soft: linear-gradient(180deg, #FFFFFF 0%, #F4F9FD 100%);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 27, 45, .06);
    --shadow-sm: 0 2px 8px -2px rgba(15, 27, 45, .08);
    --shadow-md: 0 12px 32px -16px rgba(15, 27, 45, .18);
    --shadow-lg: 0 28px 64px -28px rgba(11, 36, 56, .35);

    --font-sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, sans-serif;

    --sidebar-width: 276px;
    --header-height: 76px;
    --topbar-height: 70px;
}

/* ------------------------------ Reset ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

p { margin: 0; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-800); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.rotate-180 { transform: rotate(180deg); }

/* ---------------------------- Utilidades --------------------------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-strong { font-weight: 700; color: var(--ink); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); border: 0; margin: 8px 0; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; top: -60px; left: 16px; z-index: 200;
    background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px;
    transition: top .2s;
}
.skip-link:focus { top: 0; color: #fff; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand-600);
}
.eyebrow-light { color: #9AD9F5; }
.eyebrow::before { content: ''; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* ----------------------------- Botones ----------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 0 20px; height: 46px;
    border-radius: 12px; border: 1px solid transparent;
    font-size: 14.5px; font-weight: 650; font-family: var(--font-sans);
    letter-spacing: .01em; cursor: pointer; text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
    white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 22px -12px rgba(13, 120, 166, .7); }
.btn-primary:hover { color: #fff; box-shadow: 0 14px 28px -12px rgba(13, 120, 166, .8); }
.btn-secondary { background: var(--brand-900); color: #fff; }
.btn-secondary:hover { color: #fff; background: #3B587F; }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-800); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: rgba(15, 27, 45, .06); color: var(--ink); }
.btn-light { background: #fff; color: var(--brand-800); box-shadow: var(--shadow-sm); }
.btn-light:hover { color: var(--brand-900); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; background: #a11616; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { color: #fff; background: #116634; }
.btn-sm { height: 38px; padding: 0 15px; font-size: 13.5px; border-radius: 10px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; padding: 0; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand-700); font-weight: 650; cursor: pointer; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 11px;
    border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer;
    transition: background .18s, color .18s;
    position: relative;
}
.icon-btn:hover { background: #EEF4FA; color: var(--brand-800); }
.icon-btn .icon { width: 21px; height: 21px; }

/* ----------------------------- Badges ------------------------------ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--radius-full);
    font-size: 11.5px; font-weight: 700; line-height: 1.4; letter-spacing: .01em;
    white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-line); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-line); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-line); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-line); }
.badge-brand   { background: var(--brand-50);   color: var(--brand-700); border: 1px solid var(--brand-200); }
.badge-muted   { background: #F1F5F9;           color: #55677A; border: 1px solid var(--line); }
.badge-soft    { background: var(--brand-50);   color: var(--brand-700); }
.badge-lg { padding: 6px 13px; font-size: 12.5px; }

.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: var(--radius-full);
    background: #fff; border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--text);
    transition: border-color .18s, background .18s, color .18s;
}
.chip:hover, .chip.active { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-800); }

/* ----------------------------- Formularios ------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.form-group label .req { color: var(--danger); }
.form-hint { font-size: 12.5px; color: var(--muted); }
.form-error { font-size: 12.5px; color: var(--danger); font-weight: 550; display: flex; align-items: center; gap: 5px; }

.form-control,
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="url"], select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14.5px;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235F7183' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px rgba(18, 173, 229, .14);
    background: #fff;
}
::placeholder { color: #97A6B5; }
.form-control:disabled, input:disabled, select:disabled { background: #F3F6FA; color: var(--muted); cursor: not-allowed; }

.has-error .form-control, .has-error input, .has-error select, .has-error textarea {
    border-color: #F0A6A6; background: #FFFAFA;
}
.has-error .form-control:focus { box-shadow: 0 0 0 4px rgba(185, 28, 28, .1); }

.input-icon { position: relative; }
.input-icon > .icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 19px; height: 19px; color: #8A99A9; pointer-events: none;
}
.input-icon input, .input-icon select, .input-icon textarea { padding-left: 43px; }
.input-icon textarea { padding-top: 13px; }
.input-icon > textarea + .icon { top: 16px; transform: none; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: #8A99A9; cursor: pointer;
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.password-toggle:hover { background: #F1F5F9; color: var(--brand-700); }
.password-toggle .icon { width: 19px; height: 19px; }

.form-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text); }
.form-check input[type="checkbox"], .form-check input[type="radio"] {
    width: 18px; height: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--brand-600);
}
.form-check a { font-weight: 600; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.form-section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-title { font-size: 16px; font-weight: 750; margin-bottom: 4px; }
.form-section-desc { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.filter-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 18px;
}
.filter-bar .form-control, .filter-bar input, .filter-bar select { height: 40px; min-height: 40px; font-size: 13.5px; }
.filter-bar .input-icon { flex: 1 1 240px; max-width: 360px; }
.filter-bar .spacer { flex: 1; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: #CBD5E1; position: relative; transition: background .2s; }
.switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ------------------------------ Alertas ---------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.flash-stack-card { margin-bottom: 22px; }
.site-body > .flash-stack { max-width: 1200px; margin: 18px auto 0; padding: 0 28px; }
.alert {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 13px 15px; border-radius: var(--radius);
    border: 1px solid var(--line); background: #fff;
    font-size: 13.8px; line-height: 1.5; color: var(--text);
}
.alert .icon { width: 19px; height: 19px; margin-top: 1px; }
.alert-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-body strong { font-weight: 700; }
.alert-close {
    border: 0; background: transparent; color: currentColor; opacity: .55; cursor: pointer;
    padding: 2px; border-radius: 6px; margin-left: auto;
}
.alert-close:hover { opacity: 1; background: rgba(0,0,0,.06); }
.alert-close .icon { width: 16px; height: 16px; }
.alert-success { background: var(--success-bg); border-color: var(--success-line); color: #065F46; }
.alert-info    { background: var(--info-bg); border-color: var(--info-line); color: #0B4F6C; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-line); color: #92400E; }
.alert-danger  { background: var(--danger-bg); border-color: var(--danger-line); color: #991B1B; }

/* ------------------------------ Tarjetas --------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.card-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.card-title { font-size: 16px; font-weight: 750; }
.card-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: #FAFCFE; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-flat { box-shadow: none; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-pad { padding: 22px; }

/* ---------------------------- Encabezados -------------------------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 5px; max-width: 680px; }
.page-head .page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb .icon { width: 14px; height: 14px; }

/* ------------------------------ Avatares --------------------------- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--grad-brand); color: #fff;
    font-weight: 750; letter-spacing: .02em; flex: 0 0 auto; overflow: hidden;
    font-size: 13px;
}
img.avatar { object-fit: cover; }
.avatar-xs { width: 26px; height: 26px; font-size: 10px; }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-md { width: 42px; height: 42px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 76px; height: 76px; font-size: 24px; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid #fff; margin-left: -10px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ------------------------------ Tablas ----------------------------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 13.8px; min-width: 640px; }
.table th {
    text-align: left; padding: 12px 16px; background: #F8FAFD;
    font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #64748B;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #EDF2F7; vertical-align: middle; color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #F9FBFE; }
.table .cell-main { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.table .cell-main strong { display: block; font-weight: 650; color: var(--ink); font-size: 13.8px; }
.table .cell-main small { display: block; color: var(--muted); font-size: 12px; }
.table .table-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact th { padding: 10px 14px; }
.table-compact td { padding: 10px 14px; }
.table-empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* --------------------------- Paginación ---------------------------- */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; justify-content: flex-end; }
.page-btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    color: var(--text); font-size: 13.5px; font-weight: 600;
}
.page-btn .icon { width: 16px; height: 16px; }
.page-btn:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }
.page-btn.active { background: var(--grad-brand); border-color: transparent; color: #fff; }
.page-btn.disabled { opacity: .45; pointer-events: none; }
.page-dots { color: var(--muted); padding: 0 4px; }

/* ----------------------------- Progreso ---------------------------- */
.progress { height: 8px; border-radius: 999px; background: #E8EEF5; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--grad-brand); transition: width .4s ease; }
.progress-success .progress-bar { background: linear-gradient(90deg, #16A34A, #15803D); }
.progress-info .progress-bar { background: linear-gradient(90deg, #12ADE5, #0D78A6); }
.progress-brand .progress-bar { background: var(--grad-brand); }
.progress-lg { height: 10px; }
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line .progress { flex: 1; }
.progress-value { font-size: 12.5px; font-weight: 700; color: var(--ink); min-width: 38px; text-align: right; }

/* ----------------------------- Dropdown ---------------------------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 9px); right: 0; z-index: 60;
    min-width: 236px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 7px; animation: dropdownIn .16s ease;
}
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-menu[hidden] { display: none; }
.dropdown-menu-left { right: auto; left: 0; }
.dropdown-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; font-size: 13px; }
.dropdown-user { display: flex; align-items: center; gap: 10px; padding: 9px 11px; }
.dropdown-user strong { display: block; font-size: 13.5px; }
.dropdown-user small { display: block; color: var(--muted); font-size: 12px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 11px; border-radius: 9px; border: 0; background: transparent;
    font-size: 13.5px; font-weight: 550; color: var(--text); text-align: left; cursor: pointer;
}
.dropdown-item .icon { width: 18px; height: 18px; color: #7B8A9A; }
.dropdown-item:hover { background: #F2F7FB; color: var(--brand-800); }
.dropdown-item:hover .icon { color: var(--brand-700); }
.dropdown-item-danger { color: var(--danger); }
.dropdown-item-danger .icon { color: currentColor; }
.dropdown-item-danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.dropdown-empty { padding: 22px 16px; text-align: center; color: var(--muted); }
.dropdown-empty .icon { width: 26px; height: 26px; margin: 0 auto 8px; color: #A5B4C3; }
.dropdown-empty p { font-size: 13px; font-weight: 600; color: var(--text); }
.dropdown-empty small { font-size: 12px; }
.dropdown-notifications { width: 320px; }

/* ------------------------------ Tabs ------------------------------- */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-btn {
    padding: 12px 16px; border: 0; background: transparent; cursor: pointer;
    font-size: 13.8px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn:hover { color: var(--brand-700); }
.tab-btn.active { color: var(--brand-700); border-bottom-color: var(--brand-500); }

/* --------------------------- Tarjetas stat ------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 13px;
    box-shadow: var(--shadow-xs);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand-700);
}
.stat-icon .icon { width: 21px; height: 21px; }
.stat-icon.is-cyan { background: #E6F8FE; color: #0D8FBF; }
.stat-icon.is-green { background: var(--success-bg); color: var(--success); }
.stat-icon.is-amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.is-red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.is-navy { background: #EDF1F7; color: var(--brand-900); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stat-trend { font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend .icon { width: 14px; height: 14px; }

/* --------------------------- Estado vacío -------------------------- */
.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty-state .empty-icon {
    width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand-600);
}
.empty-state .empty-icon .icon { width: 28px; height: 28px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 420px; margin: 0 auto 18px; }

/* --------------------------- Lista simple -------------------------- */
.list { display: flex; flex-direction: column; }
.list-item {
    display: flex; align-items: center; gap: 13px;
    padding: 13px 0; border-bottom: 1px solid #EDF2F7;
}
.list-item:last-child { border-bottom: 0; }
.list-item-main { flex: 1; min-width: 0; }
.list-item-main strong { display: block; font-size: 13.8px; color: var(--ink); font-weight: 650; }
.list-item-main small { display: block; font-size: 12.2px; color: var(--muted); }
.list-icon {
    width: 40px; height: 40px; border-radius: 11px; background: #F1F7FB; color: var(--brand-700);
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.list-icon .icon { width: 19px; height: 19px; }

/* =====================================================================
   SITIO PÚBLICO
   ===================================================================== */
.site-body { background: #fff; }

.site-header {
    position: sticky; top: 0; z-index: 80;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(227, 234, 242, .9);
}
.site-header-inner { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 52px; width: auto; }
.brand-divider { width: 1px; height: 34px; background: var(--line-strong); }
.brand-product { display: flex; flex-direction: column; line-height: 1.2; }
.brand-product strong { font-size: 14.5px; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.brand-product small { font-size: 11px; color: var(--muted); font-weight: 550; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav-link { padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: #45566A; transition: background .18s, color .18s; }
.site-nav-link:hover { background: #F2F7FB; color: var(--brand-800); }
.site-nav-link.active { color: var(--brand-700); background: var(--brand-50); }
.site-header-actions { display: flex; align-items: center; gap: 9px; }
.nav-toggle { display: none; }

/* Hero */
.hero {
    position: relative; overflow: hidden;
    background: var(--grad-navy);
    color: #fff;
    padding: 76px 0 88px;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        radial-gradient(900px 420px at 82% -10%, rgba(18, 173, 229, .35), transparent 65%),
        radial-gradient(700px 500px at 8% 110%, rgba(18, 173, 229, .18), transparent 60%);
    pointer-events: none;
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.6), transparent 72%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.02fr .98fr; gap: 56px; align-items: center; }
.hero-copy { max-width: 610px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px 7px 9px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
    font-size: 12.5px; font-weight: 600; color: #D9F1FB; margin-bottom: 22px;
    backdrop-filter: blur(6px);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 4px rgba(74,222,128,.18); }
.hero h1 {
    color: #fff; font-size: clamp(36px, 4.2vw, 54px); line-height: 1.06; font-weight: 800; letter-spacing: -.03em;
    margin-bottom: 20px;
}
.hero h1 .accent {
    background: linear-gradient(90deg, #6FD8F7 0%, #12ADE5 60%, #7DD3FC 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 17px; line-height: 1.6; color: rgba(226, 242, 251, .82); max-width: 540px; margin-bottom: 28px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 38px; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.04); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.45); color: #fff; }
.hero-stats { display: flex; align-items: center; gap: 34px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 26px; font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -.02em; }
.hero-stat span { font-size: 12.5px; color: rgba(210, 235, 247, .72); }
.hero-stat + .hero-stat { position: relative; }
.hero-stat + .hero-stat::before { content: ''; position: absolute; left: -17px; top: 4px; bottom: 4px; width: 1px; background: rgba(255,255,255,.16); }

.hero-visual { position: relative; min-height: 420px; }
.hero-glow {
    position: absolute; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(18,173,229,.4), transparent 62%);
    top: 20px; right: -40px; filter: blur(6px);
}
.mock-diploma {
    position: relative; z-index: 2;
    background: #fff; border-radius: 22px; padding: 26px 26px 22px;
    color: var(--ink); box-shadow: var(--shadow-lg);
    transform: rotate(-2.5deg);
    border: 1px solid rgba(255,255,255,.6);
    max-width: 400px; margin-left: auto;
}
.mock-diploma-head { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.mock-diploma-head img { height: 38px; width: auto; }
.mock-diploma-head small { font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.mock-diploma-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: .02em; color: var(--brand-900); }
.mock-diploma-sub { font-size: 11.5px; color: var(--muted); margin: 4px 0 16px; }
.mock-diploma-name { font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 2px; }
.mock-diploma-course { font-size: 13px; color: var(--brand-700); font-weight: 600; margin-bottom: 18px; }
.mock-diploma-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mock-diploma-meta { font-size: 10.5px; color: var(--muted); }
.mock-diploma-meta strong { display: block; font-size: 12px; color: var(--ink); font-weight: 700; }
.mock-qr { width: 58px; height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 5px; }
.mock-qr-grid {
    width: 100%; height: 100%;
    background-image:
        linear-gradient(45deg, #0B1B2B 25%, transparent 25%, transparent 75%, #0B1B2B 75%),
        linear-gradient(45deg, #0B1B2B 25%, transparent 25%, transparent 75%, #0B1B2B 75%);
    background-size: 12px 12px; background-position: 0 0, 6px 6px;
}
.mock-badge {
    position: absolute; z-index: 3;
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-md);
    padding: 13px 16px; display: flex; align-items: center; gap: 11px;
    border: 1px solid rgba(227,234,242,.9);
    color: var(--ink);
}
.mock-badge-1 { left: -18px; bottom: 30px; transform: rotate(2deg); }
.mock-badge-2 { right: -12px; top: -52px; transform: rotate(3deg); }
.mock-badge-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.mock-badge-icon .icon { width: 19px; height: 19px; }
.mock-badge strong { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink); }
.mock-badge small { display: block; font-size: 11.5px; color: var(--muted); }

/* Secciones */
.section { padding: 76px 0; }
.section-tight { padding: 54px 0; }
.section-alt { background: #F6FAFD; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -.025em; margin: 12px 0 12px; }
.section-head p { color: var(--muted); font-size: 15.5px; }
.section-head-left { max-width: none; text-align: left; margin: 0 0 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head-left > div { max-width: 620px; }

.trust-bar { padding: 26px 0; border-bottom: 1px solid var(--line); background: #fff; }
.trust-items { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.trust-item .icon { width: 22px; height: 22px; color: var(--brand-600); }

/* Tarjetas de curso */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 22px; }
.course-card {
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    color: inherit;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-200); color: inherit; }
.course-cover {
    position: relative; height: 148px;
    background: linear-gradient(135deg, var(--cover-color, #0D78A6) 0%, color-mix(in srgb, var(--cover-color, #0D78A6) 45%, #0B1B2B) 100%);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.course-cover::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 78% 18%, rgba(255,255,255,.28), transparent 42%),
        linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
    background-size: auto, 34px 34px, 34px 34px;
    opacity: .8;
}
.course-cover .icon { width: 48px; height: 48px; color: rgba(255,255,255,.92); position: relative; z-index: 1; }
.course-cover-tag {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.24);
    color: #fff; backdrop-filter: blur(6px);
    font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.course-cover-price {
    position: absolute; bottom: 12px; right: 12px; z-index: 2;
    background: #fff; color: var(--brand-900); font-weight: 800; font-size: 13px;
    padding: 5px 11px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.course-body { padding: 18px 19px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.course-cat { font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.course-title { font-size: 16.5px; font-weight: 750; line-height: 1.32; color: var(--ink); letter-spacing: -.01em; }
.course-summary { font-size: 13px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: auto; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta .icon { width: 15px; height: 15px; color: #8A99A9; }
.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid #EDF2F7; margin-top: 4px; }
.course-instructor { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); font-weight: 600; }
.course-instructor .avatar { width: 28px; height: 28px; font-size: 10px; }

/* Categorías */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.category-card {
    display: flex; align-items: center; gap: 14px; padding: 18px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.category-card:hover { border-color: var(--brand-200); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: inherit; }
.category-icon {
    width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand-700);
}
.category-icon .icon { width: 22px; height: 22px; }
.category-card strong { display: block; font-size: 14px; color: var(--ink); font-weight: 700; }
.category-card small { display: block; font-size: 12px; color: var(--muted); }

/* Sección certificación */
.cert-section { position: relative; overflow: hidden; background: var(--grad-navy); color: #fff; padding: 70px 0; }
.cert-section::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(700px 300px at 15% 20%, rgba(18,173,229,.3), transparent 60%),
        radial-gradient(500px 320px at 90% 90%, rgba(18,173,229,.2), transparent 60%);
}
.cert-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 460px; gap: 48px; align-items: center; }
.cert-copy h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); margin: 14px 0 14px; letter-spacing: -.02em; }
.cert-copy p { color: rgba(219, 239, 250, .8); font-size: 15.5px; max-width: 540px; }
.cert-points { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.cert-point { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: rgba(235, 246, 252, .9); }
.cert-point .icon { width: 20px; height: 20px; color: #6FD8F7; margin-top: 2px; }
.verify-card { background: #fff; border-radius: var(--radius-xl); padding: 30px; box-shadow: var(--shadow-lg); color: var(--ink); }
.verify-card h3 { font-size: 20px; margin-bottom: 6px; }
.verify-card p { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.verify-card .input-icon { margin-bottom: 12px; }
.verify-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.verify-hint .icon { width: 15px; height: 15px; }
.verify-result { margin-top: 6px; }

/* Testimonios */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.testimonial {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 26px; display: flex; flex-direction: column; gap: 16px;
}
.testimonial-stars { display: flex; gap: 3px; color: #F59E0B; }
.testimonial-stars .icon { width: 16px; height: 16px; fill: currentColor; }
.testimonial p { font-size: 14px; color: var(--text); line-height: 1.6; }
.testimonial-author { display: flex; align-items: center; gap: 11px; margin-top: auto; }
.testimonial-author strong { display: block; font-size: 13.5px; color: var(--ink); }
.testimonial-author small { font-size: 12px; color: var(--muted); }

/* CTA final */
.cta-band { padding: 60px 0; }
.cta-card {
    position: relative; overflow: hidden;
    background: linear-gradient(120deg, #0D78A6 0%, #12ADE5 100%);
    color: #fff; border-radius: var(--radius-xl); padding: 48px 52px;
    display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}
.cta-card::before {
    content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%;
    background: rgba(255,255,255,.12); top: -200px; right: -80px;
}
.cta-card h2 { color: #fff; font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 8px; letter-spacing: -.02em; }
.cta-card p { color: rgba(255,255,255,.85); font-size: 15px; max-width: 560px; }
.cta-card .btn-light { position: relative; z-index: 2; }

/* Footer */
.site-footer { background: #0A1A2A; color: rgba(214, 231, 243, .72); padding: 58px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.4fr; gap: 42px; }
.footer-brand p { font-size: 13.5px; line-height: 1.65; margin: 16px 0 18px; max-width: 330px; color: rgba(196, 219, 235, .68); }
.footer-logo { height: 74px; width: auto; background: #fff; padding: 10px 14px; border-radius: 14px; }
.footer-social { display: flex; align-items: center; gap: 8px; }
.footer-social-label { font-size: 12px; margin-right: 4px; color: rgba(196, 219, 235, .6); }
.footer-social a {
    width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.07); color: #CFE6F4;
}
.footer-social a:hover { background: rgba(18,173,229,.22); color: #fff; }
.footer-social .icon { width: 17px; height: 17px; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(196, 219, 235, .72); font-size: 13.5px; padding: 5px 0; }
.footer-col a:hover { color: #fff; }
.footer-contact p { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; margin-bottom: 10px; }
.footer-contact .icon { width: 16px; height: 16px; color: #6FD8F7; margin-top: 2px; flex: 0 0 auto; }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,.09); margin-top: 40px; padding-top: 20px;
    font-size: 12.5px; color: rgba(180, 205, 222, .6);
}

/* =====================================================================
   AUTENTICACIÓN
   ===================================================================== */
.auth-body { background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: 46% 54%; min-height: 100vh; }
.auth-aside {
    position: relative; overflow: hidden;
    background: var(--grad-navy); color: #fff;
    display: flex; flex-direction: column;
    padding: 44px 48px;
}
.auth-aside-inner { position: relative; z-index: 2; display: flex; flex-direction: column; flex: 1; }
.auth-brand img { height: 68px; width: auto; background: #fff; padding: 10px 14px; border-radius: 16px; }
.auth-aside-copy { margin-top: auto; padding-top: 48px; max-width: 440px; }
.auth-aside-copy h1 { color: #fff; font-size: clamp(30px, 3vw, 40px); line-height: 1.12; letter-spacing: -.025em; margin: 14px 0 16px; }
.auth-aside-copy p { color: rgba(219, 239, 250, .8); font-size: 14.8px; line-height: 1.65; }
.auth-benefits { display: flex; flex-direction: column; gap: 18px; margin-top: 34px; }
.auth-benefits li { display: flex; align-items: flex-start; gap: 13px; }
.auth-benefit-icon {
    width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
    display: flex; align-items: center; justify-content: center; color: #7DD3FC;
}
.auth-benefit-icon .icon { width: 20px; height: 20px; }
.auth-benefits strong { display: block; color: #fff; font-size: 13.8px; font-weight: 700; }
.auth-benefits small { display: block; color: rgba(199, 225, 240, .7); font-size: 12.5px; margin-top: 2px; line-height: 1.5; }
.auth-aside-footer { margin-top: 36px; font-size: 11.5px; color: rgba(190, 218, 235, .55); }
.auth-aside-decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.decor-blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.decor-blob-1 { width: 420px; height: 420px; right: -140px; top: -120px; background: radial-gradient(circle, rgba(18,173,229,.42), transparent 62%); }
.decor-blob-2 { width: 360px; height: 360px; left: -120px; bottom: -110px; background: radial-gradient(circle, rgba(18,173,229,.24), transparent 62%); }
.decor-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,.5) 40%, transparent);
}
.auth-main {
    position: relative; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 40px 28px; background: var(--bg);
}
.auth-main-top { position: absolute; top: 26px; left: 32px; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-back:hover { color: var(--brand-700); }
.auth-back .icon { width: 16px; height: 16px; }
.auth-card {
    width: 100%; max-width: 452px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md); padding: 38px 38px 34px;
}
.auth-title { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 7px; }
.auth-sub { font-size: 13.8px; color: var(--muted); margin-bottom: 26px; }
.auth-card .form-group { margin-bottom: 17px; }
.auth-card .form-group:last-of-type { margin-bottom: 0; }
.auth-legal { font-size: 11.5px; color: #8797A7; text-align: center; margin-top: 18px; max-width: 420px; line-height: 1.6; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 22px; }
.auth-alt a { font-weight: 700; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: #93A3B2; font-size: 11.5px; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.demo-box {
    margin-top: 22px; padding: 14px 16px; border-radius: var(--radius);
    background: var(--brand-50); border: 1px dashed var(--brand-200);
}
.demo-box-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); margin-bottom: 9px; }
.demo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12.5px; }
.demo-row code { font-family: 'Cascadia Code', Consolas, monospace; font-size: 12px; color: var(--brand-800); background: rgba(255,255,255,.7); padding: 2px 7px; border-radius: 6px; }
.demo-row .badge { font-size: 10.5px; }
.demo-note { font-size: 11.5px; color: var(--brand-800); margin-top: 9px; opacity: .85; }

/* =====================================================================
   PANEL (DASHBOARD)
   ===================================================================== */
.dashboard-body { background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; align-self: flex-start;
    width: var(--sidebar-width); flex: 0 0 var(--sidebar-width);
    height: 100vh; display: flex; flex-direction: column;
    background: #fff; border-right: 1px solid var(--line); z-index: 90;
}
.sidebar-head { padding: 20px 18px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-brand img { height: 46px; width: auto; flex: 0 0 auto; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.22; min-width: 0; }
.sidebar-brand-text strong { font-size: 13px; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.sidebar-brand-text small { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.sidebar-close { display: none; }
.sidebar-user {
    margin: 4px 14px 12px; padding: 11px 12px;
    display: flex; align-items: center; gap: 11px;
    background: #F5F9FD; border: 1px solid #E9F1F8; border-radius: 13px;
}
.sidebar-user-meta { flex: 1; min-width: 0; line-height: 1.3; }
.sidebar-user-meta strong { display: block; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sidebar-user-meta small { display: block; font-size: 11.5px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.16); flex: 0 0 auto; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #DCE5EE; border-radius: 999px; }
.sidebar-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 10px;
    font-size: 13.7px; font-weight: 550; color: #43566B;
    border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer;
    transition: background .16s, color .16s; position: relative;
}
.sidebar-link .icon { width: 20px; height: 20px; color: #8A99A9; flex: 0 0 auto; }
.sidebar-link:hover { background: #F3F8FC; color: var(--brand-800); }
.sidebar-link:hover .icon { color: var(--brand-700); }
.sidebar-link.active { background: var(--brand-50); color: var(--brand-800); font-weight: 700; }
.sidebar-link.active .icon { color: var(--brand-700); }
.sidebar-link.active::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
    background: var(--grad-brand); border-radius: 0 3px 3px 0;
}
.sidebar-foot {
    padding: 12px 12px 16px; border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 2px;
}
.sidebar-link-muted { color: var(--muted); font-size: 13px; }
.sidebar-link-danger { color: var(--danger); }
.sidebar-link-danger .icon { color: currentColor; }
.sidebar-link-danger:hover { background: var(--danger-bg); color: var(--danger); }
.sidebar-link-danger:hover .icon { color: var(--danger); }
.logout-form { margin: 0; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(11, 27, 43, .45); z-index: 85; }
.sidebar-overlay[hidden] { display: none; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 70;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 0 26px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-menu { display: none; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.topbar-role { font-weight: 700; color: var(--brand-700); }
.topbar-sep { color: #B7C4D0; }
.topbar-page { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.topbar-search {
    display: flex; align-items: center; gap: 8px;
    width: 300px; height: 40px; padding: 0 13px;
    background: #F2F6FA; border: 1px solid transparent; border-radius: 11px;
    color: #8A99A9; transition: border-color .18s, background .18s;
}
.topbar-search:focus-within { background: #fff; border-color: var(--brand-300); box-shadow: 0 0 0 3px rgba(18,173,229,.1); }
.topbar-search .icon { width: 18px; height: 18px; flex: 0 0 auto; }
.topbar-search input {
    border: 0; background: transparent; padding: 0; min-height: 0; height: 100%;
    font-size: 13.5px; color: var(--ink); box-shadow: none;
}
.topbar-search input:focus { box-shadow: none; background: transparent; }
.topbar-icon { width: 40px; height: 40px; border-radius: 10px; }
.notification-dot {
    position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
    border-radius: 50%; background: var(--brand-500);
    border: 2px solid #fff; box-sizing: content-box;
}
.topbar-user {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 9px 4px 5px; border-radius: 11px;
    border: 1px solid transparent; background: transparent; cursor: pointer;
    color: var(--ink); font-size: 13px; font-weight: 650;
}
.topbar-user:hover { background: #F3F8FC; border-color: var(--line); }
.topbar-user .avatar { width: 32px; height: 32px; font-size: 11px; }
.topbar-user .chevron { width: 15px; height: 15px; color: #8A99A9; }
.topbar-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-content { flex: 1; padding: 28px 30px 36px; width: 100%; max-width: 1480px; margin: 0 auto; }
.app-footer {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 16px 30px 20px; font-size: 12px; color: #8A99A9;
}
.app-footer a { color: #8A99A9; }
.app-footer a:hover { color: var(--brand-700); }
.app-footer-sep { color: #C3CED8; }

/* Dashboard widgets */
.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.dashboard-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.widget-title { font-size: 15px; font-weight: 750; }
.widget-body { padding: 18px 20px; }
.widget-link { font-size: 12.5px; font-weight: 700; color: var(--brand-700); display: inline-flex; align-items: center; gap: 4px; }
.widget-link .icon { width: 14px; height: 14px; }

.course-progress-card {
    display: flex; gap: 15px; padding: 15px;
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.course-progress-cover {
    width: 92px; height: 74px; border-radius: 11px; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--cover-color, #0D78A6), color-mix(in srgb, var(--cover-color, #0D78A6) 45%, #0B1B2B));
    display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.92);
}
.course-progress-cover .icon { width: 30px; height: 30px; }
.course-progress-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.course-progress-main strong { font-size: 14px; color: var(--ink); font-weight: 700; line-height: 1.35; }
.course-progress-main small { font-size: 12px; color: var(--muted); }
.course-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-action {
    display: flex; align-items: center; gap: 11px; padding: 13px;
    border: 1px solid var(--line); border-radius: 12px; color: var(--text); font-size: 13px; font-weight: 600;
    background: #fff; transition: border-color .18s, background .18s;
}
.quick-action:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-800); }
.quick-action .quick-icon {
    width: 36px; height: 36px; border-radius: 10px; background: #F1F7FB; color: var(--brand-700);
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.quick-action .quick-icon .icon { width: 18px; height: 18px; }

.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed #E8EEF5; font-size: 13.5px; }
.info-row:last-child { border-bottom: 0; }
.info-row dt, .info-row .info-label { color: var(--muted); }
.info-row dd, .info-row .info-value { color: var(--ink); font-weight: 600; text-align: right; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; padding: 0 0 18px 26px; }
.timeline-item::before {
    content: ''; position: absolute; left: 6px; top: 6px; bottom: -4px; width: 2px; background: #E8EEF5;
}
.timeline-item:last-child::before { display: none; }
.timeline-item::after {
    content: ''; position: absolute; left: 0; top: 3px; width: 14px; height: 14px;
    border-radius: 50%; background: #fff; border: 3px solid var(--brand-400);
}
.timeline-item.is-done::after { border-color: var(--success); background: var(--success); }
.timeline-item strong { display: block; font-size: 13.5px; color: var(--ink); }
.timeline-item small { font-size: 12px; color: var(--muted); }

/* =====================================================================
   CERTIFICADOS
   ===================================================================== */
.certificate-verify-result { display: flex; flex-direction: column; gap: 16px; }
.verify-status { display: flex; align-items: center; gap: 13px; padding: 18px; border-radius: var(--radius); }
.verify-status.valid { background: var(--success-bg); border: 1px solid var(--success-line); }
.verify-status.invalid { background: var(--danger-bg); border: 1px solid var(--danger-line); }
.verify-status .status-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.verify-status.valid .status-icon { background: #DCFCE7; color: var(--success); }
.verify-status.invalid .status-icon { background: #FEE2E2; color: var(--danger); }
.verify-status strong { display: block; font-size: 16px; color: var(--ink); }
.verify-status small { font-size: 13px; color: var(--muted); }
.certificate-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.certificate-details > div { background: #fff; padding: 14px 16px; }
.certificate-details dt { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.certificate-details dd { font-size: 14px; color: var(--ink); font-weight: 650; }

/* Hoja de certificado imprimible */
.certificate-sheet-wrap { display: flex; justify-content: center; padding: 26px 0 40px; }
.certificate-sheet {
    position: relative; width: 100%; max-width: 1080px; aspect-ratio: 1.414;
    background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); overflow: hidden;
    border: 1px solid var(--line);
}
.certificate-inner {
    position: relative; height: 100%; padding: 6.5% 7%;
    display: flex; flex-direction: column;
    background:
        radial-gradient(720px 360px at 110% -10%, rgba(18,173,229,.1), transparent 60%),
        radial-gradient(600px 320px at -10% 110%, rgba(13,120,166,.08), transparent 60%),
        #fff;
}
.certificate-frame { position: absolute; inset: 2.4%; border: 2px solid #E3EEF6; border-radius: 4px; pointer-events: none; }
.certificate-frame::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(18,173,229,.18); border-radius: 2px; }
.certificate-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.certificate-brand img { height: 74px; width: auto; }
.certificate-brand small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: .04em; }
.certificate-code { text-align: right; font-size: 10.5px; color: var(--muted); }
.certificate-code strong { display: block; font-size: 13px; color: var(--brand-900); letter-spacing: .06em; }
.certificate-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2% 0; }
.certificate-kicker { font-size: 11px; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; color: var(--brand-600); }
.certificate-title { font-size: clamp(26px, 3.4vw, 44px); font-weight: 800; letter-spacing: .04em; color: var(--brand-900); margin: 8px 0 2%; }
.certificate-title span { display: block; font-size: .34em; letter-spacing: .28em; color: var(--brand-600); font-weight: 800; margin-top: 8px; }
.certificate-lead { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.certificate-name { font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 46px); font-weight: 800; color: var(--ink); margin: 8px 0 4px; letter-spacing: -.02em; }
.certificate-line { width: 46%; height: 1px; background: linear-gradient(90deg, transparent, var(--brand-400), transparent); margin: 10px 0; }
.certificate-text { font-size: 14px; color: var(--text); max-width: 680px; line-height: 1.65; }
.certificate-text strong { color: var(--brand-800); }
.certificate-hours { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 16px; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); font-size: 12.5px; font-weight: 700; }
.certificate-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.cert-signature { flex: 1; text-align: center; max-width: 260px; }
.cert-signature-line { height: 1px; background: #CBD5E1; margin-bottom: 8px; }
.cert-signature strong { display: block; font-size: 12.5px; color: var(--ink); }
.cert-signature small { display: block; font-size: 10.5px; color: var(--muted); }
.cert-qr { text-align: center; }
.cert-qr-box { width: 88px; height: 88px; margin: 0 auto 5px; border: 1px solid var(--line); border-radius: 6px; padding: 5px; background: #fff; }
.cert-qr small { font-size: 9px; color: var(--muted); }
.cert-watermark {
    position: absolute; right: -40px; bottom: -60px; width: 260px; opacity: .035; pointer-events: none;
}
.certificate-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

/* =====================================================================
   PÁGINAS DE ERROR
   ===================================================================== */
.error-page { padding: 72px 28px 96px; display: flex; justify-content: center; }
.error-card { max-width: 580px; text-align: center; }
.error-code {
    font-family: var(--font-display); font-size: clamp(72px, 10vw, 116px); font-weight: 900;
    line-height: 1; letter-spacing: -.04em;
    background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 10px;
}
.error-code-warning { background: linear-gradient(135deg, #F59E0B, #B45309); -webkit-background-clip: text; background-clip: text; }
.error-code-danger { background: linear-gradient(135deg, #EF4444, #991B1B); -webkit-background-clip: text; background-clip: text; }
.error-card h1 { font-size: 28px; margin-bottom: 12px; }
.error-card p { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.error-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* =====================================================================
   IMPRESIÓN
   ===================================================================== */
@media print {
    @page { size: A4 landscape; margin: 0; }
    body { background: #fff !important; }
    .site-header, .site-footer, .site-nav, .site-header-actions,
    .sidebar, .topbar, .app-footer, .flash-stack, .skip-link,
    .no-print, .certificate-actions, .certificate-sheet-wrap > .no-print { display: none !important; }
    .app-shell, .app-main { display: block !important; }
    .app-content { padding: 0 !important; max-width: none !important; }
    .certificate-sheet-wrap { padding: 0 !important; }
    .certificate-sheet {
        max-width: none !important; width: 297mm !important; height: 210mm !important;
        aspect-ratio: auto !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important;
    }
    .certificate-inner { padding: 14mm 18mm; }
    .certificate-frame { inset: 8mm; }
    .certificate-title { font-size: 40px !important; }
    .certificate-name { font-size: 42px !important; }
    .certificate-text { font-size: 13px !important; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1180px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1.8fr 1fr 1fr; }
    .footer-contact { grid-column: span 3; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { min-height: 100vh; padding: 64px 24px 32px; }
    .cert-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 1024px) {
    .topbar-search { width: 220px; }
    .hero-inner { grid-template-columns: 1fr; gap: 46px; }
    .hero-visual { min-height: 360px; max-width: 480px; margin: 0 auto; width: 100%; }
    .hero-copy { max-width: none; }
    .site-nav { display: none; }
    .nav-toggle { display: inline-flex; }
    .site-nav.is-open {
        display: flex; position: absolute; top: var(--header-height); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        background: #fff; border-bottom: 1px solid var(--line); padding: 12px 18px 18px;
        box-shadow: var(--shadow-md);
    }
}

@media (max-width: 980px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 120;
        transform: translateX(-102%); transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: none; }
    .sidebar-close { display: inline-flex; }
    .topbar-menu { display: inline-flex; }
    .app-content { padding: 22px 20px 30px; }
    .sidebar-open { overflow: hidden; }
    .brand-divider, .brand-product small { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 760px) {
    .container, .site-body > .flash-stack { padding-left: 18px; padding-right: 18px; }
    .site-header-inner { gap: 10px; }
    .brand-logo { height: 42px; }
    .hide-sm { display: none !important; }
    .hero { padding: 52px 0 60px; }
    .hero-stats { gap: 22px; }
    .hero-stat + .hero-stat::before { left: -11px; }
    .section { padding: 54px 0; }
    .section-head { margin-bottom: 30px; }
    .cta-card { padding: 32px 26px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-brand { grid-column: span 2; }
    .footer-contact { grid-column: span 2; }
    .dashboard-grid-3 { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .topbar-search { display: none; }
    .topbar-user-name { display: none; }
    .app-content { padding: 18px 16px 26px; }
    .page-head h1 { font-size: 22px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat-value { font-size: 24px; }
    .quick-grid { grid-template-columns: 1fr; }
    .course-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 22px; border-radius: var(--radius-lg); }
    .auth-main-top { top: 18px; left: 20px; }
    .auth-legal { margin-bottom: 20px; }
    .certificate-details { grid-template-columns: 1fr; }
    .certificate-sheet { aspect-ratio: auto; }
    .certificate-inner { padding: 22px 18px; }
    .certificate-foot { flex-direction: column; align-items: center; gap: 16px; }
    .app-footer { padding: 14px 16px 18px; }
}

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-actions .btn { width: 100%; }
    .trust-items { justify-content: center; text-align: center; }
    .section-head-left { display: block; }
    .row-between { flex-wrap: wrap; }
}
