/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue: #1a73e8;
    --blue-light: #e8f0fe;
    --green: #1a9b5c;
    --green-light: #e6f4ea;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --red: #ef4444;
    --red-light: #fee2e2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-table-head: #f8fafc;
    --bg-table-hover: #e8f0fe;
    --border: #e2e8f0;
    --topbar-bg: linear-gradient(135deg, #1a73e8, #1557b0);
    --topbar-shadow: rgba(26,115,232,.3);
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
    --blue-light: #1e3a5f;
    --green-light: #14332a;
    --amber-light: #3b2f1a;
    --red-light: #3b1c1c;
    --gray-50: #1e293b;
    --gray-100: #0f172a;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f8fafc;
    --bg-body: #0b1120;
    --bg-card: #1e293b;
    --bg-sidebar: #151d2e;
    --bg-table-head: #1a2332;
    --bg-table-hover: #253347;
    --border: #334155;
    --topbar-bg: linear-gradient(135deg, #0f2b5e, #0a1e3d);
    --topbar-shadow: rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    transition: background .3s ease, color .3s ease;
    overflow-x: hidden;
}

/* === Animations === */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 80px; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }

.spin { animation: spin .8s linear infinite; }
.fade-in { animation: fadeIn .4s var(--transition) both; }

/* === Topbar === */
.topbar {
    background: var(--topbar-bg);
    color: white;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px var(--topbar-shadow);
    transition: background .3s ease;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.sidebar-toggle:hover { background: rgba(255,255,255,.15); }
.sidebar-toggle .material-icons-outlined { font-size: 24px; }

.topbar-brand .material-icons-outlined { font-size: 28px; }
.topbar-title { font-weight: 600; font-size: 16px; display: block; }
.topbar-subtitle { font-size: 12px; opacity: .75; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-sync {
    background: rgba(255,255,255,.12);
    color: white;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
}

.btn-sync:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
.btn-sync:active { transform: translateY(0); }
.btn-sync:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sync .material-icons-outlined { font-size: 18px; }

.sync-status {
    font-size: 13px;
    display: none;
    align-items: center;
    gap: 4px;
    animation: fadeIn .3s ease;
}

.sync-status.visible { display: flex; }
.sync-status .material-icons-outlined { font-size: 18px; }
.sync-status.error { color: #fca5a5; }

/* === Layout === */
.layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
    transition: all var(--transition);
    overflow: hidden;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.sidebar-collapsed .sidebar {
    width: 0;
    padding: 0;
    border-right: none;
}

.sidebar-section { margin-bottom: 24px; }

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-400);
    padding: 0 20px;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover { background: var(--gray-50); color: var(--gray-800); }
.sidebar-link.active { background: var(--blue-light); color: var(--blue); font-weight: 600; border-left-color: var(--blue); }
.sidebar-link .material-icons-outlined { font-size: 20px; transition: transform var(--transition); }
.sidebar-link:hover .material-icons-outlined { transform: scale(1.1); }

.content {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
    animation: fadeIn .3s ease;
}

/* === Info Bar === */
.info-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 24px;
    transition: box-shadow var(--transition);
}

.info-bar:hover { box-shadow: var(--shadow); }
.info-bar .material-icons-outlined { font-size: 18px; color: var(--gray-400); }

/* === NA Toggle (switch style) === */
.na-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.na-toggle input[type="checkbox"] { display: none; }

.na-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    transition: color var(--transition);
}

.na-toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--gray-300);
    border-radius: 11px;
    transition: background var(--transition);
}

.na-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform var(--transition);
}

.na-toggle input:checked ~ .na-toggle-switch { background: var(--blue); }
.na-toggle input:checked ~ .na-toggle-switch::after { transform: translateX(18px); }
.na-toggle input:checked ~ .na-toggle-label { color: var(--blue); font-weight: 600; }

/* === KPI NA Extra === */
.kpi-na-extra {
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--amber-light);
    border-radius: 8px;
    font-size: 12px;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: slideDown .3s ease both;
    overflow: hidden;
}

.kpi-na-extra .material-icons-outlined { font-size: 14px; }
.kpi-na-extra strong { font-weight: 700; }

/* === KPI Cards === */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--blue);
    transition: all var(--transition);
    animation: fadeIn .4s ease both;
}

.kpi-card:nth-child(1) { animation-delay: .0s; }
.kpi-card:nth-child(2) { animation-delay: .05s; }
.kpi-card:nth-child(3) { animation-delay: .1s; }
.kpi-card:nth-child(4) { animation-delay: .15s; }
.kpi-card:nth-child(5) { animation-delay: .2s; }
.kpi-card:nth-child(6) { animation-delay: .25s; }

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

