/* =============================================================
   SIMPLEX — CSS Bridge + App Styles
   Reemplaza Metronic style.bundle.css con clases equivalentes.
   Bootstrap 5 se carga vía CDN y cubre grid/utilities/modals.
   ============================================================= */

/* ---------- Fuente base ---------- */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    font-size: 0.9rem;
}

/* ---------- Layout Shell ---------- */
#sidebar {
    scrollbar-width: thin;
    scrollbar-color: #334155 #1e293b;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: #1e293b; }
#sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.sidebar-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Transición suave del sidebar en mobile */
@media (max-width: 1023px) {
    #sidebar { transition: transform 0.25s ease; }
    #sidebar.open { transform: translateX(0) !important; }
}

/* Active menu item */
.menu-link-active {
    color: #60a5fa !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Submenu chevron rotate */
.menu-group[data-open="true"] .menu-chevron {
    transform: rotate(90deg);
}

/* ---------- Cards (Bootstrap .card ya existe, estos son overrides) ---------- */
.card {
    border: none;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
    border-radius: 0.625rem;
}
.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
}

/* ---------- Formularios "solid" (Metronic pattern) ---------- */
.form-control-solid,
.form-select-solid {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
    transition: border-color 0.15s ease;
}
.form-control-solid:focus,
.form-select-solid:focus {
    background-color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-control-solid::placeholder { color: #94a3b8; }

/* ---------- Symbol / Avatar ---------- */
.symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.symbol img {
    border-radius: 50%;
    object-fit: cover;
    width: 100%;
    height: 100%;
}
.symbol-25px  { width: 25px;  height: 25px; }
.symbol-30px  { width: 30px;  height: 30px; }
.symbol-35px  { width: 35px;  height: 35px; }
.symbol-40px  { width: 40px;  height: 40px; }
.symbol-45px  { width: 45px;  height: 45px; }
.symbol-50px  { width: 50px;  height: 50px; }
.symbol-60px  { width: 60px;  height: 60px; }
.symbol-md-40px { width: 40px; height: 40px; }

/* ---------- Soft Badges (Metronic badge-light-*) ---------- */
.badge-light-primary { background-color: #dbeafe; color: #1d4ed8; }
.badge-light-success { background-color: #dcfce7; color: #15803d; }
.badge-light-warning { background-color: #fef9c3; color: #a16207; }
.badge-light-danger  { background-color: #fee2e2; color: #b91c1c; }
.badge-light-info    { background-color: #e0f2fe; color: #0369a1; }
.badge-light-dark    { background-color: #f1f5f9; color: #334155; }
.badge-light-muted   { background-color: #f8fafc; color: #64748b; }

/* ---------- Separator ---------- */
.separator {
    display: block;
    height: 1px;
    background-color: #f1f5f9;
    border: none;
    margin: 0.5rem 0;
}

/* ---------- Required field marker ---------- */
.required::after {
    content: " *";
    color: #ef4444;
}

/* ---------- Button loading state ---------- */
.indicator-progress { display: none; }
.loading .indicator-label  { display: none; }
.loading .indicator-progress { display: inline-flex; align-items: center; gap: 0.5rem; }

/* ---------- Scroll helpers ---------- */
.scroll-y { overflow-y: auto; }
.hover-scroll-y:hover { overflow-y: auto; }

/* ---------- Text helpers (Metronic) ---------- */
.text-gray-400 { color: #94a3b8 !important; }
.text-gray-500 { color: #64748b !important; }
.text-gray-600 { color: #475569 !important; }
.text-gray-700 { color: #334155 !important; }
.text-gray-800 { color: #1e293b !important; }
.text-gray-900 { color: #0f172a !important; }
.text-hover-primary:hover { color: #3b82f6 !important; }

/* ---------- Min Width helpers ---------- */
.mw-650px { max-width: 650px; }
.mw-400px { max-width: 400px; }

/* ---------- Toolbar (Me::generateToolbar) ---------- */
.app-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.app-toolbar-title { font-size: 1.125rem; font-weight: 700; color: #1e293b; margin: 0; }
.app-breadcrumb { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8rem; color: #94a3b8; flex-wrap: wrap; }
.app-breadcrumb a { color: #64748b; text-decoration: none; }
.app-breadcrumb a:hover { color: #3b82f6; }
.app-breadcrumb-separator::after { content: "/"; margin: 0 0.25rem; color: #cbd5e1; }

/* ---------- GetAlert toasts ---------- */
.app-alert {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 280px;
}

/* ---------- Modals: override btn-active-color-* ---------- */
.btn-active-color-primary:hover,
.btn-active-color-primary:focus { color: #3b82f6 !important; }
.btn-sm.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 0.375rem;
    color: #64748b;
}
.btn-sm.btn-icon:hover { background: #f1f5f9; color: #1e293b; }

/* ---------- fv-row (metronic form validation row) ---------- */
.fv-row { margin-bottom: 1rem; }

/* ---------- Custom badges (status del paquete) ---------- */
.custom-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
.custom-badge.received      { background-color: #3498db; color: #fff; }
.custom-badge.packed        { background-color: #27ae60; color: #fff; }
.custom-badge.shipped       { background-color: #f39c12; color: #fff; }
.custom-badge.delivered     { background-color: #2ecc71; color: #fff; }
.custom-badge.transferred   { background-color: #9b59b6; color: #fff; }
.custom-badge.zone-received { background-color: #e74c3c; color: #fff; }
.custom-badge.agency-transferred { background-color: #f19e0f; color: #fff; }
.custom-badge.branch-received    { background-color: #34495e; color: #fff; }
.custom-badge.invoiced      { background-color: #e67e22; color: #fff; }
.custom-badge.ready-for-delivery { background-color: #95a5a6; color: #fff; }

/* ---------- DataTables override ---------- */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: #3b82f6; }
.dataTables_wrapper select {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.3rem 0.5rem;
}

/* ---------- Print ---------- */
@media print {
    #sidebar, header, footer { display: none !important; }
    main { padding-left: 0 !important; padding-top: 0 !important; }
}

/* =============================================================
   PÁGINAS DE AUTENTICACIÓN (sign-in, sign-up, etc.)
   ============================================================= */
.auth-bg {
    min-height: 100vh;
    background-color: #f8fafc;
}
.flex-root {
    display: flex;
    flex: 1 1 auto;
    min-height: 100vh;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-column-fluid { flex: 1 1 auto; }
.flex-lg-row-fluid { flex: 1 1 auto; }

/* Background image helpers (Metronic bgi-*) */
.bgi-size-cover   { background-size: cover; }
.bgi-position-center { background-position: center; }
.bgi-no-repeat    { background-repeat: no-repeat; }

/* Width helpers */
.w-lg-500px { max-width: 500px; }
.w-lg-550px { max-width: 550px; }
@media (min-width: 992px) {
    .w-lg-50 { width: 50%; }
    .order-lg-1 { order: 1; }
    .order-lg-2 { order: 2; }
    .flex-lg-row { flex-direction: row !important; }
    .flex-lg-row-fluid { flex: 1 1 0%; }
    .flex-lg-row-fluid.w-lg-50 { width: 50%; flex: none; }
    .p-lg-20 { padding: 5rem !important; }
    .py-lg-15 { padding-top: 3.75rem !important; padding-bottom: 3.75rem !important; }
    .px-lg-10 { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }
}

/* fs-* helpers (Metronic font sizes) */
.fs-2qx { font-size: 2.25rem; }
.fs-base { font-size: 0.925rem; }
.link-primary { color: #3b82f6; text-decoration: none; }
.link-primary:hover { color: #1d4ed8; text-decoration: underline; }
