/* === Pyra Workspace File Manager v3 === */
/* Aesthetic: Refined Dark Luxury - layered depth, glass, grain */
:root {
    --bg-primary: #0a0e14;
    --bg-secondary: #111620;
    --bg-tertiary: #181f2e;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --bg-active: rgba(255, 255, 255, 0.07);
    --bg-card: #141a26;
    --bg-glass: rgba(17, 22, 32, 0.85);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.09);
    --border-glow: rgba(139, 92, 246, 0.2);
    --text-primary: #edf0f7;
    --text-secondary: #8892a8;
    --text-muted: #505c74;
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-dim: #7c3aed;
    --accent-bg: rgba(139, 92, 246, 0.08);
    --accent-border: rgba(139, 92, 246, 0.2);
    --accent-glow: 0 0 20px rgba(139, 92, 246, 0.15);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.06);
    --warning: #f59e0b;
    --info: #06b6d4;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.08);
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Noto Sans Arabic', 'Segoe UI', 'Tahoma', sans-serif;
    --grain-opacity: 0.03;
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* === Pyramedia Orange Theme === */
[data-theme="pyramedia"] {
    --accent: #F97316;
    --accent-hover: #FB923C;
    --accent-dim: #EA580C;
    --accent-bg: rgba(249, 115, 22, 0.08);
    --accent-border: rgba(249, 115, 22, 0.25);
    --accent-glow: 0 0 20px rgba(249, 115, 22, 0.15);
    --border-glow: rgba(249, 115, 22, 0.2);
    --shadow-glow: 0 0 40px rgba(249, 115, 22, 0.08);
}

[data-theme="pyramedia"] .logo svg {
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.3));
}

[data-theme="pyramedia"] .btn-primary {
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

[data-theme="pyramedia"] .btn-primary:hover {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

[data-theme="pyramedia"] .breadcrumb-item.active {
    background: rgba(249, 115, 22, 0.06);
    border: 1px solid rgba(249, 115, 22, 0.1);
}

[data-theme="pyramedia"] ::selection {
    background: rgba(249, 115, 22, 0.35);
}

[data-theme="pyramedia"] :focus-visible {
    outline-color: rgba(249, 115, 22, 0.5);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    direction: ltr;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    transition: var(--theme-transition);
}

body *, body *::before, body *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Subtle noise grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; transition: background 0.2s; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* === RTL Support === */
[dir="rtl"], .rtl {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .breadcrumb { direction: ltr; }
[dir="rtl"] .preview-markdown blockquote {
    border-left: none;
    border-right: 3px solid var(--accent);
    padding-left: 0;
    padding-right: 16px;
}
[dir="rtl"] .preview-markdown ul,
[dir="rtl"] .preview-markdown ol {
    padding-left: 0;
    padding-right: 24px;
}

.preview-body .rtl-content {
    direction: rtl;
    text-align: right;
    font-family: var(--font-arabic), var(--font-sans);
}

/* Auto-detect bidi content */
.bidi-auto {
    unicode-bidi: plaintext;
    text-align: start;
}

/* === Layout === */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* === Top Bar === */
.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    flex-shrink: 0;
    height: 54px;
    backdrop-filter: blur(12px);
    background: var(--bg-glass);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    flex-shrink: 0;
    letter-spacing: -0.03em;
}

.logo svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-border));
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    padding: 2px 0;
    scrollbar-width: none;
}

.breadcrumb::-webkit-scrollbar { display: none; }

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 12px;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.breadcrumb-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.1);
    font-weight: 600;
}

/* === Toolbar === */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-sep {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 6px;
}

/* === Info Bar (path + count) === */
.info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 24px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.info-bar .path-display {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
    letter-spacing: -0.01em;
    position: relative;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    border-color: transparent;
}

.btn-danger { color: var(--danger); }
.btn-danger:hover {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    border-color: transparent;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11.5px;
}

.btn-icon {
    padding: 7px 8px;
}

.btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* === Search === */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 6px 14px;
    margin-left: auto;
    min-width: 220px;
    transition: all var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
    background: rgba(139, 92, 246, 0.02);
}

.search-box svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color var(--transition);
}

.search-box:focus-within svg {
    color: var(--accent);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    width: 100%;
    letter-spacing: -0.01em;
}

.search-box input::placeholder { color: var(--text-muted); }

/* === Main Content === */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* === File Panel === */
.file-panel {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Column headers */
.file-list-header {
    display: grid;
    grid-template-columns: 36px 1fr 28px 80px 140px 110px;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.file-list-header .sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.file-list-header .sortable:hover {
    color: var(--text-primary);
}

.file-list-header .sortable svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

/* === File Grid === */
.file-grid {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.file-item {
    display: grid;
    grid-template-columns: 36px 1fr 28px 80px 140px 110px;
    align-items: center;
    gap: 8px;
    padding: 7px 24px;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    border-bottom: 1px solid transparent;
    min-height: 44px;
    border-radius: 0;
    position: relative;
}

.file-item:hover {
    background: var(--bg-hover);
}

.file-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0.5;
    border-radius: 0 2px 2px 0;
}

.file-item.selected {
    background: var(--accent-bg);
    border-bottom-color: transparent;
}

.file-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    opacity: 1;
    border-radius: 0 2px 2px 0;
}

.file-item.selected:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* === File Icon === */
.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    transition: all var(--transition);
}

.file-item:hover .file-icon {
    transform: scale(1.05);
}

.file-icon svg {
    width: 16px;
    height: 16px;
}

.file-icon.folder { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.1); }
.file-icon.image { background: rgba(236, 72, 153, 0.08); border: 1px solid rgba(236, 72, 153, 0.1); }
.file-icon.video { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.1); }
.file-icon.audio { background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.1); }
.file-icon.document { background: rgba(6, 182, 212, 0.08); border: 1px solid rgba(6, 182, 212, 0.1); }
.file-icon.code { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.1); }
.file-icon.archive { background: rgba(249, 115, 22, 0.08); border: 1px solid rgba(249, 115, 22, 0.1); }
.file-icon.markdown { background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.1); }
.file-icon.pdf { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.1); }
.file-icon.text { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); }

