/* table navigation styles */

/* Ensure the container allows scrolling on mobile */
.shared-index-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    /* Sticky controls setup */
    .shared-index-container div.sticky {
        position: sticky;
        left: 0; /* Keeps controls centered relative to the viewport, not the table width */
        right: 0;
        margin-left: auto;
        margin-right: auto;
    }

/* On mobile, make sure the table can expand beyond the screen */
@media (max-width: 1023px) {
    .shared-table {
        min-width: 800px; /* Adjust based on your column content density */
    }
}

.shared-table th, .shared-table td {
    transition: opacity 0.2s ease-in-out;
}

/* Ensure the table doesn't collapse weirdly during shifts */
.shared-table {
    table-layout: auto;
    min-width: 100%;
}

/* RTL Support: Flip the icon to the left side for Arabic register */
html[dir="rtl"] .right-0 {
    right: auto;
    left: 0;
}

html[dir="rtl"] .register-input {
    padding-right: 0.75rem;
    padding-left: 2.5rem;
}

/* textarea resizer adjustment */
textarea.scrollbar-custom::-webkit-resizer {
    background-color: var(--scrollbar-track); 
}


.btn-swal-cancel {
    background-color: rgb(var(--color-hover)) !important;
    color: rgb(var(--color-text)) !important;
    border: 1px solid rgb(var(--color-border)) !important;
}

    /* Ensure the popup itself respects the border variable */
    .themed-swal-popup {
        border: 1px solid rgb(var(--color-border)) !important;
        border-radius: 0.5rem !important;
    }
/* Centralized SweetAlert Styling */
.swal2-popup {
    background-color: rgb(var(--color-surface)) !important;
    color: rgb(var(--color-text)) !important;
    border: 1px solid rgb(var(--color-border));
}

.swal-text-wrap {
    word-break: break-word; 
    overflow-x: hidden !important; 
    max-height: 200px; 
}

.swal2-title, .swal2-html-container {
    color: rgb(var(--color-text)) !important;
}

/* Primary "Confirm" Button - Uses Brand Color */
.swal2-confirm {
    background-color: rgb(var(--color-brand-dark)) !important;
    color: white !important; /* Ensure text is readable */
}

    .swal2-confirm:hover {
        background-color: rgb(var(--color-hover)) !important;
        color: rgb(var(--color-text)) !important;
    }


/* Secondary "Cancel" Button - Uses Hover/Surface color */
.swal2-cancel {
    background-color: rgb(var(--color-hover)) !important;
    color: rgb(var(--color-text)) !important;
    border: 1px solid rgb(var(--color-border)) !important;
}
.swal2-cancel:hover {
    background-color: rgb(var(--color-brand-dark)) !important;
    color: white !important;
    border-color: rgb(var(--color-border)) !important;
}

/* Custom Success/Error Icons */
.swal2-icon.swal2-success {
    border-color: rgb(var(--color-success)) !important;
    color: rgb(var(--color-success)) !important;
}

    .swal2-icon.swal2-success [class^=swal2-success-line] {
        background-color: rgb(var(--color-success)) !important;
    }

.swal2-icon.swal2-error {
    border-color: rgb(var(--color-error)) !important;
    color: rgb(var(--color-error)) !important;
}

/* reports date dropdowns */
#customDateContainer {
    transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out;
}

/* ===== Index Search Input ===== */
.index-search-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}

/* Animated underline / glow bar that slides in on focus */
.index-search-wrapper::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    border-radius: 0 0 6px 6px;
    background: rgb(var(--color-brand));
    opacity: 0;
    transition: left 0.3s ease, right 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.index-search-wrapper:focus-within::after {
    left: 4px;
    right: 4px;
    opacity: 1;
}

/* Search icon button — visible clickable pill */
.index-search-wrapper .search-icon-btn {
    position: absolute;
    inset-block: 4px;
    inset-inline-start: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    padding: 0;
    background-color: rgb(var(--color-elevated));
    border: 1.5px solid rgb(var(--color-border));
    border-radius: 0.35rem;
    cursor: pointer;
    color: rgb(var(--color-muted));
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
    z-index: 1;
}

.index-search-wrapper .search-icon-btn:hover {
    background-color: rgb(var(--color-hover));
    border-color: rgb(var(--color-brand) / 0.5);
    color: rgb(var(--color-brand));
}

