/* =========================================
   SISTEMA DE DISEÑO: TOKENS PRIMITIVOS
   SSOT — Todos los temas consumen estas variables.
========================================= */
:root {
    --color-sena-green: #39A900;
    --color-sena-green-dark: #2d8500;
    --color-sena-green-deep: #1e5900;
    --color-sena-orange: #ff6a00;
    --color-sena-red: #ef4444;
    --color-sena-yellow: #f59e0b;

    --color-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;

    --color-ocean-50: #ecfeff;
    --color-ocean-100: #cffafe;
    --color-ocean-200: #a5f3fc;
    --color-ocean-400: #22d3ee;
    --color-ocean-500: #06b6d4;
    --color-ocean-600: #0891b2;
    --color-ocean-700: #0e7490;
    --color-ocean-800: #155e75;
    --color-ocean-900: #164e63;
    --color-ocean-950: #0a1628;

    --color-elegant-100: #e0e7ff;
    --color-elegant-200: #c7d2fe;
    --color-elegant-500: #6366f1;
    --color-elegant-600: #4f46e5;
    --color-elegant-700: #4338ca;
    --color-elegant-800: #3730a3;
    --color-elegant-900: #312e81;
    --color-elegant-950: #1e1b4b;

    --radius: 16px;
    --radius-sm: 10px;
    --blur-glass: blur(12px);
    --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.35);

    --sena-green: var(--color-sena-green);
    --sena-green-dark: var(--color-sena-green-dark);
    --sena-green-deep: var(--color-sena-green-deep);
    --sena-orange: var(--color-sena-orange);
    --sena-red: var(--color-sena-red);
    --sena-yellow: var(--color-sena-yellow);

    --gray-50: var(--bg-card);
    --gray-100: var(--color-gray-100);
    --gray-200: var(--color-gray-200);
    --gray-300: var(--color-gray-300);
    --gray-400: var(--color-gray-400);
    --gray-500: var(--color-gray-500);
    --gray-600: var(--color-gray-600);
    --gray-700: var(--color-gray-700);
    --gray-800: var(--color-gray-800);
    --gray-900: var(--color-gray-900);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --primary: var(--accent-primary);
    --button-on-accent: var(--color-white);
    --modal-backdrop: color-mix(in srgb, var(--text-strong) 72%, transparent);
}

/* =========================================
   TEMA 1: ELEGANT (Refinado, profesional)
   Indigo + grises cálidos + sombras suaves
========================================= */
:root, [data-theme="light"], [data-theme="elegant"] {
    --bg-base: #f8f9fc;
    --bg-surface: #f0f2f7;
    --bg-card: #ffffff;

    --text-strong: #1a1a2e;
    --text-main: #4a4a68;
    --text-muted: #8888a0;

    --border-divider: #e8e8f0;
    --border-subtle: #d4d4e0;

    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.15);

    --bg-glass: #ffffff;
    --bg-glass-hover: #f4f5ff;
    --border-glass: rgba(99, 102, 241, 0.08);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.04), 0 12px 28px rgba(0, 0, 0, 0.05);

    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;

    --sena-green-light: #eef7ee;
    --sena-red-light: #fef2f2;
    --sena-yellow-light: #fffbeb;
    --sena-orange-light: #fff7ed;

    --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.3);

    --navbar-bg: linear-gradient(135deg, #1e1b4b, #312e81);
    --navbar-text: #ffffff;
    --body-deco-1: radial-gradient(circle at 15% 0%, rgba(99, 102, 241, 0.04), transparent 40%);
    --body-deco-2: radial-gradient(circle at 85% 100%, rgba(129, 140, 248, 0.03), transparent 40%);
}

/* =========================================
   TEMA 2: SENA (Identidad institucional)
   Verde SENA + blanco + naranja corporativo
   Las superficies usan blanco sólido (no glass translúcido)
   para evitar grises sucios sobre el fondo verde claro.
========================================= */
[data-theme="sena"] {
    --bg-base: #f0f7ec;
    --bg-surface: #e6f0de;
    --bg-card: #ffffff;

    --text-strong: #0f1f0f;
    --text-main: #2a452a;
    --text-muted: #5a7a5a;

    --border-divider: #d0e2c4;
    --border-subtle: #b8d0aa;

    --accent-primary: #39A900;
    --accent-hover: #2d8500;
    --accent-glow: rgba(57, 169, 0, 0.18);

    /* Glassmorphism para cumplir el estilo seleccionado */
    --bg-glass: rgba(255, 255, 255, 0.65);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(57, 169, 0, 0.15);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(30, 89, 0, 0.06);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.04), 0 12px 28px rgba(30, 89, 0, 0.08);

    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;

    --sena-green-light: #e6f5e6;
    --sena-red-light: #fef2f2;
    --sena-yellow-light: #fffbeb;
    --sena-orange-light: #fff7ed;

    --badge-tech-bg: #2d8500;
    --badge-tech-text: #ffffff;
    --badge-transversal-bg: #059669;
    --badge-transversal-text: #ffffff;
    --badge-ingles-bg: #0284c7;
    --badge-ingles-text: #ffffff;
    --comp-selected-own-border: #39A900;
    --comp-selected-own-bg: linear-gradient(135deg, rgba(57, 169, 0, 0.09) 0%, var(--bg-card) 100%);
    --comp-selected-other-border: #ff6a00;
    --comp-selected-other-bg: linear-gradient(135deg, rgba(255, 106, 0, 0.09) 0%, var(--bg-card) 100%);
    --sticky-bar-bg: rgba(255, 255, 255, 0.96);
    --sticky-bar-border: rgba(57, 169, 0, 0.22);

    --focus-ring: 0 0 0 3px rgba(57, 169, 0, 0.25);

    --navbar-bg: linear-gradient(135deg, #1e5900, #39A900);
    --navbar-text: #ffffff;
    --body-deco-1: radial-gradient(circle at 10% 0%, rgba(57, 169, 0, 0.04), transparent 40%);
    --body-deco-2: radial-gradient(circle at 90% 100%, rgba(255, 106, 0, 0.02), transparent 40%);
}

/* =========================================
   TEMA 3: OCEAN / MAR (Profundidad marina)
   Navy + teal/cyan + espuma de mar
========================================= */
[data-theme="ocean"], [data-theme="dark"] {
    --bg-base: #0e1a2e;
    --bg-surface: #152a45;
    --bg-card: rgba(20, 48, 78, 0.88);

    --text-strong: #eaf5ff;
    --text-main: #c0ddf0;
    --text-muted: #80aac8;

    --border-divider: rgba(6, 182, 212, 0.14);
    --border-subtle: rgba(6, 182, 212, 0.24);

    --accent-primary: #22d3ee;
    --accent-hover: #67e8f9;
    --accent-glow: rgba(34, 211, 238, 0.30);
    --button-on-accent: var(--color-gray-900);

    --bg-glass: rgba(18, 42, 68, 0.85);
    --bg-glass-hover: rgba(22, 52, 82, 0.92);
    --border-glass: rgba(6, 182, 212, 0.10);

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);

    --input-bg: rgba(20, 48, 78, 0.70);
    --input-bg-focus: rgba(25, 55, 88, 0.85);

    --sena-green-light: rgba(6, 182, 212, 0.1);
    --sena-red-light: rgba(239, 68, 68, 0.1);
    --sena-yellow-light: rgba(245, 158, 11, 0.1);
    --sena-orange-light: rgba(255, 106, 0, 0.1);

    --badge-tech-bg: #6366f1;
    --badge-tech-text: #ffffff;
    --badge-transversal-bg: #10b981;
    --badge-transversal-text: #ffffff;
    --badge-ingles-bg: #38bdf8;
    --badge-ingles-text: #082f49;
    --comp-selected-own-border: #22d3ee;
    --comp-selected-own-bg: linear-gradient(135deg, rgba(34, 211, 238, 0.14) 0%, var(--bg-card) 100%);
    --comp-selected-other-border: #a855f7;
    --comp-selected-other-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.14) 0%, var(--bg-card) 100%);
    --sticky-bar-bg: rgba(14, 26, 46, 0.95);
    --sticky-bar-border: rgba(34, 211, 238, 0.25);

    --focus-ring: 0 0 0 3px rgba(6, 182, 212, 0.35);

    --navbar-bg: linear-gradient(135deg, #0a1628, #134e6f);
    --navbar-text: #e8f4ff;
    --body-deco-1: radial-gradient(circle at 20% 0%, rgba(6, 182, 212, 0.06), transparent 45%);
    --body-deco-2: radial-gradient(circle at 80% 100%, rgba(14, 116, 144, 0.05), transparent 45%);
}

/* =========================================
   MODALES: patrón único para todos los módulos
   Overlay, shell, header, body, footer y cierre
   consumen los tokens de tema para mantener contraste.
   ========================================= */
.modal-overlay-base,
.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    border: 0;
    background: var(--modal-backdrop);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text-main);
}

.app-modal-overlay.is-open,
.app-modal-overlay[open] {
    display: flex;
}

dialog.app-modal-overlay::backdrop {
    background: transparent;
}

.modal-content-base,
.app-modal-content {
    display: flex;
    flex-direction: column;
    width: min(100%, 32.5rem);
    max-height: min(90vh, 52rem);
    min-height: 0;
    overflow: hidden;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.app-modal-content--wide { width: min(100%, 56rem); }
.app-modal-content--compact { width: min(100%, 28rem); }
.app-modal-content--fullscreen {
    width: min(96vw, 100rem);
    height: min(94vh, 59rem);
    max-height: none;
}
.app-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.modal-header-base,
.app-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    padding: 1.15rem clamp(1rem, 3vw, 1.5rem);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-divider);
}

.ficha-toolbar {
    color: var(--text-main);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-divider);
    position: relative;
    z-index: 90;
    padding: 0.5rem 0;
}
.ficha-toolbar-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 1600px;
    min-height: 48px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    position: relative;
}
.ficha-context {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    max-width: 280px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid var(--border-divider);
}
.ficha-context-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.ficha-context span,
.ficha-context-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ficha-context strong {
    overflow: hidden;
    color: var(--accent-hover);
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ficha-context-prog {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-top: 1px;
}
.ficha-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.ficha-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.ficha-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 0 14px;
    color: var(--text-main);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
    min-height: 44px;
}
.ficha-nav a::after {
    position: absolute;
    right: 8px;
    bottom: 0;
    left: 8px;
    height: 3px;
    background: transparent;
    border-radius: 4px 4px 0 0;
    content: "";
    transition: background-color 0.2s ease;
}
.ficha-nav a:hover { color: var(--accent-hover); background: var(--bg-card); }
.ficha-nav a.is-active { color: var(--accent-hover); font-weight: 700; background: var(--bg-card); }
.ficha-nav a.is-active::after { background: var(--accent-primary); }

.page-header {
    position: relative;
    margin-bottom: 22px;
}

.modal-header-base h2,
.modal-header-base h3,
.app-modal-header h2,
.app-modal-header h3 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 800;
    line-height: 1.3;
}

.app-modal-header-copy { min-width: 0; }
.app-modal-eyebrow {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.app-modal-subtitle {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.modal-close-base,
.app-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    color: var(--text-strong);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.7rem;
    cursor: pointer;
    font: inherit;
    font-size: 1.45rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.modal-close-base:hover,
.modal-close-base:focus-visible,
.app-modal-close:hover,
.app-modal-close:focus-visible {
    color: var(--button-on-accent, var(--color-white));
    background: var(--danger);
    border-color: var(--danger);
    transform: rotate(4deg);
}

.modal-body-base,
.app-modal-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    overflow-y: auto;
    color: var(--text-main);
}
.app-modal-body--spacious { gap: 1.15rem; }
.app-modal-body--center { text-align: center; }

.app-modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.app-modal-section-title {
    margin: 0;
    color: var(--text-strong);
    font-size: 0.95rem;
    font-weight: 800;
}
.app-modal-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.7rem;
}
.app-modal-kpi {
    padding: 0.8rem 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    text-align: center;
}
.app-modal-kpi-value {
    color: var(--accent-primary);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
}
.app-modal-kpi-label {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}
.app-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
    list-style: none;
}
.app-modal-list-item,
.app-modal-person-card {
    padding: 0.8rem 0.9rem;
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
}
.app-modal-person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.7rem;
}
.app-modal-person-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: var(--text-strong);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.app-modal-person-card:hover,
.app-modal-person-card:focus-visible {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.app-modal-person-name { font-size: 0.84rem; font-weight: 800; }
.app-modal-person-meta { color: var(--text-muted); font-size: 0.74rem; }
.app-modal-empty { color: var(--text-muted); font-size: 0.82rem; }

.modal-footer-base,
.app-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-shrink: 0;
    padding: 0.9rem clamp(1rem, 3vw, 1.5rem);
    border-top: 1px solid var(--border-divider);
}
.app-modal-footer--center { justify-content: center; }

body.modal-open { overflow: hidden; }

@media (max-width: 600px) {
    .app-modal-overlay { align-items: flex-end; padding: 0; }
    .app-modal-content,
    .app-modal-content--wide,
    .app-modal-content--compact {
        width: 100%;
        max-height: 92vh;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .app-modal-content--fullscreen { height: 92vh; max-height: 92vh; }
    .app-modal-header,
    .app-modal-body,
    .app-modal-footer { padding-left: 1rem; padding-right: 1rem; }
}

/* Badges semánticos de alto contraste para modales */
.badge-solid-success { background: var(--success) !important; color: var(--color-white) !important; font-weight: 700 !important; }
.badge-solid-warning { background: var(--color-sena-yellow) !important; color: var(--color-gray-900) !important; font-weight: 700 !important; }
.badge-solid-danger  { background: var(--danger) !important; color: var(--color-white) !important; font-weight: 700 !important; }
.badge-solid-secondary { background: var(--color-gray-600) !important; color: var(--color-white) !important; font-weight: 700 !important; }
.badge-solid-tech { background: var(--color-elegant-600) !important; color: var(--color-white) !important; font-weight: 700 !important; }
.badge-solid-transversal { background: var(--color-ocean-700) !important; color: var(--color-white) !important; font-weight: 700 !important; }
.badge-solid-ingles { background: var(--info) !important; color: var(--color-white) !important; font-weight: 700 !important; }

@keyframes modalSlideUp {
    from { transform: translateY(24px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-deco-1), var(--body-deco-2), var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(16px, 2.5vw, 32px) clamp(16px, 3vw, 32px) 56px;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1600px;
    }
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 10px 14px;
    color: white;
    background: var(--text-strong);
    border-radius: var(--radius-sm);
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
.navbar {
    background: var(--navbar-bg);
    color: var(--navbar-text);
}
.nav-shell {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    min-height: 72px;
    margin: 0 auto;
    padding: 10px clamp(16px, 3vw, 32px);
    gap: clamp(16px, 3vw, 32px);
}

.nav-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: var(--navbar-text);
    text-decoration: none;
}
.nav-logo {
    background: var(--accent-hover);
    color: white;
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 22px;
    box-shadow: var(--accent-glow);
}
.nav-brand-copy { display: grid; line-height: 1.15; }
.nav-title-line { display: flex; align-items: center; gap: 7px; }
.nav-title { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.nav-program-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: rgba(57, 169, 0, 0.22);
    border: 1px solid rgba(57, 169, 0, 0.45);
    color: #86efac;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(57, 169, 0, 0.2);
}
.nav-brand-copy small,
.nav-subtitle {
    margin-top: 3px;
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    color: rgba(255, 255, 255, 0.82);
}
.nav-primary {
    display: flex;
    align-items: center;
    align-self: stretch;
    gap: 4px;
}
.nav-link {
    display: grid;
    place-items: center;
    min-width: 68px;
    padding: 9px 13px;
    color: rgba(255,255,255,.82);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-link:hover,
.nav-link.is-active { color: white; background: rgba(255,255,255,.15); box-shadow: inset 0 0 10px rgba(255,255,255,0.05); }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-identity { display: grid; text-align: right; line-height: 1.2; }
.nav-identity small { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; opacity: .72; }
.nav-name { max-width: 190px; overflow: hidden; font-size: 13px; white-space: normal; word-wrap: break-word; color: var(--navbar-text); }
.nav-icon-button {
    position: relative;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--navbar-text);
    background: rgba(255,255,255,.12);
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-icon-button:hover { background: rgba(255,255,255,.22); transform: translateY(-2px); }
.logout-form { display: inline-flex; }

/* =========================================
   BARRA CONTEXTUAL EN NAVBAR PRINCIPAL
========================================= */
.nav-context-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 auto;
}

.nav-context-slot ~ .nav-user {
    margin-left: 0;
}

.nav-context-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 100%;
}

.nav-context-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    text-decoration: none;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.nav-context-btn-back:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.nav-context-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
}

.nav-context-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    margin: 0;
    line-height: 1.2;
}

.nav-context-icon {
    font-size: 15px;
    line-height: 1;
}

.nav-context-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9999px;
    text-decoration: none;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-context-btn-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

@media (max-width: 1100px) {
    .nav-context-bar {
        gap: 8px;
        padding: 4px 10px;
    }
    .nav-context-title {
        font-size: 12.5px;
    }
}

@media (max-width: 950px) {
    .nav-context-title-ext {
        display: none;
    }
}

@media (max-width: 760px) {
    .nav-shell:has(.nav-context-slot) {
        flex-wrap: wrap;
    }
    .nav-context-slot {
        order: 3;
        width: 100%;
        margin-top: 6px;
        margin-bottom: 2px;
    }
    .nav-context-bar {
        width: 100%;
        justify-content: space-between;
        padding: 4px 10px;
    }
    .nav-context-title {
        font-size: 12px;
    }
    .nav-context-btn-back,
    .nav-context-btn-action {
        font-size: 11.5px;
        padding: 3px 8px;
    }
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; text-decoration: none;
    border: 2px solid transparent; cursor: pointer; transition: transform 0.25s, background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary)); color: white; border: 1px solid rgba(255,255,255,0.1); }
.btn-primary:hover { box-shadow: var(--accent-glow); }
.btn-secondary { background: var(--border-divider); color: var(--text-strong); border: 1px solid var(--border-glass); }
.btn-secondary:hover { background: var(--border-subtle); }
.btn-warning { background: linear-gradient(135deg, var(--sena-orange), #d97706); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); }
.btn-warning:hover { box-shadow: 0 0 15px rgba(251, 191, 36, 0.3); }
.btn-outline { background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); color: var(--text-main); }
.navbar .btn-outline { color: var(--navbar-text); border-color: rgba(255,255,255,0.2); }
.navbar .btn-outline:hover { background: rgba(255,255,255,.14); border-color: white; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* =========================================
   ESTILOS GLOBALES DE FORMULARIO Y SELECTS MODERNOS
========================================= */
select,
.form-select,
.select-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: inline-block;
    vertical-align: middle;
    width: auto;
    max-width: 100%;
    padding: 9px 36px 9px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-strong);
    background-color: var(--input-bg, #ffffff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    border: 1.5px solid var(--border-divider);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

[data-theme="sena"] select,
[data-theme="sena"] .form-select,
[data-theme="sena"] .select-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2339A900' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

[data-theme="ocean"] select,
[data-theme="dark"] select,
[data-theme="ocean"] .form-select,
[data-theme="dark"] .form-select,
[data-theme="ocean"] .select-control,
[data-theme="dark"] .select-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322d3ee' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

select:hover,
.form-select:hover,
.select-control:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px var(--accent-glow);
}

select:focus,
select:focus-visible,
.form-select:focus,
.select-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
    background-color: var(--input-bg-focus, #ffffff);
}

select:disabled,
.form-select:disabled,
.select-control:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background-color: var(--bg-surface);
    border-color: var(--border-divider);
    box-shadow: none;
}

select option,
select optgroup {
    background-color: var(--bg-card, #ffffff);
    color: var(--text-strong, #1a1a2e);
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
}

select optgroup {
    font-weight: 700;
    color: var(--accent-primary);
    background-color: var(--bg-surface);
}

.btn-back,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    margin-bottom: 12px;
    width: fit-content;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-back:hover,
.back-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--bg-surface);
    transform: translateX(-3px);
    box-shadow: 0 2px 8px var(--accent-glow);
    text-decoration: none;
}
.btn-back span,
.back-link span {
    display: inline-block;
    transition: transform 0.2s ease;
}
.btn-back:hover span,
.back-link:hover span {
    transform: translateX(-2px);
}

.page-header,
.module-header {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.page-header h1,
.module-header h1,
.module-header .header-content h1 {
    font-size: clamp(22px, 5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 2px 0 4px;
    color: var(--text-strong);
    line-height: 1.25;
}
.page-header p,
.page-header .text-muted,
.module-header .subtitle,
.page-subtitle {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    line-height: 1.45;
}

/* =========================================
   PANEL DE CONTROL Y FILTROS EN CABECERAS
========================================= */
.page-control-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass, var(--border-divider));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 16px;
    margin-bottom: 20px;
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
}

.control-selectors-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    flex: 1;
    min-width: 280px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 220px;
}

.control-item-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 220px;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.control-label .control-icon {
    font-size: 14px;
}

.control-select-wrap {
    position: relative;
    width: 100%;
}

.control-select-wrap select {
    width: 100%;
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 38px 10px 14px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
}

