﻿.file-ui-root {
    max-width: 860px;
    background: #fff;
    border: 1px solid #cde9d3;
    border-radius: 18px;
    padding: 1.1rem 1.25rem 1.35rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    position: relative;
}

.file-ui-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
}

    .file-ui-header h4 {
        margin: 0;
        font-weight: 600;
        color: #1f5e3a;
        letter-spacing: .5px;
    }

.file-ui-badge {
    background: #e2f4e6;
    border: 1px solid #c8e7d2;
    color: #1f5e3a;
    font-size: .65rem;
    text-transform: uppercase;
    padding: .30rem .55rem .25rem;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: .07em;
}

.file-section {
    background: #fff;
    border: 1px solid #cde9d3;
    border-radius: 14px;
    padding: 1rem .95rem 1.05rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.file-section-title {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #2e8b57;
    margin: 0 0 .7rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.form-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #1f5e3a;
    margin-bottom: .35rem;
}

.bg-preview-area {
    border: 2px dashed #b7e2c1;
    min-height: 240px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    background: #fafefd;
    transition: .22s;
}

    .bg-preview-area.drag {
        border-color: #2e8b57;
        background: #f1fcf4;
    }

    .bg-preview-area img {
        max-width: 100%;
        max-height: 230px;
        border-radius: 12px;
        object-fit: cover;
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
    }

.bg-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    color: #2b6a44;
    font-weight: 500;
    font-size: .9rem;
}

    .bg-preview-placeholder i {
        font-size: 2.4rem;
        color: #2e8b57;
    }

.bg-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

.bg-meta-line-mini {
    margin-top: .5rem;
    font-size: .7rem;
    color: #3d6b48;
    font-weight: 600;
}

.bg-status {
    margin-top: .5rem;
    font-size: .7rem;
    min-height: 14px;
}

.file-preview-box {
    border: 1px solid #cde9d3;
    background: #ffffff;
    border-radius: 14px;
    padding: .85rem .85rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    align-items: center;
}

    .file-preview-box img {
        max-width: 100%;
        max-height: 260px;
        border-radius: 10px;
        object-fit: cover;
        box-shadow: 0 2px 6px rgba(0,0,0,.12);
    }

.file-meta-line {
    font-size: .68rem;
    color: #3d6b48;
    letter-spacing: .04em;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-actions-bar {
    margin-top: .3rem;
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
    border-top: 1px solid #cde9d3;
    padding-top: .85rem;
}

.file-readonly-box {
    background: #f5fcf7;
    border: 1px solid #cde9d3;
    border-radius: 10px;
    padding: .55rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    color: #1f5e3a;
}

.file-inline-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
    gap: .9rem;
}

.file-mini-label {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #2e8b57;
    margin-bottom: .25rem;
}

.file-modal-root {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: none;
}

    .file-modal-root.open {
        display: block;
    }

.file-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.file-modal-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 92%;
    max-width: 1080px;
    height: 82%;
    background: #fff;
    border: 1px solid #cde9d3;
    border-radius: 18px;
    box-shadow: 0 6px 26px rgba(0,0,0,.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .85rem;
    border-bottom: 1px solid #cde9d3;
    background: #f5fcf7;
}

.file-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f5e3a;
}

.file-modal-close {
    background: transparent;
    border: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: #2e8b57;
    cursor: pointer;
}

.file-modal-body {
    flex: 1;
    overflow: auto;
    padding: 1rem 1rem 1.25rem;
}

.file-modal-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

body.file-modal-open {
    overflow: hidden;
}

@media (max-width:575.98px) {
    .file-inline-fields {
        grid-template-columns: 1fr;
    }

    .file-ui-root {
        padding: 1rem 1rem 1.2rem;
    }
}

.fb-top-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .75rem;
    align-items: flex-start;
}

    .fb-top-meta .obj-title {
        font-size: 1.05rem;
        font-weight: 600;
        color: #1f5e3a;
        letter-spacing: .4px;
        margin: 0;
    }

.img-wrapper.fb-inline {
    width: 100%;
    min-height: 180px;
    border: 1px dashed #cde9d3;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #f5fcf7;
    overflow: hidden;
}

    .img-wrapper.fb-inline.no-image-bg {
        background: repeating-linear-gradient(45deg,#ffffff 0 14px,#eef7f2 14px 28px);
    }

    .img-wrapper.fb-inline img.item-img {
        position: static;
        width: auto;
        height: 160px;
        max-width: 100%;
        object-fit: contain;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
    }

.collapsible-section {
    position: relative;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
}

.collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, opacity .25s ease;
    opacity: 0;
}

.collapsible-section.expanded .collapsible-body {
    opacity: 1;
    max-height: 420px;
}

.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.media-thumb {
    width: 80px;
    height: 80px;
    position: relative;
    border: 1px solid #cde9d3;
    border-radius: 10px;
    background: #f5fcf7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .media-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.media-item {
    position: relative;
}

.media-actions {
    position: absolute;
    inset: auto 2px 2px 2px;
    display: flex;
    gap: 2px;
    justify-content: center;
    flex-wrap: wrap;
}

    .media-actions .btn {
        padding: .15rem .35rem;
        font-size: .55rem;
        line-height: 1;
        border-radius: 6px;
    }

.media-scroll {
    overflow: auto;
    padding: .25rem .25rem .5rem;
    background: #ffffff;
    border: 1px solid #cde9d3;
    border-radius: 12px;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: .7rem;
}

.doc-item {
    position: relative;
    padding: .35rem .4rem .45rem;
    border: 1px solid #cde9d3;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.doc-actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.file-ui-root .section-caption {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    color: #2e8b57;
    margin-bottom: .25rem;
}

.embed-back-btn {
    border: 1px solid #84cfa3;
    background: #ffffff;
    color: #1f5e3a;
    border-radius: 26px;
    padding: .45rem .9rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    cursor: pointer;
    transition: .2s;
}

    .embed-back-btn:hover,
    .embed-back-btn:focus {
        background: #2e8b57;
        color: #fff;
        border-color: #2e8b57;
        text-decoration: none;
    }

    .embed-back-btn:active {
        transform: translateY(1px);
    }

.embedded-full {
    max-width: 100%;
    border: 0;
    border-radius: 0;
    padding: 0 0 1rem 0;
    box-shadow: none;
}

    .embedded-full .file-ui-header {
        border-bottom: 1px solid #cde9d3;
        padding: 1rem 1rem .75rem 1rem;
        margin-bottom: .75rem;
    }

    .embedded-full .file-section {
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0 1rem 1rem 1rem;
        background: transparent;
    }

    .embedded-full .upload-section {
        background: transparent;
        border-bottom: 1px solid #cde9d3;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