.index-search-wrapper .search-icon-btn:active {
    transform: scale(0.92);
    background-color: rgb(var(--color-brand) / 0.12);
    border-color: rgb(var(--color-brand));
    color: rgb(var(--color-brand));
    box-shadow: 0 0 0 2px rgb(var(--color-brand) / 0.2);
}

.index-search-wrapper:focus-within .search-icon-btn {
    background-color: rgb(var(--color-brand));
    border-color: rgb(var(--color-brand));
    color: #fff;
    box-shadow: 0 0 0 2px rgb(var(--color-brand) / 0.25);
}

/* Dark mode icon button adjustments */
.dark .index-search-wrapper .search-icon-btn {
    background-color: rgb(var(--color-hover));
    border-color: rgb(var(--color-border));
}

.dark .index-search-wrapper .search-icon-btn:hover {
    background-color: rgb(var(--color-elevated));
    border-color: rgb(var(--color-brand) / 0.6);
    color: rgb(var(--color-brand));
}

.dark .index-search-wrapper:focus-within .search-icon-btn {
    background-color: rgb(var(--color-brand));
    border-color: rgb(var(--color-brand));
    color: #fff;
}

/* The actual input */
.index-search-input {
    width: 100%;
    min-width: 230px;
    padding-block: 0.4rem;
    padding-inline-start: 2.5rem; /* space for icon pill */
    padding-inline-end: 0.75rem;
    border-radius: 0.5rem;
    border: 1.5px solid rgb(var(--color-border));
    background-color: rgb(var(--color-elevated));
    color: rgb(var(--color-text));
    outline: none;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition:
        border-color 0.3s ease,
        box-shadow  0.3s ease,
        background-color 0.3s ease,
        width 0.3s ease;
}

.date-search-input {
    width: 100%;
    padding-block: 0.4rem;
    border-radius: 0.5rem;
    border: 1.5px solid rgb(var(--color-border));
    background-color: rgb(var(--color-elevated));
    color: rgb(var(--color-text));
    outline: none;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, width 0.3s ease;
}

.index-search-input::placeholder {
    color: rgb(var(--color-muted));
    opacity: 0.75;
    transition: opacity 0.25s ease;
}

.index-search-input:focus::placeholder {
    opacity: 0.45;
}

.index-search-input:hover {
    border-color: rgb(var(--color-brand) / 0.45);
    background-color: rgb(var(--color-surface));
}

.index-search-input:focus {
    border-color: rgb(var(--color-brand));
    background-color: rgb(var(--color-surface));
    box-shadow:
        0 0 0 3px rgb(var(--color-brand) / 0.18),
        0 2px 8px rgb(var(--color-brand) / 0.10);
}

/* Dark mode extra contrast */
.dark .index-search-input {
    border-color: rgb(var(--color-border));
    background-color: rgb(var(--color-elevated));
}

.dark .index-search-input:hover {
    border-color: rgb(var(--color-brand) / 0.5);
    background-color: rgb(var(--color-hover));
}

.dark .index-search-input:focus {
    background-color: rgb(var(--color-surface));
    box-shadow:
        0 0 0 3px rgb(var(--color-brand) / 0.22),
        0 2px 10px rgb(var(--color-brand) / 0.14);
}

#dateRangeSelect option[value="CUSTOM"] {
    font-weight: bold;
    color: var(--brand-main); 
}


/* export icon animation */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(-20%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.group-hover\:animate-bounce-slow {
    animation: bounce-slow 1.2s infinite;
}

/* 3D Push Effect */
#exportDropdownButton {
    transition: all 0.1s ease-in-out;
}

/* scrollbar adjustment */

:root {
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --scrollbar-thumb-hover: #a8a8a8;
}

.dark {
    --scrollbar-track: #1f2937;
    --scrollbar-thumb: #374151;
    --scrollbar-thumb-hover: #4b5563;
}

/* Chrome / Edge / Safari */
.sidebar-menu-container::-webkit-scrollbar {
    width: 8px;
}

.sidebar-menu-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.sidebar-menu-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
}

.sidebar-menu-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* Firefox */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* WebKit */
.shared-index-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.shared-index-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.shared-index-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
}

