/* Import modern typography from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* CSS Variables for Premium Light Design System */
:root {
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Clean Light Palette */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: #ffffff;
    --bg-glass-hover: #f1f5f9;
    
    /* Accents (Delifast Branding: Vibrant Red & Dark Coral) */
    --primary: #dc2626;
    --primary-hover: #b91c1c;
    --primary-glow: rgba(220, 38, 38, 0.15);
    --accent: #e11d48;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fca5a5;
    
    /* Borders & Shadows */
    --border-glass: #e2e8f0;
    --border-glass-focus: #dc2626;
    --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.1);
    
    /* Transitions */
    --transition-smooth: all 0.2s ease-in-out;
}

/* Base resets & setups */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Auth Screens */
.auth-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 1;
}

.auth-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.auth-card:hover {
    box-shadow: var(--shadow-premium), var(--shadow-glow);
}

.brand-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-logo {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0f172a 40%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    text-align: center;
}

.brand-logo span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.brand-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Alert Boxes */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
    animation: slideDown 0.2s ease;
}

.alert-danger {
    background-color: var(--error-bg);
    border-color: var(--error-border);
    color: #b91c1c;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: var(--success-border);
    color: #047857;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #64748b !important;
    margin-bottom: 0.35rem !important;
}

.form-control-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-control-wrapper svg {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    outline: none;
}


.form-control-wrapper .form-control {
    padding-left: 2.8rem;
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-control:focus + svg {
    color: var(--primary);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
}

/* Buttons styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 61, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(255, 61, 0, 0.3);
}

/* HostFlow Coral/Red Filter Button */
.btn-filter {
    background: #f87171 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.55rem 1.25rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2) !important;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-filter:hover {
    background: #ef4444 !important;
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-1px);
}

/* HostFlow Green New Button */
.btn-new {
    background: #22c55e !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.55rem 1.25rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2) !important;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-new:hover {
    background: #16a34a !important;
    box-shadow: 0 6px 15px rgba(22, 163, 74, 0.3) !important;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.btn-detail {
    background: rgba(255, 122, 0, 0.08);
    color: var(--primary);
    border: 1px solid rgba(255, 122, 0, 0.15);
}

.btn-detail:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-justo {
    background: rgba(255, 61, 0, 0.08);
    color: #e04f26;
    border: 1px solid rgba(255, 61, 0, 0.15);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}

.btn-justo:hover {
    background: #ff5c33;
    color: #fff;
}

/* Nav & Grid Layout for Admin Panel */
.dashboard-layout {
    display: flex;
    flex: 1;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    z-index: 1;
}

/* Global Top Navigation Bar */
.nav-bar {
    display: none !important; /* Ocultado para lograr el layout de barra lateral a pantalla completa */
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--bg-primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.btn-logout {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fca5a5;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: translateY(-1px);
}

/* Vertical Sidebar - HostFlow Styled Dark Sidebar */
.main-sidebar {
    width: 260px;
    background: #0f172a; /* Fondo dark navy */
    border-right: 1px solid #1e293b;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 500;
    height: 100vh;
    height: 100dvh;
    overflow: hidden; /* el scroll va dentro del menu-wrapper */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: sticky;
    top: 0;
}

.main-sidebar.collapsed {
    width: 0 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    overflow: hidden !important;
    border-right: none !important;
}

.sidebar-menu-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Necesario para que flex + overflow funcionen */
    /* Scrollbar sutil */
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.sidebar-menu-wrapper::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.sidebar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    padding: 0.5rem 1.1rem;
    color: #ffffff; /* Texto blanco logo */
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand span {
    color: var(--primary);
}

.btn-sidebar-collapse {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.btn-sidebar-collapse:hover {
    color: #ffffff;
    background: #1e293b;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu li.active::before {
    display: none; /* Sin línea lateral, estilo HostFlow pill */
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    color: #94a3b8; /* Texto gris de navegación */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.sidebar-menu li a svg {
    color: #94a3b8;
    transition: var(--transition-smooth);
}

.sidebar-menu li:hover a,
.sidebar-menu li.active a {
    color: #ffffff;
    background: #1e293b; /* Fondo de selección slate-800 */
}

.sidebar-menu li:hover a svg,
.sidebar-menu li.active a svg {
    color: #ffffff;
}

.sidebar-menu li.active a {
    font-weight: 600;
}

.sidebar-menu li.disabled a {
    opacity: 0.3;
    cursor: not-allowed;
}

.sidebar-group-header {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b; /* slate-500 */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.5rem 1.1rem 0.5rem;
    list-style: none;
}

/* Bottom Profile Panel in Sidebar */
.sidebar-profile-box {
    border-top: 1px solid #1e293b;
    padding-top: 1.5rem;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid #1e293b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #ffffff; /* Nombre blanco */
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #94a3b8;
}

.btn-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    transition: var(--transition-smooth);
}

.btn-sidebar-logout:hover {
    color: #ef4444;
}

/* Floating Expand menu button */
.sidebar-open-floating {
    position: fixed;
    left: 20px;
    top: 20px;
    z-index: 450;
    background: #ffffff;
    color: var(--primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.sidebar-open-floating:hover {
    background: var(--primary);
    color: #ffffff;
    transform: scale(1.05);
}

body.sidebar-collapsed .sidebar-open-floating {
    display: flex;
}

@media (max-width: 1024px) {
    .btn-sidebar-collapse {
        display: none !important;
    }
    .sidebar-open-floating {
        display: none !important;
    }
}

/* HostFlow Styled Content Header Row */
.content-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-premium);
    flex-wrap: wrap;
    gap: 1.25rem;
}

.content-header-row h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.content-header-row .header-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.content-header-row .header-filters select.form-control,
.content-header-row .header-filters input.form-control {
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    min-width: 140px;
    height: 38px;
}

.content-header-row .header-filters button {
    height: 38px;
    padding: 0 1.25rem;
    font-size: 0.88rem;
    border-radius: 8px;
}

/* Table styling */
.table-container {
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-premium);
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th, 
.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.custom-table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr {
    transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
    background: #f8fafc;
}

.table-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-glass);
    background: #f1f5f9;
}