.control-actions-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.card {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-radius: var(--radius);
    padding: clamp(16px, 4vw, 24px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
    box-shadow: var(--shadow-lg);
}

.form-card h2 { font-size: clamp(16px, 4vw, 20px); margin-bottom: 12px; color: var(--text-strong); }
.form-card p { margin-bottom: 12px; }

.form-group { margin-bottom: 14px; flex: 1; min-width: 0; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border-divider);
    border-radius: var(--radius-sm); font: inherit; font-size: 14.5px;
    color: var(--text-strong);
    background: var(--input-bg);
    transition: border-color 0.2s, box-shadow .2s, background 0.2s;
}
.form-group select {
    padding-right: 36px;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--accent-primary); box-shadow: var(--focus-ring); background: var(--input-bg-focus);
}

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row.align-center { align-items: flex-end; }
.flex-grow { flex: 2; }

.form-inline { display: flex; flex-direction: column; gap: 8px; }

.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.checkbox-label input { width: auto; }

.report-import-card {
    border-top: 5px solid var(--accent-primary);
    background: linear-gradient(145deg, var(--bg-glass) 60%, rgba(74, 222, 128, 0.05));
}
.import-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.import-heading h2 { margin-bottom: 0; color: var(--text-strong); }
.import-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    background: var(--sena-green-light);
    border-radius: 50%;
    font-size: 24px;
}
.report-import-card input[type="file"] {
    background: var(--input-bg);
    cursor: pointer;
    border: 1px solid var(--border-glass);
}
.report-import-card input[type="file"]::file-selector-button {
    padding: 8px 12px;
    margin-right: 10px;
    color: white;
    background: var(--text-main);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}
.import-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0 0 6px;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 700;
}
.manual-create-card > summary {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}
.manual-create-card[open] > summary { margin-bottom: 12px; color: var(--text-strong); }
.manual-create-card .btn-outline {
    color: var(--text-main);
    border-color: var(--border-subtle);
}

.flash-messages { margin-bottom: 16px; }
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 8px; font-size: 14px; backdrop-filter: blur(10px);
}
.alert-success { background: var(--sena-green-light); color: var(--accent-primary); border-left: 4px solid var(--accent-primary); border: 1px solid var(--border-glass); }
.alert-error { background: var(--sena-red-light); color: var(--sena-red); border-left: 4px solid var(--sena-red); border: 1px solid var(--border-glass); }
.alert-warning { background: var(--sena-yellow-light); color: var(--sena-orange); border-left: 4px solid var(--sena-orange); border: 1px solid var(--border-glass); }
.alert-info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-left: 4px solid #3b82f6; border: 1px solid var(--border-glass); }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    background: rgba(255,255,255,0.1); color: var(--text-main);
}
.badge-success { background: #059669; color: white; }
.badge-warning { background: var(--sena-orange); color: #3d2600; }
.badge-danger { background: var(--sena-red); color: white; }
.badge-secondary { background: var(--border-subtle); color: var(--text-strong); }
.badge-info { background: #3b82f6; color: white; }

/* =========================================
   SISTEMA DE TABLAS UNIFICADO
   SSOT — Un solo estándar para todas las tablas
   ========================================= */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container {
    margin-bottom: 16px;
}

.table-container .table-responsive {
    margin-bottom: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

/* ---- Headers (base: subtle) ---- */
.table thead th {
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    color: var(--text-muted);
    background: transparent;
    border-bottom: 1px solid var(--border-divider);
    white-space: nowrap;
    vertical-align: middle;
}

/* ---- Headers (SENA green — estándar recomendado) ---- */
.table-sena thead th {
    color: white;
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    padding: 14px 16px;
    font-size: 12px;
    letter-spacing: 0.08em;
}
.table-sena thead th a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.table-sena thead th a:hover {
    text-decoration: underline;
}

/* ---- Body rows ---- */
.table tbody tr {
    background: var(--bg-card);
    color: var(--text-main);
    border-bottom: 1px solid var(--border-divider);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--bg-surface);
}

.table tbody tr.table-clickable {
    cursor: pointer;
}

/* ---- Row results (based on approval status) ---- */
.table tbody tr.row-aprobado {
    border-left: 4px solid var(--success);
}
.table tbody tr.row-no-aprobado {
    border-left: 4px solid #dc2626;
}
.table tbody tr.row-pendiente {
    border-left: 4px solid var(--warning);
}

/* ---- Cells ---- */
.table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-main);
    border: none;
    vertical-align: middle;
}

/* ---- Row status variants (backward compat) ---- */
.table tbody tr.row-warning,
.table tbody tr.row-amarillo {
    background: var(--sena-yellow-light);
}
.table tbody tr.row-danger,
.table tbody tr.row-rojo {
    background: var(--sena-red-light);
}
.table tbody tr.row-success {
    background: transparent;
}

/* ---- Striped (alternate rows) ---- */

/* ---- Column helpers ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.td-count {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---- Actions cell ---- */
.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Table cell helpers ---- */
.td-name {
    max-width: 300px;
    display: inline-block;
    white-space: normal;
    word-break: break-word;
    font-weight: 600;
}

.td-sub {
    font-size: 0.8rem;
    margin-top: 2px;
}

.td-date {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    white-space: nowrap;
}
.td-date .month-sep {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.td-comp {
    display: inline-block;
    max-width: 260px;
    white-space: normal;
    word-break: break-word;
    font-weight: 500;
    line-height: 1.35;
}

.td-resultado {
    display: inline-block;
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.4;
    cursor: help;
}

.td-registro {
    font-weight: 500;
    white-space: nowrap;
}

.td-success {
    color: var(--success);
    font-weight: 600;
}

.td-danger {
    color: var(--danger);
    font-weight: 600;
}

/* ---- Empty state inside tables ---- */
.table-empty td {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ---- Inline progress bar ---- */
.progress-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-track-inline {
    flex: 1;
    height: 6px;
    background: var(--border-divider);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-inline {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* ---- Evaluadores list ---- */
.evaluadores-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.evaluador-item {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* =========================================
   RANKING TABLE — Estilo gamificado v2
   ========================================= */

/* ---- Container ---- */
.ranking-desktop.table-container {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.ranking-desktop .table-responsive {
    margin-bottom: 0;
    overflow: visible;
}

/* ---- Table base ---- */
.ranking-table {
    border-collapse: separate;
    border-spacing: 0 10px;
}

/* ---- Header ---- */
.ranking-table.table-sena thead th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    border: none;
}

/* ---- Body rows ---- */
.ranking-table tbody tr {
    background: var(--bg-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}
.ranking-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Top 3 — each position gets its own solid accent */
.ranking-row-top {
    background: var(--bg-card);
    border-left: 4px solid var(--sena-orange) !important;
}
.ranking-row-position-1 {
    background: var(--sena-yellow-light) !important;
    border-left-color: var(--sena-yellow) !important;
}
.ranking-row-position-2 {
    background: var(--bg-surface) !important;
    border-left-color: var(--color-gray-500) !important;
}
.ranking-row-position-3 {
    background: var(--sena-orange-light) !important;
    border-left-color: var(--sena-orange) !important;
}

/* ---- Cells ---- */
.ranking-table td {
    padding: 16px 14px;
    vertical-align: middle;
    border-top: 1px solid var(--border-divider);
    border-bottom: 1px solid var(--border-divider);
}
.ranking-table td:first-child {
    width: 60px;
    border-left: 1px solid var(--border-divider);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}
.ranking-table td:last-child {
    border-right: 1px solid var(--border-divider);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* ---- Name column ---- */
.ranking-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-strong);
    line-height: 1.3;
}
.ranking-name-link {
    color: inherit;
    text-decoration: none;
}
.ranking-name-link:hover .ranking-name,
.ranking-name-link:focus-visible .ranking-name {
    color: var(--accent-hover);
}
.ranking-doc {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
    display: block;
}

/* ---- Score column ---- */
.score-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
}
.bonus-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--text-strong);
    background: var(--sena-yellow-light);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--sena-yellow);
}
.ranking-table .score-cell {
    min-width: 160px;
}
.ranking-table .score-cell .score-row {
    margin: 0 0 6px;
    gap: 8px;
}

/* ---- Stat chips (Asistencia / Evidencias / Juicios) ---- */
.ranking-stat {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}
.stat-chip-high  { background: var(--sena-green-light); color: var(--text-strong); border-color: var(--success); }
.stat-chip-mid   { background: var(--sena-yellow-light); color: var(--text-strong); border-color: var(--sena-yellow); }
.stat-chip-low   { background: var(--sena-red-light); color: var(--text-strong); border-color: var(--danger); }

/* ---- Progress bar inside score ---- */
.ranking-table .progress-track {
    height: 5px;
    background: var(--border-divider);
    border-radius: 999px;
}

/* ---- Position badges ---- */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    width: 46px;
    min-height: 44px;
    padding: 4px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.position-1 {
    background: var(--sena-yellow);
    color: var(--color-gray-900);
    box-shadow: 0 0 10px var(--accent-glow);
}
.position-2 {
    background: var(--color-gray-500);
    color: var(--color-white);
    box-shadow: var(--shadow);
}
.position-3 {
    background: var(--sena-orange);
    color: var(--color-white);
    box-shadow: var(--shadow);
}
.position-default {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-divider);
    font-size: 12px;
}
.position-badge .position-medal,
.position-number .position-medal {
    line-height: 1;
    font-size: 0.9rem;
}
.position-badge .position-label,
.position-number .position-label {
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

/* ---- Mini badges (insignias) ---- */
.ranking-table .mini-badges {
    margin-top: 0;
    justify-content: center;
}
.badge-icon {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    padding: 3px 7px;
    border-radius: 9999px;
    font-size: 1.05rem;
    line-height: 1;
}

/* ---- Bonus text (mobile) ---- */
.bonus-text {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--text-strong);
    font-weight: 700;
    font-size: 12px;
    background: var(--sena-yellow-light);
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--sena-yellow);
}

.no-badges {
    color: var(--text-muted);
    font-size: 12px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.card-ficha { color: inherit; transition: transform 0.2s, box-shadow 0.2s; }
.card-ficha:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.ficha-productiva { background: linear-gradient(135deg, var(--bg-glass) 70%, rgba(74, 222, 128, 0.05)); border-color: rgba(74, 222, 128, 0.2); }
.ficha-finalizada { background: linear-gradient(135deg, var(--bg-glass) 70%, rgba(251, 191, 36, 0.05)); border-color: rgba(251, 191, 36, 0.2); }
.card-badge {
    background: var(--sena-green-light); color: var(--accent-primary);
    padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700;
}
.card-title { font-size: clamp(16px, 4vw, 20px); margin: 8px 0; color: var(--text-strong); }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.timeline-card {
    padding: 14px;
    margin: 12px 0 0;
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.timeline-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.timeline-card-heading h2 { font-size: 15px; margin-top: 2px; color: var(--text-strong); }
.timeline-percent { color: var(--accent-primary); font-size: 20px; font-weight: 800; text-shadow: var(--accent-glow); }
.timeline-explanation { margin: 9px 0 17px; font-size: 11px; line-height: 1.45; }
.timeline-progress {
    position: relative;
    height: 14px;
    margin: 44px 8px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px var(--border-divider), 0 2px 6px var(--accent-glow);
}
.timeline-progress-fill {
    display: block;
    width: var(--progress-value, 0%);
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: inherit;
    transition: width .3s ease;
    box-shadow: inset 0 1px 0 var(--border-glass), 0 0 8px var(--accent-glow);
}
.timeline-marker { position: absolute; left: var(--marker-position, 0%); top: -8px; height: 28px; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
.timeline-marker i { display: block; width: 3px; height: 28px; margin: 0 auto; background: var(--sena-orange); border-radius: 2px; box-shadow: 0 0 10px rgba(251,191,36,0.5); }
.timeline-marker b { position: absolute; bottom: 100%; margin-bottom: 4px; left: 50%; transform: translateX(-50%); color: var(--text-strong); font-size: 10px; font-weight: 700; background: var(--bg-card); padding: 2px 6px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.5); border: 1px solid var(--border-glass); }
.timeline-marker-stage { z-index: 2; }
.timeline-marker-end { transform: translateX(-100%); z-index: 3; }
.timeline-marker-end b { left: auto; right: 0; transform: none; }
.timeline-marker-end i { background: var(--sena-red); box-shadow: 0 0 10px rgba(239,68,68,0.5); }
.timeline-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 10px; line-height: 1.35; position: relative; z-index: 1; }
.timeline-labels strong { color: var(--text-strong); }
.timeline-current { color: var(--accent-primary); text-align: center; }
.timeline-finished { border-color: rgba(251, 191, 36, 0.3); background: var(--sena-orange-light); }

.empty-state {
    text-align: center; padding: clamp(24px, 6vw, 48px);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }
.empty-state h3 { font-size: clamp(16px, 4vw, 20px); margin-bottom: 8px; color: var(--text-strong); }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; }

.auth-page { background: var(--bg-base); min-height: 100vh; }
.auth-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 16px;
}
.auth-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    padding: clamp(24px, 6vw, 40px); width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo {
    background: var(--accent-hover); color: white;
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 32px; margin: 0 auto 16px;
    box-shadow: var(--accent-glow);
}
.auth-header h1 { font-size: clamp(18px, 5vw, 24px); color: var(--text-strong); }
.auth-header p { color: var(--text-muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-footer { text-align: center; margin-top: 20px; }
.auth-footer p { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }

.asistencia-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.attendance-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
}
.attendance-toolbar .btn-outline { color: var(--accent-hover); }
#attendance-summary { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.attendance-save-bar {
    position: sticky;
    bottom: 10px;
    z-index: 5;
    padding: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-divider);
    border-radius: calc(var(--radius-sm) + 2px);
    box-shadow: 0 8px 24px rgba(20,35,15,.16);
    backdrop-filter: blur(7px);
}
.asistencia-row {
    background: var(--bg-card); border-radius: var(--radius-md);
    padding: 16px; display: flex; flex-direction: column; gap: 12px;
    border: 1px solid var(--border-divider);
    transition: all 0.35s ease;
}
.asistencia-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}
.aprendiz-identificacion { display: flex; flex-direction: column; justify-content: center; min-width: 200px; }
.aprendiz-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aprendiz-name { font-weight: 700; font-size: 15px; color: var(--text-base); }
.aprendiz-doc { font-size: 13px; font-weight: 500; }
.asistencia-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.attendance-btn {
    position: relative;
    padding: 8px 12px; border-radius: calc(var(--radius-sm) + 4px);
    background: var(--border-divider); cursor: pointer; font-size: 12px;
    font-weight: 700; transition: all 0.25s ease; border: 2px solid transparent;
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    flex: 1; min-width: max-content;
}
.attendance-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.attendance-btn:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.attendance-btn.active { color: white; }
.attendance-btn.active.state-asiste { background: var(--accent-hover); }
.attendance-btn.active::before { margin-right: 3px; content: "\2713"; }
.attendance-btn.active.state-falta { background: #b3261e; }
.attendance-btn.active.state-falta_justificada { background: var(--sena-orange); color: #3d2600; }
.attendance-btn.active.state-excusa_medica { background: var(--sena-orange); }
.attendance-btn.active.state-tardanza { background: var(--sena-yellow); color: var(--text-strong); }

.causal-select {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
}
.causal-select select {
    padding: 5px 28px 5px 10px;
    border-radius: 20px;
    border: 1.5px solid var(--warning);
    background-color: var(--sena-yellow-light, #fffbeb);
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 700;
    background-position: right 8px center;
    background-size: 12px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.causal-select select:hover {
    border-color: var(--sena-orange);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.sesiones-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sesion-item {
    padding: 6px 12px; background: var(--sena-green-light);
    border-radius: 12px; font-size: 12px; font-weight: 600;
    color: var(--accent-primary); text-decoration: none;
}

.task-card { margin-bottom: 12px; }
.task-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.task-header h3 { font-size: clamp(15px, 4vw, 18px); }
.task-desc { color: var(--text-main); font-size: 14px; margin: 8px 0; }
.task-actions { margin-top: 12px; }
.link-external { color: var(--accent-hover); text-decoration: none; font-size: 13px; font-weight: 600; }
.link-download { color: var(--sena-orange); text-decoration: none; font-size: 13px; font-weight: 600; display: block; margin-top: 4px; }

.calificar-details summary { cursor: pointer; color: var(--accent-hover); font-weight: 600; font-size: 13px; }
.form-compact { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.form-compact input, .form-compact textarea { padding: 6px 8px; font-size: 13px; border: 1px solid var(--border-subtle); border-radius: 6px; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 12px; flex-wrap: wrap; gap: 8px; }
.section-header h2 { font-size: clamp(16px, 4vw, 20px); }

.legend { display: flex; gap: 12px; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--accent-primary); }
.dot-yellow { background: var(--sena-yellow); }
.dot-red { background: var(--sena-red); }

.row-rojo { background: var(--sena-red-light); }
.row-amarillo { background: var(--sena-yellow-light); }

.alert-banner {
    padding: 14px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px;
}
.alert-red { background: var(--sena-red-light); color: var(--sena-red); border: 2px solid var(--sena-red); }
.alert-yellow { background: var(--sena-yellow-light); color: #744100; border: 2px solid var(--sena-yellow); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
    gap: 12px; margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 16px; text-align: center; box-shadow: var(--shadow);
}
.stat-number { display: block; font-size: clamp(24px, 6vw, 32px); font-weight: 800; color: var(--accent-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-verde .stat-number { color: var(--accent-primary); }
.stat-amarillo { border-bottom: 3px solid var(--sena-orange); }
.stat-amarillo .stat-number { color: var(--sena-orange); }
.stat-rojo { border-bottom: 3px solid var(--sena-red); background: var(--sena-red-light); }
.stat-rojo .stat-number { color: var(--sena-red); }

.tasks-list-aprendiz { display: flex; flex-direction: column; gap: 12px; }
.task-item {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow);
    border-left: 4px solid var(--border-subtle);
}
.task-pendiente { border-left-color: var(--sena-orange); }
.task-entregada { border-left-color: var(--accent-primary); }
.task-retraso { border-left-color: var(--sena-red); }
.task-vencida { border-left-color: var(--text-muted); }
.task-info h3 { font-size: 15px; margin-bottom: 4px; }
.task-deadline { font-size: 12px; color: var(--text-muted); }
.task-status { margin: 8px 0; }
.task-feedback {
    background: var(--sena-green-light); border-radius: var(--radius-sm);
    padding: 10px; margin-top: 8px; font-size: 13px;
}
.entrega-form { margin-top: 8px; }
.entrega-form summary { cursor: pointer; color: var(--accent-hover); font-weight: 600; font-size: 13px; }
.entrega-form form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 12px; }

.quick-actions { margin-top: 16px; }

.nav-notifications {
    position: relative;
    color: white;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}
.notification-count {
    position: absolute;
    top: -9px;
    right: -10px;
    min-width: 17px;
    padding: 2px 4px;
    color: white;
    background: var(--sena-red);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
}

.case-list { display: grid; gap: 16px; margin-bottom: 20px; }
.case-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-left: 5px solid var(--sena-orange);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.case-card.case-red { border-left-color: var(--sena-red); }
.case-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.case-card-header h2 { font-size: 18px; }
.case-alert-list { display: grid; gap: 10px; margin-top: 14px; }
.case-alert-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}
.case-alert-copy { min-width: 0; }
.case-alert-copy strong { font-size: 14px; }
.case-alert-copy p { margin: 3px 0; color: var(--text-main); font-size: 13px; }
.case-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.case-note-form {
    display: grid;
    gap: 5px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--border-divider);
}
.case-note-form label { color: var(--text-main); font-size: 12px; font-weight: 700; }
.case-note-form textarea { width: 100%; padding: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font: inherit; font-size: 13px; }
.case-timeline { margin-top: 12px; }
.case-timeline summary { cursor: pointer; color: var(--accent-hover); font-size: 13px; font-weight: 700; }
.timeline-list { display: grid; gap: 8px; margin-top: 10px; padding-left: 4px; }
.timeline-event { display: flex; align-items: flex-start; gap: 9px; }
.timeline-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--text-muted); }
.timeline-asistencia { background: var(--accent-primary); }
.timeline-academica { background: var(--sena-orange); }
.timeline-observador { background: var(--info); }
.timeline-event strong { font-size: 12px; }
.timeline-event p { color: var(--text-main); font-size: 12px; }

.notification-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.notification-list { display: grid; gap: 8px; }
.notification-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 11px;
    padding: 13px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.notification-item.notification-unread { border-left: 4px solid var(--accent-primary); background: var(--sena-green-light); }
.notification-icon { font-size: 21px; }
.notification-copy p { color: var(--text-strong); font-size: 13px; }
.notification-copy small { color: var(--text-muted); font-size: 11px; }
.notification-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 5px; }
.learner-observer-card { border-left: 4px solid var(--info); }
.learner-observer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.learner-observer-heading h2 { font-size: 17px; }
.learner-observer-list { display: grid; gap: 10px; margin-top: 12px; list-style: none; padding: 0; }
.learner-observer-item { padding: 10px 12px; border-left: 3px solid var(--border-subtle); border-radius: var(--radius-sm); }
.learner-observer-positiva { border-left-color: var(--sena-green); }
.learner-observer-negativa { border-left-color: var(--sena-red); }
.learner-observer-neutra { border-left-color: var(--info); }
.learner-observer-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.learner-observer-item small { color: var(--text-muted); font-size: 11px; }
.learner-observer-item p { margin-top: 5px; color: var(--text-strong); font-size: 13px; white-space: pre-line; }
.learner-plan-card { border-left: 4px solid var(--warning); }
.learner-plan-list { display: grid; gap: 12px; margin-top: 14px; }
.learner-plan-item { padding: 13px; border: 1px solid var(--border-divider); border-left: 3px solid var(--warning); border-radius: var(--radius-sm); }
.learner-plan-state-cumplido { border-left-color: var(--success); }
.learner-plan-state-vencido { border-left-color: var(--danger); }
.learner-plan-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.learner-plan-item-header h3 { color: var(--text-strong); font-size: 15px; }
.learner-plan-item-header p { margin-top: 3px; }
.learner-plan-activities { margin: 12px 0; color: var(--text-main); }
.learner-plan-activities p { margin-top: 4px; color: var(--text-strong); white-space: pre-line; }
.learner-plan-next-step { margin: 10px 0; color: var(--text-muted); font-size: 13px; }
.learner-plan-evidence-form { margin-top: 11px; }
.learner-plan-empty { margin-top: 14px; padding: 20px; }
.plan-evidence-review { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-glass); }
.plan-evidence-review p { margin: 5px 0 9px; white-space: pre-line; }
.plan-evidence-missing { margin-top: 12px; padding: 10px 12px; font-size: 13px; }
.support-card { border-left: 4px solid var(--sena-orange); }
.support-card h2 { font-size: 17px; }
.support-form { display: grid; gap: 7px; padding: 11px 0; border-bottom: 1px solid var(--border-divider); }
.support-form:last-child { border-bottom: 0; }
.support-form input[type="file"], .support-form textarea { width: 100%; padding: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font: inherit; font-size: 13px; }