.file-name {
    font-size: 13px;
    font-weight: 450;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    unicode-bidi: plaintext;
    letter-spacing: -0.01em;
    transition: color var(--transition);
}

.file-item:hover .file-name {
    color: #fff;
}

.file-size {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.file-date {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    letter-spacing: 0.01em;
}

.file-actions-col {
    display: flex;
    gap: 2px;
    justify-content: flex-end;
    opacity: 0;
    transition: var(--transition);
}

.file-item:hover .file-actions-col {
    opacity: 1;
}

.file-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}

.file-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: scale(1.1);
}

.file-action-btn:active {
    transform: scale(0.95);
}

.file-action-btn.delete:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.file-action-btn svg {
    width: 14px;
    height: 14px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Preview Panel === */
.preview-panel {
    width: 0;
    overflow: hidden;
    border-left: 1px solid var(--border-color);
    background: var(--bg-secondary);
    transition: width var(--transition-slow);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.preview-panel.open {
    width: 55%;
    min-width: 420px;
}

/* Subtle gradient at the top of preview */
.preview-panel.open::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.03) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-shrink: 0;
    min-height: 52px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 1;
}

.preview-title {
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    unicode-bidi: plaintext;
    letter-spacing: -0.02em;
}

.preview-file-info {
    font-size: 10.5px;
    color: var(--text-muted);
    padding: 6px 20px 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    letter-spacing: 0.01em;
}

.preview-file-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preview-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.preview-body {
    flex: 1;
    overflow: auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* === Preview Content Types === */
.preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.preview-image img {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

.preview-video { width: 100%; }
.preview-video video {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.preview-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 32px;
}

.preview-audio .audio-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    border-radius: 50%;
    color: var(--accent);
    animation: pulse-glow 2.5s ease-in-out infinite;
    border: 1px solid var(--accent-border);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.2); }
    50% { box-shadow: 0 0 0 24px rgba(139, 92, 246, 0); }
}

.preview-audio .audio-icon svg { width: 40px; height: 40px; }

.preview-audio audio {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius);
}

/* === Markdown Preview === */
.preview-markdown {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-primary);
    unicode-bidi: plaintext;
    letter-spacing: -0.01em;
}

.preview-markdown h1, .preview-markdown h2, .preview-markdown h3,
.preview-markdown h4, .preview-markdown h5, .preview-markdown h6 {
    margin: 1.2em 0 0.5em;
    font-weight: 650;
    line-height: 1.3;
    unicode-bidi: plaintext;
}

.preview-markdown h1 {
    font-size: 1.65em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.03em;
}

.preview-markdown h2 {
    font-size: 1.3em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.02em;
}

.preview-markdown h3 { font-size: 1.15em; }

.preview-markdown p {
    margin: 0.75em 0;
    unicode-bidi: plaintext;
}

.preview-markdown a { color: var(--accent); text-decoration: none; }
.preview-markdown a:hover { text-decoration: underline; }

.preview-markdown code {
    background: var(--bg-primary);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.88em;
    border: 1px solid var(--border-color);
}

.preview-markdown pre {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1em 0;
    border: 1px solid var(--border-color);
}

.preview-markdown pre code {
    background: none;
    padding: 0;
    border: none;
}

.preview-markdown blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 16px;
    margin: 1em 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(139, 92, 246, 0.03);
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.preview-markdown ul, .preview-markdown ol {
    padding-left: 24px;
    margin: 0.8em 0;
}

.preview-markdown li {
    margin: 0.35em 0;
    unicode-bidi: plaintext;
}

.preview-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.preview-markdown th, .preview-markdown td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: start;
    unicode-bidi: plaintext;
}

.preview-markdown th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.preview-markdown img {
    max-width: 100%;
    border-radius: var(--radius);
}

.preview-markdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2em 0;
}

/* === DOCX Preview === */
.preview-docx {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-primary);
    unicode-bidi: plaintext;
}

.preview-docx h1, .preview-docx h2, .preview-docx h3,
.preview-docx h4, .preview-docx h5, .preview-docx h6 {
    margin: 1em 0 0.5em;
    font-weight: 600;
    unicode-bidi: plaintext;
}

.preview-docx p {
    margin: 0.5em 0;
    unicode-bidi: plaintext;
}

.preview-docx table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.preview-docx th, .preview-docx td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: start;
    unicode-bidi: plaintext;
}

.preview-docx img { max-width: 100%; border-radius: var(--radius); }

.preview-docx ul, .preview-docx ol {
    padding-left: 24px;
    margin: 0.5em 0;
}

/* === Code Editor === */
.code-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    resize: none;
    outline: none;
    tab-size: 4;
    unicode-bidi: plaintext;
}

.code-editor:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
}

/* === PDF Preview === */
.preview-pdf { width: 100%; height: 100%; }
.preview-pdf iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    min-width: 380px;
    max-width: 460px;
    width: 90%;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle gradient shimmer at the top of modal */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    margin-bottom: 20px;
    transition: all var(--transition);
    unicode-bidi: plaintext;
}

.modal-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
    background: rgba(139, 92, 246, 0.02);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* === Drop Zone === */
