/* place after bootstrap.css */
.table-fixed {
    table-layout: fixed;
    width: 100%;
}

.table-fixed thead th {
    white-space: nowrap; /*text stays on one line*/
    overflow: hidden; /*extra text is hidden if too long*/
    text-overflow: ellipsis; /*adds … if text is too long*/
}

/* make first column narrow and center the checkbox */
.table-fixed thead th:first-child,
.table-fixed tbody th:first-child {
    width: 40px; /* adjust px as needed */
    text-align: center; /*centers the checkbox left–right*/
    vertical-align: middle; /*centers the checkbox top–bottom*/
}

/* ensure checkbox itself doesn't cause padding growth */
.table-fixed .custom-control {
    padding-left: 0 !important;
    margin: 0 auto; /*centers the checkbox inside the cell*/
    display: inline-block; /*stops it from taking the full width*/
}

.pe-none {
    pointer-events: none !important;
}

.ms-3 {
    margin-inline-start: 1rem !important; /* mirrors ml-3's 1rem value */
}

.me-3 {
    margin-inline-end: 1rem !important; /* mirrors mr-3's 1rem value */
}

/* ==============================================
   Start select2 custom styles
   ============================================== */

.select2-container {
    min-width: 100px;
}

.select2-container--default .select2-selection--single {
    border: 0;
    border-radius: 0;
    background-color: #f7f8fe;
    font-size: 10px;
    min-height: 35px;
}

.select2-results__option {
    font-size: 10px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    padding-inline-start: 8px;
    padding-inline-end: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999;
    position: relative;
    top: 4px;
}

.select2 .selection {
    width: 100% !important;
}

/* Single select */
select.select2.is-invalid + .select2-container .select2-selection--single {
    border-color: #dc3545 !important;
}

/**** Start handle click icon and arrow *****/
/* Make space for clear (X) and arrow */
.select2-container--default .select2-selection--single {
    /*padding-right: 45px;*/
}