/* Firefox */
.shared-index-container {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ===== Universal custom scrollbar (opt-in) ===== */
.scrollbar-custom::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollbar-custom::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.scrollbar-custom::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

.scrollbar-custom {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Dark mode support */
.dark .scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}


/* Select2 scrollbar styles - Light theme */
.select2-dropdown::-webkit-scrollbar,
.select2-results::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.select2-dropdown::-webkit-scrollbar-track,
.select2-results::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.select2-dropdown::-webkit-scrollbar-thumb,
.select2-results::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
}

.select2-dropdown::-webkit-scrollbar-thumb:hover,
.select2-results::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* Firefox */
.select2-dropdown,
.select2-results {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Select2 scrollbar styles - Dark theme */
.dark .select2-dropdown::-webkit-scrollbar,
.dark .select2-results::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark .select2-dropdown::-webkit-scrollbar-track,
.dark .select2-results::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.dark .select2-dropdown::-webkit-scrollbar-thumb,
.dark .select2-results::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 8px;
}

.dark .select2-dropdown::-webkit-scrollbar-thumb:hover,
.dark .select2-results::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* Firefox - Dark */
.dark .select2-dropdown,
.dark .select2-results {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}


/* Card animation classes*/
.auth-animation {
    animation: fadeIn 0.8s ease-in-out;
}

.chart-fast-fade {
    animation: fadeIn 0.5s ease-in-out;
}

.chart-slow-fade {
    animation: fadeIn 0.8s ease-in-out;
}

/* font size adjustments*/
body, button,a.start-aligned-button {
    font-size: 0.9rem !important;
}

@media (max-width: 600px) {
    body,button {
        font-size:0.8rem !important;
    }
}

.sort div::after {
    content: "⇅";
    font-size: 1rem;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px; 
    height: 24px; 
    flex-shrink:0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc; 
    transition: .4s;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 4px; 
        bottom: 4px;
        background-color: white;
        transition: .4s;
    }

input:checked ~ .slider {
    background-color: rgb(var(--color-brand)); 
}

input:focus ~ .slider {
    box-shadow: 0 0 1px #4CAF50;
}

[dir="rtl"] .slider:before {
    left: auto; 
    right: 4px; 
}

[dir="rtl"] input:checked ~ .slider:before {
    transform: translateX(-16px); 
}

input:focus ~ .slider {
    box-shadow: 0 0 1px rgb(var(--color-brand));
}


input:checked ~ .slider:before {
    transform: translateX(16px);
}
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.kanban-card.is-loading {
    opacity: 0.6;
    background-color: rgb(var(--color-hover));
    pointer-events: none;
    position: relative;
}