.drop-zone {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(139, 92, 246, 0.06);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.drop-zone.active {
    opacity: 1;
    visibility: visible;
}

.drop-zone-content {
    background: var(--bg-glass);
    border: 2px dashed rgba(139, 92, 246, 0.4);
    border-radius: 24px;
    padding: 60px 80px;
    text-align: center;
    color: var(--accent);
    box-shadow: var(--shadow-lg), var(--accent-glow);
    animation: dropPulse 2s ease-in-out infinite;
}

@keyframes dropPulse {
    0%, 100% { border-color: rgba(139, 92, 246, 0.3); }
    50% { border-color: rgba(139, 92, 246, 0.6); }
}

.drop-zone-content svg { width: 48px; height: 48px; margin-bottom: 12px; }
.drop-zone-content p { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.drop-zone-content .hint { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; font-weight: 400; }

/* === Toast === */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 400px;
    letter-spacing: -0.01em;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn {
    from { transform: translateX(20px) scale(0.96); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* === Loading === */
.loading-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 14, 20, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.spinner {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === Context Menu === */
.context-menu {
    position: fixed;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
    padding: 6px;
    min-width: 200px;
    z-index: 1100;
    display: none;
    animation: ctxIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ctxIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-menu.active { display: block; }

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: -0.01em;
}

.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item.danger:hover { background: var(--danger-bg); }
.context-menu-item svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
.context-menu-item:hover svg { opacity: 1; }

.context-menu-sep {
    height: 1px;
    background: var(--border-color);
    margin: 4px 8px;
}

/* === Upload Progress === */
.upload-progress {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    min-width: 320px;
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    display: none;
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-progress.active { display: block; }

.upload-progress-title {
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.upload-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-hover));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.upload-progress-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* === Responsive === */
@media (max-width: 900px) {
    .preview-panel.open {
        position: fixed;
        top: 0; right: 0;
        width: 100%;
        height: 100%;
        min-width: unset;
        z-index: 200;
    }

    .file-list-header,
    .file-item {
        grid-template-columns: 36px 1fr 24px auto;
    }

    .file-date, .file-list-header .col-date {
        display: none;
    }

    .toolbar { overflow-x: auto; }
    .search-box { min-width: 150px; }
    .top-bar { padding: 0 16px; }
    .file-item { padding: 7px 16px; }
    .file-list-header { padding: 8px 16px; }
}

@media (max-width: 600px) {
    .file-list-header,
    .file-item {
        grid-template-columns: 32px 1fr 24px;
    }

    .file-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .file-size { display: none; }
    .info-bar { display: none; }
}

/* === Login Screen === */
.login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at top, var(--bg-secondary) 0%, var(--bg-primary) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow: hidden;
}

/* Floating particles */
.login-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-particles .particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.15;
    animation: floatParticle linear infinite;
}

.login-particles .particle:nth-child(1) { left: 10%; animation-duration: 18s; animation-delay: 0s; width: 4px; height: 4px; }
.login-particles .particle:nth-child(2) { left: 25%; animation-duration: 22s; animation-delay: -3s; }
.login-particles .particle:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: -6s; width: 5px; height: 5px; opacity: 0.1; }
.login-particles .particle:nth-child(4) { left: 55%; animation-duration: 20s; animation-delay: -2s; }
.login-particles .particle:nth-child(5) { left: 70%; animation-duration: 24s; animation-delay: -8s; width: 4px; height: 4px; }
.login-particles .particle:nth-child(6) { left: 85%; animation-duration: 17s; animation-delay: -5s; opacity: 0.12; }
.login-particles .particle:nth-child(7) { left: 50%; animation-duration: 21s; animation-delay: -10s; }
.login-particles .particle:nth-child(8) { left: 15%; animation-duration: 19s; animation-delay: -7s; width: 2px; height: 2px; }

@keyframes floatParticle {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-10vh) translateX(30px); opacity: 0; }
}

/* Ambient gradient orbs behind login */
.login-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: loginOrb1 8s ease-in-out infinite alternate;
}

.login-screen::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: loginOrb2 10s ease-in-out infinite alternate;
}

@keyframes loginOrb1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-40px, 40px) scale(1.1); }
}

@keyframes loginOrb2 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(30px, -30px) scale(1.15); }
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 44px 40px;
    width: 400px;
    max-width: 90%;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    z-index: 1;
    animation: loginCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top shimmer line on login card */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
    border-radius: 24px 24px 0 0;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 36px;
    justify-content: center;
    letter-spacing: -0.03em;
    flex-direction: column;
}

.login-logo-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 0 12px var(--accent));
}

.login-logo-text {
    display: flex;
    align-items: baseline;
    gap: 0;
}

.login-logo-text .accent { color: var(--accent); }

.login-logo svg {
    width: 26px;
    height: 26px;
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3));
}

/* Remember me checkbox */
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-field input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
}

.login-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
    background: var(--accent-bg);
}

.login-error {
    color: var(--danger);
    font-size: 12.5px;
    min-height: 20px;
    margin-bottom: 8px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 13.5px;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* === User Menu === */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.user-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.user-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-badge.admin {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.user-badge.employee {
    background: rgba(6, 182, 212, 0.08);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.15);
}

.user-badge.client {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* === Reviews Section === */
.reviews-section {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.reviews-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reviews-header h3 svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent);
}

.reviews-count {
    font-size: 11px;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.review-item {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: all var(--transition);
}

.review-item:hover {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.025);
}

.review-item.resolved {
    opacity: 0.45;
}

.review-item.approval {
    border-left: 3px solid var(--success);
    background: rgba(16, 185, 129, 0.02);
}

.review-item.comment {
    border-left: 3px solid var(--accent);
    background: rgba(139, 92, 246, 0.02);
}

.review-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    gap: 8px;
}

.review-meta-left,
.review-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.review-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.review-date {
    color: var(--text-muted);
    font-size: 11px;
}

.review-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.review-type-badge.approval {
    background: var(--success-bg);
    color: var(--success);
}

.review-type-badge.comment {
    background: var(--accent-bg);
    color: var(--accent);
}

.review-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    unicode-bidi: plaintext;
    white-space: pre-wrap;
    word-break: break-word;
}

.review-actions {
    display: flex;
    gap: 4px;
    margin: 0;
}

.review-actions .btn {
    padding: 2px 8px;
    font-size: 11px;
}

.review-actions .btn svg {
    width: 12px;
    height: 12px;
}

.review-resolved-badge {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: 6px;
}

/* Review Input Area */
.review-input-area {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.review-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    transition: all var(--transition);
    unicode-bidi: plaintext;
    box-sizing: border-box;
}

