/* =========================================================================
   KB Website v2 — Dark Theme (CentCom)
   ========================================================================= */

:root {
  --bg: #0a0e17;
  --bg-secondary: #0f1420;
  --surface: #1a1f2e;
  --surface-hover: #222840;
  --surface-active: #2a3150;
  --border: #2a2f3e;
  --border-light: #353b4e;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6c8cff;
  --accent-hover: #5a7aee;
  --accent-dim: rgba(108, 140, 255, 0.12);
  --accent-glow: rgba(108, 140, 255, 0.25);
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --orange: #fb923c;
  --sidebar-width: 280px;
  --header-height: 56px;
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 150ms ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* =========================================================================
   Layout
   ========================================================================= */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}

.header-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.header-logo svg { color: var(--accent); }

.header-logo .logo-sub {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.header-search form {
  position: relative;
  display: flex;
}

.header-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
  z-index: 50;
  transition: transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar-category {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.sidebar-category:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar-category.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.sidebar-category svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-category .chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.sidebar-category.expanded .chevron {
  transform: rotate(90deg);
}

.sidebar-children {
  display: none;
  padding-left: 20px;
}

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

.sidebar-child {
  display: block;
  padding: 5px 12px 5px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.sidebar-child:hover {
  color: var(--text);
  background: var(--surface);
}

.sidebar-child.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  flex: 1;
  min-height: calc(100vh - var(--header-height));
  padding: 32px 40px;
  max-width: 960px;
}

/* =========================================================================
   Breadcrumbs
   ========================================================================= */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--border-light); }
.breadcrumbs .current { color: var(--text); }

/* =========================================================================
   Index / Dashboard
   ========================================================================= */

.hero {
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.hero-search {
  margin-top: 20px;
  max-width: 520px;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

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

.hero-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  display: block;
  color: var(--text);
}

.category-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px var(--accent-dim);
  color: var(--text);
}

.category-card .card-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.category-card .card-count {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================================
   Article list
   ========================================================================= */

.section-header {
  margin-bottom: 24px;
}

.section-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  color: var(--text);
}

.article-item:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--text);
}

.article-item .article-icon {
  color: var(--text-muted);
  margin-top: 2px;
  flex-shrink: 0;
}

.article-item .article-body { flex: 1; min-width: 0; }

.article-item .article-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.article-item .article-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item .article-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-green { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.badge-yellow { background: rgba(251, 191, 36, 0.12); color: var(--yellow); }
.badge-red { background: rgba(248, 113, 113, 0.12); color: var(--red); }
.badge-muted { background: var(--surface-active); color: var(--text-secondary); }

/* =========================================================================
   Article detail
   ========================================================================= */

.article-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.article-header .article-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Markdown rendered content */
.article-content {
  line-height: 1.75;
  color: var(--text);
}

.article-content h1 { font-size: 1.6rem; font-weight: 700; margin: 2em 0 0.6em; }
.article-content h2 { font-size: 1.3rem; font-weight: 600; margin: 1.8em 0 0.5em; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.article-content h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5em 0 0.4em; color: var(--text); }
.article-content h4 { font-size: 1rem; font-weight: 600; margin: 1.2em 0 0.3em; color: var(--text-secondary); }

.article-content p { margin-bottom: 1em; }

.article-content ul, .article-content ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.article-content li { margin-bottom: 0.3em; }
.article-content li::marker { color: var(--text-muted); }

.article-content a { color: var(--accent); border-bottom: 1px solid transparent; }
.article-content a:hover { border-bottom-color: var(--accent); }

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  margin: 1em 0;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.article-content code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent);
}

.article-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 1em 0;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.9rem;
}

.article-content th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.article-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.article-content tr:hover td { background: var(--surface); }

.article-content strong { color: var(--text); font-weight: 600; }

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1em 0;
}

/* Related articles */
.related-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.related-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* =========================================================================
   Search results
   ========================================================================= */

.search-result {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: all var(--transition);
}

.search-result:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.search-result .result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.search-result .result-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.search-result .result-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result .result-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.similarity-bar {
  width: 48px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.similarity-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.search-empty svg {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.search-empty h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

/* =========================================================================
   Documents & Repairs tables
   ========================================================================= */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.data-table tr:hover td { background: var(--surface); }

.data-table .truncate {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-tab {
  padding: 6px 14px;
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

.filter-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

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

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 24px 20px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .article-content h2 { font-size: 1.15rem; }
  .header-logo .logo-sub { display: none; }
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

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

/* =========================================================================
   Auth pages
   ========================================================================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
}

.auth-logo svg { color: var(--accent); }

.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 20px;
}

/* =========================================================================
   Forms
   ========================================================================= */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.content-editor {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  min-height: 400px;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-select option { background: var(--surface); color: var(--text); }

.form-row {
  display: flex;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row { flex-direction: column; }
}

.article-form {
  max-width: 720px;
}

/* Preview toggle */
.preview-toggle {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}

.toggle-btn {
  padding: 6px 16px;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.toggle-btn:hover { color: var(--text); }
.toggle-btn.active { background: var(--accent-dim); color: var(--accent); }

.preview-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 400px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-primary {
  width: 100%;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-sm:hover { background: var(--surface-hover); color: var(--text); }
.btn-sm.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-sm.btn-accent:hover { background: var(--accent-dim); }
.btn-sm.btn-muted { border-color: var(--border); }
.btn-sm.btn-danger { border-color: var(--red); color: var(--red); }
.btn-sm.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }

/* Flash messages */
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.flash-error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.flash-success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* =========================================================================
   User menu (header)
   ========================================================================= */

.header-user {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.user-btn:hover { background: var(--surface); color: var(--text); }

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

.user-name {
  font-size: 0.85rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 200;
  overflow: hidden;
}

.user-dropdown.show { display: block; }

.dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.dropdown-danger { color: var(--red); }
.dropdown-danger:hover { background: rgba(248, 113, 113, 0.08); color: var(--red); }

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