.swal2-container {
    z-index: 3000 !important;
    direction: rtl;
    font-family: var(--dashboard-font-family, Vazirmatn, Tahoma, Arial, sans-serif) !important;
}

.dashboard-swal-popup {
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: var(--ui-radius-lg, 8px) !important;
    box-shadow: var(--ui-shadow-lg, 0 24px 70px rgba(15, 23, 42, .28)) !important;
}

.dashboard-swal-dark {
    border-color: rgba(148, 163, 184, .28);
    box-shadow: var(--ui-shadow-lg, 0 24px 70px rgba(0, 0, 0, .52)) !important;
}

.dashboard-swal-title {
    font-size: var(--ui-fs-xl, 1.2rem) !important;
    line-height: 1.7 !important;
    letter-spacing: 0;
}

.dashboard-swal-content {
    line-height: 1.9 !important;
    text-align: center !important;
}

.dashboard-swal-confirm,
.dashboard-swal-cancel {
    min-width: 6.5rem;
    border-radius: var(--ui-radius, 5px) !important;
    font-family: inherit !important;
}

.dashboard-swal-loading-text {
    margin-top: .75rem;
    color: inherit;
}

.dashboard-page-loading {
    position: fixed;
    inset: 0;
    z-index: 3200;
    pointer-events: none;
    direction: rtl;
    font-family: var(--dashboard-font-family, Vazirmatn, Tahoma, Arial, sans-serif);
    opacity: 0;
    transition: opacity .16s ease;
}

.dashboard-page-loading.is-visible {
    opacity: 1;
}

.dashboard-page-loading-bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    z-index: 3200;
    overflow: hidden;
    pointer-events: none;
    background: rgba(37, 99, 235, .12);
}

.dashboard-page-loading-bar.is-visible {
    display: block !important;
}

