body {
    font-size: .875rem;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.navbar-brand {
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.navbar .navbar-toggler {
    top: .25rem;
    right: 1rem;
}

.navbar .form-control {
    padding: .75rem 1rem;
}

.form-control-dark {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

.bd-placeholder-img {
    font-size: 1.125rem;
    text-anchor: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

@media (min-width: 768px) {
    .bd-placeholder-img-lg {
        font-size: 3.5rem;
    }
}

.btn-toolbar {
    margin-bottom: 1rem;
}

.table td, .table th {
    vertical-align: middle;
}

.card {
    margin-bottom: 1.5rem;
}

.card-stats .card-body {
    padding: 1rem;
}

.card-stats .card-status {
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.bg-gradient-primary {
    background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
}

.bg-gradient-info {
    background: linear-gradient(87deg, #11cdef 0, #1171ef 100%);
}

.bg-gradient-success {
    background: linear-gradient(87deg, #2dce89 0, #2dcecc 100%);
}

.bg-gradient-warning {
    background: linear-gradient(87deg, #fb6340 0, #fbb140 100%);
}

.bg-gradient-danger {
    background: linear-gradient(87deg, #f5365c 0, #f56036 100%);
}

.modal-header {
    border-radius: 0.3rem 0.3rem 0 0;
}

.modal-footer {
    border-radius: 0 0 0.3rem 0.3rem;
}

.alert {
    border: 0;
    border-radius: 0.25rem;
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
}

/* Estilos para mejorar el espaciado de los campos de texto */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea {
    padding-left: 0.75rem !important;
}

/* Estilos para los placeholders */
::placeholder {
    padding-left: 0.25rem;
}

/* Ajuste para los selects */
select {
    padding-left: 0.75rem !important;
    background-position: right 0.75rem center;
}

/* Estilos adicionales para el módulo de mensajeros */
.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.badge-status {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-modern {
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Estilos específicos para la tabla de cuentas por pagar */
#cuentasPagarTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

#cuentasPagarTable thead th,
#cuentasPagarTable thead td,
table.dataTable#cuentasPagarTable thead th,
table.dataTable#cuentasPagarTable thead td {
    color: white !important;
    background-color: #000000 !important;
    background: #000000 !important;
}

#cuentasPagarTable thead tr,
table.dataTable#cuentasPagarTable thead tr {
    background-color: #000000 !important;
    background: #000000 !important;
}

/* Estilos para DataTables más específicos */
table.dataTable#cuentasPagarTable thead > tr > th,
table.dataTable#cuentasPagarTable thead > tr > td,
table.dataTable#cuentasPagarTable thead > tr > th.sorting,
table.dataTable#cuentasPagarTable thead > tr > th.sorting_asc,
table.dataTable#cuentasPagarTable thead > tr > th.sorting_desc,
table.dataTable#cuentasPagarTable thead > tr > td.sorting,
table.dataTable#cuentasPagarTable thead > tr > td.sorting_asc,
table.dataTable#cuentasPagarTable thead > tr > td.sorting_desc {
    color: white !important;
    background-color: #000000 !important;
    background: #000000 !important;
}

/* Estilos de hover para las filas */
#cuentasPagarTable tbody tr.table-row-hover:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Alineación vertical */
#cuentasPagarTable td {
    vertical-align: middle;
}

/* Estilos para badges */
#cuentasPagarTable .badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
}

/* Estilos específicos para la tabla de cuentas por cobrar */
#cuentasCobrarTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

#cuentasCobrarTable thead th,
#cuentasCobrarTable thead td,
table.dataTable#cuentasCobrarTable thead th,
table.dataTable#cuentasCobrarTable thead td {
    color: white !important;
    background-color: #000000 !important;
    background: #000000 !important;
}

#cuentasCobrarTable thead tr,
table.dataTable#cuentasCobrarTable thead tr {
    background-color: #000000 !important;
    background: #000000 !important;
}

/* Estilos para DataTables más específicos */
table.dataTable#cuentasCobrarTable thead > tr > th,
table.dataTable#cuentasCobrarTable thead > tr > td,
table.dataTable#cuentasCobrarTable thead > tr > th.sorting,
table.dataTable#cuentasCobrarTable thead > tr > th.sorting_asc,
table.dataTable#cuentasCobrarTable thead > tr > th.sorting_desc,
table.dataTable#cuentasCobrarTable thead > tr > td.sorting,
table.dataTable#cuentasCobrarTable thead > tr > td.sorting_asc,
table.dataTable#cuentasCobrarTable thead > tr > td.sorting_desc {
    color: white !important;
    background-color: #000000 !important;
    background: #000000 !important;
}

/* Estilos de hover para las filas */
#cuentasCobrarTable tbody tr.table-row-hover:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Alineación vertical */
#cuentasCobrarTable td {
    vertical-align: middle;
}

/* Estilos para badges */
#cuentasCobrarTable .badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
}

#InventarioTable_wrapper .dt-head,
#productosTable_wrapper .dt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

#InventarioTable_wrapper .dataTables_length,
#productosTable_wrapper .dataTables_length {
    margin-right: 1rem;
}