.review-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
    background: rgba(139, 92, 246, 0.02);
}

.review-textarea::placeholder {
    color: var(--text-muted);
}

.review-submit-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.review-submit-actions .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-approve {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.btn-approve:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.review-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.review-empty svg {
    display: block;
    margin: 0 auto 8px;
    color: var(--text-muted);
}

/* === Users Panel === */
.users-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.users-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 800px;
    max-width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Shimmer top line on panels */
.users-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.2;
    z-index: 1;
}

@keyframes modalIn {
    from { transform: scale(0.96) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.users-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.users-panel-header h2 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.users-panel-header h2 svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.users-panel-body {
    overflow-y: auto;
    padding: 16px 24px;
    flex: 1;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.users-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
}

.users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.users-table tr {
    transition: background var(--transition);
}

.users-table tr:hover td {
    background: var(--bg-hover);
}

.users-table .user-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* User Form (inside modal) */
.user-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-form-row {
    display: flex;
    gap: 12px;
}

.user-form-row > * {
    flex: 1;
}

.user-form label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-form input,
.user-form select,
.user-form textarea {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
}

.user-form input:focus,
.user-form select:focus,
.user-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
    background: rgba(139, 92, 246, 0.02);
}

.user-form select {
    cursor: pointer;
    appearance: auto;
}

.user-form textarea {
    min-height: 60px;
    resize: vertical;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.perm-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 7px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition);
    user-select: none;
}

.perm-checkbox:hover {
    border-color: var(--accent-border);
    background: var(--accent-bg);
}

.perm-checkbox.checked {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--text-primary);
}

.perm-checkbox input[type="checkbox"] {
    display: none;
}

.perm-checkbox .perm-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.perm-checkbox.checked .perm-icon {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.3);
}

.perm-checkbox.checked .perm-icon svg {
    opacity: 1;
}

.perm-checkbox .perm-icon svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transition: var(--transition);
}

/* Folder Picker */
.folder-picker {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
    padding: 6px;
}

.folder-picker::-webkit-scrollbar { width: 5px; }
.folder-picker::-webkit-scrollbar-track { background: transparent; }
.folder-picker::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.folder-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
    user-select: none;
}

.folder-picker-item:hover {
    background: var(--bg-hover);
}

.folder-picker-item.selected {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.1);
}

.folder-picker-item .fp-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.folder-picker-item.selected .fp-check {
    background: var(--accent);
    border-color: var(--accent);
}

.folder-picker-item .fp-check svg {
    width: 10px;
    height: 10px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
}

.folder-picker-item.selected .fp-check svg {
    opacity: 1;
}

.folder-picker-item .fp-icon {
    width: 16px;
    height: 16px;
    color: var(--warning);
    flex-shrink: 0;
}

.folder-picker-item.all-access {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    padding-bottom: 10px;
    font-weight: 500;
}

.folder-picker-item.all-access .fp-icon {
    color: var(--success);
}

.folder-picker-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.folder-picker-empty {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* User form section titles */
.uf-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-top: 6px;
}

/* User form actions */
.user-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

/* Modal overlay shared */
.um-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.um-overlay.z-high {
    z-index: 1100;
}

/* User table enhancements */
.users-table .user-role-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.users-table .user-role-badge.admin {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.users-table .user-role-badge.employee {
    background: rgba(56, 189, 248, 0.1);
    color: var(--info);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.users-table .user-role-badge.client {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.users-table .user-perms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.users-table .user-perm-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.users-table .user-perm-tag.active {
    background: var(--accent-bg);
    color: var(--accent-hover);
    border-color: var(--accent-border);
}

/* ============================================
   Teams & Groups
   ============================================ */

.teams-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.teams-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.team-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.team-card:hover {
    border-color: var(--accent-border);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.06);
}

.team-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px 10px;
    gap: 12px;
}

.team-card-info {
    flex: 1;
    min-width: 0;
}

.team-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.team-card-name svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.team-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 0;
    line-height: 1.4;
}

.team-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.team-card-meta {
    padding: 0 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-meta-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
}

.team-meta-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 90px;
}

.team-meta-value {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-card-perms {
    padding: 0 16px 10px;
}

.team-card-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.01);
}

.team-card-footer .btn {
    font-size: 11px;
}

.team-card-footer .btn svg {
    width: 13px;
    height: 13px;
}

/* Team Members */
.team-members-list {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.team-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.team-member-row:last-child {
    border-bottom: none;
}

.team-member-row:hover {
    background: var(--bg-hover);
}

.team-member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.team-member-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.team-member-username {
    font-size: 11px;
    color: var(--text-muted);
}

.team-add-member {
    display: flex;
    gap: 8px;
    align-items: center;
}

.team-add-member select {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 12.5px;
}

.team-add-member select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-bg), var(--accent-glow);
}

/* File Permissions */
.fileperm-add-form {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
}

.fperm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fperm-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}

.fperm-item:hover {
    border-color: var(--accent-border);
}

.fperm-item.expired {
    opacity: 0.5;
    border-style: dashed;
}