.kanban-card.is-loading::after {
    content: '';
    position: absolute;
    opacity:1 !important;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Kanban board — drag-and-drop helpers */
.kanban-cards-container {
    overflow-x: hidden;
}

.kanban-card-ghost {
    opacity: 0.4;
    background: rgb(var(--color-brand) / 0.08);
    border: 2px dashed rgb(var(--color-brand-light));
    border-radius: 0.5rem;
}

[type=checkbox]:focus, [type=radio]:focus {
    --tw-ring-color: #2cb0f2 !important; 
    outline: none !important;
}

.select2 select2-container select2-container--default{
    width:auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {    
    margin-right: 10px !important;
}

/* Override default Select2 single select look */
.select2-container--default .select2-selection--single,.select2-selection--multiple {
    border: 2px solid rgb(var(--color-border)) !important;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: rgb(var(--color-surface)) !important;
    color: rgb(var(--color-text)) !important;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    height: 44px !important;
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered { 
    color: rgb(var(--color-text)) !important;
}

#kpi-summary-form .select2-container--default {
    max-width: 250px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: rgb(var(--color-brand-dark)) !important;
    border-color: transparent !important;
    color: white !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    border-color: transparent !important;
}

.select2-container .select2-search--inline .select2-search__field{
    height:22px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: rgb(var(--color-brand-light)) !important;
}

.select2-container .select2-search--inline .select2-search__field {
    vertical-align: middle !important;
    margin-top: 4px !important;
    margin-left: 4px !important;
}

.select2-container--default .select2-selection--multiple {
    padding: 0.25rem;
    padding-bottom:0.5rem !important;
}

.select2-container--default{
    width:100% !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: rgb(var(--color-brand-light)) !important;
    color: white;
}

.select2-container--default .select2-selection--single:hover {
    background-color: rgb(var(--color-hover)) !important;
}

.select2-container--default .select2-selection--single:focus {
    background-color: rgb(var(--color-surface));
    border-color: rgb(var(--color-brand-light)) !important;
    box-shadow: 0 0 0 2px rgb(var(--color-brand-light)) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: rgb(var(--color-text)) !important;
    padding-left: 0 !important; 
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%);
    right: 0.75rem; 
}

.select2-results__option {
    padding: 4px 8px;
    font-size: 16px;
    line-height: 2;
}

/* Dark theme Select2 dropdown styles */
.dark .select2-dropdown {
    background-color: rgb(var(--color-surface)) !important;
    border-color: rgb(var(--color-border)) !important;
}

.dark .select2-results {
    background-color: rgb(var(--color-surface)) !important;
}

.dark .select2-results__option {
    color: rgb(var(--color-text)) !important;
    background-color: rgb(var(--color-surface)) !important;
}

.dark .select2-results__option:hover,
.dark .select2-results__option--highlighted {
    background-color: rgb(var(--color-brand-dark)) !important;
    color: rgb(var(--color-text)) !important;
}

.dark .select2-results__option--selectable.select2-results__option--highlighted {
    background-color: rgb(var(--color-brand-dark)) !important;
    color: white !important;
}

.dark .select2-search__field {
    background-color: rgb(var(--color-surface)) !important;
    color: rgb(var(--color-text)) !important;
    border-color: rgb(var(--color-border)) !important;
}

.dark .select2-search__field::placeholder {
    color: rgb(var(--color-muted)) !important;
    opacity: 0.7;
}

.dark .select2-search__field:focus {
    border-color: rgb(var(--color-brand-light)) !important;
    box-shadow: 0 0 0 1px rgb(var(--color-brand-light) / 0.2) !important;
}

.dark .select2-container--default.select2-container--open .select2-selection--single,
.dark .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: rgb(var(--color-brand-light)) !important;
}

.dark .select2-container--default .select2-selection--single .select2-selection__arrow b,
.dark .select2-container--default .select2-selection--multiple .select2-selection__arrow b {
    border-color: rgb(var(--color-text)) transparent transparent transparent !important;
}

/* Validation classes */
input.valid-input {
    padding-right: 2.5rem;
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2rem;
}

input.valid-input-ar {
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.2rem;
}

input.invalid-input {
    border-color: #dc3545;
}

select.valid-input {
    padding-right: 2.5rem;
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2rem;
}

select.valid-input-ar {
    padding-right: 2.5rem;
    background-image: url('/images/icon-check.svg');
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1.2rem;
}

select.invalid-input {
    border-color: #dc3545;
}

input.valid-input.pr-10 {
    background-position: right 2.5rem center !important;
}

[dir="rtl"] input.valid-input-ar.pl-10,
input.valid-input-ar.pl-10 {
    background-position: left 2.5rem center !important;
}

.password-toggle-btn {
    z-index: 10; 
    color: #6b7280; 
}

.validation-error {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.required-field::after {
    content: '*';
    color: red;
    margin-left: 5px;
}
.input-wide {
    width: 380px;
    max-width: 100%;
}

/** Fixed Loader Styles */
.ace-loader-wrap {
    width: 160px; /* Consistent size */
    height: 160px;
    display: grid;
    place-items: center;
    transform: scale(.96);
    will-change: transform, opacity;
}

.ace-loader-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ace-sr {
    position: absolute;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
}

/* UNDERLAY: thinner stroke for subtle contrast */
.ace-trace-under {
    vector-effect: non-scaling-stroke;
    fill: none;
    stroke: rgb(44 176 242 / 0.25); /* Reduced opacity and thickness */
    stroke-width: 1px; /* Much thinner */
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--len, 300);
    stroke-dashoffset: var(--len, 300);
    animation: ace-trace var(--dur, 1600ms) ease-in-out var(--delay, 0ms) infinite alternate;
}

