/* Riell Drive — Premium Dark Brand (noir + rouge cinematic) */
/* Inter font is loaded via <link> in header.php for faster paint */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* === BRAND IDENTITY === */
    --brand-black: #0F172A;
    --brand-black-deep: #020617;
    --brand-red: #DC2626;
    --brand-red-dark: #B91C1C;
    --brand-red-light: #FEE2E2;
    --brand-silver: #94A3B8;
    --brand-silver-light: #F1F5F9;

    /* === SEMANTIC TOKENS — LIGHT === */
    --primary: var(--brand-black);
    --primary-hover: var(--brand-black-deep);
    --primary-light: #F1F5F9;
    --accent: var(--brand-red);
    --accent-hover: var(--brand-red-dark);
    --accent-light: #FEE2E2;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-2: #F1F5F9;
    --hover: #F1F5F9;
    --selected: #FEE2E2;
    --border: #E2E8F0;

    --text: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #64748B;

    --danger: #DC2626;
    --success: #16A34A;
    --warning: #F59E0B;

    --header-h: 72px;
    --sidebar-w: 256px;

    --shadow-1: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.10);
    --shadow-2: 0 2px 6px rgba(15,23,42,0.08), 0 4px 12px rgba(15,23,42,0.06);
    --shadow-3: 0 8px 20px rgba(15,23,42,0.12), 0 16px 40px rgba(15,23,42,0.10);
    --shadow-red: 0 4px 14px rgba(220,38,38,0.30);

    --radius: 12px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* === DARK MODE === */
[data-theme="dark"] {
    --primary: #F8FAFC;
    --primary-hover: #E2E8F0;
    --primary-light: #1E293B;
    --accent: #EF4444;
    --accent-hover: #DC2626;
    --accent-light: #7F1D1D;

    --bg: #020617;
    --surface: #0F172A;
    --surface-2: #1E293B;
    --hover: #1E293B;
    --selected: #7F1D1D;
    --border: #1E293B;

    --text: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;

    --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 1px 3px rgba(0,0,0,0.5);
    --shadow-2: 0 2px 6px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.4);
    --shadow-3: 0 8px 20px rgba(0,0,0,0.6), 0 16px 40px rgba(0,0,0,0.5);
    --shadow-red: 0 4px 14px rgba(239,68,68,0.40);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease-out); }
a:hover { color: var(--accent-hover); text-decoration: underline; }

::selection { background: var(--accent); color: #fff; }

/* === ACCESSIBILITY — REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* === FOCUS RING UNIVERSEL === */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === AUTH PAGES === */
.auth-page {
    background: radial-gradient(ellipse at top, #1E293B 0%, var(--brand-black-deep) 50%, #000 100%);
    min-height: 100vh;
}
.auth-page::before {
    content: '';
    position: fixed; inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(220,38,38,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.auth-card {
    background: rgba(255,255,255,0.98);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 8px 20px rgba(220,38,38,0.15);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(20px);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { display:block; margin: 0 auto 16px; }
.auth-logo .auth-logo-img { width: 200px; height: auto; max-width: 100%; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.auth-logo h1 { font-size: 24px; font-weight: 600; margin: 12px 0 6px; color: var(--brand-black); letter-spacing: -0.02em; }
.auth-logo p { color: var(--text-secondary); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--text-secondary); font-weight: 500; letter-spacing: 0.01em; }
.form-group input {
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s var(--ease-out);
}
.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(220,38,38,0.12); }
.form-group small { color: var(--text-tertiary); font-size: 12px; }
.form-row { display:flex; justify-content: space-between; align-items: center; }
.checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.link { color: var(--accent); font-size: 13px; font-weight: 500; }

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s var(--ease-out);
    box-shadow: var(--shadow-red);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220,38,38,0.4); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary .material-icons { font-size: 18px; }
.btn-block { width: 100%; justify-content: center; padding: 14px; }
.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background 0.15s var(--ease-out);
}
.btn-text:hover { background: var(--hover); }
.auth-footer { text-align: center; margin-top: 24px; color: var(--text-secondary); font-size: 14px; }
.auth-demo {
    margin-top: 24px;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-black) 0%, #1E293B 100%);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: #E2E8F0;
    text-align: center;
    border: 1px solid rgba(220,38,38,0.2);
}
.auth-demo strong { color: #FCA5A5; }
.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--accent-light); color: var(--accent-hover); border: 1px solid rgba(220,38,38,0.2); }
.alert-success { background: #DCFCE7; color: #15803D; border: 1px solid rgba(22,163,74,0.2); }

/* === HEADER === */
.drive-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: 16px; z-index: 50;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: var(--sidebar-w); }
.header-center { flex: 1; max-width: 720px; }
.header-right { display: flex; align-items: center; gap: 4px; }

