#storage-file-manager { min-width: 0; letter-spacing: 0; }
#storage-file-manager [hidden] { display: none !important; }
#storage-file-manager :is(button, a, input, select):focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.sf-toolbar, .sf-viewbar, .sf-filters, .sf-bulk, .sf-tabs, .sf-crumbs, .sf-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-toolbar { justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
#storage-file-manager .sf-toolbar h2 { margin: 0; }
.sf-links { gap: 16px; }
.sf-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--admin-text-muted); text-decoration: none; font-size: 13px; }
.sf-links a:hover { color: var(--ui-accent); }
.sf-links i { font-size: 14px; }
.sf-viewbar { justify-content: space-between; border-bottom: 1px solid var(--admin-border); }
.sf-tabs { align-self: stretch; gap: 20px; }
#storage-file-manager .sf-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--admin-text-muted); background: transparent; }
#storage-file-manager .sf-tabs button[aria-selected="true"] { border-bottom-color: var(--ui-accent); color: var(--ui-accent); font-weight: 600; }
.sf-filters { gap: 12px; margin: 16px 0; }
.sf-filters form { display: flex; gap: 0; flex: 1; min-width: 180px; position: relative; }
#storage-file-manager .sf-filters input { min-width: 0; width: 100%; padding-right: 48px; height: 44px; }
#storage-file-manager .sf-filters form button { position: absolute; right: 1px; top: 1px; min-height: 42px; height: 42px; width: 44px; border: 0; background: transparent; }
.sf-filters select { max-width: 100%; width: 140px; height: 44px; }
.sf-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); border-top: 1px solid var(--admin-border); border-bottom: 1px solid var(--admin-border); background: var(--admin-surface); }
.sf-layout:has(> .sf-tree[hidden]) { grid-template-columns: minmax(0, 1fr); }
.sf-tree { padding: 16px 12px; border-right: 1px solid var(--admin-border); max-height: 620px; overflow: auto; min-width: 0; background: var(--admin-surface-raised); }
.sf-tree-heading { display: block; margin: 0 8px 12px; font-size: 12px; color: var(--admin-text-muted); }
#storage-file-manager .sf-tree button { border: 0; background: transparent; text-align: left; padding: 8px; white-space: normal; overflow-wrap: anywhere; min-height: 40px; max-width: 100%; font-size: 13px; }
#storage-file-manager .sf-tree button:hover { background: var(--ui-hover); }
#storage-file-manager .sf-tree button[aria-current] { color: var(--ui-accent); background: var(--ui-accent-soft); font-weight: 600; }
#sf-root { width: 100%; }
.sf-tree summary { cursor: pointer; color: var(--admin-text-muted); }
.sf-tree summary button { display: inline; max-width: calc(100% - 20px) !important; vertical-align: middle; }
.sf-tree-children { padding-left: 12px; }
.sf-main { min-width: 0; padding: 16px; }
.sf-crumbs { gap: 4px; min-height: 36px; overflow-wrap: anywhere; color: var(--admin-text-muted); }
#storage-file-manager .sf-crumbs button { border: 0; background: transparent; padding: 6px 8px; white-space: normal; overflow-wrap: anywhere; max-width: 100%; font-size: 13px; color: var(--admin-text-muted); }
#storage-file-manager .sf-crumbs button:last-child { color: var(--admin-text); font-weight: 600; }
.sf-bulk { margin: 12px 0; font-size: 13px; color: var(--admin-text-muted); }
.sf-bulk label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
#sf-selection { margin-right: auto; font-variant-numeric: tabular-nums; }
#storage-file-manager input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; margin: 0; }
.sf-table { width: 100%; table-layout: fixed; min-width: 0 !important; }
.sf-table th:first-child { width: 36px; }
.sf-table th:nth-child(3) { width: 76px; }
.sf-table th:nth-child(4) { width: 132px; }
.sf-table th:last-child { width: 92px; text-align: right; }
.sf-table td { vertical-align: middle; overflow-wrap: anywhere; }
#storage-file-manager .sf-file-name { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 6px 0; min-height: 36px; max-width: 100%; white-space: normal; font-size: 14px; }
.sf-file-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sf-file-name i { flex: 0 0 18px; font-size: 17px; color: var(--admin-text-muted); }
.sf-file-name .fa-folder { color: var(--admin-yellow); }
.sf-location { display: block; overflow-wrap: anywhere; color: var(--admin-text-muted); font-size: 12px; margin-top: 4px; line-height: 1.6; }
#storage-file-manager .sf-row-actions { text-align: right; white-space: nowrap; padding-inline: 4px; }
#storage-file-manager :is(.sf-row-actions button, .sf-row-actions a, .sf-bulk button, #sf-refresh), #sf-preview-close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--admin-text-muted); text-decoration: none; }
#storage-file-manager :is(.sf-row-actions button, .sf-row-actions a, .sf-bulk button, #sf-refresh):hover, #sf-preview-close:hover { background: var(--ui-hover); border-color: var(--admin-border); color: var(--admin-text); }
#storage-file-manager #sf-remove:not(:disabled):hover, #storage-file-manager #sf-empty:not(:disabled):hover { color: var(--admin-red); }
#sf-status { overflow-wrap: anywhere; margin: 0; font-size: 13px; color: var(--admin-text-muted); }
#sf-status:not(:empty) { margin: 12px 0; padding: 10px 12px; border-left: 2px solid var(--admin-border-strong); background: var(--admin-surface-raised); }
#sf-status.sf-error { color: var(--admin-red); border-color: var(--admin-red); }
#storage-file-manager .sf-empty-state { height: 200px; text-align: center; color: var(--admin-text-muted); }
.sf-empty-state i { display: block; margin-bottom: 12px; font-size: 28px; color: var(--admin-text-subtle); }
#storage-file-manager .pagination { flex-wrap: wrap; gap: 8px; }
.sf-preview { width: min(900px, calc(100% - 32px)); max-height: 85dvh; border: 1px solid var(--admin-border-strong); border-radius: 8px; background: var(--admin-surface); color: var(--admin-text); padding: 20px; }
.sf-preview::backdrop { background: rgb(0 0 0 / .6); }
.sf-preview header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--admin-border); padding-bottom: 12px; margin-bottom: 16px; }
.sf-preview h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
#sf-preview-close { flex-shrink: 0; }
#sf-preview-content { overflow: auto; max-height: 65dvh; }
#sf-preview-content img { max-width: 100%; height: auto; display: block; margin: auto; }
#sf-preview-content pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.7 ui-monospace, Consolas, monospace; }
@media (max-width: 1100px) {
    .sf-layout { grid-template-columns: 230px minmax(0, 1fr); }
    .sf-table th:nth-child(4), .sf-table td:nth-child(4) { display: none; }
}
@media (max-width: 760px) {
    .sf-layout { grid-template-columns: minmax(0, 1fr); }
    .sf-tree { border-right: 0; border-bottom: 1px solid var(--admin-border); max-height: 190px; padding: 12px; }
    .sf-main { padding: 12px 0; }
    .sf-toolbar { align-items: flex-start; }
    .sf-links { gap: 12px; }
    .sf-filters { align-items: stretch; gap: 8px; }
    .sf-filters form { flex-basis: 100%; }
    .sf-filters select { flex: 1; width: 0; }
    .sf-table th:nth-child(3), .sf-table td:nth-child(3) { display: none; }
    .sf-table th:last-child { width: 96px; }
    #storage-file-manager .sf-table :is(th, td) { padding: 10px 4px; }
    #storage-file-manager :is(.sf-row-actions button, .sf-row-actions a, .sf-bulk button, #sf-refresh) { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
    #storage-file-manager .sf-file-name, #storage-file-manager .sf-tree button, #storage-file-manager .sf-crumbs button { min-height: 44px; }
    #storage-file-manager .sf-table input { width: 20px; height: 20px; }
    .sf-table td:first-child { height: 44px; }
    .sf-crumbs { gap: 0; }
    .sf-bulk { gap: 4px; }
}
