/* =============================================
   CSS Variables - Modern Theme
   ============================================= */
:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.1);
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning-color: #f59e0b;
    --code-bg: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Layout */
    --sidebar-width: 280px;
    --toc-width: 240px;
    --content-max-width: 850px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-light: rgba(96, 165, 250, 0.15);
    --code-bg: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* =============================================
   Base Styles
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    display: flex;
    min-height: 100vh;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =============================================
   Mobile Menu Toggle
   ============================================= */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    box-shadow: var(--shadow);
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

/* Brand Section */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #8b5cf6 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brand-info {
    flex: 1;
    min-width: 0;
}

.brand-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.3;
}

.brand-subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

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

/* Search */
.search-container {
    padding: 16px 16px 8px;
    position: relative;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 80px 10px 40px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-shortcut {
    position: absolute;
    right: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 16px;
    right: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

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

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 13px;
}

.search-result-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.search-result-excerpt mark {
    background: rgba(251, 191, 36, 0.3);
    color: inherit;
    padding: 1px 3px;
    border-radius: 2px;
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

/* Sidebar Sections */
.sidebar-section {
    padding: 8px 0;
}

.sidebar-section.folders-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.section-action-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.section-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0 8px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.15s;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-nav-item.active {
    background: var(--accent-light);
    color: var(--accent-color);
}

.sidebar-nav-item svg {
    flex-shrink: 0;
    color: inherit;
}

.sidebar-nav-item span {
    flex: 1;
}

.nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.sidebar-nav-item.active .nav-badge {
    background: var(--accent-color);
    color: white;
}

/* Navigation Tree */
.nav-tree {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px 8px;
    min-height: 0;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent-color);
}

.nav-group {
    margin-bottom: 4px;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    padding-right: 40px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius);
    position: relative;
    font-size: 13px;
    transition: background 0.15s;
}

.nav-group-title:hover {
    background: var(--bg-tertiary);
}

.nav-group-title::after {
    content: '';
    position: absolute;
    right: 16px;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(-45deg);
    transition: transform 0.2s;
}

.nav-group.collapsed .nav-group-title::after {
    transform: rotate(45deg);
}

.nav-group-items {
    display: block;
    padding-left: 12px;
    margin-top: 2px;
}

.nav-group.collapsed .nav-group-items {
    display: none;
}

.nav-group-items .nav-link {
    padding-left: 20px;
    font-weight: 400;
}

.nav-folder-icon,
.nav-doc-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}

.nav-folder-name,
.nav-doc-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 10px;
}

.nav-action-btn {
    position: absolute;
    right: 8px;
    opacity: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.nav-item:hover .nav-action-btn,
.nav-group-title:hover .nav-action-btn {
    opacity: 1;
}

.nav-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-group-title .nav-action-btn {
    right: 32px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--accent-color);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.sidebar-action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

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

/* =============================================
   Main Content
   ============================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content.with-toc {
    margin-right: var(--toc-width);
}

/* Main Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    flex: 1;
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sun-icon, .moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon,
:root:not([data-theme]) .moon-icon {
    display: none;
}

/* Documents View */
.documents-view {
    flex: 1;
    padding: 24px 32px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.filter-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle {
    display: flex;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.view-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Documents Table */
.documents-table-wrapper {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
}

.documents-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.documents-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.documents-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.documents-table tbody tr:last-child td {
    border-bottom: none;
}

.documents-table tbody tr {
    transition: background 0.15s;
    cursor: pointer;
}

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

.col-name {
    width: 45%;
}

.col-type {
    width: 15%;
}

.col-folder {
    width: 25%;
}

.col-actions {
    width: 15%;
    text-align: right;
}

/* Document Row Styling */
.doc-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    flex-shrink: 0;
}

.doc-icon.csv {
    background: var(--success-light);
    color: var(--success-color);
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-path {
    font-size: 12px;
    color: var(--text-muted);
}

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.type-badge.md {
    background: var(--accent-light);
    color: var(--accent-color);
}

.type-badge.csv {
    background: var(--success-light);
    color: var(--success-color);
}

.folder-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

.folder-badge svg {
    width: 14px;
    height: 14px;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.row-action-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.row-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.row-action-btn.danger:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0 0 24px;
    font-size: 14px;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Content View */
.content-view {
    flex: 1;
    padding: 0;
    max-width: 100%;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.content-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.content-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.content-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.content-action-btn.primary {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.content-action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.content-action-btn.danger {
    color: var(--danger-color);
}

.content-action-btn.danger:hover {
    background: var(--danger-light);
    border-color: var(--danger-color);
}

.content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 40px 32px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* =============================================
   Table of Contents
   ============================================= */
.toc {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--toc-width);
    height: 100vh;
    padding: 100px 24px 40px;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: none;
}

.toc.visible {
    display: block;
}

.toc-title {
    margin: 0 0 16px 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    line-height: 1.4;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: var(--accent-color);
    text-decoration: none;
    background: var(--bg-tertiary);
}

.toc-link.active {
    color: var(--accent-color);
    background: var(--accent-light);
    border-left-color: var(--accent-color);
}

.toc-link.toc-h3 {
    padding-left: 24px;
    font-size: 12px;
}

/* =============================================
   Markdown Content Styles
   ============================================= */
.content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem 0;
    color: var(--text-primary);
}

.content h4, .content h5, .content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem 0;
    color: var(--text-primary);
}

.content p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.content ul, .content ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--accent-color);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.content blockquote p {
    margin: 0;
}

.content pre {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
}

.content code {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
}

.content p code,
.content li code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-color);
}