.icon-btn {
    background: none; border: none; cursor: pointer;
    padding: 10px; border-radius: 50%;
    color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.1s var(--ease-out);
    min-width: 44px; min-height: 44px;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.active { background: var(--accent-light); color: var(--accent); }

.drive-logo { display: flex; align-items: center; gap: 8px; height: 100%; }
.drive-logo:hover { text-decoration: none; }
.drive-logo .logo-img { height: 56px; width: auto; border-radius: 8px; display: block; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.drive-logo .logo-text { font-size: 22px; color: var(--text-secondary); font-weight: 500; }

.search-bar {
    display: flex; align-items: center;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
    border: 1px solid transparent;
}
.search-bar:focus-within { background: var(--surface); box-shadow: var(--shadow-2); border-color: var(--border); }
.search-bar input { flex: 1; border: none; background: transparent; padding: 10px 8px; outline: none; color: var(--text); font-size: 15px; }

.user-menu { position: relative; margin-left: 8px; }
.user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-black) 0%, var(--brand-red) 100%);
    color: white; border: none; cursor: pointer;
    font-weight: 600; font-size: 16px;
    display:flex; align-items:center; justify-content:center;
    transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out);
    box-shadow: var(--shadow-1);
}
.user-avatar:hover { transform: scale(1.05); box-shadow: var(--shadow-2); }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-3);
    min-width: 280px; padding: 8px 0; display: none; z-index: 100;
    border: 1px solid var(--border);
}
.user-dropdown.show { display: block; animation: dropdownIn 0.2s var(--ease-out); }
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.user-info { padding: 16px; text-align: center; }
.avatar-big {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-black) 0%, var(--brand-red) 100%);
    color:white; display:flex; align-items:center; justify-content:center;
    font-size: 28px; font-weight: 600; margin: 0 auto 8px;
    box-shadow: var(--shadow-2);
}
.user-name { font-weight: 600; color: var(--text); }
.user-email { color: var(--text-secondary); font-size: 13px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }
.dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; color: var(--text);
    cursor: pointer; transition: background 0.15s var(--ease-out);
}
.dropdown-item:hover { background: var(--hover); text-decoration: none; }
.dropdown-item .material-icons { font-size: 20px; color: var(--text-secondary); }

/* === SIDEBAR === */
.drive-sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--surface);
    padding: 16px 8px; overflow-y: auto;
    border-right: 1px solid var(--border);
    z-index: 30;
    transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.new-btn-wrapper { position: relative; padding: 0 8px 16px; }
.new-btn {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 14px 24px 14px 18px;
    background: var(--accent);
    color: white;
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-red);
    cursor: pointer;
    font-weight: 600; font-size: 14px;
    letter-spacing: 0.02em;
    transition: all 0.2s var(--ease-out);
}
.new-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220,38,38,0.45); }
.new-btn:active { transform: scale(0.97); }
.new-btn .material-icons { font-size: 20px; }

.new-menu {
    position: absolute; top: 100%; left: 16px;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-3);
    min-width: 280px; padding: 8px 0; display: none; z-index: 100;
    border: 1px solid var(--border);
}
.new-menu.show { display: block; animation: dropdownIn 0.2s var(--ease-out); }
.menu-item {
    display: flex; align-items: center; gap: 16px;
    padding: 11px 24px; background: none; border: none;
    width: 100%; text-align: left; cursor: pointer;
    color: var(--text); transition: background 0.15s var(--ease-out);
    font-size: 14px;
}
.menu-item:hover { background: var(--hover); }
.menu-item .material-icons { color: var(--text-secondary); font-size: 20px; }
.menu-divider { height: 1px; background: var(--border); margin: 8px 0; }