.kpi-card.accent-green { border-left-color: var(--green); }
.kpi-card.accent-amber { border-left-color: var(--amber); }
.kpi-card.accent-red { border-left-color: var(--red); }

.kpi-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.kpi-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
    transition: color var(--transition);
}

.kpi-sub {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
    margin-top: 4px;
}

.kpi-card.small .kpi-value { font-size: 24px; }
.kpi-card.small { padding: 16px; }

/* === Chart Cards === */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all var(--transition);
    animation: fadeIn .5s ease both;
}

.chart-card:hover { box-shadow: var(--shadow-md); }

.chart-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.chart-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    transition: all var(--transition);
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* === Section Title === */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* === Carousel Header === */
.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.carousel-header .section-title { margin-bottom: 0; }

.carousel-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition);
}

.carousel-btn:hover { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.carousel-btn .material-icons-outlined { font-size: 20px; }

.carousel-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all var(--transition);
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--blue);
}

/* === Course Cards Carousel === */
.cards-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.cards-carousel::-webkit-scrollbar { display: none; }

/* === Course Cards === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.course-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    display: block;
    border: 1px solid transparent;
    animation: fadeIn .5s ease both;
}

.cards-carousel .course-card {
    flex: 0 0 100%;
    scroll-snap-align: center;
}

.course-card:nth-child(1) { animation-delay: .1s; }
.course-card:nth-child(2) { animation-delay: .2s; }
.course-card:nth-child(3) { animation-delay: .3s; }

.course-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
    transform: translateY(-3px);
}

.course-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.course-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    transition: all var(--transition);
}

.course-card:hover .course-icon { background: var(--blue); color: white; }

.course-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--gray-800);
}

.course-subtitle {
    font-size: 12px;
    color: var(--gray-400);
}

/* === Carousel Card Layout === */
.cards-carousel .course-card {
    padding: 40px 48px;
    border: 1px solid var(--border);
}

.card-body-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    max-width: 900px;
    margin: 0 auto;
}

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

.card-left .course-card-header { margin-bottom: 28px; }
.card-left .course-card-header h4 { font-size: 22px; }
.card-left .course-stats { margin-bottom: 24px; }
.card-left .stat-row { padding: 8px 0; font-size: 15px; }
.card-left .stat-value { font-size: 18px; }
.card-left .stat-dot { width: 12px; height: 12px; }
.card-left .stat-label { font-size: 15px; }

.card-center-chart {
    flex: 0 0 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-center-chart canvas { width: 100% !important; height: auto !important; }

.cards-carousel .course-subtitle { font-size: 14px; }
.cards-carousel .course-icon { width: 52px; height: 52px; border-radius: 12px; }
.cards-carousel .course-icon .material-icons-outlined { font-size: 28px; }
.cards-carousel .course-footer { padding-top: 24px; }
.cards-carousel .rendicion-badge { font-size: 14px; padding: 6px 16px; }
.cards-carousel .badge-pass, .cards-carousel .badge-fail { font-size: 12px; padding: 4px 12px; }

/* === Legacy chart row (detail pages) === */
.course-chart-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
}

.course-chart-row canvas { max-width: 140px; max-height: 140px; }

.course-stats { flex: 1; }

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    transition: all var(--transition);
}

.stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: transform var(--transition);
}

.stat-row:hover .stat-dot { transform: scale(1.3); }

.stat-dot.green { background: var(--green); }
.stat-dot.amber { background: var(--amber); }
.stat-dot.red { background: var(--red); }

.stat-label { flex: 1; color: var(--gray-800); }
.stat-value { font-weight: 700; color: var(--gray-900); }

.course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.course-footer .material-icons-outlined {
    font-size: 20px;
    color: var(--gray-300);
    transition: all var(--transition);
}

.course-card:hover .course-footer .material-icons-outlined { color: var(--blue); transform: translateX(4px); }

.rendicion-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all var(--transition);
}

.rendicion-badge.good { background: var(--green-light); color: var(--green); }
.rendicion-badge.low { background: var(--red-light); color: var(--red); }

.approval-info {
    display: flex;
    gap: 6px;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
    animation: fadeIn .5s ease;
}

.empty-state .material-icons-outlined {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pulse 2s ease infinite;
}

.empty-state h3 { color: var(--gray-600); margin-bottom: 8px; }

/* === Detail Page === */
.breadcrumb-bar { margin-bottom: 20px; }

.breadcrumb-bar a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: gap var(--transition);
}

.breadcrumb-bar a:hover { text-decoration: underline; gap: 8px; }

.detail-header { margin-bottom: 24px; }

.detail-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-sub {
    font-size: 13px;
    color: var(--gray-400);
}

