﻿/* Estilos específicos para la página de Clientes */
.clientes-root {
    min-height: 100vh;
    background: #f3f6fb;
    color: #1f2937;
    width: 100%;
    display: flex;
    font-family: sans-serif;
}

    /* --- ESTILOS REUTILIZADOS DE SIDEBAR Y HEADER --- */
    .clientes-root .sidebar {
        width: 250px;
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
        color: white;
        padding: 20px 0;
        position: fixed;
        height: 100vh;
        z-index: 100;
        transition: all 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .clientes-root .sidebar-header {
        padding: 0 20px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .clientes-root .logo {
        font-size: 2rem;
        font-weight: 700;
        text-decoration: none;
        background: linear-gradient(45deg, #ffffff, #f0f9ff, #dbeafe);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .clientes-root .sidebar-nav {
        padding: 20px 0;
    }

    .clientes-root .nav-item {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: all 0.3s ease;
        border-left: 4px solid transparent;
        cursor: pointer;
    }

        .clientes-root .nav-item:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border-left-color: rgba(255, 255, 255, 0.3);
        }

        .clientes-root .nav-item.active {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            border-left-color: white;
        }

    .clientes-root .nav-icon {
        font-size: 1.2rem;
        margin-right: 15px;
        width: 24px;
        text-align: center;
    }

    .clientes-root .nav-text {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .clientes-root .main-content-wrapper {
        flex: 1;
        margin-left: 250px;
        transition: all 0.3s ease;
    }

    .clientes-root .header {
        background: white;
        padding: 15px 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .clientes-root .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .clientes-root .sidebar-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #1e3a8a;
        display: none;
        padding: 5px 10px;
    }

    .clientes-root .user-info-container {
        display: flex;
        justify-content: flex-end;
        margin-left: auto;
    }

    .clientes-root .user-info {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .clientes-root .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(45deg, #059669, #10b981);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 1.1rem;
        color: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }

        .clientes-root .user-avatar:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
        }

    .clientes-root .user-details {
        text-align: right;
    }

    .clientes-root .user-name {
        font-weight: 600;
        font-size: 0.95rem;
    }

    .clientes-root .user-role {
        font-size: 0.85rem;
        opacity: 0.8;
    }

    .clientes-root .return-btn {
        background: rgba(220, 38, 38, 0.1);
        border: 1px solid rgba(220, 38, 38, 0.2);
        color: #dc2626;
        padding: 8px 16px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }

        .clientes-root .return-btn:hover {
            background: rgba(220, 38, 38, 0.2);
            transform: translateY(-2px);
        }

    .clientes-root .main-content {
        padding: 30px 0;
    }

    .clientes-root .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .clientes-root .admin-header {
        background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
        border-radius: 20px;
        padding: 30px 40px;
        margin-bottom: 30px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    }

    .clientes-root .admin-title {
        font-size: 2.2rem;
        font-weight: 700;
        color: #1e3a8a;
        margin-bottom: 10px;
    }

    .clientes-root .admin-subtitle {
        font-size: 1.1rem;
        color: #64748b;
    }

    .clientes-root .tabs-section {
        margin-bottom: 30px;
    }

    .clientes-root .tabs-container {
        display: flex;
        border-bottom: 2px solid #e2e8f0;
    }

    .clientes-root .tab {
        padding: 12px 25px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        font-weight: 600;
        color: #64748b;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all 0.3s ease;
    }

        .clientes-root .tab.active {
            color: #2563eb;
            border-bottom-color: #2563eb;
        }

        .clientes-root .tab:hover:not(.active) {
            color: #1e40af;
            border-bottom-color: #cbd5e1;
        }

    .clientes-root .tab-icon {
        font-size: 1.1rem;
    }

    .clientes-root .tab-text {
        font-size: 0.95rem;
    }

    /* --- ESTILOS DE CONTENIDO PRINCIPAL --- */
    .clientes-root .tab-content {
        background: white;
        border-radius: 20px;
        padding: 30px 40px;
        box-shadow: 0 10px 40px rgba(220, 225, 240, 0.7);
        border: 1px solid #e2e8f0;
        margin-bottom: 40px;
    }

    .clientes-root .table-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        gap: 20px;
    }

    .clientes-root .search-box {
        position: relative;
        flex-grow: 1;
        max-width: 400px;
    }

        .clientes-root .search-box input {
            width: 100%;
            padding: 12px 40px 12px 16px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            font-size: 0.95rem;
            background-color: #f9fafb;
            transition: all 0.3s ease;
        }

            .clientes-root .search-box input:focus {
                background-color: white;
                border-color: #2563eb;
                box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
                outline: none;
            }

    .clientes-root .search-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #9ca3af;
    }

    .clientes-root .add-btn {
        background: linear-gradient(135deg, #059669, #10b981);
        color: white;
        border: none;
        padding: 12px 25px;
        border-radius: 10px;
        font-weight: 600;
        font-size: 0.95rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
        white-space: nowrap;
    }

        .clientes-root .add-btn span {
            font-size: 1.3rem;
            line-height: 1;
        }

        .clientes-root .add-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
        }

    /* Tabla */
    .clientes-root .table-container {
        overflow-x: auto;
    }

    .clientes-root .admin-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 8px;
        font-size: 0.95rem;
    }

        .clientes-root .admin-table th {
            text-align: left;
            padding: 15px 20px;
            background: transparent;
            color: #64748b;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.8rem;
            letter-spacing: 0.5px;
            border-bottom: 2px solid #e2e8f0;
        }

        .clientes-root .admin-table td {
            padding: 20px;
            border: none;
            background: #fdfdff;
            color: #334155;
            vertical-align: middle;
        }

        .clientes-root .admin-table tr.data-row {
            transition: all 0.2s ease-in-out;
            border-radius: 12px;
            box-shadow: 0 2px 10px -2px rgba(220, 225, 240, 0.6);
            border: 1px solid #f0f3f8;
        }

            .clientes-root .admin-table tr.data-row:hover {
                transform: translateY(-3px) scale(1.01);
                background: #ffffff;
                box-shadow: 0 10px 30px -5px rgba(200, 205, 220, 0.9);
            }

        .clientes-root .admin-table tr td:first-child {
            border-top-left-radius: 12px;
            border-bottom-left-radius: 12px;
        }

        .clientes-root .admin-table tr td:last-child {
            border-top-right-radius: 12px;
            border-bottom-right-radius: 12px;
        }

    .clientes-root .actions-cell {
        display: flex;
        gap: 10px;
    }

    .clientes-root .action-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        border: none;
        background: transparent;
    }

        .clientes-root .action-btn svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
        }

        .clientes-root .action-btn.edit-btn {
            color: #2563eb;
            background: rgba(37, 99, 235, 0.1);
        }

            .clientes-root .action-btn.edit-btn:hover {
                background: rgba(37, 99, 235, 0.2);
                transform: translateY(-2px);
            }

    /* Paginación */
    .clientes-root .pagination-controls {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 25px;
    }

    .clientes-root .pagination-btn {
        background: #f8fafc;
        color: #64748b;
        border: 2px solid #e2e8f0;
        padding: 8px 16px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
    }

        .clientes-root .pagination-btn:hover:not(:disabled) {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

        .clientes-root .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

/* --- ESTILOS DE MODALES Y FORMULARIOS --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: modalPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    .modal-close:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: rotate(90deg);
    }

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.admin-form {
    width: 100%;
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f1f5f9;
}

    .form-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #e2e8f0;
    position: relative;
}

    .form-section-title::after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 60px;
        height: 3px;
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        border-radius: 2px;
    }

.form-grid {
    display: grid;
    gap: 20px;
}

    .form-grid.three-columns {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .form-grid.four-columns {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .form-group.span-2 {
        grid-column: span 2;
    }

    .form-group.span-3 {
        grid-column: span 3;
    }

    .form-group.span-4 {
        grid-column: span 4;
    }

    .form-group label {
        font-size: 0.9rem;
        font-weight: 600;
        color: #374151;
    }

.form-input, .form-select, .form-input[type="date"] {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #1f2937;
}

    .form-input:focus, .form-select:focus {
        background-color: white;
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        outline: none;
    }

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 45px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 30px;
    margin-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.cancel-btn, .submit-btn, .expediente-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

    .cancel-btn:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

.submit-btn {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    }

.expediente-btn {
    background: #64748b;
    color: white;
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3);
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .expediente-btn:hover {
        background: #475569;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
    }

    .expediente-btn span {
        font-size: 1.2rem;
    }


/* --- ESTILOS MODAL EXPEDIENTE (DISEÑO MÁS AMPLIO) --- */
.modal-container.expediente-modal {
    max-width: 1200px; /* Más ancho */
}

.expediente-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.expediente-main {
    display: flex;
    flex-direction: column;
}

.expediente-header {
    margin-bottom: 20px;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Mayor espaciado entre documentos */
}

.document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.document-name {
    font-weight: 500;
    color: #374151;
}

.document-actions {
    display: flex;
    gap: 8px;
    align-items: center; /* Centra verticalmente botones y status */
}

.doc-btn, .doc-btn-view {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.doc-btn {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

    .doc-btn:hover {
        background: #e2e8f0;
    }

.doc-btn-view {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

    .doc-btn-view:hover {
        background: #c7d2fe;
    }
/* === NUEVOS ESTILOS PARA EL INDICADOR DE ESTADO === */
.doc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 9999px; /* Forma de píldora */
    margin-left: auto; /* EMPUJA EL INDICADOR A LA DERECHA */
}

    .doc-status.loaded {
        background-color: #ecfdf5;
        color: #059669;
    }

    .doc-status.not-loaded {
        background-color: #fef2f2;
        color: #b91c1c;
    }


.expediente-sidebar {
    display: flex;
    flex-direction: column;
}

    .expediente-sidebar .card {
        padding: 20px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

.photo-box {
    min-height: 250px;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-style: italic;
    overflow: hidden;
    height: 100%;
    flex-grow: 1;
}

    .photo-box img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.expediente-sidebar .submit-btn {
    margin-top: 20px;
}

/* Animaciones y Responsive */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalPopIn {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .expediente-grid {
        grid-template-columns: 1fr;
    }

    .expediente-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .clientes-root .sidebar {
        transform: translateX(-100%);
    }

        .clientes-root .sidebar.active {
            transform: translateX(0);
        }

    .clientes-root .main-content-wrapper {
        margin-left: 0;
    }

    .clientes-root .sidebar-toggle {
        display: block;
    }

    .clientes-root .user-details {
        display: none;
    }

    .clientes-root .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .clientes-root .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .clientes-root .search-box {
        max-width: 100%;
    }

    .form-grid.three-columns, .form-grid.four-columns {
        grid-template-columns: 1fr;
    }

    .form-group.span-2, .form-group.span-3, .form-group.span-4 {
        grid-column: span 1;
    }
}
