@import url('./variables.css');

/* ─── APP LAYOUT ─────────────────────────────────────────────── */

.app-layout {
    display: flex; min-height: 100vh; background: var(--bg);
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
    background: var(--bg-sidebar); border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column; z-index: 40;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    display: flex; align-items: center; padding: 1.125rem 1.25rem;
    height: var(--header-height); flex-shrink: 0;
}

.sidebar-logo {
    display: flex; align-items: center; gap: 0.625rem;
    font-size: 1.125rem; font-weight: 700; color: var(--text);
    text-decoration: none; letter-spacing: -0.02em;
}
.sidebar-logo:hover { text-decoration: none; }
.sidebar-logo svg { width: 1.5rem; height: 1.5rem; color: var(--primary); }

.admin-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--primary);
    color: var(--bg);
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    line-height: 1;
    margin-left: -0.2rem;
    user-select: none;
}

.sidebar-content {
    flex: 1; overflow-y: auto; padding: 0 0.75rem;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar-content::-webkit-scrollbar { width: 4px; }
.sidebar-content::-webkit-scrollbar-track { background: transparent; }
.sidebar-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

.sidebar-actions {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0 0.25rem; margin-bottom: 1.25rem;
}

.sidebar-section { margin-bottom: 0.5rem; }
.sidebar-section-title {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); padding: 0.5rem 0.875rem 0.375rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar-nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    width: 100%; padding: 0.5625rem 0.875rem; font-size: 0.875rem; font-weight: 450;
    color: var(--text-secondary); background: transparent; border: none;
    border-radius: var(--radius); cursor: pointer; text-align: left;
    transition: all var(--transition); position: relative; text-decoration: none;
}
.sidebar-nav-item svg {
    width: 1.25rem; height: 1.25rem; flex-shrink: 0;
    stroke-width: 1.8; transition: color var(--transition);
}
.sidebar-nav-item:hover {
    background: var(--bg-hover); color: var(--text); text-decoration: none;
}
.sidebar-nav-item.active {
    background: var(--primary-light); color: var(--text); font-weight: 500;
}
.sidebar-nav-item.active svg { color: var(--primary); }

.sidebar-nav-divider {
    height: 1px; background: var(--border-light); margin: 0.5rem 0.875rem;
}

/* ─── SIDEBAR FOOTER ─────────────────────────────────────────────── */

.sidebar-footer {
    flex-shrink: 0; padding: 0.75rem; border-top: 1px solid var(--border-light);
}

.sidebar-profile-card {
    background: var(--bg); border-radius: var(--radius-xl);
    padding: 0.75rem; box-shadow: var(--shadow-xs);
}

.sidebar-profile-main {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 0.875rem; box-shadow: var(--shadow-xs);
}

.sidebar-profile {
    display: flex; align-items: center; gap: 0.625rem; cursor: default;
}
.sidebar-profile-info { flex: 1; min-width: 0; }
.sidebar-profile-name { font-size: 0.8125rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-email { font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-profile-stats {
    overflow: hidden; margin-top: 0.875rem;
}

.sidebar-stat { margin-top: 0.5rem; }
.sidebar-stat:first-child { margin-top: 0; }
.sidebar-stat-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.6875rem; font-weight: 500; color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.sidebar-stat-label { display: flex; align-items: center; gap: 0.375rem; }
.sidebar-stat-label svg { flex-shrink: 0; }
.sidebar-stat-value { font-weight: 600; }
.sidebar-stat-bar {
    height: 4px; width: 100%; background: var(--bg-hover);
    border-radius: var(--radius-full); overflow: hidden;
}
.sidebar-stat-fill {
    height: 100%; width: 0; background: #38bdf8;
    border-radius: var(--radius-full);
    transition: width 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sidebar-stat-fill-primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}

.sidebar-profile-footer-row {
    display: flex; align-items: center; gap: 0.5rem;
    margin-top: 0.75rem; padding: 0 0.25rem;
}
.sidebar-profile-badge {
    width: 1.25rem; height: 1.25rem; border-radius: var(--radius-full);
    background: #38bdf8; color: white;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-profile-label {
    font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary);
}

.sidebar-profile-actions {
    display: flex; align-items: center; gap: 0.25rem;
    margin-top: 0.75rem; padding: 0 0.25rem;
}
.sidebar-profile-action {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: none; background: transparent;
    border-radius: var(--radius); cursor: pointer; color: var(--text-muted);
    transition: all var(--transition); text-decoration: none;
}
.sidebar-profile-action:hover {
    background: var(--bg-hover); color: var(--text); text-decoration: none;
}
.sidebar-profile-action-danger:hover { color: var(--danger); }

.btn-sidebar-logout {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.625rem 1rem; margin-top: 0.75rem;
    font-size: 0.875rem; font-weight: 500; color: var(--danger);
    background: transparent; border: 1.5px solid var(--border-light);
    border-radius: var(--radius); cursor: pointer;
    transition: all var(--transition);
}
.btn-sidebar-logout:hover {
    background: var(--danger); color: white;
    border-color: var(--danger);
}

.btn-sidebar-admin {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.625rem 1rem; margin-top: 0.75rem;
    font-size: 0.875rem; font-weight: 500; color: var(--primary);
    background: transparent; border: 1.5px solid var(--border-light);
    border-radius: var(--radius); cursor: pointer; text-decoration: none;
    transition: all var(--transition);
}
.btn-sidebar-admin:hover {
    background: var(--primary); color: white;
    border-color: var(--primary); text-decoration: none;
}

.sidebar-storage { width: 100%; }
.sidebar-storage-label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 0.375rem;
}
.sidebar-storage-bar {
    width: 100%; height: 4px; background: var(--bg-hover);
    border-radius: var(--radius-full); overflow: hidden;
}
.sidebar-storage-fill {
    height: 100%; border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    transition: width var(--transition-smooth);
}