/* === Tabs === */
.tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    border-radius: 8px 8px 0 0;
}

.tab:hover { color: var(--gray-800); background: var(--gray-50); }

.tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
    background: var(--blue-light);
}

.tab .material-icons-outlined { font-size: 18px; }

.tab-count {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    transition: all var(--transition);
}

.tab.active .tab-count { background: white; color: var(--blue); }

/* === Search === */
.search-bar { margin-bottom: 16px; }

.search-bar form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    font-size: 20px;
    pointer-events: none;
    transition: color var(--transition);
}

.search-bar input {
    width: 100%;
    padding: 10px 40px 10px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--gray-800);
    outline: none;
    transition: all var(--transition);
}

.search-bar input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
.search-bar input:focus ~ .search-icon { color: var(--blue); }

.clear-search {
    position: absolute;
    right: 12px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition);
}

.clear-search:hover { color: var(--red); transform: scale(1.1); }

.results-info {
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 12px;
}

/* === Data Table === */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table thead {
    background: var(--bg-table-head);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-400);
    white-space: nowrap;
    text-align: left;
}

.data-table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    transition: background var(--transition);
}

.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-table-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.mono { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; color: var(--gray-400); }
.name-cell { font-weight: 500; color: var(--gray-800); }
.email-cell { color: var(--blue); }
.center { text-align: center; }

.score {
    font-weight: 700;
    font-size: 15px;
    color: var(--gray-900);
    transition: all var(--transition);
}

.badge-na {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--amber-light);
    color: #92400e;
}

.badge-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-600);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--blue);
    text-decoration: none;
    transition: all var(--transition);
}

.link-btn:hover { background: var(--blue-light); transform: scale(1.1); }
.link-btn .material-icons-outlined { font-size: 18px; }

/* === Toolbar === */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
}

.toolbar .search-bar { flex: 1; margin-bottom: 0; }

.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--green);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition);
}

.btn-export:hover { background: var(--green-light); border-color: var(--green); transform: translateY(-1px); }
.btn-export .material-icons-outlined { font-size: 18px; }

/* === Grading Badges === */
.score-pass { color: var(--green) !important; }
.score-fail { color: var(--red) !important; }

.badge-pass {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: var(--green-light);
    color: var(--green);
}

.badge-fail {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: var(--red-light);
    color: var(--red);
}

.badge-norindio {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-400);
}

/* === Cross Search === */
.cross-code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 2px;
}

.cross-empty { color: var(--gray-300); }

/* === URL Link (NA table) === */
.url-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    background: var(--blue-light);
    transition: all var(--transition);
    white-space: nowrap;
}

.url-link:hover { background: var(--blue); color: white; transform: translateY(-1px); }
.url-link .material-icons-outlined { font-size: 14px; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* === Responsive === */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .cards-grid { grid-template-columns: 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; }
}

@media (max-width: 768px) {
    .topbar { height: 50px; }
    .sidebar {
        position: fixed;
        top: 50px;
        left: 0;
        bottom: 0;
        z-index: 99;
        width: 260px;
        transform: translateX(-100%);
        box-shadow: none;
        border-right: 1px solid var(--border);
    }
    .sidebar-overlay { top: 50px; }
    .sidebar-collapsed .sidebar { transform: translateX(-100%); width: 260px; padding: 20px 0; border-right: 1px solid var(--border); }
    .sidebar-open .sidebar {
        transform: translateX(0) !important;
        box-shadow: 4px 0 20px rgba(0,0,0,.2);
        width: 260px;
        padding: 20px 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,.4);
        z-index: 98;
    }
    .sidebar-open .sidebar-overlay { display: block; }
    .content { padding: 16px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .topbar-subtitle { display: none; }
    .toolbar { flex-direction: column; }
    .btn-export { padding: 10px 20px; justify-content: center; }
    .detail-header h2 { font-size: 18px; }
    .tabs-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
    .tab { padding: 10px 14px; font-size: 12px; white-space: nowrap; }
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; border-radius: 0; }
    .data-table { min-width: 600px; }
    .course-chart-row { flex-direction: column; align-items: flex-start; }
    .na-toggle-label { display: none; }
    .info-bar { flex-wrap: wrap; gap: 6px; padding: 8px 12px; font-size: 12px; }
    .chart-card { padding: 16px; }
    .chart-container { max-width: 240px; }
    .charts-row { gap: 12px; }
    .cards-carousel .course-card { flex: 0 0 100%; padding: 20px; }
    .card-body-carousel { flex-direction: column; gap: 16px; max-width: 100%; }
    .card-center-chart { flex: 0 0 auto; width: 180px; }
    .card-left .stat-row { font-size: 13px; }
    .card-left .stat-value { font-size: 14px; }
    .course-chart-row canvas { max-width: 110px; max-height: 110px; }
    .carousel-header { margin-bottom: 12px; }
    .course-card { padding: 16px; }
    .course-card-header { gap: 10px; margin-bottom: 14px; }
    .course-card h4 { font-size: 14px; }
    .course-icon { width: 38px; height: 38px; }
    .breadcrumb-bar a { font-size: 12px; }
    .section-title { font-size: 14px; }
    .topbar-actions { gap: 8px; }
}