.eyebrow {
    display: block;
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.ranking-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.ranking-heading .btn-back { grid-column: 1 / -1; margin-bottom: 0; }
.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.page-actions { margin: 8px 0 16px; }
.btn-card-outline { color: var(--accent-hover); }

.participation-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-divider);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    font-size: 13px;
    line-height: 1.5;
}

.ranking-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}
.ranking-overview-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 84px;
    padding: 13px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.ranking-overview-leader {
    background: linear-gradient(135deg, var(--sena-yellow-light), var(--bg-card));
    border-color: var(--sena-yellow);
}
.overview-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: var(--bg-surface);
    font-size: 1.15rem;
}
.ranking-overview-leader .overview-icon {
    background: var(--sena-yellow);
    color: var(--color-gray-900);
}
.ranking-overview-card > div {
    min-width: 0;
}
.overview-label {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.ranking-overview-card strong {
    display: block;
    overflow: hidden;
    color: var(--text-strong);
    font-size: 15px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ranking-overview-card small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.period-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: 999px;
    box-shadow: var(--shadow);
}
.period-tabs a {
    padding: 9px 8px;
    color: var(--text-main);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.period-tabs a.active {
    background: var(--accent-primary);
    color: var(--button-on-accent);
}

.ranking-list-head,
.ranking-detail-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.ranking-list-head {
    padding: 18px 16px 2px;
}
.ranking-list-head h2,
.ranking-detail-heading h3 {
    margin: 0;
    color: var(--text-strong);
}
.ranking-list-head h2 {
    font-size: 18px;
}
.ranking-list-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}
.ranking-total {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-primary);
    color: var(--button-on-accent);
    font-size: 11px;
    font-weight: 800;
}
.ranking-detail-heading {
    margin: 6px 0 10px;
}
.ranking-detail-heading h3 {
    font-size: 15px;
}
.ranking-detail-heading > span {
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
}

/* The shared filter stays visible in the representation that is active. */
@media (max-width: 799px) {
    .ranking-card-container .table-toolbar-desktop { display: none !important; }
}
@media (min-width: 800px) {
    .ranking-card-container .table-toolbar-mobile { display: none !important; }
}

.ranking-mobile {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}
.ranking-desktop { display: none; margin-bottom: 24px; }

.ranking-podium {
    --podium-color: var(--accent-primary);
    --podium-surface: var(--bg-surface);
    margin: 4px 0 22px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
}
.ranking-podium-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}
.ranking-podium-heading h3 {
    margin: 0;
    color: var(--text-strong);
    font-size: 16px;
}
.ranking-podium-heading > span {
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
}
.ranking-podium-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.ranking-podium-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-top: 4px solid var(--podium-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.podium-1 {
    --podium-color: var(--sena-yellow);
    --podium-surface: var(--sena-yellow-light);
}
.podium-2 {
    --podium-color: var(--color-gray-500);
    --podium-surface: var(--bg-surface);
}
.podium-3 {
    --podium-color: var(--sena-orange);
    --podium-surface: var(--sena-orange-light);
}
.podium-rank {
    display: flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    max-width: 100%;
    padding: 4px 8px 4px 5px;
    border-radius: 999px;
    background: var(--podium-surface);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
}
.podium-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: var(--podium-color);
    color: var(--color-gray-900);
    font-size: 0.85rem;
}
.podium-name {
    display: block;
    overflow: hidden;
    color: var(--text-strong);
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-doc {
    color: var(--text-muted);
    font-size: 11px;
}
.podium-score {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 3px;
    padding-top: 9px;
    border-top: 1px solid var(--border-divider);
}
.podium-score span,
.podium-metrics small {
    color: var(--text-muted);
    font-size: 10px;
}
.podium-score strong {
    color: var(--podium-color);
    font-size: 19px;
    font-weight: 900;
}
.podium-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.podium-metrics span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: var(--bg-surface);
    border-radius: 8px;
}
.podium-metrics small {
    font-size: 9px;
    line-height: 1.15;
}
.podium-metrics b {
    color: var(--text-strong);
    font-size: 12px;
}

/* ---- Ranking card (mobile) ---- */
.ranking-card {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    position: relative;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}
/* Score en cards: respeta accent-primary sin !important innecesario */
.ranking-card .score-row strong {
    color: var(--accent-primary);
}
/* position-number default: texto oscuro (legible sobre fondo gris claro) */
.ranking-card .position-number.position-default {
    color: var(--text-strong);
}
/* Top positions keep a readable label on every solid badge. */
.ranking-card .position-number.position-1 { color: var(--color-gray-900); }
.ranking-card .position-number.position-2,
.ranking-card .position-number.position-3 { color: var(--color-white); }
.ranking-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.ranking-card-top {
    background: var(--bg-card);
    border-left: 4px solid var(--sena-orange);
}
.ranking-card-position-1 {
    background: var(--sena-yellow-light);
    border-left-color: var(--sena-yellow);
}
.ranking-card-position-2 {
    background: var(--bg-surface);
    border-left-color: var(--color-gray-500);
}
.ranking-card-position-3 {
    background: var(--sena-orange-light);
    border-left-color: var(--sena-orange);
}

/* Dark/ocean theme — cards más sólidas */
[data-theme="dark"] .ranking-card,
[data-theme="ocean"] .ranking-card {
    background: var(--bg-card);
    border-color: var(--border-divider);
}
[data-theme="dark"] .ranking-card-top,
[data-theme="ocean"] .ranking-card-top { border-left-color: var(--sena-orange); }
[data-theme="dark"] .card,
[data-theme="ocean"] .card {
    background: rgba(18, 44, 72, 0.90);
    border-color: rgba(6, 182, 212, 0.10);
}
[data-theme="dark"] .participation-note,
[data-theme="ocean"] .participation-note {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-divider);
}
[data-theme="dark"] .reset-card,
[data-theme="ocean"] .reset-card {
    border-color: rgba(255, 106, 0, 0.25);
}

/* ---- Premium glass card (reusable) ---- */
.premium-glass-card {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    color: var(--text-main);
}

.ranking-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.ranking-position {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.ranking-position div {
    min-width: 0;
}
.ranking-position strong {
    display: block;
    color: var(--text-strong);
    font-size: 1rem;
    overflow: hidden;
    white-space: normal;
    word-wrap: break-word;
}
.ranking-position small {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
}

.position-number {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    width: 48px;
    height: 46px;
    border-radius: 13px;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Position badges (inside position-number) */
.position-1 {
    background: var(--sena-yellow);
    color: var(--color-gray-900);
    box-shadow: 0 0 12px var(--accent-glow);
}
.position-2 {
    background: var(--color-gray-500);
    color: var(--color-white);
}
.position-3 {
    background: var(--sena-orange);
    color: var(--color-white);
}
.position-default {
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
}

/* Trend badge — colores semánticos para máxima legibilidad */
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border-divider);
}
.trend-subiendo  { background: var(--sena-green-light); color: var(--text-strong); border-color: var(--success); }
.trend-estable   { background: var(--bg-surface); color: var(--text-strong); border-color: var(--info); }
.trend-bajando   { background: var(--sena-red-light); color: var(--text-strong); border-color: var(--danger); }

/* Score row (inside card) */
.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    position: relative;
    z-index: 1;
}
.score-row span {
    color: var(--text-muted);
    font-size: 13px;
}
.score-row strong {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Progress bar (inside card) */
.progress-track {
    height: 8px;
    overflow: hidden;
    background: var(--border-divider);
    border-radius: 999px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.progress-track span {
    display: block;
    width: var(--progress-value, 0%);
    height: 100%;
    background: linear-gradient(90deg, var(--accent-hover), var(--accent-primary));
    border-radius: inherit;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px var(--accent-glow);
}
.progress-large { height: 11px; }

/* Score sources (asistencia, evidencias, juicios) */
.score-sources {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-main);
    position: relative;
    z-index: 1;
}
.score-sources span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Mini badges (insignias) inside card */
.mini-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}
.badge-icon {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 1.2rem;
    line-height: 1;
}
.no-badges {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Progress Dashboard - Unified System ===== */
.progress-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
@media (min-width: 500px) {
    .progress-dashboard { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
    .progress-dashboard { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
    .progress-dashboard { grid-template-columns: repeat(4, 1fr); }
}

.progress-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.progress-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.progress-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.progress-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.progress-card-value {
    font-size: 1.1rem;
    font-weight: 800;
    flex-shrink: 0;
}
.progress-card-track {
    height: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.progress-card-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s ease-out;
    position: relative;
    min-width: 0;
}
.progress-card-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15));
    border-radius: inherit;
}
.progress-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #64748b;
    gap: 0.5rem;
}
.progress-card-footer span {
    white-space: nowrap;
}
.progress-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #60a5fa;
    margin-bottom: 0.1rem;
}

/* Progress Card Sizes */
.progress-card-lg {
    grid-column: 1 / -1;
}
@media (min-width: 500px) {
    .progress-card-lg {
        grid-column: span 2;
    }
}

/* Progress detail bars (inside cards) */
.progress-detail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.progress-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
}
.progress-detail-label {
    color: #94a3b8;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.progress-detail-bar {
    width: 80px;
    height: 5px;
    background: rgba(0,0,0,0.25);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}
.progress-detail-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease-out;
}
.progress-detail-value {
    font-weight: 700;
    font-size: 0.72rem;
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}
.score-sources {
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 9px;
    color: var(--text-main);
    font-size: 12px;
}
.trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 800;
    white-space: nowrap;
}
.trend-sube { color: var(--accent-hover); }
.trend-baja { color: var(--sena-orange); }
.trend-estable { color: var(--text-muted); }
.mini-badges {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 8px;
    font-size: 18px;
}
.section-header.compact { margin: 0 0 12px; }
.chart-selector {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 700;
}
.chart-selector select,
.filter-inline select {
    min-width: min(260px, 70vw);
    padding: 8px 36px 8px 12px;
    border: 1.5px solid var(--border-divider);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    font-weight: 600;
    font-size: 13.5px;
}
.chart-wrap { width: 100%; min-height: 260px; }
.chart-wrap canvas { display: block; max-width: 100%; }

.settings-card summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    font-weight: 800;
}
.settings-card summary small {
    color: var(--text-muted);
    font-weight: 400;
}
.settings-form {
    padding-top: 20px;
    margin-top: 16px;
    border-top: 1px solid var(--border-divider);
}
.settings-form h3 {
    margin: 18px 0 10px;
    font-size: 15px;
}
.settings-form h3:first-child { margin-top: 0; }
.form-help {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: -4px;
}
.privacy-checkbox {
    padding: 11px 12px;
    margin-bottom: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}
.reset-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid #ffe1bf;
}
.reset-card h2 { font-size: 17px; }

.badge-catalog {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.badge-admin-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.badge-admin-card.badge-inactive {
    opacity: 0.55;
    box-shadow: none;
}
.badge-large {
    flex: 0 0 auto;
    font-size: 30px;
    line-height: 1;
}
.badge-admin-content { flex: 1; min-width: 0; }
.badge-admin-content h3 { font-size: 15px; }
.badge-admin-content p {
    margin: 4px 0 10px;
    color: var(--text-main);
    font-size: 12px;
}
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.icon-field { flex: 0 0 78px; }
.filter-inline {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
}
.achievement-report {
    display: grid;
    gap: 8px;
}
.achievement-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.achievement-row p {
    color: var(--text-muted);
    font-size: 12px;
}

.unlock-banner {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    color: #724000;
    background: linear-gradient(135deg, #fff8dc, var(--sena-orange-light));
    border: 2px solid #ffc663;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.unlock-icon { font-size: 38px; }
.unlock-banner-title,
.unlock-banner > div > strong { display: block; font-size: 14px; }
.unlock-banner p,
.unlock-banner small { font-size: 12px; }
.unlock-banner p strong { display: inline; font-size: inherit; }

.my-ranking-card {
    padding: 18px;
    margin-bottom: 16px;
    color: white;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.my-ranking-card .eyebrow { color: rgba(255,255,255,0.75); }
.my-ranking-card h2 { font-size: 19px; }
.my-ranking-card .score-row,
.my-ranking-card .score-row strong,
.my-ranking-card .score-sources,
.my-ranking-card .trend { color: white; }
.my-ranking-card .progress-track { background: rgba(255,255,255,0.25); }
.my-ranking-card .progress-track span { background: white; }
.my-position {
    font-size: 30px;
    font-weight: 900;
}
.next-position {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 700;
}
.motivational-message {
    margin-top: 8px;
    padding: 10px 12px;
    color: var(--accent-hover);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
}
.ranking-disclaimer {
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 11px;
}
.my-ranking-card .ranking-disclaimer { color: rgba(255,255,255,0.75); }
.learner-ranking-list { display: grid; gap: 5px; }
.learner-ranking-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border-radius: var(--radius-sm);
}
.learner-ranking-row.is-me {
    background: var(--sena-green-light);
    outline: 1px solid rgba(57, 169, 0, 0.2);
}
.learner-position {
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}
.learner-rank-info { min-width: 0; }
.learner-rank-info strong {
    display: block;
    margin-bottom: 4px;
    overflow: hidden;
    font-size: 12px;
    white-space: normal;
    word-wrap: break-word;
}
.learner-ranking-row > strong { font-size: 12px; }

.achievements-section { margin-bottom: 20px; }
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}
.achievement-card {
    position: relative;
    padding: 13px 10px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.achievement-card.locked {
    filter: grayscale(1);
    opacity: 0.58;
    box-shadow: none;
}
.achievement-icon {
    display: block;
    margin-bottom: 5px;
    font-size: 30px;
}
.achievement-card h3 { font-size: 12px; }
.achievement-card p {
    margin: 4px 0 8px;
    color: var(--text-muted);
    font-size: 10px;
}
.achievement-status {
    color: var(--accent-hover);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.cleaning-page-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.cleaning-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.cleaning-summary-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 14px;
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.cleaning-summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    opacity: 0.8;
}
.cleaning-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}
.cleaning-summary-card span {
    display: block;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.cleaning-summary-card strong {
    display: block;
    color: var(--accent-primary);
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 900;
    line-height: 1.1;
    font-family: inherit;
}
/* =========================================
   CONTROLES Y CÁLCULO DE TURNOS DE ASEO
========================================= */
.cleaning-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

@media (min-width: 960px) {
    .cleaning-controls {
        grid-template-columns: 1.75fr 1.25fr;
    }
}

.cleaning-panel-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(18px, 3vw, 24px);
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cleaning-calc-card {
    border-top: 4px solid var(--accent-primary);
}

.cleaning-config-card {
    border-top: 4px solid var(--border-subtle);
}

.cleaning-card-header {
    margin-bottom: 16px;
}

.cleaning-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-glow);
    color: var(--accent-hover);
    border: 1px solid var(--border-glass);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cleaning-badge-icon {
    flex-shrink: 0;
}

.cleaning-badge-neutral {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-divider);
}

.cleaning-panel-card h2 {
    font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
    font-weight: 800;
    color: var(--text-strong);
    margin: 0 0 8px 0;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.cleaning-card-desc {
    color: var(--text-main);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0;
}

.cleaning-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: auto;
}

.cleaning-form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cleaning-dates-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.cleaning-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cleaning-input-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-strong);
}

.cleaning-date-field,
.cleaning-number-field {
    width: 100%;
    min-width: 130px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-strong);
    background: var(--input-bg);
    border: 1.5px solid var(--border-divider);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.cleaning-date-field:focus,
.cleaning-number-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--focus-ring);
    background: var(--input-bg-focus);
}

.cleaning-options-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.cleaning-option-chip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-divider);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    user-select: none;
    position: relative;
}

.cleaning-option-chip:hover {
    border-color: var(--accent-primary);
    background: var(--bg-glass-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.cleaning-option-chip:has(input:checked) {
    border-color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 6%, var(--bg-card));
}

.cleaning-custom-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}

.cleaning-chip-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cleaning-chip-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.25;
}

.cleaning-chip-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
}

.cleaning-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 4px;
}

.btn-calc-turnos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-calc-turnos:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-glow);
}

.cleaning-config-form {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 14px;
}

.cleaning-number-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cleaning-number-wrap .cleaning-number-field {
    padding-right: 56px;
}

.cleaning-field-unit {
    position: absolute;
    right: 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
}

@media (max-width: 600px) {
    .btn-calc-turnos {
        width: 100%;
    }
}

.calendar-card {
    padding: clamp(14px, 2.5vw, 20px);
}
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    text-align: center;
}
.calendar-toolbar h2 {
    font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
    font-weight: 800;
    margin: 2px 0 0;
    color: var(--text-strong);
}
.calendar-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--text-strong);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.calendar-arrow:hover {
    color: var(--accent-primary);
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: scale(1.08);
}
.cleaning-calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.cleaning-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    min-width: 840px;
    border: 1px solid var(--border-divider);
    border-width: 1px 0 0 1px;
}
.calendar-weekday {
    padding: 8px 6px;
    color: white;
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    border-right: 1px solid rgba(255,255,255,.18);
    font-size: 11.5px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.calendar-day {
    min-height: 130px;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-width: 0 1px 1px 0;
    transition: background 0.15s ease;
}
.calendar-day:hover {
    background: var(--bg-glass-hover);
}
.calendar-day.outside {
    background: var(--bg-surface);
    opacity: .45;
}
.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--sena-orange);
}
.calendar-day-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 11.5px;
    font-weight: 800;
}
.session-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--sena-orange);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 106, 0, 0.5);
}
.calendar-assignment {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 8px;
    background: var(--sena-orange-light);
    border-left: 3.5px solid var(--sena-orange);
    border-radius: 6px;
    margin-bottom: 4px;
}
.calendar-assignment.state-cumplido {
    background: var(--sena-green-light);
    border-left-color: var(--accent-primary);
}
.calendar-assignment strong {
    font-size: 11px;
    line-height: 1.25;
    color: var(--text-strong);
}
.calendar-assignment small {
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 500;
}
.calendar-assignment .badge {
    align-self: flex-start;
    font-size: 8.5px;
    padding: 2px 6px;
}
.calendar-actions {
    margin-top: 6px;
    font-size: 10.5px;
}
.calendar-actions > summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 4px;
    color: var(--accent-hover);
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s ease;
}
.calendar-actions > summary:hover,
.audit-details > summary:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
}
.audit-details > summary {
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    margin-top: 4px;
}
.calendar-edit-form {
    display: grid;
    gap: 5px;
    margin: 6px 0;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 6px;
}
.calendar-edit-form select,
.calendar-edit-form input {
    width: 100%;
    min-width: 0;
    padding: 5px 22px 5px 8px;
    border: 1px solid var(--border-divider);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--input-bg);
}
.calendar-edit-form input {
    padding-right: 8px;
}
.audit-details {
    margin-top: 6px;
    padding: 6px 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    border: 1px solid var(--border-divider);
}
.audit-details p {
    margin: 3px 0 0;
    color: var(--text-main);
    font-size: 9.5px;
    line-height: 1.35;
}
.calendar-unassigned {
    display: inline-block;
    padding: 4px 8px;
    color: #9a5a07;
    background: var(--sena-orange-light);
    border: 1px dashed var(--sena-orange);
    border-radius: 6px;
    font-size: 9.5px;
    font-weight: 700;
}
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid var(--border-divider);
    color: var(--text-main);
    font-size: 11.5px;
    font-weight: 500;
}
.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.legend-block {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.legend-block.programmed { background: var(--sena-orange); }
.legend-block.done { background: var(--accent-primary); }
.legend-absent {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--sena-red);
}
.legend-block.holiday {
    background: #6366f1;
}
.calendar-day.is-holiday {
    background: rgba(99, 102, 241, 0.04);
}
.holiday-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.5);
}
.calendar-holiday {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3.5px solid #6366f1;
    border-radius: 6px;
    margin-bottom: 4px;
}
.calendar-holiday strong {
    font-size: 10.5px;
    color: #4f46e5;
    line-height: 1.25;
}
.calendar-holiday small {
    color: var(--text-muted);
    font-size: 9.5px;
}
.badge-festivo {
    background: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 8.5px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}
