@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;600;700&display=swap');

:root {
    --primary-blue: #003366;
    --secondary-blue: #0056b3;
    --gold: #D4AF37;
    --light-gold: #F4E7C3;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --medium-gray: #E0E0E0;
    --dark-gray: #666666;
    --text-dark: #222222;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

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

body {
    font-family: 'Noto Sans', sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--light-gray); /* Fallback */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow: hidden;
    animation: fadeIn 1s ease;
}

.login-layout {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 1100px;
    max-height: 700px;
    background: var(--white);
    box-shadow: 0 10px 50px rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: hidden;
    /* Make layout flexible and scale gracefully */
    align-items: stretch;
}

/* Make visual panel and form panel flexible with sensible min/max */
.login-visual-panel {
    flex: 1.4 1 420px; /* grow, shrink, basis */
    background: var(--primary-blue);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image: url('USEPS Desktop Wallpaper.png');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    min-width: 260px;
    max-width: 68%;
    transition: all 0.22s ease;
}

.login-visual-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 51, 102, 0.75); /* Dark overlay */
    backdrop-filter: blur(2px);
}

.institutional-brand {
    z-index: 10;
    text-align: center;
    padding: 2rem;
    color: var(--white);
    max-width: 80%;
}

.brand-logo-large {
    width: clamp(64px, 9vw, 120px);
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
    animation: float 4s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.institutional-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.motto-large {
    font-size: 1rem;
    font-weight: 300;
    font-style: italic;
    opacity: 0.9;
    letter-spacing: 0.05em;
}

.login-form-panel {
    flex: 1 1 360px;
    min-width: 260px;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2.6vw, 2rem) 1.5rem;
    position: relative;
}

/* Constrain inner container and allow it to scale */
.login-container {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border: 1px solid rgba(0,0,0,0.04);
}

/* Smaller logo on very narrow widths, keep proportion */
.brand-logo-large {
    width: clamp(56px, 9vw, 96px);
    height: auto;
    margin-bottom: 0.6rem;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.12));
    animation: float 4s ease-in-out infinite alternate;
}

/* Ensure small logo displays appropriately */
.brand-logo-small {
    display: none;
    width: clamp(48px, 9vw, 72px);
    height: auto;
    margin-bottom: 1rem;
}

/* Login header styling inside card */
.login-header {
    text-align: left;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(212,175,55,0.18);
    margin-bottom: 1rem;
}

.login-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
    letter-spacing: 0.2px;
}

.login-section-subtitle {
    font-size: 0.92rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

/* Inputs: ensure fields never overflow and remain touch-friendly */
.input-field-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    transition: all 0.18s cubic-bezier(.2,.9,.2,1);
    min-height: 48px; /* touch target */
    box-shadow: 0 4px 14px rgba(6,20,40,0.04);
}

/* Icon spacing and subtle color */
.field-icon-svg {
    margin-right: 10px;
    color: var(--secondary-blue);
    flex: 0 0 auto;
    opacity: 0.9;
}

/* Toggle button kept small but accessible */
.toggle-password {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #888;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    margin-left: 0.5rem;
    width: 36px;
    height: 36px;
}

/* Ensure the input inside the icon+input container expands and removes double borders */
.input-field-container input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.96rem;
    background: transparent;
    color: var(--text-dark);
    padding: 0;
}

/* Input focus effect */
.input-field-container:focus-within {
    border-color: var(--secondary-blue);
    box-shadow: 0 8px 24px rgba(0,86,179,0.08);
    transform: translateY(-1px);
}

/* Label improvements */
.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.85rem;
    display: block;
}

/* Form options spacing */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.6rem 0 1rem 0;
    width: 100%;
}

/* Remember checkbox look */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

/* Forgot link */
.forgot-link {
    color: var(--secondary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Login button styling */
.login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.25rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(0,86,179,0.14);
}

/* Login button primary color stronger and gold accent on hover */
.btn-primary {
    background: linear-gradient(180deg, var(--secondary-blue), var(--primary-blue));
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--primary-blue), #002244);
    transform: translateY(-2px);
}

