/* ===== WixDrive CSS - Modern Cloud Storage UI ===== */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #60a5fa;
    --accent: #3b82f6;
    --gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 65px;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
    --card-radius: 16px;
    --body-bg: #f0f2f5;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --sidebar-hover: rgba(59, 130, 246, 0.1);
    --sidebar-active: rgba(59, 130, 246, 0.15);
    --topbar-bg: rgba(255, 255, 255, 0.8);
    --input-bg: rgba(255, 255, 255, 0.9);
    --table-hover: rgba(59, 130, 246, 0.05);
    --drop-zone-bg: rgba(59, 130, 246, 0.05);
    --drop-zone-border: rgba(59, 130, 246, 0.3);
}

[data-bs-theme="dark"] {
    --glass-bg: rgba(30, 30, 45, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --body-bg: #0f0f1a;
    --text-primary: #e8e8f0;
    --text-secondary: #9ca3af;
    --sidebar-bg: rgba(20, 20, 35, 0.9);
    --sidebar-hover: rgba(59, 130, 246, 0.15);
    --sidebar-active: rgba(59, 130, 246, 0.2);
    --topbar-bg: rgba(20, 20, 35, 0.85);
    --input-bg: rgba(30, 30, 45, 0.9);
    --table-hover: rgba(59, 130, 246, 0.08);
    --drop-zone-bg: rgba(59, 130, 246, 0.08);
    --drop-zone-border: rgba(59, 130, 246, 0.4);
}

/* ===== Base Styles ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; }

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

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 30%, transparent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--primary) 50%, transparent); }

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
    min-height: var(--topbar-height);
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 24px;
    height: 24px;
    filter: brightness(10);
}

.sidebar-brand h5 {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.sidebar-nav .nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    padding: 0.75rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-storage {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-storage .progress {
    height: 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.sidebar-storage .progress-bar {
    background: var(--gradient);
    border-radius: 3px;
}

.storage-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.storage-label i {
    font-size: 0.85rem;
    color: var(--primary);
}

.sidebar-storage small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ===== Topbar ===== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: none;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--glass-border);
    font-size: 1.1rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--sidebar-hover);
    border-color: var(--primary);
}

.topbar-title h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.topbar-title small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.topbar-btn:hover {
    background: var(--sidebar-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* Color Picker Dropdown */
.color-picker-dropdown {
    min-width: 200px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--glass-bg), 0 0 0 4px var(--text-primary);
}

.color-swatch.active::after {
    content: '\f26e';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.topbar-user:hover {
    border-color: var(--primary);
    background: var(--sidebar-hover);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.dropdown-menu .dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.25rem;
}

.dropdown-menu .dropdown-header .fw-semibold {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.dropdown-menu .dropdown-header small {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.topbar .dropdown-toggle::after { display: none; }

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-wrapper {
    padding: 1.5rem;
    width: 100%;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.glass-card .card-title {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Stat Cards ===== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon-wrap.files-stat { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.stat-icon-wrap.storage-stat { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon-wrap.users-stat { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.stat-icon-wrap.shared-stat { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-footer {
    padding: 0.65rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-card-footer a {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--primary);
    transition: all 0.2s;
}

.stat-card-footer a:hover {
    color: var(--primary-dark);
}

.stat-card-footer small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
}

/* Mini progress bars */
.mini-progress {
    height: 5px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    flex: 1;
    overflow: hidden;
}

.mini-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--gradient);
    transition: width 0.6s ease;
}

/* ===== Welcome Banner ===== */
.welcome-banner {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient) !important;
    border: none !important;
}

.welcome-banner * {
    color: #fff !important;
}

.welcome-content h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.welcome-content p {
    opacity: 0.85;
    margin: 0;
    font-size: 0.9rem;
}

.welcome-illustration i {
    font-size: 3rem;
    opacity: 0.3;
}

/* ===== Card Header Custom ===== */
.card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.btn-primary-soft {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    transition: all 0.2s;
}

.btn-primary-soft:hover {
    background: color-mix(in srgb, var(--primary) 20%, transparent);
    color: var(--primary);
}

/* ===== Storage Progress ===== */
.storage-progress-wrap {
    padding: 0;
}

.storage-progress {
    height: 12px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.8s ease;
}

.storage-bar-fill span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
}

/* ===== File Name Cell ===== */
.file-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary);
    flex-shrink: 0;
}

.file-name-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.88rem;
}

/* ===== Activity Styles ===== */
.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== Tables ===== */
.table {
    --bs-table-bg: transparent;
    color: var(--text-primary);
}

.table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: var(--table-hover);
}

/* ===== File Manager ===== */
.fm-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.fm-search {
    position: relative;
    min-width: 200px;
}

.fm-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}

.fm-search .form-control {
    padding-left: 2.25rem;
    border-radius: 10px;
    background: var(--glass-bg);
    border-color: var(--glass-border);
    font-size: 0.85rem;
}

.fm-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* Folder Cards */
.fm-folder-card {
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fm-folder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.15);
}

.fm-folder-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.fm-folder-link:hover { color: inherit; }

.fm-folder-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    background: rgba(245, 158, 11, 0.08);
    font-size: 3.5rem;
    color: #f59e0b;
}

.fm-folder-card .fm-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.fm-folder-card:hover .fm-item-actions {
    opacity: 1;
}

/* Drag & Drop */
.fm-file-card[draggable="true"],
#fileList tr[draggable="true"] {
    cursor: grab;
}
.fm-file-card[draggable="true"]:active,
#fileList tr[draggable="true"]:active {
    cursor: grabbing;
}
.fm-dragging {
    opacity: 0.4 !important;
}
.fm-folder-card.fm-drop-ready {
    outline: 2px dashed rgba(99, 102, 241, 0.3);
    outline-offset: -2px;
}
.fm-folder-card.fm-drop-hover {
    outline: 2px solid var(--accent, #6366f1);
    outline-offset: -2px;
    background: rgba(99, 102, 241, 0.1) !important;
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

/* (folder-link, folder-preview moved above with folder-card) */

/* ===== File Cards — Uniform Size ===== */
.fm-file-card {
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.file-item {
    display: flex;
}

.file-item .fm-file-card {
    width: 100%;
}

.fm-file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.15);
}

.fm-file-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.fm-file-card:hover .fm-file-check {
    opacity: 1;
}

.fm-file-card.selected .fm-file-check {
    opacity: 1;
}

.fm-file-card.selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.fm-file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.fm-file-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Extension-based type badge */
.fm-type-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 0.4rem;
}

.fm-type-badge i {
    font-size: 2.6rem;
    line-height: 1;
}

