:root {
    --blue: #0B3D91;
    --blue-dark: #061E45;
    --blue-soft: #EAF1FF;
    --gold: #D4AF37;
    --gold-soft: #FFF6D8;
    --white: #FFFFFF;
    --bg: #F4F7FB;
    --text: #172033;
    --muted: #667085;
    --border: #DFE7F2;
    --success: #16A34A;
    --success-soft: #DCFCE7;
    --warning: #F59E0B;
    --warning-soft: #FEF3C7;
    --danger: #DC2626;
    --danger-soft: #FEE2E2;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
    --shadow-strong: 0 34px 90px rgba(15, 23, 42, 0.16);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.13), transparent 28%), var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.layout-page {
    width: min(1280px, calc(100% - 42px));
    margin: 0 auto;
    padding: 34px 0 60px;
}

.hero {
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.25), transparent 30%), linear-gradient(135deg, var(--blue-dark), #123B73);
    color: var(--white);
    border-radius: 34px;
    padding: 32px;
    box-shadow: var(--shadow-strong);
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    font-weight: 900;
    margin-bottom: 24px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: stretch;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--gold);
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 950;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(36px, 5vw, 68px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    margin-bottom: 14px;
}

.hero p {
    color: #D8E2F0;
    max-width: 780px;
    line-height: 1.7;
}

.summary-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    padding: 24px;
    display: grid;
    align-content: end;
}

    .summary-card span {
        color: var(--gold);
        font-size: 48px;
    }

    .summary-card strong {
        font-size: 44px;
        line-height: 1;
    }

    .summary-card small {
        color: #D8E2F0;
        font-weight: 850;
    }

.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

    .panel-header h2 {
        color: var(--blue-dark);
        font-size: 30px;
        letter-spacing: -0.035em;
    }

    .panel-header p {
        color: var(--muted);
        margin-top: 5px;
    }

.upload-box {
    border: 2px dashed var(--border);
    border-radius: 24px;
    background: var(--bg);
    padding: 34px;
    text-align: center;
    transition: 0.2s ease;
}

    .upload-box.dragover {
        border-color: var(--blue);
        background: var(--blue-soft);
    }

    .upload-box span {
        font-size: 58px;
        color: var(--gold);
    }

    .upload-box h3 {
        color: var(--blue-dark);
        font-size: 24px;
        margin-top: 10px;
    }

    .upload-box p {
        color: var(--muted);
        margin: 8px 0 18px;
    }

    .upload-box input {
        display: inline-block;
    }

.selected-file {
    margin-top: 14px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 850;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.primary-button,
.secondary-button {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 950;
    transition: 0.2s ease;
}

.primary-button {
    background: var(--blue);
    color: var(--white);
}

.secondary-button {
    background: var(--blue-soft);
    color: var(--blue);
}

    .primary-button:hover,
    .secondary-button:hover {
        transform: translateY(-2px);
    }

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.alert {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 850;
}

    .alert.success {
        background: var(--success-soft);
        color: #166534;
    }

    .alert.error {
        background: var(--danger-soft);
        color: #991B1B;
    }

    .alert.info {
        background: var(--blue-soft);
        color: var(--blue);
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
}

    .stat-card span {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        background: var(--blue-soft);
        color: var(--blue);
        display: grid;
        place-items: center;
        font-size: 34px;
        margin-bottom: 14px;
    }

    .stat-card.success span {
        background: var(--success-soft);
        color: #166534;
    }

    .stat-card.warning span {
        background: var(--warning-soft);
        color: #92400E;
    }

    .stat-card.danger span {
        background: var(--danger-soft);
        color: #991B1B;
    }

    .stat-card strong {
        display: block;
        color: var(--blue-dark);
        font-size: 36px;
        line-height: 1;
    }

    .stat-card small {
        display: block;
        color: var(--muted);
        font-weight: 850;
        margin-top: 8px;
    }

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

    .data-table th {
        background: var(--blue-dark);
        color: var(--white);
        text-align: left;
        padding: 14px;
        font-size: 14px;
    }

    .data-table td {
        padding: 13px 14px;
        border-bottom: 1px solid var(--border);
        color: var(--text);
        vertical-align: top;
    }

    .data-table tr:nth-child(even) td {
        background: #F8FAFC;
    }

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    text-transform: capitalize;
}

    .badge.valido,
    .badge.importado {
        background: var(--success-soft);
        color: #166534;
    }

    .badge.existente {
        background: var(--blue-soft);
        color: var(--blue);
    }

    .badge.duplicado {
        background: var(--warning-soft);
        color: #92400E;
    }

    .badge.invalido,
    .badge.fallido {
        background: var(--danger-soft);
        color: #991B1B;
    }

.import-list {
    display: grid;
    gap: 14px;
}