#InventarioTable_wrapper .dataTables_filter label,
#productosTable_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    font-weight: 500;
}

#InventarioTable_wrapper .dataTables_filter input::placeholder,
#productosTable_wrapper .dataTables_filter input::placeholder {
    color: #9ca3af;
}

#InventarioTable_wrapper .dataTables_length select,
#InventarioTable_wrapper .dataTables_filter input,
#productosTable_wrapper .dataTables_length select,
#productosTable_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    background-color: #ffffff;
}

#InventarioTable_wrapper .dataTables_paginate .paginate_button,
#productosTable_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 0 2px;
    background-color: #ffffff;
    color: #374151 !important;
}

#InventarioTable_wrapper .dataTables_paginate .paginate_button.current,
#productosTable_wrapper .dataTables_paginate .paginate_button.current {
    background-color: #111827;
    color: #ffffff !important;
    border-color: #111827;
}

#InventarioTable_wrapper .dataTables_paginate .paginate_button:hover,
#productosTable_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #f3f4f6;
    color: #111827 !important;
}

#InventarioTable_wrapper .dataTables_info,
#productosTable_wrapper .dataTables_info {
    color: #374151;
    font-size: 12px;
}

table.dataTable#InventarioTable thead > tr > th,
table.dataTable#InventarioTable thead > tr > td,
table.dataTable#InventarioTable thead > tr > th.sorting,
table.dataTable#InventarioTable thead > tr > th.sorting_asc,
table.dataTable#InventarioTable thead > tr > th.sorting_desc,
table.dataTable#InventarioTable thead > tr > td.sorting,
table.dataTable#InventarioTable thead > tr > td.sorting_asc,
table.dataTable#InventarioTable thead > tr > td.sorting_desc,
table.dataTable#productosTable thead > tr > th,
table.dataTable#productosTable thead > tr > td,
table.dataTable#productosTable thead > tr > th.sorting,
table.dataTable#productosTable thead > tr > th.sorting_asc,
table.dataTable#productosTable thead > tr > th.sorting_desc,
table.dataTable#productosTable thead > tr > td.sorting,
table.dataTable#productosTable thead > tr > td.sorting_asc,
table.dataTable#productosTable thead > tr > td.sorting_desc {
    color: white !important;
    background-color: #000000 !important;
    background: #000000 !important;
}

#InventarioTable tbody tr.table-row-hover:hover,
#productosTable tbody tr.table-row-hover:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

#InventarioTable td,
#productosTable td {
    vertical-align: middle;
}

#InventarioTable thead tr,
#productosTable thead tr {
    background-color: #000000 !important;
}

#InventarioTable thead th,
#productosTable thead th {
    color: #ffffff !important;
}

#InventarioTable_wrapper .dataTables_length label,
#productosTable_wrapper .dataTables_length label {
    color: #111827;
    font-weight: 600;
}