.equity-card .text-muted { margin-bottom: 12px; }
.responsive-data-table,
.premium-glass-table {
    /* Aliases que heredan de .table — no requieren reglas extra */
}

.equity-table thead th {
    color: white;
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 14px 16px;
}
.equity-table thead th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.equity-table thead th a:hover { text-decoration: underline; }

.equity-table tbody tr {
    border-left: 4px solid transparent;
}

.equity-table tr.is-me {
    background: var(--sena-green-light);
    border-left-color: var(--accent-primary);
}
.equity-count {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    color: var(--accent-hover);
    background: var(--sena-green-light);
    border-radius: 50%;
    font-weight: 800;
}
.availability-details summary { cursor: pointer; list-style: none; }
.availability-form {
    display: grid;
    min-width: 220px;
    gap: 5px;
    margin-top: 6px;
}
.availability-form input {
    padding: 6px;
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    font-size: 11px;
}

.learner-cleaning-card {
    padding: 16px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.learner-cleaning-card.is-upcoming {
    color: white;
    background: linear-gradient(145deg, var(--accent-primary), var(--accent-hover));
    border: none;
    box-shadow: 0 8px 22px rgba(45,134,0,.22);
}
.learner-cleaning-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.learner-cleaning-heading h2 { font-size: 18px; }
.cleaning-balance-pill {
    padding: 4px 8px;
    color: var(--accent-hover);
    background: var(--sena-green-light);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.is-upcoming .cleaning-balance-pill { color: var(--accent-hover); background: white; }
.own-cleaning-alert {
    padding: 11px;
    margin-bottom: 12px;
    color: var(--accent-hover);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}
.own-cleaning-alert > span,
.own-cleaning-alert > strong,
.own-cleaning-alert > p { display: block; }
.own-cleaning-alert > span {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}
.own-cleaning-alert > strong { margin: 1px 0; font-size: 17px; }
.own-cleaning-alert > p { font-size: 11px; }
.own-cleaning-alert p strong,
.own-cleaning-alert p span { display: inline; font-size: inherit; }
.cleaning-card-block {
    padding: 11px 0;
    border-top: 1px solid var(--border-divider);
}
.is-upcoming .cleaning-card-block { border-top-color: rgba(255,255,255,.22); }
.cleaning-card-block h3 {
    margin-bottom: 7px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.next-cleaning-feature { display: flex; align-items: center; gap: 10px; }
.next-cleaning-feature time {
    display: grid;
    min-width: 48px;
    min-height: 48px;
    place-items: center;
    color: var(--accent-hover);
    background: var(--sena-green-light);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
}
.is-upcoming .next-cleaning-feature time { background: white; }
.next-cleaning-feature strong,
.next-cleaning-feature span { display: block; font-size: 12px; }
.next-cleaning-feature span { opacity: .78; }
.cleaning-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    overflow-x: auto;
}
.cleaning-timeline-item {
    position: relative;
    min-width: 70px;
    padding: 0 6px;
    text-align: center;
}
.cleaning-timeline-item:not(:last-child)::after {
    position: absolute;
    top: 9px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--border-divider);
    content: "";
}
.timeline-check {
    position: relative;
    z-index: 1;
    display: grid;
    width: 20px;
    height: 20px;
    margin: 0 auto 4px;
    place-items: center;
    color: white;
    background: var(--accent-primary);
    border-radius: 50%;
    font-size: 10px;
}
.is-upcoming .timeline-check { color: var(--accent-hover); background: white; }
.cleaning-timeline-item strong,
.cleaning-timeline-item small { display: block; font-size: 9px; }
.cleaning-timeline-item small { opacity: .72; }
.upcoming-cleaning-list { display: grid; gap: 5px; }
.upcoming-cleaning-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 6px;
    padding: 7px;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 10px;
}
.is-upcoming .upcoming-cleaning-row {
    color: var(--text-strong);
    background: rgba(255,255,255,.94);
}
.upcoming-cleaning-row.is-me { box-shadow: inset 3px 0 var(--sena-orange); }
.upcoming-cleaning-row time { font-weight: 800; }
.upcoming-cleaning-row strong { color: var(--accent-hover); }
.cleaning-balance {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    color: var(--accent-hover);
    background: var(--sena-green-light);
    border-radius: 7px;
    font-size: 10px;
}
.is-upcoming .cleaning-balance { color: var(--accent-hover); background: white; }
.learner-audit,
.learner-swap {
    padding-top: 10px;
    font-size: 11px;
}
.learner-audit summary,
.learner-swap summary { cursor: pointer; font-weight: 800; }
.learner-audit p { margin-top: 7px; opacity: .85; }
.learner-swap form { display: grid; gap: 6px; margin: 8px 0 4px; }
.learner-swap select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}
.swap-request {
    padding: 10px;
    margin-top: 10px;
    color: var(--text-strong);
    background: var(--sena-orange-light);
    border-left: 3px solid var(--sena-orange);
    border-radius: 7px;
    font-size: 11px;
}
.swap-actions { display: flex; gap: 6px; margin-top: 7px; }

.attendance-absent {
    text-decoration: line-through;
    opacity: 0.5;
}
.legend-absent {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.legend-absent::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 8px;
    background: var(--border-subtle);
    border-radius: 2px;
}
@media (min-width: 600px) {
    .asistencia-row {
        display: grid;
        grid-template-columns: 2fr 1.5fr auto;
        align-items: center;
        gap: 20px;
    }
    .asistencia-buttons { flex: 0 0 auto; justify-content: flex-end; }
    .causal-select { grid-column: 1 / -1; margin-top: 4px; }
    .ranking-heading {
        grid-template-columns: 1fr auto;
        align-items: end;
    }
    .period-tabs {
        width: max-content;
        min-width: 390px;
    }
    .period-tabs a { padding-inline: 22px; }
    .ranking-mobile { grid-template-columns: repeat(2, 1fr); }
    .ranking-podium-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
    .ranking-podium-card { min-height: 100%; }
    .podium-1 { order: 2; transform: translateY(-6px); }
    .podium-2 { order: 1; }
    .podium-3 { order: 3; }
    .reset-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .badge-catalog { grid-template-columns: repeat(2, 1fr); }
    .achievement-grid { grid-template-columns: repeat(3, 1fr); }
    .case-alert-row { grid-template-columns: auto 1fr auto; align-items: center; }
    .case-actions { grid-column: auto; justify-content: flex-end; }
    .notification-item { grid-template-columns: auto 1fr auto; align-items: center; }
    .notification-actions { grid-column: auto; justify-content: flex-end; }
    .calendar-card { padding: 20px; }
}

@media (min-width: 800px) {
    .ranking-mobile { display: none; }
    .ranking-desktop { display: block; }
    .two-column-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .badge-catalog { grid-template-columns: repeat(3, 1fr); }
    .cleaning-controls { grid-template-columns: 1.8fr 1.2fr; }
}

.ficha-toolbar {
    color: var(--text-main);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-divider);
    position: relative;
    z-index: 90;
}
.ficha-toolbar-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 1600px;
    min-height: 48px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    position: relative;
}
.ficha-context {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    max-width: 280px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid var(--border-divider);
}
.ficha-context-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.ficha-context span,
.ficha-context-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ficha-context strong {
    overflow: hidden;
    color: var(--accent-hover);
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ficha-context-prog {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-top: 1px;
}
.ficha-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.ficha-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.ficha-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 0 14px;
    color: var(--text-main);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
    min-height: 44px;
}
.ficha-nav a::after {
    position: absolute;
    right: 8px;
    bottom: 0;
    left: 8px;
    height: 3px;
    background: transparent;
    border-radius: 4px 4px 0 0;
    content: "";
    transition: background-color 0.2s ease;
}
.ficha-nav a:hover { color: var(--accent-hover); background: var(--bg-card); }
.ficha-nav a.is-active { color: var(--accent-hover); font-weight: 700; background: var(--bg-card); }
.ficha-nav a.is-active::after { background: var(--accent-primary); }

.page-header {
    position: relative;
    margin-bottom: 24px;
}
.page-header h1 {
    max-width: 850px;
    color: var(--text-strong);
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.16;
    letter-spacing: -.025em;
}
.page-header > .text-muted { margin-top: 5px; }
.btn-back {
    min-height: 32px;
    margin-bottom: 9px;
    padding: 4px 0;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 2px 0 24px;
    padding: 10px 0 2px;
}
.dashboard-hero h1 {
    margin: 2px 0 4px;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.08;
    letter-spacing: -.04em;
}
.dashboard-hero p { color: var(--text-muted); font-size: 15px; }
.eyebrow {
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.dashboard-summary {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.dashboard-summary strong { color: var(--accent-hover); font-size: 18px; }
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.dashboard-cards .card-ficha {
    margin: 0;
    padding: clamp(18px, 3vw, 28px);
    overflow: hidden;
}
.ficha-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}
.ficha-card-labels {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.card-badge {
    padding: 5px 10px;
    font-size: 11px;
    letter-spacing: .02em;
}
.ficha-card-header .card-title {
    max-width: 780px;
    margin: 10px 0 0;
    font-size: clamp(19px, 3vw, 27px);
    line-height: 1.18;
    text-wrap: balance;
}
.ficha-card-header .card-title a { color: inherit; text-decoration: none; }
.ficha-card-header .card-title a:hover { color: var(--accent-hover); }
.ficha-open-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 7px 2px;
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}
.ficha-open-link span { font-size: 17px; transition: transform .18s; }
.ficha-open-link:hover span { transform: translateX(3px); }
.ficha-card-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    align-items: stretch;
}
.ficha-card-body > * {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ficha-progress-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.dashboard .timeline-card {
    height: 100%;
    margin: 0;
    padding: clamp(15px, 2vw, 20px);
    background: linear-gradient(145deg, var(--bg-card), var(--bg-glass));
}
.dashboard .timeline-card-heading h2 { font-size: 16px; }
.dashboard .timeline-explanation { margin: 10px 0 17px; font-size: 12px; }
.dashboard .timeline-labels { font-size: 10px; }

/* Active ficha dashboard: compact operational summary */
.ficha-dashboard-active .ficha-card-body {
    gap: 14px;
}

.ficha-dashboard-active .ficha-bars-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.ficha-dashboard-active .timeline-card {
    min-width: 0;
    padding: 14px 16px;
}

.ficha-dashboard-active .timeline-explanation {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 8px 0 13px;
}

.ficha-dashboard-active .timeline-progress {
    margin-top: 38px;
    margin-bottom: 25px;
}

.ficha-dashboard-summary {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 11px;
    padding: 14px;
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
}

.ficha-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ficha-summary-heading > strong {
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
}

.ficha-summary-heading > a {
    flex: 0 0 auto;
    color: var(--accent-hover);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

.ficha-summary-heading > a:hover { text-decoration: underline; }

.ficha-dashboard-active .ficha-state-summary {
    margin: 0;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--border-divider);
}

.ficha-dashboard-active .estados-bar {
    height: 7px;
    margin: 8px 0 6px;
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 1px 2px var(--border-divider), 0 2px 5px var(--accent-glow);
}

.ficha-dashboard-active .estados-bar > div,
.ficha-dashboard-active .estados-dot {
    background: var(--state-color);
}

.ficha-dashboard-active .estados-legend {
    gap: 4px 10px;
    font-size: 10px;
}

.ficha-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.ficha-metric {
    display: flex;
    min-width: 0;
    min-height: 68px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 9px 10px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-top: 2px solid var(--border-subtle);
    border-radius: 8px;
}

.ficha-metric.is-positive { border-top-color: var(--success); }
.ficha-metric.is-warning { border-top-color: var(--warning); }
.ficha-metric.is-danger { border-top-color: var(--danger); }

.ficha-metric-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.ficha-metric-label {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.ficha-metric-value {
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.ficha-metric.is-positive .ficha-metric-value { color: var(--success); }
.ficha-metric.is-warning .ficha-metric-value { color: var(--warning); }
.ficha-metric.is-danger .ficha-metric-value { color: var(--danger); }

.ficha-metric > .ficha-metric-value { align-self: flex-start; }
.ficha-metric small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ficha-metric-track {
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: var(--border-divider);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px var(--border-divider), 0 1px 4px var(--accent-glow);
}

.ficha-metric-track > span {
    display: block;
    width: var(--metric-value, 0%);
    height: 100%;
    background: var(--text-muted);
    border-radius: inherit;
    box-shadow: inset 0 1px 0 var(--border-glass);
}

.ficha-metric.is-positive .ficha-metric-track > span { background: var(--success); }
.ficha-metric.is-warning .ficha-metric-track > span { background: var(--warning); }
.ficha-metric.is-danger .ficha-metric-track > span { background: var(--danger); }

.ficha-academic-attention {
    padding-top: 10px;
    border-top: 1px solid var(--border-divider);
}

.ficha-competency-list {
    display: grid;
    gap: 5px;
    margin-top: 7px;
}

.ficha-competency {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-main);
    font-size: 10px;
}

.ficha-competency > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ficha-competency > strong {
    color: var(--warning);
    font-size: 11px;
    font-weight: 900;
}

.ficha-competency.is-positive > strong { color: var(--success); }

.ficha-dashboard-active .ficha-action-grid {
    gap: 8px;
}

.ficha-dashboard-active .module-action {
    min-height: 58px;
    gap: 8px;
    padding: 9px;
}

.ficha-dashboard-active .module-icon-chart {
    color: var(--accent-hover);
    background: var(--sena-green-light);
}

@media (min-width: 940px) {
    .ficha-dashboard-active .ficha-bars-container {
        grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
        gap: 16px;
    }

    .ficha-dashboard-active .ficha-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    .ficha-dashboard-active .ficha-dashboard-summary { padding: 15px; }
}

@media (max-width: 600px) {
    .ficha-dashboard-active .ficha-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ficha-states-summary {
    margin-top: 12px;
    padding: 0 4px;
}
.estados-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border-divider);
    margin-bottom: 6px;
}
.estados-bar > div {
    min-width: 4px;
    transition: width 0.3s ease;
}
.estados-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.estados-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.estados-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-divider);
}
.dash-stat {
    text-align: center;
    padding: 6px 4px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-glass);
}
.dash-stat strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.2;
}
.dash-stat span {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.dash-stat-alertas strong { color: var(--sena-orange); }
.ficha-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    width: 100%;
}
.ficha-action-grid::-webkit-scrollbar {
    height: 6px;
}
.ficha-action-grid::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}
.ficha-action-grid::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}
.module-action {
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 10px;
    padding: 11px;
    color: var(--text-strong);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
}
.module-action:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.module-icon {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--accent-hover);
    background: var(--sena-green-light);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
}
.module-action > span:last-child { min-width: 0; }
.module-action strong,
.module-action small { display: block; }
.module-action strong {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    word-wrap: break-word;
}
.module-action small { margin-top: 2px; color: var(--text-muted); font-size: 10px; line-height: 1.25; }
.module-action-primary { border-color: rgba(74, 222, 128, 0.3); background: var(--sena-green-light); }
.module-action-primary .module-icon { color: white; background: var(--accent-hover); }
.module-action-warning { border-color: rgba(251, 191, 36, 0.3); background: var(--sena-orange-light); }
.module-action-warning .module-icon { color: var(--sena-orange); background: rgba(251, 191, 36, 0.15); }

.flash-messages {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 350px;
    width: calc(100% - 48px);
}
.flash-messages .alert {
    pointer-events: auto;
    border: 1px solid transparent; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 14px 16px;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    color: var(--text-strong);
    backdrop-filter: blur(16px);
}
.flash-messages .alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}
.flash-messages .alert-success { background: var(--bg-glass); border-color: var(--border-glass); }
.flash-messages .alert-success::before { background: var(--accent-primary); }
.flash-messages .alert-error { background: var(--bg-glass); border-color: var(--border-glass); }
.flash-messages .alert-error::before { background: var(--sena-red); }
.flash-messages .alert-warning { background: var(--bg-glass); border-color: var(--border-glass); }
.flash-messages .alert-warning::before { background: var(--sena-orange); }

.flash-messages .alert.is-closing {
    animation: fadeOutToast 0.3s ease forwards;
}

