﻿/* ========== Modal (scoped & responsive) =============================================== */
.modal-backdrop,
.modal-modal-backdrop {
    /* Theme tokens */
    --modal-primary: #1e88e5;
    --modal-primary-dark: #1565c0;
    --modal-secondary: #f0f2f5;
    --modal-white: #fff;
    --modal-border: #e0e0e0;
    --modal-text: #333;

    /* Base */
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 4000;

    /* Backdrop/visibility */
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    color: var(--modal-text);
}

.modal-backdrop * {
    box-sizing: border-box;
    font-family: 'IRANSans', sans-serif;
}

/* Font Awesome (scoped) */
.modal-backdrop .fa,
.modal-backdrop .fa-solid,
.modal-backdrop [class*='fa-'] {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* Visible state */
.modal-backdrop.is-visible,
.modal-modal-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Dialog */
.modal-modal {
    width: min(640px, 100%);
    max-height: 92vh;
    background: var(--modal-white);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Enter/exit animation */
    transform: translateY(20px) scale(.96);
    opacity: 0;
    transition: transform .28s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity .28s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.modal-modal--wide {
    width: min(920px, 100%);
}

.modal-modal--wide .acc-table-scroll,
.modal-modal .acc-table-scroll {
    height: var(--modal-search-table-height, min(420px, 52vh));
    min-height: var(--modal-search-table-height, min(420px, 52vh));
    max-height: var(--modal-search-table-height, min(420px, 52vh));
    margin-bottom: 0;
}

.modal-backdrop.is-visible .modal-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header */
.modal-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--modal-border);
    background: linear-gradient(135deg, var(--modal-primary), var(--modal-primary-dark));
    color: #fff;
}

.modal-modal-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex: 1;
}

.modal-modal-title i {
    font-size: 20px;
}

/* Header close button */
.modal-modal-header .modal-btn-outline {
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    padding: 8px 12px;
    min-width: auto;
}

.modal-modal-header .modal-btn-outline:hover {
    background: rgba(255, 255, 255, .25);
}

.modal-modal-header .modal-filter-refresh {
    margin-inline-start: auto;
    font-size: 23px;
    line-height: 1;
}

.modal-modal-header .modal-filter-refresh.is-loading span {
    display: inline-block;
    animation: modal-filter-refresh-spin .7s linear infinite;
}

@keyframes modal-filter-refresh-spin {
    to { transform: rotate(-360deg); }
}

.modal-date-source {
    display: none !important;
}

.modal-date-input {
    direction: ltr;
    width: 100%;
    min-width: 0;
    height: 42px;
    display: grid;
    grid-template-columns: minmax(58px, 1.45fr) auto minmax(38px, 1fr) auto minmax(38px, 1fr);
    align-items: center;
    gap: 2px;
    padding: 0 9px;
    background: #fff;
    border: 1px solid var(--modal-border);
    border-radius: 8px;
    transition: border-color .2s, box-shadow .2s;
}

.modal-grid.modal-g-2.modal-date-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)) !important;
}

#personKardexFilterBackdrop .modal-date-grid {
    grid-template-columns: 1fr !important;
}

.modal-form-row.modal-date-row {
    grid-template-columns: 80px minmax(0, 1fr) !important;
}

.modal-form-row.modal-date-row .modal-form-label {
    white-space: nowrap;
}

.modal-date-input:focus-within {
    border-color: var(--modal-primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .12);
}

.modal-date-segment {
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--modal-text);
    font: inherit;
    text-align: center;
}

.modal-date-segment::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.modal-date-separator {
    color: #64748b;
    font-weight: 700;
    user-select: none;
    pointer-events: none;
}

/* Body */
.modal-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto; /* اسکرول عمودی وقتی محتوا بلندتر از مودال است */
}

.modal-modal-body--table {
    overflow: hidden; /* جدول خودش اسکرول دارد */
    padding-bottom: 8px;
}