/* Layout App global para móvil/tablet */
@media (max-width: 1024px) {
    body { position: fixed; width: 100%; height: 100vh; overflow: hidden; background-color: #f1f5f9; }
    .fixed.inset-y-0.flex.w-64.flex-col { display: none !important; }
    .pl-64 { padding-left: 0 !important; }
    main { height: auto; min-height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 120px !important; }
    .mobile-hide { display: none !important; }
    .app-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; background: #0f172a; color: #ffffff; display: flex; align-items: center; justify-content: space-around; z-index: 1000; }
    .app-bottom-nav a, .app-bottom-nav button { background: transparent; color: #ffffff; border: none; font-weight: 600; font-size: 14px; padding: 8px 12px; text-decoration: none; display: flex; align-items: center; gap: 6px; }
    /* Scroll horizontal suave en contenedores */
    .overflow-x-auto, .table-container { -webkit-overflow-scrolling: touch; }
    .overflow-y-auto, .table-container { padding-bottom: 24px; }
    .dataTables_wrapper, .table-container, .overflow-x-auto { padding-right: 60px; }
    /* Optimización táctil: inputs y botones más grandes */
    input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="date"], input[type="search"], select, textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    button, .btn, .btn-action {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }
    /* Botón flotante (FAB) */
    .app-fab { position: fixed; right: 16px; bottom: 72px; width: 56px; height: 56px; border-radius: 50%; background: #1e3a5f; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,0.25); z-index: 1001; }
    .app-fab:hover { background: #0f2b4a; }
    .app-fab-menu { position: fixed; right: 16px; bottom: 136px; display: none; flex-direction: column; gap: 8px; z-index: 1001; }
    .app-fab-menu a { display: flex; align-items: center; gap: 8px; background: #0f172a; color: #fff; padding: 10px 12px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); text-decoration: none; font-weight: 600; }
}
@media (min-width: 1025px) {
    .app-bottom-nav { display: none !important; }
    .app-fab, .app-fab-menu { display: none !important; }
}
@media print {
    .app-bottom-nav { display: none !important; }
    .app-fab, .app-fab-menu { display: none !important; }
    body { background: #ffffff !important; position: static; height: auto; overflow: visible; }
}

/* Menú 'Más' */
.app-more-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 1002; }
.app-more-panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 70vh; background: #0f172a; color: #fff; border-top-left-radius: 16px; border-top-right-radius: 16px; box-shadow: 0 -8px 24px rgba(0,0,0,0.25); padding: 12px; overflow: hidden; }
.app-more-header { display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px 4px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.app-more-header input[type="search"] { flex: 1; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; background: rgba(255,255,255,0.08); color: #fff; padding: 8px 10px; font-size: 14px; }
.app-more-header button { background: transparent; color: #fff; border: none; font-size: 18px; }
.app-more-content { overflow-y: auto; max-height: calc(70vh - 48px); padding-top: 8px; }
.app-more-group { margin-bottom: 14px; }
.app-more-title { font-weight: 700; letter-spacing: .2px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.app-more-link { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.06); color: #ffffff; text-decoration: none; margin: 6px 0; font-weight: 600; }
.app-more-link:hover { background: rgba(255,255,255,0.12); }
.app-more-link i { width: 18px; text-align: center; }

/* Drawer lateral para tablets en horizontal */
@media (orientation: landscape) and (min-width: 900px) and (max-width: 1024px) {
    body { position: static !important; height: auto !important; overflow: visible !important; }
    .fixed.inset-y-0.flex.w-64.flex-col { display: flex !important; }
    .fixed.inset-y-0.flex.w-64.flex-col { position: fixed !important; top: 0; bottom: 0; height: 100vh !important; background-color: #1e3a5f !important; z-index: 1001; }
    .fixed.inset-y-0.flex.w-64.flex-col > .flex { height: 100% !important; overflow-y: auto !important; background-color: #1e3a5f !important; }
    .pl-64 { padding-left: 16rem !important; }
    .app-bottom-nav { display: none !important; }
    .app-more-panel { top: 0; right: 0; left: auto; bottom: 0; width: 320px; max-height: 100vh; border-radius: 0; }
    .app-more-content { max-height: calc(100vh - 48px); }
}

/* Acciones solo con icono en celular */
@media (max-width: 768px) {
    .product-actions .action-text { display: none !important; }
    .product-actions .inline-flex { padding: 8px 8px; }
}

/* Responsivo global de tablas y filtros */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
@media (max-width: 1024px) {
    .filter-grid { display: flex; flex-wrap: wrap; gap: 12px; }
    .filter-grid .filter-group, .filter-grid .filter-input, .filter-grid .filter-select { width: 100%; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .filter-grid .filter-group { width: calc(50% - 6px); }
}
/* Reportes y gráficos responsivos */
.report-container, .chart-container { max-width: 100% !important; }
canvas { max-width: 100% !important; height: auto !important; }
/* Imágenes y modales responsivos en móvil */
@media (max-width: 1024px) {
    img { max-width: 100%; height: auto; }
    [role="dialog"] { max-width: 90vw; }
}
@media (max-width: 1024px) {
    .report-container { display: block !important; visibility: visible !important; }
}
.report-modal { position: fixed; inset: 0; z-index: 2005; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); }
.report-modal .report-content { background: #ffffff; max-width: 90vw; max-height: 85vh; overflow: auto; border-radius: 8px; }
.report-modal .report-content iframe { width: 90vw; height: 80vh; border: none; }
.swal2-container { z-index: 2005 !important; }