.sidebar-nav { padding: 8px 0; }
.nav-item {
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px; height: 44px;
    color: var(--text);
    border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
    margin-right: 8px; cursor: pointer;
    transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
    font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active { background: var(--selected); color: var(--accent); font-weight: 600; }
.nav-item.active .material-icons { color: var(--accent); }
.nav-item .material-icons { font-size: 20px; color: var(--text-secondary); transition: color 0.15s var(--ease-out); }

.nav-divider { height: 1px; background: var(--border); margin: 8px 16px; }
.nav-section-title {
    padding: 12px 24px 6px;
    font-size: 11px; color: var(--text-tertiary);
    font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em;
}

.storage-info { padding: 16px 24px; border-top: 1px solid var(--border); margin-top: 16px; }
.storage-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.storage-fill { height: 100%; background: var(--accent); transition: width 0.4s var(--ease-out); }
.storage-text { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.storage-text .material-icons { font-size: 16px; }
.storage-upgrade {
    display: inline-block; margin-top: 12px;
    padding: 8px 16px; border: 1px solid var(--border);
    border-radius: var(--radius-pill); color: var(--accent);
    font-size: 13px; font-weight: 500;
    transition: all 0.15s var(--ease-out);
}
.storage-upgrade:hover { background: var(--accent-light); border-color: var(--accent); text-decoration: none; }

/* === MAIN CONTENT === */
.drive-main { margin-left: var(--sidebar-w); margin-top: var(--header-h); padding: 0; min-height: calc(100vh - var(--header-h)); position: relative; }
.drive-toolbar {
    position: sticky; top: var(--header-h); background: var(--bg);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid transparent;
    z-index: 20;
    transition: background 0.2s var(--ease-out);
}
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.breadcrumb h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.crumb {
    font-size: 24px; font-weight: 500; color: var(--text);
    padding: 6px 12px; border-radius: var(--radius-sm);
    letter-spacing: -0.02em;
    transition: background 0.15s var(--ease-out);
}
.crumb:hover { background: var(--hover); text-decoration: none; }
.crumb.current { font-weight: 600; }
.crumb-sep { color: var(--text-tertiary); font-size: 20px !important; }
.view-toolbar { display: flex; gap: 4px; align-items: center; }
.drive-content { padding: 16px 24px 100px; }

/* === FOLDERS === */
.section { margin-bottom: 32px; }
.section-title {
    font-size: 12px; font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.folder-card {
    background: var(--surface-2); border-radius: var(--radius);
    padding: 14px 14px; display: flex; align-items: center; gap: 12px;
    cursor: pointer; position: relative;
    transition: all 0.15s var(--ease-out);
    border: 1.5px solid transparent;
}
.folder-card:hover { background: var(--hover); border-color: var(--border); transform: translateY(-1px); }
.folder-card:active { transform: scale(0.98); }
.folder-card.selected { background: var(--selected); border-color: var(--accent); }
.folder-icon { font-size: 24px !important; }
.folder-name { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.starred-badge { color: var(--warning); font-size: 18px !important; position: absolute; right: 36px; }
.more-btn {
    background: none; border: none; cursor: pointer;
    padding: 6px; border-radius: 50%;
    color: var(--text-secondary);
    display: none;
    transition: background 0.15s var(--ease-out);
}
.folder-card:hover .more-btn, .file-card:hover .more-btn { display: inline-flex; }
.more-btn:hover { background: rgba(0,0,0,.08); }
[data-theme="dark"] .more-btn:hover { background: rgba(255,255,255,.12); }

/* === FILES GRID === */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.file-card {
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    cursor: pointer; position: relative;
    transition: all 0.15s var(--ease-out);
}
.file-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--text-tertiary); }
.file-card:active { transform: scale(0.98); }
.file-card.selected { border-color: var(--accent); }
.file-thumb { height: 160px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-icon-big { font-size: 64px !important; }
.file-footer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.file-name { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.starred-badge { position: absolute; top: 8px; right: 8px; color: var(--warning); background: var(--surface); border-radius: 50%; padding: 2px; }

/* === FILES LIST === */
.files-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.files-table thead { background: var(--surface); border-bottom: 1.5px solid var(--border); }
.files-table th {
    text-align: left; padding: 12px 16px;
    font-weight: 600; color: var(--text-secondary);
    font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.files-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); font-feature-settings: 'tnum'; }
.file-row { cursor: pointer; transition: background 0.1s var(--ease-out); }
.file-row:hover { background: var(--hover); }
.file-row.selected { background: var(--selected); }
.file-name-cell { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.file-name-cell .material-icons { font-size: 24px; }
.starred-small { color: var(--warning); font-size: 16px !important; }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 80px 24px; color: var(--text-secondary); }
.empty-state img { margin-bottom: 24px; opacity: .8; }
.empty-state h3 { font-size: 20px; font-weight: 500; margin-bottom: 8px; letter-spacing: -0.01em; }
.empty-state p { font-size: 14px; }

/* === SKELETON LOADERS === */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--hover) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.skeleton-icon { width: 40px; height: 40px; border-radius: var(--radius-md); }
.skeleton-text { flex: 1; }
.skeleton-line { height: 14px; margin-bottom: 6px; }
.skeleton-line.short { width: 40%; }

/* === TRASH INFO === */
.trash-info {
    background: var(--accent-light); padding: 10px 16px;
    border-radius: var(--radius-md); margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--accent-hover);
    border: 1px solid rgba(220,38,38,0.15);
}
.trash-info .material-icons { font-size: 18px; }

/* === MODALS === */
.modal { display: none; position: fixed; inset: 0; background: rgba(2,6,23,0.5); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal.show { display: flex; animation: fadeIn 0.2s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
    min-width: 360px; max-width: 520px; width: 90%;
    animation: modalIn 0.25s var(--ease-out);
    border: 1px solid var(--border);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-content.modal-share { max-width: 520px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 18px 24px; }
.modal-input {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text);
    outline: none; font-size: 15px;
    transition: all 0.15s var(--ease-out);
}
.modal-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(220,38,38,0.12); }
.modal-footer { padding: 16px 24px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.share-section { margin-bottom: 20px; }
.share-section label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.share-link-row { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--hover); border-radius: var(--radius-md); }
.share-link-row .material-icons { background: var(--accent-light); color: var(--accent); padding: 8px; border-radius: 50%; }
.share-link-info { flex: 1; }
.share-link-info strong { display: block; font-size: 13px; }
.share-link-info select { margin-top: 4px; background: transparent; border: none; color: var(--text-secondary); outline: none; cursor: pointer; }
.share-link-display { display: flex; gap: 8px; margin-top: 12px; }
.share-link-display input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* === CONTEXT MENU === */
.context-menu {
    position: fixed; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-3);
    padding: 8px 0; min-width: 240px; z-index: 300;
    display: none;
    border: 1px solid var(--border);
}
.context-menu.show { display: block; animation: dropdownIn 0.15s var(--ease-out); }
.context-item {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 24px 10px 16px;
    cursor: pointer; font-size: 14px;
    transition: background 0.1s var(--ease-out);
}
.context-item:hover { background: var(--hover); }
.context-item .material-icons { font-size: 20px; color: var(--text-secondary); }
.context-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* === UPLOAD TRACKER === */
.upload-tracker {
    position: fixed; bottom: 24px; right: 24px;
    width: 360px; background: var(--surface);
    border-radius: var(--radius); box-shadow: var(--shadow-3);
    z-index: 200; overflow: hidden;
    border: 1px solid var(--border);
}
.upload-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--brand-black); color: white;
}
.upload-list { max-height: 240px; overflow-y: auto; }
.upload-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.upload-item .material-icons { color: var(--text-secondary); }
.upload-info { flex: 1; min-width: 0; }
.upload-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: var(--accent); transition: width .2s; }
.upload-item.done .material-icons { color: var(--success); }
.upload-item.error .material-icons { color: var(--danger); }