/* Clear (X) button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    right: 4px;
    z-index: 2;
    cursor: pointer;
}

/* Dropdown arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    right: 6px;
}

/* RTL support (Arabic) */
[dir="rtl"] .select2-container--default .select2-selection--single {
    padding-left: 0;
    padding-right: initial;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__clear {
    left: 30px;
    right: auto;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 6px;
    right: auto;
}

/**** End handle click icon and arrow *****/

/* Apply invalid styling to the Select2 selection element
   when the original <select> has the .is-invalid class */
select.is-invalid ~ .select2-container .select2-selection--single,
select.is-invalid ~ .select2-container .select2-selection--multiple {
    /* Match Bootstrap's invalid border color */
    border-color: #dc3545 !important;

    /* Bootstrap invalid state icon */
    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-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* LTR: Place the validation icon on the right and reserve space for it */
:dir(ltr) select.is-invalid ~ .select2-container .select2-selection--single,
:dir(ltr) select.is-invalid ~ .select2-container .select2-selection--multiple {
    padding-right: calc(1.5em + 0.75rem);
    background-position: right calc(0.375em + 0.1875rem) center;
}

/* RTL: Mirror the layout by placing the icon on the left */
:dir(rtl) select.is-invalid ~ .select2-container .select2-selection--single,
:dir(rtl) select.is-invalid ~ .select2-container .select2-selection--multiple {
    padding-left: calc(1.5em + 0.75rem);
    background-position: left calc(0.375em + 0.1875rem) center;
}

/* Shrink select2 */
.select2-sm + .select2-container .select2-selection__choice {
    font-size: 11px;
    padding: 1px 5px !important;
}

.select2-sm + .select2-container .select2-selection__choice__display {
    font-size: 11px;
}

/* =============================================
   End select2 custom styles
   ============================================= */

.appended-card-item {
    background-color: rgba(21, 97, 203, 0.1);
    height: auto;
    padding: 20px;
}

.add-new-card-item {
    cursor: pointer;
}

.remove-card-item-btn {
    font-size: 30px;
    margin-top: 35px;
    cursor: pointer
}

.google-map {
    border: 1px solid #ddd;
    border-radius: 8px;
}

.center-vertically {
    display: flex;
    align-items: center;
    min-height: 80px;
}

.coupon-items-wrapper,
.autocomplete-items-wrapper {
    height: 150px;
    overflow: auto;
}

.autocomplete-card {
    padding: 10px;
    background-color: #f5f5f5;
}

.table-scroll-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

/************ start upload **************/
.upload-item, .old-item {
    position: relative;
}

.upload-item .remove-new, .old-item .remove-old {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.upload-item:hover .remove-new, .old-item:hover .remove-old {
    opacity: 1;
}

.upload-img {
    max-height: 150px;
    object-fit: contain;
    width: 100%;
    background-color: #f8f9fa;
}

.file-count {
    background-color: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Different border colors for different field types */
.preview.images .upload-item {
    border-left: 3px solid #3498db;
}

.photos .add-file-container {
    padding: 15px 50px;
    font-size: 18px;
    border-radius: 15px;
    border: 2px dashed #0073b690;
    margin-top: 30px;
    cursor: pointer;
}

.items .img .upload-img {
    max-height: unset;
}

.upload-files::before {
    background-color: unset;
}

.upload-files .items {
    margin-bottom: unset;
}

/********** end upload ***************/

.appended-card-item {
    position: relative;
}

.appended-card-item .remove-card-item-btn.absolute {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px; /* replaces left/right automatically */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.rate-section span.checked {
    color: orange;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.font-100 {
    font-size: 100% !important;
}

.badge-spacing {
    margin-inline-end: 1px !important;
    margin-block-end: 1px !important;
    display: inline-block;
}

.badge-style {
    color: #fff !important;
    font-size: 9px;
}

/** Cropper **/
.cropper-container.cropper-bg {
    width: 770px !important;
}

.list-thumb {
    max-width: 45px;
    max-height: 45px;
    width: auto;
    height: auto;
    object-fit: contain; /* preserves aspect ratio, no cropping/stretching */
}

/* =============================================
   Start Custom Btn Styles
   ============================================= */
.custom_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 40px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
    letter-spacing: 0.01em;
}

/* light overlay on hover, dark press on active — works on any color */
.custom_btn::after {
    content: '';
    position: absolute;
    inset: 0; /* top/right/bottom/left = 0 */
    background: transparent;
    transition: background 0.12s ease;
    pointer-events: none;
}

.custom_btn:hover::after {
    background: rgba(255, 255, 255, 0.12);
}

.custom_btn:active {
    transform: scale(0.97);
}

.custom_btn:active::after {
    background: rgba(0, 0, 0, 0.08);
}

.custom_btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #378add;
}

.custom_btn:disabled,
.custom_btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── filled variants ── */
.custom_btn_blue {
    background: #185fa5;
    color: #fff;
}

.custom_btn_blue:hover {
    color: #fff;
    box-shadow: 0 2px 8px rgba(24, 95, 165, 0.30);
}

.custom_btn_red {
    background: #a32d2d;
    color: #fff;
}

.custom_btn_red:hover {
    box-shadow: 0 2px 8px rgba(163, 45, 45, 0.30);
}

/* ── ghost variants (secondary / destructive secondary) ── */
.custom_btn_ghost {
    background: transparent;
    color: #1a1a1a;
    border: 0.5px solid #aaa;
}

.custom_btn_ghost:hover {
    background: #f5f5f5;
}

.custom_btn_ghost::after {
    display: none;
}

.custom_btn_ghost_blue {
    background: transparent;
    color: #185fa5;
    border: 0.5px solid #85b7eb;
}

.custom_btn_ghost_blue:hover {
    background: #e6f1fb;
}

.custom_btn_ghost_blue::after {
    display: none;
}

.custom_btn_ghost_red {
    background: transparent;
    color: #a32d2d;
    border: 0.5px solid #f09595;
}

.custom_btn_ghost_red:hover {
    background: #fcebeb;
}

.custom_btn_ghost_red::after {
    display: none;
}

/* ── additional filled variants ── */
.custom_btn_info {
    background: #17a2b8;
    color: #fff;
}

.custom_btn_info:hover {
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.30);
}

.custom_btn_success {
    background: #1e7e34;
    color: #fff;
}

.custom_btn_success:hover {
    box-shadow: 0 2px 8px rgba(30, 126, 52, 0.30);
}

/* =============================================
   End Custom Btn Styles
   ============================================= */

.small-btn-list .cont {
    padding: 6px 15px;
    font-size: 10px;
}

.small-btn-list .shape {
    width: 70%;
}

/***************** Summary Card *******************/
.summary-card {
    border-radius: .5rem;
    transition: transform .15s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
    flex-shrink: 0;
}

.period-arrow {
    display: inline-block;
}

[dir="rtl"] .period-arrow {
    transform: scaleX(-1);
}

/* =============================================
   Queue Page Styles
   ============================================= */

.kpi-card {
    background: #fff;
    padding: 20px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f1f1;
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.queue-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s, transform 0.2s;
}

.queue-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.queue-card.active {
    border-left: 4px solid #0d6efd; /* LTR accent */
    background-color: #f8faff;
}

[dir="rtl"] .queue-card.active {
    border-left: 1px solid #eee;
    border-right: 4px solid #0d6efd; /* RTL accent */
}

.queue-card.done {
    background-color: #fcfcfc;
}

.queue-card.done.cancelled {
    background-color: #fff5f5;
}

/* =============================================
   Queue Card Dropdown Styles & Positioning Fix
   ============================================= */
/* 1. Make sure the parent .dropdown has a positioning context */
.queue-card .dropdown {
    position: relative !important;
}

/* 2. Style the menu and set basic position */
.queue-card .dropdown-menu {
    top: 100% !important;
    margin-top: 5px !important;

    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1050;
}

/* 3. Align correctly for Arabic (RTL) */
[dir="rtl"] .queue-card .dropdown-menu {
    left: 0;
    right: unset;
}

/* 4. Align correctly for English (LTR) */
[dir="ltr"] .queue-card .dropdown-menu {
    left: 0 !important;
    right: auto !important;
}

/* 5. Dropdown Item Styles */
.queue-card .dropdown-item {
    padding: 8px 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.queue-card .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #333;
}

/* ---- icon picker (see public/assets/admin/js/cms-icon-picker.js) ---- */
.cms-icon-trigger {
    display: flex;
    align-items: center;
    gap: .625rem;
    text-align: start;
    cursor: pointer;
}

.cms-icon-trigger:focus {
    outline: 0;
    border-color: var(--primary, #007bff);
}

.cms-icon-preview {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(0, 123, 255, .12);
    color: var(--primary, #007bff);
    flex: none;
}

.cms-icon-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: start;
}

.cms-icon-caret {
    font-size: .7rem;
    opacity: .6;
    flex: none;
}

.cms-icon-pop {
    position: absolute;
    z-index: 2000;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15);
}

.cms-icon-pop[hidden] {
    display: none;
}

.cms-icon-opt {
    display: grid;
    place-items: center;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: .75rem;
    background: transparent;
    color: #495057;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.cms-icon-opt:hover,
.cms-icon-opt:focus {
    outline: 0;
    background: rgba(0, 123, 255, .12);
    color: var(--primary, #007bff);
}

.cms-icon-opt.is-active,
.cms-icon-opt.is-active:hover,
.cms-icon-opt.is-active:focus {
    background: var(--primary, #007bff);
    color: #fff;
}

.cms-icon-opt:focus-visible {
    outline: 2px solid var(--primary, #007bff);
    outline-offset: -2px;
}

.cms-icon-preview.is-empty {
    background: transparent;
    border: 1px dashed rgba(0, 0, 0, .3);
}

/* ==== Toggle switch (estidam prototype, adapted - replace #2f6fdb with your primary color) ==== */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .toggle-slider {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 40px;
    height: 22px;
    border-radius: 9999px;
    background: #d3dbe4;
    transition: background-color .2s ease;
}

.toggle-switch .toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .2s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: #2f6fdb;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

[dir="rtl"] .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(-18px);
}

.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(47, 111, 219, .25);
}

/* ==== Pill chips (products / solutions used) - same states as the prototype ==== */
.chip-select {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    border: 1px solid #d3dbe4;
    border-radius: 9999px;
    background: #fff;
    color: #4b5563;
    padding: .375rem .75rem;
    font-size: .875rem;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}

.chip:hover {
    border-color: rgba(47, 111, 219, .4);
}

.chip:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(47, 111, 219, .25);
}

.chip .chip-check {
    display: none;
    font-size: .7rem;
}

.chip.active {
    border-color: #2f6fdb;
    background: rgba(47, 111, 219, .1);
    color: #2f6fdb;
}

.chip.active .chip-check {
    display: inline-block;
}
