/* ── Brand override for Bootstrap 5 ── */
:root {
    --bs-primary:         #AD0E0B;
    --bs-primary-rgb:     173, 14, 11;
    --bs-link-color:      #AD0E0B;
    --bs-link-hover-color:#8A0B09;
    --sidebar-bg:         #1e293b;
    --sidebar-w:          260px;
    --topbar-h:           60px;
}

/* ── Button primary ── */
.btn-primary {
    --bs-btn-bg:                 #AD0E0B;
    --bs-btn-border-color:       #AD0E0B;
    --bs-btn-hover-bg:           #8A0B09;
    --bs-btn-hover-border-color: #8A0B09;
    --bs-btn-active-bg:          #6D0907;
    --bs-btn-focus-shadow-rgb:   173,14,11;
}
.btn-outline-primary {
    --bs-btn-color:              #AD0E0B;
    --bs-btn-border-color:       #AD0E0B;
    --bs-btn-hover-bg:           #AD0E0B;
    --bs-btn-hover-border-color: #AD0E0B;
}
.text-primary   { color: #AD0E0B !important; }
.bg-primary     { background-color: #AD0E0B !important; }
.border-primary { border-color: #AD0E0B !important; }
a { color: #AD0E0B; }
a:hover { color: #8A0B09; }

/* ── Sidebar ── */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-w);
    height: 100vh; background: var(--sidebar-bg);
    display: flex; flex-direction: column; z-index: 1035;
    overflow-y: auto;
}
.sidebar-logo {
    padding: 20px; border-bottom: 1px solid rgba(255,255,255,.07);
    text-align: center;
}
.sidebar-logo img { max-height: 42px; object-fit: contain; }
.sidebar-logo span {
    display: block; font-size: 11px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: rgba(255,255,255,.4); margin-top: 8px;
}
.sidebar-section {
    padding: 18px 18px 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
    text-transform: uppercase; color: rgba(255,255,255,.3);
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 20px; color: rgba(255,255,255,.65);
    font-size: 14px; font-weight: 500;
    text-decoration: none; border-left: 3px solid transparent;
    transition: all .18s ease;
}
.sidebar-link i { font-size: 17px; width: 20px; }
.sidebar-link:hover  { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-link.active { color: #fff; background: rgba(173,14,11,.25); border-left-color: #AD0E0B; }
.sidebar-footer {
    padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.07);
    font-size: 11px; color: rgba(255,255,255,.25);
}

/* ── Main wrapper ── */
@media (min-width: 992px) { .main-wrapper { margin-left: var(--sidebar-w); } }

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h); background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
}

/* ── Cards ── */
.card { border: none; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.card-hover {
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.10) !important;
}

/* ── KPI cards ── */
.kpi-card { border-radius: 14px; overflow: hidden; position: relative; }
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    right: 0; height: 4px;
}
.kpi-red::before    { background: linear-gradient(90deg,#AD0E0B,#ff4d4f); }
.kpi-blue::before   { background: linear-gradient(90deg,#0d6efd,#6ea8fe); }
.kpi-green::before  { background: linear-gradient(90deg,#198754,#75b798); }
.kpi-orange::before { background: linear-gradient(90deg,#fd7e14,#ffda6a); }
.kpi-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}

/* ── Product cards ── */
.product-card {
    border-radius: 12px; border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s ease, box-shadow .2s ease;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,.11) !important;
}
.product-price { font-size: 1.35rem; font-weight: 700; color: #AD0E0B; }
.product-code  { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; }

/* ── Status badges ── */
.badge-PENDIENTE  { background: #fef3cd; color: #856404 !important; }
.badge-PROCESADO  { background: #cff4fc; color: #055160 !important; }
.badge-SURTIDO    { background: #d1e7dd; color: #0f5132 !important; }
.badge-ERROR      { background: #f8d7da; color: #842029 !important; }
.badge-status { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }

/* ── Table ── */
.table-hover tbody tr { transition: background .12s; }
.table thead th { font-size: 11px; font-weight: 700; text-transform: uppercase;
                  letter-spacing: .5px; color: #6c757d; border-bottom: 2px solid #e9ecef; }

/* ── Cart ── */
.qty-control { display: inline-flex; align-items: center; gap: 0; }
.qty-control input {
    width: 56px; text-align: center; border-left: 0; border-right: 0;
    border-radius: 0; padding: 4px 0; font-weight: 600;
}
.qty-control .btn { padding: 4px 10px; line-height: 1.4; }

/* ── Pagination ── */
.page-link { color: #AD0E0B; border-color: #dee2e6; }
.page-link:hover { color: #8A0B09; background: #f8f9fa; }
.page-item.active .page-link { background: #AD0E0B; border-color: #AD0E0B; }

/* ── Auth page ── */
.auth-wrapper {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2d0b0a 0%, #AD0E0B 50%, #1e293b 100%);
    padding: 20px;
}
.auth-card {
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-width: 420px; width: 100%;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .35s ease both; }
.animate-in-delay-1 { animation-delay: .06s; }
.animate-in-delay-2 { animation-delay: .12s; }
.animate-in-delay-3 { animation-delay: .18s; }
.animate-in-delay-4 { animation-delay: .24s; }

/* ── Misc ── */
.empty-state { text-align: center; padding: 60px 20px; color: #adb5bd; }
.empty-state i { font-size: 52px; display: block; margin-bottom: 16px; }
.form-control:focus, .form-select:focus {
    border-color: #AD0E0B;
    box-shadow: 0 0 0 .2rem rgba(173,14,11,.15);
}
.catalog-filters-card { position: sticky; top: 76px; }
.sidebar-link.active i { color: #ff6b6b; }

/* ── Movil layout ── */
.movil-header {
    position: sticky; top: 0; z-index: 1020;
    background: var(--sidebar-bg);
    height: 56px; padding: 0 12px 0 8px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.movil-header-logo img { height: 32px; object-fit: contain; border-radius: 4px; }
.movil-header-title {
    font-size: 12px; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; color: rgba(255,255,255,.55);
    text-align: center; flex: 1; padding: 0 8px;
}
.movil-header-title strong { display: block; font-size: 13px; color: #fff; letter-spacing: .3px; }
.movil-main {
    padding: 16px;
    min-height: calc(100vh - 56px);
    background: #f1f5f9;
}
.movil-kpi {
    border-radius: 14px; padding: 16px;
    background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.07);
    display: flex; align-items: center; gap: 12px;
}
.movil-kpi-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.movil-kpi-val { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.movil-kpi-lbl { font-size: 11px; color: #6c757d; margin-top: 2px; }

/* ── Movil offcanvas menu ── */
.movil-offcanvas {
    background: var(--sidebar-bg);
    width: 260px;
}
.movil-offcanvas .offcanvas-header { background: var(--sidebar-bg); }
.movil-offcanvas-nav {
    display: flex; flex-direction: column; padding: 8px 0;
}
.movil-offcanvas-link {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 20px; color: rgba(255,255,255,.65);
    font-size: 14px; font-weight: 500;
    text-decoration: none; border-left: 3px solid transparent;
    transition: all .18s ease;
}
.movil-offcanvas-link i { font-size: 18px; width: 20px; }
.movil-offcanvas-link:hover  { color: #fff; background: rgba(255,255,255,.06); }
.movil-offcanvas-link.active { color: #fff; background: rgba(173,14,11,.25); border-left-color: #AD0E0B; }
.offcanvas-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 8px 0;
}

/* ── Movil header (updated) ── */
.movil-menu-btn {
    background: none; border: none; padding: 6px 8px;
    color: rgba(255,255,255,.8); font-size: 24px; line-height: 1;
    cursor: pointer; border-radius: 8px;
    transition: background .15s ease;
}
.movil-menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
