﻿:root,
[data-theme-mode="light"],
[data-theme-mode="dark"] {
    --primary-rgb: 228, 50, 43 !important;
    --primary-color: rgb(228, 50, 43) !important;
}

/* =========================
   BOTONES
========================= */
.btn-bd-primary {
    --bs-btn-font-weight: 600;
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-border-radius: 0.5rem;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(var(--primary-rgb), 0.9);
    --bs-btn-hover-border-color: rgba(var(--primary-rgb), 0.9);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(var(--primary-rgb), 0.85);
    --bs-btn-active-border-color: rgba(var(--primary-rgb), 0.85);
}


/* =========================
   LOGIN
========================= */
.login-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f6fa;
    overflow: hidden;
}

/* Contenedor para apilar rojo + blanco */
.login-stack {
    position: relative;
}

/* Card rojo detrás */
.login-back {
    position: absolute;
    width: 660px;
    height: 200px;
    background: #e4322b;
    border-radius: 10px;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 15px 40px rgba(0,0,0,.15);
    z-index: 1;
}

/* Card blanco */
.login-box {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    padding: 2rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,.15);
}

.login-logo {
    max-width: 260px;
    width: 100%;
    display: block;
    margin: 0 auto 1rem;
}


/* =========================
   SIDEBAR (YNEX)
========================= */
.app-sidebar,
.main-sidebar,
.sidebar,
[data-menu-styles="dark"],
.app-sidebar .main-sidebar {
    background-color: #263544 !important;
}

.main-sidebar-header {
    background-color: #263544 !important;
}

    .main-sidebar-header a span {
        font-size: 1.4rem;
    }

.brand-text {
    font-size: 1.6rem;
    font-weight: 600;
}


/* =========================
   CARD SISTEMA
========================= */
.card-sistema {
    cursor: pointer;
    transition: transform 0.2s ease;
    align-items: center;
    justify-content: center;
}

    .card-sistema:hover {
        transform: scale(1.03);
    }

.card-sistema-custom:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.card-title:hover {
    align-items:end;
}

/* =========================
   CIRCLE BUTTON
========================= */
.circle-btn {
    background-color: #e4322b;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .circle-btn:hover {
        color: #fff;
        transform: scale(1.1);
    }


/* =========================
   LOADER
========================= */
/* Fondo semi transparente centrado */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    /* Mostrar loader */
    .loader-overlay.show {
        display: flex;
    }

.loader-overlay .spinner-border {
    margin: 0;
}

/* Imagen centrada y en rojo */
.loader-img {
    width: 90px;
    filter: invert(1) brightness(0) saturate(100%) sepia(100%) saturate(8000%) contrast(250%) hue-rotate(355deg);
}

/* =========================
   FONDO MODAL
========================= */
.gray-modal {
    background-color: rgb(var(--body-bg-rgb)) !important;
}

/* =========================
   TABLAS
========================= */
.Selected-Item {
    background-color: #F2F2F2 !important;
}

.scroll-base {
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #c5c5c5 #f8f9fa;
}

.scroll-base::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scroll-base::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.scroll-base::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.scroll-base::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.scroll-y {
    overflow-y: auto;
    overflow-x: hidden;
}

.scroll-x {
    overflow-x: auto;
    overflow-y: hidden;
}

.scroll-both {
    overflow-x: auto;
    overflow-y: hidden;
}

.dataTables_wrapper.scroll-base.scroll-both[style*="max-height"],
.dataTables_wrapper.scroll-base.scroll-y[style*="max-height"] {
    overflow-y: auto;
}

/* ResponsiveDataTable */
.dataTables_wrapper.scroll-base {
    box-sizing: border-box;
    max-width: 100%;
    container-type: inline-size;
    container-name: dt-host;
}

.dataTables_wrapper.scroll-base > .row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.dataTables_wrapper.scroll-base table.dataTable {
    width: 100% !important;
    max-width: 100%;
    margin-bottom: 0;
}

