/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, button { font-size: 0.9375rem; }
img { display: block; max-width: 100%; }

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
    --primary:        #1967d2;
    --primary-dark:   #1558b0;
    --primary-light:  #e8f0fe;
    --danger:         #d93025;
    --danger-light:   #fce8e6;
    --success:        #188038;
    --success-light:  #e6f4ea;
    --warning:        #f29900;
    --bg:             #f8f9fa;
    --surface:        #ffffff;
    --surface-2:      #f1f3f4;
    --border:         #dadce0;
    --text:           #202124;
    --text-muted:     #5f6368;
    --text-light:     #80868b;
    --sidebar-w:      240px;
    --header-h:       64px;
    --radius-sm:      4px;
    --radius:         8px;
    --radius-lg:      12px;
    --radius-xl:      20px;
    --shadow-sm:      0 1px 3px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.1);
    --shadow:         0 2px 6px rgba(60,64,67,.15), 0 1px 4px rgba(60,64,67,.12);
    --shadow-lg:      0 4px 16px rgba(60,64,67,.2), 0 2px 6px rgba(60,64,67,.12);
    --t:              .18s cubic-bezier(.4,0,.2,1);
}

/* ── Auth Page ───────────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%);
}
.auth-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.auth-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -.5px;
}
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--t), border-color var(--t);
}
.auth-tab:hover  { color: var(--primary); }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-panel      { display: none; }
.auth-panel.active { display: block; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.form-group input {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--t), box-shadow var(--t);
    outline: none;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25,103,210,.15);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 20px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background var(--t), border-color var(--t), box-shadow var(--t), transform .1s;
    outline: none;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); box-shadow: var(--shadow-sm); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #b5261d; }
.btn-ghost    { background: transparent; color: var(--primary); border-color: transparent; }
.btn-ghost:hover    { background: var(--primary-light); }
.btn-block    { width: 100%; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 16px;
}
.alert-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid #f5c6c4; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a8d5b5; }

/* ── App Layout ──────────────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    width: var(--sidebar-w);
}
.sidebar-toggle {
    width: 40px; height: 40px;
    border: none; background: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: background var(--t);
}
.sidebar-toggle svg { width: 20px; height: 20px; }
.sidebar-toggle:hover { background: var(--surface-2); }
.app-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.25rem; font-weight: 600; color: var(--text);
    padding: 6px 8px; border-radius: var(--radius);
    transition: background var(--t);
    white-space: nowrap;
}
.app-brand:hover { background: var(--surface-2); }
.header-search {
    flex: 1;
    max-width: 720px;
    margin: 0 16px;
}
.search-form {
    display: flex; align-items: center;
    background: var(--surface-2);
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    gap: 10px;
    transition: background var(--t), box-shadow var(--t);
}
.search-form:focus-within {
    background: var(--surface);
    box-shadow: var(--shadow);
}
.search-icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-form input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    color: var(--text);
}
.search-form input::placeholder { color: var(--text-muted); }
.header-right { margin-left: auto; flex-shrink: 0; }

/* ── User menu ───────────────────────────────────────────────────────────── */
.user-menu   { position: relative; }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    transition: box-shadow var(--t);
}
.user-avatar:hover { box-shadow: 0 0 0 3px var(--primary-light); }
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    display: none;
    z-index: 200;
}
.user-dropdown.open { display: block; }
.user-info {
    display: flex; flex-direction: column;
    padding: 10px 16px 14px;
    gap: 2px;
}
.user-info strong { font-size: .9375rem; color: var(--text); }
.user-info span   { font-size: .8125rem; color: var(--text-muted); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: var(--text);
    font-size: .9375rem;
    transition: background var(--t);
}
.dropdown-item svg { width: 18px; height: 18px; color: var(--text-muted); }
.dropdown-item:hover { background: var(--surface-2); }

