/* =================================================================
   File Manager — Modern side-by-side layout
   ================================================================= */

/* ── Context Menu ──────────────────────────────────────────────── */
.fm-ctx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9990;
}

.fm-ctx-menu {
    position: fixed;
    z-index: 9991;
    background: var(--theme-surface, #fff);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 190px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0.4rem;
    animation: fm-ctx-appear 0.12s ease-out;
}

@keyframes fm-ctx-appear {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.fm-ctx-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.85rem;
    color: var(--theme-text, #2c3e50);
    text-align: left;
}

.fm-ctx-item:hover {
    background: var(--theme-hover, rgba(0,0,0,0.04));
}

.fm-ctx-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.fm-ctx-item.danger {
    color: var(--theme-danger, #dc3545);
}

.fm-ctx-item.danger:hover {
    background: rgba(220, 53, 69, 0.08);
}

.fm-ctx-divider {
    height: 1px;
    background: var(--theme-border, #e9ecef);
    margin: 0.35rem 0;
}

/* ── Empty folder state ─────────────────────────────────────────── */
.fm-empty-folder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 2rem;
}

.fm-empty-folder-card {
    text-align: center;
    padding: 3rem 2.5rem;
    background: var(--theme-surface, #fff);
    border: 2px dashed var(--theme-border);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
}

.fm-empty-folder-card i {
    font-size: 3.5rem;
    color: var(--theme-offset, #d1d5db);
    margin-bottom: 1rem;
    display: block;
}

.fm-empty-folder-card h5 {
    font-weight: 600;
    color: var(--theme-text, inherit);
    margin-bottom: 0.5rem;
}

.fm-empty-folder-card p {
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ── Toolbar ────────────────────────────────────────────────────── */
.fm-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.fm-toolbar .form-select {
    width: auto;
    min-width: 160px;
    max-width: 220px;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.85rem;
}

.fm-toolbar .fm-separator {
    width: 1px;
    height: 1.5rem;
    background: var(--theme-border);
    flex-shrink: 0;
}

.fm-view-toggle {
    display: inline-flex;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-button, var(--theme-radius));
    overflow: hidden;
    flex-shrink: 0;
}

.fm-view-toggle .fm-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.fm-view-toggle .fm-toggle-btn:not(:last-child) {
    border-right: 1px solid var(--theme-border);
}

.fm-view-toggle .fm-toggle-btn.active {
    background: var(--theme-primary);
    color: #fff;
}

.fm-view-toggle .fm-toggle-btn.active.fm-toggle-storage {
    background: var(--theme-info, #17a2b8);
}

/* Search box with clear X */
.fm-search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 200px;
}

.fm-search-box .form-control {
    padding-right: 2rem;
}

.fm-search-clear {
    position: absolute;
    right: 0.35rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.7rem;
    padding: 0.2rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.fm-search-clear:hover {
    opacity: 1;
    color: var(--theme-danger, #dc3545);
}

.fm-view-toggle .fm-toggle-btn:not(.active):hover {
    background: var(--theme-hover, rgba(0,0,0,0.04));
}

.fm-view-toggle .fm-toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.fm-toolbar .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.fm-toolbar .fm-spacer { flex: 1; min-width: 0; }

.fm-toast-success {
    font-size: 0.78rem;
    color: var(--theme-success, #16a34a);
    background: var(--theme-success-muted, rgba(22, 163, 74, .12));
    padding: 0.2rem 0.6rem;
    border-radius: var(--theme-radius-button, var(--theme-radius));
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    animation: fm-toast-in 0.2s ease-out;
}

@keyframes fm-toast-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.fm-file-count {
    font-size: 0.75rem;
    color: var(--theme-text-muted, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Main layout — side-by-side ─────────────────────────────────── */
.fm-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-height: calc(100vh - 220px);
}

.fm-layout.fm-has-detail {
    grid-template-columns: 3fr minmax(300px, 1fr);
}

.fm-layout.fm-detail-wide {
    grid-template-columns: 1fr minmax(300px, 1fr);
}

@media (max-width: 768px) {
    .fm-layout.fm-has-detail {
        grid-template-columns: 1fr;
    }
}

/* ── Breadcrumb navigation ──────────────────────────────────────── */
.fm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    overflow-x: auto;
}

.fm-breadcrumb-item {
    background: none;
    border: none;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.8rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.fm-breadcrumb-item:hover {
    background: var(--theme-hover, rgba(0,0,0,0.04));
    color: var(--theme-text, inherit);
}

.fm-breadcrumb-item.active {
    color: var(--theme-text, inherit);
    font-weight: 600;
}

.fm-breadcrumb-source {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--theme-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.fm-breadcrumb-sep {
    font-size: 0.65rem;
    color: var(--theme-text-muted, #6b7280);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Folder items in file list */
.fm-folder-item {
    cursor: pointer;
}

.fm-folder-item:hover {
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.06) !important;
}

/* Drop target highlight for drag-to-move */
.fm-drop-hover {
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.15) !important;
    box-shadow: inset 0 0 0 2px var(--theme-primary);
    border-radius: 4px;
}

.fm-breadcrumb-item.fm-drop-hover {
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.2) !important;
    color: var(--theme-primary) !important;
}

/* Dragging state */
.fm-file-item[draggable="true"] {
    cursor: grab;
}

.fm-file-item[draggable="true"]:active {
    cursor: grabbing;
    opacity: 0.6;
}

/* Folder tree in move dialog */
.fm-folder-tree {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    max-height: 300px;
    overflow-y: auto;
}

.fm-folder-tree-item {
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
    border-bottom: 1px solid var(--theme-border-light, rgba(0,0,0,0.04));
}

.fm-folder-tree-item:hover {
    background: var(--theme-hover, rgba(0,0,0,0.03));
}

.fm-folder-tree-item.active {
    background: var(--theme-primary);
    color: #fff;
}

/* ── File list panel (left side) ────────────────────────────────── */
.fm-list-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.fm-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.fm-search .form-control {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.fm-search .form-check-label {
    font-size: 0.8rem;
    white-space: nowrap;
}

.fm-file-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 300px);
    background: var(--theme-border-light, rgba(0,0,0,0.04));
}

.fm-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: var(--theme-surface, #fff);
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.82rem;
    user-select: none;
}

.fm-file-item:nth-child(even) {
    background: rgba(0,0,0,0.008);
}

.fm-file-item:hover {
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.06) !important;
}

/* Asset view with source filter — warm green tint */
.fm-source-filtered .fm-file-list {
    background: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.06);
    border-color: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.35);
    border-width: 2px;
}
.fm-source-filtered .fm-file-item:nth-child(even) {
    background: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.08);
}
.fm-source-filtered .fm-file-item:hover {
    background: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.14) !important;
}
.fm-source-filtered .fm-breadcrumb {
    border-color: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.35);
    background: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.06);
    border-width: 2px;
}
.fm-source-filtered .fm-toolbar {
    border-color: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.25);
    background: rgba(var(--theme-primary-rgb, 26, 107, 60), 0.04);
}