.fperm-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.fperm-target {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.fperm-expiry {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.fperm-expiry svg {
    width: 12px;
    height: 12px;
}

/* === Responsive Additions === */
@media (max-width: 900px) {
    .user-name { display: none; }
    .users-panel { width: 95%; }
    .permissions-grid { grid-template-columns: repeat(2, 1fr); }
    .user-form-row { flex-direction: column; gap: 14px; }
    .notif-dropdown { width: 320px; }
}

@media (max-width: 600px) {
    .user-badge { display: none; }
    .login-card { padding: 32px 24px; }
    .permissions-grid { grid-template-columns: 1fr 1fr; }
    .notif-dropdown { width: 280px; right: -60px; }
    .deep-search-panel { width: 98%; border-radius: 16px; }
}

/* ============================================
   Notification Bell & Dropdown
   ============================================ */

.notif-bell { position: relative; }
.notif-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: #fff;
    font-size: 9px; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 8px; display: flex;
    align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: notifPulse 2s ease-in-out infinite;
}

.notif-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    width: 380px; max-height: 500px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
    z-index: 1200; overflow: hidden;
    display: flex; flex-direction: column;
    animation: ctxIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.notif-dropdown-header h3 {
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    letter-spacing: -0.01em;
}
.notif-dropdown-header h3 svg { width: 15px; height: 15px; color: var(--accent); }
.notif-dropdown-body { overflow-y: auto; flex: 1; }

.notif-item {
    display: flex; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer; transition: all var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { border-left: 3px solid var(--accent); background: rgba(139,92,246,0.04); }

.notif-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notif-icon svg { width: 16px; height: 16px; }
.notif-icon.comment { background: rgba(139,92,246,0.08); color: var(--accent); border: 1px solid rgba(139,92,246,0.12); }
.notif-icon.upload { background: rgba(16,185,129,0.08); color: var(--success); border: 1px solid rgba(16,185,129,0.12); }
.notif-icon.approval { background: rgba(16,185,129,0.1); color: #22c55e; border: 1px solid rgba(16,185,129,0.15); }

.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.notif-message { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.notif-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 12.5px; }

/* ============================================
   Activity Log Panel
   ============================================ */

.activity-filters {
    display: flex; gap: 8px; margin-bottom: 16px;
    flex-wrap: wrap; align-items: flex-end;
}
.activity-filters > div { display: flex; flex-direction: column; }
.activity-filters label {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    display: block; margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.activity-filters input,
.activity-filters select {
    padding: 7px 10px; font-size: 12px;
    background: rgba(255, 255, 255, 0.02); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    font-family: inherit;
    transition: all var(--transition);
}
.activity-filters input:focus,
.activity-filters select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
    outline: none;
}

.activity-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.activity-table th {
    text-align: left; padding: 10px 10px; font-size: 10px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); border-bottom: 1px solid var(--border-color);
}
.activity-table td {
    padding: 9px 10px; border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.activity-table tr { transition: background var(--transition); }
.activity-table tr:hover td { background: var(--bg-hover); }

.action-badge {
    font-size: 10px; padding: 3px 9px; border-radius: 12px;
    font-weight: 600; display: inline-flex; align-items: center;
    gap: 3px; white-space: nowrap; letter-spacing: 0.01em;
}
.action-badge.upload { background: rgba(16,185,129,0.08); color: var(--success); }
.action-badge.delete { background: rgba(239,68,68,0.08); color: var(--danger); }
.action-badge.rename { background: rgba(6,182,212,0.08); color: var(--info); }
.action-badge.create_folder { background: rgba(245,158,11,0.08); color: var(--warning); }
.action-badge.save_file { background: rgba(139,92,246,0.08); color: var(--accent); }
.action-badge.login { background: rgba(16,185,129,0.08); color: var(--success); }
.action-badge.logout { background: rgba(255,255,255,0.03); color: var(--text-muted); }
.action-badge.user_created { background: rgba(16,185,129,0.08); color: var(--success); }
.action-badge.user_updated { background: rgba(6,182,212,0.08); color: var(--info); }
.action-badge.user_deleted { background: rgba(239,68,68,0.08); color: var(--danger); }
.action-badge.password_changed { background: rgba(245,158,11,0.08); color: var(--warning); }
.action-badge.review_added { background: rgba(139,92,246,0.08); color: var(--accent); }
.action-badge.review_deleted { background: rgba(239,68,68,0.08); color: var(--danger); }
.action-badge.trash_restore { background: rgba(16,185,129,0.08); color: var(--success); }
.action-badge.trash_purge { background: rgba(239,68,68,0.08); color: var(--danger); }
.action-badge.share_created { background: rgba(6,182,212,0.08); color: var(--info); }

.activity-path {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-secondary); max-width: 200px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-load-more { text-align: center; padding: 12px; }

/* ============================================
   Trash Panel
   ============================================ */

.trash-meta { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }
.trash-actions { display: flex; gap: 4px; justify-content: flex-end; }
.btn-restore { color: var(--success) !important; }
.btn-restore:hover { background: rgba(16,185,129,0.1) !important; box-shadow: 0 0 8px rgba(16,185,129,0.1) !important; }

/* ============================================
   Deep Search Modal
   ============================================ */

.deep-search-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 640px; max-width: 95%;
    max-height: 70vh;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Shimmer line */
.deep-search-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

.deep-search-input-wrap {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 22px; border-bottom: 1px solid var(--border-color);
    position: relative;
}
.deep-search-input-wrap svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; opacity: 0.7; }

.deep-search-input {
    flex: 1; background: none; border: none;
    color: var(--text-primary); font-size: 15px;
    font-family: inherit; outline: none;
    letter-spacing: -0.01em;
}
.deep-search-input::placeholder { color: var(--text-muted); }

.deep-search-results { overflow-y: auto; flex: 1; padding: 4px 0; }

.deep-search-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px; cursor: pointer; transition: all var(--transition);
    position: relative;
}
.deep-search-item:hover { background: var(--bg-hover); }
.deep-search-item:hover::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: var(--accent); opacity: 0.5; border-radius: 0 2px 2px 0;
}

.deep-search-item-info { flex: 1; min-width: 0; }
.deep-search-item-name { font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em; }
.deep-search-item-path {
    font-size: 10.5px; color: var(--text-muted);
    font-family: var(--font-mono);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-top: 1px;
}
.deep-search-item-meta { font-size: 10.5px; color: var(--text-muted); flex-shrink: 0; text-align: right; }

.deep-search-status { padding: 12px 20px; font-size: 11.5px; color: var(--text-muted); text-align: center; }
.deep-search-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 12.5px; }
.deep-search-loading { display: flex; justify-content: center; padding: 40px; }

/* ============================================
   Share Links Modal
   ============================================ */