/* MAIN stroke on top - much thinner */
.ace-trace-shape {
    vector-effect: non-scaling-stroke;
    fill: none !important;
    stroke: #2CB0F2 !important;
    filter: url(#ace-glow-strong) drop-shadow(0 0 3px rgba(44,176,242,.5)); /* Reduced glow */
    stroke-width: 0.5px; /* Much thinner main stroke */
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--len, 300);
    stroke-dashoffset: var(--len, 300);
    animation: ace-trace var(--dur, 1600ms) ease-in-out var(--delay, 0ms) infinite alternate;
}

@keyframes ace-trace {
    to {
        stroke-dashoffset: 0;
    }
}

/* Overlay styles */
.ace-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease, visibility .25s ease;
}

.loader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.ace-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 28, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ace-overlay-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(40% 40% at 50% 45%, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 60%), radial-gradient(65% 65% at 50% 50%, rgba(0,0,0,.12) 0%, rgba(0,0,0,0) 60%);
    pointer-events: none;
}

.ace-overlay-body {
    position: relative;
    display: grid;
    place-items: center;
    gap: 16px;
    width: min(260px, 56vw);
    aspect-ratio: 1 / 1;
    padding: 20px;
    border-radius: 22px;
    background: rgba(20, 24, 35, 0.28);
    box-shadow: 0 10px 35px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.08);
    backdrop-filter: blur(10px) saturate(115%);
    -webkit-backdrop-filter: blur(10px) saturate(115%);
    transform: translateY(2px) scale(.985);
    opacity: .98;
    transition: transform .3s ease, opacity .3s ease;
}

.ace-overlay:not(.loader-hidden) .ace-overlay-body {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: ace-breathe 2.4s ease-in-out .3s infinite;
}

.ace-overlay:not(.loader-hidden) .ace-loader-wrap {
    animation: ace-breathe 2.4s ease-in-out .3s infinite;
}

@keyframes ace-breathe {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.012); /* Subtler breathing */
    }
}

.ace-loading-text {
    font: 500 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans";
    color: rgba(255,255,255,.9);
    letter-spacing: .3px;
    text-align: center;
    user-select: none;
    min-height: 20px; /* Prevent layout shift */
}

.ace-loading-text .ace-dots {
    display: inline-flex;
    gap: 4px;
    margin-inline-start: 6px;
}

.ace-loading-text .ace-dots i {
    display: inline-block;
    width: .35em;
    height: .35em;
    border-radius: 50%;
    background: rgb(44 176 242 / 1);
    opacity: .5;
    transform: translateY(0);
    animation: ace-dot 1.4s infinite ease-in-out;
}

.ace-loading-text .ace-dots i:nth-child(2) {
    animation-delay: .2s;
}

.ace-loading-text .ace-dots i:nth-child(3) {
    animation-delay: .4s;
}

@keyframes ace-dot {
    0%, 80%, 100% {
        opacity: .4;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Logo styling */
#ace-logo text,
#ace-logo .ace-logo-text,
#ace-logo path[fill]:not(.ace-trace-shape):not(.ace-trace-under) {
    fill: #ffffff !important;
    filter: drop-shadow(0 0 3px rgba(44,176,242,0.5));
}

#ace-logo [fill]:not([fill="none"]):not(.ace-trace-shape):not(.ace-trace-under) {
    fill: #fff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ace-loader-wrap {
        width: 140px;
        height: 140px;
    }

    .ace-overlay-body {
        width: min(220px, 70vw);
        padding: 16px;
        gap: 14px;
    }

    .ace-loading-text {
        font-size: 13px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .ace-trace-under,
    .ace-trace-shape {
        animation-duration: 2s;
    }

    .ace-overlay-body,
    .ace-loader-wrap {
        animation: none;
    }

    .ace-loading-text .ace-dots i {
        animation: none;
        opacity: .7;
    }
}

.nav-profile-container i {
    transform: translateY(0);
    transition: transform 0.2s ease-in; /* slow ease on unhover */
}

.nav-profile-container:hover i {
    transform: translateY(4px);
    transition: transform 0.15s ease-out; /* faster ease on hover */
}

.start-aligned-button {
    position: relative;
    overflow: hidden; /* keep gloss inside the button */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.start-aligned-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient( 120deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 60%, transparent 100% );
    transform: skewX(-20deg);
    transition: left 0.4s ease-in-out;
}