.fm-ext-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Type colors with background tints */
.fm-type-badge.image { background: rgba(16, 185, 129, 0.08); }
.fm-type-badge.image i { color: #10b981; }
.fm-type-badge.image .fm-ext-label { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.fm-type-badge.pdf { background: rgba(239, 68, 68, 0.08); }
.fm-type-badge.pdf i { color: #ef4444; }
.fm-type-badge.pdf .fm-ext-label { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.fm-type-badge.doc { background: rgba(59, 130, 246, 0.08); }
.fm-type-badge.doc i { color: #3b82f6; }
.fm-type-badge.doc .fm-ext-label { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

.fm-type-badge.video { background: rgba(139, 92, 246, 0.08); }
.fm-type-badge.video i { color: #8b5cf6; }
.fm-type-badge.video .fm-ext-label { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.fm-type-badge.audio { background: rgba(245, 158, 11, 0.08); }
.fm-type-badge.audio i { color: #f59e0b; }
.fm-type-badge.audio .fm-ext-label { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.fm-type-badge.archive { background: rgba(99, 102, 241, 0.08); }
.fm-type-badge.archive i { color: #6366f1; }
.fm-type-badge.archive .fm-ext-label { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.fm-type-badge.code { background: rgba(6, 182, 212, 0.08); }
.fm-type-badge.code i { color: #06b6d4; }
.fm-type-badge.code .fm-ext-label { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.fm-type-badge.default { background: rgba(107, 114, 128, 0.08); }
.fm-type-badge.default i { color: #6b7280; }
.fm-type-badge.default .fm-ext-label { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.fm-file-details {
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.fm-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.fm-file-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fm-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.5;
}

.fm-item-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}

.fm-file-card:hover .fm-item-actions,
.fm-folder-card:hover .fm-item-actions {
    opacity: 1;
}

/* ===== Right-Click Context Menu ===== */
.fm-context-menu {
    display: none;
    position: fixed;
    z-index: 9999;
    min-width: 200px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 0.4rem;
    animation: ctxFadeIn 0.15s ease;
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.fm-context-menu.show {
    display: block;
}

.fm-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-context-menu li.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.3rem 0.5rem;
}

.fm-context-menu li a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s;
}

.fm-context-menu li a:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
}

.fm-context-menu li a.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.fm-context-menu li a i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* Empty State */
.fm-empty {
    padding: 3.5rem 2rem;
    text-align: center;
    border-radius: 16px;
}

.fm-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(96, 165, 250, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.fm-empty-icon i {
    font-size: 2.2rem;
    color: var(--primary);
}

.fm-empty h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.fm-empty p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

/* Table View */
.fm-table {
    font-size: 0.88rem;
}

.fm-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
    background: transparent;
}

.fm-table tbody td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
    border-color: var(--glass-border);
}

.fm-table tbody tr:hover {
    background: var(--table-hover);
}

.fm-table-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.fm-table-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.fm-table-icon.image { color: #10b981; }
.fm-table-icon.pdf { color: #ef4444; }
.fm-table-icon.doc { color: #3b82f6; }
.fm-table-icon.video { color: #8b5cf6; }
.fm-table-icon.audio { color: #f59e0b; }
.fm-table-icon.archive { color: #6366f1; }
.fm-table-icon.code { color: #06b6d4; }
.fm-table-icon.default { color: var(--text-secondary); }

.fm-table-name a {
    color: var(--text-primary);
    font-weight: 500;
}

.fm-table-name a:hover {
    color: var(--primary);
}

/* File Info Modal */
.fm-info-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.6rem 1rem;
    font-size: 0.9rem;
}

.fm-info-grid dt {
    color: var(--text-secondary);
    font-weight: 500;
}

.fm-info-grid dd {
    margin: 0;
    font-weight: 600;
    word-break: break-all;
}

/* ===== Settings Panel ===== */
.fm-settings-panel {
    width: 340px !important;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
}

.fm-settings-panel .offcanvas-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
}

.fm-settings-panel .offcanvas-title {
    font-size: 1rem;
    font-weight: 700;
}

.fm-settings-panel .offcanvas-body {
    padding: 1rem 1.25rem;
}

.fm-setting-group {
    margin-bottom: 1.25rem;
}

.fm-setting-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.fm-range-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
    white-space: nowrap;
}

/* Card Size Buttons */
.fm-size-options {
    display: flex;
    gap: 0.5rem;
}

.fm-size-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    border: 2px solid var(--glass-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
}

.fm-size-btn i {
    font-size: 1.3rem;
}

.fm-size-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.fm-size-btn.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

/* Card Style Grid */
.fm-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.fm-style-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem;
    border-radius: 10px;
    border: 2px solid var(--glass-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
}

.fm-style-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.fm-style-btn.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}

.fm-style-preview {
    width: 100%;
    height: 32px;
    border-radius: 6px;
}

.glass-preview {
    background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.solid-preview {
    background: var(--card-bg, #f8f9fa);
    border: 1px solid transparent;
}

.outline-preview {
    background: transparent;
    border: 2px solid var(--glass-border);
}

.minimal-preview {
    background: transparent;
    border: 1px dashed var(--glass-border);
}

/* Toggle List */
.fm-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fm-toggle-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.35rem 0;
}

.fm-toggle-item .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

/* Card Style Variations */
.fm-file-card.style-solid {
    background: var(--card-bg, #fff) !important;
    backdrop-filter: none !important;
    border: 1px solid var(--glass-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.fm-file-card.style-outline {
    background: transparent !important;
    backdrop-filter: none !important;
    border: 2px solid var(--glass-border);
    box-shadow: none;
}

.fm-file-card.style-outline:hover {
    border-color: var(--primary);
    box-shadow: none;
}

.fm-file-card.style-minimal {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none;
    border-radius: 8px !important;
    box-shadow: none;
}

.fm-file-card.style-minimal .fm-file-preview {
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.fm-file-card.style-minimal:hover {
    background: var(--sidebar-hover) !important;
    box-shadow: none;
    transform: none;
}

/* Card Size Presets */
.file-grid-small .file-item { flex: 0 0 calc(100%/7); max-width: calc(100%/7); }
.file-grid-small .fm-file-preview { height: 90px; }
.file-grid-small .fm-type-badge i { font-size: 1.8rem; }
.file-grid-small .fm-ext-label { font-size: 0.55rem; padding: 0.1rem 0.4rem; }
.file-grid-small .fm-file-name { font-size: 0.72rem; }
.file-grid-small .fm-file-meta { font-size: 0.65rem; }

.file-grid-large .file-item { flex: 0 0 25%; max-width: 25%; }
.file-grid-large .fm-file-preview { height: 200px; }
.file-grid-large .fm-type-badge i { font-size: 3.4rem; }
.file-grid-large .fm-ext-label { font-size: 0.75rem; padding: 0.2rem 0.65rem; }
.file-grid-large .fm-file-name { font-size: 0.92rem; }
.file-grid-large .fm-file-meta { font-size: 0.78rem; }

/* ===== Upload Progress ===== */
.upload-progress-wrapper {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 400px;
    z-index: 1060;
    background: var(--glass-bg, rgba(255,255,255,0.95));
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
    background: var(--glass-bg, rgba(255,255,255,0.6));
}

.upload-progress-header .upload-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-upload-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.btn-upload-toggle:hover {
    background: var(--sidebar-hover, rgba(0,0,0,0.06));
}

.upload-progress-wrapper.collapsed .upload-progress-list {
    display: none;
}

.upload-progress-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.upload-item {
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.35rem;
    background: var(--sidebar-hover, rgba(0,0,0,0.02));
    transition: background 0.2s;
}

.upload-item:last-child {
    margin-bottom: 0;
}

.upload-progress-bar-wrap {
    position: relative;
    height: 22px;
    border-radius: 11px;
    background: var(--border-color, rgba(0,0,0,0.08));
    overflow: hidden;
    margin-top: 0.3rem;
}

.upload-progress-bar {
    height: 100%;
    border-radius: 11px;
    background: linear-gradient(90deg, var(--primary, #3b82f6), var(--secondary, #60a5fa));
    transition: width 0.25s ease;
    min-width: 0;
}

.upload-progress-bar.success {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.upload-progress-bar.error {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.upload-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    pointer-events: none;
    letter-spacing: 0.3px;
}

.upload-speed-info {
    font-size: 0.68rem;
    margin-top: 0.2rem;
    color: var(--text-secondary);
    text-align: right;
}

.upload-item .upload-name {
    font-size: 0.82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    display: inline-block;
}

.upload-item .upload-status {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-upload-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    line-height: 1;
}

.btn-upload-cancel:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* ===== Upload Success Popup ===== */
.upload-success-popup {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.upload-success-popup.show {
    opacity: 1;
    pointer-events: auto;
}
.upload-success-content {
    background: var(--glass-bg, #fff);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.08));
    border-radius: 20px;
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.8);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.upload-success-popup.show .upload-success-content {
    transform: scale(1);
}
.upload-success-icon {
    font-size: 3.5rem;
    color: #22c55e;
    margin-bottom: 0.75rem;
    line-height: 1;
}
.upload-success-content h5 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}
.upload-success-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* ===== Ghost Button ===== */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

/* ===== Glass Modal ===== */
.glass-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    position: relative;
}

/* Floating Save Button */
#previewSaveBtn {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 10;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
#previewSaveBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
}

/* ===== File Card Extensions ===== */
.file-card .file-select {
    position: absolute;
    top: 10px;
    left: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.file-card:hover .file-select {
    opacity: 1;
}

.file-card .file-preview {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    cursor: pointer;
}

.file-card .file-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.file-card .file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-actions {
    opacity: 1;
}

.file-thumb {
    width: 100%;
    max-height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* ===== Folder Card Link ===== */
.folder-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.folder-link:hover {
    color: inherit;
}

.folder-card .file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.folder-card .file-info .file-name {
    font-weight: 600;
}

.folder-card .file-actions {
    flex-shrink: 0;
}

/* ===== File Icon Small ===== */
.file-icon-sm {
    font-size: 1.1rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    color: var(--primary);
}

/* ===== Upload Area ===== */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--drop-zone-bg, transparent);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.upload-prompt i {
    font-size: 3rem;
    color: var(--primary);
}

.upload-prompt h5 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* ===== Breadcrumb ===== */
.file-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.file-breadcrumb a,
.file-breadcrumb span {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.file-breadcrumb a {
    color: var(--primary);
}

.file-breadcrumb a:hover {
    background: var(--sidebar-hover);
}

.file-breadcrumb .separator {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ===== Modals ===== */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
}

/* ===== Forms ===== */
.form-control,
.form-select {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    background: var(--input-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
}

.form-floating > .form-control,
.form-floating > .form-select {
    border-radius: 10px;
}

.form-floating > label {
    color: var(--text-secondary);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--gradient);
    border: none;
    border-radius: 10px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #6b3fa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: 10px;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== Badges ===== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* ===== Storage Progress ===== */
.storage-widget .progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.1);
}

.storage-widget .progress-bar {
    background: var(--gradient);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ===== Toast ===== */
.toast-container {
    z-index: 1090;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 30%, #0f3460 60%, #1a1a2e 100%);
    background-size: 300% 300%;
    animation: authGradient 16s ease infinite;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

@keyframes authGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating cloud shapes */
.auth-cloud {
    position: absolute;
    color: rgba(255, 255, 255, 0.04);
    z-index: 0;
    pointer-events: none;
}

.auth-cloud-1 {
    width: 220px;
    top: 8%;
    left: 5%;
    animation: cloudDrift1 25s linear infinite;
}

.auth-cloud-2 {
    width: 160px;
    top: 65%;
    right: -160px;
    animation: cloudDrift2 30s linear infinite;
}

.auth-cloud-3 {
    width: 100px;
    top: 30%;
    right: 15%;
    color: rgba(59, 130, 246, 0.06);
    animation: cloudDrift3 20s linear infinite;
}

.auth-cloud-4 {
    width: 280px;
    bottom: 10%;
    left: -280px;
    animation: cloudDrift2 35s linear infinite 5s;
}

.auth-cloud-5 {
    width: 120px;
    top: 15%;
    right: -120px;
    color: rgba(59, 130, 246, 0.04);
    animation: cloudDrift2 22s linear infinite 8s;
}

@keyframes cloudDrift1 {
    0% { transform: translateX(0); }
    50% { transform: translateX(40px); }
    100% { transform: translateX(0); }
}

@keyframes cloudDrift2 {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 300px)); }
}

@keyframes cloudDrift3 {
    0% { transform: translateX(0) translateY(0); }
    33% { transform: translateX(-30px) translateY(-15px); }
    66% { transform: translateX(20px) translateY(10px); }
    100% { transform: translateX(0) translateY(0); }
}

/* Sparkle particles */
.auth-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.6);
    z-index: 0;
    pointer-events: none;
}

.auth-particle-1 {
    top: 20%; left: 20%;
    animation: particlePulse 3s ease-in-out infinite, particleFloat 8s ease-in-out infinite;
}
.auth-particle-2 {
    top: 70%; left: 75%;
    width: 3px; height: 3px;
    background: rgba(96, 165, 250, 0.5);
    animation: particlePulse 4s ease-in-out infinite 1s, particleFloat 10s ease-in-out infinite 2s;
}
.auth-particle-3 {
    top: 35%; right: 10%;
    width: 5px; height: 5px;
    background: rgba(255, 255, 255, 0.3);
    animation: particlePulse 2.5s ease-in-out infinite 0.5s, particleFloat 7s ease-in-out infinite 1s;
}
.auth-particle-4 {
    top: 80%; left: 15%;
    width: 3px; height: 3px;
    background: rgba(59, 130, 246, 0.4);
    animation: particlePulse 3.5s ease-in-out infinite 2s, particleFloat 9s ease-in-out infinite 3s;
}
.auth-particle-5 {
    top: 10%; right: 25%;
    width: 6px; height: 6px;
    background: rgba(255, 255, 255, 0.15);
    animation: particlePulse 5s ease-in-out infinite 1.5s, particleFloat 12s ease-in-out infinite;
}
.auth-particle-6 {
    top: 50%; left: 40%;
    width: 3px; height: 3px;
    background: rgba(96, 165, 250, 0.3);
    animation: particlePulse 3s ease-in-out infinite 3s, particleFloat 6s ease-in-out infinite 4s;
}

@keyframes particlePulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.8); }
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, -20px); }
    50% { transform: translate(-10px, -35px); }
    75% { transform: translate(20px, -15px); }
}

/* Auth card */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 520px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    position: relative;
    z-index: 1;
    animation: authCardIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    overflow: hidden;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

[data-bs-theme="dark"] .auth-card {
    background: rgba(18, 18, 32, 0.92);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* Cloud Banner */
.auth-cloud-banner {
    position: relative;
    height: 160px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-cloud-banner .banner-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
    top: -60px;
    right: -40px;
    animation: bannerGlow 4s ease-in-out infinite;
}

@keyframes bannerGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.auth-cloud-banner .banner-clouds {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.auth-cloud-banner .banner-cloud {
    position: absolute;
    color: rgba(255, 255, 255, 0.2);
}

.auth-cloud-banner .banner-cloud-lg {
    width: 180px;
    bottom: -20px;
    left: -30px;
    color: rgba(255, 255, 255, 0.15);
    animation: bannerCloudFloat 8s ease-in-out infinite;
}

.auth-cloud-banner .banner-cloud-sm {
    width: 90px;
    top: 10px;
    right: 20px;
    color: rgba(255, 255, 255, 0.12);
    animation: bannerCloudFloat 6s ease-in-out infinite 1s;
}

.auth-cloud-banner .banner-cloud-md {
    width: 130px;
    bottom: 5px;
    right: -20px;
    color: rgba(255, 255, 255, 0.1);
    animation: bannerCloudFloat 7s ease-in-out infinite 2s;
}

@keyframes bannerCloudFloat {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(10px) translateY(-8px); }
}

.auth-cloud-banner .banner-icon {
    position: relative;
    z-index: 2;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: bannerIconFloat 3s ease-in-out infinite;
}

@keyframes bannerIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Card body */
.auth-card-body {
    padding: 2rem 2.25rem 2.25rem;
}

.auth-card .brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-card .brand h3 {
    font-size: 1.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

[data-bs-theme="dark"] .auth-card .brand h3 {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
}

.auth-card .brand .tagline {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
}

/* Form inputs */
.auth-card .form-floating .form-control {
    border-radius: 14px;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    padding: 1.625rem 1.15rem 0.625rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    height: calc(3.5rem + 2px);
}

.auth-card .form-floating .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent);
    background: #fff;
}

[data-bs-theme="dark"] .auth-card .form-floating .form-control:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
}

.auth-card .form-floating label {
    padding: 1rem 1.15rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.auth-card .form-floating > .form-control:focus ~ label,
.auth-card .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.8) translateY(-0.6rem);
    opacity: 0.75;
}

/* Auth button */
.auth-card .btn-auth {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #fff;
    padding: 0.85rem 1.5rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 30%, transparent);
}

.auth-card .btn-auth::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.auth-card .btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 40%, transparent);
    color: #fff;
}

.auth-card .btn-auth:hover::before {
    opacity: 1;
}

.auth-card .btn-auth:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

.auth-card .btn-auth i,
.auth-card .btn-auth span {
    position: relative;
    z-index: 1;
}

/* Password toggle */
.input-password-wrap {
    position: relative;
}

.input-password-wrap .form-floating {
    flex: 1;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 1.1rem;
    transition: color 0.2s;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Auth divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

/* Auth links */
.auth-card .auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.auth-card .auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.auth-card .auth-link:hover {
    color: var(--primary-dark);
}

.auth-card .auth-link:hover::after {
    width: 100%;
}

/* Auth footer */
.auth-card .auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.auth-card .auth-footer p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin: 0;
}

/* Theme toggle floating */
.theme-toggle-auth {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.theme-toggle-auth:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(20deg) scale(1.08);
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    margin-top: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
}

.password-strength .strength-bar {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-strength .strength-bar.weak { width: 25%; background: #ef4444; }
.password-strength .strength-bar.fair { width: 50%; background: #f59e0b; }
.password-strength .strength-bar.good { width: 75%; background: var(--primary); }
.password-strength .strength-bar.strong { width: 100%; background: #10b981; }

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    transition: color 0.3s;
}

/* Auth card feature list */
.auth-features {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-features .feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-features .feature-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent), color-mix(in srgb, var(--secondary) 8%, transparent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-features .feature-item i {
    font-size: 1rem;
    color: var(--primary);
}

[data-bs-theme="dark"] .auth-features {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .auth-features .feature-icon-wrap {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 15%, transparent), color-mix(in srgb, var(--secondary) 10%, transparent));
}

/* Form check in auth */
.auth-card .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.auth-card .form-check-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
/* ===== Profile Page ===== */
.avatar-upload {
    position: relative;
    display: inline-block;
}

.avatar-upload img,
.avatar-upload .avatar-placeholder-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--glass-border);
}

.avatar-placeholder-lg {
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
}

.avatar-upload .avatar-edit {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: 3px solid var(--body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.avatar-upload .avatar-edit:hover {
    transform: scale(1.1);
}

/* ===== Preview Modal ===== */
#previewModal .modal-dialog {
    transition: none;
}
#previewModal .modal-header {
    cursor: grab;
    user-select: none;
}
#previewModal .modal-header.dragging {
    cursor: grabbing;
}
.preview-container {
    max-height: 70vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 1rem;
}

.preview-container img {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 8px;
}

/* Video Player - YouTube-like */
.preview-video-player {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50vh;
    max-height: 80vh;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
    contain: layout paint;
}

.preview-video-player video {
    width: 100%;
    max-height: 80vh;
    display: block;
    outline: none;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
    image-rendering: auto;
    object-fit: contain;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.preview-video-player video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.preview-container video {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 8px;
}

.preview-container iframe {
    width: 100%;
    height: 65vh;
    border: none;
    border-radius: 8px;
}

/* Image Viewer with Zoom */
.preview-image-viewer {
    width: 100%;
    height: 70vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.04);
    background-image:
        linear-gradient(45deg, rgba(0,0,0,0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0,0,0,0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.03) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    cursor: grab;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

[data-bs-theme="dark"] .preview-image-viewer {
    background-color: rgba(0, 0, 0, 0.3);
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.03) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.03) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.preview-image-viewer img {
    transform-origin: center center;
    transition: none;
    pointer-events: none;
    max-width: none;
    max-height: none;
}

.preview-image-viewer:active {
    cursor: grabbing;
}

/* PDF Viewer */
.preview-pdf-viewer {
    width: 100%;
    height: 70vh;
    overflow: auto;
    background: #525659;
    display: flex;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.preview-pdf-viewer.panning {
    cursor: grabbing;
}

.preview-pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.preview-pdf-canvas {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Word Document Preview */
.preview-docx-viewer {
    max-height: 70vh;
    overflow: auto;
    padding: 2rem 2.5rem;
    background: #fff;
    color: #1a1a2e;
    font-family: 'Segoe UI', 'Calibri', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
}

.preview-docx-viewer[contenteditable="true"] {
    outline: none;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.preview-docx-viewer[contenteditable="true"]:focus {
    border-color: var(--primary);
}

/* Editable Excel */
.preview-xlsx-viewer .xlsx-table td[contenteditable="true"] {
    cursor: text;
    outline: none;
    min-width: 50px;
}
.preview-xlsx-viewer .xlsx-table td[contenteditable="true"]:focus {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: inset 0 0 0 2px var(--primary);
}
[data-bs-theme="dark"] .preview-xlsx-viewer .xlsx-table td[contenteditable="true"]:focus {
    background: rgba(59, 130, 246, 0.15);
}

/* Editor Toolbar */
.preview-edit-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0.4rem 0.75rem;
    background: var(--glass-bg, rgba(255,255,255,0.95));
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.08));
    flex-wrap: wrap;
}
.preview-edit-toolbar .toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border-color, rgba(0,0,0,0.12));
    margin: 0 4px;
}
.preview-edit-toolbar button {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
    line-height: 1;
}
.preview-edit-toolbar button:hover {
    background: var(--sidebar-hover, rgba(0,0,0,0.06));
}
.preview-edit-toolbar button.active {
    background: var(--primary);
    color: #fff;
}

[data-bs-theme="dark"] .preview-docx-viewer {
    background: #1e1e2e;
    color: #e2e8f0;
}

.preview-docx-viewer h1 { font-size: 1.8rem; font-weight: 700; margin: 1.2rem 0 0.6rem; }
.preview-docx-viewer h2 { font-size: 1.5rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.preview-docx-viewer h3 { font-size: 1.25rem; font-weight: 600; margin: 0.8rem 0 0.4rem; }
.preview-docx-viewer h4 { font-size: 1.1rem; font-weight: 600; margin: 0.7rem 0 0.35rem; }
.preview-docx-viewer p { margin: 0.3rem 0; }
.preview-docx-viewer .docx-empty { margin: 0; line-height: 0.8; }
.preview-docx-viewer .docx-title { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: 0.2rem; }
.preview-docx-viewer .docx-subtitle { font-size: 1.3rem; font-weight: 400; color: #64748b; margin-top: 0; }
.preview-docx-viewer li { margin: 0.2rem 0 0.2rem 1.5rem; }
.preview-docx-viewer img { border-radius: 4px; }

.preview-docx-viewer .docx-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0;
    font-size: 0.9rem;
}

.preview-docx-viewer .docx-table td {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

[data-bs-theme="dark"] .preview-docx-viewer .docx-table td {
    border-color: #374151;
}

.preview-docx-viewer .docx-table tr:first-child td {
    font-weight: 600;
    background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme="dark"] .preview-docx-viewer .docx-table tr:first-child td {
    background: rgba(255, 255, 255, 0.05);
}

/* Excel Preview */
.preview-xlsx-viewer {
    max-height: 70vh;
    overflow: auto;
    padding: 1rem;
    background: #fff;
    color: #1a1a2e;
}

[data-bs-theme="dark"] .preview-xlsx-viewer {
    background: #1e1e2e;
    color: #e2e8f0;
}

.xlsx-sheet-tab {
    display: inline-block;
    padding: 0.4rem 1rem;
    margin: 0.5rem 0.25rem 0.25rem 0;
    background: #217346;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

.xlsx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    font-family: 'Calibri', 'Segoe UI', Arial, sans-serif;
}

.xlsx-table td {
    border: 1px solid #d1d5db;
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .xlsx-table td {
    border-color: #374151;
}

.xlsx-table tr:first-child td {
    font-weight: 600;
    background: rgba(33, 115, 70, 0.08);
}

[data-bs-theme="dark"] .xlsx-table tr:first-child td {
    background: rgba(33, 115, 70, 0.2);
}

.xlsx-table tr:hover td {
    background: rgba(33, 115, 70, 0.04);
}

/* PowerPoint Preview */
.preview-pptx-viewer {
    max-height: 70vh;
    overflow: auto;
    padding: 1.5rem;
    background: #2d2d2d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.pptx-slide {
    width: 100%;
    max-width: 800px;
}

.pptx-slide-num {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.pptx-slide-content {
    background: #fff;
    color: #1a1a2e;
    border-radius: 6px;
    padding: 2rem 2.5rem;
    min-height: 120px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', 'Calibri', Arial, sans-serif;
}

.pptx-slide-content h2 { font-size: 1.6rem; font-weight: 700; margin: 0.5rem 0; }
.pptx-slide-content h3 { font-size: 1.25rem; font-weight: 600; margin: 0.4rem 0; }
.pptx-slide-content p { margin: 0.25rem 0; line-height: 1.6; }

.pptx-image {
    text-align: center;
    margin: 0.5rem 0;
}

.pptx-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 4px;
}

.pptx-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.88rem;
}

.pptx-table th,
.pptx-table td {
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.7rem;
}

.pptx-table th {
    background: rgba(210, 71, 38, 0.08);
    font-weight: 600;
}

/* Zoom Controls */
.preview-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    margin-right: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.2rem 0.35rem;
}

.preview-zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.preview-zoom-btn:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
}

.preview-zoom-level {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 42px;
    text-align: center;
    user-select: none;
}

@media (max-width: 575.98px) {
    .preview-image-viewer {
        height: 55vh;
    }

    .preview-pdf-viewer {
        height: 55vh;
    }

    .preview-zoom-controls {
        padding: 0.15rem 0.25rem;
        gap: 0.15rem;
    }

    .preview-zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .preview-zoom-level {
        font-size: 0.68rem;
        min-width: 36px;
    }

    #previewModal .modal-header {
        flex-wrap: nowrap;
    }

    #previewModal .modal-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100px;
    }
}

/* ===== View Toggler ===== */
.view-toggle .btn {
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
}

.view-toggle .btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Pagination ===== */
.pagination .page-link {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--gradient);
    border-color: var(--primary);
}

/* ===== Charts ===== */
.chart-container {
    position: relative;
    height: 280px;
}

/* ===== Activity Item ===== */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-icon.upload { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.activity-icon.download { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.activity-icon.delete { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.activity-icon.share { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.activity-icon.login { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.activity-icon.default { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

.content-wrapper .glass-card {
    animation: fadeInUp 0.35s ease forwards;
}

.content-wrapper .row .col-xl-3:nth-child(2) .glass-card { animation-delay: 0.05s; }
.content-wrapper .row .col-xl-3:nth-child(3) .glass-card { animation-delay: 0.1s; }
.content-wrapper .row .col-xl-3:nth-child(4) .glass-card { animation-delay: 0.15s; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.uploading-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.upload-item {
    animation: slideInRight 0.3s ease forwards;
}

/* ===== Responsive ===== */

/* Tablet / Medium screens */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

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

    .sidebar-overlay.show {
        display: block;
    }

    .content-wrapper {
        padding: 1.25rem;
    }

    .chart-container {
        height: 240px;
    }

    .welcome-banner {
        padding: 1.25rem 1.5rem;
    }

    .card-header-custom {
        padding: 0.85rem 1.25rem;
    }

    .stat-card-body {
        padding: 1rem 1.25rem;
    }

    .stat-card-footer {
        padding: 0.5rem 1.25rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.65rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Small tablets / large phones */
@media (max-width: 767.98px) {
    :root {
        --topbar-height: 58px;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .topbar {
        padding: 0 1rem;
    }

    .topbar-title h5 {
        font-size: 1rem;
    }

    .topbar-title small {
        display: none;
    }

    .topbar-user .user-info {
        display: none;
    }

    .topbar-user {
        padding: 0.25rem;
        border-radius: 50%;
    }

    .topbar-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .welcome-content h4 {
        font-size: 1.1rem;
    }

    .welcome-content p {
        font-size: 0.82rem;
    }

    .welcome-illustration i {
        font-size: 2rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .stat-icon-wrap {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        font-size: 1.1rem;
    }

    .stat-card-body {
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-card-footer {
        padding: 0.5rem 1rem;
    }

    .glass-card {
        border-radius: 14px;
    }

    .glass-card p-4,
    .glass-card.p-4 {
        padding: 1rem !important;
    }

    .chart-container {
        height: 220px;
    }

    .card-header-custom {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header-custom h6 {
        font-size: 0.85rem;
    }

    .table-responsive {
        margin: 0 -0.25rem;
    }

    .table thead th {
        font-size: 0.72rem;
        padding: 0.5rem 0.65rem;
        white-space: nowrap;
    }

    .table tbody td {
        padding: 0.6rem 0.65rem;
        font-size: 0.82rem;
    }

    .file-name-cell {
        gap: 0.5rem;
    }

    .file-icon-box {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 0.85rem;
    }

    .file-name-cell span {
        font-size: 0.82rem;
        max-width: 120px;
    }

    .activity-item {
        padding: 0.6rem 0;
    }

    .activity-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 0.8rem;
    }

    .activity-text {
        font-size: 0.8rem;
    }

    .activity-time {
        font-size: 0.7rem;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .file-card {
        padding: 1rem;
    }

    .upload-progress-wrapper {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
    }

    .storage-progress {
        height: 10px;
    }

    .mini-progress {
        height: 4px;
    }

    .drop-zone {
        padding: 2rem 1.5rem;
    }

    .drop-zone i {
        font-size: 2.5rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 2.5rem;
    }
}

/* Mobile phones */
@media (max-width: 575.98px) {
    :root {
        --topbar-height: 54px;
    }

    .content-wrapper {
        padding: 0.75rem;
    }

    .topbar {
        padding: 0 0.75rem;
    }

    .sidebar-toggle {
        font-size: 1.15rem;
        padding: 0.35rem;
    }

    .topbar-title h5 {
        font-size: 0.95rem;
    }

    .row.g-4 {
        --bs-gutter-y: 0.75rem;
        --bs-gutter-x: 0.75rem;
    }

    .welcome-banner {
        padding: 1rem;
        margin-bottom: 0.75rem !important;
    }

    .welcome-content h4 {
        font-size: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.15rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .stat-icon-wrap {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .stat-card-body {
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .stat-card-footer {
        padding: 0.45rem 0.85rem;
    }

    .stat-card-footer a,
    .stat-card-footer small {
        font-size: 0.7rem;
    }

    .glass-card {
        border-radius: 12px;
    }

    .chart-container {
        height: 200px;
    }

    .card-header-custom {
        padding: 0.65rem 0.85rem;
    }

    .card-header-custom h6 {
        font-size: 0.8rem;
    }

    .btn-primary-soft {
        font-size: 0.72rem;
        padding: 0.25rem 0.65rem;
    }

    .table thead th {
        font-size: 0.68rem;
        padding: 0.45rem 0.5rem;
    }

    .table tbody td {
        padding: 0.5rem;
        font-size: 0.78rem;
    }

    .file-name-cell span {
        max-width: 90px;
    }

    .file-icon-box {
        width: 28px;
        height: 28px;
        border-radius: 7px;
        font-size: 0.78rem;
    }

    .activity-list {
        padding: 0.5rem !important;
    }

    .activity-item {
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .activity-icon {
        width: 28px;
        height: 28px;
        border-radius: 7px;
        font-size: 0.75rem;
    }

    .activity-text {
        font-size: 0.75rem;
    }

    .activity-time {
        font-size: 0.65rem;
    }

    .file-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .file-card {
        padding: 0.85rem;
        border-radius: 10px;
    }

    .file-card .file-icon {
        font-size: 2rem;
    }

    .file-card .file-name {
        font-size: 0.78rem;
    }

    .folder-card {
        padding: 0.75rem 1rem;
    }

    .storage-progress-wrap .d-flex small {
        font-size: 0.72rem;
    }

    .badge {
        font-size: 0.68rem;
        padding: 0.3em 0.6em;
    }

    .dropdown-menu {
        border-radius: 10px;
        min-width: 180px;
    }

    .dropdown-item {
        font-size: 0.82rem;
        padding: 0.45rem 0.65rem;
    }

    .avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .auth-card {
        border-radius: 16px;
        margin: 0.75rem;
        max-width: 100%;
    }

    .auth-wrapper {
        padding: 0;
    }

    .auth-cloud-banner {
        height: 120px;
    }

    .auth-cloud-banner .banner-icon {
        width: 60px;
        height: 60px;
        font-size: 1.7rem;
    }

    .auth-card-body {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .auth-card .brand h3 {
        font-size: 1.35rem;
    }

    .auth-card .btn-auth {
        padding: 0.75rem 1.25rem;
        font-size: 0.92rem;
    }

    .auth-features {
        gap: 0.75rem;
    }

    .auth-features .feature-item {
        font-size: 0.65rem;
    }

    .auth-features .feature-icon-wrap {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .theme-toggle-auth {
        top: 0.75rem;
        right: 0.75rem;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .page-header h4 {
        font-size: 1.1rem;
    }

    .form-control,
    .form-select {
        font-size: 0.88rem;
        padding: 0.5rem 0.85rem;
    }

    .btn {
        font-size: 0.85rem;
    }

    .modal-content {
        border-radius: 14px;
    }

    .preview-container {
        padding: 0.5rem;
    }

    .share-link-container {
        flex-direction: column;
    }

    .permission-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Extra small - very narrow phones */
@media (max-width: 359.98px) {
    .content-wrapper {
        padding: 0.5rem;
    }

    .topbar {
        padding: 0 0.5rem;
    }

    .topbar-title h5 {
        font-size: 0.88rem;
    }

    .stat-card-body {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .stat-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .stat-card .stat-value {
        font-size: 1rem;
    }

    .file-name-cell span {
        max-width: 70px;
    }

    .welcome-banner {
        padding: 0.85rem;
    }

    .welcome-content h4 {
        font-size: 0.9rem;
    }

    .chart-container {
        height: 180px;
    }
}

/* ===== File List View ===== */
.file-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.2s;
    gap: 1rem;
}

.file-list-item:hover {
    background: var(--table-hover);
}

.file-list-item .file-icon {
    font-size: 1.5rem;
    width: 36px;
    text-align: center;
}

.file-list-item .file-info {
    flex: 1;
    min-width: 0;
}

.file-list-item .file-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-item .file-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-list-item .file-actions {
    display: flex;
    gap: 0.25rem;
}

/* ===== Empty State ===== */
.empty-state {
    padding: 3rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ===== Permission Toggle ===== */
.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s;
}

.permission-item:hover {
    background: var(--table-hover);
}

.permission-item:last-child {
    border-bottom: none;
}

/* ===== Search ===== */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
    border-radius: 10px;
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Dropdown Menu ===== */
.dropdown-menu {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ===== Share Link ===== */
.share-link-container {
    display: flex;
    gap: 0.5rem;
}

.share-link-container .form-control {
    font-size: 0.85rem;
    background: var(--input-bg);
}

/* ===== Status Indicators ===== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: #10b981; }
.status-dot.offline { background: #ef4444; }
.status-dot.away { background: #f59e0b; }

/* ===== File Manager — Mobile Responsive ===== */

/* Touch devices: disable hover effects, always show actions */
@media (hover: none) and (pointer: coarse) {
    .fm-file-card:hover {
        transform: none;
        box-shadow: var(--glass-shadow);
    }

    .fm-folder-card:hover {
        transform: none;
        box-shadow: var(--glass-shadow);
    }

    .fm-file-check,
    .fm-item-actions {
        opacity: 1;
    }

    .fm-context-menu li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .topbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* -- Tablet (max 991.98px) -- */
@media (max-width: 991.98px) {
    .fm-header > div {
        flex-direction: column;
        align-items: stretch !important;
    }

    .fm-title-group {
        width: 100%;
    }

    .fm-toolbar {
        width: 100%;
    }

    .fm-search {
        min-width: 0;
        flex: 1;
    }

    .fm-folder-preview {
        height: 120px;
    }

    .fm-file-preview {
        height: 120px;
    }

    .fm-type-badge i {
        font-size: 2.4rem;
    }

    /* Card size presets — tablet override */
    .file-grid-small .file-item {
        flex: 0 0 calc(100% / 5);
        max-width: calc(100% / 5);
    }

    .file-grid-large .file-item {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

/* -- Small tablets / large phones (max 767.98px) -- */
@media (max-width: 767.98px) {
    /* FM Header */
    .fm-header {
        padding-bottom: 0.75rem;
    }

    .fm-header > div {
        gap: 0.75rem !important;
    }

    .fm-header h5 {
        font-size: 1.05rem;
    }

    .fm-header .breadcrumb {
        font-size: 0.75rem;
    }

    .fm-title-group {
        gap: 0.5rem !important;
    }

    .fm-search .form-control {
        font-size: 0.8rem;
    }

    /* Folder cards */
    .fm-folder-card {
        border-radius: 12px;
    }

    .fm-folder-preview {
        height: 100px;
        font-size: 2.8rem;
    }

    /* File cards */
    .fm-file-card {
        border-radius: 12px;
    }

    .fm-file-preview {
        height: 110px;
    }

    .fm-file-details {
        padding: 0.55rem 0.7rem;
    }

    .fm-file-name {
        font-size: 0.78rem;
    }

    .fm-file-meta {
        font-size: 0.68rem;
    }

    .fm-type-badge i {
        font-size: 2.2rem;
    }

    .fm-ext-label {
        font-size: 0.6rem;
    }

    .fm-section-title {
        font-size: 0.75rem;
    }

    /* Settings panel */
    .fm-settings-panel {
        width: 300px !important;
    }

    /* Context menu touch-friendly */
    .fm-context-menu {
        min-width: 180px;
    }

    .fm-context-menu li a {
        padding: 0.55rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Empty state */
    .fm-empty {
        padding: 2.5rem 1.5rem;
    }

    .fm-empty-icon {
        width: 64px;
        height: 64px;
    }

    .fm-empty-icon i {
        font-size: 1.8rem;
    }

    .fm-empty h5 {
        font-size: 1.1rem;
    }

    .fm-empty p {
        font-size: 0.85rem;
    }

    /* Preview */
    .preview-container img,
    .preview-container video {
        max-height: 55vh;
    }

    .preview-container iframe {
        height: 55vh;
    }

    /* Card size presets — phone override */
    .file-grid-small .file-item {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .file-grid-large .file-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* -- Mobile phones (max 575.98px) -- */
@media (max-width: 575.98px) {
    /* Topbar spacing */
    .topbar-right {
        gap: 0.4rem;
    }

    .topbar .btn-primary.btn-sm {
        padding: 0.35rem 0.55rem;
        font-size: 0.85rem;
    }

    /* FM Header — full stack */
    .fm-header {
        padding-bottom: 0.6rem;
        margin-bottom: 1rem !important;
    }

    .fm-header > div {
        gap: 0.6rem !important;
    }

    .fm-header h5 {
        font-size: 0.95rem;
    }

    .fm-title-group {
        gap: 0.35rem !important;
        flex-direction: column;
        align-items: flex-start !important;
    }

    .fm-header .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        white-space: nowrap;
        max-width: 100%;
        padding-bottom: 2px;
    }

    .fm-header .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .fm-toolbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.35rem !important;
    }

    .fm-toolbar::-webkit-scrollbar {
        display: none;
    }

    .fm-search {
        min-width: 0;
        flex: 1 1 120px;
    }

    .fm-search .form-control {
        font-size: 0.78rem;
        padding: 0.35rem 0.6rem 0.35rem 2rem;
    }

    /* Folder grid */
    .fm-folder-card {
        border-radius: 10px;
    }

    .fm-folder-preview {
        height: 90px;
        font-size: 2.4rem;
    }

    .fm-item-actions {
        opacity: 1;
    }

    /* File cards */
    .fm-file-card {
        border-radius: 10px;
    }

    .fm-file-preview {
        height: 90px;
    }

    .fm-file-details {
        padding: 0.4rem 0.55rem;
    }

    .fm-file-name {
        font-size: 0.74rem;
    }

    .fm-file-meta {
        font-size: 0.64rem;
    }

    .fm-type-badge i {
        font-size: 1.8rem;
    }

    .fm-ext-label {
        font-size: 0.55rem;
        padding: 0.1rem 0.4rem;
    }

    .fm-file-check {
        opacity: 1;
    }

    .fm-section-title {
        font-size: 0.72rem;
    }

    /* Settings panel — full width */
    .fm-settings-panel {
        width: 100% !important;
    }

    .fm-setting-group {
        margin-bottom: 1rem;
    }

    .fm-setting-label {
        font-size: 0.7rem;
    }

    .fm-size-btn {
        padding: 0.5rem 0.35rem;
        font-size: 0.68rem;
    }

    .fm-size-btn i {
        font-size: 1.1rem;
    }

    .fm-style-btn {
        padding: 0.45rem;
        font-size: 0.68rem;
    }

    /* Context menu — viewport constrained & touch-friendly */
    .fm-context-menu {
        min-width: 200px;
        max-width: calc(100vw - 1rem);
        border-radius: 14px;
    }

    .fm-context-menu li a {
        padding: 0.6rem 0.75rem;
        font-size: 0.88rem;
        min-height: 44px;
    }

    /* Upload area */
    .upload-area {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .upload-prompt i {
        font-size: 2rem;
    }

    .upload-prompt h5 {
        font-size: 1rem;
    }

    .upload-prompt p {
        font-size: 0.82rem;
    }

    /* Upload progress */
    .upload-progress-wrapper {
        width: calc(100% - 1.5rem);
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .upload-item {
        padding: 0.55rem 0.65rem;
        border-radius: 8px;
    }

    .upload-item .upload-name {
        font-size: 0.75rem;
        max-width: 140px;
    }

    /* Empty state */
    .fm-empty {
        padding: 2rem 1rem;
    }

    .fm-empty-icon {
        width: 56px;
        height: 56px;
    }

    .fm-empty-icon i {
        font-size: 1.5rem;
    }

    .fm-empty h5 {
        font-size: 1rem;
    }

    .fm-empty p {
        font-size: 0.82rem;
        margin-bottom: 1rem;
    }

    /* FM Table (list view) */
    .fm-table thead th {
        font-size: 0.65rem;
        padding: 0.4rem 0.45rem;
    }

    .fm-table tbody td {
        padding: 0.4rem 0.45rem;
        font-size: 0.76rem;
    }

    .fm-table-name {
        gap: 0.35rem;
    }

    .fm-table-icon {
        font-size: 1rem;
        width: 20px;
    }

    .fm-table-name a {
        font-size: 0.76rem;
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    /* File info modal */
    .fm-info-grid {
        grid-template-columns: 90px 1fr;
        gap: 0.4rem 0.65rem;
        font-size: 0.82rem;
    }

    /* Preview */
    .preview-container {
        padding: 0.35rem;
        border-radius: 8px;
    }

    .preview-container img,
    .preview-container video {
        max-height: 50vh;
    }

    .preview-container iframe {
        height: 50vh;
    }

    /* Card size presets — mobile override */
    .file-grid-small .file-item {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    .file-grid-small .fm-file-preview {
        height: 70px;
    }

    .file-grid-large .file-item {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .file-grid-large .fm-file-preview {
        height: 140px;
    }

    /* Modals — nearly fullscreen */
    .modal-dialog.modal-xl,
    .modal-dialog.modal-lg {
        margin: 0.35rem;
        max-width: calc(100% - 0.7rem);
    }

    .modal-content {
        border-radius: 14px;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-header .modal-title {
        font-size: 0.95rem;
    }

    .modal-body {
        padding: 0.85rem;
    }

    .modal-footer {
        padding: 0.6rem 0.85rem;
    }

    /* View toggle compact */
    .view-toggle .btn {
        padding: 0.35rem 0.5rem;
    }

    /* Glass card content */
    .glass-card.p-4 {
        padding: 0.85rem !important;
    }
}

/* -- Extra small phones (max 359.98px) -- */
@media (max-width: 359.98px) {
    .fm-header h5 {
        font-size: 0.85rem;
    }

    .fm-search {
        flex: 1 1 90px;
    }

    .fm-file-preview {
        height: 70px;
    }

    .fm-file-details {
        padding: 0.3rem 0.45rem;
    }

    .fm-file-name {
        font-size: 0.68rem;
    }

    .fm-file-meta {
        font-size: 0.58rem;
    }

    .fm-folder-preview {
        height: 70px;
        font-size: 2rem;
    }

    .fm-type-badge i {
        font-size: 1.4rem;
    }

    .fm-ext-label {
        font-size: 0.5rem;
        padding: 0.08rem 0.3rem;
    }

    .fm-table-name a {
        max-width: 70px;
    }

    .fm-empty {
        padding: 1.5rem 0.65rem;
    }

    .fm-context-menu li a {
        padding: 0.5rem 0.65rem;
        font-size: 0.82rem;
    }

    .file-grid-small .file-item {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .file-grid-small .fm-file-preview {
        height: 60px;
    }
}
