* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #d1d5db;
  color: var(--gray-900);
  line-height: 1.5;
}

/* Layout */
.app { height: 100vh; display: flex; flex-direction: column; }
.header { background: white; border-bottom: 1px solid var(--gray-200); padding: 0.75rem 1rem; display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.header h1 { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.main { flex: 1; display: flex; overflow: hidden; }

/* Home Layout avec sidebar */
.home-layout { display: flex; flex: 1; overflow: hidden; }
.home-sidebar { width: 240px; background: var(--gray-50); border-right: 1px solid var(--gray-200); padding: 1rem 0; overflow-y: auto; flex-shrink: 0; }
.home-content { flex: 1; overflow-y: auto; padding: 0.75rem; background: var(--gray-100); }

.sidebar-section { margin-bottom: 0.75rem; }
.sidebar-title { font-size: 0.625rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 0.75rem; margin-bottom: 0.25rem; display: flex; justify-content: space-between; align-items: center; }
.sidebar-action { color: var(--primary); cursor: pointer; font-size: 0.625rem; }
.sidebar-action:hover { text-decoration: underline; }
.sidebar-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.75rem; cursor: pointer; color: var(--gray-700); font-size: 0.8125rem; transition: background 0.1s; border-radius: 0.25rem; margin: 0 0.25rem; }
.sidebar-item:hover { background: var(--gray-100); }
.sidebar-item.active { background: #e0e7ff; color: var(--primary); }
.sidebar-icon { font-size: 0.875rem; width: 18px; text-align: center; }
.sidebar-project { font-size: 0.8125rem; }
.sidebar-project-icon { width: 22px; height: 22px; background: #dbeafe; color: var(--primary); border-radius: 0.25rem; display: flex; align-items: center; justify-content: center; font-size: 0.5625rem; font-weight: 700; flex-shrink: 0; }
.sidebar-empty { font-size: 0.75rem; color: var(--gray-400); padding: 0.25rem 0.75rem; font-style: italic; }

/* Sidebar */
.sidebar { width: 280px; background: var(--gray-50); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.sidebar-actions { padding: 0.375rem 0.75rem; }
.sidebar-actions .btn { width: 100%; justify-content: center; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 0.375rem 0.25rem; }
.sidebar-footer { padding: 0.5rem 0.75rem; border-top: 1px solid var(--gray-200); font-size: 0.6875rem; color: var(--gray-500); }

/* Content */
.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: transparent; }
.content-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-200); flex-shrink: 0; }
.content-body { flex: 1; overflow-y: auto; padding: 1rem; }
.content-inner { width: 80%; max-width: 1400px; margin: 0 auto; padding: 1rem; background: white; border-radius: 0.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* Dans la vue wiki (avec sidebar), content-inner prend toute la largeur */
.main .content .content-inner { width: 100%; max-width: none; margin: 0; }

/* Dans la home, content-inner prend toute la largeur */
.home-content .content-inner { width: 100%; max-width: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-favorite { font-size: 1.1rem; min-width: 28px; opacity: 0.3; filter: grayscale(100%); }
.btn-favorite:hover { opacity: 0.5; transform: scale(1.1); }
.btn-favorite.active { opacity: 1; filter: none; }
.btn-favorite.active:hover { transform: scale(1.1); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-block { width: 100%; justify-content: center; }

/* Form */
.input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300); border-radius: 0.5rem; font-size: 0.875rem; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.input-lg { padding: 0.75rem 1rem; font-size: 1.25rem; font-weight: 600; }
.textarea { resize: vertical; min-height: 100px; }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.375rem; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.5rem; }

/* Tree */
.tree-item { margin: 2px 0; }
.tree-item-row { display: flex; align-items: center; gap: 0.25rem; padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; transition: background 0.1s; }
.tree-item-row:hover { background: var(--gray-100); }
.tree-item-row.active { background: #dbeafe; color: var(--primary); }
.tree-toggle { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 0.25rem; }
.tree-toggle:hover { background: var(--gray-200); }
.tree-icon { font-size: 1rem; }
.tree-title { flex: 1; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-badge { font-size: 0.625rem; padding: 0.125rem 0.375rem; background: var(--warning); color: white; border-radius: 0.25rem; }
.tree-children { margin-left: 1.25rem; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--gray-500); }
.breadcrumb a { color: var(--gray-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--gray-900); font-weight: 500; }

/* Page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-200); }
.page-title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); }
.page-meta { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.25rem; }
.page-actions { display: flex; gap: 0.5rem; }

/* Status badges */
.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.5rem; font-size: 0.75rem; font-weight: 500; border-radius: 0.375rem; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-default { background: #dbeafe; color: #1e40af; }

/* Wiki content */
.wiki-content { line-height: 1.7; }
.wiki-content > *:first-child { margin-top: 0; }
.wiki-content h1 { font-size: 1.75rem; font-weight: 700; margin: 1.5rem 0 1rem; color: var(--gray-900); }
.wiki-content h2 { font-size: 1.5rem; font-weight: 600; margin: 1.25rem 0 0.75rem; color: var(--gray-900); }
.wiki-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1rem 0 0.5rem; color: var(--gray-900); }
.wiki-content p { margin-bottom: 1rem; }
.wiki-content ul, .wiki-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.wiki-content ul { list-style-type: disc; }
.wiki-content ol { list-style-type: decimal; }
.wiki-content li { margin-bottom: 0.25rem; }
.wiki-content a { color: var(--primary); text-decoration: underline; }
.wiki-content pre { background: var(--gray-100); padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 1rem 0; }
.wiki-content code { font-family: 'Fira Code', monospace; background: var(--gray-100); padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.875em; }
.wiki-content pre code { background: none; padding: 0; }
.wiki-content blockquote { border-left: 4px solid var(--primary); padding-left: 1rem; margin: 1rem 0; color: var(--gray-600); font-style: italic; }
.wiki-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.wiki-content th, .wiki-content td { border: 1px solid var(--gray-300); padding: 0.75rem; text-align: left; }
.wiki-content th { background: var(--gray-100); font-weight: 600; }
.wiki-content img { max-width: 100%; border-radius: 0.5rem; margin: 1rem 0; }
.wiki-content hr { border: none; border-top: 1px solid var(--gray-200); margin: 2rem 0; }

/* Rich Editor */
.rich-editor { border: 1px solid var(--gray-300); border-radius: 0.5rem; background: white; overflow: hidden; }
.rich-editor.fullscreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; border-radius: 0; display: flex; flex-direction: column; }
.rich-editor.fullscreen .editor-content { flex: 1; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); align-items: center; }
.toolbar-group { display: flex; gap: 0.125rem; align-items: center; }
.toolbar-divider { width: 1px; height: 24px; background: var(--gray-300); margin: 0 0.375rem; }
.editor-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 0.375rem; cursor: pointer; color: var(--gray-700); font-size: 0.875rem; transition: all 0.1s; }
.editor-btn:hover { background: var(--gray-200); }
.editor-btn:active { background: var(--gray-300); }
.editor-btn.active { background: var(--primary); color: white; }
.editor-select { height: 32px; padding: 0 0.5rem; border: 1px solid var(--gray-300); border-radius: 0.375rem; background: white; font-size: 0.75rem; color: var(--gray-700); cursor: pointer; min-width: 80px; }
.editor-select:focus { outline: none; border-color: var(--primary); }
.editor-color { width: 32px; height: 32px; padding: 2px; border: 1px solid var(--gray-300); border-radius: 0.375rem; cursor: pointer; background: white; }
.editor-color::-webkit-color-swatch-wrapper { padding: 0; }
.editor-color::-webkit-color-swatch { border: none; border-radius: 0.25rem; }
.editor-content { min-height: 300px; max-height: 500px; overflow-y: auto; padding: 1rem; outline: none; line-height: 1.7; }
.editor-content:focus { background: #fafbfc; }
.editor-source { width: 100%; min-height: 300px; max-height: 500px; padding: 1rem; border: none; outline: none; font-family: 'Fira Code', 'Monaco', monospace; font-size: 0.875rem; resize: none; background: #1f2937; color: #e5e7eb; }
.editor-statusbar { display: flex; justify-content: flex-end; gap: 1rem; padding: 0.5rem 1rem; background: var(--gray-50); border-top: 1px solid var(--gray-200); font-size: 0.75rem; color: var(--gray-500); }

/* Special chars grid */
.special-chars-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.25rem; }
.special-char-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gray-200); border-radius: 0.375rem; background: white; cursor: pointer; font-size: 1.125rem; transition: all 0.1s; }
.special-char-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Children pages */
.children-grid { display: grid; gap: 0.75rem; margin-top: 1rem; }
.child-card { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 0.5rem; cursor: pointer; transition: all 0.15s; }
.child-card:hover { border-color: var(--primary); background: #eff6ff; }
.child-icon { font-size: 1.25rem; }
.child-title { font-weight: 500; }

/* Comments */
.comments-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--gray-200); }
.comments-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.comment { background: var(--gray-50); border-radius: 0.5rem; padding: 1rem; margin-bottom: 0.75rem; }
.comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.comment-avatar { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; }
.comment-author { font-weight: 500; }
.comment-date { font-size: 0.75rem; color: var(--gray-500); }
.comment-content { font-size: 0.875rem; color: var(--gray-700); white-space: pre-wrap; }
.comment-actions { margin-top: 0.5rem; display: flex; gap: 0.75rem; }
.comment-action { font-size: 0.75rem; color: var(--gray-500); cursor: pointer; }
.comment-action:hover { color: var(--primary); }
.comment-replies { margin-left: 2rem; margin-top: 0.5rem; padding-left: 1rem; border-left: 2px solid var(--gray-200); }
.comment-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.comment-form textarea { width: 100%; resize: vertical; min-height: 80px; }
.comment-form button { align-self: flex-end; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: white; border-radius: 0.75rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); max-width: 800px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; margin: 1rem; }
.modal-lg { max-width: 1000px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-200); flex-shrink: 0; }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 0.375rem; cursor: pointer; color: var(--gray-400); font-size: 1.25rem; }
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); background: var(--gray-50); flex-shrink: 0; }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100; }
.drawer { position: fixed; right: 0; top: 0; height: 100%; width: 450px; background: white; box-shadow: -4px 0 20px rgba(0,0,0,0.1); display: flex; flex-direction: column; z-index: 101; }
.drawer-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; }
.drawer-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.drawer-close { position: absolute; right: 1rem; top: 1rem; }