/* === DROP OVERLAY === */
.drop-overlay {
    position: fixed; inset: 0;
    background: rgba(220,38,38,0.10);
    border: 3px dashed var(--accent);
    pointer-events: none; z-index: 150;
    display: none; align-items: center; justify-content: center;
}
.drop-overlay.show { display: flex; animation: fadeIn 0.2s var(--ease-out); }
.drop-message {
    background: var(--surface);
    padding: 32px 48px; border-radius: var(--radius-lg);
    text-align: center; box-shadow: var(--shadow-3);
    border: 1px solid var(--accent);
}
.drop-message .material-icons { font-size: 72px; color: var(--accent); }
.drop-message h2 { margin-top: 12px; font-size: 22px; color: var(--text); letter-spacing: -0.01em; }

/* === TOASTS === */
.toast-container { position: fixed; bottom: 24px; left: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 400; }
.toast {
    background: var(--brand-black); color: white;
    padding: 14px 24px; border-radius: var(--radius-md);
    min-width: 280px; max-width: 568px;
    box-shadow: var(--shadow-3);
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px;
    animation: slideUp 0.25s var(--ease-out);
    border-left: 3px solid var(--accent);
}
.toast button { background: none; border: none; color: #FCA5A5; cursor: pointer; font-weight: 600; text-transform: uppercase; font-size: 13px; letter-spacing: 0.04em; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === PROFILE === */
.profile-page { max-width: 720px; margin: 0 auto; padding: 24px; }
.profile-card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-1); border: 1px solid var(--border); }
.profile-header { display: flex; align-items: center; gap: 24px; margin-bottom: 32px; }
.avatar-huge {
    width: 96px; height: 96px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-black) 0%, var(--brand-red) 100%);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 40px; font-weight: 600;
    box-shadow: var(--shadow-2);
}
.profile-storage { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.profile-storage h4 { font-weight: 600; margin-bottom: 12px; }
.profile-form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.profile-form h4 { font-weight: 600; }

/* === SHARE PAGE === */
.share-page { min-height: 100vh; background: var(--bg); }
.share-header { padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.share-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.share-preview { text-align: center; }
.share-preview img { max-width: 80vw; max-height: 60vh; border-radius: var(--radius); box-shadow: var(--shadow-2); }
.share-preview h2 { margin: 24px 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.share-preview p { color: var(--text-secondary); margin-bottom: 24px; }
.file-icon-huge { font-size: 128px !important; }

/* === ACTIVITIES PAGE === */
.activities-list { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.activity-row { display: flex; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--hover); }
.activity-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.activity-icon .material-icons { font-size: 20px; }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-weight: 500; }
.activity-target { color: var(--text-secondary); font-weight: 400; margin-left: 8px; }
.activity-time { color: var(--text-tertiary); font-size: 12px; margin-top: 2px; font-feature-settings: 'tnum'; }

/* === SHARE MODAL ENHANCED === */
.share-add-row { display: flex; gap: 8px; align-items: center; }
.share-add-row .modal-input { flex: 1; }
.share-add-row select { padding: 11px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); }
.full-btn { display: flex; align-items: center; gap: 8px; padding: 12px; width: 100%; justify-content: flex-start; background: var(--accent-light); color: var(--accent); border-radius: var(--radius-md); font-weight: 500; }
.full-btn:hover { background: var(--accent-light); transform: translateY(-1px); }
.shares-list { max-height: 200px; overflow-y: auto; }
.share-entry { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.share-entry:last-child { border-bottom: none; }
.share-entry .who { flex: 1; font-size: 14px; font-weight: 500; }
.share-entry .perm { color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.share-entry button { background: none; border: none; color: var(--danger); cursor: pointer; padding: 6px 8px; border-radius: var(--radius-sm); transition: background 0.15s var(--ease-out); }
.share-entry button:hover { background: var(--hover); }
.share-entry .copy-btn { color: var(--accent); }
.muted { color: var(--text-tertiary); font-size: 13px; padding: 12px 4px; font-style: italic; }

/* === MOVE TREE === */
.move-crumb {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; background: var(--hover);
    border-radius: var(--radius-md); font-size: 13px;
    color: var(--text-secondary); margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.15s var(--ease-out);
}
.move-crumb:hover { background: var(--surface-2); }
.move-crumb .material-icons { font-size: 18px; color: var(--accent); }
.folder-tree { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; }
.tree-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.1s var(--ease-out);
}
.tree-item:hover { background: var(--hover); }
.tree-item.selected { background: var(--accent-light); color: var(--accent); }
.tree-item .material-icons:first-child { color: var(--text-secondary); }
.tree-empty { padding: 24px; text-align: center; color: var(--text-tertiary); font-size: 13px; font-style: italic; }

/* === SORT MENU === */
.sort-dropdown { position: relative; }
.sort-menu {
    position: absolute; right: 0; top: calc(100% + 4px);
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-3);
    min-width: 240px; padding: 8px 0;
    display: none; z-index: 150;
    border: 1px solid var(--border);
}
.sort-menu.show { display: block; animation: dropdownIn 0.2s var(--ease-out); }
.sort-menu .menu-item.active { color: var(--accent); font-weight: 600; }
.sort-menu .menu-item.active .material-icons { color: var(--accent); }

/* === DARK MODE TOGGLE === */
.theme-toggle {
    cursor: pointer; padding: 8px;
    border-radius: 50%; transition: background 0.15s var(--ease-out);
}
.theme-toggle:hover { background: var(--hover); }
[data-theme="dark"] .theme-toggle .material-icons::before { content: 'light_mode'; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .drive-sidebar { transform: translateX(-100%); transition: transform .25s var(--ease-out); }
    .drive-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-3); }
    .drive-main { margin-left: 0; }
    .header-left { min-width: 0; }
    .drive-logo .logo-text { display: none; }
    .drive-toolbar { padding: 12px 16px; }
    .breadcrumb h2, .crumb { font-size: 20px; }
}
@media (max-width: 600px) {
    .header-right .icon-btn:not(:last-child):not(.theme-toggle) { display: none; }
    .file-grid, .folder-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .auth-card { padding: 32px 24px; }
    html, body { font-size: 15px; }
}