/* Spinner color override for contrast with button */
.spinner-svg {
    animation: spin 1s linear infinite;
    color: #fff;
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* Footer spacing responsive */
.login-footer {
    position: absolute;
    bottom: clamp(12px, 3.2vw, 20px);
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 2.5rem;
    font-size: 0.85rem;
    color: var(--dark-gray);
}

/* Ensure modal and pdf preview are responsive */
.modal .modal-content,
.notification-content,
.modal-content.modal-large {
    width: min(96%, 980px);
    max-height: 88vh;
    overflow: auto;
}

/* PDF iframe responsiveness */
#pdfPreviewContent iframe,
.modal-content iframe {
    width: 100%;
    height: 60vh;
    min-height: 320px;
}

/* Make tables and cards wrap nicely on small widths */
@media (max-width: 1100px) {
    .login-visual-panel {
        max-width: 55%;
    }
    .login-form-panel {
        max-width: 45%;
    }
}

/* Responsive stacking for narrow screens but keep design intact */
@media (max-width: 900px) {
    .login-layout {
        flex-direction: column;
        max-height: none;
        border-radius: 0;
    }

    .login-visual-panel {
        width: 100%;
        max-width: 100%;
        min-height: 160px;
        padding: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-visual-panel::before {
        background: rgba(0, 51, 102, 0.85);
    }

    .login-form-panel {
        width: 100%;
        max-width: 100%;
        padding: 1.25rem;
        background: var(--light-gray);
    }

    .brand-logo-small {
        display: block;
    }

    .brand-logo-large {
        display: none;
    }

    .login-container {
        max-width: 520px;
        padding: clamp(1rem, 4vw, 2rem);
        border-radius: 10px;
        box-shadow: 0 6px 22px rgba(0,0,0,0.08);
    }

    .login-footer {
        position: static;
        margin-top: 1.25rem;
    }
}

/* Very small devices: keep spacing tight, ensure min touch sizes */
@media (max-width: 420px) {
    .login-container {
        padding: 0.9rem;
    }
    .login-section-title {
        font-size: 1.15rem;
    }
    .login-section-subtitle {
        font-size: 0.82rem;
    }
    .input-field-container {
        padding: 0.5rem 0.6rem;
    }
    .toggle-password { width: 32px; height: 32px; }
    .btn { padding: 0.6rem 1rem; font-size: 0.95rem; }
}

header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 0;
    letter-spacing: 2px;
    line-height: 1.1;
    text-shadow: 0 1px 0 rgba(0,0,0,0.12);
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.2;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    border: 3px solid var(--white);
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--white);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--white);
    color: var(--primary-blue);
}

.main-nav {
    background: var(--white);
    border-bottom: 3px solid var(--gold);
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    overflow-x: auto;
}

.nav-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--light-gray);
    color: var(--secondary-blue);
}

.nav-btn.active {
    color: var(--primary-blue);
    border-bottom-color: var(--gold);
    background: var(--light-gold);
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.section {
    display: none;
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}

h3 {
    color: var(--secondary-blue);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 6px;
}

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

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-section .form-group input[type="text"],
.form-section .form-group input[type="date"],
.form-section .form-group input[type="number"],
.form-section .form-group textarea,
.form-section .form-group select {
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-blue);
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 0.5rem;
}

.date-inputs input {
    text-align: center;
}

.instructions {
    background: var(--white);
    padding: 1rem;
    border-left: 4px solid var(--gold);
}

.instructions ul {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.25rem;
}

.competencia-card {
    background: var(--white);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--medium-gray);
}

.competencia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-gold);
}

.competencia-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.competencia-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
}

.competencia-accordion {
    background: var(--white);
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--medium-gray);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
}

