.files-page {
    padding: 22px;
}

.files-container {
    width: min(1400px, 100%);
    margin: 0 auto;
}

.files-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.files-heading h1 {
    margin: 0 0 5px;
}

.storage-card {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.9);
}

.storage-values {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.storage-value {
    display: grid;
    gap: 4px;
}

.storage-value strong {
    font-size: 18px;
}

.storage-value span {
    color: var(--muted);
    font-size: 12px;
}

.storage-progress {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #0c1322;
}

.storage-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--primary),
        #8f73ff
    );
    transition: width 0.25s ease;
}

.files-toolbar {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.files-toolbar label {
    min-width: 180px;
    margin: 0;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(220px, 1fr)
    );
    gap: 14px;
}

.file-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel);
}

.file-preview {
    display: grid;
    width: 100%;
    height: 190px;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: #0c1322;
    color: var(--muted);
}

.file-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-placeholder {
    padding: 15px;
    text-align: center;
    overflow-wrap: anywhere;
}

.file-information {
    display: grid;
    gap: 7px;
    padding: 13px;
}

.file-name {
    overflow: hidden;
    color: var(--text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.file-actions {
    display: flex;
    gap: 7px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.file-actions a {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--panel-2);
    text-decoration: none;
}

.file-actions a:hover {
    border-color: var(--primary);
}

.files-empty {
    padding: 70px 20px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

.files-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.files-loading {
    padding: 50px 20px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 700px) {
    .files-page {
        padding: 14px;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .file-preview {
        height: 220px;
    }

    .files-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .files-toolbar label {
        width: 100%;
        min-width: 0;
    }
}
