:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --bg-color: #f0f4f8;
    --text-main: #2d3748;
    --text-muted: #718096;
    --error-color: #e53e3e;
    --error-bg: #fff5f5;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(74, 144, 226, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
}

.login-body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Prevent scroll on mobile for login */
}

/* --- DOC ACTIONS --- */
.doc-actions-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.doc-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-small {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon-small:hover {
    background: #f7fafc;
    color: var(--primary-color);
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.btn-icon-small.delete:hover {
    color: var(--error-color);
}

/* Background Animated Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: rgba(74, 144, 226, 0.4);
    top: -50px;
    left: -50px;
}

.blob-2 {
    width: 250px;
    height: 250px;
    background: rgba(100, 200, 255, 0.3);
    bottom: -50px;
    right: -50px;
    animation-delay: -4s;
}

@keyframes float {
    0% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(20px) scale(1.05);
    }

    100% {
        transform: translateY(0px) scale(1);
    }
}

/* Glassmorphism Card */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 10;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--glass-shadow);
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.logo-container {
    margin-bottom: 24px;
}

.logo {
    max-width: 140px;
    height: auto;
}

.title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Form Elements */
.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    padding-left: 4px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper input:not(:placeholder-shown)+.input-icon {
    color: var(--primary-color);
}

/* Password Toggle */
.toggle-pwd-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-pwd-btn:hover {
    color: var(--primary-color);
}

/* Options */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.forgot-pwd {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-pwd:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Submit Button */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Alert Box */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: left;
    animation: shake 0.5s ease-in-out;
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error-color);
    border: 1px solid rgba(229, 62, 62, 0.2);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .glass-card {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .title {
        font-size: 1.5rem;
    }
}

/* --- ESTILOS DEL DASHBOARD --- */
.dashboard-body {
    background-color: var(--bg-color);
    overflow-y: auto;
}

.top-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 35px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.greeting {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
}

.btn-icon:hover {
    color: var(--error-color);
    transform: scale(1.05);
    background: var(--error-bg);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px;
    padding-bottom: 80px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    width: auto;
}

.children-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.child-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.child-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.child-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.child-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-item {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.doc-item:active {
    transform: scale(0.98);
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.doc-icon {
    color: var(--primary-color);
}

.doc-details {
    display: flex;
    flex-direction: column;
}

.doc-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.doc-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pendiente {
    background: #feebc8;
    color: #dd6b20;
}

.badge-revisado {
    background: #c6f6d5;
    color: #38a169;
}

.badge-rechazado {
    background: #fed7d7;
    color: #e53e3e;
}

.badge-missing {
    background: #e2e8f0;
    color: #4a5568;
}

.page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(74, 144, 226, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    color: #cbd5e0;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 8px;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    color: var(--text-main);
}

.modal-close:hover {
    background: #edf2f7;
    color: var(--text-main);
}

.input-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    appearance: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

.file-drop-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    background: rgba(74, 144, 226, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--primary-color);
}

.file-drop-area:hover {
    background: rgba(74, 144, 226, 0.1);
}

.file-input {
    display: none;
}

.text-area {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    resize: vertical;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.text-area:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}


/* --- MODAL GENÉRICO --- */
.modal-sm {
    max-width: 320px;
    text-align: center;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

.btn-secondary {
    padding: 14px;
    border: 1px solid #cbd5e0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
}

.modal-actions .btn-primary {
    flex: 1;
}

/* --- BENTO GRID --- */
/* Estilos premium para el panel principal */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.bento-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
}

.bento-card:active {
    transform: translateY(0);
}

.bento-span-2 {
    grid-column: span 2;
}

.bento-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

.bento-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.bento-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Especial para la Beca */
.bento-beca {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(253, 160, 133, 0.3);
}

.bento-beca .bento-icon {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.bento-beca .bento-title {
    color: #fff;
    font-size: 1.2rem;
}

.bento-beca .bento-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

/* Estilos de Resumen de Beca */
.bento-summary {
    align-items: stretch;
    text-align: left;
    padding: 30px;
}

.bento-beca-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 16px;
}

.bento-beca-header .bento-icon {
    margin-bottom: 0;
}

.beca-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.beca-detail-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.beca-detail-item strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    opacity: 0.9;
}

.btn-beca-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #f7a26f;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    align-self: flex-start;
}

.btn-beca-link:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}