.alert-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    opacity: 0.7;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-left: 12px;
}
.alert-close-btn:hover {
    opacity: 1;
    color: var(--text-strong);
    background: var(--bg-hover);
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(110%) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes fadeOutToast {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}


.auth-page .container { max-width: none; padding: 0; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.share-access-card {
    padding: 14px 18px;
    border-left: 4px solid var(--accent-primary);
}
.share-access-card > summary {
    color: var(--accent-hover);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}
.share-access-card[open] > summary { margin-bottom: 8px; }
.share-access-card p { margin: 5px 0 10px; font-size: 12px; }
.share-access-row { display: flex; align-items: stretch; gap: 8px; }
.share-access-row input {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 13px;
}
.copy-feedback { min-height: 18px; color: var(--accent-hover); font-weight: 700; }
.alert-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.alert-summary-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-left: 4px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.alert-summary-item strong { font-size: 24px; line-height: 1; }
.alert-summary-item span { color: var(--text-main); font-size: 12px; font-weight: 800; }
.alert-summary-item.is-green { border-left-color: var(--accent-primary); }
.alert-summary-item.is-green strong { color: var(--accent-hover); }
.alert-summary-item.is-yellow { border-left-color: var(--sena-orange); }
.alert-summary-item.is-yellow strong { color: #744100; }
.alert-summary-item.is-red { border-left-color: var(--sena-red); }
.alert-summary-item.is-red strong { color: #a91f1c; }
.settings-card { padding: 0; }
.settings-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: var(--text-strong);
    cursor: pointer;
    list-style-position: inside;
    font-weight: 800;
}
.settings-card > summary small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}
.settings-card[open] { padding: 0 18px 18px; }
.settings-card[open] > summary { margin: 0 -18px 12px; border-bottom: 1px solid var(--border-divider); }
.status-text { margin-left: 6px; font-size: 11px; }
.error-page {
    max-width: 620px;
    margin: clamp(40px, 10vh, 100px) auto;
    padding: clamp(28px, 6vw, 52px);
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.error-code {
    display: block;
    color: var(--accent-hover);
    font-size: clamp(48px, 12vw, 82px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.06em;
}
.error-page h1 { margin: 10px 0 7px; font-size: clamp(24px, 5vw, 34px); }
.error-page p { margin-bottom: 20px; color: var(--text-muted); }

.competency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

.competency-section {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    padding: 1rem;
}

.competency-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-divider);
}

.competency-icon {
    font-size: 1.5rem;
    flex: 0 0 auto;
}

.competency-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.competency-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    word-wrap: break-word;
}

.competency-done {
    background: var(--sena-green-light);
    color: var(--accent-hover);
    border: 1px solid var(--border-divider);
}

.competency-pending {
    background: var(--sena-red-light);
    color: var(--sena-red);
    border: 1px solid var(--border-divider);
}

.competency-status-icon {
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 900;
    width: 1.5rem;
    text-align: center;
}

.competency-name {
    min-width: 0;
}

.badge-transversal {
    background: var(--sena-green-light);
    color: var(--accent-hover);
}

.badge-ingles {
    background: var(--color-elegant-100);
    color: var(--color-elegant-600);
}

@media (min-width: 940px) {
    .ficha-card-body {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        align-items: stretch;
    }
    .ficha-bars-container {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 24px;
        align-items: start;
    }
    .ficha-progress-panel {
        border-right: none;
        padding-right: 0;
        width: 100%;
    }
    .ficha-action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .dashboard-stats-row {
        grid-template-columns: repeat(7, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1200px) {
    .ficha-card-body {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        align-items: stretch;
    }
    .ficha-bars-container {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 32px;
    }
    .ficha-action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .dashboard-stats-row {
        grid-template-columns: repeat(7, 1fr);
    }
}

@media (max-width: 760px) {
    .nav-shell {
        min-height: 58px;
        padding: 6px clamp(10px, 3vw, 16px);
        gap: 6px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    .nav-brand {
        gap: 8px;
        flex: 0 1 auto;
        min-width: 0;
    }
    .nav-logo {
        width: 34px;
        height: 34px;
        font-size: 17px;
        flex-shrink: 0;
    }
    .nav-brand-copy {
        min-width: 0;
        line-height: 1.1;
    }
    .nav-title-line {
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .nav-title {
        font-size: 14px;
        white-space: nowrap;
    }
    .nav-program-badge {
        font-size: 9px;
        padding: 1px 5px;
        border-radius: 4px;
    }
    .nav-brand-copy small,
    .nav-subtitle {
        display: block;
        font-size: 9.5px;
        opacity: 0.8;
        max-width: 130px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: rgba(255, 255, 255, 0.78);
    }
    .nav-primary {
        display: flex;
        align-items: center;
        gap: 3px;
        flex: 0 0 auto;
    }
    .nav-link {
        min-width: auto;
        padding: 5px 9px;
        font-size: 11.5px;
        font-weight: 700;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.88);
        white-space: nowrap;
    }
    .nav-link:hover,
    .nav-link.is-active {
        background: rgba(255, 255, 255, 0.22);
        color: #ffffff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }
    .nav-user {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-left: 0;
        flex: 0 0 auto;
    }
    .nav-identity {
        display: none;
    }
    .nav-icon-button {
        width: 34px;
        height: 34px;
        font-size: 15px;
        flex-shrink: 0;
    }
    .nav-logout {
        min-height: 32px;
        padding: 4px 8px;
        font-size: 11.5px;
        border-radius: 6px;
        white-space: nowrap;
    }
    .ficha-toolbar-inner {
        min-height: 44px;
        padding: 0 8px;
        gap: 6px;
    }
    .ficha-context {
        max-width: 140px;
        margin-right: 4px;
        padding-right: 8px;
        gap: 4px;
        flex-shrink: 0;
    }
    .ficha-context-text {
        display: flex;
        flex-direction: column;
        line-height: 1.1;
        min-width: 0;
    }
    .ficha-context-label {
        font-size: 9px;
        color: var(--text-muted);
        text-transform: uppercase;
        font-weight: 800;
    }
    .ficha-context strong {
        font-size: 12px;
        color: var(--accent-hover);
    }
    .ficha-context-prog {
        display: block;
        font-size: 9px;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }
    .ficha-nav {
        gap: 3px;
        padding-bottom: 2px;
    }
    .ficha-nav a {
        min-height: 32px;
        padding: 0 9px;
        font-size: 11.5px;
        border-radius: 6px;
        white-space: nowrap;
    }
    .dashboard-hero { align-items: stretch; flex-direction: column; gap: 15px; }
    .dashboard-hero .btn { width: 100%; }
    .ficha-card-header { flex-direction: column; gap: 7px; }
    .ficha-open-link { padding-top: 0; }
    .share-access-row { align-items: stretch; flex-direction: column; }
    .attendance-toolbar { align-items: stretch; flex-direction: column; }
    #attendance-summary { text-align: center; }
    .alert-summary-item { align-items: flex-start; flex-direction: column; gap: 3px; }

    /* Todas las tablas se convierten en cards en mobile */
    .table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        background: transparent;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table thead {
        display: none;
    }

    .table tbody {
        display: grid;
        gap: 10px;
    }

    .table tbody tr {
        background: var(--bg-card);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--border-divider);
        border-left: 4px solid var(--border-divider);
    }

    /* Row status on mobile */
    .table tbody tr.row-amarillo,
    .table tbody tr.row-pendiente,
    .table tbody tr.row-warning {
        border-left-color: var(--warning);
    }
    .table tbody tr.row-rojo,
    .table tbody tr.row-no-aprobado,
    .table tbody tr.row-danger {
        border-left-color: var(--danger);
    }
    .table tbody tr.row-aprobado,
    .table tbody tr.row-success {
        border-left-color: var(--success);
    }

    .table tbody tr:hover {
        background: var(--bg-glass-hover);
    }

    .table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 42px;
        padding: 10px 14px;
        text-align: right;
        border-bottom: 1px solid var(--border-divider);
    }

    .table td:last-child {
        border-bottom: none;
    }

    .table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        text-align: left;
    }

    .table .actions-cell {
        justify-content: flex-end;
    }
}

@media (max-width: 420px) {
    .nav-shell {
        padding: 5px 8px;
        gap: 4px;
    }
    .nav-brand {
        gap: 6px;
    }
    .nav-logo {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    .nav-title {
        font-size: 13px;
    }
    .nav-program-badge {
        font-size: 8px;
        padding: 1px 4px;
        border-radius: 4px;
    }
    .nav-brand-copy small,
    .nav-subtitle {
        display: none;
    }
    .nav-primary {
        gap: 2px;
    }
    .nav-link {
        padding: 4px 7px;
        font-size: 11px;
    }
    .nav-icon-button {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .nav-logout {
        padding: 3px 6px;
        font-size: 10.5px;
        min-height: 28px;
    }
    .ficha-context-label {
        display: none;
    }
    .ficha-context-prog {
        max-width: 70px;
    }
    .module-action { min-height: 62px; }
    .timeline-marker b { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================
   THEME FLOAT — Selector de temas global
   Aparece en todas las pantallas incluso login
========================================= */
/* =========================================
   THEME FLOAT — Selector de tema flotante único (Single Floating Icon FAB)
   Reemplaza iconos/botones múltiples por un único botón flotante premium.
========================================= */
.theme-float {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    background: var(--bg-glass, rgba(15, 23, 42, 0.25));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0.75;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.theme-float:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 12px rgba(57, 169, 0, 0.3);
}
.theme-float-single-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgba(57, 169, 0, 0.85) 0%, rgba(5, 150, 105, 0.85) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
    overflow: hidden;
}
.theme-float-single-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 70%);
    pointer-events: none;
}
.theme-float-single-btn:hover {
    transform: rotate(15deg) scale(1.04);
    background: linear-gradient(135deg, #39A900 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(57, 169, 0, 0.5);
}
.theme-float-single-btn:active {
    transform: scale(0.92);
}
.theme-float-single-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.theme-float-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}
.theme-float-dot:hover {
    transform: scale(1.15);
}
.theme-float-dot.is-active {
    border-color: white;
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
}

@media (max-width: 640px) {
    .theme-float {
        bottom: 12px;
        right: 12px;
        opacity: 0.65;
    }
    .theme-float:hover,
    .theme-float:focus-within {
        opacity: 1;
    }
    .theme-float-single-btn {
        width: 32px;
        height: 32px;
    }
    .theme-float-single-btn svg {
        width: 15px;
        height: 15px;
    }
}
.panel-aprendiz {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow);
}

.panel-header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-title {
    color: var(--text-strong);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-top: 0.25rem;
}

.panel-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.juicio-tab-active {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.juicio-tab-inactive {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-divider);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.section-container {
    margin-bottom: 1rem;
}

.section-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-title {
    color: var(--text-strong);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
}

/* Dashboard Grid - Mobile First (1 col), Tablet (2 cols), Desktop PC (3 cols) */
.progress-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .progress-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .progress-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1400px) {
    .progress-dashboard {
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }
}

.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.progress-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.progress-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-card-label {
    color: var(--text-strong);
    font-weight: 700;
    font-size: 0.95rem;
}

.progress-card-value {
    font-size: 1.25rem;
    font-weight: 800;
}

.progress-card-track {
    width: 100%;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-divider);
}

.progress-card-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.progress-detail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-divider);
}

.progress-detail-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.progress-detail-label {
    color: var(--text-strong);
    font-weight: 700;
}

.progress-detail-bar {
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    overflow: hidden;
}

.progress-detail-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
}

.progress-detail-value {
    color: var(--text-strong);
    font-weight: 700;
    text-align: right;
}

/* --- Juicios & Evaluation Detail Components --- */
.juicio-detail-card {
    margin-bottom: 2rem;
}

.juicio-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.juicio-detail-title {
    color: var(--text-strong);
    margin-top: 0.25rem;
    font-size: 1.4rem;
    font-weight: 800;
}

.juicio-detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.juicio-sub-title {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.comp-mini-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.comp-mini-card.comp-complete {
    border-color: var(--success);
}

.comp-mini-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.comp-mini-left {
    flex: 1;
    min-width: 0;
}

.comp-mini-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comp-mini-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.comp-mini-right {
    text-align: right;
    flex-shrink: 0;
}

.comp-mini-pct {
    font-size: 1rem;
    font-weight: 800;
}

.comp-mini-ratio {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.comp-mini-track {
    margin-top: 8px;
    background: var(--bg-card);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.comp-mini-fill {
    height: 100%;
    border-radius: 2px;
}

/* Timeline components */
.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 70px 1fr 50px;
    gap: 10px;
    align-items: center;
}

.timeline-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-bars {
    display: flex;
    gap: 2px;
    height: 20px;
    align-items: center;
}

.timeline-bar-approved {
    height: 14px;
    background: var(--success);
    border-radius: 3px;
    min-width: 4px;
    width: var(--progress-value, 0%);
}

.timeline-bar-pending {
    height: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 3px;
    min-width: 4px;
    width: var(--progress-value, 0%);
}

.timeline-count {
    font-size: 0.75rem;
    color: var(--text-strong);
    text-align: right;
}

.timeline-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-approved { background: var(--success); }
.legend-pending { background: var(--bg-surface); border: 1px solid var(--border-divider); }

/* Instructor grid */
.instructor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.instructor-mini-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.instructor-mini-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instructor-mini-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.instructor-mini-counts {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
}

.instructor-mini-pct {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Tasks Section Components */
.tasks-section-header {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.tasks-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-strong);
    margin-top: 0.25rem;
}

.evidence-progress-mini {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 240px;
    box-shadow: var(--shadow);
}

.evidence-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-strong);
}

.tasks-pending-title {
    margin-bottom: 1.25rem;
    color: var(--danger);
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tasks-list-aprendiz {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.task-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-strong);
}

.task-deadline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.task-desc {
    margin-top: 0.75rem;
    line-height: 1.5;
    color: var(--text-main);
    font-size: 0.95rem;
}

.task-feedback {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border-left: 4px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--text-strong);
}

.task-feedback-success {
    border-left-color: var(--success);
}

.task-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.entrega-form {
    margin-top: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.entrega-summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--accent-hover);
}

.entrega-form-inner {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-file-input {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: 6px;
    color: var(--text-main);
}

.entregadas-details {
    margin-bottom: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.entregadas-summary {
    padding: 1.25rem;
    cursor: pointer;
    font-weight: 700;
    color: var(--success);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.tasks-inner {
    padding: 0 1.25rem 1.25rem 1.25rem;
}

/* =========================================
   PANEL DEL APRENDIZ — CAPA DE COMPONENTES
   Reglas finales y tokens del tema. Mantener
   aquí los ajustes de esta vista para evitar
   regresiones por estilos heredados.
========================================= */
.panel-aprendiz {
    width: 100%;
    max-width: none;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.panel-header-card {
    color: var(--text-main);
    background: var(--bg-card);
    border-color: var(--border-divider);
}

.panel-header-card .panel-subtitle {
    color: var(--text-muted);
}

.panel-header-card .btn-outline {
    color: var(--text-strong);
    background: var(--bg-card);
    border-color: var(--border-subtle);
    margin-top: 0;
}

.panel-header-card .btn-outline:hover,
.panel-header-card .btn-outline:focus-visible {
    color: var(--button-on-accent, var(--color-white));
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.progress-dashboard {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    margin-bottom: 0;
}

.progress-card-value {
    color: var(--metric-color, var(--accent-primary));
}

.progress-card-fill {
    width: var(--progress-value, 0%);
    background: var(--metric-color, var(--accent-primary));
}

.progress-detail-bar span {
    width: var(--progress-value, 0%);
    background: var(--metric-color, var(--accent-primary));
}

.metrics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 0;
}

.metric-card {
    min-width: 0;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.metric-card-title {
    color: var(--text-strong);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.metric-card-subtitle {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
}

.metric-card-score {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
}

.juicio-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-divider);
}

.juicio-tab-active,
.juicio-tab-inactive {
    flex: 0 0 auto;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.juicio-tab-active {
    color: var(--button-on-accent, var(--color-white));
    background: var(--accent-hover);
    border: 1px solid var(--accent-hover);
}

.juicio-tab-inactive {
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
}

.juicio-tab-inactive:hover,
.juicio-tab-inactive:focus-visible {
    color: var(--text-strong);
    border-color: var(--accent-primary);
}

.juicio-tab-content[hidden] {
    display: none;
}

.juicio-competencias-list,
.juicio-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 32rem;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.juicio-competencias-list > .competencia-accordion,
.juicio-status-list > .juicio-status-item {
    flex: 0 0 auto;
}

.competencia-accordion {
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.competencia-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    color: var(--text-strong);
    background: var(--bg-card);
    cursor: pointer;
    list-style: none;
}

.competencia-summary::-webkit-details-marker {
    display: none;
}

.competencia-summary-main {
    flex: 1;
    min-width: 0;
}

.competencia-name {
    margin-bottom: 0.35rem;
    color: var(--text-strong);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.35;
}

.competencia-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 600;
}

.competencia-summary-stats {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.85rem;
}

.competencia-progress,
.table-progress-track {
    width: 5rem;
    height: 0.5rem;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 999px;
}

.competencia-progress-fill,
.table-progress-fill {
    width: var(--progress-value, 0%);
    height: 100%;
    border-radius: inherit;
}

.competencia-progress-fill.is-complete,
.table-progress-fill.is-complete { background: var(--success); }
.competencia-progress-fill.is-partial,
.table-progress-fill.is-partial { background: var(--warning); }
.competencia-progress-fill.is-empty,
.table-progress-fill.is-empty { background: var(--text-muted); }

.competencia-chevron {
    color: var(--text-strong);
    font-size: 0.85rem;
    font-weight: 700;
}

.competencia-rap-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-divider);
}

.rap-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.rap-item-content { flex: 1; min-width: 0; }
.rap-item-title { margin: 0; color: var(--text-strong); font-size: 0.83rem; font-weight: 700; line-height: 1.4; }
.rap-item-meta { margin-top: 0.3rem; color: var(--text-main); font-size: 0.75rem; font-weight: 500; }
.panel-empty-message { padding: 1.5rem; color: var(--text-muted); text-align: center; font-weight: 600; }
.panel-empty-message.is-success { color: var(--success); }
.panel-empty-message.is-warning { color: var(--warning); }

.juicio-summary-grid {
    display: grid;
    grid-template-columns: minmax(10rem, 0.8fr) minmax(15rem, 1.2fr);
    align-items: center;
    gap: 1.5rem;
}

.juicio-donut-wrap { display: flex; justify-content: center; }
.juicio-donut {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8.75rem;
    height: 8.75rem;
    background: conic-gradient(var(--success) var(--summary-value), var(--border-divider) 0);
    border-radius: 50%;
}
.juicio-donut-hole {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6.55rem;
    height: 6.55rem;
    color: var(--text-strong);
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 900;
}
.juicio-summary-bars { display: flex; flex-direction: column; gap: 1rem; }
.juicio-summary-bar-label { display: flex; justify-content: space-between; margin-bottom: 0.25rem; color: var(--text-strong); font-size: 0.9rem; font-weight: 700; }
.juicio-summary-bar progress { width: 100%; height: 0.5rem; accent-color: var(--accent-primary); }
.juicio-summary-bar progress.progress-transversal { accent-color: var(--success); }
.juicio-summary-bar progress.progress-ingles { accent-color: var(--info); }

.juicio-status-item {
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-left: 4px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}
.juicio-status-item.is-pending { border-left-color: var(--warning); }
.juicio-status-item.is-approved { border-left-color: var(--success); }
.juicio-status-title { margin: 0; color: var(--text-strong); font-size: 0.85rem; font-weight: 700; line-height: 1.4; }
.juicio-status-meta { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; color: var(--text-muted); font-size: 0.75rem; }
.juicio-status-row, .juicio-status-detail { display: flex; justify-content: space-between; gap: 0.75rem; }
.juicio-status-detail { padding: 0.25rem 0.5rem; background: var(--bg-card); border: 1px solid var(--border-divider); border-radius: 0.35rem; }
.juicio-status-value { color: var(--warning); font-weight: 700; }
.is-approved .juicio-status-value { color: var(--success); }

.evaluators-block { grid-column: 1; width: 100%; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-divider); }
.evaluators-title { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.85rem; font-weight: 700; }
.evaluators-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.evaluator-chip { padding: 0.3rem 0.8rem; color: var(--text-strong); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 0.8rem; font-weight: 600; }

.panel-aprendiz .alert { color: var(--text-strong); }
.active-alerts-label { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.alert-message { margin: 0.25rem 0; }
.alert-note { color: var(--text-muted); }
.alert-lead { font-size: 1.1rem; }
.table-progress { display: flex; align-items: center; gap: 0.5rem; }
.table-progress-track { flex: 1; max-width: 7.5rem; }
.instructor-distribution-title { margin-top: 1.25rem; }
.cell-success { color: var(--success); font-weight: 700; }
.cell-danger { color: var(--danger); }

.my-ranking-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.my-ranking-card h2 { color: var(--color-white); margin-top: 0.25rem; font-size: 1.6rem; font-weight: 800; }
.my-position { color: var(--color-white); font-size: 3rem; font-weight: 900; }
.score-row { margin-top: 1rem; padding-top: 1rem; }
.ranking-progress { margin-top: 0.75rem; }
.ranking-progress span { width: var(--progress-value, 0%); }
.evidence-progress-value { color: var(--success); font-weight: 700; }
.evidence-progress-caption { display: block; font-size: 0.8rem; text-align: right; }
.task-evidence-actions { margin-top: 0.75rem; margin-bottom: 0.75rem; gap: 0.5rem; }
.download-evidence-link { color: var(--success); border-color: var(--success); }
.download-evidence-link:hover,
.download-evidence-link:focus-visible { color: var(--button-on-accent, var(--color-white)); background: var(--success); border-color: var(--success); }
.uploaded-note { display: block; margin-top: 0.25rem; color: var(--text-muted); }
.full-width { width: 100%; }
.details-badge { margin-left: auto; }

.competencia-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.8rem;
    color: var(--button-on-accent, var(--color-white));
    background: var(--accent-hover);
    border: 1px solid var(--accent-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
}

.competencia-detail-button:hover,
.competencia-detail-button:focus-visible {
    color: var(--button-on-accent, var(--color-white));
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.competencia-modal-shell {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.competencia-modal-header h2 {
    margin-top: 0.25rem;
    color: var(--text-strong);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    line-height: 1.25;
}

.competencia-modal-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.competencia-modal-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
}

.competencia-modal-stat span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.competencia-modal-stat strong {
    color: var(--text-strong);
    font-size: 1.05rem;
}

.competencia-modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.competencia-modal-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.competencia-modal-section-heading h3 {
    color: var(--text-strong);
    font-size: 1rem;
}

.competencia-modal-rap-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.competencia-modal-rap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-left: 4px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.competencia-modal-rap.is-approved { border-left-color: var(--success); }
.competencia-modal-rap.is-pending { border-left-color: var(--warning); }
.competencia-modal-rap-main { min-width: 0; }
.competencia-modal-rap h4 { color: var(--text-strong); font-size: 0.92rem; line-height: 1.4; }
.competencia-modal-rap p { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; }
.competencia-modal-rap-judgement { color: var(--text-main) !important; }
.competencia-modal-rap-judgement strong { color: var(--text-strong); }
.competencia-detail-source { display: none; }
.modal-open { overflow: hidden; }

/* =========================================
   SEGUIMIENTO: bandeja de decisiones del instructor
   ========================================= */
.followup-page-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 1.25rem;
}
.followup-heading h1 { margin-bottom: .25rem; }
.followup-ficha-link { color: var(--text-muted); text-decoration: none; }
.followup-ficha-link:hover { color: var(--accent-hover); }
.followup-header-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: .55rem;
}
.followup-evaluation-time { color: var(--text-muted); font-size: .72rem; font-weight: 700; }
.followup-guidance {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: .9rem;
}
.followup-guidance strong { color: var(--text-strong); }
.followup-guidance p { margin-top: .2rem; color: var(--text-main); font-size: .82rem; }
.followup-action-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.followup-action-bar form { margin: 0; }
.followup-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: 1rem;
}
.followup-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-top: 3px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.followup-summary-card.is-danger { border-top-color: var(--danger); }
.followup-summary-card.is-warning { border-top-color: var(--warning); }
.followup-summary-card.is-success { border-top-color: var(--success); }
.followup-summary-icon { font-size: 1.35rem; line-height: 1; }
.followup-summary-card strong { display: block; color: var(--text-strong); font-size: 1.65rem; line-height: 1; }
.followup-summary-card span:not(.followup-summary-icon) { display: block; margin-top: .18rem; color: var(--text-main); font-size: .76rem; font-weight: 800; }
.followup-summary-card small { grid-column: 1 / -1; color: var(--text-muted); font-size: .7rem; }
.followup-summary-card.is-danger strong { color: var(--danger); }
.followup-summary-card.is-warning strong { color: var(--warning); }
.followup-summary-card.is-success strong { color: var(--success); }
.followup-settings { margin-bottom: 1.25rem; }
.followup-settings-form { display: grid; gap: 1rem; }
.followup-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}
.followup-settings-grid .form-group { gap: .3rem; }
.followup-settings-grid label { color: var(--text-strong); font-size: .78rem; font-weight: 800; }
.followup-settings-grid input { min-height: 2.35rem; }
.followup-settings-grid small { color: var(--text-muted); font-size: .68rem; }
.followup-checkbox { display: flex; align-items: center; gap: .55rem; color: var(--text-main); font-size: .78rem; font-weight: 700; }
.followup-checkbox input { accent-color: var(--accent-primary); }
.followup-settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .9rem; border-top: 1px solid var(--border-divider); }
.followup-settings-footer p { margin: 0; font-size: .75rem; }
.followup-workspace { margin-top: 1.25rem; }
.followup-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}
.followup-toolbar h2 { color: var(--text-strong); font-size: 1.15rem; }
.followup-filters { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.followup-filters input { min-width: min(20rem, 50vw); }
.followup-filters select { min-width: 9.5rem; }
.followup-results-count { color: var(--text-muted); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.case-card { padding: 1.15rem; }
.case-card.case-red { border-left-color: var(--danger); }
.case-card-header { align-items: center; }
.case-person { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.case-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    color: var(--button-on-accent, var(--color-white));
    background: var(--accent-primary);
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 900;
    text-transform: uppercase;
}
.case-red .case-avatar { background: var(--danger); }
.case-priority-line { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .2rem; }
.case-priority-label { color: var(--accent-hover); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.case-red .case-priority-label { color: var(--danger); }
.case-card-header h3 { color: var(--text-strong); font-size: 1.08rem; }
.case-card-header h3 a { color: inherit; text-decoration: none; }
.case-card-header p { margin-top: .15rem; font-size: .75rem; }
.case-state-pill { display: inline-flex; align-items: center; padding: .22rem .5rem; border-radius: 999px; font-size: .65rem; font-weight: 900; }
.case-state-pill.is-open { color: var(--button-on-accent, var(--color-white)); background: var(--accent-primary); }
.case-state-pill.is-escalated { color: var(--button-on-accent, var(--color-white)); background: var(--danger); }
.case-card-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.case-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
    margin-top: 1rem;
    padding: .65rem 0;
    border-top: 1px solid var(--border-divider);
    border-bottom: 1px solid var(--border-divider);
}
.case-metric { min-width: 0; padding: .2rem .7rem; border-right: 1px solid var(--border-divider); }
.case-metric:last-child { border-right: 0; }
.case-metric span { display: block; color: var(--text-muted); font-size: .68rem; font-weight: 800; }
.case-metric strong { display: block; margin-top: .2rem; color: var(--text-strong); font-size: 1.22rem; line-height: 1.1; }
.case-metric strong.is-success { color: var(--success); }
.case-metric strong.is-warning { color: var(--warning); }
.case-metric strong.is-danger { color: var(--danger); }
.case-metric small { display: block; margin-top: .18rem; overflow: hidden; color: var(--text-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.case-alert-list { gap: .7rem; margin-top: .8rem; }
.case-alert-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .8rem;
    padding: .85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
}
.case-alert-title,
.case-alert-copy > strong { display: block; margin-top: .45rem; color: var(--text-strong); font-size: .88rem; }
.case-alert-copy p { line-height: 1.45; }
.case-alert-copy p strong { display: inline; font-size: inherit; color: inherit; margin: 0; }
.case-alert-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.case-alert-heading .badge-solid-danger,
.case-alert-heading .badge-solid-warning { display: inline-flex; padding: .25rem .5rem; border-radius: 999px; font-size: .66rem; text-transform: uppercase; }
.case-alert-status { color: var(--text-muted); font-size: .7rem; font-weight: 800; }
.case-alert-facts { display: flex; flex-wrap: wrap; gap: .4rem .7rem; margin-top: .45rem; color: var(--text-muted); font-size: .68rem; }
.case-alert-facts span::before { margin-right: .25rem; color: var(--border-subtle); content: "•"; }
.case-alert-facts .case-auto-escalated { color: var(--danger); font-weight: 800; }
.case-actions { align-items: flex-start; min-width: 10rem; }
.case-actions form { margin: 0; }
.case-note-form { grid-column: 1 / -1; gap: .4rem; padding: .8rem 0 0; border-top: 1px solid var(--border-divider); border-bottom: 0; }
.case-note-form textarea { color: var(--text-main); background: var(--input-bg); }
.case-note-form button { justify-self: start; }
.case-timeline { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--border-divider); }
.case-timeline summary { color: var(--accent-hover); }
.case-timeline-empty { margin-top: .7rem; font-size: .8rem; }
.followup-filter-empty { margin-top: 1rem; }
.followup-plan-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.plan-card { margin: 0; padding: 1.25rem; border-left: 4px solid var(--warning); }
.plan-card.plan-state-cumplido { border-left-color: var(--success); }
.plan-card.plan-state-vencido { border-left-color: var(--danger); }
.plan-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.plan-card-header h3 { color: var(--text-strong); font-size: 1rem; }
.plan-card-header p { margin-top: .2rem; font-size: .75rem; }
.plan-state-badge { text-transform: uppercase; }
.plan-activities { margin: .9rem 0; color: var(--text-main); }
.plan-activities p { margin-top: .25rem; color: var(--text-strong); white-space: pre-wrap; }
.plan-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; color: var(--text-muted); font-size: .78rem; }
.plan-actions { margin-top: .9rem; }
.followup-plan-empty { margin-top: 2rem; }
.observador-historial { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border-divider); }
.observador-historial h3 { color: var(--text-strong); font-size: .95rem; }
.observador-historial-lista { display: grid; gap: .7rem; margin-top: .8rem; list-style: none; padding: 0; }
.observador-historial-lista li { padding-left: .7rem; border-left: 3px solid var(--border-divider); font-size: .8rem; }
.observador-historial-lista strong { display: inline-block; margin-left: .4rem; color: var(--text-strong); }
.observador-historial-lista p { margin-top: .2rem; color: var(--text-main); white-space: pre-wrap; }

