:root {
    --sidebar-width: 250px;
    --primary: #4e73df;
    --success: #1cc88a;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --dark: #1a1a2e;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fc;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, #224abe 100%);
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand i {
    font-size: 1.8rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    gap: 10px;
}

.nav-item:hover,
.nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left: 4px solid var(--primary);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.user-info i {
    font-size: 1.5rem;
}

.user-info div {
    display: flex;
    flex-direction: column;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-weight: 600;
    color: var(--dark);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-card:nth-child(2) { border-left-color: var(--success); }
.stat-card:nth-child(3) { border-left-color: var(--warning); }
.stat-card:nth-child(4) { border-left-color: var(--danger); }

.stat-info h3 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    color: var(--dark);
}

.stat-info p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.2;
}

/* Tables */
.table {
    margin: 0;
}

.table thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
    border: none;
    padding: 0.8rem;
}

.table tbody td {
    padding: 0.8rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #f8f9fc;
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
}

/* Buttons */
.btn-icon {
    padding: 0.3rem 0.5rem;
    line-height: 1;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--dark);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(78,115,223,0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile toggle button */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* Estilos adicionales para imágenes */
.img-thumbnail {
    border-radius: 8px;
    padding: 2px;
    background: #f8f9fa;
}

#previewImagen {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 4px;
    transition: all 0.3s;
}

#previewImagen:hover {
    border-color: var(--primary);
}

#placeholderImagen {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

#placeholderImagen:hover {
    border-color: var(--primary);
    background: #e8f0fe;
}

/* Spinner en botón */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 5px;
}

/* Estilos para el módulo de pedidos */
.btn-group .btn {
    padding: 0.25rem 0.5rem;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: #f8f9fc;
}

/* Badges de estado más grandes */
.badge.fs-6 {
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem;
}

/* Cards de estadísticas */
.card.bg-primary,
.card.bg-warning,
.card.bg-info,
.card.bg-success,
.card.bg-secondary,
.card.bg-dark {
    border: none;
    border-radius: 10px;
}

.card.bg-warning .card-body small {
    color: #664d03 !important;
    font-weight: 600;
}

/* Tabla de detalle */
.table tfoot tr {
    border-top: 2px solid var(--primary);
}

/* Responsive para tabla de pedidos */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
}