.modal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.modal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Footer */
.modal-modal-footer {
    flex: 0 0 auto;
    padding: 16px 20px;
    border-top: 1px solid var(--modal-border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    background: #fafafa;
}

/* Account settings */
.account-settings-modal {
    width: min(520px, 100%);
}

.account-settings-modal form {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.account-settings-modal .modal-modal-title {
    gap: 10px;
}

.account-settings-modal .modal-modal-header .modal-btn-outline {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    padding: 5px 11px;
    font-size: 26px;
    line-height: 1;
}

.account-settings-help {
    margin: 0 0 18px;
    color: #475569;
    line-height: 1.8;
}

.account-settings-fields {
    display: grid;
    gap: 14px;
}

.account-settings-field {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 600;
}

.account-settings-field .modal-form-control {
    direction: ltr;
    text-align: left;
}

.account-settings-hint {
    margin-top: -9px;
    color: #64748b;
    font-size: 12px;
}

.account-settings-show-passwords {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.account-settings-show-passwords input {
    width: 16px;
    height: 16px;
    accent-color: var(--modal-primary);
}

.account-settings-message {
    display: none;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    line-height: 1.7;
}

.account-settings-message.is-error {
    display: block;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.account-settings-message.is-success {
    display: block;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

/* Buttons */
.modal-btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s ease;
    white-space: nowrap;
    min-width: 100px;
    min-height: 44px;
    flex: 0 0 auto;
}

.modal-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.modal-btn-primary {
    background: var(--modal-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 136, 229, .25);
}

.modal-btn-primary:hover:not(:disabled) {
    background: var(--modal-primary-dark);
    box-shadow: 0 4px 12px rgba(30, 136, 229, .35);
    transform: translateY(-1px);
}

.modal-btn-outline {
    background: #fff;
    border: 1px solid var(--modal-border);
    color: var(--modal-text);
}

.modal-btn-outline:hover:not(:disabled) {
    background: var(--modal-secondary);
    border-color: var(--modal-primary);
    color: var(--modal-primary);
}

.modal-picker-btn {
    padding: 5px;
    border: 1px solid var(--modal-border);
    border-radius: 8px;
    background: #616366c4;
    color: #fff;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.modal-picker-btn:hover {
    background: var(--modal-primary);
    color: #fff;
    border-color: var(--modal-primary);
}

.modal-picker-btn .icon-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: inherit;
}

.modal-picker-btn .icon-sidebar svg {
    display: block;
}

/* Grid utilities */
.modal-grid {
    display: grid;
    gap: 14px;
}

.modal-g-1 {
    grid-template-columns: 1fr;
}

.modal-g-2 {
    grid-template-columns: repeat(2, 1fr);
}

.modal-g-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Cards */
.modal-card {
    flex-shrink: 0; /* جلوگیری از فشرده شدن */
    margin-top: 16px;    
    border: 1px solid var(--modal-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.modal-card-h {
    background: linear-gradient(135deg, #eef5ff, #e3f2fd);
    border-bottom: 1px solid var(--modal-border);
    padding: 12px 16px;
    color: #1565c0;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-card-b {
    padding: 16px;
}

.margin-bottom-10 {
    margin-bottom: 10px;
}

.modal-collapse-toggle {
    cursor: pointer;
    user-select: none;
    transition: transform .2s ease;
}

.modal-collapse-toggle:hover {
    color: var(--modal-primary);
}

.modal-hidden {
    display: none !important;
}

/* Form rows (unified: grid) */
.modal-form-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.modal-form-label {
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    color: var(--modal-text);
}

.modal-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--modal-border);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    transition: all .2s ease;
}

.modal-form-control:focus {
    outline: none;
    border-color: var(--modal-primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .1);
}

.modal-form-control::placeholder {
    color: #aaa;
}

/* Checkboxes/inline items */
.modal-form-check {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Prevent background scroll when open (toggle via JS) */
body.modal-open {
    overflow: hidden;
}

/* -------- Special row: account code (override grid -> flex) -------- */
.modal-form-row.account-code-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-form-row.account-code-row .modal-form-label {
    flex: 0 0 90px;
    text-align: left;
    direction: rtl;
}

.account-code-inputs {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    direction: rtl;
}

.account-code-inputs .modal-form-control.code-part {
    width: auto;
    min-width: 0;
    padding: 9px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.account-code-inputs .modal-form-control[data-field="kol"],
.account-code-inputs .modal-form-control[data-field="moeen"] {
    flex: 0 0 85px;
}

.account-code-inputs .modal-form-control[data-field="tafsili1"],
.account-code-inputs .modal-form-control[data-field="tafsili2"] {
    flex: 1 1 0;
}

.modal-form-row.account-code-row .modal-picker-btn {
    flex: 0 0 auto;
}

/* Table styles */
.acc-table-scroll {
    --modal-search-table-height: min(420px, 52vh);
    flex: 1 1 auto;
    height: var(--modal-search-table-height);
    min-height: var(--modal-search-table-height);
    max-height: var(--modal-search-table-height);
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--modal-border);
    border-radius: 8px;
    margin-bottom: 16px;
    min-width: 0;
}

.acc-table-scroll::-webkit-scrollbar {
    width: 8px;
}

.acc-table-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.acc-table-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.modal-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    overflow-x: hidden;
}

.modal-table thead th {
    padding: 12px;
    text-align: center;
    white-space: nowrap;
    background: linear-gradient(135deg, #f7f9ff, #eef5ff);
    border-bottom: 2px solid var(--modal-primary);
    color: var(--modal-primary-dark);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody {

}

.modal-table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--modal-border);
}

.modal-table tbody tr {
    cursor: pointer;
    transition: background .2s ease;
}

.modal-table tbody tr:hover {
    background: #f8fbff;
}

.modal-table tbody tr.selected {
    background: rgba(30, 136, 229, .12);
    border-right: 3px solid var(--modal-primary);
}

.modal-table .col-code {
    width: 160px;
    text-align: center;
    white-space: nowrap;
    font-weight: 600;
    color: var(--modal-primary-dark);
}

.modal-table .col-name {
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    padding-right: 16px;
}

.modal-table th,
.modal-table td {
    border-right: 1px solid var(--modal-border);
}

.modal-table th:first-child,
.modal-table td:first-child {
    border-right: none;
}

/* Loading overlay (global) */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 24, 61, .5);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .25s ease;
}

.loading-overlay.is-open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    background: #fff;
    border: 1px solid #eef2ff;
    border-radius: 20px;
    padding: 28px 32px;
    width: min(92vw, 380px);
    display: grid;
    justify-items: center;
    gap: 14px;
    box-shadow: 0 24px 64px rgba(15, 47, 122, .28);
}

.loading-text {
    color: #133a99;
    font-weight: 700;
    font-size: 15px;
}

.spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 5px solid #e9efff;
    border-top-color: #1f57e6;
    animation: spin .8s linear infinite;
    box-shadow: inset 0 0 0 4px rgba(47, 107, 255, .08);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .modal-backdrop,
    .modal-modal-backdrop {
        padding: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
        align-items: flex-end;
    }

    .modal-modal,
    .modal-modal--wide {
        width: min(100%, 100%);
        max-height: min(94vh, 100%);
    }

    .modal-form-row,
    .modal-form-row.modal-date-row,
    .modal-form-row.account-code-row {
        grid-template-columns: 1fr !important;
    }

    .modal-picker-row,
    .modal-g-2,
    .modal-g-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modal-backdrop {
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        align-items: flex-end;
    }

    .modal-modal,
    .modal-modal--wide {
        width: 100%;
        max-width: 100%;
        max-height: 96vh;
        max-height: 96dvh;
        min-width: 0;
        overflow: hidden;
        border-radius: 14px 14px 0 0;
        align-self: flex-end;
    }

    .modal-modal-header {
        padding: 14px 16px;
        padding-top: max(14px, env(safe-area-inset-top, 0px));
        min-height: 52px;
    }

    .modal-modal-title {
        font-size: 16px;
    }

    .modal-modal-body {
        padding: 14px 16px;
        max-height: calc(96dvh - 140px);
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .modal-modal-footer {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .modal-modal-footer > div,
    .modal-modal-footer .modal-footer-search-fields,
    .modal-modal-footer .modal-footer-search-actions {
        width: 100%;
        min-width: 0 !important;
        flex: 0 0 auto;
        height: auto;
        max-height: none;
    }

    .modal-footer-search {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
    }

    .modal-footer-search-fields {
        grid-template-columns: 1fr;
        flex: 1 1 auto;
    }

    .modal-footer-search-actions {
        display: flex;
        flex-direction: column-reverse;
        width: 100%;
    }

    .modal-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        min-width: 0;
        flex: 0 0 auto;
        height: auto;
        max-height: none;
    }

    .modal-g-2,
    .modal-g-3 {
        grid-template-columns: 1fr;
    }

    .modal-form-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .modal-form-row.modal-date-row {
        grid-template-columns: 1fr !important;
    }

    .modal-form-label {
        text-align: right;
    }

    .account-code-inputs .modal-form-control[data-field="kol"],
    .account-code-inputs .modal-form-control[data-field="moeen"] {
        flex: 0 0 70px;
    }

    .acc-table-scroll {
        --modal-search-table-height: min(50vh, 360px);
        height: var(--modal-search-table-height);
        min-height: var(--modal-search-table-height);
        max-height: var(--modal-search-table-height);
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }

    .modal-table .col-code {
        width: 120px;
        font-size: 13px;
    }

    .modal-table thead th,
    .modal-table tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .modal-form-control,
    .modal-table input,
    .modal-table select {
        font-size: 16px !important;
    }

    .modal-table th.col-code,
    .modal-table td.col-code {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -4px 0 8px -4px rgba(15, 23, 42, .18);
    }

    .modal-table thead th.col-code {
        z-index: 3;
        background: #f1f5f9;
    }
}

@media (max-width: 480px) {
    .modal-modal-header {
        padding: 14px 12px;
    }

    .modal-modal-body {
        padding: 12px;
    }

    .modal-card-b {
        padding: 12px;
    }

    .account-code-inputs {
        flex-wrap: wrap;
    }

    .account-code-inputs .modal-form-control {
        flex: 1 1 calc(50% - 4px);
        min-width: 60px;
    }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    .modal-backdrop {
        transition: none;
    }

    .modal-modal {
        transition: none;
    }

    .spinner {
        animation: none;
        border-top-color: var(--modal-primary);
    }
}


/* مودال جستجو حساب همیشه بالاتر */
#accountSearchBackdrop {
    z-index: 4200 !important;
}