.import-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}

    .import-card h3 {
        color: var(--blue-dark);
        margin-bottom: 6px;
    }

    .import-card p {
        color: var(--muted);
        line-height: 1.5;
    }

.import-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.empty-message {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 20px;
    color: var(--muted);
    font-weight: 850;
    text-align: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .hero-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .import-card {
        grid-template-columns: 1fr;
    }

    .panel-header {
        display: grid;
    }
}

@media (max-width: 620px) {
    .layout-page {
        width: min(100% - 28px, 1280px);
    }

    .hero,
    .panel {
        border-radius: 22px;
        padding: 22px;
    }

    .upload-box {
        padding: 24px;
    }

    .actions,
    .import-actions {
        display: grid;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
        justify-content: center;
    }
}

.filters-panel {
    margin: 22px 0;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
}

.filters-grid {
    display: grid;
    grid-template-columns: 180px 240px minmax(220px, 1fr) auto auto;
    gap: 14px;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

    .filter-field span {
        font-size: 0.82rem;
        font-weight: 700;
        color: #334155;
    }

    .filter-field select,
    .filter-field input {
        min-height: 42px;
        border: 1px solid rgba(15, 23, 42, 0.16);
        border-radius: 12px;
        padding: 0 12px;
        font: inherit;
        color: #0f172a;
        background: #fff;
        outline: none;
    }

        .filter-field select:focus,
        .filter-field input:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
        }

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

    .report-card .material-symbols-rounded {
        color: #2563eb;
    }

    .report-card strong {
        display: block;
        font-size: 1.35rem;
        color: #0f172a;
    }

    .report-card small {
        color: #64748b;
    }

    .report-card.success .material-symbols-rounded {
        color: #16a34a;
    }

    .report-card.danger .material-symbols-rounded {
        color: #dc2626;
    }

    .report-card.warning .material-symbols-rounded {
        color: #d97706;
    }

.category-report {
    margin-top: 18px;
}

    .category-report h3 {
        margin: 0 0 12px;
        font-size: 1rem;
        color: #0f172a;
    }

.career-report-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.career-report-card {
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

    .career-report-card strong {
        display: block;
        color: #0f172a;
    }

    .career-report-card small {
        color: #64748b;
    }

    .career-report-card p {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 12px 0 0;
    }

.mini-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

    .mini-badge.success {
        color: #166534;
        background: #dcfce7;
    }

    .mini-badge.danger {
        color: #991b1b;
        background: #fee2e2;
    }

    .mini-badge.warning {
        color: #92400e;
        background: #fef3c7;
    }

.badge.valid {
    color: #166534;
    background: #dcfce7;
}

.badge.invalid {
    color: #991b1b;
    background: #fee2e2;
}

.badge.duplicated {
    color: #92400e;
    background: #fef3c7;
}

.badge.other {
    color: #334155;
    background: #e2e8f0;
}

@media (max-width: 1100px) {
    .filters-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .search-field {
        grid-column: 1 / -1;
    }

    .report-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 640px) {
    .filters-grid,
    .report-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================
   IMPORT MODE SWITCH
========================= */

.import-mode-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    max-width: 760px;
}

.import-mode-option {
    min-height: 96px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.10);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    text-align: left;
    transition: 0.2s ease;
}

.import-mode-option:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.16);
}

.import-mode-option.active {
    background: var(--white);
    color: var(--blue-dark);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
}

.import-mode-option > span {
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: rgba(212, 175, 55, 0.18);
    color: var(--gold);
    display: grid;
    place-items: center;
    font-size: 28px;
}

.import-mode-option.active > span {
    background: var(--gold-soft);
    color: #92400E;
}

.import-mode-option strong {
    align-self: end;
    font-size: 15px;
    line-height: 1.15;
}

.import-mode-option small {
    color: #D8E2F0;
    line-height: 1.45;
    font-weight: 750;
}

.import-mode-option.active small {
    color: var(--muted);
}

.mode-badge {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 950;
    white-space: nowrap;
}

.mode-badge .material-symbols-rounded {
    font-size: 21px;
}

/* =========================
   DYNAMIC IMPORT TABLE
========================= */

body[data-import-mode="teachers"] .upload-box span {
    color: var(--blue);
}

body[data-import-mode="teachers"] .summary-card span,
body[data-import-mode="teachers"] .kicker {
    color: var(--gold);
}

.badge.created,
.badge.create,
.badge.insert,
.badge.insertar {
    background: var(--success-soft);
    color: #166534;
}

.badge.updated,
.badge.update,
.badge.actualizar {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge.skipped,
.badge.skip,
.badge.omitido {
    background: #E2E8F0;
    color: #334155;
}

.badge.preview {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge.confirmed {
    background: var(--success-soft);
    color: #166534;
}

@media (max-width: 980px) {
    .import-mode-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .import-mode-option {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .mode-badge {
        width: 100%;
        justify-content: center;
    }
}
