:root {
    --primary: #6338e5; /* Morado Vibrante */
    --primary-dark: #4424a7; /* Morado Oscuro Sidebar */
    --primary-light: #f0ebff;
    
    --secondary: #ffeb3b; 
    
    --bg-page: #f8f9fc;
    --bg-card: #ffffff;
    
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-lighter: #9ca3af;
    
    --success: #10b981;
    --success-bg: #d1fae5;
    
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    
    --danger: #ef4444;
    --danger-bg: #fee2e2;

    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }

/* =============== LOGIN V2 =============== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #4c1d95, #7e22ce);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.login-logo {
    background: white;
    color: var(--primary);
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}
.login-header p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.login-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.login-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}
.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.input-wrapper {
    position: relative;
}
.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
    width: 18px;
    height: 18px;
}
.input-wrapper .input-right-icon {
    left: auto;
    right: 1rem;
    cursor: pointer;
}
.input-style {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s;
}
.input-style:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.login-footer {
    margin-top: 2rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
}

/* =============== APP LAYOUT (SIDEBAR + MAIN) =============== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sidebar-logo {
    background: white;
    color: var(--primary-dark);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}
.sidebar-title h2 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}
.sidebar-title span {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}
.nav-item {
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item i { width: 20px; height: 20px; }
.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--primary-light);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.user-widget {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem;
}
.user-widget-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.user-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
}
.user-details span {
    font-size: 0.75rem;
    opacity: 0.7;
}
.user-actions {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
}
.user-actions span {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}
.user-actions span:hover { color: white; }

/* Main Content Area */
.main-area {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}
.breadcrumb i { width: 20px; height: 20px; }
.breadcrumb span { color: var(--text-main); font-weight: 600; }

.top-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.top-user .avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.8rem;
}
.top-user-info h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.top-user-info span { font-size: 0.7rem; color: var(--text-muted); }

/* Headings */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}
.section-title i { color: var(--primary); }