.dashboard-page-loading-bar span {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    transform-origin: right center;
    background: linear-gradient(270deg, #2563eb, #0f766e, #f59e0b);
    box-shadow: var(--ui-shadow, 0 0 14px rgba(37, 99, 235, .45));
    animation: dashboard-page-loading-fill 1.15s ease-in-out infinite;
}

.dashboard-page-loading-card {
    position: fixed;
    top: 14px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    max-width: min(360px, calc(100vw - 2rem));
    min-height: 42px;
    padding: .55rem .75rem;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: var(--ui-radius, 7px);
    background: rgba(255, 255, 255, .96);
    color: #172033;
    box-shadow: var(--ui-shadow-lg, 0 12px 32px rgba(15, 23, 42, .18));
    backdrop-filter: blur(8px);
}

.dashboard-page-loading-spinner {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 3px solid rgba(37, 99, 235, .18);
    border-top-color: #2563eb;
    border-left-color: #0f766e;
    border-radius: 50%;
    animation: dashboard-page-loading-spin .72s linear infinite;
}

.dashboard-page-loading-text {
    overflow: hidden;
    font-size: var(--ui-fs-md, .9rem);
    font-weight: 600;
    line-height: 1.7;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.dark-mode .dashboard-page-loading-bar,
html[data-theme="dark"] .dashboard-page-loading-bar {
    background: rgba(96, 165, 250, .14);
}

html.dark-mode .dashboard-page-loading-card,
html[data-theme="dark"] .dashboard-page-loading-card {
    border-color: rgba(148, 163, 184, .26);
    background: rgba(17, 24, 39, .94);
    color: #e5e7eb;
    box-shadow: var(--ui-shadow-lg, 0 12px 34px rgba(0, 0, 0, .42));
}

html.dark-mode .dashboard-page-loading-spinner,
html[data-theme="dark"] .dashboard-page-loading-spinner {
    border-color: rgba(96, 165, 250, .2);
    border-top-color: #60a5fa;
    border-left-color: #2dd4bf;
}

@keyframes dashboard-page-loading-fill {
    0% {
        transform: scaleX(.08);
        opacity: .72;
    }
    58% {
        transform: scaleX(.86);
        opacity: 1;
    }
    100% {
        transform: scaleX(1);
        opacity: .28;
    }
}

@keyframes dashboard-page-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.dashboard-toast-container {
    z-index: 3100 !important;
    padding: 1rem !important;
}

.dashboard-swal-toast {
    width: min(360px, calc(100vw - 1.25rem)) !important;
    min-height: 72px !important;
    padding: .8rem 1rem !important;
    border: 1px solid rgba(255, 255, 255, .24) !important;
    border-radius: var(--ui-radius, 7px) !important;
    color: #fff !important;
    box-shadow: var(--ui-shadow-lg, 0 16px 40px rgba(15, 23, 42, .30)) !important;
}

.dashboard-toast-blue { background: #2563eb !important; }
.dashboard-toast-green { background: #047857 !important; }
.dashboard-toast-teal { background: #0f766e !important; }
.dashboard-toast-violet { background: #6d28d9 !important; }
.dashboard-toast-graphite { background: #334155 !important; }

.dashboard-swal-toast-title {
    margin: 0 !important;
    padding: .2rem .35rem !important;
    color: #fff !important;
    font-size: var(--ui-fs-md, .92rem) !important;
    line-height: 1.8 !important;
    text-align: right !important;
}

.dashboard-swal-toast .swal2-icon {
    margin: 0 .15rem 0 .65rem !important;
    transform: scale(.72);
}

.dashboard-swal-toast .swal2-close {
    color: rgba(255, 255, 255, .92) !important;
}

.dashboard-swal-toast-progress {
    background: rgba(255, 255, 255, .55) !important;
}

.dashboard-swal-bootstrap-popup {
    max-height: 92vh;
    overflow: hidden;
}

.dashboard-swal-bootstrap-popup .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
    overflow: auto !important;
    text-align: right !important;
}

.dashboard-swal-bootstrap-host {
    width: 100%;
    max-height: 92vh;
    overflow: auto;
    color: var(--bs-body-color);
}

.dashboard-swal-bootstrap-host .modal-content {
    width: 100%;
    --bs-modal-padding: 1.25rem;
    --bs-modal-header-padding-x: 1.25rem;
    --bs-modal-header-padding-y: 1rem;
    --bs-modal-footer-gap: .35rem;
    border: 0;
    border-radius: var(--ui-radius, 7px);
    box-shadow: none;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .modal-content {
    border-radius: var(--ui-radius-lg, 8px);
    overflow: hidden;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .modal-header {
    min-height: 58px;
    padding: .9rem 1.25rem;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .modal-body {
    padding: 1.15rem 1.25rem 1.25rem;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .form-label {
    margin-bottom: .28rem;
    color: #52657a;
    font-size: var(--dashboard-ui-small-font-size) !important;
    font-weight: 600;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .form-control:not(textarea),
.dashboard-swal-bootstrap-host.attendance-modal-host .form-select,
.dashboard-swal-bootstrap-host.attendance-modal-host .select2-container--default .select2-selection--single {
    height: var(--dashboard-control-height) !important;
    min-height: var(--dashboard-control-height) !important;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .select2-container--default .select2-selection--single .select2-selection__rendered {
    height: calc(var(--dashboard-control-height) - 2px) !important;
    line-height: calc(var(--dashboard-control-height) - 2px) !important;
    font-size: var(--dashboard-ui-font-size) !important;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(var(--dashboard-control-height) - 2px) !important;
}

.dashboard-swal-bootstrap-host.attendance-modal-host .attendance-time-input {
    direction: ltr;
    text-align: center;
    letter-spacing: .04em;
    font-family: Tahoma, Arial, sans-serif !important;
}

.dashboard-swal-bootstrap-host .modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 1rem 1.25rem;
    background: var(--bs-body-bg);
}

.dashboard-swal-bootstrap-host .modal-body {
    padding: 1.25rem;
}

.dashboard-swal-bootstrap-host .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    gap: .35rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, rgba(241, 245, 249, .94), rgba(226, 232, 240, .94));
    border-top: 1px solid rgba(148, 163, 184, .28);
}

.dashboard-swal-bootstrap-host .modal-footer .btn {
    min-width: 116px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .45rem 1rem;
    font-size: var(--dashboard-ui-font-size, .875rem) !important;
    line-height: 1.45 !important;
}

.dashboard-swal-bootstrap-host .modal-body > :first-child {
    margin-top: 0;
}

.dashboard-swal-bootstrap-host .modal-body > :last-child {
    margin-bottom: 0;
}

html.dark-mode .dashboard-swal-bootstrap-host .modal-content,
html.dark-mode .dashboard-swal-bootstrap-host .modal-header,
html.dark-mode .dashboard-swal-bootstrap-host .modal-footer,
html[data-theme="dark"] .dashboard-swal-bootstrap-host .modal-content,
html[data-theme="dark"] .dashboard-swal-bootstrap-host .modal-header,
html[data-theme="dark"] .dashboard-swal-bootstrap-host .modal-footer {
    background: #111827;
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, .24);
}

html.dark-mode .dashboard-swal-bootstrap-host .modal-footer,
html[data-theme="dark"] .dashboard-swal-bootstrap-host .modal-footer {
    background: linear-gradient(180deg, rgba(30, 41, 59, .96), rgba(15, 23, 42, .96));
}

html.dark-mode .dashboard-swal-bootstrap-host.attendance-modal-host .form-label,
html[data-theme="dark"] .dashboard-swal-bootstrap-host.attendance-modal-host .form-label {
    color: rgba(226, 232, 240, .78);
}

.swal2-loader {
    border-color: #0d6efd transparent #0d6efd transparent !important;
}

html.dark-mode .swal2-loader,
html[data-theme="dark"] .swal2-loader {
    border-color: #60a5fa transparent #60a5fa transparent !important;
}

@media (max-width: 640px) {
    .dashboard-page-loading-card {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .dashboard-swal-popup {
        width: calc(100% - 1rem) !important;
    }

    .dashboard-swal-bootstrap-popup {
        max-height: 96vh;
    }

    .dashboard-swal-bootstrap-host {
        max-height: 96vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .swal2-popup,
    .swal2-backdrop-show {
        animation: none !important;
    }

    .dashboard-page-loading,
    .dashboard-page-loading-bar span,
    .dashboard-page-loading-spinner {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   CoreStack-only rules: features that GatePass does not have (bilingual layout, user center,
   collapsed menu rail, calendar, profile font options, ...). Kept from the previous stylesheet.
   ========================================================================== */
.dashboard-sidebar-loading-icon {
    width: 13px;
    flex: 0 0 13px;
    font-size: 13px;
    line-height: 1;
    animation: dashboard-page-loading-spin .72s linear infinite;
}
html[dir="ltr"] .dashboard-swal-toast-title,
html[dir="ltr"] .dashboard-swal-toast-content {
    direction: ltr !important;
    text-align: left !important;
}
@media (prefers-reduced-motion: reduce) {
.dashboard-page-loading-bar span,
    .dashboard-sidebar-loading-icon {
        animation: none !important;
        transition: none !important;
    }
}
