/* ==========================================================
   R19.5A — Layout refinement after workflow completion
   ========================================================== */

/* Hide the old File Sections location after it has been moved */
.vault-project-tree > .tree-head,
.vault-project-tree > .tree-section {
    display: none;
}

/* Project Files heading / toolbar */
.vault-files-panel > .panel-head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 20px !important;
}

.vault-files-panel > .panel-head > div:first-child {
    display: grid;
    gap: 3px;
}

.vault-files-panel > .panel-head .eyebrow {
    margin: 0 !important;
    color: #83b4ff !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    letter-spacing: .11em;
}

.vault-files-panel > .panel-head h3 {
    margin: 0 !important;
    font-size: 21px !important;
    line-height: 1.1;
}

.vault-files-panel > .panel-head .primary-link {
    min-height: 39px;
    padding: 0 15px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 900;
}

/* Filters become a proper compact toolbar */
.vault-files-panel .filter-bar {
    margin-top: 10px !important;
}

.vault-files-panel .filter-bar label {
    display: grid;
    gap: 6px;
    color: #a9c4e8;
    font-size: 10px;
    font-weight: 850;
}

.vault-files-panel .filter-bar input,
.vault-files-panel .filter-bar select {
    width: 100%;
    background: rgba(4, 15, 29, .72) !important;
}

/* File Sections move lower and become a clean drawer */
.vault-sections-drawer {
    margin-top: 24px !important;
    border-color: rgba(121, 177, 252, .23) !important;
    background: linear-gradient(145deg, rgba(11, 35, 59, .90), rgba(5, 19, 34, .96)) !important;
    overflow: hidden;
}

.vault-sections-details > summary {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 75px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, rgba(43, 105, 194, .22), rgba(7, 21, 37, .16));
}

.vault-sections-details > summary::-webkit-details-marker {
    display: none;
}

.vault-sections-details > summary:hover {
    background: linear-gradient(90deg, rgba(56, 125, 224, .30), rgba(8, 25, 43, .22));
}

.vault-sections-summary-copy {
    display: grid;
    gap: 3px;
}

.vault-sections-summary-copy small {
    color: #84b5ff !important;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.vault-sections-summary-copy strong {
    color: #f1f7ff !important;
    font-size: 17px;
}

.vault-sections-summary-copy em {
    color: #9db7da !important;
    font-size: 11px;
    font-style: normal;
}

.vault-sections-summary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 33px;
    padding: 0 12px;
    border: 1px solid rgba(129, 184, 255, .34);
    border-radius: 8px;
    color: #cce0ff !important;
    background: rgba(51, 111, 194, .18);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.vault-sections-details[open] > summary .vault-sections-summary-action {
    border-color: rgba(102, 215, 173, .38);
    color: #d7ffec !important;
    background: rgba(33, 157, 115, .18);
}

.vault-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    padding: 14px 16px 17px;
    border-top: 1px solid rgba(134, 181, 249, .14);
}

.vault-sections-grid .tree-head {
    display: none !important;
}

.vault-sections-grid .tree-section {
    display: flex !important;
    align-items: center;
    min-height: 42px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid rgba(125, 177, 250, .16);
    border-radius: 9px;
    color: #c4dcff !important;
    background: rgba(5, 17, 32, .56);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none !important;
}

.vault-sections-grid .tree-section:hover {
    border-color: rgba(127, 184, 255, .48);
    color: #fff !important;
    background: rgba(43, 105, 194, .27);
    transform: translateY(-1px);
}

.vault-sections-grid .tree-section.active {
    border-color: rgba(127, 193, 255, .62);
    color: #fff !important;
    background: linear-gradient(135deg, rgba(47, 116, 214, .56), rgba(27, 70, 128, .72));
}

.vault-sections-grid .tree-section span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-sections-grid .tree-section small {
    margin-inline-start: auto;
    padding-inline-start: 8px;
    color: #8fc1ff !important;
    font-size: 8px;
    font-weight: 900;
}

/* The upload panel has clearer separation */
#upload-file.vault-form-panel {
    margin-top: 24px !important;
}

@media (max-width: 720px) {
    .vault-files-panel > .panel-head,
    .vault-sections-details > summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .vault-files-panel > .panel-head .primary-link,
    .vault-sections-summary-action {
        width: 100%;
    }

    .vault-sections-grid {
        grid-template-columns: 1fr;
        padding: 11px;
    }

    .vault-sections-summary-copy em {
        line-height: 1.45;
    }
}