.dataTables_wrapper table.dataTable th.d-none + th,
.dataTables_wrapper table.dataTable td.d-none + td {
    border-left: 1px solid var(--bs-table-border-color, #e9ecef);
}

@container dt-host (min-width: 992px) {
    .dataTables_wrapper.scroll-base {
        overflow-x: visible;
    }

    .dataTables_wrapper.scroll-base table.dataTable {
        table-layout: fixed;
    }

    .dataTables_wrapper.scroll-base table.dataTable th,
    .dataTables_wrapper.scroll-base table.dataTable td {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dataTables_wrapper.scroll-base table.dataTable td:last-child,
    .dataTables_wrapper.scroll-base table.dataTable th:last-child {
        overflow: visible;
        text-overflow: unset;
    }
}

@container dt-host (max-width: 991px) {
    .dataTables_wrapper.scroll-base {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper.scroll-base table.dataTable {
        width: max-content !important;
        min-width: 100%;
        table-layout: auto;
    }

    .dataTables_wrapper.scroll-base table.dataTable th,
    .dataTables_wrapper.scroll-base table.dataTable td {
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
    }
}

@media (min-width: 992px) {
    .dataTables_wrapper.scroll-base {
        overflow-x: visible;
    }

    .dataTables_wrapper.scroll-base table.dataTable {
        table-layout: fixed;
    }

    .dataTables_wrapper.scroll-base table.dataTable th,
    .dataTables_wrapper.scroll-base table.dataTable td {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dataTables_wrapper.scroll-base table.dataTable td:last-child,
    .dataTables_wrapper.scroll-base table.dataTable th:last-child {
        overflow: visible;
        text-overflow: unset;
    }
}

@media (max-width: 991.98px) {
    .dataTables_wrapper.scroll-base {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper.scroll-base table.dataTable {
        width: max-content !important;
        min-width: 100%;
        table-layout: auto;
    }

    .dataTables_wrapper.scroll-base table.dataTable th,
    .dataTables_wrapper.scroll-base table.dataTable td {
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
    }
}

@media (max-width: 767.98px) {
    .dataTables_wrapper.scroll-base {
        overflow-x: visible;
        overflow-y: visible;
    }

    .dataTables_wrapper.scroll-base table.dataTable {
        width: 100% !important;
        min-width: 0;
        border: 0;
    }

    .dataTables_wrapper.scroll-base table.dataTable thead {
        display: none;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--bs-table-border-color, #e9ecef);
        border-radius: 0.375rem;
        background: #fff;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr.even {
        background: #fff;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody td {
        display: grid;
        grid-template-columns: minmax(6.5rem, 38%) 1fr;
        gap: 0.5rem;
        align-items: start;
        padding: 0.5rem 0.75rem;
        border: 0;
        border-bottom: 1px solid var(--bs-table-border-color, #e9ecef);
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        text-align: left;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody td:last-child {
        border-bottom: 0;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody td.d-none {
        display: none !important;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody td::before {
        font-weight: 600;
        font-size: 0.8rem;
        color: #6c757d;
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody td[data-label]::before {
        content: attr(data-label);
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr > td.d-none:first-child + td::before {
        content: "Folio";
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr > td.d-none:first-child + td + td::before {
        content: "Proveedor";
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr > td.d-none:first-child + td + td + td::before {
        content: "Planta";
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr > td.d-none:first-child + td + td + td + td::before {
        content: "Estatus";
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr > td.d-none:first-child + td + td + td + td + td::before {
        content: "Fecha";
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody tr > td.d-none:first-child + td + td + td + td + td + td::before {
        content: "Acciones";
    }

    .dataTables_wrapper.scroll-base table.dataTable tbody td .btn {
        margin-top: 0.15rem;
    }
}

/* =========================
   iFrame
========================= */

.iframe-wrapper {
    height: calc(100vh - 70px);
    overflow: hidden;
}

    .iframe-wrapper iframe {
        width: 100%;
        height: 100%;
        border: 0;
    }

/* =========================
   Editor de Menus
========================= */
.menu-edit-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap; /* 🔥 evita saltos */
}

/* 🔥 ID padre */
.id-input {
    width: 60px;
    min-width: 50px;
    padding: 2px;
    font-size: 11px;
    text-align: center;
}

/* 🔥 icono visual */
.icono {
    width: 20px;
    text-align: center;
}

/* 🔥 input icono */
.icon-input {
    width: 140px;
    font-size: 11px;
    padding: 2px;
}

/* 🔥 texto fijo */
.text-label {
    min-width: 180px;
    font-size: 12px;
}

/* 🔥 input texto */
.text-input {
    flex-grow: 1;
    font-size: 12px;
    padding: 2px 6px;
}

/* =========================
   Custom Cards
========================= */
.card-fullscreen-custom {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1055;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column; /* 🔥 clave */
}

    .card-fullscreen-custom .card-body {
        flex: 1; /* 🔥 ocupa el espacio restante */
        overflow: auto;
    }
    .card-fullscreen-custom .apexcharts-canvas {
        height: 100% !important;
    }

/* =========================
   Custom Choices
========================= */
.choices__inner {
    min-height: 35px !important;
    height: 35px;
    padding: 6px 12px !important;
    display: flex;
    align-items: center;
}

.choices__list--single .choices__item {
    line-height: 1.5;
}

