/* ============================================
   AhmedCloud - Dark Theme
   FileRun-inspired Professional Cloud Manager
   ============================================ */

/* === CSS VARIABLES (FileRun-matching dark theme) === */
:root {
    /* Core theme colors */
    --theme-main: #3b82f6;
    --theme-main-hover: #2563eb;
    --theme-main-active: #1d4ed8;
    --theme-main-light: rgba(59, 130, 246, 0.15);
    --theme-main-subtle: rgba(59, 130, 246, 0.08);

    /* Dark backgrounds */
    --theme-bg: #0f172a;
    --theme-body-bg: #1e293b;
    --theme-surface: #1e293b;
    --theme-surface-raised: #283548;
    --theme-surface-overlay: #334155;
    --theme-surface-hover: rgba(255, 255, 255, 0.04);
    --theme-surface-active: rgba(255, 255, 255, 0.08);

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: rgba(59, 130, 246, 0.18);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f1f5f9;
    --sidebar-border: #1e293b;
    --sidebar-width: 240px;

    /* Topbar */
    --topbar-bg: #0f172a;
    --topbar-border: #1e293b;
    --topbar-height: 48px;

    /* Text colors */
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --text-link: #60a5fa;

    /* Borders */
    --border: #334155;
    --border-light: #1e293b;
    --border-focus: var(--theme-main);

    /* Status colors */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-context: 0 6px 24px rgba(0,0,0,0.5);

    /* Radii */
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Sizing */
    --info-panel-width: 300px;

    /* Misc */
    --transition: 0.15s ease;
    --font: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* File colors */
    --folder-color: #60a5fa;
    --folder-shared: #a78bfa;
    --file-image: #f472b6;
    --file-video: #fb923c;
    --file-audio: #c084fc;
    --file-pdf: #ef4444;
    --file-doc: #60a5fa;
    --file-spreadsheet: #34d399;
    --file-presentation: #fbbf24;
    --file-archive: #a1887f;
    --file-code: #4ade80;
    --file-default: #94a3b8;

    /* Scrollbar */
    --scrollbar-thumb: #475569;
    --scrollbar-track: transparent;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--theme-body-bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

a { color: var(--text-link); text-decoration: none; cursor: pointer; }
a:hover { color: var(--theme-main); }

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }

::selection { background: var(--theme-main-light); color: #fff; }

/* Font Awesome adjustments */
.fa, .fas, .far, .fal, .fat, .fad, .fab {
    font-style: normal;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

i[class*="fa-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.4;
    background: transparent;
    color: var(--text);
}

.btn i { font-size: 14px; }

.btn-primary {
    background: var(--theme-main);
    color: #fff;
}
.btn-primary:hover {
    background: var(--theme-main-hover);
    box-shadow: var(--shadow-sm);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-success { background: var(--success); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--theme-surface-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}
.btn-ghost:hover { background: var(--theme-surface-active); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-sm i { font-size: 12px; }
.btn-xs { padding: 2px 6px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--theme-surface-active); color: var(--text); }
.btn-icon i { font-size: 16px; }

.btn-loader {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === FORM ELEMENTS === */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, .input-icon input, input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="number"], select, textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}
.form-control:focus, .input-icon input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--theme-main);
    box-shadow: 0 0 0 2px var(--theme-main-light);
}
::placeholder { color: var(--text-muted); }

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}
.input-icon input { padding-left: 40px; }

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
}

/* Checkbox */
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.checkbox-wrap input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--theme-main);
    cursor: pointer;
}

/* === LOGIN SCREEN === */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-bg);
    z-index: 9999;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(59,130,246,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.06) 0%, transparent 60%);
}

.login-card {
    position: relative;
    width: 380px;
    padding: 40px;
    background: var(--theme-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo .logo-icon {
    font-size: 48px;
    color: var(--theme-main);
    margin-bottom: 12px;
    display: block;
}
.login-logo h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}
.login-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.login-form .btn-primary {
    margin-top: 8px;
    padding: 10px;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* === TOP BAR === */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 100;
    gap: 8px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 200px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
    user-select: none;
}
.brand:hover { background: var(--theme-surface-hover); }
.brand-icon { font-size: 22px; color: var(--theme-main); }
.brand-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}

.topbar-center { flex: 1; display: flex; justify-content: center; max-width: 560px; margin: 0 auto; }