input:focus-visible {
    outline: none;
}

[multiple]:focus, [type=date]:focus, [type=datetime-local]:focus, [type=email]:focus, [type=month]:focus, [type=number]:focus, [type=password]:focus, [type=search]:focus, [type=tel]:focus, [type=text]:focus, [type=time]:focus, [type=url]:focus, [type=week]:focus, select:focus, textarea:focus {
    --tw-ring-color: white !important; /* example: Tailwind orange-500 */
    box-shadow: none !important; /* remove default ring shadow */
    outline: none !important; /* remove extra outline */
    border-color: #2CB0F2 !important
}

.start-aligned-button:hover::before {
    left: 125%; /* swipe across button */
}
.tooltip {
    max-width: min(280px, 90vw) !important;
}

/* Mobile: disable tooltip completely */
@media (max-width: 767px) {
    .tooltip {
        display: none !important;
    }
}

/* ==========================
   Payment Status Badges
   ========================== */

.square-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem; /* px-2 py-1 */
    font-size: 0.6rem; /* text-xs */
    font-weight: 600;
    border-radius: 5px;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem; /* px-2 py-1 */
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    border-radius: 9999px; /* rounded-full */
    border: 1px solid transparent;
    white-space: nowrap;
}

.number-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem; /* px-2 py-1 */
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    border-radius: 9999px; /* rounded-full */
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Variants */
.badge-green {
    color: #166534; /* text-green-800 */
    background-color: #bbf7d0; /* bg-green-100 */
    border-color: #22c55e; /* border-green-500 */
}

.badge-yellow {
    color: #92400e; /* text-yellow-800 */
    background-color: #fef3c7; /* bg-yellow-100 */
    border-color: #f59e0b; /* border-yellow-500 */
}

.badge-red {
    color: #991b1b; /* text-red-800 */
    background-color: #fecaca; /* bg-red-200 */
    border-color: #ef4444; /* border-red-500 */
}

.badge-blue {
    color: #1e3a8a; /* text-blue-800 */
    background-color: #bfdbfe; /* bg-blue-200 */
    border-color: #3b82f6; /* border-blue-500 */
}

.badge-purple {
    color: #6b21a8; /* text-purple-800 */
    background-color: #e9d5ff; /* bg-purple-200 */
    border-color: #a855f7; /* border-purple-500 */
}

.badge-gray {
    color: #374151; /* text-gray-700 */
    background-color: #e5e7eb; /* bg-gray-200 */
    border-color: #6b7280; /* border-gray-500 */
}

.badge-orange {
    color: #9a3412; /* text-orange-800 */
    background-color: #ffedd5; /* bg-orange-100 */
    border-color: #f97316; /* border-orange-500 */
}   

.badge-indigo {
    color: #3730a3; /* text-indigo-700 */
    background-color: #e0e7ff; /* bg-indigo-100 */
    border-color: #6366f1; /* border-indigo-500 */
}

.badge-sky {
    color: #0369a1; /* text-sky-700 */
    background-color: #e0f2f1; /* bg-sky-100 (Lighter blue/teal shade) */
    border-color: #0ea5e9; /* border-sky-500 */
}

#paymentSelect {
    width: 100% !important;
}

.select2-container {
    width: 100% !important;
}

.select2-dropdown {
    z-index: 1060;
}

.select2-ats .select2-selection--single {
    height: 44px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0 .75rem;
    background: #fff;
}

.select2-ats .select2-selection__rendered {
    line-height: 44px;
}

.select2-ats .select2-selection__arrow {
    height: 44px;
    right: .5rem;
}
.shared-table-container,
.shared-index-container {
    max-height: none !important;
    overflow-y: visible !important;
}

#responsesTableBody .shared-table th, #responsesTableBody .shared-table td {
    white-space: normal;
    word-break: break-word;
}
input[data-maxed="true"] {
    background-color: #fff5f5;
    border-color: #ef4444;
}
.group:hover .tooltip {
    display: block;
}

.tooltip {
    white-space: normal;
    line-height: 1.4;
}
.shared-index-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.shared-search-form-container {
    flex: 1;
    min-width: 250px;
}

.start-aligned-button {
    white-space: nowrap;
    flex-shrink: 0;
}
#detailsModal > div {
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

