/* ZDialog - собственные диалоги и тосты движка (см. z-dialog.js).
   Селекторы swal2-input / swal2-content не стилизуем здесь: это алиас-классы,
   их наследие обслуживает office.css; свои стили - только zdlg-*. */

.zdlg-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 33, 46, 0.45);
    padding: 16px;
}

.zdlg-popup {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(20, 16, 60, 0.25);
    max-width: 32em;
    width: 100%;
    padding: 22px 26px 20px;
    text-align: center;
    font-size: 1rem;
    animation: zdlg-pop .18s ease-out;
    /* НЕ hidden: выпадашки внутри контента (void_autocomplete в диалоге
       переключения пользователя) должны выходить за края попапа */
    overflow: visible;
}

@keyframes zdlg-pop {
    from { transform: scale(.92); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.zdlg-icon {
    width: 64px;
    height: 64px;
    margin: 4px auto 12px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    font-family: inherit;
}
.zdlg-icon-sm {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-width: 2px;
    font-size: 16px;
    margin: 0 10px 0 0;
}
.zdlg-icon-success  { color: #2f9e44; border-color: #8ce99a; }
.zdlg-icon-error    { color: #e03131; border-color: #ffa8a8; }
.zdlg-icon-warning  { color: #f08c00; border-color: #ffd8a8; font-family: Georgia, serif; }
.zdlg-icon-info     { color: #1971c2; border-color: #a5d8ff; font-family: Georgia, serif; font-style: italic; }
.zdlg-icon-question { color: #604fc9; border-color: #cdc5f4; }

.zdlg-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #2b2b3a;
    margin-bottom: 8px;
    word-break: break-word;
}

.zdlg-content {
    color: #45454f;
    word-break: break-word;
}

.zdlg-input {
    display: block;
    width: 100%;
    margin: 14px auto 0;
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #cfcfda;
    border-radius: 6px;
    background: #fff;
    color: #2b2b3a;
    box-sizing: border-box;
}
.zdlg-input:focus {
    outline: none;
    border-color: #604fc9;
    box-shadow: 0 0 0 3px rgba(96, 79, 201, 0.15);
}

.zdlg-validation {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff0f0;
    color: #c92a2a;
    font-size: .9rem;
}

.zdlg-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.zdlg-btn {
    border: 0;
    border-radius: 6px;
    padding: 9px 22px;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    color: #fff;
    background: #604fc9;
    transition: filter .12s;
}
.zdlg-btn:hover:not(:disabled) { filter: brightness(1.08); }
.zdlg-btn:disabled { opacity: .65; cursor: default; }
.zdlg-btn-cancel { background: #868e96; }
.zdlg-btn-deny { background: #adb5bd; color: #2b2b3a; }

/* спиннер на confirm при showLoaderOnConfirm */
.zdlg-btn-loading {
    color: transparent !important;
    position: relative;
}
.zdlg-btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: zdlg-spin .7s linear infinite;
}
@keyframes zdlg-spin { to { transform: rotate(360deg); } }

.zdlg-timerbar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    background: #604fc9;
    width: 100%;
    /* скругление краёв полосы самостоятельно (попап больше не клипает overflow) */
    border-radius: 0 0 10px 10px;
    animation-name: zdlg-timer;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}
@keyframes zdlg-timer { from { width: 100%; } to { width: 0; } }

/* ---- тосты (правый верхний угол, стек, живут независимо от диалога) ---- */

.zdlg-toasts {
    position: fixed;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    pointer-events: none;
}

.zdlg-toast {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(20, 16, 60, 0.22);
    padding: 10px 16px;
    min-width: 240px;
    max-width: 420px;
    pointer-events: auto;
    cursor: pointer;
    animation: zdlg-toast-in .18s ease-out;
    overflow: hidden;
}
@keyframes zdlg-toast-in {
    from { transform: translateX(24px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.zdlg-toast-title {
    font-weight: 600;
    color: #2b2b3a;
    font-size: .95rem;
}
.zdlg-toast-html {
    color: #45454f;
    font-size: .88rem;
}

@media (max-width: 576px) {
    .zdlg-popup { padding: 18px 14px 16px; }
    .zdlg-actions { flex-direction: column; }
    .zdlg-btn { width: 100%; }
}

/* ---- ZViewer: полноэкранный просмотр картинок (см. z-dialog.js) ---- */

.zview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 18, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zdlg-pop .15s ease-out;
}
.zview-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.zview-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    background: #fff;
}
.zview-btn {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s;
}
.zview-btn:hover { background: rgba(255, 255, 255, 0.28); }
.zview-close { top: 16px; right: 16px; }
.zview-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.zview-next { right: 14px; top: 50%; transform: translateY(-50%); }
.zview-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}
.zview-caption {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 80vw;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}