.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px); z-index: 39;
}

/* ─── MAIN CONTENT ─────────────────────────────────────────────── */

.main-content {
    flex: 1; margin-left: var(--sidebar-width);
    display: flex; flex-direction: column; min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

/* ─── HEADER ─────────────────────────────────────────────── */

.header {
    display: flex; align-items: center; gap: 0.75rem;
    height: var(--header-height); padding: 0 1.5rem;
    background: var(--bg-white); border-bottom: 1px solid var(--border-light);
    flex-shrink: 0; position: sticky; top: 0; z-index: 30;
}

.header-toggle { display: none; }

.header-breadcrumb {
    display: flex; align-items: center; gap: 0;
    font-size: 0.875rem; min-width: 0; flex: 1;
    overflow: hidden;
}
.breadcrumb-item {
    display: inline-flex; align-items: center;
    white-space: nowrap; flex-shrink: 0;
}
.breadcrumb-item:last-child {
    color: var(--text); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1;
}
.breadcrumb-link {
    display: inline-flex; align-items: center; gap: 0.375rem;
    color: var(--text-muted); font-weight: 400;
    padding: 0.25rem 0.375rem; border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.breadcrumb-link:hover { color: var(--primary); background: var(--bg-hover); text-decoration: none; }
.breadcrumb-link svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.breadcrumb-separator {
    color: var(--text-muted); margin: 0 0.125rem;
    font-size: 0.6875rem; opacity: 0.5;
    display: inline-flex; align-items: center;
}
.breadcrumb-separator svg { width: 0.75rem; height: 0.75rem; }

.header-search {
    position: relative; flex: 1; max-width: 480px; margin: 0 auto;
}
.header-search-icon {
    position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%);
    width: 1rem; height: 1rem; color: var(--text-muted); pointer-events: none;
}
.header-search-input {
    width: 100%; padding: 0.5rem 0.875rem 0.5rem 2.5rem;
    font-size: 0.875rem; color: var(--text); background: var(--bg);
    border: 1.5px solid transparent; border-radius: var(--radius-full);
    transition: all var(--transition);
}
.header-search-input:focus {
    outline: none; background: var(--bg-white); border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.header-search-input::placeholder { color: var(--text-muted); }

/* ─── TOOLBAR ─────────────────────────────────────────────── */

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; padding: 0.625rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white); flex-shrink: 0; flex-wrap: wrap;
}
.toolbar-left {
    display: flex; align-items: center; gap: 0.75rem;
}
.toolbar-title {
    font-size: 0.875rem; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 0.25rem; margin: 0;
    white-space: nowrap;
}
.toolbar-count { color: var(--text-muted); font-weight: 400; }
.toolbar-total {
    font-size: 0.75rem; color: var(--text-muted); white-space: nowrap;
}

.toolbar-right {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}

.toolbar-search {
    position: relative; width: 14rem;
}
.toolbar-search-icon {
    position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%);
    width: 0.875rem; height: 0.875rem; color: var(--text-muted);
    pointer-events: none; opacity: 0.7;
}
.toolbar-search-input {
    width: 100%; height: 2rem; padding: 0 0.625rem 0 2rem;
    font-size: 0.8125rem; color: var(--text); background: var(--bg);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    outline: none; transition: all var(--transition);
}
.toolbar-search-input:focus {
    border-color: var(--border); box-shadow: 0 0 0 2px var(--primary-glow);
}
.toolbar-search-input::placeholder { color: var(--text-muted); }

