/* ── UI Components ── */

/* Card title */
.card .card-title {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

/* ── Forms ── */
.form-control,
.form-control-sm,
.form-select {
    background-color: #f7f7f7 !important;
    border: none !important;
    box-shadow: none !important;
    color: #444 !important;
    transition: background-color 0.3s ease !important;
}
.form-control-sm {
    min-height: 34px !important;
}
.form-control:hover,
.form-control-sm:hover,
.form-select:hover {
    background-color: #ededed !important;
}
.form-control:focus,
.form-control-sm:focus,
.form-select:focus {
    background-color: #ededed !important;
}
.form-control::placeholder,
.form-control-sm::placeholder {
    color: #999 !important;
    opacity: 1;
}

/* Checkboxes */
.form-check-input {
    background-color: #f7f7f7 !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease !important;
}
.form-check-input:hover {
    background-color: #ededed !important;
}
.form-check-input:checked {
    background-color: #eb81a7 !important;
    border: none !important;
}

/* Form switches */
.form-switch .form-check-input {
    margin-left: 0 !important;
    border-radius: 4px !important;
    --bs-form-switch-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Crect x='-2.5' y='-2.5' width='5' height='5' rx='1.2' fill='rgba(0,0,0,0.25)'/%3E%3C/svg%3E") !important;
}
.form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Crect x='-2.5' y='-2.5' width='5' height='5' rx='1.2' fill='%23fff'/%3E%3C/svg%3E") !important;
}
.form-switch-lg .form-check-label {
    font-size: 14px;
    margin-left: 8px;
    vertical-align: -1px;
}
.form-switch-lg .form-check-input + .form-check-label { color: #999; }
.form-switch-lg .form-check-input:checked + .form-check-label { color: #444; }

/* Permissions switches — input-like appearance */
#editAffiliateModal .form-check.form-switch.form-switch-lg {
    padding: 0 0.8rem;
    padding-left: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    min-height: 34px;   
}
#editAffiliateModal .form-check.form-switch.form-switch-lg .form-check-input {
    margin-right: 8px;
    flex-shrink: 0;
}
#editAffiliateModal .form-check.form-switch.form-switch-lg .form-check-label {
    margin-left: 0;
}

/* Table toggle switches — contrast with table background */
.table-switch .form-check-input {
    background-color: #fff !important;
}
.table-switch .form-check-input:checked {
    background-color: #eb81a7 !important;
}

/* Form-select native arrow */
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-size: 14px !important;
    background-position: right 10px center !important;
}

/* ── Select2 Single ── */
.select2-container--default .select2-selection--single {
    background-color: #f7f7f7 !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease !important;
}
.select2-container--default .select2-selection--single:hover {
    background-color: #ededed !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #444 !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%);
    width: 20px !important;
    height: auto !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}
.select2-container--open .select2-selection--single .select2-selection__arrow::after {
    transform: rotate(180deg);
}

/* Select2 Multiple */
.select2-container--default .select2-selection--multiple {
    background-color: #f7f7f7 !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease !important;
    min-height: 10px !important;
    line-height: 1.4;
}
.select2-container--default .select2-selection--multiple:hover {
    background-color: #ededed !important;
}