.content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.content th, .content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.content th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
}

.content tr:last-child td {
    border-bottom: none;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5rem 0;
}

/* Heading anchors */
.content h2, .content h3, .content h4 {
    position: relative;
}

.heading-anchor {
    position: absolute;
    left: -1.5rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
    text-decoration: none;
    font-weight: 400;
}

.content h2:hover .heading-anchor,
.content h3:hover .heading-anchor,
.content h4:hover .heading-anchor {
    opacity: 1;
}

/* =============================================
   Context Menu
   ============================================= */
.context-menu {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    display: none;
    padding: 4px;
}

.context-menu.active {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.context-menu-danger {
    color: var(--danger-color);
}

.context-menu-danger:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

/* =============================================
   Modal Styles
   ============================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* =============================================
   Upload Modal
   ============================================= */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.upload-zone.drag-over {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-text {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-subtext {
    margin: 0 0 16px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.upload-target {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-target label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.upload-target select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
}

.upload-progress {
    margin-top: 24px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0;
    transition: width 0.3s;
    border-radius: 3px;
}

.progress-text {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.upload-results {
    margin-top: 16px;
}

.upload-success {
    padding: 16px;
    background: var(--success-light);
    border-radius: var(--radius);
    color: var(--success-color);
    font-weight: 500;
}

.upload-success ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    font-weight: 400;
}

.upload-error {
    padding: 16px;
    background: var(--danger-light);
    border-radius: var(--radius);
    color: var(--danger-color);
}

/* =============================================
   Editor Modal
   ============================================= */
.editor-modal .modal-content {
    max-width: 1000px;
    height: 85vh;
}

.editor-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.editor-status {
    font-size: 13px;
    color: var(--text-muted);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.toolbar-btn {
    padding: 8px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--accent-color);
    color: white;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.editor-path-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.editor-path-input label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}

.editor-path-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.editor-textarea {
    flex: 1;
    padding: 16px;
    border: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.7;
    resize: none;
    outline: none;
}

.editor-preview-section {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

.editor-preview-section.hidden {
    display: none;
}

.editor-preview {
    padding: 24px;
}

.editor-preview h1 {
    font-size: 1.75rem;
    margin: 0 0 1rem 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.editor-preview h2 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem 0;
}

.editor-preview h3 {
    font-size: 1.15rem;
    margin: 1.25rem 0 0.5rem 0;
}

.editor-preview p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.editor-preview pre {
    background: var(--code-bg);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.editor-preview code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.875em;
}

/* Editor Type Toggle */
.editor-type-toggle {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.editor-type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-type-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.editor-type-btn.active {
    background: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.editor-type-btn svg {
    flex-shrink: 0;
}

/* Editor Section Styles */
.editor-section {
    flex: 1;
    display: flex;
    overflow: hidden;
}

#richtextSection {
    flex-direction: column;
}

/* Path Input with Extension */
.path-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.path-input-wrapper input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', monospace;
    outline: none;
}

.path-extension {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', monospace;
    border-left: 1px solid var(--border-color);
}

/* Quill Editor Customization */
#richtextSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#richtextSection .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

#richtextSection .ql-container {
    flex: 1;
    border: none;
    font-family: inherit;
    font-size: 14px;
    overflow-y: auto;
}

#richtextSection .ql-editor {
    padding: 24px;
    min-height: 100%;
    color: var(--text-primary);
}

#richtextSection .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
}

/* Dark mode Quill adjustments */
[data-theme="dark"] #richtextSection .ql-toolbar {
    background: var(--bg-secondary);
}

[data-theme="dark"] #richtextSection .ql-stroke {
    stroke: var(--text-secondary);
}