.share-config { display: flex; flex-direction: column; gap: 14px; }
.share-config label {
    font-size: 10.5px; font-weight: 600; color: var(--text-muted);
    display: block; margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.share-config select,
.share-config input[type="number"] {
    padding: 8px 12px; background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius); font-family: inherit; font-size: 12.5px;
    width: 100%; transition: all var(--transition);
}
.share-config select:focus,
.share-config input[type="number"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
    outline: none;
}

.share-link-result {
    display: flex; gap: 8px; align-items: center;
    padding: 10px 14px; background: rgba(139, 92, 246, 0.04);
    border: 1px solid var(--accent-border); border-radius: var(--radius);
    margin-top: 14px;
}
.share-link-url {
    flex: 1; font-family: var(--font-mono); font-size: 11px;
    color: var(--accent); overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; user-select: all;
}

.share-existing-title {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 18px 0 10px; padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.share-link-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius); margin-bottom: 6px; font-size: 12px;
    transition: all var(--transition);
}
.share-link-item:hover { border-color: var(--border-light); }
.share-link-info { flex: 1; min-width: 0; }
.share-link-expires { color: var(--text-muted); font-size: 10.5px; }
.share-link-count { color: var(--text-muted); font-size: 10.5px; }
.share-link-expired { opacity: 0.4; }

/* ============================================
   Selection & Focus Polish
   ============================================ */

::selection {
    background: rgba(139, 92, 246, 0.25);
    color: #fff;
}

::-moz-selection {
    background: rgba(139, 92, 246, 0.25);
    color: #fff;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: var(--accent-glow);
}

/* Smooth anchor transitions */
a {
    transition: color var(--transition);
}

/* Global transitions for interactive elements */
input, select, textarea {
    transition: all var(--transition);
}

/* Better placeholder styling */
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ============================================
   UI Redesign: Top Bar Enhancements
   ============================================ */

.top-bar {
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 12px rgba(0,0,0,0.2), 0 1px 0 var(--accent-border);
}

.logo .logo-accent {
    color: var(--accent);
    font-weight: 800;
}

/* User Avatar */
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 3px var(--accent-border);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 42px;
    height: 22px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent-border);
}

.theme-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.theme-toggle.active .theme-toggle-knob {
    transform: translateX(20px);
}

.theme-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    transition: opacity 0.2s ease;
}

.theme-toggle-icon.purple {
    left: 4px;
    color: #8b5cf6;
}

.theme-toggle-icon.orange {
    right: 4px;
    color: #F97316;
}

/* ============================================
   UI Redesign: View Toggle (List / Grid)
   ============================================ */

.view-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.view-toggle-btn svg {
    width: 15px;
    height: 15px;
}

.view-toggle-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.view-toggle-btn.active {
    color: var(--accent);
    background: var(--accent-bg);
}

/* Grid View Layout */
.file-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
}

.file-grid.grid-view .file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    text-align: center;
    min-height: 120px;
    transition: all var(--transition);
    cursor: pointer;
}

.file-grid.grid-view .file-item:hover {
    border-color: var(--accent-border);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-grid.grid-view .file-item.selected {
    border-color: var(--accent);
    background: var(--accent-bg);
    box-shadow: var(--accent-glow);
}

.file-grid.grid-view .file-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
}

.file-grid.grid-view .file-icon svg {
    width: 44px;
    height: 44px;
}

.file-grid.grid-view .file-name {
    font-size: 11.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.3;
}

.file-grid.grid-view .file-size,
.file-grid.grid-view .file-date {
    display: none;
}

.file-grid.grid-view .file-actions-col {
    display: none;
}

.file-grid.grid-view .file-list-header {
    display: none;
}

/* ============================================
   UI Redesign: Colored File Type Icons
   ============================================ */