/* ── App Layout body ─────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--header-h); left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    background: var(--surface);
    display: flex; flex-direction: column;
    padding: 12px 0;
    overflow-y: auto;
    transition: transform var(--t);
    z-index: 90;
}
.sidebar.collapsed { transform: translateX(-100%); }
.sidebar-top { padding: 4px 12px 12px; position: relative; }
.btn-upload-main {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: .9375rem; font-weight: 500; color: var(--text);
    box-shadow: var(--shadow-sm);
    width: 100%;
    transition: box-shadow var(--t), background var(--t);
}
.btn-upload-main svg { width: 22px; height: 22px; color: var(--primary); }
.btn-upload-main:hover { box-shadow: var(--shadow); background: var(--surface-2); }
.upload-menu {
    position: absolute; left: 12px; top: calc(100% - 4px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: calc(var(--sidebar-w) - 24px);
    padding: 6px 0;
    display: none;
    z-index: 150;
}
.upload-menu.open { display: block; }
.upload-menu-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 11px 16px;
    background: none; border: none;
    font-size: .9375rem; color: var(--text);
    text-align: left;
    transition: background var(--t);
}
.upload-menu-item svg { width: 20px; height: 20px; color: var(--text-muted); }
.upload-menu-item:hover { background: var(--surface-2); }
.sidebar-nav { padding: 4px 8px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-xl);
    font-size: .9375rem; font-weight: 500; color: var(--text-muted);
    transition: background var(--t), color var(--t);
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.sidebar-storage {
    margin-top: auto;
    padding: 16px 16px 8px;
    border-top: 1px solid var(--border);
}
.storage-label {
    display: flex; align-items: center; gap: 8px;
    font-size: .8125rem; font-weight: 500; color: var(--text-muted);
    margin-bottom: 8px;
}
.storage-label svg { width: 16px; height: 16px; }
.storage-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}
.storage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width .6s ease;
}
.storage-fill[style*="8"] { background: var(--warning); }
.storage-fill[style*="9"] { background: var(--danger);  }
.sidebar-storage small { font-size: .75rem; color: var(--text-light); }

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 0;
    min-width: 0;
    transition: margin-left var(--t);
}
.main-content.full { margin-left: 0; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    gap: 12px;
    flex-wrap: wrap;
}
.breadcrumb {
    display: flex; align-items: center;
    flex-wrap: wrap; gap: 2px;
    font-size: .9375rem;
    flex: 1; min-width: 0;
}
.crumb {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: background var(--t), color var(--t);
    white-space: nowrap;
    max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.crumb svg { width: 16px; height: 16px; flex-shrink: 0; }
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb-current { color: var(--text); font-weight: 500; pointer-events: none; }
.crumb-sep { color: var(--text-light); padding: 0 2px; user-select: none; }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
    width: 36px; height: 36px;
    border: none; background: none;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: background var(--t), color var(--t);
}
.view-btn svg { width: 18px; height: 18px; }
.view-btn:hover { background: var(--surface-2); color: var(--text); }
.view-btn.active { background: var(--primary-light); color: var(--primary); }

/* ── Drop zone ───────────────────────────────────────────────────────────── */
.drop-zone {
    position: relative;
    min-height: calc(100vh - var(--header-h) - 60px);
    padding: 16px 24px;
}
.drop-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px;
    background: rgba(25,103,210,.07);
    border: 3px dashed var(--primary);
    border-radius: var(--radius-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--t);
    z-index: 5;
}
.drop-overlay svg { width: 56px; height: 56px; color: var(--primary); }
.drop-overlay p   { font-size: 1.1rem; font-weight: 500; color: var(--primary); }
.drop-zone.drag-over .drop-overlay { opacity: 1; }

/* ── File Grid ───────────────────────────────────────────────────────────── */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    align-content: start;
}