/* Storage browser — cool blue tint */
.fm-storage-mode .fm-file-list {
    background: rgba(var(--theme-info-rgb, 37, 99, 235), 0.06);
    border-color: rgba(var(--theme-info-rgb, 37, 99, 235), 0.35);
    border-width: 2px;
}
.fm-storage-mode .fm-file-item:nth-child(even) {
    background: rgba(var(--theme-info-rgb, 37, 99, 235), 0.1);
}
.fm-storage-mode .fm-file-item:hover {
    background: rgba(var(--theme-info-rgb, 37, 99, 235), 0.16) !important;
}
.fm-storage-mode .fm-breadcrumb {
    border-color: rgba(var(--theme-info-rgb, 37, 99, 235), 0.35);
    background: rgba(var(--theme-info-rgb, 37, 99, 235), 0.06);
    border-width: 2px;
}
.fm-storage-mode .fm-toolbar {
    border-color: rgba(var(--theme-info-rgb, 37, 99, 235), 0.25);
    background: rgba(var(--theme-info-rgb, 37, 99, 235), 0.04);
}

/* Sensitive source — red left border accent + subtle red tint */
/* Asset view + sensitive: red-green combo */
.fm-source-filtered.fm-sensitive-mode .fm-file-list {
    border-left: 4px solid rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.05);
}
.fm-source-filtered.fm-sensitive-mode .fm-file-item:nth-child(even) {
    background: rgba(220, 38, 38, 0.07);
}
.fm-source-filtered.fm-sensitive-mode .fm-breadcrumb {
    border-left: 4px solid rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.04);
}
.fm-source-filtered.fm-sensitive-mode .fm-toolbar {
    border-left: 4px solid rgba(220, 38, 38, 0.5);
    background: rgba(220, 38, 38, 0.03);
}

