/* Sistema Comida - Estilos Principales */

/* Reset y Base */
body {
    background: #f5f6fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar */
.left-sidebar {
    background: #1e2130 !important;
    width: 240px;
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    z-index: 1020;
    box-shadow: 3px 0 10px rgba(0,0,0,0.2);
    transition: transform 0.28s ease;
}

.left-sidebar::-webkit-scrollbar { width: 4px; }
.left-sidebar::-webkit-scrollbar-track { background: #1e2130; }
.left-sidebar::-webkit-scrollbar-thumb { background: #495057; border-radius: 2px; }

.sidebar-link {
    padding: 10px 16px;
    border-radius: 8px;
    margin: 2px 8px;
    color: #adb5bd !important;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none !important;
    display: flex;
    align-items: center;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: #fff !important;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Page wrapper */
.page-wrapper {
    margin-left: 240px;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    padding: 20px;
}

/* Cards */
.card {
    border-radius: 12px !important;
    border: none !important;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Botones */
.btn {
    border-radius: 8px !important;
    font-weight: 500;
}

.btn-block {
    border-radius: 8px !important;
}

/* Tablas */
.table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
}

.table td {
    vertical-align: middle;
    font-size: 13px;
    padding: 8px 12px;
}

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

/* Forms */
.form-control {
    border-radius: 8px !important;
    border: 1.5px solid #dee2e6;
    font-size: 14px;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.15rem rgba(0,123,255,0.2);
}

/* Badges */
.badge {
    border-radius: 6px !important;
    font-size: 11px;
    padding: 4px 8px;
}

/* Alertas */
.alert {
    border-radius: 10px !important;
    border: none;
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menú activo según URL */
.sidebar-item.active > .sidebar-link {
    background: rgba(0,123,255,0.2) !important;
    color: #fff !important;
    border-left: 3px solid #007bff;
}

/* Responsive */
@media (max-width: 767px) {
    .left-sidebar {
        transform: translateX(-260px) !important;
        width: 260px !important;
        z-index: 1025 !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    .left-sidebar.sidebar-open {
        transform: translateX(0) !important;
    }
    .page-wrapper {
        margin-left: 0 !important;
        padding: 10px;
    }
}

@media (min-width: 768px) {
    .left-sidebar.sidebar-hidden {
        transform: translateX(-240px);
    }
    .page-wrapper.sidebar-hidden {
        margin-left: 0;
    }
}

/* Modal */
.modal-content {
    border-radius: 16px !important;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-radius: 16px 16px 0 0 !important;
}

/* Select2 */
.select2-container--default .select2-selection--single {
    border: 1.5px solid #dee2e6 !important;
    border-radius: 8px !important;
    height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    color: #495057 !important;
}

/* Toast / Notificaciones */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
}

/* Colores de estado */
.estado-a { color: #28a745; }
.estado-c { color: #6c757d; }
.estado-x { color: #dc3545; }

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personalizado */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* btn-xs — Bootstrap 4 doesn't include this size */
.btn-xs {
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 3px;
}

/* Prevent action button cells from wrapping */
td.td-acciones, .td-nowrap { white-space: nowrap; }