/* مودال فیلتر کارت حساب */
#accountCardFilterBackdrop {
    z-index: 4100 !important;
}


/* اضافه کردن به انتهای فایل modal.css */

/* مودال جستجو حساب همیشه بالاتر */
#accountSearchBackdrop {
    z-index: 4200 !important;
}

/* مودال فیلتر کارت حساب */
#accountCardFilterBackdrop {
    z-index: 4100 !important;
}

/* مودال فیلتر موجودی انبار */
#inventoryFilterBackdrop {
    z-index: 4100 !important;
}

#inventoryFilterBackdrop .inventory-filter-modal {
    width: min(920px, 100%);
}

#inventoryFilterBackdrop .inventory-filter-columns {
    align-items: start;
}

#inventoryFilterBackdrop .inventory-filter-column {
    align-content: start;
}

#inventoryFilterBackdrop .modal-card {
    margin-top: 0;
}

#inventoryFilterBackdrop .inventory-range-grid .modal-form-row {
    grid-template-columns: 88px minmax(0, 1fr);
    margin-bottom: 0;
}

#inventoryFilterBackdrop .inventory-picker-row {
    grid-template-columns: 112px minmax(0, 1fr) auto;
}

#inventoryFilterBackdrop .modal-card-b > .modal-form-row:last-child {
    margin-bottom: 0;
}