.search-box {
    position: relative;
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}
.search-box:focus-within {
    border-color: var(--theme-main);
    box-shadow: 0 0 0 2px var(--theme-main-light);
    background: var(--theme-surface);
}
.search-box .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}
.search-box input {
    flex: 1;
    background: none;
    border: none;
    padding: 7px 12px 7px 38px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    width: 100%;
}
.search-clear {
    width: 28px; height: 28px;
    margin-right: 4px;
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: calc(var(--topbar-height) + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 200;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
}
.search-result-item:hover { background: var(--theme-surface-active); }
.search-result-item i { font-size: 18px; color: var(--text-muted); flex-shrink: 0; width: 20px; text-align: center; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-path {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Topbar right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 160px;
    justify-content: flex-end;
}

/* View mode buttons */
.view-mode-group {
    display: flex;
    align-items: center;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.view-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.view-mode-btn:hover { color: var(--text); background: var(--theme-surface-hover); }
.view-mode-btn.active { color: var(--theme-main); background: var(--theme-main-subtle); }
.view-mode-btn i { font-size: 13px; }

/* User avatar */
.user-menu-trigger { cursor: pointer; }
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--theme-main);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    transition: box-shadow var(--transition);
}
.user-avatar:hover { box-shadow: 0 0 0 2px var(--theme-main-light); }

/* === DROPDOWN MENU === */
.dropdown-menu {
    position: fixed;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-context);
    min-width: 220px;
    z-index: 500;
    padding: 6px;
    animation: dropIn 0.12s ease-out;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-menu { right: 12px; top: calc(var(--topbar-height) + 4px); }

.dropdown-header {
    padding: 10px 12px;
}
.dropdown-header strong { display: block; color: var(--text); font-size: 13px; }
.dropdown-header small { color: var(--text-muted); font-size: 11px; }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
    color: var(--text);
}
.dropdown-item:hover { background: var(--theme-surface-active); text-decoration: none; }
.dropdown-item i { font-size: 15px; color: var(--text-secondary); width: 18px; text-align: center; }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger i { color: var(--danger); }

.storage-info { padding: 8px 12px; }
.storage-bar {
    height: 4px;
    background: var(--theme-surface-overlay);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}
.storage-bar-fill {
    height: 100%;
    background: var(--theme-main);
    border-radius: 2px;
    transition: width 0.5s ease;
}
.storage-info small { color: var(--text-muted); font-size: 11px; }

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 90;
    transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
    overflow: hidden;
}

.sidebar-nav {
    padding: 8px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    user-select: none;
}
.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
    text-decoration: none;
}
.nav-item.active {
    background: var(--sidebar-active);
    color: var(--theme-main);
    font-weight: 500;
}
.nav-item i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.nav-item .badge {
    margin-left: auto;
    background: var(--theme-main);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 12px;
}

.sidebar-section-title {
    padding: 8px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Folder tree */
.folder-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    min-height: 0;
}
.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    padding-left: calc(8px + var(--depth, 0) * 16px);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--sidebar-text);
    font-size: 12px;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tree-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.tree-item.active { color: var(--theme-main); background: var(--sidebar-active); }
.tree-toggle {
    width: 16px; height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.15s;
}
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.empty { visibility: hidden; }
.tree-item .tree-icon {
    font-size: 14px;
    color: var(--folder-color);
    flex-shrink: 0;
}
.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar storage */
.sidebar-storage {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}
.sidebar-storage .storage-bar { margin-bottom: 6px; }
.sidebar-storage small { color: var(--text-muted); font-size: 11px; }

/* === MAIN CONTENT === */
.main-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-body {
    display: flex;
    flex: 1;
    padding-top: var(--topbar-height);
    min-height: 0;
}

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    transition: margin-left 0.2s ease;
    background: var(--theme-body-bg);
}
.sidebar.collapsed ~ .content { margin-left: 0; }

/* === TOOLBAR === */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    min-height: 44px;
    gap: 12px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
}
.breadcrumb a, .breadcrumb .bc-item {
    color: var(--text-secondary);
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    text-decoration: none;
}
.breadcrumb a:hover, .breadcrumb .bc-item:hover {
    background: var(--theme-surface-active);
    color: var(--text);
    text-decoration: none;
}
.breadcrumb .bc-home { display: flex; align-items: center; }
.breadcrumb .bc-home i { font-size: 15px; }
.bc-sep { color: var(--text-muted); font-size: 11px; margin: 0 2px; }
.bc-current { color: var(--text); font-weight: 500; cursor: default; }
.bc-current:hover { background: transparent; }

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* "New" dropdown button */
.new-btn {
    position: relative;
}
.new-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-context);
    min-width: 200px;
    z-index: 300;
    padding: 6px;
}
.new-dropdown .dropdown-item i { width: 20px; }