[data-theme="dark"] #richtextSection .ql-fill {
    fill: var(--text-secondary);
}

[data-theme="dark"] #richtextSection .ql-picker {
    color: var(--text-secondary);
}

[data-theme="dark"] #richtextSection .ql-picker-options {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] #richtextSection .ql-toolbar button:hover,
[data-theme="dark"] #richtextSection .ql-toolbar button.ql-active {
    color: var(--accent-color);
}

[data-theme="dark"] #richtextSection .ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] #richtextSection .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent-color);
}

[data-theme="dark"] #richtextSection .ql-toolbar button:hover .ql-fill,
[data-theme="dark"] #richtextSection .ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent-color);
}

/* =============================================
   Overlay (Mobile)
   ============================================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =============================================
   Responsive Design
   ============================================= */
@media (max-width: 1200px) {
    .toc {
        display: none !important;
    }

    .main-content,
    .main-content.with-toc {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

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

    .main-header {
        padding: 16px 20px;
        padding-top: 70px;
    }

    .page-title {
        font-size: 20px;
    }

    .documents-view {
        padding: 16px 20px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        overflow-x: auto;
    }

    .documents-table th,
    .documents-table td {
        padding: 12px;
    }

    .col-folder {
        display: none;
    }

    .content {
        padding: 24px 20px;
    }

    .content h1 {
        font-size: 1.5rem;
    }

    .content h2 {
        font-size: 1.25rem;
    }
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
    .sidebar,
    .toc,
    .mobile-menu-toggle,
    .overlay,
    .main-header,
    .filter-bar,
    .content-header,
    .modal {
        display: none !important;
    }

    .main-content {
        margin: 0;
    }

    .documents-view {
        padding: 0;
    }

    body {
        background: white;
        color: black;
    }

    .content a {
        color: black;
        text-decoration: underline;
    }

    .content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .content pre {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .content h2, .content h3 {
        page-break-after: avoid;
    }
}

/* =============================================
   Scrollbar Styling
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

/* =============================================
   Toast Notifications
   ============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    min-width: 280px;
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info .toast-icon {
    color: var(--accent-color);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* =============================================
   HTML/Rich Text Badge
   ============================================= */
.type-badge.html {
    background: #f97316;
    color: white;
}

.doc-icon.html {
    color: #f97316;
}

/* =============================================
   Login Screen
   ============================================= */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #8b5cf6 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 20px;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-error {
    padding: 12px;
    background: var(--danger-light);
    border-radius: var(--radius);
    color: var(--danger-color);
    font-size: 13px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn .spinner {
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* =============================================
   User Menu
   ============================================= */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.15s;
}

.user-menu-btn:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.user-email {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.15s;
    z-index: 100;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px 16px;
}

.user-dropdown-email {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.user-dropdown-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.user-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-dropdown-item svg {
    flex-shrink: 0;
}

/* =============================================
   Users Management
   ============================================= */
.users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

.btn-sm svg {
    margin-right: 6px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.user-item-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.user-item-email {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.user-item-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.user-item-badge {
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.user-item-badge.admin {
    background: #fef3c7;
    color: #d97706;
}

.user-item-actions {
    display: flex;
    gap: 8px;
}

.user-action-btn {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.15s;
}

.user-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-action-btn.danger:hover {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Checkbox styling */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
}

/* Hide app container initially */
.app-container {
    display: contents;
}

@media (max-width: 600px) {
    .user-email {
        display: none;
    }

    .login-container {
        padding: 24px;
    }
}