.toolbar-sort-group {
    display: flex; align-items: center; gap: 2px;
}
.toolbar-sort-select {
    height: 2rem; padding: 0 1.75rem 0 0.5rem; font-size: 0.8125rem;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239C9790' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius) 0 0 var(--radius); color: var(--text);
    outline: none; cursor: pointer;
    appearance: none; -webkit-appearance: none;
}
.toolbar-sort-dir {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: 1px solid var(--border-light);
    border-left: none; background: var(--bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer; color: var(--text-muted); transition: all var(--transition);
}
.toolbar-sort-dir:hover { color: var(--text); background: var(--bg-hover); }
.toolbar-sort-dir.desc svg { transform: scaleY(-1); }

.toolbar-actions-group {
    display: flex; align-items: center; gap: 0.375rem; margin-left: 0.375rem;
}

.btn-outline {
    display: inline-flex; align-items: center; gap: 0.375rem;
    height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; font-weight: 500;
    color: var(--text); background: var(--bg-white);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-outline:hover { background: var(--bg-hover); border-color: var(--border); }
.btn-outline:disabled { opacity: 0.4; pointer-events: none; }
.btn-outline svg { flex-shrink: 0; opacity: 0.6; }

.view-toggle {
    display: flex; align-items: center; background: var(--bg);
    border-radius: var(--radius); padding: 2px; gap: 2px;
}
.view-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: none; background: transparent;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
    transition: all var(--transition);
}
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active {
    background: var(--bg-white); color: var(--text);
    box-shadow: var(--shadow-xs);
}

/* ─── FILE AREA ─────────────────────────────────────────────── */

.file-area {
    flex: 1; padding: 1.5rem; overflow-y: auto; position: relative;
    display: flex; flex-direction: column;
}
.file-area > #file-view {
    flex: 1; display: flex; flex-direction: column;
}
.file-area.drag-over::after {
    content: '⇣  Перетащите файлы сюда';
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 15, 17, 0.88);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    outline: 2px dashed rgba(237, 168, 42, 0.55); outline-offset: -20px;
    color: var(--primary);
    font-size: 1.25rem; font-weight: 600; letter-spacing: 0.04em;
    z-index: 9999; pointer-events: none; animation: fadeIn 150ms ease;
    text-shadow: 0 0 28px rgba(237, 168, 42, 0.45);
}

/* ─── DROP ZONE ─────────────────────────────────────────────── */

.fm-dropzone {
    border: 1px dashed var(--border); border-radius: var(--radius-xl);
    padding: 0.75rem 1rem; margin-bottom: 0.75rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    transition: all var(--transition);
}
.fm-dropzone.dragging {
    border-color: var(--primary); background: rgba(255,149,0,0.04);
}
.fm-dropzone-left { display: flex; align-items: center; gap: 0.75rem; }
.fm-dropzone-icon {
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-full);
    background: var(--bg-white); border: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fm-dropzone-icon svg { width: 1rem; height: 1rem; opacity: 0.6; }
.fm-dropzone-text p { margin: 0; font-size: 0.8125rem; }
.fm-dropzone-text p:first-child { font-weight: 500; color: var(--text); }
.fm-dropzone-text p:last-child { font-size: 0.75rem; color: var(--text-muted); }

/* ─── BULK BAR ─────────────────────────────────────────────── */

.fm-bulk-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.8125rem;
}
.fm-bulk-left {
    display: flex; align-items: center; gap: 0.625rem;
}
.fm-bulk-left label {
    display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer;
}
.fm-bulk-left input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 14px; height: 14px; cursor: pointer;
    background: var(--bg-hover); border: 1.5px solid var(--primary); border-radius: 3px;
    display: inline-block; vertical-align: middle;
    transition: background 120ms, border-color 120ms;
}
.fm-bulk-left input[type="checkbox"]:checked {
    background-color: var(--primary); border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5L4 7.5L8.5 2.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 70%;
}
.fm-bulk-left .fm-bulk-count { color: var(--text-muted); }
.fm-bulk-left .fm-bulk-size { color: var(--text-muted); }
.fm-bulk-right { display: flex; align-items: center; gap: 0.5rem; }

/* ─── FILE GRID ─────────────────────────────────────────────── */

.file-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem; background: var(--bg-white); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 0.75rem;
}

.file-card {
    display: flex; flex-direction: column; position: relative;
    border: 1px solid var(--border-light); border-radius: var(--radius);
    overflow: hidden; cursor: pointer; user-select: none;
    transition: all var(--transition);
    animation: cardEnter 400ms cubic-bezier(0.16,1,0.3,1) backwards;
}
.file-card:hover { border-color: var(--border); }
.file-card.selected {
    border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow);
}