#inventoryFilterBackdrop .inventory-number-input {
    direction: ltr;
}

#inventoryFilterBackdrop .modal-form-control[readonly] {
    background: #fafafa;
    cursor: pointer;
}

#inventoryFilterBackdrop .inventory-options-list {
    display: grid;
    gap: 14px;
}

#inventoryFilterBackdrop .inventory-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 26px;
    cursor: pointer;
    font-weight: 500;
}

#inventoryFilterBackdrop .inventory-option input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--modal-primary);
}

@media (max-width: 760px) {
    #inventoryFilterBackdrop .inventory-filter-columns,
    #inventoryFilterBackdrop .inventory-range-grid {
        grid-template-columns: 1fr;
    }

    #inventoryFilterBackdrop .inventory-range-grid .modal-form-row,
    #inventoryFilterBackdrop .inventory-picker-row {
        grid-template-columns: 1fr;
    }
}

/* اعتبارسنجی انتخاب حساب در گزارش کارت حساب */
#accountCardFilterBackdrop .account-required-mark {
    margin-right: 3px;
    color: #dc2626;
    font-weight: 800;
}

#accountCardFilterBackdrop .modal-validation-error {
    margin: 8px 82px 0 0;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
}

#accountCardFilterBackdrop .account-selection-invalid .modal-form-control,
#accountCardFilterBackdrop .account-selection-invalid .modal-picker-btn {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .12);
}