@media (max-width: 940px) {
    .followup-page-header { grid-template-columns: auto minmax(0, 1fr); }
    .followup-header-actions { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .followup-summary-grid, .followup-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .followup-toolbar { align-items: stretch; flex-direction: column; }
    .followup-filters { justify-content: flex-start; }
}

@media (max-width: 620px) {
    .followup-page-header { display: flex; align-items: stretch; flex-direction: column; gap: .7rem; }
    .followup-header-actions { align-items: stretch; flex-direction: column; }
    .followup-header-actions .btn { width: 100%; justify-content: center; }
    .followup-summary-grid, .followup-settings-grid, .case-metrics { grid-template-columns: 1fr 1fr; }
    .followup-settings-footer { align-items: stretch; flex-direction: column; }
    .followup-settings-footer .btn { width: 100%; }
    .followup-filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .followup-filters input, .followup-filters select { min-width: 0; width: 100%; }
    .followup-filters input, .followup-results-count { grid-column: 1 / -1; }
    .case-card-header, .case-person { align-items: flex-start; }
    .case-card-header { flex-direction: column; }
    .case-card-header-actions { justify-content: flex-start; width: 100%; }
    .case-alert-row { grid-template-columns: 1fr; }
    .case-actions { min-width: 0; }
    .case-actions .btn { flex: 1 1 auto; }
    .case-metric { padding-inline: .45rem; }
}

@media (max-width: 720px) {
    .panel-header-main,
    .metric-card-header,
    .competencia-summary,
    .my-ranking-top { align-items: stretch; flex-direction: column; }
    .header-actions { width: 100%; }
    .header-actions .btn { flex: 1 1 10rem; justify-content: center; }
    .competencia-summary-stats { justify-content: space-between; }
    .juicio-summary-grid { grid-template-columns: 1fr; }
    .my-position { align-self: flex-start; }
}

@media (max-width: 480px) {
    .metric-card { padding: 1rem; }
    .juicio-status-row, .juicio-status-detail { align-items: flex-start; flex-direction: column; }
    .score-sources .badge { width: 100%; }
    .competencia-modal-header,
    .competencia-modal-footer,
    .competencia-modal-body { padding: 1rem; }
    .competencia-modal-section-heading,
    .competencia-modal-rap { align-items: flex-start; flex-direction: column; }
    .competencia-modal-rap .badge { align-self: flex-start; }
}

/* ── Filtro por chips de estado (vista Aprendices) ── */
.estado-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.estado-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    text-decoration: none;
    transition: all 0.15s ease;
}
.estado-chip:hover {
    border-color: var(--accent-primary);
    color: var(--text-strong);
}
.estado-chip .chip-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--border-subtle);
    color: var(--text-strong);
}
.estado-chip.is-active {
    background: var(--sena-green-light);
    border-color: var(--accent-primary);
    color: var(--accent-hover);
}
.estado-chip.is-active .chip-count {
    background: var(--accent-primary);
    color: #fff;
}
.estado-chip.chip-warning.is-active { background: rgba(217, 119, 6, 0.15); border-color: #d97706; color: #b45309; }
.estado-chip.chip-warning.is-active .chip-count { background: #d97706; color: #fff; }
.estado-chip.chip-danger.is-active { background: rgba(220, 38, 38, 0.12); border-color: #dc2626; color: #b91c1c; }
.estado-chip.chip-danger.is-active .chip-count { background: #dc2626; color: #fff; }
.estado-chip.chip-info.is-active { background: rgba(59, 130, 246, 0.12); border-color: #3b82f6; color: #1d4ed8; }
.estado-chip.chip-info.is-active .chip-count { background: #3b82f6; color: #fff; }
.estado-chip.chip-secondary.is-active { background: var(--border-subtle); border-color: var(--text-muted); color: var(--text-strong); }
.estado-chip.chip-secondary.is-active .chip-count { background: var(--text-muted); color: var(--bg-surface); }

@media (max-width: 480px) {
    .estado-chip { width: 100%; justify-content: space-between; }
}

/* =========================================
   COMPONENTES UI/UX V8.7: BREADCRUMBS, STICKY BAR, WHATSAPP
   ========================================= */

/* ── Barra de Navegación Superior Unificada (Breadcrumbs + Volver) ── */
.page-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
    flex-wrap: wrap;
}

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

.page-nav-bar .btn-back,
.page-nav-bar .back-link {
    margin-bottom: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 9999px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 32px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.page-nav-bar .btn-back:hover,
.page-nav-bar .back-link:hover {
    color: var(--text-strong);
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: translateX(-2px);
}

/* ── Migas de Pan (Breadcrumbs) ── */
.breadcrumb-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    padding: 5px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: 9999px;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 32px;
}
.breadcrumb-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.breadcrumb-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.breadcrumb-nav a:hover {
    color: var(--accent-primary);
    text-decoration: none;
}
.breadcrumb-separator {
    color: var(--border-subtle);
    font-size: 11px;
    user-select: none;
    opacity: 0.8;
}
.breadcrumb-current {
    color: var(--text-strong);
    font-weight: 700;
}

/* ── Barra Flotante de Guardado (Sticky Save Bar) ── */
.sticky-save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--sticky-bar-bg);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-top: 1px solid var(--sticky-bar-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 12px clamp(16px, 4vw, 32px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: slideUpBar 0.25s ease-out;
}
@keyframes slideUpBar {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.sticky-save-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.sticky-save-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-main);
}
.sticky-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}
.sticky-stat-pill.is-present { background: var(--sena-green-light); color: var(--sena-green-dark); }
.sticky-stat-pill.is-absent { background: var(--sena-red-light); color: var(--danger); }
.sticky-stat-pill.is-justified { background: var(--sena-yellow-light); color: #b45309; }
.sticky-save-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .sticky-save-bar {
        padding: 10px 14px;
    }
    .sticky-save-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .sticky-save-summary {
        justify-content: space-around;
        font-size: 12px;
    }
    .sticky-save-actions .btn {
        width: 100%;
    }
}

/* ── Botón Compartir por WhatsApp ── */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: #ffffff !important;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-whatsapp:hover, .btn-whatsapp:focus-visible {
    background: #20ba59;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transform: translateY(-1px);
    color: #ffffff !important;
}
.btn-whatsapp:active {
    transform: translateY(0);
}
.btn-whatsapp svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ── Badges Semánticos de Competencias y Tipos ── */
.badge-tech {
    background: var(--badge-tech-bg) !important;
    color: var(--badge-tech-text) !important;
    font-weight: 700 !important;
}
.badge-transversal {
    background: var(--badge-transversal-bg) !important;
    color: var(--badge-transversal-text) !important;
    font-weight: 700 !important;
}
.badge-ingles {
    background: var(--badge-ingles-bg) !important;
    color: var(--badge-ingles-text) !important;
    font-weight: 700 !important;
}

/* ── Indicador de Racha de Inasistencias ── */
.racha-alerta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    background: var(--sena-red-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulseAlert 2s infinite ease-in-out;
}
@keyframes pulseAlert {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.97); }
}

/* ── Ficha Nav Scroll Effect ── */
.ficha-toolbar-inner {
    position: relative;
}

/* =========================================
   DASHBOARD: BUSCADOR Y VISTAS (TARJETAS / COMPACTA)
   ========================================= */
.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 24px;
    flex-wrap: wrap;
}
.dashboard-search-wrap {
    flex: 1;
    min-width: 260px;
    max-width: 480px;
    position: relative;
}
.dashboard-search-input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-divider);
    background: var(--input-bg);
    color: var(--text-strong);
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dashboard-search-input:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: var(--focus-ring);
}
.dashboard-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}
.view-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}
.view-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.view-switch-btn:hover {
    color: var(--text-strong);
}
.view-switch-btn.is-active {
    background: var(--bg-card);
    color: var(--accent-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Vista Compacta (Lista) */
.dashboard-compact-view {
    display: none;
    margin-bottom: 24px;
}
.dashboard-compact-view.is-visible {
    display: block;
}
.dashboard-cards.is-hidden {
    display: none;
}
.dashboard-compact-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.dashboard-compact-table th {
    background: var(--bg-surface);
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-divider);
    text-align: left;
}
.dashboard-compact-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-divider);
    font-size: 13px;
    color: var(--text-main);
    vertical-align: middle;
}
.dashboard-compact-table tr:last-child td {
    border-bottom: none;
}
/* ── Fila de Encabezado Unificada (Single-Row Header) ── */
.page-header,
.page-header-row,
.module-header,
.cleaning-page-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.page-title-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.page-title-cluster .btn-back,
.page-title-cluster .back-link {
    margin: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: 9999px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 32px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.page-title-cluster .btn-back:hover,
.page-title-cluster .back-link:hover {
    color: var(--text-strong);
    background: var(--bg-card);
    border-color: var(--accent-primary);
    transform: translateX(-2px);
}

.page-header h1,
.page-header-row h1,
.module-header h1,
.module-header .header-content h1,
.page-header-info h1,
.page-title {
    font-size: clamp(1.2rem, 1rem + 0.7vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-strong);
    line-height: 1.22;
}

.page-header-info,
.page-header .header-content,
.module-header .header-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.page-header-actions,
.page-header .header-actions,
.page-header .page-actions,
.module-header .header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .page-header,
    .page-header-row,
    .module-header,
    .cleaning-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .page-title-cluster,
    .page-header-info {
        width: 100%;
        justify-content: flex-start;
    }
    .page-header-actions,
    .page-header .header-actions,
    .page-header .page-actions,
    .module-header .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 8px;
    }
    .page-header-actions .btn,
    .page-header .header-actions .btn,
    .page-header .page-actions .btn,
    .module-header .header-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 38px;
    }
}
.dashboard-compact-table tr:hover td {
    background: var(--bg-glass-hover);
}
.compact-ficha-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.compact-ficha-title strong {
    color: var(--text-strong);
    font-size: 14px;
}
.compact-ficha-title small {
    color: var(--text-muted);
    font-size: 12px;
}
.compact-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
}
.compact-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Separador Semántico en Ficha Nav ── */
.ficha-nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-divider);
    margin: auto 4px;
    flex-shrink: 0;
}

/* ── Barra Inferior Móvil para Aprendices (Bottom Navigation) ── */
.learner-bottom-nav {
    display: none;
}

@media (max-width: 640px) {
    .learner-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--sticky-bar-bg);
        backdrop-filter: var(--blur-glass);
        -webkit-backdrop-filter: var(--blur-glass);
        border-top: 1px solid var(--border-divider);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    }
    .learner-bottom-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 700;
        padding: 4px 8px;
        border-radius: 8px;
        transition: color 0.15s ease;
        flex: 1;
        text-align: center;
    }
    .learner-bottom-link .bottom-nav-icon {
        font-size: 18px;
        line-height: 1;
    }
    .learner-bottom-link:hover,
    .learner-bottom-link:focus-visible,
    .learner-bottom-link.is-active {
        color: var(--accent-primary);
    }
    body.has-learner-bottom-nav {
        padding-bottom: 70px;
    }
}

/* =========================================
   PANEL DEL INSTRUCTOR — JERARQUÍA MOBILE FIRST
   La tarjeta prioriza el estado y las tareas frecuentes;
   los módulos de consulta quedan disponibles bajo demanda.
========================================= */
.dashboard-toolbar {
    align-items: stretch;
    margin: 20px 0 14px;
}

.dashboard-search-wrap {
    flex: 1 1 360px;
    min-width: 0;
    max-width: none;
}

.dashboard-search-input,
.dashboard-search-clear,
.view-switch-btn {
    min-height: 42px;
}

.dashboard-search-input {
    padding-right: 44px;
}

.dashboard-search-clear {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.dashboard-search-clear:hover {
    color: var(--text-strong);
    background: var(--bg-surface);
}

.dashboard-result-count {
    align-self: center;
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-no-results {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
}

.dashboard-no-results[hidden] {
    display: none;
}

.view-switch-btn {
    justify-content: center;
    padding: 7px 14px;
}

.ficha-card-header > div {
    min-width: 0;
}

.ficha-secondary-metrics {
    border-top: 1px solid var(--border-divider);
}

.ficha-secondary-metrics summary,
.ficha-more-actions summary,
.fichas-archivadas > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.ficha-secondary-metrics summary::-webkit-details-marker,
.ficha-more-actions summary::-webkit-details-marker,
.fichas-archivadas > summary::-webkit-details-marker {
    display: none;
}

.ficha-secondary-metrics summary::after,
.fichas-archivadas > summary::after {
    color: var(--accent-primary);
    content: "＋";
    font-size: 18px;
    line-height: 1;
}

.ficha-secondary-metrics[open] summary::after,
.fichas-archivadas[open] > summary::after {
    content: "−";
}

.ficha-secondary-metrics summary small {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
}

.ficha-secondary-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 0 2px;
}

.ficha-more-actions {
    border-top: 1px solid var(--border-divider);
}

.ficha-more-actions summary {
    justify-content: flex-start;
    gap: 8px;
    color: var(--accent-hover);
}

.ficha-more-actions summary span {
    margin-left: auto;
    font-size: 19px;
    font-weight: 500;
}

.ficha-more-actions[open] summary span {
    transform: rotate(45deg);
}

.ficha-more-actions .ficha-action-grid {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-divider);
}

.ficha-action-grid-primary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.ficha-action-grid-primary .module-action {
    min-height: 62px;
}

.ficha-more-actions .module-action {
    min-height: 58px;
}

.fichas-archivadas {
    margin-top: 32px;
}

.fichas-archivadas > summary {
    padding: 12px 14px;
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
}

.fichas-archivadas-list {
    margin-top: 16px;
}

@media (max-width: 1040px) {
    .ficha-action-grid-primary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .ficha-action-grid-primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .nav-identity {
        display: none;
    }

    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 18px;
    }

    .dashboard-hero .btn {
        width: 100%;
    }

    .dashboard-toolbar {
        gap: 8px;
    }

    .dashboard-search-wrap,
    .view-switcher {
        flex-basis: 100%;
        width: 100%;
    }

    .view-switcher {
        display: flex;
    }

    .view-switch-btn {
        flex: 1 1 0;
    }

    .dashboard-result-count {
        width: 100%;
        text-align: right;
    }

    .dashboard-no-results {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-no-results .btn {
        width: 100%;
    }

    .ficha-card-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
    }

    .ficha-open-link {
        align-self: flex-start;
        min-height: 42px;
        padding: 9px 0;
    }

    .ficha-secondary-metrics summary {
        flex-wrap: wrap;
    }

    .ficha-secondary-metrics summary small {
        flex-basis: 100%;
        margin-left: 0;
    }

    .ficha-secondary-metrics-grid,
    .ficha-more-actions .ficha-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ficha-nav-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding-right: 12px;
        padding-bottom: 44px;
        padding-left: 12px;
    }

    .dashboard-hero h1 {
        font-size: clamp(28px, 10vw, 36px);
    }

    .dashboard-hero p {
        max-width: 30rem;
        font-size: 14px;
    }

    .dashboard-cards {
        gap: 14px;
    }

    .dashboard-cards .card-ficha {
        padding: 16px 14px;
    }

    .ficha-dashboard-active .ficha-metric-grid,
    .ficha-secondary-metrics-grid,
    .ficha-more-actions .ficha-action-grid {
        grid-template-columns: 1fr;
    }

    .ficha-action-grid-primary {
        grid-template-columns: 1fr;
    }

    .ficha-action-grid-primary .module-action,
    .ficha-more-actions .module-action {
        min-height: 58px;
    }

    .ficha-toolbar {
        padding: 4px 0;
    }

    .ficha-toolbar-inner {
        min-height: 48px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .ficha-nav a {
        min-height: 46px;
        padding-right: 12px;
        padding-left: 12px;
    }
}

@media (max-width: 420px) {
    .nav-shell {
        min-height: 60px;
        padding: 8px 12px;
        gap: 8px;
    }

    .nav-primary {
        display: none;
    }

    .nav-logo {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .nav-title {
        font-size: 14px;
    }

    .nav-brand-copy small,
    .nav-subtitle {
        display: none;
    }

    .nav-icon-button,
    .nav-logout {
        min-width: 42px;
        min-height: 42px;
    }

    .nav-icon-button {
        width: 42px;
        height: 42px;
    }

    .nav-logout {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ==========================================================================
   REDISEÑO ELEGANTE DE TARJETA DE FICHA Y TRACKER DE FASES (SENA CONTROL)
   ========================================================================== */

.ficha-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-ficha-planeacion {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-strong);
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-ficha-planeacion:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-card);
}

/* ==========================================================================
   MÓDULO HERO: TIEMPO DE FORMACIÓN & CUÁNTO FALTA POR TERMINAR (2 COLUMNAS)
   ========================================================================== */

.ficha-time-hero,
.ficha-formation-hero {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ficha-time-hero:hover,
.ficha-formation-hero:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Grid de 2 columnas mobile-first */
.time-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 820px) {
    .time-hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
        align-items: stretch;
    }
}

