/**
 * Custom CSS for Panadería Villalobos Management System
 * Using Bootstrap 5.3 as base
 */

/* Alpine.js x-cloak - Hide elements until Alpine.js is loaded */
[x-cloak] {
    display: none !important;
}

:root {
    --primary-blue: #0d6efd;
    --success-green: #198754;
    --danger-red: #dc3545;
    --warning-yellow: #ffc107;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure text caret is visible in normal inputs */
input[type="number"],
input[type="email"],
input[type="tel"],
textarea {
    caret-color: auto !important;
}

/* FORCE: Hide cursor in ALL date inputs */
input[type="text"][placeholder*="dd/mm"],
input[type="text"][placeholder*="aaaa"],
input[id*="date"],
input[id*="period"],
input[id*="fecha"],
input.calendar-date,
input.segmented-date,
input.custom-date-input {
    cursor: text !important;
}

/* Show caret on focus for date inputs */
input[type="text"][placeholder*="dd/mm"]:focus,
input[type="text"][placeholder*="aaaa"]:focus,
input[id*="date"]:focus,
input[id*="period"]:focus,
input[id*="fecha"]:focus,
input.calendar-date:focus,
input.segmented-date:focus,
input.custom-date-input:focus {
    caret-color: auto !important;
    cursor: text !important;
}

/* Hide any fake cursor elements */
.segmented-date-cursor,
.segmented-date-container .segmented-date-cursor {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* FORCE: Remove ALL date placeholders */
input[type="text"][placeholder*="dd/mm"]::placeholder,
input[type="text"][placeholder*="aaaa"]::placeholder,
input[type="text"][placeholder*="yyyy"]::placeholder,
input[id*="date"]::placeholder,
input[id*="period"]::placeholder,
input[class*="date"]::placeholder {
    color: transparent !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* Remove placeholder text completely */
input.calendar-date::placeholder,
input.segmented-date::placeholder,
input.custom-date-input::placeholder {
    content: "" !important;
    color: transparent !important;
    opacity: 0 !important;
}

/* Date inputs - text cursor for editable date inputs */
input.custom-date-input,
input.segmented-date,
input[data-segmented-date],
input.calendar-date {
    cursor: text !important;
    max-width: 155px !important;
    width: 155px !important;
}

input.custom-date-input:focus,
input.segmented-date:focus,
input[data-segmented-date]:focus,
input.calendar-date:focus {
    caret-color: auto !important;
    cursor: text !important;
}

/* Text cursor on all date input states with maximum specificity */
input.form-control.custom-date-input,
input.form-control.segmented-date,
input.form-control[data-segmented-date],
input.form-control.calendar-date,
.input-group input.custom-date-input,
.input-group input.segmented-date,
.input-group input[data-segmented-date],
.input-group input.calendar-date {
    cursor: text !important;
}

input.form-control.custom-date-input:hover,
input.form-control.segmented-date:hover,
input.form-control[data-segmented-date]:hover,
input.form-control.calendar-date:hover,
.input-group input.custom-date-input:hover,
.input-group input.segmented-date:hover,
.input-group input[data-segmented-date]:hover,
.input-group input.calendar-date:hover {
    cursor: text !important;
}

.container-fluid {
    flex: 1;
}

/* Blue Navigation Banner */
.navbar-dark.bg-primary {
    background-color: var(--primary-blue) !important;
}

/* Horizontal Menu Below Banner */
.menu-horizontal {
    background-color: #fff;
    border-bottom: 2px solid var(--border-color);
    padding: 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.menu-horizontal .nav-pills .nav-link {
    color: #495057;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    margin-right: 0.25rem;
    transition: all 0.2s;
}

.menu-horizontal .nav-pills .nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

.menu-horizontal .nav-pills .nav-link.active {
    background-color: var(--primary-blue);
    color: white;
}

/* Dropdown Menu in Horizontal Nav */
.menu-horizontal .dropdown-menu {
    position: absolute;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: block;
}

.menu-horizontal .dropdown-menu[style*="display: none"] {
    display: none !important;
}

.menu-horizontal .dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.menu-horizontal .dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

/* Cards */
.stats-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.stats-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stats-card .stats-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-blue);
}

.stats-card .stats-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Tables */
.table {
    border: 1px solid var(--border-color);
}

.table thead {
    background-color: var(--light-gray);
}

.table th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.table td {
    text-align: left;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Category Badges */
.category-badge {
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 0.25rem;
    display: inline-block;
}

/* Type Color Badges - Predefined Colors */
.bg-tipo-dospinos {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.bg-tipo-cocacola {
    background-color: #fd7e14 !important;
    color: #fff !important;
}

.bg-tipo-cintaazul {
    background-color: #6dd3f5 !important;
    color: #212529 !important;
}

.bg-tipo-huevos {
    background-color: #f8c8dc !important;
    color: #212529 !important;
}

.bg-tipo-numar {
    background-color: #28a745 !important;
    color: #fff !important;
}

.bg-tipo-queso {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.bg-tipo-promociones {
    background-color: #8b5cf6 !important;
    color: #fff !important;
}

.bg-tipo-minisuper {
    background-color: #d1d5db !important;
    color: #212529 !important;
}

/* Type Color Badges - Dynamic Colors for New Types */
.bg-tipo-teal {
    background-color: #20c997 !important;
    color: #212529 !important;
}

.bg-tipo-brown {
    background-color: #795548 !important;
    color: #fff !important;
}

.bg-tipo-indigo {
    background-color: #6610f2 !important;
    color: #fff !important;
}

.bg-tipo-pink {
    background-color: #d63384 !important;
    color: #fff !important;
}

.bg-tipo-cyan {
    background-color: #0dcaf0 !important;
    color: #212529 !important;
}

.bg-tipo-lime {
    background-color: #84cc16 !important;
    color: #212529 !important;
}

/* Status Badges */
.status-activo {
    background-color: #f8d7da;
    color: #842029;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.status-inactivo {
    background-color: #d1e7dd;
    color: #0f5132;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Stock Warning */
.stock-zero {
    color: var(--danger-red);
    font-weight: bold;
}

/* Filter Section */
.filter-section {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Date Input with Fixed Slashes */
.date-input-group {
    position: relative;
}

.date-input-group input[type="text"] {
    font-family: monospace;
}

/* Custom Date Input with Fixed "/" */
.custom-date-input {
    cursor: text !important;
    color: #212529 !important;
    background-color: #fff !important;
}

.custom-date-input.is-invalid {
    border-color: var(--danger-red);
    background-image: none;
}

.custom-date-input.is-invalid:focus {
    border-color: var(--danger-red);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
    caret-color: auto !important;
    cursor: text !important;
}

.custom-date-input:focus {
    caret-color: auto !important;
    cursor: text !important;
    background-color: #fff !important;
}

/* Form Validation Styles - Red borders for all invalid required fields */
.form-control.is-invalid,
.was-validated .form-control:invalid,
input[type="date"].is-invalid,
input[type="date"].form-control.is-invalid,
#purchase_payment_date.is-invalid {
    border-color: var(--danger-red) !important;
    padding-right: calc(1.5em + .75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus,
input[type="date"].is-invalid:focus {
    border-color: var(--danger-red) !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Select elements with invalid state */
.form-select.is-invalid,
.was-validated .form-select:invalid {
    border-color: var(--danger-red) !important;
    padding-right: 4.125rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-position: right .75rem center, center right 2.25rem;
    background-size: 16px 12px, calc(.75em + .375rem) calc(.75em + .375rem);
    background-repeat: no-repeat;
}

.form-select.is-invalid:focus,
.was-validated .form-select:invalid:focus {
    border-color: var(--danger-red) !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Textarea elements with invalid state */
textarea.form-control.is-invalid,
.was-validated textarea.form-control:invalid {
    border-color: var(--danger-red) !important;
    padding-right: calc(1.5em + .75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) top calc(.375em + .1875rem);
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

textarea.form-control.is-invalid:focus,
.was-validated textarea.form-control:invalid:focus {
    border-color: var(--danger-red) !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Checkbox and radio button invalid state */
.form-check-input.is-invalid {
    border-color: var(--danger-red) !important;
}

.form-check-input.is-invalid:checked {
    background-color: var(--danger-red);
    border-color: var(--danger-red);
}

.form-check-input.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Invalid feedback text */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--danger-red);
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Calendar Button */
.calendar-btn {
    font-size: 1.2rem;
    padding: 0.375rem 0.75rem;
    border-left: none;
    transition: all 0.2s;
}

.calendar-btn:hover {
    background-color: var(--light-gray);
    border-color: #ced4da;
}

.calendar-btn:active {
    background-color: #e9ecef;
}

.input-group:focus-within .calendar-btn {
    border-color: #86b7fe;
}

.input-group .custom-date-input:focus {
    border-right-color: #ced4da;
}

/* Flatpickr Spanish Calendar Styling */
.flatpickr-calendar {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    z-index: 99999 !important;
}

/* Ensure flatpickr calendar appears above modals */
.flatpickr-calendar.open {
    z-index: 99999 !important;
}

.flatpickr-months .flatpickr-month {
    background: var(--primary-blue);
    color: white;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--primary-blue);
    color: white;
    -webkit-text-fill-color: white;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: white;
    color: #333;
    -webkit-text-fill-color: #333;
}

/* Fix month dropdown text visibility in modals */
.modal .flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months,
select.flatpickr-monthDropdown-months {
    background: var(--primary-blue) !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.modal .flatpickr-current-month .flatpickr-monthDropdown-months option,
.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months option,
select.flatpickr-monthDropdown-months option {
    background: white !important;
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
}

.flatpickr-current-month input.cur-year {
    background: transparent !important;
    color: white !important;
}

/* Fix year display in modals - ensure visibility */
.modal .flatpickr-current-month input.cur-year,
.flatpickr-calendar .flatpickr-current-month input.cur-year,
input.cur-year[type="number"] {
    background: transparent !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
}

.flatpickr-weekdays {
    background: var(--light-gray);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.flatpickr-day.today {
    border-color: var(--primary-blue);
}

.flatpickr-day:hover {
    background: rgba(13, 110, 253, 0.1);
}

/* Ensure flatpickr calendar elements are always clickable */
.flatpickr-calendar,
.flatpickr-calendar * {
    pointer-events: auto !important;
}

.flatpickr-day {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Required Field Asterisk */
.text-danger {
    color: var(--danger-red) !important;
}

/* Action Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    margin-right: 0.25rem;
}

.btn-edit {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-edit:hover {
    background-color: var(--primary-blue);
    color: white;
}

.btn-activate {
    color: var(--success-green);
    border-color: var(--success-green);
}

.btn-activate:hover {
    background-color: var(--success-green);
    color: white;
}

.btn-deactivate {
    color: var(--danger-red);
    border-color: var(--danger-red);
}

.btn-deactivate:hover {
    background-color: var(--danger-red);
    color: white;
}

.btn-pending {
    color: var(--warning-yellow);
    border-color: var(--warning-yellow);
}

.btn-pending:hover {
    background-color: var(--warning-yellow);
    color: #000;
}

/* POS Specific Styles */
.cart-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cart-item {
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    position: relative;
    background-color: white;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.25rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.125rem;
    line-height: 1.2;
}

.cart-item-code {
    font-size: 0.7rem;
    color: #6c757d;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--primary-blue);
    font-weight: 500;
}

.cart-item-remove {
    color: var(--danger-red);
    cursor: pointer;
    font-size: 1rem;
}

.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.quantity-control button {
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-control input {
    width: 36px;
    text-align: center;
    padding: 0.15rem;
    font-size: 0.8rem;
}

.cart-item-subtotal {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--success-green);
}

/* Payment Method Buttons */
.payment-methods {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}


.payment-methods .btn {
    flex: 1;
    min-width: 100px;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

/* Modal Improvements */
.modal.show {
    display: block !important;
    pointer-events: auto !important;
}

/* Ensure the modal element itself can receive clicks (for click-outside-to-close) */
.modal {
    pointer-events: auto;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Global Alert and Confirm Modals - NUCLEAR Z-INDEX - Always on top */
#globalAlertModal,
#globalConfirmModal {
    z-index: 99999 !important;
    position: fixed !important;
    isolation: isolate !important;
}

#globalAlertModal.show,
#globalConfirmModal.show {
    z-index: 99999 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#globalAlertModal .modal-dialog,
#globalConfirmModal .modal-dialog {
    z-index: 100000 !important;
    position: relative !important;
}

#globalAlertModal .modal-content,
#globalConfirmModal .modal-content {
    z-index: 100001 !important;
    position: relative !important;
    pointer-events: auto !important;
}

#globalAlertModal ~ .modal-backdrop,
#globalConfirmModal ~ .modal-backdrop {
    z-index: 99998 !important;
}

/* Ensure global alert/confirm modal backdrops are always on top */
#globalAlertModal.show ~ .modal-backdrop,
#globalConfirmModal.show ~ .modal-backdrop,
.modal-backdrop.globalAlertBackdrop,
.modal-backdrop.globalConfirmBackdrop {
    z-index: 99998 !important;
}

/* Salary and Purchase Modals - Proper z-index */
#newSalaryModal,
#newPurchaseModal,
#detailsModal {
    z-index: 1055 !important;
}

/* Add Type Modal - higher z-index to appear above productModal */
#addTypeModal {
    z-index: 1070 !important;
}

#addTypeModal .modal-dialog {
    z-index: 1071 !important;
}

/* Modal backdrop should be BELOW the modal - FORCE IT */
.modal-backdrop {
    z-index: 1040 !important;
}

/* Override ANY backdrop that tries to be higher */
.modal-backdrop.show,
.modal-backdrop.fade,
div.modal-backdrop {
    z-index: 1040 !important;
    max-z-index: 1040 !important;
}

#newSalaryModal .modal-dialog,
#newPurchaseModal .modal-dialog,
#detailsModal .modal-dialog {
    z-index: 1060 !important;
    position: relative;
}

/* Ensure modal content is clickable and on top */
.modal-dialog {
    pointer-events: auto !important;
}

.modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1061 !important;
}

/* Disable modal fade animation - show instantly */
.modal.fade {
    transition: none !important;
    opacity: 1 !important;
}

.modal.fade .modal-dialog {
    transition: none !important;
    transform: none !important;
}

.modal-backdrop.fade {
    transition: none !important;
    opacity: 0.5 !important;
}

/* Fix for grayed out modal content */
.modal.fade.show {
    pointer-events: auto !important;
}

.modal.fade.show .modal-dialog {
    pointer-events: auto !important;
}

/* Ensure form controls in modals are interactive */
.modal-body input,
.modal-body select,
.modal-body textarea,
.modal-body button {
    pointer-events: auto !important;
    z-index: auto !important;
}

/* Form Improvements */
.form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alert Messages */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-green);
}

.alert-danger {
    border-left-color: var(--danger-red);
}

.alert-warning {
    border-left-color: var(--warning-yellow);
}

.alert-info {
    border-left-color: var(--primary-blue);
}

/* Loading Spinner */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .payment-methods {
        flex-direction: column;
    }

    .payment-methods .btn {
        width: 100%;
    }

    .menu-horizontal .nav {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .filter-section {
        display: none !important;
    }

    .container-fluid {
        width: 100%;
        max-width: 100%;
    }
}

/* Footer */
.footer {
    margin-top: auto;
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.text-nowrap {
    white-space: nowrap;
}

/* Currency/Money Amount Styling - Always Right Aligned */
.money-amount,
.currency-amount,
td.money,
th.money,
.price-column,
.total-column,
.amount-column {
    text-align: right !important;
}

/* Stats cards with money values - right align the value */
.stats-card .stats-value.money-amount {
    text-align: right !important;
}

/* Table cells containing currency symbols should be right aligned */
td:has(> :first-child:is([data-currency])),
td[data-type="money"],
td[data-type="currency"],
td[data-type="price"],
td[data-type="amount"] {
    text-align: right !important;
}

/* Remove arrows from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Date inputs - show pointer cursor */
input[type="date"] {
    cursor: pointer !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer !important;
}

/* Global Toast Notifications */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
    min-width: 250px;
}

.toast-notification.toast-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #198754;
}

.toast-notification.toast-error {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

.toast-notification.toast-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.toast-notification.toast-info {
    background-color: #cff4fc;
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

.toast-notification i {
    font-size: 1.2rem;
}

.toast-notification.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive toast positioning */
@media (max-width: 576px) {
    #toast-container {
        left: 10px;
        right: 10px;
        top: 70px;
    }

    .toast-notification {
        max-width: 100%;
        min-width: auto;
    }
}

/* ========================================
   Multi-Select Filter Dropdown Styles
   ======================================== */

.multi-select-filter {
    position: relative;
    width: 100%;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background-color: #fff;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.multi-select-trigger:hover {
    border-color: #86b7fe;
}

.multi-select-trigger.open {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.multi-select-trigger .selected-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 0.5rem;
}

.multi-select-trigger .selected-count {
    background-color: var(--primary-blue);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    margin-right: 0.5rem;
    font-weight: 600;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background-color: #fff;
    border: 1px solid #86b7fe;
    border-top: none;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.multi-select-dropdown.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    border-bottom: 1px solid #f0f0f0;
}

.multi-select-option:last-child {
    border-bottom: none;
}

.multi-select-option:hover {
    background-color: rgba(13, 110, 253, 0.08);
}

.multi-select-option.selected {
    background-color: rgba(13, 110, 253, 0.12);
}

.multi-select-option.all-option {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.multi-select-option.all-option:hover {
    background-color: #e9ecef;
}

.multi-select-option .option-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    flex-shrink: 0;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

.multi-select-option .option-label {
    flex: 1;
    user-select: none;
}

/* Search wrapper for searchable multi-select */
.multi-select-search-wrapper {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.multi-select-search {
    width: 100%;
}

.multi-select-options-container {
    max-height: 250px;
    overflow-y: auto;
}

/* Badge for selected items in trigger */
.multi-select-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: calc(100% - 2rem);
}

.multi-select-badge {
    display: inline-flex;
    align-items: center;
    background-color: #e7f1ff;
    color: var(--primary-blue);
    font-size: 0.8rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hide checkbox for "Todos" option only */
.multi-select-option.all-option .option-checkbox {
    display: none;
}

/* Disabled options in multi-select */
.multi-select-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.multi-select-option.disabled:hover {
    background-color: #f8f9fa;
}

.multi-select-option.disabled .option-checkbox {
    cursor: not-allowed;
}

.multi-select-option.disabled .option-label {
    color: #6c757d;
}

/* Count badge in multi-select options */
.multi-select-option .option-count {
    margin-left: auto;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.multi-select-option.disabled .option-count {
    background-color: #f1f3f5;
    color: #adb5bd;
}

/* Responsive adjustments for multi-select */
@media (max-width: 768px) {
    .multi-select-dropdown {
        max-height: 250px;
    }

    .multi-select-badge {
        max-width: 100px;
    }
}

/* Data Loaded Message - Consistent styling across all pages */
.data-loaded-msg {
    font-size: 0.875rem;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.data-loaded-msg i {
    color: var(--success-green);
    font-size: 0.9rem;
}