@media (max-width: 480px) {
    .topbar { padding: 0 10px; }
    .topbar-title { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-brand .material-icons-outlined { font-size: 22px; }
    .topbar-brand { gap: 8px; min-width: 0; }
    .btn-sync { padding: 5px 8px; font-size: 11px; }
    .btn-sync span.material-icons-outlined { font-size: 16px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .kpi-card { padding: 12px; }
    .kpi-value { font-size: 22px; }
    .kpi-label { font-size: 10px; }
    .kpi-sub { font-size: 11px; }
    .kpi-card.small .kpi-value { font-size: 20px; }
    .content { padding: 10px; }
    .search-bar input { font-size: 13px; padding: 8px 36px 8px 40px; }
    .search-icon { font-size: 18px; left: 12px; }
    .detail-header h2 { font-size: 16px; }
    .detail-sub { font-size: 12px; }
    .charts-row { gap: 10px; margin-bottom: 20px; }
    .chart-card { padding: 12px; }
    .chart-title { font-size: 12px; margin-bottom: 10px; }
    .chart-container { max-width: 200px; }
    .chart-legend { font-size: 11px; gap: 8px; }
    .cards-grid { gap: 10px; }
    .course-card { padding: 14px; }
    .course-footer { flex-wrap: wrap; gap: 6px; }
    .rendicion-badge { font-size: 11px; padding: 3px 8px; }
    .approval-info { gap: 4px; }
    .badge-pass, .badge-fail, .badge-na, .badge-norindio, .badge-status { font-size: 10px; padding: 2px 8px; }
    .tabs-bar { margin-bottom: 12px; }
    .tab { padding: 8px 10px; font-size: 11px; }
    .tab .material-icons-outlined { font-size: 16px; }
    .tab-count { font-size: 10px; padding: 1px 6px; }
    .toolbar { gap: 8px; margin-bottom: 10px; }
    .btn-export { padding: 8px 14px; font-size: 12px; }
    .results-info { font-size: 11px; margin-bottom: 8px; }
    .table-wrapper { margin: 0 -10px; }
    .data-table { min-width: 480px; }
    .data-table th { font-size: 9px; padding: 6px 6px; }
    .data-table td { font-size: 11px; padding: 6px; }
    .data-table .mono { font-size: 10px; }
    .data-table .email-cell { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .data-table .name-cell { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .score { font-size: 13px; }
    .empty-state { padding: 40px 16px; }
    .empty-state .material-icons-outlined { font-size: 48px; }
    .empty-state h3 { font-size: 16px; }
    .empty-state p { font-size: 13px; }
    .na-toggle-switch { width: 36px; height: 20px; }
    .na-toggle-switch::after { width: 14px; height: 14px; }
    .na-toggle input:checked ~ .na-toggle-switch::after { transform: translateX(16px); }
    .info-bar { font-size: 11px; padding: 6px 10px; margin-bottom: 16px; }
    .kpi-na-extra { font-size: 11px; padding: 4px 8px; }
    .url-link { padding: 3px 8px; font-size: 11px; }
    .cross-code { font-size: 9px; }
    .sidebar-toggle .material-icons-outlined { font-size: 22px; }
}

@media (max-width: 360px) {
    .topbar-title { font-size: 12px; }
    .btn-sync span:not(.material-icons-outlined) { display: none; }
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-value { font-size: 20px; }
    .content { padding: 8px; }
    .table-wrapper { margin: 0 -8px; }
}

/* === Login === */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: fadeIn .4s var(--transition) both;
}

.login-brand {
    background: var(--topbar-bg);
    color: white;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand .material-icons-outlined { font-size: 32px; }

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--red-light);
    color: var(--red);
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 500;
}

.login-error .material-icons-outlined { font-size: 18px; }

.login-form {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
}

.login-form input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--gray-800);
    outline: none;
    transition: all var(--transition);
}

.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }

.login-submit {
    background: var(--blue);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 11px 16px;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.login-submit:hover { background: #1557b0; transform: translateY(-1px); }
.login-submit:active { transform: translateY(0); }

.login-remember { margin-left: 0; margin-top: -4px; }

.logout-link { color: inherit; text-decoration: none; }
