.breadcrumb {
    background-color: white !important;
    padding: 5px 20px !important;
    margin-bottom: 0;
    list-style: none;
    border: 1px solid #e9ecef;
}

.breadcrumb a {
    color: #4a4a4a;;
    font-weight: 400;
}

.card .card-header .card-title {
    font-size: 1.3rem;
    font-weight: bold;
}

.table thead tr {
    background-color: #ececec !important;
    color: #000000 !important;
}

.table thead th {
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
}

.password-progress {
    margin-top: 10px;
    margin-bottom: 0;
}

.dataTables_scroll {
    overflow: auto;
}

.form-control-checkbox {
    height: 25px;
    width: 25px;
    text-align: center;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.cursor-pointer {
    cursor: pointer;
}

a.card-icon p.desc {
    text-align: center;
    font-size: 12px !important;
}

a.card-icon {
    text-decoration: none !important;
    color: black !important;
    border: 1px solid #dee2e6 !important;
}

.card-icon-selected {
    background-color: #fdedbc;
}

a.card-icon:hover {
    background-color: #fdedbc;
    animation: shakeY;
    animation-duration: 2s;
}

.low-stock {
    background-color: red;
    color: white !important;
}

.img-small {
    width: 20px;
    height: 20px;
}

/* =============================================
   RESPONSIVE - Móvil y Tableta
   ============================================= */

/* --- Tabla de productos en venta --- */
.table-sale-products-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-sale-products-wrap .table {
    min-width: 800px;
}

/* --- MÓVIL: todo más grande para fácil uso táctil --- */
@media (max-width: 768px) {

    /* Body base */
    body {
        font-size: 16px;
    }

    /* --- Navbar header --- */
    .main-header.navbar {
        padding: 0.3rem 0.5rem;
    }

    .main-header .nav-item .nav-link {
        padding: 0.6rem 0.7rem;
        font-size: 1rem;
    }

    .main-header .dropdown-menu {
        min-width: 260px;
        font-size: 1rem;
    }

    .main-header .dropdown-item {
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }

    .main-header .navbar-nav .nav-item .nav-link {
        white-space: nowrap;
    }

    /* --- Sidebar --- */
    .main-sidebar {
        z-index: 1040;
    }

    .sidebar .nav-link p {
        font-size: 1rem;
    }

    .sidebar .nav-link {
        padding: 0.7rem 1rem;
    }

    /* --- Cards --- */
    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-footer {
        padding: 0.75rem 1rem;
    }

    .card-header .card-title {
        font-size: 1.2rem;
    }

    /* --- Tablas --- */
    .table {
        font-size: 1rem;
    }

    .table td,
    .table th {
        padding: 0.6rem 0.5rem;
        vertical-align: middle;
    }

    .table .btn {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }

    /* --- Forms --- */
    .form-group label {
        font-size: 1rem;
        margin-bottom: 0.3rem;
        font-weight: 500;
    }

    .form-control {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
        min-height: 44px;
    }

    select.form-control {
        font-size: 1rem;
        min-height: 44px;
    }

    .input-group > .form-control {
        min-width: 0;
    }

    .input-group-append .btn,
    .input-group-prepend .btn {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        min-height: 44px;
    }

    /* --- Botones --- */
    .btn {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        min-height: 44px;
    }

    .btn-sm {
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
        min-height: 38px;
    }

    .btn-block {
        min-height: 48px;
        font-size: 1.1rem;
    }

    /* --- Modales --- */
    .modal-dialog {
        max-width: 96% !important;
        margin: 0.5rem auto !important;
    }

    .modal-xl {
        width: 98% !important;
        max-width: 98% !important;
    }

    .modal-lg {
        width: 96% !important;
        max-width: 96% !important;
    }

    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-body .form-control {
        font-size: 1rem;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        margin-bottom: 0.3rem;
    }

    /* --- Select2 --- */
    .select2-container--bootstrap4 .select2-selection {
        min-height: 44px;
    }

    .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
        font-size: 1rem;
        line-height: 2.2;
    }

    .select2-results__option {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }

    /* --- Breadcrumb --- */
    .breadcrumb {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    .breadcrumb-item a {
        font-size: 0.95rem;
    }

    /* --- Content header --- */
    .content-header {
        padding: 0.5rem 0.75rem;
    }

    .content-header h1 {
        font-size: 1.2rem;
    }

    /* --- SweetAlert --- */
    .swal2-popup {
        font-size: 1rem;
        padding: 1.5rem;
    }

    .swal2-title {
        font-size: 1.3rem;
    }

    .swal2-content {
        font-size: 1rem;
    }

    .swal2-confirm {
        font-size: 1.1rem;
        min-height: 48px;
    }

    /* --- Login --- */
    .login-box {
        width: 95%;
        margin: 0 auto;
    }

    .login-logo {
        font-size: 1.5rem;
    }

    .login-card-body {
        padding: 1.5rem;
    }

    .login-card-body .form-control {
        font-size: 1rem;
        min-height: 48px;
    }

    .login-card-body .btn {
        min-height: 50px;
        font-size: 1.1rem;
    }

    /* --- Sale form --- */
    .content-electronic-billing .col-lg-2,
    .content-electronic-billing .col-lg-7,
    .content-electronic-billing .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #tblProducts {
        font-size: 0.9rem;
    }

    #tblProducts th,
    #tblProducts td {
        padding: 0.4rem;
    }

    .card.p-4 {
        padding: 1rem !important;
    }

    /* --- DataTables --- */
    div.dataTables_wrapper div.dataTables_filter {
        text-align: left;
        margin-top: 0.5rem;
    }

    div.dataTables_wrapper div.dataTables_filter input {
        width: 100%;
        font-size: 1rem;
        min-height: 44px;
    }

    div.dataTables_wrapper div.dataTables_info {
        font-size: 0.9rem;
        padding-top: 0.75rem;
    }

    div.dataTables_wrapper div.dataTables_paginate {
        text-align: center;
        padding-top: 0.75rem;
    }

    .paginate_button {
        font-size: 1rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* --- Dropdown menus --- */
    .dropdown-menu {
        font-size: 1rem;
    }

    .dropdown-item {
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }

    /* --- Totals panel --- */
    .flex-row-reverse {
        flex-direction: column !important;
    }

    .flex-row-reverse .col-lg-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* --- Touchspin --- */
    .input-group.bootstrap-touchspin.bootstrap-touchspin-injected {
        width: 100% !important;
    }

    .bootstrap-touchspin .input-group-btn-vertical {
        display: flex;
    }

    /* --- Pagination --- */
    .page-link {
        font-size: 1rem;
        padding: 0.6rem 0.9rem;
    }

    /* --- Lists --- */
    .content-list-actions {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }

    .content-list-actions .btn {
        width: 100%;
    }

    /* --- Close button in modals --- */
    .close {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    /* --- Checkboxes --- */
    .custom-control-label {
        font-size: 1rem;
    }

    .custom-control-input {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* --- MUY PEQUEÑO (teléfono) --- */
@media (max-width: 400px) {
    .main-header .nav-item .nav-link {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .btn {
        font-size: 0.95rem;
        padding: 0.45rem 0.8rem;
    }

    .table {
        font-size: 0.9rem;
    }
}

/* =============================================
   MEJORAS RESPONSIVE ADICIONALES
   ============================================= */

/* --- Sidebar: auto ocultar en movil --- */
@media (max-width: 768px) {
    body.sidebar-collapse-mobile .main-sidebar {
        transform: translate(-250px, 0);
    }
    body.sidebar-collapse-mobile .content-wrapper,
    body.sidebar-collapse-mobile .main-footer {
        margin-left: 0;
    }
    /* Cuando el sidebar esta abierto en movil */
    body:not(.sidebar-collapse-mobile) .content-wrapper {
        margin-left: 0;
    }
    /* Overlay cuando sidebar abierto en movil */
    body:not(.sidebar-collapse-mobile)::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
    }
}

/* --- Dashboard: graficos responsive --- */
@media (max-width: 768px) {
    #graph-stock-products {
        height: 40vh !important;
        min-height: 250px;
    }
    #graph-purchase-vs-sale {
        min-height: 300px;
    }
    #graph-purchase-vs-sale svg,
    #graph-stock-products svg {
        max-width: 100% !important;
    }
    /* Highcharts responsive */
    .highcharts-container {
        width: 100% !important;
        height: auto !important;
    }
    .highcharts-container svg {
        width: 100% !important;
    }
}