.file-card-checkbox {
    position: absolute; left: 0.5rem; top: 0.5rem; z-index: 2;
}
.file-card-checkbox input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 14px; height: 14px; cursor: pointer;
    background: var(--bg-hover); border: 1.5px solid var(--primary); border-radius: 3px;
    display: inline-block; vertical-align: middle;
    transition: background 120ms, border-color 120ms;
}
.file-card-checkbox input[type="checkbox"]:checked {
    background-color: var(--primary); border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5L4 7.5L8.5 2.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 70%;
}

.file-card-preview {
    position: relative; height: 7rem; width: 100%; overflow: hidden;
    background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center;
}
.file-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-card-preview svg { width: 1.5rem; height: 1.5rem; opacity: 0.5; }

.file-card-body { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.5rem; flex: 1; }
.file-card-name {
    font-size: 0.8125rem; font-weight: 500; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card-meta {
    font-size: 0.6875rem; color: var(--text-muted);
}
.file-card-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 0; margin-top: auto;
}
.file-card-actions button {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: none; background: transparent;
    border-radius: var(--radius); cursor: pointer; color: var(--text-muted);
    transition: all var(--transition);
}
.file-card-actions button:hover { background: var(--bg-hover); color: var(--text); }
.file-card-actions button.action-danger:hover { color: var(--danger); }

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── FILE LIST (TABLE) ─────────────────────────────────────────────── */

.file-list {
    width: 100%; background: var(--bg-white);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    overflow: hidden;
}
.file-list-header {
    display: grid; grid-template-columns: 28px 1fr 90px 90px auto;
    gap: 0.75rem; padding: 0.5rem 0.75rem;
    font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.03em;
    background: var(--bg-hover);
}
.file-list-row {
    display: grid; grid-template-columns: 28px 1fr 90px 90px auto;
    gap: 0.75rem; padding: 0.5rem 0.75rem; align-items: center;
    border-top: 1px solid var(--border-light); cursor: pointer;
    transition: background var(--transition);
    animation: listRowEnter 350ms cubic-bezier(0.16,1,0.3,1) backwards;
}
.file-list-row:hover { background: var(--bg-hover); }
.file-list-row.selected { background: var(--primary-light); }
.file-list-name {
    display: flex; align-items: center; gap: 0.625rem;
    min-width: 0; font-size: 0.8125rem;
}
.file-list-name svg { width: 1rem; height: 1rem; flex-shrink: 0; opacity: 0.6; }
.file-list-name-info { flex: 1; min-width: 0; max-width: 16rem; }
.file-list-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-weight: 500; }
.file-list-bar { margin-top: 0.25rem; height: 3px; width: 11rem; max-width: 100%; background: var(--bg-active); border-radius: var(--radius-full); overflow: hidden; }
.file-list-bar-fill { height: 100%; background: var(--text-secondary); border-radius: var(--radius-full); opacity: 0.45; }
.file-list-type { text-transform: uppercase; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.03em; color: var(--text-muted); }
.file-list-cell { font-size: 0.8125rem; color: var(--text-secondary); }

.file-list-actions { display: flex; align-items: center; gap: 0; white-space: nowrap; }
.file-list-actions button {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: none; background: transparent;
    border-radius: var(--radius); cursor: pointer; color: var(--text-muted);
    transition: all var(--transition);
}
.file-list-actions button:hover { background: var(--bg-hover); color: var(--text); }
.file-list-actions button.action-danger { color: rgba(239,68,68,0.5); }
.file-list-actions button.action-danger:hover { color: var(--danger); background: transparent; }

/* ─── CONTEXT MENU ─────────────────────────────────────────────── */

@keyframes listRowEnter {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.file-list-checkbox {
    display: flex; align-items: center; justify-content: center;
}
.file-list-checkbox input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 14px; height: 14px; cursor: pointer;
    background: var(--bg-hover); border: 1.5px solid var(--primary); border-radius: 3px;
    display: inline-block; vertical-align: middle;
    transition: background 120ms, border-color 120ms;
}
.file-list-checkbox input[type="checkbox"]:checked {
    background-color: var(--primary); border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5L4 7.5L8.5 2.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 70%;
}

.file-list-expand {
    display: flex; align-items: center; justify-content: center;
    width: 1.25rem; height: 1.25rem; border: none; background: transparent;
    cursor: pointer; padding: 0; flex-shrink: 0; margin-right: 0.25rem;
}
.file-list-expand svg {
    width: 14px; height: 14px; color: var(--text-muted);
    transition: transform 400ms cubic-bezier(0.34, 0, 0.64, 1);
}
.file-list-expand.expanded svg { transform: rotate(90deg); }

