* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

:root {
    --bg-dark: #f0f2f5;
    --bg-darker: #ffffff;
    --text-light: #1a1b1e;
    --text-gray: #4b5563;
    --primary-blue: #3b82f6;
    --accent-dark: #2563eb;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e5e9f2 100%);
    min-height: 100vh;
}

/* Header styles */
header {
    background-color: var(--bg-darker);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

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

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo {
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-bar input {
    padding: 0.8rem;
    border: none;
    border-radius: 20px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

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

.logout-button {
    background-color: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

#userName {
    font-weight: 500;
    color: var(--text-light);
}

/* Main container */
.admin-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem 70px 1rem;
}

/* Section styles */
.admin-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 2rem;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.admin-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
}

.section-title i {
    color: var(--primary-blue);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-icon.total {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
}

.stat-icon.entregados {
    background: linear-gradient(135deg, var(--success-green), #059669);
}

.stat-icon.pendientes {
    background: linear-gradient(135deg, var(--warning-orange), #d97706);
}

.stat-icon.porcentaje {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Filtros */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filters-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.filter-item select {
    padding: 0.6rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-item select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.actions-group {
    display: flex;
    gap: 10px;
}

.btn-action {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn-action:hover {
    background: var(--accent-dark);
    box-shadow: 0 6px 10px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Albaranes Container */
.albaranes-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.albaran-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.albaran-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.albaran-card.entregado {
    border-left-color: var(--success-green);
}

.albaran-card.pendiente {
    border-left-color: var(--warning-orange);
}

.albaran-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.albaran-numero {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.albaran-numero i {
    color: var(--primary-blue);
}

.albaran-status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.albaran-status.entregado {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.albaran-status.pendiente {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-orange);
}

.albaran-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.albaran-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    font-weight: 600;
}

.info-value {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.albaran-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.albaran-fecha {
    font-size: 0.85rem;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.albaran-actions {
    display: flex;
    gap: 8px;
}

.btn-toggle {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-entregar:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-pendiente {
    background: var(--warning-orange);
    color: white;
}

.btn-pendiente:hover {
    background: #d97706;
    transform: scale(1.05);
}

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

.btn-delete:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1rem;
}

/* Navigation bar */
.navigation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-item {
    color: var(--text-gray);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-blue);
}

.nav-item i {
    font-size: 1.5em;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
        height: auto;
        flex-direction: column;
        gap: 0.5rem;
    }

    .logo-container {
        width: 100%;
        justify-content: center;
    }

    .logo-image {
        height: 30px;
    }

    .logo {
        font-size: 1rem;
    }

    .search-bar {
        width: 100%;
        margin: 0.5rem 0;
    }

    .admin-container {
        margin: 1rem auto;
    }

    .admin-section {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-group {
        flex-direction: column;
    }

    .filter-item select {
        width: 100%;
        min-width: auto;
    }

    .actions-group {
        width: 100%;
    }

    .btn-action {
        flex: 1;
        justify-content: center;
    }

    .albaran-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .albaran-body {
        grid-template-columns: 1fr;
    }

    .albaran-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .albaran-actions {
        width: 100%;
        justify-content: stretch;
    }

    .btn-toggle {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}
.badge-regenerado {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.albaran-fechas {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.albaran-fecha {
    font-size: 0.85rem;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.fecha-label {
    font-weight: 600;
    color: var(--text-light);
}

.fecha-actualizacion {
    color: #8b5cf6;
}

.fecha-actualizacion i {
    color: #8b5cf6;
}

@media (max-width: 768px) {
    .albaran-fechas {
        width: 100%;
    }
    
    .badge-regenerado {
        margin-left: 0;
        margin-top: 5px;
    }
}