/* Version items */
.version-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--gray-50); border-radius: 0.5rem; margin-bottom: 0.75rem; }
.version-number { font-weight: 700; font-size: 1rem; color: var(--gray-600); padding: 0.5rem 0.75rem; background: white; border-radius: 0.375rem; border: 1px solid var(--gray-200); }
.version-number.current { background: var(--primary); color: white; border-color: var(--primary); }
.version-info { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.version-info span:first-child { font-weight: 500; }
.version-info span:last-child { font-size: 0.875rem; color: var(--gray-500); }

/* Version item */
.version-item { padding: 1rem 1.5rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: flex-start; gap: 1rem; cursor: pointer; transition: background 0.1s; }
.version-item:hover { background: var(--gray-50); }
.version-number { width: 40px; height: 40px; background: var(--gray-100); color: var(--gray-700); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.875rem; flex-shrink: 0; }
.version-number.current { background: var(--success); color: white; }
.version-info { flex: 1; }
.version-meta { font-size: 0.875rem; font-weight: 500; }
.version-date { font-size: 0.75rem; color: var(--gray-500); }
.version-message { font-size: 0.8125rem; color: var(--gray-600); font-style: italic; margin-top: 0.25rem; }

/* Cards */
.card { background: white; border: 1px solid var(--gray-200); border-radius: 0.75rem; overflow: hidden; }
.card-body { padding: 1.5rem; }

/* Grid */
.grid { display: grid; gap: 0.75rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* View Toggle */
.view-toggle { display: inline-flex; background: var(--gray-100); border-radius: 0.5rem; padding: 0.25rem; gap: 0.25rem; }
.view-toggle-btn { padding: 0.375rem 0.75rem; border: none; background: transparent; border-radius: 0.375rem; cursor: pointer; font-size: 0.875rem; color: var(--gray-600); transition: all 0.15s; display: flex; align-items: center; gap: 0.375rem; }
.view-toggle-btn:hover { color: var(--gray-800); }
.view-toggle-btn.active { background: white; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Project card */
.project-card { background: white; border: 1px solid var(--gray-200); border-radius: 0.75rem; padding: 1rem; cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; gap: 0.75rem; }
.project-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1); }

/* Header: icône + titre/code */
.project-card-header { display: flex; align-items: center; gap: 0.75rem; }
.project-icon { width: 42px; height: 42px; background: #dbeafe; color: var(--primary); border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; font-size: 0.9375rem; font-weight: 700; flex-shrink: 0; }
.project-card-info { flex: 1; min-width: 0; }
.project-name { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--gray-900); }
.project-code { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.125rem; }

/* Body: description */
.project-card-body { flex: 1; }
.project-desc { font-size: 0.8125rem; color: var(--gray-600); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-desc-empty { color: var(--gray-400); font-style: italic; }

/* Footer: meta + actions */
.project-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 0.5rem; border-top: 1px solid var(--gray-100); }
.project-card-meta { font-size: 0.75rem; color: var(--gray-500); }
.project-card-actions { display: flex; gap: 0; }
.project-card-actions .btn-ghost { padding: 0.25rem 0.3rem; font-size: 0.8rem; border-radius: 0.25rem; }
.project-card-actions .btn-ghost:hover { background: var(--gray-100); }

/* Recent pages */
.project-recent-pages { background: var(--gray-50); border-radius: 0.5rem; padding: 0.5rem; margin-top: -0.25rem; }
.recent-page-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem; border-radius: 0.375rem; cursor: pointer; transition: background 0.1s; }
.recent-page-item:hover { background: white; }
.recent-page-icon { font-size: 0.8rem; }
.recent-page-title { flex: 1; font-size: 0.75rem; color: var(--gray-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-page-date { font-size: 0.6875rem; color: var(--gray-400); white-space: nowrap; }
.recent-empty { text-align: center; font-size: 0.75rem; color: var(--gray-400); padding: 0.5rem; }

.project-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.125rem; flex-wrap: wrap; }

/* Projects Table View */
.projects-table { width: 100%; border-collapse: collapse; background: white; border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--gray-200); }
.projects-table th { text-align: left; padding: 0.625rem 0.75rem; font-weight: 600; color: var(--gray-600); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.projects-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.projects-table tr { cursor: pointer; transition: background 0.1s; }
.projects-table tbody tr:hover { background: var(--gray-50); }
.projects-table tbody tr:last-child td { border-bottom: none; }
.project-table-name { display: flex; align-items: flex-start; gap: 0.75rem; }
.project-table-icon { width: 32px; height: 32px; background: #dbeafe; color: var(--primary); border-radius: 0.375rem; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; margin-top: 0.125rem; }
.project-table-title { font-weight: 500; color: var(--gray-900); line-height: 1.3; }
.project-table-code { font-size: 0.75rem; color: var(--gray-500); }
.project-table-desc { font-size: 0.8125rem; color: var(--gray-600); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 350px; }
.project-table-desc-full { display: none; }
.project-table-more { font-size: 0.75rem; color: var(--primary); cursor: pointer; margin-top: 0.25rem; }
.project-table-more:hover { text-decoration: underline; }
.project-table-actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
.project-table-actions .btn-ghost { padding: 0.25rem 0.375rem; font-size: 0.875rem; }
.project-table-recent { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--gray-200); }
.project-table-recent-title { font-size: 0.6875rem; color: var(--gray-400); margin-bottom: 0.25rem; text-transform: uppercase; }
.project-table-recent-list { display: flex; flex-direction: column; gap: 0.125rem; }
.project-table-recent-item { font-size: 0.75rem; color: var(--gray-600); display: flex; align-items: center; gap: 0.375rem; }
.project-table-recent-item:hover { color: var(--primary); }

/* Template card */
.template-card { background: white; border: 1px solid var(--gray-200); border-radius: 0.5rem; padding: 1rem; }
.template-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.template-name { font-weight: 600; }
.template-desc { font-size: 0.875rem; color: var(--gray-500); }
.template-preview { background: var(--gray-50); border-radius: 0.375rem; padding: 0.75rem; font-size: 0.75rem; color: var(--gray-600); max-height: 100px; overflow: hidden; margin-top: 0.75rem; }
.template-actions { display: flex; gap: 0.5rem; }

/* Favorites */
.favorites-container { display: flex; flex-direction: column; gap: 2rem; }
.favorites-section { }
.favorites-title { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 1rem; }
.favorites-list { display: flex; flex-direction: column; gap: 0.5rem; }
.favorite-item { display: flex; align-items: center; gap: 1rem; background: white; border: 1px solid var(--gray-200); border-radius: 0.5rem; padding: 0.75rem 1rem; cursor: pointer; transition: all 0.15s; }
.favorite-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1); }
.favorite-icon { font-size: 1.25rem; }
.project-icon-sm { width: 36px; height: 36px; background: #dbeafe; color: var(--primary); border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 700; }
.favorite-info { flex: 1; min-width: 0; }
.favorite-name { font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favorite-meta { font-size: 0.75rem; color: var(--gray-500); }
.empty-desc { font-size: 0.875rem; color: var(--gray-400); margin-top: 0.5rem; }

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-title { font-size: 1.125rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.5rem; }
.empty-text { color: var(--gray-500); margin-bottom: 1.5rem; }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Search results */
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--gray-200); border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 300px; overflow-y: auto; z-index: 50; }
.search-result { padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid var(--gray-100); }
.search-result:hover { background: var(--gray-50); }
.search-result:last-child { border-bottom: none; }
.search-result-title { font-weight: 500; margin-bottom: 0.25rem; }
.search-result-excerpt { font-size: 0.75rem; color: var(--gray-500); }