/* Sort dropdown */
.sort-dropdown {
    position: relative;
}
.sort-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition);
}
.sort-trigger:hover { background: var(--theme-surface-hover); color: var(--text); }
.sort-trigger i { font-size: 12px; }

/* === SELECTION BAR === */
.selection-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--theme-main);
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}
.selection-bar .btn {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 12px;
    padding: 3px 10px;
}
.selection-bar .btn:hover {
    background: rgba(255,255,255,0.15);
}

/* === FILE CONTAINER === */
.file-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
    position: relative;
}

/* === GRID VIEW (Thumbnails) === */
.grid-view .file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 12px 16px;
}

.grid-item {
    position: relative;
    background: var(--theme-surface-raised);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
    user-select: none;
}
.grid-item:hover {
    background: var(--theme-surface-overlay);
    border-color: var(--border);
}
.grid-item.selected {
    background: var(--theme-main-subtle);
    border-color: var(--theme-main);
}

.grid-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface);
    position: relative;
    overflow: hidden;
}
.grid-thumb i {
    font-size: 40px;
    color: var(--text-muted);
    transition: color var(--transition);
}
.grid-thumb i.folder-icon { color: var(--folder-color); }
.grid-thumb.has-image {
    background: #000;
}
.grid-thumb.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.grid-thumb .grid-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    cursor: pointer;
}
.grid-item:hover .grid-check,
.grid-item.selected .grid-check { opacity: 1; }
.grid-item.selected .grid-check {
    background: var(--theme-main);
    border-color: var(--theme-main);
}
.grid-item.selected .grid-check::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Pro';
    font-weight: 300;
    font-size: 11px;
    color: #fff;
}

.grid-info {
    padding: 8px 10px;
}
.grid-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.grid-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.grid-meta .star-icon { color: var(--warning); font-size: 11px; }

/* === LARGE GRID VIEW === */
.large-grid-view .file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    padding: 16px;
}
.large-grid-view .grid-item { border-radius: var(--radius-lg); }
.large-grid-view .grid-thumb { aspect-ratio: 3/2; }
.large-grid-view .grid-info { padding: 10px 12px; }
.large-grid-view .grid-name { font-size: 13px; }

/* === LIST VIEW === */
.list-view .file-list { display: flex; flex-direction: column; }

.list-header {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 34px;
    border-bottom: 1px solid var(--border);
    background: var(--theme-surface-raised);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 5;
}
.list-header .col { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.list-header .col:hover { color: var(--text); }
.list-header .sort-arrow { font-size: 9px; }

.list-row {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 38px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}
.list-row:hover { background: var(--theme-surface-hover); }
.list-row.selected { background: var(--theme-main-subtle); }
.list-row.cut { opacity: 0.5; }

.col { padding: 0 8px; }
.col-check { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.col-icon { width: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.col-icon i { font-size: 17px; }
.col-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.col-name .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}
.col-name .star-badge { color: var(--warning); font-size: 11px; }
.col-name .shared-badge { color: var(--folder-shared); font-size: 11px; }
.col-size { width: 80px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); text-align: right; }
.col-date { width: 140px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); }
.col-actions { width: 40px; flex-shrink: 0; display: flex; justify-content: center; opacity: 0; transition: opacity var(--transition); }
.list-row:hover .col-actions { opacity: 1; }

.col-check input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--theme-main);
    cursor: pointer;
}

/* === COMPACT LIST VIEW === */
.list-compact-view .file-list { display: flex; flex-direction: column; }
.list-compact-view .list-row { height: 30px; }
.list-compact-view .col-name .file-name { font-size: 12px; }
.list-compact-view .col-icon i { font-size: 14px; }

/* === PHOTOS VIEW === */
.photos-view .file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px;
    padding: 4px;
}
.photos-view .grid-item {
    border-radius: 0;
    background: #000;
    border: none;
}
.photos-view .grid-thumb { aspect-ratio: 1; }
.photos-view .grid-info { display: none; }
.photos-view .grid-item:hover { opacity: 0.85; }
.photos-view .grid-item.selected { outline: 3px solid var(--theme-main); outline-offset: -3px; }