.time-hero-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

/* En desktop/tablet, división visual sutil entre columnas */
@media (min-width: 720px) {
    .time-hero-col-progress {
        padding-right: 20px;
        border-right: 1px solid var(--border-divider);
    }
    .time-hero-col-group {
        padding-left: 4px;
    }
}

.time-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.time-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}

.time-hero-icon {
    font-size: 14px;
}

.time-hero-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
}

.time-hero-badge.is-goal {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.time-hero-badge.is-active {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.time-hero-badge.is-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.time-hero-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
}

.time-hero-tag.is-milestone {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.time-hero-tag.is-pending {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.time-hero-metric-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-hero-val-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.time-hero-val {
    font-size: clamp(24px, 3.2vw, 32px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-strong);
    letter-spacing: -0.02em;
}

.time-hero-unit {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 700;
    color: var(--text-muted);
}

.time-hero-val-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.time-hero-detail {
    font-size: 12px;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0;
}

.time-hero-track {
    position: relative;
    height: 8px;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: visible;
    margin: 4px 0 2px;
}

.time-hero-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.time-hero-marker {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #dc2626;
    z-index: 3;
    pointer-events: none;
}

.time-hero-marker-label {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8.5px;
    font-weight: 800;
    color: #dc2626;
    white-space: nowrap;
    letter-spacing: .02em;
}

.time-hero-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.time-meta-item strong {
    color: var(--text-strong);
    font-weight: 700;
}

.time-meta-divider {
    color: var(--border-divider);
}

/* Gráfico comparativo del promedio académico del grupo */
.group-average-progress {
    min-width: 0;
}

.group-average-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group-average-track {
    position: relative;
    height: 12px;
    margin: 12px 0 0;
    overflow: visible;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, .14), 0 1px 0 rgba(255, 255, 255, .8);
}

.group-average-track::after {
    position: absolute;
    inset: -1px;
    z-index: 4;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

.group-average-bar {
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, #2563eb, #39a900);
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
    transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

.group-average-target-line {
    position: absolute;
    top: -4px;
    bottom: -4px;
    z-index: 3;
    width: 2px;
    background: #dc2626;
    pointer-events: none;
}

.group-average-target-label {
    position: absolute;
    top: -18px;
    transform: translateX(-50%);
    color: #dc2626;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}

.group-average-scale {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
}

.group-average-scale span:nth-child(2) {
    color: var(--text-main);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.group-average-insight {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    background: var(--bg-card);
    font-size: 11px;
    line-height: 1.35;
}

.group-average-insight.is-positive {
    border-color: rgba(5, 150, 105, .24);
    background: rgba(16, 185, 129, .06);
}

.group-average-insight.is-attention {
    border-color: rgba(217, 119, 6, .28);
    background: rgba(245, 158, 11, .08);
}

.group-average-insight.is-neutral {
    color: var(--text-muted);
    background: var(--bg-input);
}

.group-average-insight-icon {
    flex: 0 0 auto;
    color: #059669;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.group-average-insight.is-attention .group-average-insight-icon {
    color: #d97706;
}

.group-average-insight.is-neutral .group-average-insight-icon {
    color: var(--text-muted);
}

.time-remaining-note {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: baseline;
    gap: 6px 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.35;
}

.time-remaining-label {
    color: var(--text-main);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.time-remaining-note strong {
    color: var(--text-strong);
    font-size: 12px;
}

.time-remaining-note .time-hero-unit {
    font-size: 11px;
}

/* Grilla de hitos dentro de la columna 2 con iconos representativos */
.time-milestones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

@media (max-width: 440px) {
    .time-milestones-grid {
        grid-template-columns: 1fr;
    }
}

.time-milestone-card {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.time-milestone-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.time-milestone-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-input);
    color: var(--text-strong);
}

.is-lectiva-card .time-milestone-icon-box {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.is-productiva-card .time-milestone-icon-box {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.time-milestone-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.milestone-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.milestone-date {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-strong);
}

.milestone-sub-date {
    display: block;
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 2px;
}

.milestone-sub-date strong {
    color: var(--text-main);
    font-weight: 600;
}

.milestone-status-tag {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
    white-space: nowrap;
    border: 1px solid var(--border-divider);
}

.milestone-status-tag.is-productiva-tag {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.25);
}

/* --- Tracker de Fases del Proyecto --- */
.ficha-fases-tracker {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.ficha-formation-hero .ficha-fases-tracker,
.ficha-time-hero .ficha-fases-tracker {
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-divider);
    border-radius: 0;
    padding: 18px 0 0;
    margin-top: 2px;
    box-shadow: none;
}

.fases-tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.fases-tracker-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fases-eyebrow {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}

.fases-badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fases-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.fases-status-pill.is-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.fases-status-pill.is-info {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.fases-status-pill.is-success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.fases-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.fases-source-pill {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.fases-source-pill.is-verified {
    background: rgba(57, 169, 0, 0.12);
    color: var(--primary);
    border: 1px solid rgba(57, 169, 0, 0.25);
}

.fases-source-pill.is-estimated {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-divider);
}

.fases-source-pill.is-estimated:hover {
    color: var(--text-strong);
    border-color: var(--text-muted);
}

.fases-comparison-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-divider);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.fases-comparison-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fases-comparison-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fases-comparison-val {
    font-size: 12px;
    font-weight: 800;
}

.fases-comparison-divider {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Stepper horizontal de fases */
.fases-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.fase-step {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    position: relative;
    transition: all 0.2s ease;
}

.fase-step.is-completed {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.04), var(--bg-card));
}

.fase-step.is-delayed {
    border-color: rgba(239, 68, 68, 0.45);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.04), var(--bg-card));
}

.fase-step.is-current-time {
    box-shadow: 0 0 0 1.5px var(--accent-hover);
}

.fase-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.fase-step-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fase-step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-input);
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.fase-step.is-completed .fase-step-num {
    background: rgba(16, 185, 129, 0.2);
    color: #059669;
}

.fase-step-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fase-step-badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.fase-marker-time {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.fase-marker-rap {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.fase-step-metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 11px;
}

.fase-step-pct {
    font-weight: 700;
    color: var(--text-main);
}

.fase-step-count {
    color: var(--text-muted);
    font-size: 10px;
}

.fase-step-bar {
    height: 5px;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: hidden;
}

.fase-step-bar-fill {
    height: 100%;
    background: var(--accent-hover);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.fase-step.is-completed .fase-step-bar-fill {
    background: #10b981;
}

.fase-step.is-delayed .fase-step-bar-fill {
    background: #f59e0b;
}

.fases-veredicto-caption {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    padding-top: 6px;
    border-top: 1px dashed var(--border-divider);
}

.fases-veredicto-caption p {
    margin: 0;
}

/* --- Grid Bento de KPIs Operativos --- */
.ficha-bento-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.ficha-bento-kpis.ficha-bento-kpis-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bento-kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-md);
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 9px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bento-kpi-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.bento-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.bento-kpi-label {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.bento-kpi-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
}

.bento-kpi-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
}

.bento-kpi-tag.tag-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.bento-kpi-tag.tag-ok {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.bento-kpi-center {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bento-kpi-val {
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-strong);
}

.bento-kpi-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bento-kpi-track {
    position: relative;
    height: 6px;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: hidden;
}

.bento-kpi-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.bento-kpi-bar.is-time {
    background: var(--accent-hover);
}

.bento-kpi-bar.is-attendance {
    background: #10b981;
}

.bento-kpi-target-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2;
}

/* --- Foco Estratégico y Alertas --- */
.ficha-strategic-focus {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.strategic-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.strategic-alert-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.strategic-alert-body strong {
    color: #b45309;
    font-weight: 700;
}

.strategic-alert-body p {
    margin: 2px 0 0;
    color: var(--text-main);
    line-height: 1.35;
}

.ficha-competencies-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11.5px;
}

.competencies-caption {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
}

.competencies-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.competency-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    font-size: 11px;
}

.competency-chip .chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
}

.competency-chip.is-mid .chip-dot {
    background: #f59e0b;
}

.competency-chip.is-ok .chip-dot {
    background: #10b981;
}

.competency-chip .chip-name {
    color: var(--text-main);
}

.competency-chip .chip-val {
    font-weight: 800;
    color: var(--text-strong);
}

/* --- Expandibles Secundarios --- */
.ficha-expandable-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ficha-secondary-details {
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    overflow: hidden;
}

.ficha-secondary-details summary {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.ficha-secondary-details summary:hover {
    color: var(--text-strong);
}

.secondary-details-content {
    padding: 12px;
    border-top: 1px solid var(--border-divider);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

/* Tarjeta enriquecida de métrica secundaria */
.detail-kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    position: relative;
}

.detail-kpi-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.detail-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-kpi-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.detail-kpi-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-kpi-icon-badge.is-tyt {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.detail-kpi-icon-badge.is-productiva {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.detail-kpi-icon-badge.is-cert {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.detail-kpi-icon-badge.is-integral {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.detail-kpi-title-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.detail-kpi-title-block strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.25;
}

/* Velocímetro en miniatura para tarjeta TyT */
.detail-kpi-gauge-wrap {
    flex-shrink: 0;
    width: 65px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-speedometer-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Indicador radial para Certificación */
.detail-kpi-ring-wrap {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-ring-svg {
    width: 36px;
    height: 36px;
    overflow: visible;
}

/* Insignias de estado en tarjetas */
.detail-kpi-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
}

.detail-kpi-badge.is-productiva {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.detail-kpi-badge.is-positive {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.detail-kpi-badge.is-attention {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Barra de progreso en tarjetas de detalle */
.detail-kpi-track {
    position: relative;
    height: 6px;
    background: var(--bg-input);
    border-radius: 999px;
    overflow: visible;
    margin: 1px 0;
}

.detail-kpi-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.detail-kpi-bar.is-tyt {
    background: linear-gradient(90deg, #3b82f6, #2563eb 60%, #10b981);
}

.detail-kpi-bar.is-cert {
    background: linear-gradient(90deg, #10b981, #059669);
}

.detail-kpi-target-line {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #dc2626;
    z-index: 2;
    pointer-events: none;
}

/* Pipeline visual de Etapa Productiva */
.stage-pipeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 3px 0;
    width: 100%;
    box-sizing: border-box;
}

.stage-step {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.stage-step.is-active {
    color: var(--primary);
}

.stage-step.is-done {
    color: #059669;
}

.stage-step.is-next {
    color: #2563eb;
}

.stage-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-divider);
    flex-shrink: 0;
}

.stage-step.is-active .stage-dot {
    background: var(--primary);
    box-shadow: 0 0 0 2.5px rgba(57, 169, 0, 0.2);
}

.stage-step.is-done .stage-dot {
    background: #059669;
}

.stage-step.is-next .stage-dot {
    background: #2563eb;
    box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.2);
}

.stage-connector {
    flex: 1;
    height: 2px;
    background: var(--border-divider);
    min-width: 8px;
}

.stage-connector.is-done {
    background: #059669;
}

/* Barra de Balance Convivencial / Sentiment Ratio */
.behavior-balance-bar {
    height: 7px;
    border-radius: 999px;
    background: var(--bg-input);
    display: flex;
    overflow: hidden;
    gap: 2px;
    margin: 1px 0;
}

.balance-segment.is-positive {
    background: #10b981;
    border-radius: 999px 0 0 999px;
}

.balance-segment.is-negative {
    background: #ef4444;
    border-radius: 0 999px 999px 0;
}

.balance-segment.is-clean {
    background: rgba(16, 185, 129, 0.35);
    border-radius: 999px;
}

/* Micro-chips informativos */
.detail-kpi-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kpi-mini-chip {
    font-size: 10.5px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kpi-mini-chip strong {
    color: var(--text-strong);
}

.kpi-mini-chip.is-warning {
    color: #d97706;
}

.kpi-mini-chip.is-danger {
    color: #dc2626;
}

.kpi-mini-chip.is-success,
.kpi-mini-chip.is-positive {
    color: #059669;
}

.kpi-mini-chip.is-date {
    color: var(--text-main);
    font-size: 10.5px;
}

.detail-item-label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.btn-detail-link {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-hover);
    text-decoration: none;
}

.btn-detail-link:hover {
    text-decoration: underline;
}

/* Responsive para pantallas medianas y móviles */
@media (max-width: 980px) {
    .ficha-bento-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fases-stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 580px) {
    .ficha-bento-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .fases-stepper {
        grid-template-columns: minmax(0, 1fr);
    }

    .fases-tracker-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fases-comparison-summary {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================================================
   TARJETA DE FICHA — POLISH OPERATIVO Y MOBILE FIRST
   Barras con borde, color semántico y lectura progresiva de pendientes.
   ============================================================================ */

.ficha-time-hero .time-hero-track,
.ficha-time-hero .group-average-track {
    height: 12px;
    border: 1.5px solid var(--border-subtle);
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, .14), 0 1px 0 rgba(255, 255, 255, .8);
}

.ficha-time-hero .time-hero-track::after,
.ficha-time-hero .group-average-track::after {
    position: absolute;
    inset: -1px;
    z-index: 4;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

.ficha-time-hero .time-hero-bar,
.ficha-time-hero .group-average-bar {
    min-width: 3px;
}

.ficha-time-hero .time-hero-bar,
.ficha-time-hero .group-average-bar {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.ficha-dashboard-active .fase-step-bar,
.ficha-dashboard-active .estados-bar,
.ficha-dashboard-active .bento-kpi-track,
.ficha-dashboard-active .detail-kpi-track,
.ficha-dashboard-active .behavior-balance-bar {
    border: 1.5px solid var(--border-subtle);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, .12), 0 1px 0 rgba(255, 255, 255, .75);
}

.ficha-dashboard-active .fase-step-bar {
    height: 9px;
}

.ficha-dashboard-active .fase-step-bar-fill,
.ficha-dashboard-active .bento-kpi-bar,
.ficha-dashboard-active .detail-kpi-bar,
.ficha-dashboard-active .balance-segment {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36);
}

.ficha-dashboard-active .bento-kpi-card {
    --kpi-accent: var(--info);
    position: relative;
    overflow: hidden;
    border-width: 1.5px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.ficha-dashboard-active .bento-kpi-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--kpi-accent);
    content: "";
}

.ficha-dashboard-active .bento-kpi-card.is-goal-reached,
.ficha-dashboard-active .bento-kpi-card.is-positive {
    --kpi-accent: #059669;
}

.ficha-dashboard-active .bento-kpi-card.is-progress {
    --kpi-accent: #6366f1;
}

.ficha-dashboard-active .bento-kpi-card.is-attention,
.ficha-dashboard-active .bento-kpi-card.is-warning {
    --kpi-accent: #d97706;
}

.ficha-dashboard-active .bento-kpi-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ficha-dashboard-active .bento-kpi-label::before {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--kpi-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--kpi-accent) 14%, transparent);
    content: "";
}

.ficha-dashboard-active .bento-kpi-track {
    height: 11px;
    padding: 2px;
    overflow: hidden;
    box-sizing: border-box;
    background: var(--bg-input);
}

.ficha-dashboard-active .bento-kpi-bar {
    min-height: 100%;
    background: var(--kpi-accent);
}

.ficha-dashboard-active .bento-kpi-bar.is-attendance {
    background: #059669;
}

.ficha-dashboard-active .bento-state-legend {
    margin-top: 7px;
    line-height: 1.25;
}

.ficha-dashboard-active .bento-state-legend span {
    min-width: 0;
}

.ficha-dashboard-active .bento-state-legend .estados-dot {
    background: var(--state-color);
}

.ficha-dashboard-active .detail-kpi-track {
    height: 9px;
    padding: 1px;
    overflow: hidden;
    box-sizing: border-box;
}

.ficha-dashboard-active .detail-kpi-bar {
    min-height: 100%;
}

/* Indicadores que estaban calculados, pero no eran visibles en la tarjeta. */
.ficha-operational-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: clamp(14px, 2vw, 18px);
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
    border: 1.5px solid var(--border-divider);
    border-radius: var(--radius-md);
}

.operational-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.operational-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--accent-hover);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.operational-panel-heading h3 {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(14px, 1.6vw, 16px);
    line-height: 1.25;
}

.operational-panel-note {
    flex: 0 0 auto;
    padding: 4px 8px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 700;
}

.ficha-operational-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

.operational-item {
    --operational-accent: var(--info);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 78px;
    padding: 11px 12px;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1.5px solid var(--border-divider);
    border-left: 4px solid var(--operational-accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.operational-item--tasks { --operational-accent: #6366f1; }
.operational-item--evidence { --operational-accent: #059669; }
.operational-item--plans { --operational-accent: #d97706; }

.operational-item:hover {
    border-color: var(--operational-accent);
    box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.operational-item:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), 0 5px 14px rgba(15, 23, 42, .08);
}

.operational-item-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    background: color-mix(in srgb, var(--operational-accent) 12%, var(--bg-card));
    border-radius: 10px;
    font-size: 16px;
}

.operational-item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.operational-item-label {
    color: var(--text-muted);
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: .045em;
    line-height: 1.2;
    text-transform: uppercase;
}

.operational-item-copy strong {
    color: var(--operational-accent);
    font-size: clamp(18px, 2.3vw, 23px);
    font-weight: 900;
    line-height: 1.1;
}

.operational-item-copy small {
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.operational-item-arrow {
    align-self: center;
    color: var(--operational-accent);
    font-size: 18px;
    font-weight: 800;
}

.operational-progress {
    display: block;
    width: 100%;
    height: 9px;
    margin-top: 5px;
    overflow: hidden;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12);
}

.operational-progress > span {
    display: block;
    min-width: 0;
    height: 100%;
    background: var(--operational-accent);
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}

/* El nombre de la competencia es información accionable: debe envolver. */
.ficha-competencies-compact {
    align-items: flex-start;
}

.competency-chip {
    max-width: 100%;
    align-items: flex-start;
    line-height: 1.3;
}

.competency-chip .chip-name,
.ficha-competency > span {
    min-width: 0;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

@media (min-width: 620px) {
    .ficha-operational-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .ficha-operational-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .ficha-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-ficha-planeacion {
        min-height: 42px;
        padding: 8px 11px;
        box-sizing: border-box;
    }
}

@media (max-width: 560px) {
    .time-hero-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .time-hero-col-group {
        gap: 10px;
    }

    .time-remaining-note {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .time-remaining-label {
        grid-column: 1 / -1;
    }

    .time-hero-meta-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .time-meta-divider {
        display: none;
    }

    .fases-comparison-summary {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .fases-comparison-item {
        flex: 1 1 140px;
        min-width: 0;
    }

    .fases-comparison-val {
        white-space: normal;
        line-height: 1.25;
    }

    .operational-panel-heading {
        flex-direction: column;
        gap: 7px;
    }

    .operational-panel-note {
        align-self: flex-start;
    }
}

/* En teléfonos estrechos, las acciones necesitan ancho completo para conservar
   sus etiquetas y evitar saltos de palabra poco legibles. */
@media (max-width: 480px) {
  .ficha-dashboard-active .ficha-action-grid-primary {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
    .ficha-dashboard-active .bento-kpi-card,
    .operational-item,
    .time-hero-bar,
    .group-average-bar {
        transition: none;
    }
}

/* ============================================================================
   TARJETAS DE FICHA — PROFUNDIDAD, SEPARACIÓN Y LECTURA PROGRESIVA
   La ficha funciona como una superficie propia y sus módulos como fichas
   internas. El color del borde superior identifica la etapa sin depender solo
   del texto o de los indicadores.
   ============================================================================ */

.dashboard-cards .card-ficha,
.fichas-archivadas-list .card-ficha {
    --ficha-accent: var(--accent-primary);
    --ficha-accent-soft: color-mix(in srgb, var(--accent-primary) 9%, var(--bg-card));
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-top: 4px solid var(--ficha-accent);
    border-radius: 20px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .08),
        0 10px 24px rgba(15, 23, 42, .08),
        0 24px 48px -32px color-mix(in srgb, var(--ficha-accent) 42%, transparent);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.dashboard-cards .card-ficha.ficha-lectiva,
.fichas-archivadas-list .card-ficha.ficha-lectiva {
    --ficha-accent: #2563eb;
    --ficha-accent-soft: rgba(37, 99, 235, .08);
}

.dashboard-cards .card-ficha.ficha-productiva,
.fichas-archivadas-list .card-ficha.ficha-productiva {
    --ficha-accent: #059669;
    --ficha-accent-soft: rgba(5, 150, 105, .08);
}

.dashboard-cards .card-ficha.ficha-finalizada,
.fichas-archivadas-list .card-ficha.ficha-finalizada {
    --ficha-accent: #64748b;
    --ficha-accent-soft: rgba(100, 116, 139, .08);
}

.dashboard-cards .card-ficha.ficha-pendiente,
.fichas-archivadas-list .card-ficha.ficha-pendiente {
    --ficha-accent: #d97706;
    --ficha-accent-soft: rgba(217, 119, 6, .09);
}

.dashboard-cards .card-ficha:hover,
.fichas-archivadas-list .card-ficha:hover {
    border-color: color-mix(in srgb, var(--ficha-accent) 52%, var(--border-subtle));
    box-shadow:
        0 2px 4px rgba(15, 23, 42, .08),
        0 16px 32px rgba(15, 23, 42, .12),
        0 28px 56px -34px color-mix(in srgb, var(--ficha-accent) 52%, transparent);
    transform: translateY(-3px);
}

.card-ficha .ficha-card-header {
    position: relative;
    margin: 0;
    padding: clamp(15px, 2.2vw, 23px) clamp(15px, 2.6vw, 27px);
    background: linear-gradient(135deg, var(--ficha-accent-soft), var(--bg-card) 58%);
    border-bottom: 1px solid var(--border-divider);
}

.card-ficha .ficha-card-header::after {
    position: absolute;
    right: clamp(15px, 2.6vw, 27px);
    bottom: -1px;
    left: clamp(15px, 2.6vw, 27px);
    height: 1px;
    background: linear-gradient(90deg, var(--ficha-accent), transparent 70%);
    content: "";
    opacity: .55;
}

.card-ficha .ficha-card-header > div:first-child {
    flex: 1 1 auto;
}

.card-ficha .ficha-card-labels {
    gap: 6px;
}

.card-ficha .card-badge {
    color: var(--ficha-accent);
    background: var(--bg-card);
    border: 1px solid color-mix(in srgb, var(--ficha-accent) 35%, var(--border-subtle));
    border-radius: 999px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .06);
}

.card-ficha .ficha-card-header .card-title {
    max-width: none;
    margin-top: 9px;
    color: var(--text-strong);
}

.card-ficha .ficha-header-actions {
    align-self: flex-start;
    justify-content: flex-end;
}

.card-ficha .btn-ficha-planeacion,
.card-ficha .ficha-open-link {
    min-height: 42px;
    box-sizing: border-box;
}

.card-ficha .btn-ficha-planeacion {
    background: var(--bg-card);
    border-color: color-mix(in srgb, var(--ficha-accent) 28%, var(--border-divider));
    box-shadow: 0 2px 5px rgba(15, 23, 42, .05);
}

.card-ficha .btn-ficha-planeacion:hover,
.card-ficha .btn-ficha-planeacion:focus-visible {
    color: var(--ficha-accent);
    border-color: var(--ficha-accent);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--ficha-accent) 18%, transparent);
}

.card-ficha .ficha-open-link {
    color: var(--ficha-accent);
}

.card-ficha .ficha-card-body {
    gap: clamp(11px, 1.5vw, 15px);
    padding: clamp(13px, 2.2vw, 22px);
}

.card-ficha .ficha-time-hero {
    gap: 14px;
    padding: clamp(13px, 1.8vw, 18px);
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-card));
    border: 1.5px solid var(--border-divider);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 4px 12px rgba(15, 23, 42, .06);
}

.card-ficha .time-hero-col-progress {
    padding-right: 0;
}

.card-ficha .time-hero-col-group {
    padding-left: 0;
}

.card-ficha .time-hero-eyebrow {
    color: var(--ficha-accent);
}

.card-ficha .time-hero-more,
.card-ficha .ficha-phase-details {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-radius: 12px;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .04);
}

.card-ficha .time-hero-more > summary,
.card-ficha .ficha-phase-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 8px 11px;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
}

.card-ficha .time-hero-more > summary::-webkit-details-marker,
.card-ficha .ficha-phase-details > summary::-webkit-details-marker {
    display: none;
}

.card-ficha .time-hero-more > summary:hover,
.card-ficha .ficha-phase-details > summary:hover {
    background: var(--ficha-accent-soft);
}

.card-ficha .time-hero-more > summary:focus-visible,
.card-ficha .ficha-phase-details > summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ficha-accent) 30%, transparent);
    outline-offset: -3px;
}