.file-icon.folder svg { color: #F59E0B; filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.2)); }
.file-icon.image svg { color: #EC4899; filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.2)); }
.file-icon.video svg { color: #EF4444; filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.2)); }
.file-icon.audio svg { color: #8B5CF6; filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.2)); }
.file-icon.pdf svg { color: #EF4444; filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.15)); }
.file-icon.code svg { color: #10B981; filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2)); }
.file-icon.markdown svg { color: #06B6D4; filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.2)); }
.file-icon.document svg { color: #3B82F6; filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.2)); }
.file-icon.archive svg { color: #F97316; filter: drop-shadow(0 0 4px rgba(249, 115, 22, 0.2)); }
.file-icon.text svg { color: var(--text-secondary); }

/* ============================================
   UI Redesign: Animations & Micro-interactions
   ============================================ */

/* Staggered file item entrance */
@keyframes fileItemSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item.animate-in {
    animation: fileItemSlideIn 0.25s ease forwards;
    opacity: 0;
}

/* Preview panel slide-in */
@keyframes previewSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.preview-panel.open {
    animation: previewSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Modal entrance */
@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-overlay.active .modal {
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast slide-in */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast {
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Folder hover bounce */
.file-icon.folder {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.file-item:hover .file-icon.folder {
    transform: scale(1.08);
}

/* Button click feedback */
.btn:active {
    transform: scale(0.97);
}

/* ============================================
   UI Redesign: Enhanced Empty State
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 48px 24px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state .hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.empty-state .empty-action {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ============================================
   UI Redesign: Breadcrumb Enhancement
   ============================================ */

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition);
}

.breadcrumb-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0.4;
    margin: 0 2px;
    user-select: none;
}

/* ============================================
   UI Redesign: Notification Badge Pulse
   ============================================ */

@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.notif-badge:not([style*="display:none"]):not(:empty) {
    animation: notifPulse 2s infinite;
}

.notif-badge[data-count="0"] {
    display: none !important;
}

/* ============================================
   UI Redesign: Drag & Drop Enhancement
   ============================================ */

@keyframes dropZonePulse {
    0%, 100% { border-color: var(--accent); box-shadow: 0 0 0 0 var(--accent-bg); }
    50% { border-color: var(--accent-hover); box-shadow: 0 0 0 8px transparent; }
}

.drop-zone.active {
    animation: dropZonePulse 1.5s ease-in-out infinite;
    background: radial-gradient(ellipse at center, var(--accent-bg) 0%, transparent 70%);
}

.drop-zone.active .drop-zone-content svg {
    animation: floatUpDown 1.5s ease-in-out infinite;
}

@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.drop-zone.active .drop-zone-content p {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   UI Redesign: Mobile & Responsive
   ============================================ */

@media (max-width: 900px) {
    .theme-toggle { display: none; }
    .view-toggle { display: none; }
    .file-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        padding: 10px;
    }
}

@media (max-width: 600px) {
    .top-bar { padding: 0 12px; height: 48px; }
    .logo { font-size: 13px; gap: 6px; }
    .logo svg { width: 18px; height: 18px; }
    .toolbar { padding: 6px 10px; gap: 6px; flex-wrap: wrap; }
    .search-box { min-width: 120px; }
    .user-avatar { width: 26px; height: 26px; font-size: 10px; }
    .breadcrumb { gap: 4px; font-size: 11px; }
    .file-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
        padding: 8px;
    }
    .file-grid.grid-view .file-item {
        padding: 14px 8px 10px;
        min-height: 90px;
    }
    .file-grid.grid-view .file-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 6px;
    }
    .file-grid.grid-view .file-icon svg {
        width: 32px;
        height: 32px;
    }
    .file-grid.grid-view .file-name {
        font-size: 10.5px;
    }
    .empty-state svg { width: 48px; height: 48px; }
    .empty-state p { font-size: 13px; }
}

/* ============================================
   UI Redesign: Smooth Page Transition
   ============================================ */

.file-grid {
    transition: opacity 0.15s ease;
}

.file-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Upload progress enhancement */
.upload-progress.active {
    animation: modalPopIn 0.3s ease forwards;
}

/* ============================================
   Enhanced User Management: Tree Folder Picker
   ============================================ */

.folder-tree-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    font-size: 10px;
    line-height: 1;
}

.folder-tree-toggle:hover {
    color: var(--accent);
}

.folder-tree-toggle.expanded {
    transform: rotate(90deg);
}

.folder-tree-toggle.placeholder {
    visibility: hidden;
}

.folder-picker-item .tree-loading {
    width: 12px;
    height: 12px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

/* ============================================
   Enhanced User Management: Per-Folder Permissions
   ============================================ */

.folder-perm-toggle {
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    background: none;
    border: none;
    transition: var(--transition);
    margin-left: auto;
    flex-shrink: 0;
}

.folder-perm-toggle:hover {
    color: var(--accent);
    background: var(--accent-bg);
}

.folder-perm-toggle.active {
    color: var(--accent);
}

.folder-perm-override {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    animation: folderPermSlide 0.2s ease;
}

@keyframes folderPermSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.folder-perm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.folder-perm-grid .perm-checkbox {
    padding: 4px 6px;
    font-size: 10px;
    gap: 5px;
}

.folder-perm-grid .perm-checkbox .perm-icon {
    width: 14px;
    height: 14px;
}

.folder-perm-grid .perm-checkbox .perm-icon svg {
    width: 9px;
    height: 9px;
}

.folder-perm-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-style: italic;
}

/* ============================================
   Enhanced User Management: Team Selector
   ============================================ */

.team-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-height: 40px;
}

.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    transition: all var(--transition);
    user-select: none;
}

.team-chip:hover {
    border-color: var(--accent-border);
    background: var(--accent-bg);
}

.team-chip.selected {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

.team-chip .team-chip-icon {
    width: 14px;
    height: 14px;
}

.team-selector-empty {
    width: 100%;
    text-align: center;
    padding: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   Enhanced User Management: User Summary
   ============================================ */

.user-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0;
}

.summary-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.04);
}

.summary-row-label {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 100px;
    flex-shrink: 0;
}

.summary-row-value {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.summary-perms-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.summary-perm-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}

.summary-perm-tag.active {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
}

.summary-folder-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-folder-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-secondary);
    border-radius: 4px;
    background: rgba(255,255,255,0.015);
}

.summary-folder-item svg {
    width: 14px;
    height: 14px;
    color: var(--warning);
    flex-shrink: 0;
}

.summary-folder-perms {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
}

.summary-teams-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.summary-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Enhanced User Management: Permission Templates
   ============================================ */

.template-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.template-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    transition: all var(--transition);
    user-select: none;
    position: relative;
}

.template-card:hover {
    border-color: var(--accent-border);
    background: var(--accent-bg);
}

.template-card.active {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
}

.template-card.builtin {
    border-style: dashed;
}

.template-card .template-delete {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    margin-left: 2px;
    border: none;
    padding: 0;
    font-size: 10px;
}

.template-card:hover .template-delete {
    opacity: 1;
}

.template-card .template-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.template-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    border: 1px dashed var(--border-light);
    background: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.template-save-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

/* ============================================
   Enhanced User Management: Copy From User
   ============================================ */

.copy-user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: folderPermSlide 0.15s ease;
}

.copy-user-dropdown::-webkit-scrollbar { width: 5px; }
.copy-user-dropdown::-webkit-scrollbar-track { background: transparent; }
.copy-user-dropdown::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.copy-user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.copy-user-item:last-child {
    border-bottom: none;
}

.copy-user-item:hover {
    background: var(--accent-bg);
    color: var(--text-primary);
}

.copy-user-item .copy-user-name {
    flex: 1;
}

.copy-user-item .copy-user-role {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.copy-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    border: 1px dashed var(--border-light);
    background: none;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}

.copy-user-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}

/* Quick setup row */
.quick-setup-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-setup-row > .template-selector {
    flex: 1;
    min-width: 0;
}