/* =============== CARDS =============== */
.card-base {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.summary-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.summary-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.sc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sc-icon i { width: 24px; height: 24px; }
.sc-icon.purple { background: var(--primary-light); color: var(--primary); }
.sc-icon.green { background: var(--success-bg); color: var(--success); }
.sc-icon.orange { background: var(--warning-bg); color: var(--warning); }
.sc-icon.gray { background: #f3f4f6; color: var(--text-muted); }

.sc-info h3 { font-size: 1.5rem; font-weight: 700; line-height: 1; margin-bottom: 0.25rem; }
.sc-info p { font-size: 0.85rem; color: var(--text-muted); }

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Tablas V2 (Estilo Fila/Lista) */
.list-ranking {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.list-header {
    display: grid;
    grid-template-columns: 0.5fr 3fr 1fr 1fr 1fr 1fr 1.5fr 1fr;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}
.list-row {
    display: grid;
    grid-template-columns: 0.5fr 3fr 1fr 1fr 1fr 1fr 1.5fr 1fr;
    padding: 1rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: background 0.2s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #f9fafb; }

.rank-badge { font-size: 1.2rem; }
.user-cell { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; }
.user-cell .av { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: white; display:flex; align-items:center; justify-content:center; font-size: 0.8rem; }
.pts-cell { font-weight: 700; color: var(--primary); }
.val-green { color: var(--success); font-weight: 600; }
.val-orange { color: var(--warning); font-weight: 600; }
.days-rest { font-weight: 600; }
.days-rest.danger { color: var(--danger); }

/* Tarjetas de Detalle Practicante */
.practicante-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.pr-card {
    padding: 1.5rem;
    position: relative;
}
.pr-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.pr-header h4 { font-size: 1rem; font-weight: 700; }
.pr-header span { font-size: 0.8rem; color: var(--text-muted); display: block; }
.pr-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.pr-stat-box {
    background: var(--bg-page);
    padding: 0.75rem;
    border-radius: 10px;
    text-align: center;
}
.pr-stat-box strong { display: block; font-size: 1.2rem; color: var(--text-main); }
.pr-stat-box span { font-size: 0.75rem; color: var(--text-muted); }
.pr-alert {
    margin-top: 1rem;
    background: var(--danger-bg);
    color: var(--danger);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* Tarjetas Filas (Equipo) */
.row-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.row-card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.row-card-left h4 { font-size: 1rem; font-weight: 600; }
.role-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.2rem;
    display: inline-block;
}
.role-pill.rrhh { background: var(--success-bg); color: var(--success); }
.row-card-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary);
}
.row-card-right i { cursor: pointer; width: 18px; height: 18px; }
.row-card-right i.red { color: var(--danger); }
.btn-evaluar {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Tarjetas Campaña (Mesa) */
.campaign-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.camp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}
.camp-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.camp-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.camp-icon {
    width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.camp-title h3 { font-size: 0.9rem; font-weight: 700; color: var(--primary-dark); text-transform: uppercase;}
.camp-title p { font-size: 1.1rem; font-weight: 700; color: var(--text-main); line-height: 1.2;}
.plat-pill {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 700;
    background: #e0f2fe; color: #0284c7; margin-bottom: 1rem;
}
.camp-footer { font-size: 0.8rem; color: var(--text-muted); }
.camp-footer div { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.camp-footer i { width: 14px; height: 14px; }
.btn-new-camp {
    background: var(--primary); color: white; border: none; padding: 0.6rem 1.25rem; border-radius: 8px; font-weight: 600; cursor: pointer;
}
.btn-new-camp i { width: 16px; height: 16px; margin-right: 0.5rem; vertical-align: middle; }

/* Modal Reset */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: var(--bg-card); width: 90%; max-width: 450px;
    border-radius: 16px; padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header h2 { font-size: 1.25rem; margin-bottom: 1.5rem; font-weight: 700; }
.modal-footer { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 2rem; }
.btn-secondary { background: #f3f4f6; color: var(--text-main); border: none; padding: 0.75rem 1.5rem; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* Table base */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; background: var(--bg-page); }
td { font-size: 0.9rem; }
.table-container { background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }

/* Utils Colors */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

/* --- Cursos Player --- */
.course-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
}
.video-wrapper iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.course-modules {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    height: 600px;
    overflow-y: auto;
}
.module-header {
    font-weight: 700;
    color: var(--primary-dark);
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.clase-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.clase-item:hover { background: var(--bg-page); }
.clase-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.cb-mock {
    width: 20px; height: 20px; border-radius: 4px; border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: transparent; transition: all 0.2s;
}
.cb-mock.done { background: var(--success); border-color: var(--success); color: white; }

.comments-section {
    margin-top: 2rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.comment-box {
    display: flex; gap: 1rem; margin-bottom: 1.5rem;
}
.comment-box .avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0;
}
.comment-content {
    background: var(--bg-page); padding: 1rem; border-radius: 12px; flex: 1;
}
.comment-content strong { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.comment-content span { font-size: 0.75rem; color: var(--text-muted); }

.filter-bar {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-xl { max-width: 900px !important; }

.pdf-container {
    background: white; padding: 2rem; border-radius: 12px; color: black;
}
.pdf-header { text-align: center; border-bottom: 2px solid var(--primary); padding-bottom: 1rem; margin-bottom: 2rem; }
.log-line {
    display: flex; gap: 1rem; padding: 0.5rem 0; font-size: 0.85rem; border-bottom: 1px dashed #eee;
}

.grid-4 {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem;
}
.course-card {
    background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); overflow: hidden;
    cursor: pointer; transition: transform 0.2s;
}
.course-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.cc-cover { height: 120px; background: #e2e8f0; background-size: cover; background-position: center; position: relative; }
.cc-profile { width: 48px; height: 48px; border-radius: 50%; background: white; position: absolute; bottom: -24px; left: 1rem; border: 3px solid var(--bg-card); background-size: cover; }
.cc-body { padding: 2rem 1rem 1rem; }
.cc-body h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.cc-progress { height: 6px; background: var(--bg-page); border-radius: 3px; overflow: hidden; margin-top: 1rem; }
.cc-bar { height: 100%; background: var(--primary); transition: width 0.3s; }
.cc-perc { font-size: 0.75rem; font-weight: 700; color: var(--primary); text-align: right; margin-top: 0.25rem; }