/* Storage view + sensitive: red-blue combo */
.fm-storage-mode.fm-sensitive-mode .fm-file-list {
    border-left: 4px solid rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.05);
}
.fm-storage-mode.fm-sensitive-mode .fm-file-item:nth-child(even) {
    background: rgba(220, 38, 38, 0.07);
}
.fm-storage-mode.fm-sensitive-mode .fm-breadcrumb {
    border-left: 4px solid rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.04);
}
.fm-storage-mode.fm-sensitive-mode .fm-toolbar {
    border-left: 4px solid rgba(220, 38, 38, 0.5);
    background: rgba(220, 38, 38, 0.03);
}

.fm-file-item.active {
    background: var(--theme-primary);
    color: #fff;
}

.fm-file-item.active .fm-file-meta,
.fm-file-item.active .fm-file-ext {
    color: rgba(255,255,255,0.75);
}

.fm-file-item.active .fm-file-ext {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.fm-file-item .fm-file-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 1.3rem;
    text-align: center;
}

.fm-file-item .fm-file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.fm-file-item .fm-file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.fm-file-meta {
    font-size: 0.7rem;
    color: var(--theme-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-file-item .fm-file-ext {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    background: var(--theme-offset-bg, rgba(0,0,0,0.06));
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── Preview text/code content ──────────────────────────────────── */
.fm-preview-text {
    max-height: 340px;
    overflow: auto;
    padding: 0.75rem;
    background: var(--theme-background, #f8f9fa);
    border-bottom: 1px solid var(--theme-border);
    font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 2;
}

.fm-preview-text.fm-json {
    color: var(--theme-text);
}

.fm-preview-text .json-key { color: #0550ae; font-weight: 600; }
.fm-preview-text .json-string { color: #0a3069; }
.fm-preview-text .json-number { color: #0550ae; }
.fm-preview-text .json-bool { color: #cf222e; }
.fm-preview-text .json-null { color: #6e7781; font-style: italic; }

.fm-preview-html {
    max-height: 340px;
    overflow: auto;
    padding: 0.75rem;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ── Expanded preview overlay ──────────────────────────────────── */
.fm-preview-expanded {
    position: fixed;
    top: 3.5rem;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    background: var(--theme-surface, #fff);
    display: flex;
    flex-direction: column;
    animation: fm-expand-in 0.2s ease-out;
}

@keyframes fm-expand-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.fm-preview-expanded .fm-preview-expand-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-background);
    flex-shrink: 0;
}

.fm-preview-expanded .fm-preview-expand-header .fm-spacer { flex: 1; }

.fm-preview-expanded .fm-preview-expand-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-background);
}

.fm-preview-expanded .fm-preview-expand-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.1s ease;
}

.fm-preview-expanded .fm-preview-expand-body img:active {
    cursor: grabbing;
}

.fm-preview-expanded .fm-preview-expand-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.fm-preview-expanded .fm-preview-expand-body .fm-preview-text {
    max-height: none;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    font-size: 0.85rem;
}

/* ── Detail panel (right side) ──────────────────────────────────── */
.fm-detail-resize {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}

.fm-detail-resize .btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.fm-detail-resize .btn:hover {
    opacity: 1;
}

.fm-detail-panel {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.fm-preview {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    overflow: hidden;
    background: var(--theme-surface, #fff);
}

.fm-preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    max-height: 380px;
    background: var(--theme-background);
    border-bottom: 1px solid var(--theme-border);
    padding: 0.5rem;
}

.fm-preview-image img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    cursor: pointer;
    border-radius: 4px;
}

.fm-preview-image iframe {
    width: 100%;
    height: 360px;
    border: none;
}

.fm-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: var(--theme-text-muted, #6b7280);
}

.fm-preview-placeholder i {
    font-size: 3rem;
    opacity: 0.35;
    margin-bottom: 0.5rem;
}

/* ── Import thumbnails ───────────────────────────────────────── */
.fm-import-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--theme-border);
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.fm-import-thumb:hover {
    border-color: var(--theme-primary);
    transform: scale(1.1);
}

.fm-import-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-import-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 2px solid var(--theme-border);
    color: var(--theme-text-muted, #6b7280);
    font-size: 1.1rem;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}

.fm-import-icon:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.fm-import-pdf {
    color: var(--theme-danger, #dc3545);
    border-color: var(--theme-danger, #dc3545);
}

.fm-import-pdf:hover {
    opacity: 0.8;
}

/* Action bar between preview and metadata */
.fm-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-background);
}

.fm-preview-actions .btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
}

/* Metadata editor */
.fm-preview-body {
    padding: 0.65rem;
}

.fm-preview-body .form-label {
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--theme-text-muted, #6b7280);
}

.fm-preview-body .form-control {
    font-size: 0.82rem;
    padding: 0.25rem 0.45rem;
}

.fm-preview-body textarea.form-control {
    resize: vertical;
}

/* Metadata info grid */
.fm-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 0.75rem;
    font-size: 0.72rem;
    color: var(--theme-text-muted, #6b7280);
    padding-top: 0.45rem;
    border-top: 1px solid var(--theme-border-light, rgba(0,0,0,0.06));
    margin-top: 0.45rem;
}

.fm-meta-grid strong {
    color: var(--theme-text, inherit);
}

/* ── Upload zone (drop target) ──────────────────────────────────── */
.fm-upload-zone {
    position: relative;
    min-height: 100%;
    transition: box-shadow 0.2s;
}

.fm-upload-zone-active {
    box-shadow: inset 0 0 0 3px var(--theme-primary);
    border-radius: var(--theme-radius);
}

.fm-drop-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.08);
    border: 3px dashed var(--theme-primary);
    border-radius: var(--theme-radius);
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(3px);
}

.fm-drop-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--theme-primary);
    font-weight: 500;
}