/* === EMPTY & LOADING STATES === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; color: var(--text-muted); opacity: 0.4; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--theme-main);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* === CONTEXT MENU === */
.context-menu {
    position: fixed;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-context);
    min-width: 200px;
    max-width: 280px;
    z-index: 1000;
    padding: 6px;
    animation: dropIn 0.1s ease-out;
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
    color: var(--text);
    user-select: none;
}
.ctx-item:hover { background: var(--theme-surface-active); }
.ctx-item i { font-size: 15px; color: var(--text-secondary); width: 18px; text-align: center; flex-shrink: 0; }
.ctx-item:hover i { color: var(--text); }
.ctx-item .ctx-shortcut { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger i { color: var(--danger); }
.ctx-item.disabled { opacity: 0.4; pointer-events: none; }

.ctx-submenu { position: relative; }
.ctx-submenu::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Pro';
    font-size: 9px;
    font-weight: 300;
    margin-left: auto;
    color: var(--text-muted);
}
.ctx-submenu-items {
    display: none;
    position: absolute;
    left: 100%;
    top: -6px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-context);
    min-width: 180px;
    padding: 6px;
    z-index: 1001;
}
.ctx-submenu:hover > .ctx-submenu-items { display: block; }

.ctx-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

.ctx-header {
    padding: 6px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Folder color dots in context menu */
.color-options {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    flex-wrap: wrap;
}
.color-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: #fff; box-shadow: 0 0 0 2px var(--theme-main); }

/* === INFO PANEL (Right side) === */
.info-panel {
    width: var(--info-panel-width);
    border-left: 1px solid var(--border);
    background: var(--theme-surface);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}
.info-panel.hidden { width: 0; border: none; overflow: hidden; }

.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.info-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
}

/* Info panel tabs */
.info-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.info-tab {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.info-tab:hover { color: var(--text); background: var(--theme-surface-hover); }
.info-tab.active {
    color: var(--theme-main);
    border-bottom-color: var(--theme-main);
}

.info-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Info panel preview thumbnail */
.info-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 160px;
    background: var(--theme-surface-raised);
}
.info-preview i { font-size: 56px; color: var(--text-muted); }
.info-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
}

/* Info panel file name */
.info-file-name {
    padding: 12px 16px 0;
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

/* Star rating in info panel */
.info-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px 16px;
}
.info-rating i {
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}
.info-rating i.active,
.info-rating i:hover { color: var(--warning); }

/* Info details list */
.info-details { padding: 8px 0; }
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px;
    font-size: 12px;
}
.detail-row .label { color: var(--text-muted); }
.detail-row .value { color: var(--text); font-weight: 500; text-align: right; max-width: 60%; word-break: break-all; }

/* Info panel tags */
.info-tags {
    padding: 8px 16px;
}
.info-tags-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--theme-main-subtle);
    color: var(--theme-main);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}
.tag .tag-remove {
    cursor: pointer;
    font-size: 9px;
    opacity: 0.7;
}
.tag .tag-remove:hover { opacity: 1; }

/* Activity in info panel */
.activity-list { padding: 8px 0; }
.activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 16px;
    font-size: 12px;
}
.activity-item .activity-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--theme-surface-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.activity-item .activity-icon i { font-size: 12px; color: var(--text-secondary); }
.activity-text { flex: 1; }
.activity-text strong { font-weight: 600; color: var(--text); }
.activity-time { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

/* Comments in info panel */
.comment-list { padding: 8px 0; }
.comment-item {
    padding: 8px 16px;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--theme-surface-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}
.comment-author { font-size: 12px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 10px; color: var(--text-muted); }
.comment-text { font-size: 12px; color: var(--text-secondary); padding-left: 32px; }

.comment-input-wrap {
    padding: 8px 16px;
    display: flex;
    gap: 8px;
}
.comment-input-wrap input {
    flex: 1;
    padding: 6px 10px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 12px;
}

/* === UPLOAD PANEL === */
.upload-panel {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 340px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 400;
    overflow: hidden;
}
.upload-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--theme-surface-overlay);
    cursor: pointer;
    user-select: none;
}
.upload-panel-header span { font-size: 13px; font-weight: 500; }
.upload-panel-actions { display: flex; gap: 4px; }

