#dispatch-payment-options label {
    margin-right: 16px !important;
}
#client-sales-table td.actions-cell .client-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
}

/* Align headers and cells in client sales table */
#client-sales-table th,
#client-sales-table td {
    vertical-align: middle !important;
}
#client-sales-table th:last-child,
#client-sales-table td:last-child {
    text-align: center !important;
}

/* Center vertical header for table headers (e.g., dispatches) */
.table thead th {
    vertical-align: middle !important;
}

/* Force left alignment for numeric columns Neto (3), IVA (4), Total (5) */
#client-sales-table tbody td:nth-child(3),
#client-sales-table tbody td:nth-child(4),
#client-sales-table tbody td:nth-child(5) {
    text-align: left !important;
}
.pagination {
    margin-top: 20px;
}

.pagination li {
    margin: 0 5px;
}


.pagination li a {
    color: #007bff;
}

.pagination li.active a {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Custom Switch Styles */
.custom-control.custom-switch {
    padding-left: 2.25rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #28a745;
    border-color: #28a745;
}

.custom-control-input:not(:checked) ~ .custom-control-label::before {
    background-color: #dc3545;
    border-color: #dc3545;
}

.custom-switch .custom-control-label::before {
    left: -2.25rem;
    height: 1.25rem;
    width: 2.25rem;
    pointer-events: all;
    border-radius: 1.25rem;
}

.custom-switch .custom-control-label::after {
    top: calc(0.25rem + 2px);
    left: calc(-2.25rem + 2px);
    width: calc(1.25rem - 4px);
    height: calc(1.25rem - 4px);
    background-color: #fff;
    border-radius: 1.25rem;
    transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(1rem);
}

.custom-switch .custom-control-label {
    padding-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* General button sizing - make all buttons smaller */
.btn {
    font-size: 0.8rem !important;
    padding: 0.375rem 0.75rem !important;
    line-height: 1.2 !important;
}

.btn-sm {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1.1 !important;
}

.btn-lg {
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
    line-height: 1.3 !important;
}

/* Provider actions buttons */
.btn-group-vertical .btn {
    width: 100%;
    text-align: center;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    white-space: nowrap;
    display: block;
}

/* Even more compact for providers table */
#providers-table .btn-group-vertical .btn {
    width: 100%;
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
    margin-bottom: 0.15rem;
    display: block;
}

.btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

.btn-group-vertical .btn i {
    margin-right: 0.2rem;
    width: 10px;
    text-align: center;
    font-size: 0.65rem;
}

/* Responsive adjustments for action buttons */
@media (max-width: 768px) {
    .btn-group-vertical .btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .btn-group-vertical .btn i {
        width: 10px;
        font-size: 0.6rem;
    }
}

/* Provider filters styling */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-label i {
    margin-right: 0.25rem;
    color: #6c757d;
}

#provider-search {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#provider-search:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#status-filter {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

#clear-filters {
    margin-top: 1.75rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Filter results counter */
.text-muted.small {
    font-size: 0.75rem;
    font-style: italic;
}

/* Responsive filter adjustments */
@media (max-width: 768px) {
    .form-label {
        font-size: 0.8rem;
    }
    
    #clear-filters {
        margin-top: 0.5rem;
        margin-left: 0 !important;
        width: 100%;
    }
    
    /* Even smaller buttons on mobile */
    .btn {
        font-size: 0.75rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    
    .btn-sm {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

/* Table button adjustments */
.table .btn {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
    min-width: 60px !important;
    white-space: nowrap !important;
}

.table .btn i {
    font-size: 0.65rem !important;
    margin-right: 0.2rem !important;
}

/* Make table action columns narrower - default */
.table th:last-child,
.table td:last-child {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    padding: 0.25rem !important;
}

/* Sales table needs more space for action pills */
#sales-table th:last-child,
#sales-table td:last-child {
    width: 160px !important; /* narrower but enough for 3 pills stacked */
    min-width: 160px !important;
    max-width: 160px !important;
    white-space: normal !important;
}

/* Clients table actions column = 10% of table width */
#clients-table th.actions,
#clients-table td.actions {
    width: 15% !important;
    min-width: 15% !important;
}

/* Stack and separate action buttons in Clients table */
#clients-table .action-stack a {
    width: 100% !important;
}
#clients-table .action-stack a + a {
    margin-top: 8px !important;
}

/* Even more compact for providers table specifically */
#providers-table th:last-child,
#providers-table td:last-child {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 0.2rem !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* Center the button container in the cell */
#providers-table td:last-child .btn-group-vertical {
    margin: 0 auto !important;
    width: 100% !important;
}

/* Ensure buttons are properly centered */
#providers-table .btn-group-vertical .btn {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

/* Compact button groups */
.btn-group-vertical {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Compact text for long button labels */
.btn-group-vertical .btn:contains("Restaurar Todo") {
    font-size: 0.65rem !important;
}

.btn-group-vertical .btn:contains("Eliminar Todo") {
    font-size: 0.65rem !important;
}

/* Alternative: Use shorter text for buttons */
.btn-restore-all::before {
    content: "Restaurar";
}

.btn-delete-all::before {
    content: "Eliminar";
}

/* Form button adjustments */
.form-group .btn {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.7rem !important;
}

/* Navbar button adjustments */
.navbar .btn {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
}

/* Card header button adjustments */
.card-header .btn {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
}

/* Link button adjustments */
.btn-link {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.4rem !important;
}

/* Dropdown button adjustments */
.dropdown-toggle {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
}

/* Badge adjustments to match smaller buttons */
.badge {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
}

/* Pills used for table action links */
.pill {
    padding: 0.35rem 0.75rem !important;
    margin-right: 0.4rem !important;
    display: block !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}
.actions .pill:last-child { margin-right: 0 !important; }

/* Ensure spacing in action cell */
#sales-table td.actions {
    text-align: center !important;
}
#sales-table td.actions .action-pills {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
}
#sales-table td.actions .pill {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Center the header title for Acciones */
#sales-table th.actions {
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    vertical-align: middle !important;
}

/* Alert button adjustments */
.alert .btn {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
}

/* Modal button adjustments */
.modal .btn {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.7rem !important;
}

/* Pagination adjustments */
.pagination .page-link {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
}

/* Responsive tables */
.table-responsive-sm { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Mobile tweaks */
@media (max-width: 576px) {
  body { padding: 8px; }
  .navbar-brand img { width: 56px; }
  .table td, .table th { padding: .5rem; }
  .btn { padding: .375rem .5rem !important; font-size: .85rem !important; }
}

/* Prevent horizontal overflow on small devices */
html, body { max-width: 100%; overflow-x: hidden; }
.navbar, .container, .container-fluid { max-width: 100%; }
.dropdown-menu { max-width: 100vw; }