.time-hero-more-copy,
.ficha-phase-summary-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.time-hero-more-copy strong,
.ficha-phase-summary-copy strong {
    color: var(--text-strong);
    font-size: 11.5px;
    font-weight: 800;
}

.time-hero-more-copy small,
.ficha-phase-summary-copy small {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.3;
}

.time-hero-more-icon,
.ficha-phase-summary-action {
    flex: 0 0 auto;
    color: var(--ficha-accent);
    font-size: 11px;
    font-weight: 800;
}

.time-hero-more-icon {
    font-size: 19px;
    font-weight: 500;
    transition: transform .18s ease;
}

.time-hero-more[open] .time-hero-more-icon {
    transform: rotate(45deg);
}

.ficha-phase-summary-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.ficha-phase-summary-action span {
    font-size: 19px;
    font-weight: 500;
    transition: transform .18s ease;
}

.ficha-phase-details[open] .ficha-phase-summary-action span {
    transform: rotate(45deg);
}

.time-hero-more-content,
.ficha-phase-details-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-divider);
}

.card-ficha .time-hero-more-content .group-average-insight,
.card-ficha .time-hero-more-content .time-remaining-note,
.card-ficha .time-hero-more-content .time-milestones-grid {
    margin: 0;
}

.card-ficha .ficha-phase-details {
    border-color: color-mix(in srgb, var(--ficha-accent) 22%, var(--border-divider));
}

.card-ficha .ficha-phase-details > summary {
    border-left: 3px solid var(--ficha-accent);
}

.card-ficha .ficha-phase-details .ficha-fases-tracker {
    gap: 12px;
    padding: 4px 0 2px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.card-ficha .ficha-bento-kpis {
    gap: 10px;
}

.card-ficha .bento-kpi-card,
.card-ficha .ficha-operational-panel,
.card-ficha .module-action,
.card-ficha .ficha-secondary-details {
    border-width: 1.5px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.card-ficha .bento-kpi-card {
    background: var(--bg-card);
}

.card-ficha .bento-kpi-sub {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.3;
}

.card-ficha .ficha-operational-panel {
    gap: 10px;
    padding: clamp(12px, 1.8vw, 16px);
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-card));
}

.card-ficha .operational-item {
    min-height: 68px;
    background: var(--bg-card);
}

.card-ficha .ficha-action-grid-primary .module-action,
.card-ficha .ficha-more-actions .module-action {
    background: var(--bg-card);
}

.card-ficha .ficha-action-grid-primary .module-action:hover,
.card-ficha .ficha-more-actions .module-action:hover {
    border-color: var(--ficha-accent);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--ficha-accent) 14%, transparent);
}

.card-ficha .ficha-expandable-section {
    gap: 9px;
}

/* Los nombres de fases y competencias deben envolver; no se recorta texto
   operativo para ganar unos píxeles de altura. */
.card-ficha .fase-step-name,
.card-ficha .competency-chip .chip-name {
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    white-space: normal;
}

@media (max-width: 700px) {
    .card-ficha .ficha-card-header {
        padding: 14px 15px;
    }

    .card-ficha .ficha-header-actions {
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
    }

    .card-ficha .btn-ficha-planeacion {
        flex: 1 1 auto;
    }

    .card-ficha .ficha-phase-summary-action {
        font-size: 0;
    }

    .card-ficha .ficha-phase-summary-action span {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .card-ficha .ficha-card-body {
        padding: 12px;
    }

    .card-ficha .time-hero-more > summary,
    .card-ficha .ficha-phase-details > summary {
        min-height: 44px;
        padding: 8px 10px;
    }

    .card-ficha .time-hero-more-content,
    .card-ficha .ficha-phase-details-content {
        padding: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-cards .card-ficha,
    .fichas-archivadas-list .card-ficha,
    .time-hero-more-icon,
    .ficha-phase-summary-action span {
        transition: none;
    }
}

/* =========================================
   VISIÓN GENERAL DE LA FICHA (FICHA 360)
   Centro de control y mando operativo
========================================= */
.vision-general {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

.vision-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.vision-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vision-badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.vision-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0;
    line-height: 1.25;
}

.vision-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.urgent-panel {
    background: color-mix(in srgb, var(--bg-card) 85%, var(--bg-base));
    border: 1px solid var(--border-divider);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.urgent-section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 16px 0;
}

.urgent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.urgent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-divider);
    border-left: 4px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.urgent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.urgent-card.is-danger {
    border-left-color: var(--danger);
}

.urgent-card.is-warning {
    border-left-color: var(--warning);
}

.urgent-card.is-info {
    border-left-color: var(--info);
}

.urgent-card.is-ok {
    border-left-color: var(--success);
}

.urgent-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.urgent-card-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.urgent-card-title {
    display: block;
    font-size: 0.95rem;
    color: var(--text-strong);
    line-height: 1.2;
}

.urgent-card-count {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-strong);
}

.urgent-desc {
    font-size: 0.85rem;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.urgent-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.urgent-list li {
    line-height: 1.3;
}

.urgent-link {
    color: var(--text-strong);
    text-decoration: none;
}

.urgent-link:hover {
    text-decoration: underline;
    color: var(--primary);
}

.urgent-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.urgent-more a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.urgent-action-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding-top: 4px;
    border-top: 1px dashed var(--border-divider);
    width: 100%;
}

.urgent-action-btn:hover {
    text-decoration: underline;
}

.vision-hero-block {
    margin: 0;
}

.vision-phase-accordion {
    margin-top: 16px;
    border-top: 1px solid var(--border-divider);
    padding-top: 12px;
}

.vision-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}

.vision-detail-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vision-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-divider);
}

.vision-card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vision-card-icon {
    font-size: 1.35rem;
}

.competencies-list-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comp-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.comp-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.comp-name {
    font-size: 0.9rem;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comp-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.comp-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 120px;
}

.comp-pct {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 38px;
    text-align: right;
}

.comp-mini-bar {
    flex: 1;
    height: 7px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
}

.comp-mini-bar > div {
    height: 100%;
    border-radius: 4px;
}

.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }

.upcoming-tasks-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upcoming-tasks-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-divider);
}

.upcoming-tasks-list li a {
    color: var(--text-strong);
    text-decoration: none;
}

.upcoming-tasks-list li a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.recent-notes-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-notes-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.82rem;
    padding: 4px 0;
}

.note-type-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.note-positiva { background: var(--success); }
.note-negativa { background: var(--danger); }
.note-neutra { background: var(--info); }

.note-snippet {
    margin: 2px 0 0 0;
    color: var(--text-main);
    line-height: 1.25;
}

.empty-inline-note {
    font-size: 0.88rem;
    margin: 10px 0;
}

.sub-heading {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 4px;
}

.vision-action-nav {
    margin-top: 10px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SISTEMA INTEGRAL DE RECOMENDACIONES PEDAGÓGICAS Y LOGROS FORMATIVOS
   ───────────────────────────────────────────────────────────────────────────── */

/* Variantes de severidad para strategic-alert-banner */
.strategic-alert-banner--critica {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}
.strategic-alert-banner--critica .strategic-alert-body strong {
    color: #dc2626;
}

.strategic-alert-banner--preventiva {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.28);
}
.strategic-alert-banner--preventiva .strategic-alert-body strong {
    color: #b45309;
}

.strategic-alert-banner--sugerencia {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.28);
}
.strategic-alert-banner--sugerencia .strategic-alert-body strong {
    color: #2563eb;
}

.strategic-alert-banner--positiva {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.28);
}
.strategic-alert-banner--positiva .strategic-alert-body strong {
    color: #059669;
}

.strategic-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.rec-chip-metric {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    line-height: 1.2;
}
.rec-chip--critica { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.rec-chip--preventiva { background: rgba(245, 158, 11, 0.15); color: #92400e; }
.rec-chip--sugerencia { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.rec-chip--positiva { background: rgba(16, 185, 129, 0.15); color: #047857; }

.strategic-alert-actions {
    margin-top: 6px;
}
.rec-action-link {
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.18s ease, transform 0.15s ease;
}
.rec-action-link:hover {
    text-decoration: underline;
    transform: translateX(2px);
}
.rec-action-link--critica { color: #dc2626; }
.rec-action-link--preventiva { color: #b45309; }
.rec-action-link--sugerencia { color: #2563eb; }
.rec-action-link--positiva { color: #059669; }

/* Enlace a más recomendaciones en dashboard */
.more-recommendations-cue {
    padding-left: 2px;
    margin-top: -2px;
}
.more-recommendations-link {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.more-recommendations-link:hover {
    color: var(--accent-primary, #6366f1);
    text-decoration: underline;
}

/* Centro de recomendaciones en Visión General */
.vision-recommendations-center {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.vision-rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.vision-rec-intro {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}
.vision-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* Tarjeta individual de recomendación (recommendation-card) */
.recommendation-card {
    display: flex;
    gap: 12px;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.recommendation-card--critica {
    border-left: 4px solid #ef4444;
    background: color-mix(in srgb, var(--bg-surface) 95%, rgba(239, 68, 68, 0.08));
}
.recommendation-card--preventiva {
    border-left: 4px solid #f59e0b;
    background: color-mix(in srgb, var(--bg-surface) 95%, rgba(245, 158, 11, 0.08));
}
.recommendation-card--sugerencia {
    border-left: 4px solid #3b82f6;
    background: color-mix(in srgb, var(--bg-surface) 95%, rgba(59, 130, 246, 0.08));
}
.recommendation-card--positiva {
    border-left: 4px solid #10b981;
    background: color-mix(in srgb, var(--bg-surface) 95%, rgba(16, 185, 129, 0.08));
}

.recommendation-card-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.recommendation-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}
.recommendation-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.recommendation-badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.recommendation-badge--critica { color: #dc2626; }
.recommendation-badge--preventiva { color: #b45309; }
.recommendation-badge--sugerencia { color: #2563eb; }
.recommendation-badge--positiva { color: #059669; }

.recommendation-metric {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.recommendation-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-strong);
    margin: 2px 0;
    line-height: 1.3;
}
.recommendation-card-text {
    font-size: 0.83rem;
    color: var(--text-main);
    line-height: 1.35;
    margin: 0 0 6px 0;
}
.recommendation-card-footer {
    margin-top: auto;
    padding-top: 4px;
}
.btn-recommendation {
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: var(--radius-xs, 6px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-recommendation--critica {
    background: #ef4444;
    color: #ffffff;
}
.btn-recommendation--critica:hover { background: #dc2626; }
.btn-recommendation--preventiva {
    background: #f59e0b;
    color: #1f2937;
}
.btn-recommendation--preventiva:hover { background: #d97706; color: #fff; }
.btn-recommendation--sugerencia {
    background: #3b82f6;
    color: #ffffff;
}
.btn-recommendation--sugerencia:hover { background: #2563eb; }
.btn-recommendation--positiva {
    background: #10b981;
    color: #ffffff;
}
.btn-recommendation--positiva:hover { background: #059669; }

/* ─────────────────────────────────────────────────────────────────────────────
   SECCIÓN DE LOGROS FORMATIVOS DEL APRENDIZ
   ───────────────────────────────────────────────────────────────────────────── */

.learner-recommendations-cluster {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.25rem;
}
.learner-rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.learner-rec-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.learner-achievements-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.learner-achievements-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.learner-achievements-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.badge-rank-level {
    font-weight: 700;
    padding: 5px 12px;
    font-size: 0.84rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    color: var(--accent-primary, #6366f1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.achievements-intro {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}
.achievements-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.15rem;
}

.achievement-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.achievement-card.is-unlocked {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.04) 100%);
}
.achievement-card.is-locked {
    opacity: 0.85;
}

.achievement-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.achievement-badge-icon {
    font-size: 2rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}
.achievement-card.is-unlocked .achievement-badge-icon {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.badge-achievement-unlocked {
    background: rgba(16, 185, 129, 0.18);
    color: #059669;
    font-weight: 700;
    font-size: 11px;
    padding: 3px 8px;
}
.badge-achievement-locked {
    background: rgba(156, 163, 175, 0.18);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    padding: 3px 8px;
}

.achievement-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0 0 2px 0;
}
.achievement-tier {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.tier-diamante { color: #0284c7; }
.tier-oro { color: #d97706; }
.tier-plata { color: #6b7280; }
.tier-bronce { color: #b45309; }

.achievement-desc {
    font-size: 0.83rem;
    color: var(--text-main);
    line-height: 1.35;
    margin: 0 0 12px 0;
    flex-grow: 1;
}

.achievement-card-progress {
    margin-top: auto;
    padding-top: 6px;
}
.achievement-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    margin-bottom: 4px;
}
.achievement-progress-label {
    color: var(--text-muted);
}
.achievement-progress-val {
    color: var(--text-strong);
}

.achievement-progress-bar {
    height: 6px;
    background: var(--border-divider, #e5e7eb);
    border-radius: 999px;
    overflow: hidden;
}
.achievement-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.fill-diamante { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.fill-oro { background: linear-gradient(90deg, #fbbf24, #d97706); }
.fill-plata { background: linear-gradient(90deg, #9ca3af, #4b5563); }
.fill-bronce { background: linear-gradient(90deg, #f97316, #b45309); }

.achievement-feedback {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
    font-size: 11.5px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.3;
}
.achievement-feedback p {
    margin: 0;
}
.feedback-quote-icon {
    font-style: normal;
    flex-shrink: 0;
}

/* ==========================================================================
   Ficha Countdown Strip & Date Alerts (Inicio Lectiva & Cierre Ficha)
   ========================================================================== */

.ficha-countdown-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.ficha-countdown-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ficha-countdown-alert.alert-level-urgente,
.ficha-countdown-alert.alert-level-critico {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08));
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--text-strong);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.ficha-countdown-alert.alert-level-aviso {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--text-strong);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.08);
}

.countdown-alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.countdown-alert-text {
    flex: 1;
}

.countdown-alert-text strong {
    font-weight: 700;
}

.countdown-alert-pill {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.alert-level-urgente .countdown-alert-pill,
.alert-level-critico .countdown-alert-pill {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
}

.alert-level-aviso .countdown-alert-pill {
    background: #f59e0b;
    color: #ffffff;
    border-color: #d97706;
}

/* --- Countdown Strip --- */
.ficha-countdown-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ficha-countdown-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-surface));
    border: 1px solid var(--border-divider);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ficha-countdown-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--text-muted);
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.ficha-countdown-card.card-countdown-lectiva::before {
    background: linear-gradient(180deg, #0ea5e9, #3b82f6);
}

.ficha-countdown-card.card-countdown-cierre::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.ficha-countdown-card.is-imminent::before {
    background: linear-gradient(180deg, #ef4444, #f97316);
}

.ficha-countdown-card.is-upcoming::before {
    background: linear-gradient(180deg, #f59e0b, #eab308);
}

.ficha-countdown-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    border-color: var(--border-color);
}

.countdown-card-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-divider);
    color: var(--text-strong);
    flex-shrink: 0;
}

.card-countdown-lectiva .countdown-card-icon-box {
    color: #0284c7;
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
}

.card-countdown-cierre .countdown-card-icon-box {
    color: #059669;
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.ficha-countdown-card.is-imminent .countdown-card-icon-box {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.countdown-card-content {
    flex: 1;
    min-width: 0;
}

.countdown-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.countdown-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.countdown-card-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    white-space: nowrap;
}

.countdown-card-status.is-urgent,
.countdown-card-status.is-critical {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.countdown-card-status.is-warning,
.countdown-card-status.is-notice {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.countdown-card-status.is-success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.countdown-card-status.is-info {
    background: rgba(14, 165, 233, 0.15);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.countdown-card-status.is-normal {
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border-divider);
}

.countdown-card-figure {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.countdown-card-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}

.countdown-card-subval {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.countdown-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-divider);
    padding-top: 6px;
    margin-top: 2px;
}

.countdown-footer-date strong {
    color: var(--text-main);
}

/* Badges de cuenta regresiva */
.badge-countdown-urgent {
    background: #ef4444 !important;
    color: #ffffff !important;
    animation: pulse-countdown 2.5s infinite;
}

.badge-countdown-warning {
    background: #f59e0b !important;
    color: #ffffff !important;
}

.badge-countdown-notice,
.badge-countdown-info {
    background: #0ea5e9 !important;
    color: #ffffff !important;
}

.badge-countdown-normal {
    background: var(--bg-surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-divider);
}

@keyframes pulse-countdown {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.88; transform: scale(1.02); }
}

/* Centro de operación del aprendiz administrador */
.cleaning-admin-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-divider);
    border-left: 4px solid var(--accent-primary);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.cleaning-admin-summary-copy h2 {
    margin: 0.2rem 0 0.35rem;
    color: var(--text-strong);
    font-size: clamp(1.1rem, 1rem + 0.45vw, 1.35rem);
}

.cleaning-admin-summary-copy p {
    margin: 0;
    line-height: 1.5;
}

.cleaning-admin-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.cleaning-admin-metrics > div {
    padding: 0.75rem 0.5rem;
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    text-align: center;
}

.cleaning-admin-metrics strong,
.cleaning-admin-metrics span { display: block; }
.cleaning-admin-metrics strong { color: var(--accent-hover); font-size: 1.35rem; line-height: 1.1; }
.cleaning-admin-metrics span { margin-top: 0.25rem; color: var(--text-muted); font-size: 0.7rem; }

.cleaning-admin-actions {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-divider);
}

.cleaning-admin-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-divider);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    background: var(--bg-surface);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cleaning-admin-actions a:hover,
.cleaning-admin-actions a:focus-visible {
    border-color: var(--accent-primary);
    color: var(--accent-hover);
    background: var(--sena-green-light);
    outline: none;
}

.cleaning-step-number {
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    margin-right: 0.35rem;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--accent-primary);
    font-size: 0.72rem;
    vertical-align: 0.08em;
}

#form-generar-turnos,
#form-asignar-turno,
#calendario-turnos { scroll-margin-top: 1rem; }

@media (max-width: 760px) {
    .cleaning-admin-summary { grid-template-columns: 1fr; }
    .cleaning-admin-actions { grid-column: auto; }
}
