/**
 * Estilos Personalizados
 * Sistema de Control de Ventas e Inventario - Quesadillas
 */

:root {
    --primary-color: #e65100;
    --primary-dark: #bf360c;
    --primary-light: #ff9800;
    --secondary-color: #424242;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background-color: #f5f7fa;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 18px;
}

.sidebar-header i {
    margin-right: 8px;
}

.sidebar .nav {
    padding: 15px 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    margin: 2px 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.sidebar .nav-link i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 5px;
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.top-header {
    background: white;
    padding: 15px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-content {
    padding: 25px;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--secondary-color);
    padding: 8px 15px;
    border-radius: 10px;
    transition: all 0.3s;
}

.user-dropdown .dropdown-toggle:hover {
    background: #f5f5f5;
}

.user-dropdown .dropdown-toggle::after {
    margin-left: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 10px;
}

.user-info {
    text-align: left;
}

.user-info .user-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.user-info .user-role {
    font-size: 12px;
    color: #888;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0 !important;
}

.card-header .card-title {
    color: var(--secondary-color);
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card {
    border-radius: 15px;
    overflow: hidden;
}

.stat-card .card-body {
    padding: 25px;
}

.stat-card .stat-icon {
    font-size: 48px;
    opacity: 0.3;
}

.stat-card .card-subtitle {
    font-size: 13px;
    font-weight: 500;
}

.stat-card .card-title {
    font-size: 28px;
    font-weight: 700;
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    padding: 12px 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: 10px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(230, 81, 0, 0.15);
}

.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.input-group-text {
    border-radius: 10px 0 0 10px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-right: none;
}

.input-group .form-control {
    border-radius: 0 10px 10px 0;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 16px;
}

/* ===== BADGES ===== */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
}

/* ===== MODAL ===== */
.modal-content {
    border: none;
    border-radius: 15px;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 25px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 15px 25px;
}

/* ===== POS/VENTAS ===== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.menu-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(230, 81, 0, 0.15);
}

.menu-item.selected {
    border-color: var(--primary-color);
    background: rgba(230, 81, 0, 0.05);
}

.menu-item .item-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.menu-item .item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 18px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-total {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.cart-total .total-label {
    font-size: 14px;
    color: #666;
}

.cart-total .total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid #f0f0f0;
}

/* ===== SIDEBAR TOGGLE BUTTON ===== */
#sidebarToggle {
    border: none;
    background: transparent;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebarToggle:hover {
    background: #f0f0f0;
    border-radius: 8px;
}

#sidebarToggle:focus {
    box-shadow: none;
    outline: none;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
    
    #sidebarToggle {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    .sidebar-overlay {
        display: none;
    }
}

/* ===== UTILITIES ===== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-action-btn {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    color: white;
}

.quick-action-btn i {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.quick-action-btn span {
    font-weight: 600;
}

/* Quantity Input */
.quantity-input {
    display: flex;
    align-items: center;
}

.quantity-input button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-input button:hover {
    background: var(--primary-dark);
}

.quantity-input input {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 16px;
}

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #666;
}