/* --- Info boxes en dashboard responsive --- */
@media (max-width: 576px) {
    .info-box {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
    .info-box .info-box-icon {
        width: 100%;
        border-radius: 0.25rem 0.25rem 0 0;
    }
    .info-box .info-box-content {
        padding: 0.75rem;
    }
}

/* --- Busqueda de productos (sale form) --- */
@media (max-width: 576px) {
    .input-group-search .input-group-append .btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
        min-height: 40px;
    }
    /* Botones de accion de productos */
    #button-addon4 .btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
    /* Tabla de productos en venta */
    #tblProducts_wrapper {
        overflow-x: auto;
    }
    .table-sale-products-wrap .table {
        min-width: 700px;
    }
    /* Totals en venta */
    .card.p-4 .table td {
        font-size: 0.9rem;
        padding: 0.4rem 0.3rem;
    }
    .card.p-4 .table input {
        font-size: 0.9rem;
        min-height: 36px;
    }
}

/* --- Breadcrumb responsive --- */
@media (max-width: 576px) {
    .breadcrumb {
        flex-wrap: wrap;
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem !important;
    }
    .breadcrumb-item {
        margin-bottom: 0.2rem;
    }
}

/* --- Brand / Logo en sidebar --- */
@media (max-width: 768px) {
    .brand-link .brand-text {
        font-size: 1rem;
    }
    .brand-image {
        max-height: 40px;
    }
}