.badge-id {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Styled Standard Toggles */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Modals glassmorphic & transitions */
.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
    transform: translate(0, -30px);
}

.modal.show .modal-dialog {
    transform: none;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
    max-width: 700px;
}

.modal-dialog-large {
    max-width: 950px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    outline: 0;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 600;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.close:hover {
    color: var(--error);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
}

/* Tabs Styling inside Detail Modals */
.nav-tabs-custom {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-tabs {
    display: flex;
    list-style: none;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}

.nav-tabs li a {
    display: block;
    padding: 0.75rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition-smooth);
}

.nav-tabs li.active a {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: block;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Custom Grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

.col-md-8 {
    flex: 0 0 66.6666%;
    max-width: 66.6666%;
    padding: 0 0.75rem;
}

.col-md-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
    padding: 0 0.75rem;
}

/* Dashboard statistics styling */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.filter-group select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.65rem 2.2rem 0.65rem 1rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1em;
}

/* Map Rounded Container */
.map {
    height: 250px;
    width: 100%;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
}

/* Alerts and Banners */
.no-records {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.main-footer {
    text-align: center;
    margin-top: auto;
    padding: 2rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-glass);
}

/* Paginación Premium Global */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-pills {
    display: flex;
    gap: 0.35rem;
}

.pagination-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.pagination-pill.active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.pagination-pill:hover:not(.active) {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary);
}

/* Tabla Premium Global */
table.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

table.premium-table th {
    padding: 1rem;
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid #edf2f7;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: var(--transition-smooth);
}

table.premium-table th:hover {
    color: var(--primary);
    background-color: #f1f5f9;
}

table.premium-table td {
    padding: 1rem;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
    color: #334155;
    line-height: 1.5;
}

table.premium-table tr:hover {
    background-color: #f8fafc;
}

/* Badges de Estado del Pedido */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-pending { background-color: #fef3c7; color: #d97706; }
.badge-confirmed { background-color: #e0f2fe; color: #0284c7; }
.badge-preparing { background-color: #e0e7ff; color: #4f46e5; }
.badge-delivered { background-color: #d1fae5; color: #059669; }
.badge-canceled { background-color: #fee2e2; color: #dc2626; }

/* Media Queries Responsivos Globales y Drawer de Navegación */
.btn-outline {
    background: transparent !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 8px !important;
    font-weight: 600;
}
.btn-outline:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: var(--shadow-glow) !important;
}

.table-responsive table.premium-table,
.table-responsive table.custom-table,
.table-container table.premium-table,
.table-container table.custom-table {
    min-width: 950px;
}

/* Mobile responsive drawer styling */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #0f172a;
    color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-menu-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: var(--transition-smooth);
}

.btn-menu-toggle:hover {
    color: var(--primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 990;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }
    
    .main-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100% !important;
        max-height: 100% !important;
        z-index: 1000 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* scroll va dentro del menu-wrapper */
    }
    
    .main-sidebar.open {
        left: 0 !important;
    }
    
    .main-content {
        margin-top: 60px !important;
        padding: 1.25rem !important;
        padding-top: 2rem !important;
    }
    
    .dashboard-layout {
        flex-direction: row !important;
    }
    
    .sidebar-profile-box {
        flex-shrink: 0 !important; /* nunca se comprime, siempre visible */
        border-top: 1px solid #1e293b;
        padding-top: 1rem;
    }
}

@media (max-width: 768px) {
    .content-header-row {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 1.25rem !important;
    }
    .content-header-row .header-filters {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }
    .content-header-row .header-filters select.form-control,
    .content-header-row .header-filters input.form-control,
    .content-header-row .header-filters button {
        width: 100% !important;
        min-width: 100% !important;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch !important;
    }
    .filter-group {
        width: 100%;
    }
    .filter-group select,
    .filter-group input,
    .filter-group button {
        width: 100% !important;
        min-width: 100% !important;
    }
    .filter-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Searchable Select Dropdown */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: var(--shadow-premium);
    display: none;
}

.searchable-select-dropdown.show {
    display: block;
}

.searchable-select-option {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.searchable-select-option:hover {
    background-color: var(--bg-glass-hover);
    color: var(--primary);
}

.searchable-select-option.selected {
    background-color: rgba(255, 122, 0, 0.08);
    color: var(--primary);
    font-weight: 600;
}

.searchable-select-no-results {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