.file-list-row.depth-1 { padding-left: 2.5rem; }
.file-list-row.depth-2 { padding-left: 4rem; }
.file-list-row.depth-3 { padding-left: 5.5rem; }
.file-list-row.depth-4 { padding-left: 7rem; }
.file-list-row.child-row {
    animation: listRowEnter 350ms cubic-bezier(0.16,1,0.3,1) backwards;
}

.context-menu {
    position: fixed; z-index: 60; min-width: 200px; padding: 0.375rem;
    background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); animation: dropdownIn 180ms cubic-bezier(0.16,1,0.3,1);
}
.context-menu-item {
    display: flex; align-items: center; gap: 0.625rem; width: 100%;
    padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: var(--text);
    background: transparent; border: none; text-align: left; cursor: pointer;
    border-radius: var(--radius-sm); transition: background var(--transition);
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-item svg { width: 1rem; height: 1rem; color: var(--text-muted); flex-shrink: 0; }
.context-menu-item-danger { color: var(--danger); }
.context-menu-item-danger svg { color: var(--danger); }
.context-menu-divider { height: 1px; margin: 0.25rem 0.5rem; background: var(--border-light); }

/* ─── UPLOAD CARD MODAL ─────────────────────────────────────────────── */

.upload-card-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(8px);
    animation: fadeIn 200ms ease;
}
.upload-card {
    width: 100%; max-width: 520px; margin: 1rem;
    background: var(--bg-white); border-radius: var(--radius-2xl);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
    animation: modalPop 300ms cubic-bezier(0.16,1,0.3,1);
    overflow: hidden;
}
.upload-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 1.5rem 1.5rem 0;
}
.upload-card-header-left {
    display: flex; align-items: center; gap: 1rem;
}
.upload-card-header-icon {
    width: 3rem; height: 3rem; border-radius: var(--radius-full);
    background: var(--bg); display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
}
.upload-card-header-icon svg { width: 1.5rem; height: 1.5rem; color: var(--text-muted); }
.upload-card-title { font-size: 1.125rem; font-weight: 600; color: var(--text); }
.upload-card-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.125rem; }

.upload-card-dropzone {
    margin: 1.5rem; border: 2px dashed var(--border);
    border-radius: var(--radius-lg); padding: 2rem 1rem;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; cursor: pointer;
    transition: all 200ms ease;
}
.upload-card-dropzone:hover {
    border-color: var(--primary); background: rgba(255,149,0,0.03);
}
.upload-card-dropzone.dragging {
    border-color: var(--primary); background: rgba(255,149,0,0.08);
}
.upload-card-dropzone svg { width: 2.5rem; height: 2.5rem; color: var(--text-muted); margin-bottom: 1rem; }
.upload-card-dropzone-title { font-weight: 600; color: var(--text); font-size: 0.9375rem; }
.upload-card-dropzone-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.upload-card-dropzone-btn {
    margin-top: 1rem; padding: 0.375rem 1rem; font-size: 0.8125rem;
    font-weight: 500; color: var(--text); background: transparent;
    border: 1px solid var(--border); border-radius: var(--radius);
    pointer-events: none;
}