/* ── File Item (grid) ────────────────────────────────────────────────────── */
.file-item {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: 16px 12px 12px;
    cursor: pointer;
    position: relative;
    transition: background var(--t), border-color var(--t), box-shadow var(--t);
    user-select: none;
}
.file-item:hover {
    background: var(--primary-light);
    border-color: #c5d8fb;
    box-shadow: var(--shadow-sm);
}
.file-item.selected {
    background: var(--primary-light);
    border-color: var(--primary);
}
.file-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.file-icon svg { width: 40px; height: 40px; }
.file-icon--folder { background: none; color: #fbbc04; }
.file-icon--image  { background: #e8f0fe; color: var(--primary); }
.file-icon--video  { background: #fce8e6; color: var(--danger); }
.file-icon--audio  { background: #e6f4ea; color: var(--success); }
.file-icon--pdf    { background: #fce8e6; color: #d93025; }
.file-icon--word   { background: #e8f0fe; color: #1a73e8; }
.file-icon--excel  { background: #e6f4ea; color: #188038; }
.file-icon--ppt    { background: #fef7e0; color: #f09300; }
.file-icon--zip    { background: #f1f3f4; color: var(--text-muted); }
.file-icon--text   { background: #f1f3f4; color: var(--text-muted); }
.file-icon--file   { background: #f1f3f4; color: var(--text-muted); }
.file-thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
}
.file-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.file-name {
    font-size: .875rem; font-weight: 500; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: block;
}
.file-meta { font-size: .75rem; color: var(--text-light); }
.file-actions {
    position: absolute; top: 8px; right: 8px;
    display: flex; gap: 2px;
    opacity: 0;
    transition: opacity var(--t);
}
.file-item:hover .file-actions { opacity: 1; }
.action-btn {
    width: 28px; height: 28px;
    border: none; background: rgba(255,255,255,.8);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: background var(--t), color var(--t);
    backdrop-filter: blur(4px);
    text-decoration: none;
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { background: var(--surface); color: var(--primary); }

/* ── List view ───────────────────────────────────────────────────────────── */
.file-grid.list-view {
    grid-template-columns: 1fr;
    gap: 2px;
}
.file-grid.list-view .file-item {
    flex-direction: row;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius);
    gap: 12px;
}
.file-grid.list-view .file-icon {
    width: 36px; height: 36px;
    margin-bottom: 0; flex-shrink: 0;
}
.file-grid.list-view .file-icon svg { width: 24px; height: 24px; }
.file-grid.list-view .file-info { flex-direction: row; align-items: center; flex: 1; gap: 16px; }
.file-grid.list-view .file-name { flex: 1; }
.file-grid.list-view .file-meta { white-space: nowrap; }
.file-grid.list-view .file-actions { position: static; opacity: 1; margin-left: auto; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg { width: 72px; height: 72px; opacity: .4; }
.empty-state h3  { font-size: 1.125rem; font-weight: 500; color: var(--text); }
.empty-state p   { font-size: .9375rem; max-width: 320px; }

/* ── Context Menu ────────────────────────────────────────────────────────── */
.context-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px 0;
    z-index: 300;
    display: none;
}
.context-menu.open { display: block; }
.ctx-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 10px 16px;
    background: none; border: none;
    font-size: .9375rem; color: var(--text); text-align: left;
    transition: background var(--t);
}
.ctx-item svg { width: 18px; height: 18px; color: var(--text-muted); }
.ctx-item:hover { background: var(--surface-2); }
.ctx-item--danger { color: var(--danger); }
.ctx-item--danger svg { color: var(--danger); }
.ctx-sep { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Modais ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 400;
    display: none;
    backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: block; }
.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(90vw, 440px);
    z-index: 500;
    display: none;
    opacity: 0;
    transition: opacity .2s, transform .2s;
}
.modal.open {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-header h2 { font-size: 1.125rem; font-weight: 600; color: var(--text); }
.modal-close {
    width: 32px; height: 32px;
    background: none; border: none;
    border-radius: 50%;
    font-size: 1.25rem; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--t);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body  { padding: 20px 24px; }
.modal-body p { font-size: .9375rem; color: var(--text-muted); line-height: 1.6; }
.modal-body strong { color: var(--text); }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 0 24px 24px;
}

/* ── Move modal ──────────────────────────────────────────────────────────── */
.modal-move { width: min(90vw, 480px); }
.move-crumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}
.move-crumb-item {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 8px;
    border-radius: var(--radius);
    font-size: .8125rem; font-weight: 500; color: var(--text-muted);
    cursor: pointer;
    transition: background var(--t), color var(--t);
    border: none; background: none;
}
.move-crumb-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.move-crumb-item:hover  { background: var(--surface-2); color: var(--text); }
.move-crumb-item.active { color: var(--text); font-weight: 600; pointer-events: none; }
.move-crumb-sep { color: var(--text-light); font-size: .875rem; user-select: none; }
.move-list {
    max-height: 260px;
    overflow-y: auto;
    margin: 0 -24px;
    padding: 4px 0;
}
.move-folder-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 24px;
    cursor: pointer;
    transition: background var(--t);
    gap: 10px;
}
.move-folder-item:hover { background: var(--surface-2); }
.move-folder-item.selected { background: var(--primary-light); }
.move-folder-left {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
}
.move-folder-left svg { width: 20px; height: 20px; color: #fbbc04; flex-shrink: 0; }
.move-folder-left span { font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-folder-enter {
    width: 28px; height: 28px;
    border: none; background: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
    transition: background var(--t), color var(--t);
    flex-shrink: 0;
}
.move-folder-enter svg { width: 16px; height: 16px; }
.move-folder-enter:hover { background: var(--border); color: var(--text); }
.move-empty {
    text-align: center; padding: 28px;
    font-size: .875rem; color: var(--text-light);
}
.move-loading { text-align: center; padding: 28px; font-size: .875rem; color: var(--text-muted); }
.move-destination {
    font-size: .8125rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
}
.move-destination strong { color: var(--text); }

/* ── Preview modal ───────────────────────────────────────────────────────── */
.modal-preview {
    width: min(95vw, 90vh);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: rgba(20,20,20,.95);
    overflow: hidden;
}
.modal-preview #previewImg {
    max-height: calc(90vh - 80px);
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius);
}
.modal-preview #previewName {
    margin-top: 12px;
    color: rgba(255,255,255,.7);
    font-size: .875rem;
}
.modal-close-preview {
    position: absolute; top: 16px; right: 16px;
    color: #fff;
    background: rgba(255,255,255,.15);
}
.modal-close-preview:hover { background: rgba(255,255,255,.25); }

/* ── Upload progress ─────────────────────────────────────────────────────── */
.upload-progress {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 320px;
    padding: 16px 20px;
    z-index: 600;
    display: none;
}
.upload-progress.open { display: block; }
.upload-progress-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
    font-size: .9375rem; font-weight: 500; color: var(--text);
}
.upload-progress-header button {
    background: none; border: none;
    font-size: 1.25rem; color: var(--text-muted);
    line-height: 1; cursor: pointer;
}
.upload-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.upload-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width .3s ease;
}
.upload-progress small { font-size: .8125rem; color: var(--text-muted); }

/* ── Toast notifications ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column-reverse; gap: 8px;
    z-index: 700;
    pointer-events: none;
}
.toast {
    background: #323232;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-xl);
    font-size: .9375rem;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    display: flex; align-items: center; gap: 12px;
    animation: toastIn .25s ease;
    max-width: 380px;
}
.toast.toast-error   { background: var(--danger); }
.toast.toast-success { background: var(--success); }
.toast-close { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-size: 1rem; }
@keyframes toastIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bdc1c6; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .header-left { width: auto; }
    .app-brand span { display: none; }
    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .drop-zone { padding: 12px 16px; }
    .toolbar { padding: 10px 16px; }
}
@media (max-width: 480px) {
    .auth-container { padding: 28px 20px; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