.accordion-header:hover {
    background: var(--medium-gray);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s;
    display: inline-block;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-content.active {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.accordion-content .items-grid {
    padding: 1.5rem;
}

.items-grid {
    display: grid;
    gap: 1rem;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--light-gray);
    border-radius: 4px;
}

.item-text {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.item-selector {
    display: flex;
    gap: 0.5rem;
}

.score-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.score-btn:hover {
    border-color: var(--secondary-blue);
    transform: translateY(-2px);
}

.score-btn.selected {
    background: var(--secondary-blue);
    color: var(--white);
    border-color: var(--secondary-blue);
}

.totales {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.total-item {
    text-align: center;
    padding: 1rem;
}

.total-item span {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.total-item strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.nivel-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    background: var(--gold);
    color: var(--primary-blue);
    font-size: 1rem !important;
}

.privacy-notice {
    background: var(--light-gold);
    border-left: 4px solid var(--gold);
}

.small-text {
    font-size: 0.85rem;
    line-height: 1.5;
}

.privacy-notice a {
    color: var(--secondary-blue);
    text-decoration: none;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--secondary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: var(--white);
    color: var(--secondary-blue);
    border: 2px solid var(--secondary-blue);
}

.btn-secondary:hover {
    background: var(--secondary-blue);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 0.9rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background: var(--primary-blue);
    color: var(--white);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

th {
    font-weight: 600;
    font-size: 0.9rem;
}

td {
    font-size: 0.9rem;
}

tbody tr:hover {
    background: var(--light-gray);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-borrador { background: var(--medium-gray); color: var(--text-dark); }
.status-finalizada { background: var(--secondary-blue); color: var(--white); }
.status-conforme { background: var(--success); color: var(--white); }
.status-apelada { background: var(--warning); color: var(--text-dark); }

.action-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--medium-gray);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-blue);
    margin-bottom: 0.5rem;
}

.kpi-label {
    font-size: 0.9rem;
    color: var(--dark-gray);
    font-weight: 600;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--medium-gray);
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.help-content {
    display: grid;
    gap: 1.5rem;
}

.help-section {
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 6px;
}

.help-section h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.help-table {
    margin-top: 1rem;
    background: var(--white);
}

.help-table th {
    background: var(--secondary-blue);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

/* Notification Modal System */
.notification-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
    align-items: center;
    justify-content: center;
}

.notification-modal.active {
    display: flex;
}

.notification-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.notification-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: iconPulse 0.6s ease-out;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-icon.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: var(--white);
}

.notification-icon.error {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: var(--white);
}

.notification-icon.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: var(--white);
}

.notification-icon.info {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: var(--white);
}

.notification-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.notification-message {
    font-size: 1rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.notification-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.notification-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.notification-btn.primary {
    background: var(--secondary-blue);
    color: var(--white);
}

.notification-btn.primary:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,86,179,0.3);
}

.notification-btn.secondary {
    background: var(--white);
    color: var(--secondary-blue);
    border: 2px solid var(--secondary-blue);
}

.notification-btn.secondary:hover {
    background: var(--light-gray);
}

.notification-btn.danger {
    background: var(--danger);
    color: var(--white);
}

.notification-btn.danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-large {
    max-width: 1000px;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-gray);
    cursor: pointer;
}

.close:hover {
    color: var(--primary-blue);
}

.evaluacion-print {
    padding: 2rem;
}

.evaluacion-print h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.evaluacion-print .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.evaluacion-print .info-item {
    padding: 0.5rem;
    background: var(--light-gray);
    border-radius: 4px;
}

.evaluacion-print .info-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-gray);
}

.evaluacion-print .info-value {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.conformidad-box {
    background: var(--light-gold);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.conformidad-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.firma-digital {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--white);
    border: 2px dashed var(--gold);
    border-radius: 6px;
    text-align: center;
}

.apelacion-form {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 6px;
}

.apelacion-info {
    background: var(--white);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--dark-gray);
}

.empty-state h3 {
    margin-bottom: 1rem;
}

.config-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--medium-gray);
}

.config-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.config-tab:hover {
    color: var(--secondary-blue);
}

.config-tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--gold);
}

.config-content {
    position: relative;
}

.config-panel {
    display: none;
}

.config-panel.active {
    display: block;
    animation: fadeIn 0.3s;
}

.config-section {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 6px;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.config-header h3 {
    margin: 0;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-superadmin {
    background: var(--gold);
    color: var(--primary-blue);
}

.role-administrador {
    background: var(--secondary-blue);
    color: var(--white);
}

.role-evaluador {
    background: var(--medium-gray);
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .logo-section {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-logo {
        height: 60px;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .totales {
        grid-template-columns: 1fr;
    }

    .config-tabs {
        overflow-x: auto;
    }

    .config-tab {
        white-space: nowrap;
    }

    .login-container {
        padding: 2rem 1.75rem 1.75rem;
    }

    .login-title {
        font-size: 0.85rem;
    }

    .login-section-title {
        font-size: 1.25rem;
    }
}

/* Modern Config UI */
.config-container-modern {
    background: transparent;
    animation: fadeIn 0.4s ease;
}

.config-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: 700;
    margin: 0;
}

.btn-add-user {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 51, 102, 0.2);
}

.user-form-wrapper {
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modern-form-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
}

.form-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1rem;
}

.form-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.modern-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
}

