.band-files {
    --files-accent: #5568d3;
    --files-border: #dde2ed;
    --files-muted: #596477;
    color: #283345;
    font-size: 0.92rem;
    line-height: 1.5;
}

.band-files [hidden] {
    display: none !important;
}

.band-files button,
.band-files input,
.band-files select {
    font: inherit;
}

.band-files button,
.band-files select {
    min-height: 36px;
}

.band-files button:focus-visible,
.band-files select:focus-visible,
.band-files input:focus-visible,
.band-files [tabindex]:focus-visible,
.files-manager-toggle:focus-within {
    outline: 3px solid var(--files-accent, #5568d3);
    outline-offset: 3px;
}

.band-files button:disabled,
.band-files input:disabled,
.band-files select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.band-files .btn-small {
    padding: 7px 12px;
    font-size: 0.83rem;
    white-space: normal;
}

.band-files .btn:not(.btn-primary):not(.btn-delete) {
    background: #eef0f6;
    color: #34415a;
}

.band-files .btn:not(.btn-primary):not(.btn-delete):hover {
    background: #e0e5f1;
}

.band-files .btn-delete {
    background: #fff0f0;
    color: #a12626;
    border: 1px solid #edc7c7;
}

.band-files .btn-delete:hover {
    background: #ffe0e0;
}

.files-toolbar,
.files-detail-heading,
.files-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.files-toolbar h3 {
    font-size: 1.25rem;
    color: #303b52;
}

.files-muted,
.files-list-meta,
.files-read-legend {
    color: var(--files-muted);
    font-size: 0.79rem;
}

.files-status {
    min-height: 1.5em;
    margin: 10px 0 14px;
    color: var(--files-muted);
    font-size: 0.82rem;
}

.files-status.is-error,
.files-error {
    color: #a12626;
}

.files-layout {
    display: grid;
    grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
    border: 1px solid var(--files-border);
    border-radius: 7px;
    overflow: hidden;
    min-height: 540px;
}

.files-sidebar {
    padding: 18px 14px;
    background: #f8f9fc;
    border-right: 1px solid var(--files-border);
    min-width: 0;
}

.files-sidebar h4 {
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.band-files label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.band-files select {
    width: 100%;
    max-width: 100%;
    padding: 7px 9px;
    border: 1px solid #cbd2df;
    border-radius: 4px;
    background: white;
    color: #34415a;
}

.files-read-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
    font-size: 0.73rem;
}

.files-read-legend .is-read {
    margin-left: 10px;
}

.files-dot {
    display: inline-block;
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--files-accent);
    border-radius: 50%;
    background: var(--files-accent);
}

.files-dot.is-read {
    background: transparent;
}

.files-list {
    max-height: 440px;
    overflow-y: auto;
    padding: 3px;
    margin: 0 -3px;
    scrollbar-width: thin;
}

.files-group + .files-group {
    margin-top: 16px;
}

.files-group-label {
    padding: 0 8px 5px;
    color: var(--files-muted);
    font-size: 0.73rem;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

.files-list-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #303b52;
    text-align: left;
    cursor: pointer;
}

.files-list-item:hover {
    background: #eef0f8;
}

.files-list-item.is-selected {
    border-color: #c5cef7;
    background: #e9edfc;
}

.files-list-info,
.files-detail-info {
    min-width: 0;
}

.files-filename {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.84rem;
    font-weight: 600;
}

.files-list-meta {
    display: block;
    margin-top: 2px;
    font-size: 0.73rem;
}

.files-list-empty {
    padding: 20px 8px;
    font-size: 0.85rem;
    color: var(--files-muted);
}

.files-upload {
    border-top: 1px solid var(--files-border);
    padding-top: 18px;
    margin-top: 20px;
}

.files-dropzone {
    border: 1px dashed #9ca9c6;
    background: #fff;
    border-radius: 4px;
    padding: 15px 10px;
    text-align: center;
    margin: 10px 0 7px;
    font-size: 0.8rem;
    color: #495874;
}

.files-dropzone.is-dragging,
.files-dropzone:focus-within {
    border-color: var(--files-accent);
    background: #e9edfc;
}