/* Rich Editor */
.rich-editor { border: 1px solid var(--gray-300); border-radius: 0.5rem; background: white; overflow: hidden; }
.rich-editor.fullscreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; border-radius: 0; display: flex; flex-direction: column; }
.rich-editor.fullscreen .editor-content { flex: 1; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); align-items: center; }
.toolbar-group { display: flex; gap: 0.125rem; align-items: center; }
.toolbar-divider { width: 1px; height: 24px; background: var(--gray-300); margin: 0 0.375rem; }
.editor-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 0.375rem; cursor: pointer; color: var(--gray-700); font-size: 0.875rem; transition: all 0.1s; }
.editor-btn:hover { background: var(--gray-200); }
.editor-btn:active { background: var(--gray-300); }
.editor-select { height: 32px; padding: 0 0.5rem; border: 1px solid var(--gray-300); border-radius: 0.375rem; background: white; font-size: 0.75rem; color: var(--gray-700); cursor: pointer; min-width: 80px; }
.editor-select:focus { outline: none; border-color: var(--primary); }
.editor-color { width: 32px; height: 32px; padding: 2px; border: 1px solid var(--gray-300); border-radius: 0.375rem; cursor: pointer; background: white; }
.editor-color::-webkit-color-swatch-wrapper { padding: 0; }
.editor-color::-webkit-color-swatch { border: none; border-radius: 0.25rem; }
.editor-content { min-height: 300px; max-height: 500px; overflow-y: auto; padding: 1rem; outline: none; line-height: 1.7; }
.editor-content:focus { background: #fafbfc; }
.editor-source { width: 100%; min-height: 300px; max-height: 500px; padding: 1rem; border: none; outline: none; font-family: 'Fira Code', 'Monaco', monospace; font-size: 0.875rem; resize: none; background: #1f2937; color: #e5e7eb; }
.editor-statusbar { display: flex; justify-content: flex-end; gap: 1rem; padding: 0.5rem 1rem; background: var(--gray-50); border-top: 1px solid var(--gray-200); font-size: 0.75rem; color: var(--gray-500); }

/* Special chars grid */
.special-chars-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.25rem; }
.special-char-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gray-200); border-radius: 0.375rem; background: white; cursor: pointer; font-size: 1.125rem; transition: all 0.1s; }
.special-char-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ML margin left helper */
.ml-2 { margin-left: 0.5rem; }