.form-group-modern.full-width {
    grid-column: 1 / -1;
}

.form-group-modern label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.form-group-modern input,
.form-group-modern select {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fdfdfd;
}

.form-group-modern input:focus,
.form-group-modern select:focus {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    background: #fff;
    outline: none;
}

.modern-form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d0d0d0;
    color: var(--dark-gray);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #f5f5f5;
    color: var(--text-dark);
    border-color: #b0b0b0;
}

.table-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid #eaeaea;
}

/* MODERN LIST & TABLE STYLES */

.page-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 1rem;
}

.header-titles h2 {
    margin-bottom: 0.25rem;
    border-bottom: none;
    padding-bottom: 0;
}

.header-titles .subtitle {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin: 0;
}

.filters-toolbar {
    display: flex;
    gap: 1.5rem;
    background: var(--white);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    margin-bottom: 1.5rem;
    align-items: center;
    border: 1px solid #eee;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.modern-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.modern-search-input:focus {
    border-color: var(--secondary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.filter-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-select-wrapper label {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.modern-select {
    padding: 0.6rem 2rem 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 180px;
}

.modern-select:focus {
    border-color: var(--secondary-blue);
    outline: none;
}

/* Modern Card for Table */
.modern-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    overflow: hidden;
}

.modern-card.no-padding {
    padding: 0;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table thead th {
    background: var(--primary-blue);
    color: #fff;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    white-space: nowrap;
}

.modern-table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    transition: background 0.2s;
}

.modern-table tbody tr:hover td {
    background-color: #f8fbff;
}

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

/* Cell content styling */
.id-cell {
    font-family: monospace;
    color: var(--dark-gray);
    font-weight: 600;
}

.user-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.badge-area {
    display: inline-block;
    background: #f0f2f5;
    color: #555;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    width: fit-content;
}

.date-cell {
    display: flex;
    flex-direction: column;
}

.score-container {
    width: 100%;
    max-width: 160px;
}

.score-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.text-xs {
    font-size: 0.75rem;
}

.score-track {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Status Badges */
.status-badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge-modern.status-borrador {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-badge-modern.status-finalizada {
    background-color: #cce5ff;
    color: #004085;
}

.status-badge-modern.status-conforme {
    background-color: #d4edda;
    color: #155724;
}

.status-badge-modern.status-apelada {
    background-color: #fff3cd;
    color: #856404;
}

/* Role Badges Modern */
.role-badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-badge-modern.role-superadmin {
    background-color: #fff3cd; /* Gold-ish light */
    color: #856404;
    border: 1px solid #ffeeba;
}

.role-badge-modern.role-administrador {
    background-color: #cce5ff; /* Blue light */
    color: #004085;
    border: 1px solid #b8daff;
}

.role-badge-modern.role-evaluador {
    background-color: #e2e3e5; /* Gray light */
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Actions Group */
.actions-group {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--dark-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #f0f0f0;
    color: var(--primary-blue);
    border-color: #e0e0e0;
}

.icon-btn.btn-highlight {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.icon-btn.btn-highlight:hover {
    background: var(--success);
    color: #fff;
}

/* Dropdown Menu for Actions */
.dropdown-trigger-wrapper {
    position: relative;
}

.action-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 100;
    display: none;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.action-dropdown-menu.active {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item .icon {
    font-size: 1rem;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 0;
}

.text-danger {
    color: var(--danger) !important;
}

/* Empty State Modern */
.empty-state-modern {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 10px;
    border: 1px dashed #ddd;
    margin-top: 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-modern h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
}

/* Utility Helpers */
.d-block { display: block; }
.mt-1 { margin-top: 0.25rem; }
.fw-bold { font-weight: 600; }
.small { font-size: 0.85rem; }

@media (max-width: 768px) {
    .filters-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .modern-table thead {
        display: none; 
    }
    
    .modern-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .modern-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        text-align: right;
    }
    
    .modern-table tbody td::before {
        content: attr(data-label); /* Requires data-label attr in HTML for this to work perfectly, simplified for now */
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--dark-gray);
        text-align: left;
    }
    
    .user-cell {
        align-items: flex-start;
        text-align: left;
    }
    
    .actions-group {
        width: 100%;
        justify-content: space-between;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }
}