/* assets/style.css v2.0 - Modern Design */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #7e22ce;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-dark: #0c1425;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #475569;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-search: 20px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
}

[data-theme="light"] {
    --background: #ffffff;
    --surface: #f8fafc;
    --surface-light: #f1f5f9;
    --surface-dark: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}


/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.preloader-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Main App */
#app.hidden {
    display: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Drag & Drop Overlay */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(4px);
    border: 2px dashed var(--primary);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9997;
}

.drag-overlay.active {
    display: flex;
}

.drag-content {
    text-align: center;
    padding: 40px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.drag-content i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.drag-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.drag-content p {
    color: var(--text-secondary);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    min-width: 200px;
    display: none;
    overflow: hidden;
}

.context-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--text-primary);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.context-item:hover {
    background: var(--surface-light);
    border-left-color: var(--primary);
}

.context-item.danger {
    color: var(--danger);
}

.context-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Upload Panel */
.upload-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    overflow: hidden;
    transform: translateY(100%);
    opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
}

.upload-panel.active {
    transform: translateY(0);
    opacity: 1;
}

.upload-header {
    padding: 16px;
    background: var(--surface-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.upload-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.upload-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.upload-close:hover {
    background: var(--surface-light);
}

.upload-list {
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-item:last-child {
    border-bottom: none;
}

.upload-icon {
    width: 32px;
    height: 32px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-info {
    flex: 1;
    min-width: 0;
}

.upload-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-progress {
    height: 4px;
    background: var(--surface-light);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.upload-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.upload-total {
    padding: 16px;
    background: var(--surface-dark);
    border-top: 1px solid var(--border);
}

.upload-progress-bar {
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

#upload-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Upload Modal */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    background: var(--surface-light);
    transition: all var(--transition-fast);
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-zone .btn-primary {
    margin-top: 5px;
    margin-bottom:5px;
    text-align:center;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-zone i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.selected-files {
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 20px;
}

.selected-file {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
    gap: 10px;
}

.selected-file i {
    color: var(--text-secondary);
    width: 20px;
    font-size: 14px;
}

.selected-file .file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.selected-file .file-size {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.selected-file .file-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.selected-file .file-remove:hover {
    background: var(--surface-dark);
    color: var(--danger);
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 36px;
    width: auto;
}

/* Мобильные кнопки (изначально скрыты на десктопе) */
.mobile-search-toggle,
.mobile-sort-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-search-toggle:hover,
.mobile-sort-toggle:hover {
    background: var(--surface-light);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 20px;
    transition: all 0.3s ease;
}

/* Состояние поиска (активируется по кнопке) */
.header-search-active .header-left .logo,
.header-search-active .header-right .mobile-sort-toggle,
.header-search-active .header-right .user-dropdown,
.header-search-active .header-right .btn-primary,
.header-search-active .header-right .mobile-search-toggle {
    display: none !important;
}

.header-search-active .header-center {
    max-width: 100%;
    margin: 0;
}

.header-search-active .search-box {
    width: 100%;
}

/* Search Box */
.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 10px 48px 10px 40px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-search);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.search-clear:hover {
    background: var(--surface-light);
}

.search-box input:valid + .search-clear {
    display: flex;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.user-btn:hover {
    background: var(--surface-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#username {
    font-size: 14px;
    font-weight: 500;
}

.user-btn i:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.user-menu.show {
    display: block;
}

.user-info {
    padding: 20px;
    background: var(--surface-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-details p {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-menu-items {
    padding: 8px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    transition: background var(--transition-fast);
    cursor: pointer;
}

.user-menu-item:hover {
    background: var(--surface-light);
}

.user-menu-item.logout {
    color: var(--danger);
}

.user-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* Storage Info */
.storage-info {
    background: var(--surface-dark);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}

.storage-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--surface-light);
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.storage-details p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.storage-details strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Quick Access */
.quick-access {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quick-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.quick-item:hover {
    background: var(--surface-light);
}

.quick-item i {
    width: 20px;
    color: var(--text-secondary);
}

/* Filters */
.filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Folder Info Section */
.folder-info-panel {
    background: var(--surface-dark);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.folder-info-panel strong {
    color: var(--text-primary);
}
.folder-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.folder-stat:last-child {
    margin-bottom: 0;
}
.folder-stat i {
    color: var(--primary);
    width: 20px;
}
.stat-details {
    flex: 1;
}
.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.stat-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--background);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.breadcrumb:hover {
    color: var(--text-primary);
}

.breadcrumb::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-muted);
}

.breadcrumb:last-child::after {
    content: '';
}

.selected-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--surface-light);
    border-radius: var(--radius);
    font-size: 14px;
}

.selected-info.hidden {
    display: none;
}

#selected-count {
    font-weight: 500;
}

.btn-clear-selection {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: color var(--transition-fast);
}

.btn-clear-selection:hover {
    color: var(--text-primary);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Кнопка обновления */
.btn-refresh {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.btn-refresh:hover {
    background: var(--surface-light);
}

.view-controls {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

.sort-select {
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Actions Bar */
.actions-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actions-bar.hidden {
    display: none;
}

.actions-left, .actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.actions-bar,
.selected-info {
    display: none !important;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--surface-light);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--surface-dark);
}

.action-btn.danger {
    color: var(--danger);
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* File Area */
.file-area {
    min-height: 400px;
    position: relative;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* File Grid View */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.file-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.file-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.file-item.selected {
    border-color: var(--primary);
    background: var(--surface-light);
}

.file-preview {
    height: 120px;
    background: var(--surface-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.file-preview i {
    font-size: 48px;
    color: var(--text-secondary);
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.file-info {
    padding: 12px;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Modern Checkbox */
.checkbox-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.modern-checkbox {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}
.checkbox-wrapper label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
}
.checkbox-wrapper label::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
    margin-top: -1px;
}
.modern-checkbox:checked + label {
    background: var(--primary);
    border-color: var(--primary);
}
.modern-checkbox:checked + label::after {
    transform: rotate(45deg) scale(1);
}

/* File List View */
.file-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.file-list table {
    width: 100%;
    border-collapse: collapse;
}

.file-list th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-dark);
    border-bottom: 1px solid var(--border);
}

.file-list td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.file-list tr:last-child td {
    border-bottom: none;
}

.file-list tr:hover {
    background: var(--surface-light);
}

.file-list tr.selected {
    background: var(--surface-light);
}

.col-checkbox {
    width: 50px;
}

.col-name {
    width: 35%;
}

.col-size {
    width: 15%;
}

.col-modified {
    width: 20%;
}

.col-type {
    width: 15%;
}

.col-actions {
    width: 10%;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 20px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.modal-footer .btn-primary,
.upload-zone .btn-primary {
    width: auto;
    height: auto;
    padding: 10px 20px;
}

.btn-secondary {
    padding: 8px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--surface-light);
}

.btn-danger {
    padding: 8px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Profile Modal */
.profile-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.avatar-upload-section {
    text-align: center;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--surface-dark);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--primary);
    overflow: hidden;
}

.avatar-preview i {
    font-size: 48px;
    color: var(--text-secondary);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Security Modal */
.sessions-list, .devices-list, .logs-list {
    max-height: 400px;
    overflow-y: auto;
}

.session-item, .device-item, .log-item {
    padding: 14px;
    background: var(--surface-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}
.session-info, .device-info, .log-info {
    flex: 1;
}
.session-device, .device-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}
.session-location, .session-time, .device-browser, .device-last, .log-time, .log-details, .log-footer {
    font-size: 12px;
    color: var(--text-secondary);
}
.log-action {
    font-size: 13px;
    font-weight: 600;
    margin: 4px 0;
}
.log-action.login { color: var(--success); }
.log-action.logout { color: var(--info); }
.log-action.error { color: var(--danger); }
.btn-logout-session, .btn-remove-device {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.btn-logout-session:hover, .btn-remove-device:hover {
    background: var(--surface-dark);
    color: var(--danger);
}
.empty-message {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

/* Мобильное меню сортировки */
.sort-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 20px;
}

.sort-menu.active {
    transform: translateY(0);
}

.sort-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sort-menu-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.sort-menu-close:hover {
    background: var(--surface-light);
}

.sort-item {
    padding: 15px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sort-item:last-child {
    border-bottom: none;
}

.sort-item:hover {
    background: var(--surface-light);
}

.sort-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--primary);
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.notification.error .notification-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.notification.warning .notification-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.notification.info .notification-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--surface-light);
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-control[readonly] {
    background: var(--surface-light);
    cursor: not-allowed;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .search-box {
        width: 400px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
    }
    
    .search-box {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 16px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .logo img {
        height: 60px;
        padding-top:2px;
    }
    
    .mobile-search-toggle,
    .mobile-sort-toggle {
        display: flex;
    }
    
    .header-center {
        max-width: 0;
        overflow: hidden;
        margin: 0;
        opacity: 0;
    }
    
    .header-search-active .header-center {
        max-width: 100%;
        opacity: 1;
    }
    
    .sort-select {
        display: none;
    }
    
    .btn-primary .upload-text {
        display: none;
    }
    
    .btn-primary {
        padding: 10px;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
    
    .btn-primary i {
        margin: 0;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    /* Увеличение области касания для чекбоксов */
    .checkbox-wrapper label {
        width: 20px;
        height: 20px;
    }
    
    .checkbox-wrapper .modern-checkbox:checked + label::after {
        left: 6px;
        top: 2px;
    }
}

@media (max-width: 576px) {
    .user-btn span {
        display: none;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* QR Scanner Modal */
#qr-scanner-modal .modal-content {
    max-width: 400px;
}

#qr-reader {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    background: #000;
}

#qr-reader video {
    width: 100%;
    height: auto;
}

/* Улучшенный QR-слайдер */
.qr-confirm-card {
    background: var(--surface-dark);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.qr-confirm-warning {
    color: var(--warning);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.qr-confirm-warning i {
    font-size: 36px;
}

.qr-confirm-warning p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.qr-confirm-slider-container {
    margin: 0 auto;
    max-width: 300px;
    user-select: none;
}

.qr-slider-track {
    position: relative;
    height: 56px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
    cursor: pointer;
}

.qr-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 28px 0 0 28px;
    transition: width 0.1s ease;
}

.qr-slider-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.1s ease;
    z-index: 2;
}

.qr-slider-thumb i {
    color: #16a34a;
    font-size: 20px;
    transition: transform 0.2s;
}

.qr-slider-label {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.qr-slider-container.swiping .qr-slider-thumb {
    transition: none;
}
.qr-slider-container.swiping .qr-slider-fill {
    transition: none;
}
.qr-slider-container.confirmed .qr-slider-thumb {
    left: calc(100% - 52px) !important;
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.qr-slider-container.confirmed .qr-slider-fill {
    width: 100% !important;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #16a34a;
}
.qr-slider-container.confirmed .qr-slider-label {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-5px); }
}

/* Скрытие сканера QR на десктопах */
@media (min-width: 769px) {
    .user-menu-item[data-action="scan-qr"] {
        display: none !important;
    }
    #qr-scanner-modal {
        display: none !important;
    }
}
.file-preview img,
.file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}