/* Auth */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 1rem; }
.auth-card { background: white; border-radius: 1rem; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.auth-title { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.auth-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 2rem; }
.auth-link { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--gray-600); }
.auth-link a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

/* User menu */
.user-menu { display: flex; align-items: center; gap: 0.75rem; }
.user-name { font-size: 0.875rem; color: var(--gray-700); display: flex; align-items: center; gap: 0.5rem; }

/* Role badges */
.role-badge { display: inline-block; padding: 0.125rem 0.5rem; font-size: 0.6875rem; font-weight: 600; color: white; border-radius: 0.25rem; text-transform: uppercase; letter-spacing: 0.025em; }
.visibility-badge { font-size: 0.75rem; color: var(--gray-500); }
.perm-badge { font-size: 0.875rem; margin-left: 0.25rem; }

/* Project meta */
.project-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }

/* Members */
.member-section { margin-bottom: 2rem; }
.member-section h3 { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--gray-200); }
.member-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--gray-50); border-radius: 0.5rem; margin-bottom: 0.5rem; }
.member-card.clickable { cursor: pointer; transition: background 0.15s; }
.member-card.clickable:hover { background: var(--gray-100); }
.member-avatar { width: 40px; height: 40px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 600; flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 500; }
.member-email { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Permissions table */
.permissions-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.permissions-table th, .permissions-table td { padding: 0.5rem 0.75rem; text-align: center; border-bottom: 1px solid var(--gray-200); }
.permissions-table th { background: var(--gray-100); font-weight: 600; color: var(--gray-700); font-size: 0.75rem; }
.permissions-table th:first-child, .permissions-table td:first-child { text-align: left; font-weight: 500; }
.permissions-table tr:hover { background: var(--gray-50); }
.perm-yes { color: #059669; }
.perm-no { color: #dc2626; }
.perm-partial { color: #d97706; font-size: 0.6875rem; }

/* Roles summary */
.roles-summary { background: var(--gray-50); border-radius: 0.5rem; padding: 1rem; }
.role-item { display: flex; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-200); }
.role-item:last-child { border-bottom: none; }
.role-name { font-weight: 600; color: var(--gray-800); min-width: 140px; }
.role-desc { color: var(--gray-600); font-size: 0.875rem; }

/* Global Search */
.projects-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.projects-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.projects-actions { display: flex; gap: 1rem; align-items: center; }
.global-search-box { display: flex; gap: 0.5rem; }
.global-search-input { width: 280px; }

/* Header avec recherche centrée */
.header-with-search { display: flex; align-items: center; gap: 1.5rem; position: relative; z-index: 100; }
.header-logo { font-size: 1.25rem; font-weight: 700; white-space: nowrap; margin: 0; }
.header-search { flex: 1; display: flex; justify-content: center; max-width: 600px; margin: 0 auto; position: relative; z-index: 101; }
.search-input-header { flex: 1; border-radius: 0.5rem 0 0 0.5rem; border-right: none; min-width: 300px; }
.btn-search { border-radius: 0 0.5rem 0.5rem 0; white-space: nowrap; }

/* Onglets de recherche - PLEINE PAGE (pas modale) */
.search-tabs-container { background: white; }
.search-tabs-row { display: flex; justify-content: space-between; align-items: center; padding: 0 0 1rem 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 1rem; }
.search-tabs { display: flex; align-items: center; gap: 0.5rem; }
.search-tab { padding: 0.625rem 1.25rem; border: none; background: transparent; font-size: 0.875rem; font-weight: 500; color: var(--gray-600); cursor: pointer; border-radius: 0.375rem; transition: all 0.15s; white-space: nowrap; }
.search-tab:hover { background: var(--gray-100); color: var(--gray-800); }
.search-tab.active { background: var(--primary); color: white; }
.search-tab-content { padding: 0; }

/* Layout résultats avec facettes */
.search-results-layout { display: flex; gap: 2rem; }
.search-facets { width: 220px; flex-shrink: 0; }
.search-results-main { flex: 1; min-width: 0; }

/* Tableau des résultats */
.search-results-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.search-results-table th { text-align: left; padding: 0.75rem 0.5rem; background: var(--gray-50); font-weight: 600; color: var(--gray-600); font-size: 0.75rem; text-transform: uppercase; border-bottom: 2px solid var(--gray-200); }
.search-results-table td { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.search-results-table tr.clickable { cursor: pointer; }
.search-results-table tr.clickable:hover { background: var(--gray-50); }
.result-type-icon { font-size: 1.25rem; }
.result-title { font-weight: 500; color: var(--gray-900); }
.result-excerpt { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; }
.result-project-badge { background: var(--gray-100); padding: 0.25rem 0.5rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 600; }
.result-author { font-size: 0.8125rem; color: var(--gray-600); }
.result-date { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; }
.status-badge { padding: 0.25rem 0.5rem; border-radius: 0.25rem; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; }
.status-published { background: #d1fae5; color: #065f46; }
.status-draft { background: #fef3c7; color: #92400e; }

/* Onglet Activités */
.activity-tab, .history-tab { max-width: 700px; margin: 0 auto; }
.activity-list, .history-list { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item, .history-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--gray-50); border-radius: 0.5rem; cursor: pointer; transition: background 0.15s; }
.activity-item:hover, .history-item:hover { background: var(--gray-100); }
.activity-icon, .history-icon { font-size: 1.5rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: white; border-radius: 0.5rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.activity-info, .history-info { flex: 1; min-width: 0; }
.activity-title, .history-query { font-weight: 500; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta, .history-meta { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; }

/* Utilitaires */
.ml-auto { margin-left: auto; }
.mt-4 { margin-top: 1rem; }
.btn-block { display: block; width: 100%; }

.global-search-panel { display: flex; gap: 1.5rem; margin-top: 1rem; }

/* Facettes */
.search-facets { width: 220px; flex-shrink: 0; background: var(--gray-50); border-radius: 0.5rem; padding: 1rem; height: fit-content; }
.facet-section { margin-bottom: 1.25rem; }
.facet-section:last-child { margin-bottom: 0; }
.facet-title { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; color: var(--gray-500); margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.facet-options { display: flex; flex-direction: column; gap: 0.125rem; }
.facet-option { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.375rem; cursor: pointer; font-size: 0.8125rem; transition: all 0.15s; color: var(--gray-700); }
.facet-option:hover { background: var(--gray-200); }
.facet-option.active { background: var(--primary); color: white; }
.facet-option.active .facet-count { background: rgba(255,255,255,0.25); color: white; }
.facet-option input[type="radio"] { display: none; }
.facet-count { font-size: 0.6875rem; background: var(--gray-200); color: var(--gray-600); padding: 0.125rem 0.375rem; border-radius: 0.25rem; min-width: 1.25rem; text-align: center; }

/* Résultats */
.search-results-container { flex: 1; min-width: 0; }
.search-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.search-results-info { display: flex; align-items: center; gap: 1rem; }
.search-results-count { font-size: 0.875rem; color: var(--gray-600); }
.search-no-results { text-align: center; padding: 3rem 1rem; }

/* Tableau des résultats */
.search-results-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.search-results-table th { text-align: left; padding: 0.75rem; background: var(--gray-100); font-weight: 600; color: var(--gray-700); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.025em; border-bottom: 2px solid var(--gray-200); }
.search-results-table td { padding: 0.75rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.search-results-table tr.clickable { cursor: pointer; transition: background 0.15s; }
.search-results-table tr.clickable:hover { background: var(--gray-50); }
.result-type-badge { font-size: 1.25rem; }
.result-title { font-weight: 500; color: var(--gray-900); margin-bottom: 0.25rem; }
.result-excerpt { font-size: 0.75rem; color: var(--gray-500); line-height: 1.4; max-width: 400px; }
.result-project { display: inline-block; background: var(--gray-100); padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 500; }
.status-badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-size: 0.6875rem; font-weight: 500; }
.status-badge.published { background: #d1fae5; color: #065f46; }
.status-badge.draft { background: #fef3c7; color: #92400e; }
.status-badge.private { background: var(--gray-200); color: var(--gray-700); }
.status-badge.public { background: #dbeafe; color: #1e40af; }
.date-cell { white-space: nowrap; font-size: 0.75rem; color: var(--gray-500); }

@media (max-width: 900px) {
  .global-search-panel { flex-direction: column; }
  .search-facets { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 1rem; }
  .facet-section { margin-bottom: 0; flex: 1; min-width: 150px; }
  .global-search-input { width: 200px; }
}

/* Projects header */
.projects-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.projects-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.projects-actions { display: flex; gap: 1rem; align-items: center; }

/* Global search */
.global-search-box { position: relative; }
.global-search-input { width: 300px; padding-left: 1rem; }
.global-search-results { background: white; border-radius: 0.5rem; margin-top: 1rem; }

/* Search layout */
.search-layout { display: flex; gap: 1.5rem; min-height: 400px; }
.search-facets { width: 240px; flex-shrink: 0; background: var(--gray-50); border-radius: 0.5rem; padding: 1rem; }
.search-results-main { flex: 1; min-width: 0; }

/* Facets */
.facets-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.facets-header h3 { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.facet-section { margin-bottom: 1.25rem; }
.facet-section h4 { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.5rem 0; }
.facet-options { display: flex; flex-direction: column; gap: 0.25rem; }
.facet-option { display: flex; justify-content: space-between; align-items: center; padding: 0.375rem 0.5rem; border-radius: 0.25rem; cursor: pointer; font-size: 0.8125rem; transition: background 0.15s; }
.facet-option:hover { background: var(--gray-100); }
.facet-option.active { background: var(--primary); color: white; }
.facet-option.active .facet-count { background: rgba(255,255,255,0.2); color: white; }
.facet-label { flex: 1; }
.facet-count { font-size: 0.6875rem; background: var(--gray-200); color: var(--gray-600); padding: 0.125rem 0.375rem; border-radius: 0.75rem; min-width: 1.25rem; text-align: center; }

/* Search results header */
.search-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }
.results-count { font-size: 0.875rem; color: var(--gray-600); }

/* Results table */
.results-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.results-table th { text-align: left; padding: 0.75rem; font-weight: 600; color: var(--gray-600); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--gray-200); background: var(--gray-50); }
.results-table td { padding: 0.75rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.result-row { cursor: pointer; transition: background 0.15s; }
.result-row:hover { background: var(--gray-50); }
.result-type { font-size: 0.75rem; white-space: nowrap; }
.result-title { font-weight: 500; color: var(--gray-900); margin-bottom: 0.25rem; }
.result-excerpt { font-size: 0.75rem; color: var(--gray-500); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-project { font-size: 0.75rem; background: var(--gray-100); padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-weight: 500; }
.result-date { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; }

/* Status badges */
.status-badge { display: inline-block; font-size: 0.6875rem; font-weight: 500; padding: 0.125rem 0.5rem; border-radius: 0.25rem; }
.status-published { background: #d1fae5; color: #065f46; }
.status-draft { background: #fef3c7; color: #92400e; }
.status-public { background: #dbeafe; color: #1e40af; }
.status-private { background: #f3f4f6; color: #374151; }

/* Form compact */
.form-compact { display: flex; flex-direction: column; gap: 0.75rem; }
.form-compact .input-lg { font-size: 1.5rem; padding: 0.5rem 0; border: none; border-bottom: 2px solid var(--gray-200); border-radius: 0; background: transparent; }
.form-compact .input-lg:focus { border-color: var(--primary); box-shadow: none; }
.form-row-inline { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.form-row-inline .input { flex: 1; min-width: 120px; max-width: 200px; }
.status-toggle { display: flex; gap: 1rem; margin-left: auto; }
.radio-inline { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.875rem; cursor: pointer; color: var(--gray-600); }
.radio-inline input[type="radio"] { width: 0.875rem; height: 0.875rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }

/* Templates */
.templates-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.template-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 0.5rem; cursor: pointer; transition: all 0.15s; }
.template-card:hover { border-color: var(--primary); background: white; }
.template-icon { font-size: 1.5rem; }
.template-info { flex: 1; min-width: 0; }
.template-name { font-weight: 600; margin-bottom: 0.25rem; }
.template-desc { font-size: 0.875rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.default-templates { margin-bottom: 1rem; padding: 1rem; background: var(--gray-50); border-radius: 0.5rem; }
.default-templates-title { font-size: 0.875rem; font-weight: 500; color: var(--gray-600); margin-bottom: 0.5rem; }
.default-templates-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.form-actions-inline { display: flex; gap: 0.75rem; }
.checkbox-inline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }

/* Home customize button */
.home-customize { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); text-align: center; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1rem; font-size: 0.875rem; }
.breadcrumb-link { color: var(--primary); cursor: pointer; }
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-400); margin: 0 0.25rem; }
.breadcrumb-current { color: var(--gray-600); }

/* Admin Page */
.admin-page { max-width: 1200px; }
.admin-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--gray-200); }
.admin-section:last-child { border-bottom: none; }
.admin-section h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; color: var(--gray-800); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-card { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1px solid #bae6fd; border-radius: 0.75rem; padding: 1.5rem; text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.25rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.admin-table th { background: var(--gray-50); font-weight: 600; font-size: 0.875rem; color: var(--gray-600); }
.admin-table code { background: var(--gray-100); padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-size: 0.875rem; }

.benchmark-controls { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }

.benchmark-results-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.benchmark-result-card { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 0.5rem; padding: 1rem; }
.benchmark-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.benchmark-time { font-size: 0.75rem; color: var(--gray-500); }
.benchmark-details { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.5rem; }
.benchmark-stat { font-size: 0.875rem; }
.benchmark-stat .label { color: var(--gray-500); }
.benchmark-stat.highlight { background: #dcfce7; padding: 0.25rem 0.5rem; border-radius: 0.25rem; }
.benchmark-stat.highlight strong { color: #166534; }
.benchmark-times { font-size: 0.75rem; color: var(--gray-500); }

.text-muted { color: var(--gray-500); }
.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }


/* Toast notifications */
.toast { position: fixed; bottom: 20px; right: 20px; padding: 0.75rem 1.25rem; border-radius: 0.5rem; color: white; font-size: 0.875rem; opacity: 0; transform: translateY(20px); transition: all 0.3s ease; z-index: 10000; max-width: 400px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-info { background: #3b82f6; }
.toast-warning { background: #f59e0b; }


/* Export styles */
.export-section { margin-bottom: 1.5rem; }
.export-section h3 { margin: 0 0 0.75rem 0; font-size: 1rem; color: #374151; }
.export-buttons { display: flex; gap: 0.75rem; }
.export-selection { margin-top: 0.75rem; }
.export-select-all { margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #e5e7eb; }
.export-pages-list { max-height: 300px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 0.375rem; padding: 0.5rem; }
.export-page-item { display: block; padding: 0.5rem; cursor: pointer; border-radius: 0.25rem; }
.export-page-item:hover { background: #f3f4f6; }
.export-page-item input { margin-right: 0.5rem; }


/* Header search */
.header-search { display: flex; align-items: center; gap: 0.5rem; position: relative; }
.header-search .input { width: 250px; }
.search-results-dropdown { position: absolute; top: 100%; right: 0; width: 300px; max-height: 400px; overflow-y: auto; background: white; border: 1px solid #e5e7eb; border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; margin-top: 0.25rem; }
.search-results-dropdown .search-result { padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.search-results-dropdown .search-result:hover { background: #f3f4f6; }
.search-results-dropdown .search-result:last-child { border-bottom: none; }

