.mf-file-list {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.mf-file-list thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--mf-bg);
}

.mf-file-list th {
    text-align: left;
    padding: var(--mf-space-3) var(--mf-space-4);
    font-size: 12px;
    font-weight: 600;
    color: var(--mf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--mf-border);
    white-space: nowrap;
}

.mf-file-list th:first-child { padding-left: var(--mf-space-5); }
.mf-file-list th:last-child  { padding-right: var(--mf-space-5); }

.mf-file-list__col-check    { width: 40px; padding-right: 0; }
.mf-file-list__col-name     { width: auto; }
.mf-file-list__col-modified { width: 180px; }
.mf-file-list__col-size     { width: 100px; text-align: right; }
.mf-file-list__col-actions  { width: 60px; text-align: right; }

.mf-file-row__check-cell { padding-right: 0; }

.mf-file-row__check {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--mf-primary);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--mf-transition);
}

.mf-file-row:hover .mf-file-row__check,
.mf-file-row--checked .mf-file-row__check,
.mf-file-list thead input[type="checkbox"]:checked ~ * ,
.mf-file-list thead .mf-file-row__check {
    opacity: 1;
}

.mf-file-list thead input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--mf-primary);
    cursor: pointer;
}

.mf-file-row--checked {
    background: var(--mf-primary-subtle);
}

.mf-file-row {
    cursor: pointer;
    transition: background-color var(--mf-transition);
}

.mf-file-row:hover {
    background: var(--mf-surface-2);
}

.mf-file-row--selected {
    background: var(--mf-primary-subtle);
}

.mf-file-row td {
    padding: var(--mf-space-3) var(--mf-space-4);
    font-size: 14px;
    color: var(--mf-text);
    border-bottom: 1px solid var(--mf-border);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mf-file-row td:first-child { padding-left: var(--mf-space-5); }
.mf-file-row td:last-child  { padding-right: var(--mf-space-5); }

.mf-file-row__name-cell {
    display: flex;
    align-items: center;
    gap: var(--mf-space-3);
    min-width: 0;
}

.mf-file-row__icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: var(--mf-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mf-surface-2);
    color: var(--mf-text-muted);
}

.mf-file-row__icon svg { width: 20px; height: 20px; }

.mf-file-row__icon--folder { background: var(--mf-primary-subtle); color: var(--mf-primary); }
.mf-file-row__icon--image  { background: #FDF2F8; color: #DB2777; }
.mf-file-row__icon--video  { background: #FEF3C7; color: #B45309; }
.mf-file-row__icon--audio  { background: #ECFDF5; color: #10B981; }
.mf-file-row__icon--pdf    { background: #FEE2E2; color: #B91C1C; }
.mf-file-row__icon--doc    { background: #DBEAFE; color: #1D4ED8; }
.mf-file-row__icon--sheet  { background: #D1FAE5; color: #047857; }
.mf-file-row__icon--slide  { background: #FED7AA; color: #C2410C; }
.mf-file-row__icon--archive{ background: #F3E8FF; color: #7E22CE; }
.mf-file-row__icon--code   { background: #E0E7FF; color: #4338CA; }

[data-bs-theme="dark"] .mf-file-row__icon--image  { background: #831843; color: #F9A8D4; }
[data-bs-theme="dark"] .mf-file-row__icon--video  { background: #78350F; color: #FCD34D; }
[data-bs-theme="dark"] .mf-file-row__icon--audio  { background: #064E3B; color: #6EE7B7; }
[data-bs-theme="dark"] .mf-file-row__icon--pdf    { background: #7F1D1D; color: #FCA5A5; }
[data-bs-theme="dark"] .mf-file-row__icon--doc    { background: #1E3A8A; color: #93C5FD; }
[data-bs-theme="dark"] .mf-file-row__icon--sheet  { background: #064E3B; color: #6EE7B7; }
[data-bs-theme="dark"] .mf-file-row__icon--slide  { background: #7C2D12; color: #FDBA74; }
[data-bs-theme="dark"] .mf-file-row__icon--archive{ background: #581C87; color: #D8B4FE; }
[data-bs-theme="dark"] .mf-file-row__icon--code   { background: #1E1B4B; color: #A5B4FC; }

.mf-file-row__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mf-text);
    font-weight: 500;
}

.mf-file-row__modified,
.mf-file-row__size {
    color: var(--mf-text-muted);
    font-size: 13px;
}

.mf-file-row__size { text-align: right; }

.mf-file-row__actions { text-align: right; }

@media (max-width: 767.98px) {
    .mf-file-list__col-modified,
    .mf-file-row__modified { display: none; }
    .mf-file-list__col-size { width: 80px; }
}

@media (max-width: 575.98px) {
    .mf-file-row__size,
    .mf-file-list__col-size { display: none; }
}
