/* Base + panel (consolidado) */
* {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
}

.muted {
    color: #7f8c8d;
}

.login-body {
    background: linear-gradient(to top left, #000000 0%, #333333 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-container--wide {
    max-width: 440px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-subtitle {
    color: #7f8c8d;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-error {
    background: #fee;
    color: #e74c3c;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: left;
    border-left: 4px solid #e74c3c;
}

.login-form {
    text-align: left;
}

.login-label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
    color: #2c3e50;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.login-hint {
    margin-top: 20px;
    font-size: 12px;
    color: #95a5a6;
    text-align: left;
}

.admin-header {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.4em;
}

.user-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info a {
    color: #1abc9c;
    text-decoration: none;
    margin-left: 4px;
}

.periodo-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.periodo-switch label {
    font-size: 13px;
    font-weight: 600;
    color: #ecf0f1;
}

.periodo-switch select {
    background: #1abc9c;
    color: #0d3b32;
    border: 0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.admin-menu {
    background: #34495e;
    padding: 12px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    background: #2c3e50;
    border-radius: 5px;
    font-size: 14px;
}

.admin-menu a:hover {
    background: #1abc9c;
}

.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 3px solid #1abc9c;
    padding-bottom: 10px;
    display: inline-block;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

.alert-box {
    padding: 16px;
    border-radius: 10px;
    margin-top: 24px;
}

.alert-danger {
    background: #ffebee;
    border-left: 4px solid #e74c3c;
}

.alert-ok {
    background: #d5f4e6;
    border-left: 4px solid #27ae60;
}

/* Formularios gestión */
.card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

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

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}

.btn-secondary:hover {
    background: #dfe6e9;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

table.data-table th,
table.data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

table.data-table th {
    background: #34495e;
    color: white;
}

.mensaje-exito {
    background: #d5f4e6;
    color: #27ae60;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #27ae60;
}

.mensaje-error {
    background: #fee;
    color: #e74c3c;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #e74c3c;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal.open {
    display: flex;
}

.modal-inner {
    background: white;
    padding: 28px;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.close-x {
    font-size: 26px;
    cursor: pointer;
    border: none;
    background: none;
    line-height: 1;
}

.categorias-opciones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.categoria-option input {
    display: none;
}

.categoria-option label {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #ccc;
    text-align: center;
    font-size: 13px;
}

.categoria-excelente label {
    border-color: #2ecc71;
}

.categoria-regular label {
    border-color: #f39c12;
}

.categoria-malo label {
    border-color: #e74c3c;
}

.categoria-vacio label {
    border-color: #95a5a6;
}

.categoria-option input:checked+label {
    color: #fff;
    font-weight: bold;
}

.categoria-excelente input:checked+label {
    background: #2ecc71;
    border-color: #2ecc71;
}

.categoria-regular input:checked+label {
    background: #f39c12;
    border-color: #f39c12;
}

.categoria-malo input:checked+label {
    background: #e74c3c;
    border-color: #e74c3c;
}

.categoria-vacio input:checked+label {
    background: #95a5a6;
    border-color: #95a5a6;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.badge-excelente {
    background: #2ecc71;
}

.badge-regular {
    background: #f39c12;
}

.badge-malo {
    background: #e74c3c;
}

.badge-avvacia,
.badge-avvacia {
    background: #95a5a6;
}

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

.stat-card-report {
    background: white;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card-report .valor {
    font-size: 28px;
    font-weight: bold;
}

/* Lista de cotejo (vista tipo Excel) */
.cotejo-filters {
    margin-bottom: 16px;
}

.cotejo-filter-grid {
    align-items: end;
}

.cotejo-filter-actions .cotejo-filter-spacer {
    display: block;
    min-height: 1.2em;
}

.cotejo-legend {
    margin-bottom: 12px;
    font-size: 14px;
}

.cotejo-legend-item {
    margin-left: 12px;
    font-weight: 600;
}

.cotejo-docente-name {
    font-size: 1.1rem;
    margin: 8px 0 16px;
}

.cotejo-curso-block {
    margin-bottom: 24px;
}

.cotejo-curso-title {
    margin-top: 0;
}

.cotejo-curso-meta {
    margin-top: -8px;
}

.cotejo-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px;
}

.cotejo-table {
    border-collapse: collapse;
    font-size: 12px;
    min-width: 1100px;
    background: #fff;
}

.cotejo-table th,
.cotejo-table td {
    border: 1px solid #dce0e6;
    padding: 6px 4px;
    text-align: center;
    vertical-align: middle;
}

.cotejo-th-criterio,
.cotejo-td-criterio {
    text-align: left !important;
    min-width: 200px;
    max-width: 280px;
    position: sticky;
    left: 0;
    background: #f8fafc;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.cotejo-crit-num {
    font-weight: 700;
    color: #3498db;
    margin-right: 4px;
}

.cotejo-crit-text {
    display: inline;
    line-height: 1.35;
}

.cotejo-th-week {
    min-width: 36px;
    background: #eef2f7;
}

.cotejo-th-pct,
.cotejo-td-pct {
    background: #e3f2fd;
    font-weight: 600;
    min-width: 44px;
}

.cotejo-th-total,
.cotejo-td-totalpct {
    background: #fff9e6;
    font-weight: 700;
}

.cotejo-td-cell {
    padding: 4px !important;
}

.cotejo-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cotejo-locked-badge {
    font-size: 10px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.cotejo-edit-link {
    font-size: 11px;
    white-space: nowrap;
}

.cotejo-row-total th,
.cotejo-row-total td {
    background: #f0f4f8;
    font-weight: 600;
}

.cotejo-td-total-week {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.cotejo-td-pct-empty {
    background: #f5f5f5 !important;
}

.cotejo-actions {
    margin: 24px 0 8px;
}

/* Reportes — planilla ancha tipo DATA */
.report-filters-card .report-filters-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e6ed;
}

.report-filters-title {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.report-filters-hint {
    margin: 0;
    font-size: 13px;
}

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

.report-filters-status {
    min-height: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #1e8449;
    padding-left: 2px;
}

.btn-report-apply,
.btn-report-clear {
    min-height: 40px;
    min-width: 150px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.1px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-report-apply {
    background: linear-gradient(180deg, #3ea3e3 0%, #2e86c1 100%);
    border: 1px solid #2874a6;
}

.btn-report-clear {
    background: linear-gradient(180deg, #f4b446 0%, #eea513 100%);
    border: 1px solid #d68910;
}

.btn-report-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    min-width: 170px;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.45);
    border: 2px solid #145a32;
    white-space: nowrap;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-report-pdf:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.55);
    filter: brightness(1.03);
    color: #fff !important;
}

.btn-report-apply:hover,
.btn-report-clear:hover,
.btn-report-pdf:hover {
    transform: translateY(-1px);
}

.btn-report-apply:hover,
.btn-report-clear:hover {
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.18);
    filter: brightness(1.03);
}

.btn-report-apply:focus-visible,
.btn-report-clear:focus-visible,
.btn-report-pdf:focus-visible {
    outline: 3px solid rgba(52, 152, 219, 0.28);
    outline-offset: 2px;
}

@media (max-width: 820px) {
    .report-filters-actions {
        width: 100%;
    }

    .btn-report-apply,
    .btn-report-clear,
    .btn-report-pdf {
        width: 100%;
        min-width: 0;
    }
}

.report-planilla-card h3 {
    margin-top: 0;
}

.report-planilla-legend {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.rep-legend {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin: 0 2px;
}

.rep-legend--b1 {
    background: #c8e6c9;
    color: #1b5e20;
}

.rep-legend--b2 {
    background: #bbdefb;
    color: #0d47a1;
}

.rep-legend--b3 {
    background: #ffe082;
    color: #e65100;
}

.report-matrix-scroll {
    overflow-x: auto;
    margin: 0 -8px;
    padding: 0 8px 8px;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dde4ec;
    border-radius: 8px;
    background: #fafbfc;
}

.report-matrix-table {
    font-size: 12px;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
}

.report-matrix-table th,
.report-matrix-table td {
    padding: 6px 5px;
    text-align: center;
    vertical-align: middle;
}

.report-matrix-table .report-sticky-col,
.report-matrix-table .report-sticky-col2,
.report-matrix-table .report-sticky-col3 {
    text-align: left;
    position: sticky;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.report-matrix-table .report-sticky-col {
    left: 0;
    min-width: 72px;
    z-index: 4;
}

.report-matrix-table .report-sticky-col2 {
    left: 72px;
    min-width: 160px;
    z-index: 3;
}

.report-matrix-table .report-sticky-col3 {
    left: 232px;
    min-width: 140px;
    z-index: 2;
}

.report-matrix-table thead .report-sticky-col,
.report-matrix-table thead .report-sticky-col2,
.report-matrix-table thead .report-sticky-col3 {
    background: #eceff1;
    z-index: 5;
}

.report-matrix-table thead .report-sticky-col2 {
    z-index: 5;
}

.report-matrix-table thead .report-sticky-col3 {
    z-index: 5;
}

.report-matrix-groups th {
    font-size: 11px;
    padding: 8px 4px;
    color: #fff;
    border: 1px solid #37474f;
}

.report-matrix-corner {
    background: #37474f;
}

.report-matrix-g1 {
    background: #2e7d32;
}

.report-matrix-g2 {
    background: #1565c0;
}

.report-matrix-g3 {
    background: #e65100;
}

.report-matrix-pcts {
    background: #455a64;
}

.report-week {
    min-width: 28px;
    font-weight: 600;
}

.report-week-1 {
    background: #e8f5e9;
}

.report-week-2 {
    background: #e3f2fd;
}

.report-week-3 {
    background: #fff8e1;
}

.report-week-num {
    font-variant-numeric: tabular-nums;
}

.report-pct,
.report-pct-tot {
    min-width: 44px;
    font-weight: 700;
    background: #e3f2fd;
}

.report-pct-tot {
    background: #fff9e6;
}

/* Resumen por programa (tabla Excel + gráficos) */
.report-programa-card {
    margin-top: 16px;
}

.report-programa-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.report-programa-table {
    border-collapse: collapse;
    font-size: 13px;
}

.report-programa-table th,
.report-programa-table td {
    border: 1px solid #1a1a1a;
    padding: 8px 10px;
    vertical-align: middle;
}

.report-programa-table thead th {
    background: #d9d9d9;
    font-weight: 700;
    text-transform: uppercase;
}

.report-prog-th-desc,
.report-prog-td-desc {
    text-align: left;
    background: #fff;
}

.report-programa-table thead .report-prog-th-prog {
    text-align: left;
}

.report-prog-th-num {
    text-align: center;
    min-width: 72px;
}

.report-programa-table tbody td:not(.report-prog-td-num):not(.report-prog-td-desc) {
    text-align: left;
    background: #fff;
}

.report-prog-td-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: #ddebf7;
}

.report-programa-charts {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 8px;
}

.report-chart-block h4.report-chart-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1f3864;
    text-align: center;
}

.report-chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    max-width: 100%;
}

.report-chart-canvas-wrap canvas {
    display: block;
    max-width: 100%;
}

@media (min-width: 900px) {
    .report-chart-canvas-wrap {
        height: 380px;
    }
}

/* Dashboard — resumen para encargado */
.dashboard-lead {
    margin: 0 0 20px;
    font-size: 15px;
    max-width: 720px;
}

.dashboard-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    color: #2c3e50;
}

.dashboard-cobertura-card .dashboard-cobertura-metric {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px 20px;
}

.dashboard-cobertura-big {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #2c3e50;
}

.dashboard-cobertura-pct {
    font-size: 15px;
    color: #7f8c8d;
    font-weight: 600;
}

.dashboard-inline-alert {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.dashboard-inline-alert--warn {
    background: #fff8e6;
    border-left: 4px solid #f39c12;
    color: #5d4a1f;
}

.dashboard-estado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.dashboard-estado-pill {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.dashboard-estado-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dashboard-estado-num {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    font-variant-numeric: tabular-nums;
}

.dashboard-estado-pct {
    font-size: 12px;
    color: #7f8c8d;
}

.dashboard-activity-row {
    margin-top: 0;
}

.dashboard-sem-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-sem-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

.dashboard-sem-list li:last-child {
    border-bottom: none;
}

.dashboard-cta-card .dashboard-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}