.upload-panel-body {
    max-height: 240px;
    overflow-y: auto;
}
.upload-panel-body.collapsed { display: none; }

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
}
.upload-item i { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
.upload-item-info { flex: 1; min-width: 0; }
.upload-filename {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-filesize { font-size: 11px; color: var(--text-muted); }
.upload-bar {
    height: 3px;
    background: var(--theme-surface);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}
.upload-bar-fill {
    height: 100%;
    background: var(--theme-main);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.upload-status { font-size: 11px; flex-shrink: 0; }
.upload-status.success { color: var(--success); }
.upload-status.error { color: var(--danger); }

/* === PREVIEW OVERLAY === */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 800;
    display: flex;
    flex-direction: column;
}
.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    flex-shrink: 0;
}
.preview-filename {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}
.preview-actions { display: flex; gap: 4px; }
.preview-actions .btn-icon { color: rgba(255,255,255,0.7); }
.preview-actions .btn-icon:hover { color: #fff; background: rgba(255,255,255,0.12); }

.preview-nav {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    pointer-events: none;
    z-index: 801;
}
.preview-nav .btn-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    pointer-events: auto;
    backdrop-filter: blur(8px);
}
.preview-nav .btn-icon:hover { background: rgba(255,255,255,0.2); }
.preview-nav .btn-icon i { font-size: 20px; }

.preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 0;
    overflow: auto;
}
.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.preview-content video {
    max-width: 100%;
    max-height: 100%;
}
.preview-content audio {
    width: 400px;
    max-width: 100%;
}
.preview-content .text-preview {
    width: 100%;
    max-width: 800px;
    max-height: 100%;
    overflow: auto;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.preview-content .pdf-preview {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    border-radius: var(--radius);
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--theme-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 460px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.15s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h3 { font-size: 15px; font-weight: 600; }

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    animation: toastIn 0.25s ease-out;
    max-width: 420px;
}
.toast i { font-size: 17px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

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

/* === DRAG & DROP OVERLAY === */
.content.drag-over::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--theme-main-light);
    border: 2px dashed var(--theme-main);
    border-radius: var(--radius);
    z-index: 50;
    pointer-events: none;
}

.drop-zone-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(59,130,246,0.08);
    border: 2px dashed var(--theme-main);
    border-radius: var(--radius);
    z-index: 51;
    pointer-events: none;
    color: var(--theme-main);
}
.drop-zone-hint i { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.drop-zone-hint span { font-size: 15px; font-weight: 500; }

/* === ADMIN PANEL === */
.admin-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.admin-sidebar {
    width: 200px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 8px;
    overflow-y: auto;
    flex-shrink: 0;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
}
.admin-nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.admin-nav-item.active { background: var(--sidebar-active); color: var(--theme-main); }
.admin-nav-item i { font-size: 15px; width: 18px; text-align: center; }

.admin-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.admin-card {
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.admin-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Admin stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.stat-card {
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-card .stat-icon.blue { background: var(--theme-main-light); color: var(--theme-main); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* Admin table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.admin-table tr:hover td { background: var(--theme-surface-hover); }

.role-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.role-badge.admin { background: var(--danger-bg); color: var(--danger); }
.role-badge.user { background: var(--theme-main-light); color: var(--theme-main); }

/* === SHARES === */
.shares-list { padding: 16px; }
.share-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--theme-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.share-item i { font-size: 20px; color: var(--text-muted); }
.share-info { flex: 1; min-width: 0; }
.share-name { font-size: 13px; font-weight: 500; }
.share-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.share-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--theme-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}
.share-link:hover { background: var(--theme-surface-active); }

/* === MOVE/COPY DIALOG - Folder browser === */
.folder-browser {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--theme-surface-raised);
}
.folder-browser-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
}
.folder-browser-item:hover { background: var(--theme-surface-active); }
.folder-browser-item.selected { background: var(--theme-main-subtle); color: var(--theme-main); }
.folder-browser-item i { font-size: 16px; color: var(--folder-color); }

/* === UTILITY CLASSES === */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-primary { color: var(--theme-main) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 260px; z-index: 200; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .content { margin-left: 0 !important; }
    .topbar-center { display: none; }
    .info-panel { position: fixed; right: 0; top: var(--topbar-height); bottom: 0; z-index: 150; box-shadow: var(--shadow-lg); }
    .grid-view .file-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .upload-panel { left: 16px; width: calc(100% - 32px); }
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 190;
}
@media (max-width: 768px) {
    .sidebar.open ~ .sidebar-overlay { display: block; }
}

/* === RENAME INLINE === */
.rename-input {
    background: var(--theme-surface);
    border: 2px solid var(--theme-main);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    color: var(--text);
    font-size: inherit;
    font-family: inherit;
    outline: none;
    width: 100%;
    max-width: 300px;
}

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, var(--theme-surface-raised) 25%, var(--theme-surface-overlay) 50%, var(--theme-surface-raised) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === NOTIFICATION DOT === */
.notification-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

/* === PRINT === */
@media print {
    .topbar, .sidebar, .info-panel, .upload-panel, .context-menu, .modal-overlay, .preview-overlay, .toast-container { display: none !important; }
    .content { margin-left: 0 !important; }
    body { background: #fff; color: #000; }
}