/* ============================================ */
/* Dashboard                                     */
/* ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 20px;
    max-width: 1200px;
}

.dash-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.dash-card-wide {
    grid-column: 1 / -1;
}

.dash-card-header {
    padding: 14px 16px 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-card-header svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dash-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.dash-stats-row {
    display: flex;
    gap: 0;
    padding: 0;
    grid-column: 1 / -1;
}

.dash-stat {
    flex: 1;
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-stat:last-child {
    border-right: none;
}

.dash-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.dash-stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.dash-quick-actions {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-list {
    max-height: 400px;
    overflow-y: auto;
}

.dash-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    transition: background 0.15s;
}

.dash-list-item:last-child {
    border-bottom: none;
}

.dash-list-clickable {
    cursor: pointer;
}

.dash-list-clickable:hover {
    background: var(--hover);
}

.dash-list-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.dash-list-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.dash-list-meta {
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}

.dash-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

.dash-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
}

.dash-project-card {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.dash-project-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dash-project-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dash-project-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
    word-break: break-all;
}

.dash-project-meta {
    font-size: 12px;
    color: var(--muted);
}

.dash-project-date {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.dashboard-loading, .dashboard-error {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ============================================ */
/* Threaded Reviews                              */
/* ============================================ */

.review-item[data-depth="1"] {
    border-left: 2px solid var(--border);
}

.review-item[data-depth="2"] {
    border-left: 2px solid rgba(139, 92, 246, 0.3);
}

.review-reply-actions {
    padding: 0 12px 8px;
}

.review-reply-btn {
    font-size: 11px !important;
    color: var(--muted) !important;
    padding: 2px 8px !important;
}

.review-reply-btn:hover {
    color: var(--primary) !important;
}

.review-reply-form {
    padding: 0 12px 12px;
    margin-left: 12px;
}

.review-reply-textarea {
    min-height: 60px !important;
    font-size: 12px !important;
}

.review-reply-submit {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* ============================================ */
/* Version History                               */
/* ============================================ */

.versions-section {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.versions-header {
    padding: 8px 12px;
}

.versions-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.versions-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    background: var(--hover);
    padding: 1px 7px;
    border-radius: 10px;
}

.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    transition: background 0.15s;
}

.version-item:hover {
    background: var(--hover);
}

.version-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.version-number {
    font-weight: 600;
    color: var(--primary);
    min-width: 28px;
}

.version-author {
    color: var(--text);
    font-weight: 500;
}

.version-date {
    color: var(--muted);
    font-size: 11px;
}

.version-size {
    color: var(--muted);
    font-size: 11px;
}

.version-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.version-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.version-badge {
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
}

/* ============================================ */
/* Settings Panel                                */
/* ============================================ */

.settings-form {
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px 0;
}

.settings-section {
    margin-bottom: 16px;
}

.settings-section-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
    padding: 8px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 12px;
}

.settings-row label {
    font-size: 13px;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.settings-row input[type="text"],
.settings-row input[type="number"],
.settings-row input[type="url"] {
    width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
}

.settings-row input[type="color"] {
    width: 50px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    cursor: pointer;
}

.settings-row select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    min-width: 100px;
}

/* ============================================ */
/* Session Management                            */
/* ============================================ */

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.session-item:last-child {
    border-bottom: none;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.session-ip {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.session-ua {
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-time {
    font-size: 11px;
    color: var(--muted);
}

/* ============================================ */
/* Login Lockout Warning                         */
/* ============================================ */

.login-lockout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

/* ============================================ */
/* Responsive Dashboard                          */
/* ============================================ */

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }

    .dash-stats-row {
        flex-direction: column;
    }

    .dash-stat {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px;
    }

    .dash-stat:last-child {
        border-bottom: none;
    }

    .dash-projects {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .settings-row input[type="text"],
    .settings-row input[type="number"] {
        width: 100%;
    }
}

/* ============================================
   @Mentions Dropdown
   ============================================ */
.mention-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--transition);
}

.mention-item:hover,
.mention-item.active {
    background: var(--accent-bg);
}

.mention-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mention-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.mention-displayname {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mention-username {
    font-size: 11px;
    color: var(--text-muted);
}

.mention-highlight {
    color: var(--accent);
    font-weight: 500;
    background: var(--accent-bg);
    padding: 1px 4px;
    border-radius: 3px;
    cursor: default;
}

/* ============================================
   Star / Favorites
   ============================================ */
.file-star-col {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
}

.star-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.3;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.star-btn svg {
    width: 14px;
    height: 14px;
}

.star-btn:hover {
    opacity: 1;
    color: #F59E0B;
    transform: scale(1.15);
}

.star-btn.active {
    opacity: 1;
    color: #F59E0B;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
}

.star-btn.active:hover {
    color: #D97706;
}

.file-item:hover .star-btn {
    opacity: 0.6;
}

.file-item:hover .star-btn.active {
    opacity: 1;
}

/* Grid view star positioning */
.file-grid.grid-view .file-star-col {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
}

.file-grid.grid-view .star-btn {
    opacity: 0;
}

.file-grid.grid-view .file-item:hover .star-btn {
    opacity: 0.6;
}

.file-grid.grid-view .star-btn.active {
    opacity: 1;
}

.file-grid.grid-view .file-item {
    position: relative;
}

/* ============================================
   Dashboard: Favorites & Recent Files
   ============================================ */
.dash-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 12px;
}

.dash-fav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition);
    gap: 6px;
}

.dash-fav-item:hover {
    border-color: var(--accent-border);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dash-fav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-fav-icon svg {
    width: 28px;
    height: 28px;
}

.dash-fav-name {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.dash-fav-path {
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.dash-recent-strip {
    display: flex;
    gap: 10px;
    padding: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.dash-recent-strip::-webkit-scrollbar {
    height: 4px;
}

.dash-recent-strip::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.dash-recent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 90px;
    max-width: 100px;
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    gap: 4px;
}

.dash-recent-item:hover {
    border-color: var(--accent-border);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.dash-recent-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-recent-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.dash-recent-name {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.dash-recent-meta {
    font-size: 10px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .mention-dropdown {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
    }
    .dash-favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 600px) {
    .file-star-col {
        width: 24px;
    }
    .star-btn svg {
        width: 12px;
        height: 12px;
    }
}