/* Select2 Dropdown */
.select2-dropdown {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.12) !important;
    margin-top: 6px !important;
    border-radius: 4px !important;
    overflow: hidden;
    background-color: #fff !important;
    padding: 6px !important;
}
.select2-container--open .select2-dropdown--below {
    border-top-left-radius: 4px !important;
    border-top-right-radius: 4px !important;
}
.select2-container--open .select2-dropdown--above {
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
    margin-top: -4px !important;
}
.select2-container--default .select2-results > .select2-results__options {
    padding: 0 !important;
}
.select2-results__options {
    border-radius: 0 0 4px 4px !important;
    background-color: #fff !important;
}
.select2-search--dropdown {
    padding: 0 0 4px 0 !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #f7f7f7 !important;
    border: none !important;
    color: #444 !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    height: 32px !important;
    font-size: 13px !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: #999 !important;
}
.select2-results__option {
    padding: 6px 10px !important;
    font-size: 13px !important;
    border-radius: 4px !important;
    margin-top: 4px !important;
}
.select2-results__option:first-child {
    margin-top: 0 !important;
}
.select2-container--default .select2-results__option--selected {
    background-color: #f7f7f7 !important;
    color: #444 !important;
    position: relative;
    padding-right: 30px !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #f7f7f7 !important;
    color: #444 !important;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #f7f7f7 !important;
    color: inherit !important;
}
.select2-results__option .form-check-input,
.select2-results__option input[type="checkbox"] {
    display: none !important;
}
.select2-container--default .select2-results__option--selected::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ── Daterangepicker ── */
.daterangepicker {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.12) !important;
    border-radius: 4px !important;
    background-color: #fff !important;
    font-family: inherit !important;
    font-size: 13px !important;
    padding: 4px !important;
}
.daterangepicker:before,
.daterangepicker:after,
.daterangepicker::before,
.daterangepicker::after {
    display: none !important;
    border: none !important;
    content: none !important;
}
.daterangepicker .drp-calendar.left  { padding: 8px 4px 8px 8px !important; }
.daterangepicker .drp-calendar.right { padding: 8px 8px 8px 4px !important; }
.daterangepicker.single .drp-calendar.left { padding: 8px !important; }
.daterangepicker .calendar-table {
    border: none !important;
    background-color: #fff !important;
}
.daterangepicker .calendar-table th,
.daterangepicker .calendar-table td {
    border: none !important;
    font-size: 12px !important;
    color: #666 !important;
}
.daterangepicker .calendar-table th.month {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #333 !important;
}
.daterangepicker .calendar-table th.next,
.daterangepicker .calendar-table th.prev { color: #999 !important; }
.daterangepicker .calendar-table .next span,
.daterangepicker .calendar-table .prev span { border-color: #999 !important; }
.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
    background-color: #f7f7f7 !important;
    color: #333 !important;
    border-radius: 4px !important;
}
.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
    color: #ccc !important;
    background-color: transparent !important;
}
.daterangepicker td.in-range {
    background-color: #f7f7f7 !important;
    color: #333 !important;
    border-radius: 0 !important;
}
.daterangepicker td.active,
.daterangepicker td.active:hover {
    background: linear-gradient(243deg, #e88aa8, #e1467d) !important;
    color: #fff !important;
    border-radius: 4px !important;
}
.daterangepicker td.start-date { border-radius: 4px 0 0 4px !important; }
.daterangepicker td.end-date   { border-radius: 0 4px 4px 0 !important; }
.daterangepicker td.start-date.end-date { border-radius: 4px !important; }
.daterangepicker td.disabled {
    color: #ccc !important;
    text-decoration: none !important;
}
.daterangepicker select.monthselect,
.daterangepicker select.yearselect,
.daterangepicker select.hourselect,
.daterangepicker select.minuteselect,
.daterangepicker select.secondselect,
.daterangepicker select.ampmselect {
    background-color: #f7f7f7 !important;
    border: none !important;
    color: #444 !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
}
.daterangepicker select:hover { background-color: #ededed !important; }
.daterangepicker .calendar-time {
    border: none !important;
    color: #666 !important;
    padding: 4px 0 !important;
    margin: 8px 0 0 0 !important;
}
.daterangepicker .calendar-time select {
    padding: 4px 6px !important;
    height: auto !important;
    line-height: 1.4 !important;
}
.daterangepicker .drp-buttons {
    border-top: none !important;
    padding: 8px 12px 12px 12px !important;
}
.daterangepicker .drp-buttons .btn-primary {
    background: linear-gradient(243deg, #e88aa8, #e1467d) !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    padding: 5px 14px !important;
}
.daterangepicker .drp-buttons .btn-primary:hover { filter: brightness(1.1) !important; }
.daterangepicker .drp-buttons .cancelBtn {
    background-color: #f7f7f7 !important;
    border: none !important;
    color: #444 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    padding: 5px 14px !important;
}
.daterangepicker .drp-buttons .cancelBtn:hover { background-color: #ededed !important; }
.daterangepicker .drp-selected {
    color: #999 !important;
    font-size: 12px !important;
}
.daterangepicker .ranges { padding: 0 !important; margin: 0 !important; }
.daterangepicker .ranges ul { padding: 8px !important; }
.daterangepicker .ranges li {
    background-color: #f7f7f7 !important;
    border: none !important;
    border-radius: 4px !important;
    color: #666 !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
    margin-bottom: 4px !important;
}
.daterangepicker .ranges li:last-child { margin-bottom: 0 !important; }
.daterangepicker .ranges li:hover {
    background-color: #ededed !important;
    color: #333 !important;
}
.daterangepicker .ranges li.active {
    background: linear-gradient(243deg, #e88aa8, #e1467d) !important;
    color: #fff !important;
}
.daterangepicker .drp-calendar.left .calendar-table,
.daterangepicker .drp-calendar.right .calendar-table { border: none !important; }
.daterangepicker.show-ranges .drp-calendar.left,
.daterangepicker .drp-calendar.left,
.daterangepicker .drp-calendar.right { border: none !important; }

/* ── Filter buttons (statistic) ── */
.filter-buttons button {
    background-color: #f7f7f7 !important;
    border: none !important;
    color: #666 !important;
}
.filter-buttons button:hover {
    background-color: #ededed !important;
    color: #444 !important;
}
.filter-buttons button[disabled] {
    background: #ffd6ea !important;
    color: #666 !important;
}
.filter-buttons .filter-level-2 button[disabled] {
    background: #b8f0bb !important;
    color: #666 !important;
}
.filter-buttons .filter-level-3 button[disabled] {
    background: #fce89a !important;
    color: #666 !important;
}

/* ── MGS Multiselect ── */
.mgs_multiselect-container {
    position: relative;
    max-width: 100%;
}
.mgs_select-box {
    max-width: 100%;
    padding: 0.391rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #f7f7f7 !important;
    border: none !important;
    color: #444 !important;
    transition: background-color 0.3s ease !important;
    position: relative;
    padding-right: 30px !important;
}
.mgs_select-box:hover { background-color: #ededed !important; }
.mgs_select-box.mgs_active { border-radius: 4px; }
.mgs_select-box::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: transform 0.3s ease;
}
.mgs_select-box.mgs_active::after { transform: translateY(-50%) rotate(180deg); }
.mgs_options-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    border-radius: 4px;
    z-index: 1052;
    max-height: 200px;
    overflow-y: auto;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.12) !important;
    background-color: #fff !important;
    padding: 6px !important;
}
.mgs_options-list label {
    display: block;
    position: relative;
    padding: 6px 30px 6px 10px;
    margin: 4px 0 0 0;
    border-radius: 4px;
    cursor: pointer;
}
.mgs_options-list label:hover { background-color: #f7f7f7; }
.mgs_options-list label:has(input:checked) {
    background-color: #f7f7f7;
    color: #444;
}
.mgs_options-list label:has(input:checked)::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}
.mgs_options-list input[type="checkbox"] { display: none; }
.mgs_search-box-outer { margin: 0 0 4px 0; }
.mgs_search-box {
    display: block;
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #444;
    appearance: none;
    background-clip: padding-box;
    border-radius: 4px;
    box-shadow: none;
    outline: none;
    background-color: #f7f7f7 !important;
    border: none !important;
    transition: background-color 0.3s ease !important;
    height: 32px !important;
}
.mgs_search-box:focus {
    background-color: #f7f7f7 !important;
    color: #444;
    outline: 0;
    border: none !important;
}
.mgs_search-box::placeholder { color: #999 !important; }

/* ── Buttons ── */
.btn-gradient {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    background: linear-gradient(243deg, #e88aa8, #e1467d);
    color: #fff !important;
    padding: 7px 10px;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.3s ease;
}
.btn-gradient .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 8px;
    position: relative;
}
.btn-gradient .btn-icon svg {
    position: relative;
    width: 16px !important;
    height: 16px !important;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
/* Arrow overlay on hover — shows arrow-right replacing original icon */
.btn-gradient .btn-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") no-repeat center / contain;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.btn-gradient:hover .btn-icon svg {
    opacity: 0;
}
.btn-gradient:hover .btn-icon::after {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(4px);
}
.modal-header { background-color: #f7f7f7 !important; border-bottom-color: #f7f7f7 !important; }
.modal-footer { background-color: #ffffff !important; border-top-color: #f7f7f7 !important; }
/* Modal save buttons already have arrow-right — just shift, don't swap */
.modal-footer .btn-gradient .btn-icon::after { display: none; }
.modal-footer .btn-gradient .btn-icon svg { transition: transform 0.25s ease; }
.modal-footer .btn-gradient:hover .btn-icon svg { opacity: 1; transform: translateX(4px); }
.btn-gradient:hover { filter: brightness(1.1); color: #fff !important; }
.btn-gradient:focus { box-shadow: none !important; outline: none !important; }
.btn-gradient:disabled, .btn-gradient.disabled { opacity: 0.65; pointer-events: none; filter: none; border: 0; }
.btn-gradient.is-saved { opacity: 1; }
.btn-gradient.is-saved .btn-icon svg { transform: translateX(4px); }
.modal-footer .btn-gradient { width: auto; border: 0; display: inline-flex; }
.modal-footer .btn-secondary.btn-sm { padding: calc(0.391rem - 1px) 0.8rem; font-size: 0.812rem; }
.btn-gradient.btn-sm { padding: 0.391rem 0.8rem; font-size: 0.812rem; border: 0; }
.btn-gradient.btn-sm .btn-icon { width: 14px; height: 14px; }
.btn-gradient.btn-sm .btn-icon svg { width: 14px !important; height: 14px !important; }
.btn-gradient.btn-sm .btn-icon::after { width: 14px; height: 14px; }
.btn-primary {
    background: linear-gradient(243deg, #e88aa8, #e1467d) !important;
    border: none !important;
    transition: filter 0.3s ease !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(243deg, #e88aa8, #e1467d) !important;
    filter: brightness(1.1) !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}
.btn:focus,
.btn:active:focus,
.btn-close:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Reset filter */
.btn-reset-filter {
    color: #999;
    text-decoration: underline dashed;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.3s ease;
    font-size: 13px;
    margin-bottom: -2px;
}
.btn-reset-filter:hover { color: #333; }
.btn-reset-filter svg,
.btn-reset-filter i {
    width: 12px !important;
    height: 12px !important;
    vertical-align: -2px;
    margin-right: -1px;
}
/* Hide filters toggle */
.hide_show_filters .link-icon {
    width:20px !important;
    height: 20px !important;
    vertical-align: -3px;
}

/* ── Pagination ── */
.pagination { gap: 4px; }
.page-item .page-link {
    background-color: #f7f7f7;
    border: none;
    color: #666;
    border-radius: 4px !important;
    padding: 5px 10px;
    font-size: 13px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.page-item .page-link:hover { background-color: #ededed; color: #333; }
.page-item .page-link:focus { box-shadow: none; outline: none; }
.page-item.active .page-link,
.page-item .page-link.active {
    background: linear-gradient(243deg, #e88aa8, #e1467d) !important;
    color: #fff !important;
    border: none;
}
.page-item.active .page-link:hover,
.page-item .page-link.active:hover { filter: brightness(1.1); }

/* ── Search input ── */
.search-input-wrapper { position: relative; }
.search-input-wrapper .form-control { padding-right: 32px !important; }
.search-input-wrapper .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #999;
}

/* ── Sidebar tooltips ── */
.tooltip-sidebar .tooltip-inner {
    background: #1e1e2f;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 10px;
}
.tooltip-sidebar.bs-tooltip-end .tooltip-arrow::before,
.tooltip-sidebar.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before { border-right-color: #1e1e2f; }
.tooltip-sidebar.bs-tooltip-start .tooltip-arrow::before,
.tooltip-sidebar.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before { border-left-color: #1e1e2f; }
.tooltip-sidebar.bs-tooltip-top .tooltip-arrow::before,
.tooltip-sidebar.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before { border-top-color: #1e1e2f; }
.tooltip-sidebar.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip-sidebar.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before { border-bottom-color: #1e1e2f; }

/* Status history tooltip */
.tooltip-status-history .tooltip-inner {
    text-align: left;
    max-width: 320px;
}

/* ── Filters panel ── */
#filters_tab {
    transition: max-width 1s;
    max-width: 100%;
}
#filters_tab.closed { max-width: 0px; display: none; }
#filters_tab .card-body { opacity: 0; }
#filters_tab .card-body:not(.filters-ready) * { transition: none !important; }
#filters_tab .card-body.filters-ready { opacity: 1; transition: opacity 0.15s ease; }

/* compact horizontal spacing inside filter cards */
#filters_tab .card-body .row { --bs-gutter-x: 0.4rem; }

.hide_show_filters svg { width: 18px !important; height: 18px !important; }
.show-phone .hide_show_filters svg { width: 16px !important; height: 16px !important; }
.hide_show_filters.disabled { pointer-events: none; opacity: 0.35; cursor: default; }
.show-phone .hide_show_filters.disabled { pointer-events: none; opacity: 0.35; }

/* ── Data-tooltip (legacy) ── */
[data-tooltip],
.tooltip {
    position: relative;
    cursor: pointer;
}
[data-tooltip]:before,
[data-tooltip]:after,
.tooltip:before,
.tooltip:after {
    position: absolute;
    visibility: hidden;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
    opacity: 0;
    -webkit-transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, -webkit-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
    -moz-transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, -moz-transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, transform 0.2s cubic-bezier(0.71, 1.7, 0.77, 1.24);
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    pointer-events: none;
}
[data-tooltip]:hover:before,
[data-tooltip]:hover:after,
[data-tooltip]:focus:before,
[data-tooltip]:focus:after,
.tooltip:hover:before,
.tooltip:hover:after,
.tooltip:focus:before,
.tooltip:focus:after {
    visibility: visible;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
    opacity: 1;
}
.tooltip:before,
[data-tooltip]:before {
    z-index: 1001;
    border: 6px solid transparent;
    background: transparent;
    content: "";
}
.tooltip:after,
[data-tooltip]:after {
    z-index: 1000;
    padding: 8px;
    width: 160px;
    background-color: hsla(0, 0%, 20%, 0.9);
    color: #fff;
    content: attr(data-tooltip);
    font-size: 14px;
    line-height: 1.2;
}
/* Top (default) */
[data-tooltip]:before, [data-tooltip]:after,
.tooltip:before, .tooltip:after,
.tooltipnew-top:before, .tooltipnew-top:after { bottom: 100%; left: 50%; }
[data-tooltip]:before, .tooltip:before, .tooltipnew-top:before {
    margin-left: -6px; margin-bottom: -12px;
    border-top-color: hsla(0, 0%, 20%, 0.9);
}
[data-tooltip]:after, .tooltip:after, .tooltipnew-top:after { margin-left: -80px; }
[data-tooltip]:hover:before, [data-tooltip]:hover:after,
[data-tooltip]:focus:before, [data-tooltip]:focus:after,
.tooltip:hover:before, .tooltip:hover:after,
.tooltip:focus:before, .tooltip:focus:after,
.tooltipnew-top:hover:before, .tooltipnew-top:hover:after,
.tooltipnew-top:focus:before, .tooltipnew-top:focus:after {
    -webkit-transform: translateY(-12px);
    -moz-transform: translateY(-12px);
    transform: translateY(-12px);
}
/* Left */
.tooltipnew-left:before, .tooltipnew-left:after { right: 100%; bottom: 50%; left: auto; }
.tooltipnew-left:before {
    margin-left: 0; margin-right: -12px; margin-bottom: 0;
    border-top-color: transparent;
    border-left-color: hsla(0, 0%, 20%, 0.9);
}
.tooltipnew-left:hover:before, .tooltipnew-left:hover:after,
.tooltipnew-left:focus:before, .tooltipnew-left:focus:after {
    -webkit-transform: translateX(-12px);
    -moz-transform: translateX(-12px);
    transform: translateX(-12px);
}
/* Bottom */
.tooltipnew-bottom:before, .tooltipnew-bottom:after { top: 100%; bottom: auto; left: 50%; }
.tooltipnew-bottom:before {
    margin-top: -12px; margin-bottom: 0;
    border-top-color: transparent;
    border-bottom-color: hsla(0, 0%, 20%, 0.9);
}
.tooltipnew-bottom:hover:before, .tooltipnew-bottom:hover:after,
.tooltipnew-bottom:focus:before, .tooltipnew-bottom:focus:after {
    -webkit-transform: translateY(12px);
    -moz-transform: translateY(12px);
    transform: translateY(12px);
}
/* Right */
.tooltipnew-right:before, .tooltipnew-right:after { bottom: 50%; left: 100%; }
.tooltipnew-right:before {
    margin-bottom: 0; margin-left: -12px;
    border-top-color: transparent;
    border-right-color: hsla(0, 0%, 20%, 0.9);
}
.tooltipnew-right:hover:before, .tooltipnew-right:hover:after,
.tooltipnew-right:focus:before, .tooltipnew-right:focus:after {
    -webkit-transform: translateX(12px);
    -moz-transform: translateX(12px);
    transform: translateX(12px);
}
.tooltipnew-left:before, .tooltipnew-right:before { top: 3px; }
.tooltipnew-left:after, .tooltipnew-right:after { margin-left: 0; margin-bottom: -16px; }

/* ── Preloaders ── */
#filtered_table .card { position: relative; }
.preloader-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, #e1467d 50%, #e88aa8 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    animation: preloader-spin 0.7s linear infinite;
}
.card-preloader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 0.25rem;
    opacity: 0;
    pointer-events: none;
}
.card-preloader.active { opacity: 1; pointer-events: auto; }
.card-preloader.hiding { transition: opacity 0.3s ease; opacity: 0; pointer-events: none; }
.table-preloader {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.table-preloader.active { opacity: 1; pointer-events: auto; }
.table-preloader.hiding { transition: opacity 0.3s ease; opacity: 0; pointer-events: none; }
@keyframes preloader-spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal.fade .modal-dialog { transform: none !important; transition: opacity 0.2s ease !important; }
.modal.fade { transition: opacity 0.2s ease !important; }

/* ── Flatpickr z-index fix for Bootstrap modals ── */
.flatpickr-calendar {
    z-index: 10060 !important;
}

/* ── Two-step time picker ── */
.tp-wrap { position: relative; }
.tp-display {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.391rem 0.8rem; font-size: 0.812rem; font-weight: 400;
    line-height: 1.5; color: #444; background: #f7f7f7;
    border: none; border-radius: 0.25rem;
    cursor: pointer; user-select: none;
    transition: background-color .3s ease;
    height: auto;
}
.tp-display::after {
    content: '';
    display: block;
    width: 14px; height: 14px; margin-left: 6px; flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat;
    transition: transform .3s ease;
    border: none;
}
.tp-display:hover { background: #ededed; }
.tp-display.tp-open {
    background: #ededed;
}
.tp-display.tp-open::after {
    transform: rotate(180deg);
}
.tp-dropdown {
    display: none; position: absolute; top: 100%; left: 0;
    width: max-content; margin-top: 8px; background: #fff;
    border: none; border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    z-index: 1060; padding: 6px;
}
.tp-dropdown.tp-show { display: block; }
.tp-dropdown .tp-label {
    font-size: 11px; color: #999; text-transform: uppercase;
    letter-spacing: .5px; margin-bottom: 0; padding: 4px 0 6px 0;
}
.tp-dropdown .tp-grid {
    display: grid; gap: 3px;
}
.tp-dropdown .tp-grid.tp-hours { grid-template-columns: repeat(6, 1fr); }
.tp-dropdown .tp-grid.tp-minutes { grid-template-columns: repeat(4, 1fr); }
.tp-dropdown .tp-grid button {
    padding: 5px; width: 30px; font-size: 13px; text-align: center;
    border: 0; border-radius: 4px; background: #f7f7f7;
    color: #333; cursor: pointer; transition: all .12s;
    line-height: 1.3;
}
.tp-dropdown .tp-grid button:hover {
    background: #fff0f5; color: #c4567a;
}
.tp-dropdown .tp-grid button.tp-active {
    background: #eb81a7; color: #fff; font-weight: 600;
}
.tp-dropdown .tp-back {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; color: #eb81a7; cursor: pointer;
    margin-bottom: 4px; border: none; background: none; padding: 0;
}
.tp-dropdown .tp-back:hover { text-decoration: underline; }

/* ── Inline Drum Timepicker (working hours) — legacy ── */
.drum-picker-inline {
    position: relative;
    display: flex;
    background: #f7f7f7;
    border-radius: 4px;
    padding: 4px 2px;
    flex: 1;
    min-width: 0;
}
.drum-picker-inline:hover {
    background: #ededed;
}
.drum-picker-wheels {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0;
}
.drum-picker-wheel {
    height: 76px;          /* 3 visible items × ~25px */
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    text-align: center;
    scrollbar-width: none;
}
.drum-picker-wheel::-webkit-scrollbar { display: none; }
.drum-picker-wheel div {
    height: 25.2px;
    line-height: 25.2px;
    font-size: 13px;
    color: #aaa;
    scroll-snap-align: center;
    transition: color .15s, font-weight .15s;
    cursor: pointer;
    user-select: none;
}
.drum-picker-wheel div.drum-pad {
    scroll-snap-align: none;
    cursor: default;
}
.drum-picker-wheel div.active {
    color: #333;
    font-weight: 600;
}
.drum-picker-sep {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 0 1px;
    line-height: 76px;
}
.drum-picker-highlight {
    position: absolute;
    left: 3px;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    height: 26px;
    background: rgb(255, 230, 240);
    border-radius: 4px;
    pointer-events: none;
    z-index: 0;
}
.drum-picker-wheel {
    position: relative;
    z-index: 1;
}
@keyframes custom-fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Online status pulse ── */
.status-online {
    position: relative;
    display: inline-block;
}
.status-pulse-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 0;
    vertical-align: 4px;
}
.status-pulse-icon > svg,
.status-pulse-icon > i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.status-pulse-icon::before,
.status-pulse-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(76, 175, 80, 0.55);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: statusPulseWave 1.8s ease-out infinite;
    pointer-events: none;
}
.status-pulse-icon::after {
    animation-delay: 0.7s;
}
@keyframes statusPulseWave {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* ── Rounded override ── */
.rounded-circle {
    border-radius: 6px !important;
}

/* ── Navbar logo ── */
.navbar .logo-mini-wrapper .logo-mini { width: 32px !important; }

/* ── Statistic chevron icons ── */
svg.stat-chevron { vertical-align: -4px; }

/* ── Card titles ── */
.card .card-title { font-size: 1rem; }

/* ── Card overflow: allow dropdowns to escape ── */
.card, .card-body { overflow: visible !important; }

/* ── Sidebar active indicator: right side ── */
.sidebar .sidebar-body .nav .nav-item.active .nav-link::before {
    left: auto !important;
    right: 0;
    width: 6px;
    border-radius: 2px 0 0 2px;
}
.sidebar .sidebar-body .nav .nav-item.active .nav-link,
.sidebar .sidebar-body .nav .nav-item.active .nav-link .link-title,
.sidebar .sidebar-body .nav .nav-item.active .nav-link .link-icon {
    color: #eb81a7 !important;
}

/* ── Mobile sidebar ── */
@media (max-width: 991px) {
    .sidebar .sidebar-body .nav .nav-item .nav-link .link-title {
        font-size: 15px !important;
    }
    .sidebar .sidebar-body, .sidebar-open .sidebar .sidebar-header{
        border: 0 !important;
    }
    .sidebar .sidebar-body {
        background: color(srgb 0.9999 1 1);
    }
    .sidebar .sidebar-body .nav .nav-item .nav-link .link-icon {
        width: 22px !important;
        height: 22px !important;
    }
    .sidebar .sidebar-body .nav .nav-item .nav-link .link-title {
        margin-left: 34px !important;
    }
    .sidebar .sidebar-header {
        padding: 0 16px !important;
        height: 60px !important;
    }
    .sidebar .sidebar-body .nav {
        padding: 11px 0 40px 16px !important;
    }
    .sidebar .sidebar-body .nav .nav-item.active .nav-link::before {
        right: 0 !important;
    }
    .sidebar .sidebar-body .nav .nav-item.active .nav-link,
    .sidebar .sidebar-body .nav .nav-item.active .nav-link .link-title,
    .sidebar .sidebar-body .nav .nav-item.active .nav-link .link-icon {
        color: #eb81a7 !important;
    }
    .sidebar {
        transition: none !important;
    }
}

/* ── Dropdown items: neutral gray hover/active ── */
.dropdown-item:not(.dropdown-item:active, .dropdown-item.active):hover,
.tt-menu .tt-suggestion:not(.dropdown-item:active, .dropdown-item.active):hover {
    background-color: #f0f0f0 !important;
}
.dropdown-item.active,
.dropdown-item:active,
.tt-menu .active.tt-suggestion,
.tt-menu .tt-suggestion:active {
    background-color: #e8e8e8 !important;
    color: var(--bs-body-color) !important;
}
.dropdown-item.active i,
.dropdown-item.active svg,
.dropdown-item:active i,
.dropdown-item:active svg {
    color: var(--bs-body-color) !important;
}

/* ── Mobile & Tablet: table height ── */
@media (max-width: 991px) {
    .main-wrapper .page-wrapper {
        min-height: auto !important;
        height: auto !important;
    }
    .stretch-card,
    .stretch-card > .card,
    .stretch-card > .card > .card-body {
        min-height: 0 !important;
        height: auto !important;
    }
}
