/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --accent: #4299e1;
    --accent-hover: #3182ce;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ============================================
   TEMA OSCURO - VARIABLES
   ============================================ */
[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-sidebar: #2d3748;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --shadow: rgba(0, 0, 0, 0.3);
}



/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
   /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    background: linear-gradient(135deg, #00d2ff 0%, #3a47d5 100%); */
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);


    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-container h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-error {
    background: #fee;
    color: #c33;
    padding: 0.875rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.9rem;
}

.login-error.show {
    display: block;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}


/* ============================================
   LOGO EN LOGIN
   ============================================ */
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInDown 0.6s ease-out;
}

.logo-img {
    width: 120px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}


.logo-img:hover {
    transform: scale(1.05);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}






/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
#dashboardProveedor {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px var(--shadow);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo svg {
    color: var(--accent);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}



/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.theme-toggle {
    width: 60px;
    height: 30px;
    background: var(--border-color);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent);
}

.theme-icon {
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(30px);
}

.theme-toggle .sun {
    opacity: 1;
}

.theme-toggle .moon {
    opacity: 0.5;
}

[data-theme="dark"] .theme-toggle .sun {
    opacity: 0.5;
}

[data-theme="dark"] .theme-toggle .moon {
    opacity: 1;
}

/* Ajustar el sidebar-header para el nuevo elemento */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}




/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--bg-primary);
    color: var(--accent);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
}

.nav-btn .icon {
    font-size: 1.25rem;
}

/* ============================================
   SIDEBAR FOOTER
   ============================================ */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.nombre-proveedor {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.btn-logout {
    background: var(--danger) !important;
    color: white !important;
}

.btn-logout:hover {
    background: #c53030 !important;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   VIEWS (SECCIONES)
   ============================================ */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* ============================================
   STATS CARDS
   ============================================ */
/* ============================================
   KPI BAR COMPACTA - PROVEEDORES
   ============================================ */
.kpi-bar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 2rem;
}

.kpi-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.kpi-number {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* Colores de estado */
.kpi-primary {
    color: #2563eb;
}

.kpi-success {
    color: #16a34a;
}

.kpi-warning {
    color: #f59e0b;
}

/* Divisor vertical */
.kpi-divider {
    width: 1px;
    background: var(--border-color);
    opacity: 0.6;
}

/* Responsivo */
@media (max-width: 900px) {
    .kpi-bar {
        flex-wrap: wrap;
    }
    .kpi-item {
        flex: 1 1 45%;
        margin-bottom: 0.5rem;
    }
    .kpi-divider {
        display: none;
    }
}

@media (max-width: 600px) {
    .kpi-item {
        flex: 1 1 100%;
    }
}


/* ============================================
   TABLES
   ============================================ */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 2rem;
}

.table-container h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--accent);
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-primary);
}

.data-table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.data-table .loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.estado-enviado {
    background: #d1ecf1;
    color: #0c5460;
}

.estado-procesado {
    background: #fff3cd;
    color: #856404;
}

.estado-pendiente {
    background: #f8d7da;
    color: #721c24;
}

.estado-pagado {
    background: #d4edda;
    color: #155724;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-ver {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
}

.btn-ver:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* ============================================
   UPLOAD AREA
   ============================================ */
.instruccion {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #17a2b8;
}

.instruccion code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--accent);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    background: var(--bg-primary);
    margin-bottom: 1.5rem;
}

.btn-subir {
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-subir:hover {
    background: var(--accent-hover);
}

.limite {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lista-archivos {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.archivo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.btn-eliminar-archivo {
    background: var(--danger);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.btn-enviar {
    margin-top: 1.5rem;
    padding: 1rem 3rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.btn-enviar:hover:not(:disabled) {
    background: #38a169;
}

.btn-enviar:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* ============================================
   COMPROBANTES
   ============================================ */
.lista-comprobantes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comprobante-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.comprobante-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-descargar {
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    min-width: 320px;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .logo h1,
    .btn-text {
        display: none;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
}




/* ============================================
   ARCHIVOS DRIVE - VER ADJUNTOS
   ============================================ */
.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.lista-adjuntos {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.archivo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.archivo-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--accent);
}

.archivo-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.archivo-icono {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    flex-shrink: 0;
}

.archivo-detalles {
    flex: 1;
    min-width: 0;
}

.archivo-detalles strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archivo-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.tipo-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tipo-pdf {
    background: #fee2e2;
    color: #dc2626;
}

.tipo-excel {
    background: #d1fae5;
    color: #059669;
}

.tipo-word {
    background: #dbeafe;
    color: #2563eb;
}

.tipo-imagen {
    background: #fef3c7;
    color: #d97706;
}

.tipo-zip {
    background: #f3f4f6;
    color: #6b7280;
}

.tipo-documento {
    background: #e0f2fe;
    color: #0284c7;
}

.archivo-acciones {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-ver-archivo,
.btn-descargar-archivo {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-ver-archivo {
    background: var(--accent);
    color: white;
}

.btn-ver-archivo:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-descargar-archivo {
    background: var(--success);
    color: white;
}

.btn-descargar-archivo:hover {
    background: #38a169;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .archivo-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .archivo-info {
        width: 100%;
    }
    
    .archivo-acciones {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-ver-archivo,
    .btn-descargar-archivo {
        flex: 1;
        justify-content: center;
    }
}


.btn-abrir-carpeta {
    background: #3498db;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-abrir-carpeta:hover {
    background: #2980b9;
}

.tipo-folder {
    background: #3498db;
    color: white;
}



.btn-volver:hover {
    background: #2980b9 !important;
    transform: translateX(-2px);
    transition: all 0.2s;
}