.files-dropzone .files-picker {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid #c5cef7;
    border-radius: 4px;
    background: #eef0f6;
    color: #4054bd;
    margin: 8px 0 3px;
    cursor: pointer;
}

.files-dropzone .files-picker:hover {
    background: #e0e5f1;
}

.files-dropzone:has(input:focus-visible) .files-picker {
    outline: 3px solid var(--files-accent);
    outline-offset: 3px;
}

.files-dropzone:has(input:disabled) .files-picker {
    opacity: 0.6;
    cursor: not-allowed;
}

#files-clear-queue {
    margin-top: 12px;
}

.files-upload > .files-muted {
    margin-top: 6px;
}

.files-queue:empty,
.files-download-status:empty {
    display: none;
}

.files-queue {
    margin-top: 16px;
}

.files-queue-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--files-border);
}

.files-queue-item progress {
    width: 100%;
    height: 7px;
    accent-color: var(--files-accent);
}

.files-detail {
    min-width: 0;
    margin: 0;
    background: white;
}

.files-detail-heading {
    padding: 18px 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    border-bottom: 1px solid var(--files-border);
}

.files-detail-heading h3 {
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.files-detail-info {
    flex: 1 1 190px;
}

.files-detail-meta {
    margin-top: 4px;
}

.files-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
}

.files-preview {
    min-width: 0;
    min-height: 420px;
    background: #f3f5f9;
}

.files-empty {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    gap: 10px;
    color: var(--files-muted);
}

.files-empty h4 {
    color: #34415a;
    font-size: 1rem;
}

.files-empty p {
    max-width: 340px;
    font-size: 0.85rem;
}

.files-preview-message,
.files-download-status {
    padding: 12px 20px;
    font-size: 0.82rem;
    color: var(--files-muted);
}

.files-download-status {
    border-bottom: 1px solid var(--files-border);
}

.files-download-status .btn {
    margin-top: 8px;
}

.files-pdf {
    display: block;
    width: 100%;
    min-height: 590px;
    border: none;
    background: white;
}

.files-image {
    display: block;
    width: 100%;
    height: 510px;
    padding: 20px;
    object-fit: contain;
}

.files-workbook {
    min-width: 0;
    padding: 16px;
}

.files-sheet-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.files-sheet-controls label {
    margin: 0;
}

.files-sheet-controls select {
    width: auto;
    min-width: 0;
    max-width: 75%;
}

.files-parser-notice {
    color: #765209;
    background: #fff7df;
    border-left: 3px solid #c79224;
    font-size: 0.78rem;
    padding: 8px 10px;
    margin-top: 8px;
}

.files-sheet-scroll {
    max-width: 100%;
    overflow: auto;
    max-height: 540px;
    margin-top: 14px;
    border: 1px solid var(--files-border);
    background: white;
}

.files-sheet {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    width: max-content;
    min-width: 100%;
}

.files-sheet td,
.files-sheet th {
    border-right: 1px solid #e2e6ee;
    border-bottom: 1px solid #e2e6ee;
    padding: 5px 9px;
    min-width: 60px;
    max-width: 330px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    vertical-align: top;
    text-align: left;
}

.files-sheet th {
    color: #465570;
    background: #edf0f6;
}

.files-sheet thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.files-sheet tbody th {
    min-width: 42px;
    position: sticky;
    left: 0;
}

.files-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.files-manager-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    margin: 6px 8px;
    color: #34415a;
}

.files-manager-toggle input {
    width: auto;
    margin: 0;
    accent-color: #5568d3;
}

.files-manager-status {
    font-size: 0.78rem;
    color: #596477;
}

#band-members-admin .admin-item {
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 720px) {
    .files-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .files-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--files-border);
    }

    .files-list {
        max-height: 280px;
    }

    .files-detail-heading {
        padding: 16px;
    }

    .files-toolbar {
        align-items: flex-start;
    }

    .files-empty {
        min-height: 280px;
    }

    .files-image {
        height: 360px;
    }

    .files-workbook {
        padding: 10px;
    }
}
