/* ZFile - свой виджет загрузки файлов/картинок (см. z-file.js, замена Krajee) */

.zfile {
    border: 1px dashed #cfd3dd;
    border-radius: 10px;
    padding: 10px;
    background: #fafbfd;
    transition: border-color .15s, background .15s;
}
.zfile.zfile-drag {
    border-color: #604fc9;
    background: #f3f1fc;
}

.zfile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zfile-item,
.zfile-add {
    width: 132px;
    height: 132px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e7ee;
}

.zfile-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #8b90a0;
    border-style: dashed;
    text-align: center;
    font-size: .78rem;
    padding: 8px;
    user-select: none;
}
.zfile-add:hover { color: #604fc9; border-color: #604fc9; }
.zfile-add i { font-size: 22px; }

.zfile-prev {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a7abba;
    font-size: 34px;
}
.zfile-prev img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zfile-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(22, 22, 34, 0.55);
    color: #fff;
    font-size: .68rem;
    line-height: 1.3;
    padding: 3px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zfile-actions {
    position: absolute;
    top: 4px; right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .12s;
}
.zfile-item:hover .zfile-actions { opacity: 1; }

.zfile-btn {
    border: 0;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    background: rgba(22, 22, 34, 0.55);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zfile-btn:hover { background: #604fc9; }
.zfile-btn .zfile-del:hover,
.zfile-btn:hover .fa-trash-can { color: #ffd3d3; }

.zfile-progress {
    position: absolute;
    left: 0; bottom: 0;
    height: 4px;
    width: 0;
    background: #604fc9;
    transition: width .15s;
    z-index: 2;
}
.zfile-loading .zfile-prev { opacity: .5; }

/* компактный single-режим (аватар, одиночный файл в форме) */
.zfile-single .zfile-item,
.zfile-single .zfile-add { width: 112px; height: 112px; }