.upload-card-files {
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem 1.5rem; max-height: 300px; overflow-y: auto;
}
.upload-card-file {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.625rem 0; gap: 0.75rem;
    animation: listRowEnter 300ms cubic-bezier(0.16,1,0.3,1);
}
.upload-card-file + .upload-card-file { border-top: 1px solid var(--border-light); }
.upload-card-file-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.upload-card-file-ext {
    width: 2.5rem; height: 2.5rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg); border-radius: var(--radius);
    font-size: 0.5625rem; font-weight: 700; color: var(--text-muted);
    letter-spacing: 0.02em; text-transform: uppercase;
}
.upload-card-file-info { flex: 1; min-width: 0; }
.upload-card-file-name {
    font-size: 0.8125rem; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-card-file-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.upload-card-file-meta .uc-uploading { color: var(--primary); }
.upload-card-file-meta .uc-completed { color: var(--success); }
.upload-card-file-progress {
    height: 4px; background: var(--bg-hover); border-radius: var(--radius-full);
    margin-top: 0.375rem; overflow: hidden;
}
.upload-card-file-progress-bar {
    height: 100%; border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    transition: width 200ms ease;
}
.upload-card-file-right { display: flex; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.upload-card-file-right .uc-check { color: var(--success); }
.upload-card-file-right .uc-remove {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: none; background: transparent;
    border-radius: var(--radius-full); cursor: pointer; color: var(--text-muted);
    transition: all var(--transition);
}
.upload-card-file-right .uc-remove:hover { background: var(--bg-hover); color: var(--text); }

/* ─── UPLOAD ZONE ─────────────────────────────────────────────── */

.upload-zone {
    position: fixed; inset: 0; z-index: 70;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,149,0,0.06); backdrop-filter: blur(4px);
    border: 3px dashed var(--primary); border-radius: var(--radius-2xl);
    animation: fadeIn 200ms ease;
}

.upload-drop-inline {
    border: 2px dashed var(--border); border-radius: var(--radius-xl);
    padding: 1rem; transition: all var(--transition);
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.upload-drop-inline.dragging {
    border-color: var(--primary); background: rgba(255,149,0,0.05);
}
.upload-drop-inline-icon {
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-full);
    background: var(--bg-white); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.upload-drop-inline-icon svg { width: 1rem; height: 1rem; opacity: 0.6; }
.upload-zone-content {
    text-align: center; color: var(--primary);
    animation: floatUp 600ms cubic-bezier(0.16,1,0.3,1);
}
.upload-zone-content svg { width: 3.5rem; height: 3.5rem; margin: 0 auto 0.75rem; }
.upload-zone-content p { font-size: 1.125rem; font-weight: 600; }
.upload-zone-content span { font-size: 0.875rem; color: var(--text-secondary); }

@keyframes floatUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── UPLOAD PANEL ─────────────────────────────────────────────── */

.upload-panel {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 80;
    width: 380px; max-height: 400px;
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
    animation: modalPop 300ms cubic-bezier(0.16,1,0.3,1);
    overflow: hidden;
}
.upload-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-light);
}
.upload-panel-title { font-size: 0.875rem; font-weight: 600; }
.upload-panel-list {
    max-height: 300px; overflow-y: auto; padding: 0.5rem;
}
.upload-panel-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.5rem; border-radius: var(--radius);
}
.upload-panel-item-icon { width: 2rem; height: 2rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: var(--radius-sm); }
.upload-panel-item-icon svg { width: 1rem; height: 1rem; color: var(--text-muted); }
.upload-panel-item-info { flex: 1; min-width: 0; }
.upload-panel-item-name { font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-panel-item-size { font-size: 0.6875rem; color: var(--text-muted); }
.upload-panel-item-progress {
    height: 3px; background: var(--bg-hover); border-radius: var(--radius-full);
    margin-top: 0.375rem; overflow: hidden;
}
.upload-panel-item-progress-bar {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: var(--radius-full); transition: width 200ms ease;
}
.upload-panel-item-status { flex-shrink: 0; }

/* ─── PREVIEW MODAL ─────────────────────────────────────────────── */

.preview-overlay {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    animation: fadeIn 200ms ease;
}
.preview-container {
    position: relative; max-width: 90vw; max-height: 90vh;
    animation: modalPop 300ms cubic-bezier(0.16,1,0.3,1);
}
.preview-container img { max-width: 100%; max-height: 85vh; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.preview-container video { max-width: 100%; max-height: 85vh; border-radius: var(--radius-lg); }
.preview-container audio { min-width: 320px; }
.preview-close {
    position: absolute; top: -2.5rem; right: 0;
    color: white; background: rgba(255,255,255,0.15);
    border: none; padding: 0.5rem; border-radius: var(--radius);
    cursor: pointer; transition: background var(--transition);
}
.preview-close:hover { background: rgba(255,255,255,0.25); }

/* ─── FOLDER PICKER ─────────────────────────────────────────────── */

.folder-tree { list-style: none; padding: 0.25rem 0; margin: 0; }
.folder-tree ul { list-style: none; padding: 0; margin: 0; }

.folder-tree-node { list-style: none; }

.folder-tree-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; font-size: 0.875rem; color: var(--text);
    background: transparent; border: none; width: 100%; text-align: left;
    cursor: pointer; border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.folder-tree-item:hover { background: var(--bg-hover); }
.folder-tree-item.selected { background: var(--primary-light); font-weight: 500; }
.folder-tree-item svg { flex-shrink: 0; }

.folder-tree-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 1.25rem; height: 1.25rem; border: none; background: transparent;
    cursor: pointer; padding: 0; flex-shrink: 0;
}

.folder-tree-chevron {
    transition: transform 400ms cubic-bezier(0.34, 0, 0.64, 1);
    color: var(--text-muted);
}

.folder-tree-spacer {
    display: inline-block; width: 1.25rem; flex-shrink: 0;
}

.folder-tree-children {
    padding-left: 1.5rem;
    transition: height 400ms cubic-bezier(0.34, 0, 0.64, 1);
}

/* ─── SHARE DIALOG ─────────────────────────────────────────────── */

.share-dialog {
    display: flex; flex-direction: column; gap: 0.75rem;
}

.share-public-toggle {
    display: flex; flex-direction: column; gap: 0.5rem;
}

.share-toggle-label {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.875rem; font-weight: 500; cursor: pointer;
}

.share-toggle-label input[type="checkbox"] {
    width: 1rem; height: 1rem; accent-color: var(--primary);
    cursor: pointer;
}

.share-public-link {
    display: flex; gap: 0.5rem; align-items: center;
    padding: 0.5rem 0.75rem; background: var(--bg); border-radius: var(--radius);
}
.share-public-link.hidden { display: none; }

.share-public-link .form-input {
    flex: 1; font-size: 0.8125rem;
    background: var(--bg-white); border: 1px solid var(--border-light);
}

.share-divider {
    height: 1px; background: var(--border-light); margin: 0.25rem 0;
}

.share-section-heading {
    font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
    margin: 0 0 0.5rem;
}

.share-add-section { display: flex; flex-direction: column; }

.share-add-row {
    display: flex; gap: 0.5rem; align-items: center;
}

.share-add-row .form-input { min-width: 0; }
.share-add-row .form-input[type="email"] { flex: 1; }
.share-add-row .form-input[type="text"] { flex: 1; }

.share-level-select {
    width: 10rem; flex-shrink: 0;
}

.share-perm-list {
    display: flex; flex-direction: column;
    max-height: 240px; overflow-y: auto;
}

.share-perm-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border-light);
}
.share-perm-row:last-child { border-bottom: none; }