.fm-drop-overlay-content i {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

/* Empty upload state */
.fm-upload-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    border: 2px dashed var(--theme-border);
    border-radius: var(--theme-radius);
    background: var(--theme-background);
    color: var(--theme-text-muted, #6b7280);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    padding: 2rem;
}

.fm-upload-empty:hover {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.03);
}

.fm-upload-empty i {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.fm-upload-empty-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.fm-upload-empty-hint {
    font-size: 0.82rem;
    opacity: 0.6;
}

/* ── Upload dialog ──────────────────────────────────────────────── */
.fm-upload-droparea {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 220px;
    border: 2px dashed var(--theme-border);
    border-radius: var(--theme-radius);
    background: var(--theme-background);
    color: var(--theme-text-muted, #6b7280);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    padding: 2rem;
}

.fm-upload-droparea:hover {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb, 99, 102, 241), 0.04);
}

/* InputFile covers the entire drop area — transparent overlay for click + drag */
.fm-upload-droparea-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.fm-upload-droparea i {
    font-size: 3rem;
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.fm-upload-droparea-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--theme-text, inherit);
}

.fm-upload-droparea-hint {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* File card in upload dialog step 2 */
.fm-upload-file-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
}

.fm-upload-file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.fm-upload-file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.fm-upload-file-info .fw-semibold {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bulk selection bar ─────────────────────────────────────────── */
.fm-bulk-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--theme-primary);
    color: #fff;
    border-radius: var(--theme-radius);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.fm-bulk-bar .btn {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.fm-bulk-bar .btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.6);
}

/* ── Upload progress ────────────────────────────────────────────── */
.fm-upload-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--theme-info-bg, #dbeafe);
    border: 1px solid var(--theme-info-border, #93c5fd);
    border-radius: var(--theme-radius);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--theme-info-text, #1e40af);
}