/* --- User panel en sidebar --- */
@media (max-width: 768px) {
    .user-panel .info a {
        font-size: 0.95rem;
    }
    .user-panel .image img {
        width: 40px;
        height: 40px;
    }
}

/* --- Tablas de listados responsive --- */
@media (max-width: 576px) {
    div.dataTables_wrapper div.dataTables_length {
        text-align: left;
        margin-bottom: 0.5rem;
    }
    div.dataTables_wrapper div.dataTables_length select {
        min-height: 38px;
        font-size: 0.95rem;
    }
    .table td, .table th {
        white-space: nowrap;
    }
}

/* --- Header de listados --- */
@media (max-width: 576px) {
    .card-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start !important;
    }
    .card-header .card-title {
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
}

/* --- Botones en footer de card --- */
@media (max-width: 576px) {
    .card-footer {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }
    .card-footer .btn {
        width: 100%;
    }
}

/* --- Navegacion de modulo responsive --- */
@media (max-width: 768px) {
    .nav-sidebar .nav-header {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    .nav-sidebar .nav-link p {
        font-size: 0.95rem;
    }
}

/* --- Scroll horizontal suave en tablas --- */
.table-responsive-stack {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Mejoras para forms de creacion en general --- */
@media (max-width: 576px) {
    .container-fluid > .row > [class*="col-"] {
        margin-bottom: 0.5rem;
    }
    .row .form-group {
        margin-bottom: 0.6rem;
    }
}

/* --- Select2 en movil --- */
@media (max-width: 768px) {
    .select2-container {
        width: 100% !important;
    }
}

/* --- Calendario / Datepicker --- */
@media (max-width: 576px) {
    .bootstrap-datetimepicker-widget {
        max-width: 100% !important;
    }
    .bootstrap-datetimepicker-widget table td,
    .bootstrap-datetimepicker-widget table th {
        font-size: 0.85rem;
        padding: 0.3rem;
    }
}

/* --- Proforma/Invoice print preview --- */
@media (max-width: 576px) {
    .content-wrapper iframe,
    .content-wrapper object,
    .content-wrapper embed {
        max-width: 100%;
        height: 70vh;
    }
}

/* --- Fix para el dropdown del user menu --- */
@media (max-width: 576px) {
    .navbar-nav.ml-auto .dropdown-menu {
        left: auto !important;
        right: 0 !important;
    }
}

/* --- Fix solapamiento sidebar en movil --- */
@media (max-width: 768px) {
    .sidebar-mini.layout-fixed .wrapper .main-sidebar {
        position: fixed;
    }
}