.share-perm-user {
    display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0;
}

.share-perm-user-info {
    display: flex; flex-direction: column; min-width: 0;
}

.share-perm-name {
    font-size: 0.875rem; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.share-perm-email {
    font-size: 0.75rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.share-empty {
    font-size: 0.8125rem; color: var(--text-muted); padding: 0.75rem 0;
}

.share-guest-info {
    font-size: 0.875rem; color: var(--text-secondary);
    padding: 0.5rem 0; margin: 0;
}

.share-request-section { display: flex; flex-direction: column; }

/* ─── ACCESS REQUESTS ─────────────────────────────────────────── */

.access-requests-section {
    background: var(--bg-white); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); padding: 1rem; margin-bottom: 1rem;
}

.access-requests-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.9375rem; font-weight: 600; color: var(--text);
    margin: 0 0 0.75rem;
}

.access-requests-title svg { color: var(--primary); flex-shrink: 0; }

.access-requests-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem;
    font-size: 0.6875rem; font-weight: 700; color: var(--text-white);
    background: var(--primary); border-radius: var(--radius-full);
}

.access-request-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0; border-top: 1px solid var(--border-light);
}

.access-request-user {
    display: flex; align-items: flex-start; gap: 0.5rem; flex: 1; min-width: 0;
}

.access-request-info {
    display: flex; flex-direction: column; gap: 0.125rem; min-width: 0;
}

.access-request-name {
    font-size: 0.875rem; font-weight: 600; color: var(--text);
}

.access-request-detail {
    font-size: 0.75rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.access-request-message {
    font-size: 0.75rem; color: var(--text-muted); font-style: italic;
}

.access-request-meta {
    flex-shrink: 0; font-size: 0.75rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.access-request-actions {
    display: flex; gap: 0.375rem; flex-shrink: 0;
}

.access-approve-btn.btn { color: var(--success); }
.access-approve-btn.btn:hover { background: var(--success-light); }
.access-reject-btn.btn { color: var(--danger); }
.access-reject-btn.btn:hover { background: var(--danger-light); }

/* ─── SIDEBAR BADGE ─────────────────────────────────────────── */

.sidebar-nav-item { position: relative; }

.sidebar-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.125rem; height: 1.125rem; padding: 0 0.3125rem;
    font-size: 0.625rem; font-weight: 700; color: var(--text-white);
    background: var(--primary); border-radius: var(--radius-full);
    margin-left: auto;
}
.sidebar-badge:empty { display: none; }

/* ─── INFO PANEL ─────────────────────────────────────────────── */

.info-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 360px;
    background: var(--bg-white); border-left: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg); z-index: 50;
    animation: slideInRight 300ms cubic-bezier(0.16,1,0.3,1);
    display: flex; flex-direction: column;
}
.info-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light);
}
.info-panel-title { font-size: 1rem; font-weight: 600; }
.info-panel-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.info-panel-section { margin-bottom: 1.25rem; }
.info-panel-section-title {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.625rem;
}
.info-panel-row {
    display: flex; justify-content: space-between; padding: 0.375rem 0;
    font-size: 0.8125rem;
}
.info-panel-label { color: var(--text-secondary); }
.info-panel-value { color: var(--text); font-weight: 500; }
.info-panel-preview {
    width: 100%; aspect-ratio: 16/10; background: var(--bg);
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1rem;
    display: flex; align-items: center; justify-content: center;
}
.info-panel-preview img { width: 100%; height: 100%; object-fit: cover; }
.info-panel-preview svg { width: 3rem; height: 3rem; color: var(--text-muted); }

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; }
    .header-toggle { display: flex; }
    .info-panel { width: 100%; max-width: 360px; }
}

