.daa-file-manager {
    max-width: 1120px;
    margin: 22px auto;
    overflow: hidden;
    border: 1px solid #87a8d8;
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 40px rgba(17, 58, 119, .14);
}

.file-manager__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 0, rgba(126, 206, 255, .35), transparent 38%),
        linear-gradient(135deg, #0d3d96, #1c70df 58%, #0a4fb9);
}

.file-manager__header h2 { margin: 3px 0; color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); }
.file-manager__header p { max-width: 700px; margin: 7px 0 0; color: #dcecff; }
.file-manager__header .eyebrow { color: #aee0ff; }
.file-manager__connection { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .9rem; }
.file-manager__connection i { width: 10px; height: 10px; border-radius: 50%; background: #53e48a; box-shadow: 0 0 0 4px rgba(83, 228, 138, .18); }

.file-manager__chrome {
    display: grid;
    grid-template-columns: auto auto minmax(180px, 1fr);
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #b8cce8;
    background: linear-gradient(#f8fbff, #deebfb);
}

.file-tool,
.file-breadcrumb button,
.file-action button,
.file-action a {
    min-height: 34px;
    border: 1px solid #91acd0;
    border-radius: 7px;
    color: #12386c;
    background: linear-gradient(#fff, #e4effd);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.file-tool { padding: 6px 11px; }
.file-tool:hover:not(:disabled), .file-action button:hover, .file-action a:hover { border-color: #2468c7; background: #fff; }
.file-tool:disabled { opacity: .45; cursor: default; }

.file-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 4px 8px;
    overflow-x: auto;
    border: 1px solid #9db6d7;
    border-radius: 7px;
    background: #fff;
}

.file-breadcrumb button { min-height: 26px; padding: 2px 7px; border: 0; background: transparent; white-space: nowrap; }
.file-breadcrumb button:hover { background: #e9f3ff; }
.file-breadcrumb span { color: #7290b5; }

.file-manager__actions {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr);
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid #d0deef;
    background: #f7fbff;
}

.file-upload-form,
.file-folder-form {
    display: flex;
    align-items: end;
    gap: 9px;
    min-width: 0;
}

.file-upload-form { flex-wrap: wrap; }
.file-upload-form small { flex-basis: 100%; color: #5f7089; }
.file-picker, .file-folder-form label { display: grid; flex: 1; gap: 5px; min-width: 160px; color: #173c70; font-weight: 700; }
.file-picker input, .file-folder-form input { min-height: 38px; padding: 7px 9px; border: 1px solid #9fb7d7; border-radius: 7px; background: #fff; }
.file-primary-action { color: #fff; background: linear-gradient(#2d89f3, #1162c7); }

.file-drop-zone {
    margin: 0 14px 14px;
    padding: 14px;
    border: 2px dashed #8eb2df;
    border-radius: 10px;
    color: #385f91;
    text-align: center;
    background: #f2f8ff;
    transition: .15s ease;
}

.file-drop-zone.is-dragging { border-color: #1d6fd6; color: #0c4da5; background: #deedff; transform: scale(.995); }

.file-manager__status {
    padding: 9px 14px;
    border-bottom: 1px solid #d5e1ef;
    color: #46617e;
    background: #fbfdff;
}

.file-manager__status[data-state="error"] { color: #8a1520; background: #fff0f1; }
.file-manager__status[data-state="success"] { color: #24603d; background: #effbf4; }
.file-manager__status[data-state="loading"] { color: #164f96; }

.file-list { min-height: 150px; }
.file-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.7fr) minmax(150px, .65fr) 100px 210px;
    gap: 12px;
    align-items: center;
    min-height: 54px;
    padding: 8px 14px;
    border-bottom: 1px solid #e1e9f3;
}

.file-row:not(.file-row--heading):hover { background: #edf6ff; }
.file-row--heading { min-height: 38px; color: #4b6380; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #edf3fa; }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; color: #142f55; text-align: left; background: transparent; font: inherit; }
button.file-name { cursor: pointer; }
.file-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name__icon { flex: 0 0 auto; font-size: 1.7rem; filter: drop-shadow(0 2px 2px rgba(0, 50, 120, .15)); }
.file-date, .file-size { color: #5d6d82; font-size: .9rem; }
.file-action { display: flex; justify-content: flex-end; gap: 6px; }
.file-action button, .file-action a { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 9px; font-size: .88rem; }
.file-list__empty { padding: 34px 18px; color: #66758a; text-align: center; }

.pdf-preview {
    width: min(1120px, calc(100vw - 32px));
    height: min(860px, calc(100vh - 32px));
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid #164f9c;
    border-radius: 12px;
    background: #e8f1fb;
    box-shadow: 0 24px 80px rgba(0, 22, 60, .48);
}

.pdf-preview::backdrop { background: rgba(3, 17, 39, .68); }
.pdf-preview__window { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100%; }
.pdf-preview__header,
.pdf-preview__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; }
.pdf-preview__header { color: #fff; background: linear-gradient(#3989ed, #0758bb); }
.pdf-preview__header div { display: grid; min-width: 0; }
.pdf-preview__header span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .82; }
.pdf-preview__header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-preview__header button { width: 34px; height: 32px; border: 1px solid #fff; border-radius: 7px; color: #fff; background: #d93924; font-size: 1.25rem; cursor: pointer; }
.pdf-preview__footer { border-top: 1px solid #abc0dd; background: #edf4fc; }
.pdf-preview__footer .file-tool { display: inline-flex; align-items: center; text-decoration: none; }
.pdf-preview iframe { width: 100%; height: 100%; border: 0; background: #59616c; }

@media (max-width: 820px) {
    .file-manager__header { align-items: flex-start; flex-direction: column; }
    .file-manager__chrome { grid-template-columns: auto auto; }
    .file-breadcrumb { grid-column: 1 / -1; }
    .file-manager__actions { grid-template-columns: 1fr; }
    .file-row { grid-template-columns: minmax(0, 1fr) 110px; }
    .file-row--heading { display: none; }
    .file-date { display: none; }
    .file-size { grid-column: 1; padding-left: 44px; }
    .file-action { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 540px) {
    .daa-file-manager { margin-inline: -8px; border-radius: 9px; }
    .file-manager__header { padding: 16px; }
    .file-upload-form, .file-folder-form { align-items: stretch; flex-direction: column; }
    .file-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .file-size { grid-column: 1; }
    .file-action { grid-column: 1; grid-row: auto; justify-content: flex-start; padding-left: 44px; }
}