@media (max-width: 768px) {
    #accountCardFilterBackdrop .modal-validation-error {
        margin-right: 0;
    }
}

#costCenterSearchBackdrop {
    z-index: 4300 !important;
}

#listBedBesFilterBackdrop {
    z-index: 4100 !important;
}

#listBedBesFilterBackdrop .lbb-filter-modal {
    width: min(860px, 100%);
}

#listBedBesFilterBackdrop .lbb-picker-row {
    grid-template-columns: 96px minmax(0, 1fr) auto;
}

#listBedBesFilterBackdrop .lbb-card-h-accent {
    color: #9b1c1c;
}

#confirmDialogBackdrop,
.confirm-dialog-backdrop {
    z-index: 5200;
}

.confirm-dialog-modal {
    width: min(440px, 100%);
}

.confirm-dialog-modal .modal-modal-title {
    gap: 8px;
}

.confirm-dialog-modal.confirm-dialog--danger .modal-modal-header {
    background: linear-gradient(135deg, #e53935, #b71c1c);
}

.confirm-dialog-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog-title-icon svg {
    display: block;
}

.confirm-dialog-body {
    padding: 22px 20px !important;
}

.confirm-dialog-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.confirm-dialog-icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fef2f2;
    color: #c62828;
}

.confirm-dialog-modal:not(.confirm-dialog--danger) .confirm-dialog-icon {
    background: #eff6ff;
    color: var(--modal-primary-dark);
}

.confirm-dialog-icon svg {
    display: block;
}

.confirm-dialog-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.confirm-dialog-message {
    margin: 0;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
}

.confirm-dialog-hint {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.modal-btn-danger {
    background: #c62828;
    color: #fff;
    box-shadow: 0 2px 8px rgba(198, 40, 40, .25);
}

.modal-btn-danger:hover:not(:disabled) {
    background: #b71c1c;
    box-shadow: 0 4px 12px rgba(183, 28, 28, .35);
    transform: translateY(-1px);
}

.modal-btn-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, .22);
}

.modal-btn-confirm,
.modal-btn-primary.modal-btn-confirm {
    background-color: #188820;
    box-shadow: 0 2px 8px rgba(24, 136, 32, .25);
}

.modal-btn-confirm:hover:not(:disabled) {
    background-color: #14691a;
    box-shadow: 0 4px 12px rgba(24, 136, 32, .35);
}

.modal-footer-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer-search-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    flex: 1 1 280px;
    min-width: 0;
    width: 100%;
}

.modal-footer-search-fields--single {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

.modal-footer-search-fields--single .modal-form-label {
    text-align: right;
    margin: 0;
}

.modal-footer-search-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.modal-footer-search .modal-form-control {
    min-height: 42px;
}