/* ─── HISTORY VIEW ─────────────────────────────────────────────── */

.history-list {
    display: flex; flex-direction: column;
    padding: 0.5rem 0;
}

.history-date-header {
    font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
    padding: 1rem 1rem 0.5rem; text-transform: capitalize;
    border-bottom: 1px solid var(--border-light);
}

.history-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 1rem; border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.history-row:hover { background: var(--bg-hover); }

.history-icon {
    flex-shrink: 0; width: 2rem; height: 2rem; border-radius: var(--radius);
    background: var(--bg-card); display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-light);
}

.history-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem;
}

.history-action {
    font-size: 0.875rem; font-weight: 500; color: var(--text);
}

.history-file {
    font-size: 0.75rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.history-time {
    flex-shrink: 0; font-size: 0.75rem; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ─── ALBUMS VIEW ─────────────────────────────────────────────── */

.albums-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem; padding: 1rem 0;
}

.album-card {
    border-radius: var(--radius-lg); overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border-light);
    cursor: pointer; transition: all var(--transition);
}
.album-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.album-cover {
    aspect-ratio: 4/3; background: var(--bg-hover); overflow: hidden;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; color: var(--text-muted);
}

.album-info { padding: 0.75rem; }

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

.album-meta {
    font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem;
}

@media (max-width: 640px) {
    .header { padding: 0 1rem; }
    .file-area { padding: 1rem; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
    .file-list-header,
    .file-list-row { grid-template-columns: 28px 1fr 80px; }
    .file-list-header > :nth-child(3),
    .file-list-header > :nth-child(5),
    .file-list-row > :nth-child(3),
    .file-list-row > :nth-child(5) { display: none; }
    .toolbar { padding: 0.5rem 1rem; }
    .toolbar-search { width: 100%; order: 10; }
    .toolbar-actions-group { display: none; }
    .fm-bulk-left .fm-bulk-size { display: none !important; }
    .upload-panel { left: 1rem; right: 1rem; width: auto; bottom: 1rem; }
}

/* ─── BULK PROGRESS CARD ─────────────────────────────────────────────── */

.bulk-progress-card {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    width: 280px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideInUp 200ms ease;
}
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.bulk-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.bulk-progress-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bulk-progress-count {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.bulk-progress-track {
    background: var(--border-light);
    border-radius: var(--radius-full);
    height: 4px;
    overflow: hidden;
}
.bulk-progress-fill {
    background: var(--primary);
    height: 100%;
    transition: width 180ms ease;
    border-radius: var(--radius-full);
}

/* ─── FLOATING UPLOAD CARD (drag-and-drop progress) ──────────────────── */

.float-upload-card {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    max-height: 420px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 90;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInUp 200ms ease;
}
.float-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.float-upload-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.float-upload-list {
    overflow-y: auto;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
}
.float-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
}
.float-upload-row:hover {
    background: var(--bg-hover);
}
.float-upload-card.collapsed .float-upload-list {
    display: none;
}
.float-upload-toggle-icon {
    transition: transform 250ms cubic-bezier(0.16,1,0.3,1);
    display: block;
}
.float-upload-card.collapsed .float-upload-toggle-icon {
    transform: rotate(180deg);
}

/* ─── NOTIFICATION BELL ──────────────────────────────────────────────── */
.notif-wrapper {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}
.notif-bell-btn {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: var(--danger, #e53e3e);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full, 9999px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
}
.notif-badge.hidden { display: none; }
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 12px);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.notif-panel.hidden { display: none; }
.notif-panel-hd {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-light, var(--border));
    flex-shrink: 0;
}
.notif-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.notif-panel-body {
    overflow-y: auto;
    flex: 1;
}
.notif-section-hd {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.notif-count {
    background: var(--primary);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full, 9999px);
    padding: 1px 5px;
}
.notif-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light, var(--border));
    transition: background 100ms;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--bg-hover); }
.notif-row-info {
    flex: 1;
    min-width: 0;
}
.notif-row-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-row-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}
.notif-row-msg {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
}
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