#detailsModal:not(.hidden) > div {
    transform: translateY(0);
    opacity: 1;
}

/* ===== Access Tabs Styling ===== */
#tabs .tab-link {
    transition: all 0.2s ease-in-out;
    color: rgb(var(--color-text));
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

#tabs .tab-link:hover {
    color: white;
    border-bottom: 2px solid var(--brand-200);
    background-color: rgb(var(--color-brand-light));
}

.dark #tabs .tab-link:hover { 
    background-color: rgb(var(--color-brand-dark)); 

}

#tabs .tab-link.active {
    color: white;
    border-bottom: 2px solid var(--brand-500);
    background-color: rgb(var(--color-brand-light));
    font-weight: 600;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.dark #tabs .tab-link.active { 
    background-color: rgb(var(--color-brand-dark)); 

}
[data-id][draggable="true"] {
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

[data-id][draggable="true"].border-blue-400 {
    border-color: #3b82f6 !important;
    transform: scale(1.01);
}
/* Make it clear headers are clickable */
table.shared-table thead th.ts-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Hover feel */
table.shared-table thead th.ts-sortable:hover {
    background: rgba(15, 23, 42, 0.04); /* subtle */
}

/* The little sort icon container */
table.shared-table thead th .ts-sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 8px;
    opacity: 0.45;
    font-size: 0.85em;
    transform: translateY(1px);
}

/* When sorted */
table.shared-table thead th.sort-asc,
table.shared-table thead th.sort-desc {
    background: rgba(15, 23, 42, 0.06);
}

table.shared-table thead th.sort-asc .ts-sort-indicator,
table.shared-table thead th.sort-desc .ts-sort-indicator {
    opacity: 1;
}

/* Disable sorting visuals */
table.shared-table thead th.ts-nosort {
    cursor: default;
}

table.shared-table thead th.ts-nosort:hover {
    background: transparent;
}

table.shared-table thead th.ts-nosort .ts-sort-indicator {
    display: none;
}

.fa,
.fa-solid,
.fas,
.far,
.fab {
    --fa-display: inline; 
}
/* ===== AI PPT Modal Styles (scoped) ===== */
#aiSlidesTrack {
    will-change: transform;
}

.ai-slide {
    min-width: 100%;
    padding: 18px;
}

.ai-card {
    border-radius: 1.25rem;
    background: white;
    border: 1px solid rgba(226, 232, 240, 1);
    box-shadow: 0 12px 30px rgba(2,6,23,.06);
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    animation: aiIn .5s ease-out forwards;
}

@keyframes aiIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ai-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(15,23,42,.06), rgba(148,163,184,.15));
    border-bottom: 1px solid rgba(226,232,240,1);
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,.08);
    color: rgba(15,23,42,1);
    flex: none;
}

.ai-card-body {
    padding: 14px 16px 18px;
}

.ai-lines p {
    margin: 0 0 10px;
    line-height: 1.8;
    font-size: .95rem;
    color: rgb(15 23 42);
}

.ai-bullets {
    margin: 0;
    padding-left: 1.1rem;
}

html[dir="rtl"] .ai-bullets {
    padding-left: 0;
    padding-right: 1.1rem;
}

/* prevent broken scorlling by explicitly constraining containers */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

.pages-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.ai-bullets li {
    margin: 0 0 10px;
    line-height: 1.8;
    color: rgb(15 23 42);
    position: relative;
    opacity: 0;
    transform: translateY(6px);
    animation: aiBullet .45s ease-out forwards;
}

@keyframes aiBullet {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(148,163,184,.8);
    transition: transform .2s ease, background .2s ease;
    cursor: pointer;
}

.ai-dot.active {
    background: rgba(15,23,42,1);
    transform: scale(1.2);
}

/* loading shimmer */
.ai-skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, .35);
    background: rgba(248, 250, 252, 1);
    padding: 14px;
    margin-top: 12px;
}

.ai-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(148,163,184,.25), transparent);
    animation: aiShimmer 1.2s infinite;
}

@keyframes aiShimmer {
    100% {
        transform: translateX(100%);
    }
}
.pulse-badge {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255,165,0,0.6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255,165,0,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255,165,0,0);
    }
}