/* ============================================
   AIVectorMemory Dashboard - UI/UX Pro Max Design System
   
   Product: Developer Tool / IDE
   Style: Dark Mode (OLED) + Minimalism + Bento Box Grid
   
   Color Palette:
   - Primary: #3B82F6
   - Secondary: #1E293B
   - CTA: #2563EB
   - Background: #0F172A
   - Surface: #1E293B
   - Text: #F1F5F9
   - Muted: #94A3B8
   - Border: #334155
   
   Typography: Developer Mono
   - Heading/Code: JetBrains Mono
   - Body: IBM Plex Sans
   ============================================ */

/* === Theme Variables === */
:root {
  /* Backgrounds — aligned to design mockup hsl(240 5% ...) palette */
  --bg-primary: hsl(240 5% 12%);
  --bg-surface: hsl(240 5% 16%);
  --bg-sidebar: hsl(240 5% 10%);
  --bg-input: hsl(240 5% 12%);
  --bg-muted: hsl(240 5% 18%);
  --bg-hover: hsl(240 5% 22%);
  --bg-card-hover: hsl(240 5% 20%);

  /* Text */
  --text-primary: hsl(0 0% 98%);
  --text-secondary: hsl(240 5% 64.9%);
  --text-muted: hsl(240 5% 45%);
  --text-dim: hsl(240 5% 35%);
  --text-heading: hsl(0 0% 90%);

  /* Borders */
  --border: hsl(240 5% 24%);
  --border-hover: hsl(240 5% 32%);
  --border-light: hsl(240 5% 24% / 0.5);

  /* Accent — mockup primary hsl(210 100% 54%) */
  --accent: hsl(210 100% 54%);
  --accent-hover: hsl(210 100% 46%);
  --accent-light: hsl(210 100% 68%);
  --accent-bg: hsl(210 100% 54% / 0.15);
  --accent-bg-light: hsl(210 100% 54% / 0.10);
  --accent-bg-subtle: hsl(210 100% 54% / 0.08);
  --accent-tag: hsl(210 100% 54% / 0.12);

  /* Status colors */
  --color-success: hsl(142 71% 45%);
  --color-success-bg: hsl(142 71% 45% / 0.15);
  --color-success-dot: hsl(142 71% 45%);
  --color-warning: hsl(25 95% 53%);
  --color-warning-bg: hsl(25 95% 53% / 0.15);
  --color-error: hsl(0 84% 60%);
  --color-error-light: hsl(0 84% 68%);
  --color-error-bg: hsl(0 84% 60% / 0.15);
  --color-info: hsl(210 100% 68%);
  --color-info-bg: hsl(210 100% 54% / 0.15);
  --color-cyan: #06B6D4;
  --color-purple: hsl(270 76% 60%);
  --color-purple-bg: hsl(270 76% 60% / 0.15);

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.4);
  --shadow-focus: 0 0 0 3px hsl(210 100% 54% / 0.15);

  /* Glass — from mockup */
  --glass-bg: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  --glass-border: rgba(255,255,255,0.05);
  --glass-shadow: 0 8px 32px 0 rgba(0,0,0,0.37);

  /* Overlay */
  --overlay: rgba(0,0,0,0.6);

  /* Spacing */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-pill: 20px;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

[data-theme="light"] {
  --bg-primary: hsl(0 0% 98%);
  --bg-surface: hsl(0 0% 100%);
  --bg-sidebar: hsl(0 0% 96%);
  --bg-input: hsl(0 0% 100%);
  --bg-muted: hsl(240 5% 93%);
  --bg-hover: hsl(240 5% 88%);
  --bg-card-hover: hsl(240 5% 95%);

  --text-primary: hsl(240 10% 10%);
  --text-secondary: hsl(240 5% 40%);
  --text-muted: hsl(240 5% 55%);
  --text-dim: hsl(240 5% 70%);
  --text-heading: hsl(240 10% 20%);

  --border: hsl(240 5% 85%);
  --border-hover: hsl(240 5% 75%);
  --border-light: hsl(240 5% 85% / 0.5);

  --accent: hsl(210 100% 45%);
  --accent-hover: hsl(210 100% 38%);
  --accent-light: hsl(210 100% 54%);
  --accent-bg: hsl(210 100% 45% / 0.12);
  --accent-bg-light: hsl(210 100% 45% / 0.08);
  --accent-bg-subtle: hsl(210 100% 45% / 0.05);
  --accent-tag: hsl(210 100% 45% / 0.1);

  --color-success: hsl(142 71% 35%);
  --color-success-bg: hsl(142 71% 45% / 0.12);
  --color-success-dot: hsl(142 71% 35%);
  --color-warning: hsl(25 95% 45%);
  --color-warning-bg: hsl(25 95% 53% / 0.12);
  --color-error: hsl(0 84% 50%);
  --color-error-light: hsl(0 84% 60%);
  --color-error-bg: hsl(0 84% 60% / 0.1);
  --color-info: hsl(210 100% 45%);
  --color-info-bg: hsl(210 100% 45% / 0.1);
  --color-cyan: #0891B2;
  --color-purple: hsl(270 76% 50%);
  --color-purple-bg: hsl(270 76% 60% / 0.1);

  --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.15);
  --shadow-focus: 0 0 0 3px hsl(210 100% 45% / 0.2);

  --glass-bg: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
  --glass-border: rgba(0,0,0,0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0,0,0,0.08);

  --overlay: rgba(0,0,0,0.3);
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}
#app { display: flex; width: 100%; height: 100%; }

/* === Sidebar === */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--bg-surface);
}
.logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--bg-surface);
}
.logo-icon { width: 28px; height: 28px; }
.logo-icon .node { fill: var(--accent); }
.logo-icon .edge { stroke: var(--accent); stroke-width: 1.2; opacity: 0.5; }
.nav-list { list-style: none; padding: 12px 0; flex: 1; }
.nav-item {
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid transparent;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-section-label { padding: 16px 24px 6px; font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; list-style: none; }
.nav-section-label:first-child { padding-top: 8px; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-heading); }
.nav-item.active {
  background: var(--accent-bg-light);
  color: var(--text-primary);
  border-left-color: var(--accent);
  font-weight: 500;
}

/* === Sidebar Decor === */
.sidebar-decor { padding: 12px 20px 16px; border-top: 1px solid var(--bg-surface); opacity: 0.6; }
.sidebar-decor svg { width: 100%; height: 60px; }
.node-pulse { animation: nodePulse 3s ease-in-out infinite; }
.node-pulse:nth-child(2) { animation-delay: 0.6s; }
.node-pulse:nth-child(3) { animation-delay: 1.2s; }
.node-pulse:nth-child(4) { animation-delay: 1.8s; }
.node-pulse:nth-child(5) { animation-delay: 2.4s; }
@keyframes nodePulse { 0%, 100% { opacity: 0.4; r: 3; } 50% { opacity: 1; r: 4; } }
.edge-flow { opacity: 0.3; stroke-dasharray: 4 4; animation: edgeFlow 4s linear infinite; }
@keyframes edgeFlow { to { stroke-dashoffset: -40; } }

/* === Content === */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-header { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: hsl(240 5% 12% / 0.8); backdrop-filter: blur(12px); }
.main-header-left { display: flex; align-items: center; gap: 12px; }
.main-header-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.main-header-project { font-size: 12px; color: var(--accent); background: var(--accent-bg); padding: 2px 10px; border-radius: var(--radius-pill); }
.main-header-actions { display: flex; align-items: center; gap: 6px; }
[data-theme="light"] .main-header { background: hsl(0 0% 98% / 0.85); border-bottom-color: var(--border); }
.main-content { flex: 1; padding: 20px 24px; overflow-y: auto; background: var(--bg-primary); display: flex; flex-direction: column; position: relative; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
#tab-stats.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* === Page Header === */
.page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.page-title { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-count { font-size: 13px; color: var(--text-muted); }

/* === Stats Grid === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.mini-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); padding: 16px 20px; transition: all 0.2s ease; cursor: pointer; }
.mini-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-card-hover); }
.mini-card__label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; }
.mini-card__number { font-family: var(--font-mono); font-size: 26px; font-weight: 700; line-height: 1.2; }
.mini-card__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.mini-card--blue .mini-card__number { color: var(--accent); }
.mini-card--cyan .mini-card__number { color: var(--color-cyan); }
.mini-card--warning .mini-card__number { color: var(--color-warning); }
.mini-card--info .mini-card__number { color: var(--accent-light); }
.mini-card--success .mini-card__number { color: var(--color-success); }
.mini-card--muted .mini-card__number { color: var(--text-muted); }
.mini-card__sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* === Block Alert === */
.block-alert { background: hsl(0 84% 60% / 0.08); border: 1px solid hsl(0 84% 60% / 0.25); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; transition: border-color 0.2s ease; }
.block-alert__header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.block-alert__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-error); flex-shrink: 0; animation: pulse 2s infinite; }
.block-alert__title { font-family: var(--font-mono); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-error); }
.block-alert__reason { font-size: 15px; color: var(--text-primary); line-height: 1.5; }
.block-alert__task { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.block-alert__label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-muted); margin-right: 8px; }
.block-alert--ok { border-color: var(--color-success-dot); }
.block-alert--ok .block-alert__dot { background: var(--color-success-dot); animation: none; }
.block-alert--ok .block-alert__title { color: var(--color-success); }
.block-alert:hover { box-shadow: var(--shadow-card); }

/* === Stat Link === */
.stat-card__more { font-size: 12px; color: var(--accent-light); cursor: pointer; text-decoration: none; white-space: nowrap; }
.stat-card__more:hover { color: var(--accent); }
.stat-link { display: flex; justify-content: space-between; align-items: center; width: 100%; color: inherit; text-decoration: none; cursor: pointer; padding: 2px 0; border-radius: 4px; transition: color 0.15s ease; }
.stat-link:hover { color: var(--accent); }
.stat-link:hover .badge, .stat-link:hover .tag-count { opacity: 0.8; }

/* === Stat List === */
.stat-list { list-style: none; }
.stat-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13px; color: var(--text-heading); border-bottom: 1px solid var(--border-light); }
.stat-list li:last-child { border-bottom: none; }
.stat-list--tags .tag-count { font-family: var(--font-mono); font-weight: 600; color: var(--accent); font-size: 13px; }

/* === Badges === */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--info { background: var(--color-info-bg); color: var(--accent-light); }
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--muted { background: var(--bg-muted); color: var(--text-muted); }

/* === Vector Network === */
#vector-network-container { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.vector-network { margin-top: 20px; background: var(--glass-bg); border-radius: var(--radius); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); padding: 20px 24px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.vector-network__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.vector-network__left { display: flex; align-items: baseline; gap: 12px; }
.vector-network__label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.vector-network__sub { font-size: 12px; color: var(--text-dim); }
.vector-network__more { font-size: 12px; color: var(--accent-light); cursor: pointer; text-decoration: none; white-space: nowrap; }
.vector-network__more:hover { color: var(--accent); }
.vector-graph { width: 100%; flex: 1; min-height: 0; user-select: none; cursor: grab; }
.vector-graph:active { cursor: grabbing; }
.vg-edge { stroke: var(--border); stroke-width: 1; transition: stroke 0.2s; }
.vg-edge--weak { stroke: var(--bg-surface); stroke-width: 0.5; stroke-dasharray: 3 3; }
.vg-node { cursor: pointer; transition: opacity 0.15s; }
.vg-node__glow { transition: fill 0.2s; }
.vg-node__core { transition: filter 0.2s; }
.vg-node__label { font-family: var(--font-mono); font-size: 11px; fill: var(--text-secondary); text-anchor: middle; pointer-events: none; transition: fill 0.15s; }
.vg-node:hover .vg-node__glow { fill: hsl(210 100% 54% / 0.25) !important; }
.vg-node:hover .vg-node__label { fill: var(--text-primary); }
.vg-node:hover .vg-node__core { filter: brightness(1.3); }

/* === Toolbar === */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; }
.search-box { position: relative; flex: 1; max-width: 360px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.search-input { width: 100%; padding: 9px 32px 9px 36px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-primary); background: var(--bg-surface); transition: all 0.15s ease; font-family: inherit; }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.search-input::placeholder { color: var(--text-dim); }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border: none; background: transparent; color: var(--text-muted); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; padding: 0; line-height: 1; }
.search-clear:hover { color: var(--text-primary); background: var(--border); }
.search-clear.hidden { display: none; }
.filter-input, .filter-select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-primary); background: var(--bg-surface); font-family: inherit; }
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.filter-select option { background: var(--bg-surface); color: var(--text-primary); }

/* === Memory Card === */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.memory-card { background: var(--bg-surface); border-radius: 10px; padding: 18px 20px; border: 1px solid var(--border); transition: all 0.15s ease; }
.memory-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-card); }
.memory-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.memory-card__header-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1; }
.memory-card__id { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); background: var(--border-light); padding: 2px 8px; border-radius: 4px; flex-shrink: 0; }
.memory-card__actions { display: flex; gap: 4px; }
.memory-card__content { font-size: 13px; line-height: 1.7; color: var(--text-heading); white-space: pre-wrap; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; transition: all 0.2s ease; }
.memory-card__content.expanded { -webkit-line-clamp: unset; display: block; }
.memory-card__time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; margin-left: auto; }
.memory-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: var(--accent-tag); color: var(--accent-light); padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; border: 1px solid hsl(210 100% 54% / 0.15); }
.memory-card__time { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

/* === Glass Card === */
.glass-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); }

/* === Buttons === */
.btn { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; transition: all 0.15s ease; display: inline-flex; align-items: center; gap: 6px; }
.btn--primary { background: var(--accent-hover); color: #fff; }
.btn--primary:hover { background: var(--accent); }
.btn--secondary { background: var(--border); color: var(--text-heading); }
.btn--secondary:hover { background: var(--border-hover); }
.btn--ghost { background: transparent; color: var(--accent-light); padding: 4px 10px; }
.btn--ghost:hover { background: var(--accent-bg-light); }
.btn--outline { background: transparent; border: 1px solid var(--border-hover); color: var(--text-heading); padding: 4px 12px; }
.btn--outline:hover { border-color: var(--accent-light); color: var(--accent-light); background: var(--accent-bg-subtle); }
.btn--ghost-danger { background: transparent; color: var(--color-error-light); padding: 4px 10px; }
.btn--ghost-danger:hover { background: var(--color-error-bg); }
.btn--sm { padding: 4px 10px; font-size: 12px; }

/* === Pager === */
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bg-surface); }
.pager__ellipsis { color: var(--text-muted); font-size: 13px; padding: 0 4px; user-select: none; }
.pager__info { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-right: 8px; }
.pager__btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface); cursor: pointer; font-size: 13px; color: var(--text-secondary); font-family: inherit; transition: all 0.15s ease; }
.pager__btn:hover { border-color: var(--accent); color: var(--accent-light); }
.pager__btn--active { background: var(--accent-hover); color: #fff; border-color: var(--accent-hover); }

/* === Issue Card === */
.issue-card { background: var(--bg-surface); border-radius: 10px; padding: 18px 20px; border: 1px solid var(--border); transition: all 0.15s ease; cursor: pointer; }
.issue-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-card); }
.issue-card__header { display: flex; justify-content: space-between; align-items: flex-start; }
.issue-card__title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.issue-card__number { font-family: var(--font-mono); color: var(--text-muted); font-weight: 500; font-size: 13px; }
.issue-card__content { font-size: 13px; line-height: 1.6; color: var(--text-secondary); margin-top: 10px; white-space: pre-wrap; word-break: break-all; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.3s ease; opacity: 0; margin-top: 0; }
.issue-card.expanded .issue-card__content { max-height: 500px; opacity: 1; margin-top: 10px; }
.issue-card__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.issue-card__expand { font-size: 11px; color: var(--text-muted); margin-top: 6px; transition: color 0.15s; }
.issue-card:hover .issue-card__expand { color: var(--text-secondary); }

/* Issue structured fields */
.issue-parent-tag { display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--color-purple-bg); color: var(--color-purple); font-size: 11px; font-weight: 500; }
.issue-structured { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.3s, opacity 0.2s; }
.issue-card.expanded .issue-structured { max-height: 2000px; opacity: 1; margin-top: 10px; }
.issue-field { margin-bottom: 8px; padding: 6px 10px; background: var(--bg-muted); border-radius: 6px; border-left: 3px solid var(--border); }
.issue-field__label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.issue-field__value { font-size: 13px; color: var(--text-heading); white-space: pre-wrap; word-break: break-word; }
.issue-field__value code { background: var(--accent-bg); padding: 1px 5px; border-radius: 3px; font-size: 12px; color: var(--accent-light); }
.issue-extra-fields { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 0; }
.issue-extra-fields[open] { padding: 0 12px 12px; }
.issue-extra-toggle { cursor: pointer; padding: 10px 12px; font-size: 13px; color: var(--text-secondary); font-weight: 500; list-style: none; user-select: none; }
.issue-extra-toggle::-webkit-details-marker { display: none; }
.issue-extra-toggle::before { content: '▶ '; font-size: 10px; transition: transform 0.2s; display: inline-block; }
.issue-extra-fields[open] > .issue-extra-toggle::before { transform: rotate(90deg); }
.issue-extra-fields[open] > .issue-extra-toggle { margin-bottom: 8px; color: var(--text-heading); }
.issue-files-list { list-style: none; padding: 0; margin: 0; }
.issue-file-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.issue-file-item code { font-size: 12px; }
.badge--xs { font-size: 10px; padding: 0 4px; }

/* === Status Panel === */
.status-panel { background: var(--bg-surface); border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--border); }
.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.status-item__label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.status-item__value { font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; background: var(--bg-primary); padding: 8px 12px; border-radius: var(--radius-sm); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot--ok { background: var(--color-success-dot); }
.status-dot--blocked { background: var(--color-error); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.status-section { margin-bottom: 20px; }
.status-section:last-child { margin-bottom: 0; }
.status-section__title { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.status-section__list { display: flex; flex-direction: column; gap: 6px; }
.status-section__item { font-size: 13px; color: var(--text-heading); line-height: 1.5; }

/* === Modal === */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--overlay); backdrop-filter: blur(4px); }
.modal-body { position: relative; background: var(--bg-surface); border-radius: 14px; padding: 28px; width: 80%; max-height: 80vh; overflow-y: auto; border: 1px solid var(--border); box-shadow: var(--shadow-modal); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.modal-header .modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all 0.15s ease; }
.modal-header .modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* === Form === */
.form-field { margin-bottom: 16px; }
.form-label { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-primary); background: var(--bg-input); font-family: inherit; transition: all 0.15s ease; }
.form-textarea { min-height: 200px; resize: vertical; max-height: 50vh; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }

/* === Section Title === */
.section-title { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; margin-top: 20px; }

/* === Empty State === */
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }

/* === Toast === */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 20px; border-radius: 10px; font-size: 13px; color: var(--text-primary); pointer-events: auto; animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards; max-width: 400px; backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.06); }
.toast--success { background: var(--color-success-bg); border-color: rgba(34,197,94,0.3); }
.toast--info { background: var(--color-info-bg); border-color: rgba(59,130,246,0.3); }
.toast--warning { background: var(--color-warning-bg); border-color: rgba(245,158,11,0.3); }
.toast--error { background: var(--color-error-bg); border-color: rgba(239,68,68,0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* === Welcome Guide === */
.welcome-guide { text-align: center; padding: 48px 32px; max-width: 520px; margin: 0 auto; }
.welcome-guide__title { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-heading); margin-bottom: 12px; }
.welcome-guide__desc { font-size: 13px; color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; }
.welcome-guide__cmd { font-family: var(--font-mono); font-size: 12px; color: var(--color-purple); background: var(--color-purple-bg); padding: 8px 16px; border-radius: 8px; display: inline-block; margin-top: 12px; user-select: all; }

/* === Export/Import Toolbar === */
.toolbar-right { display: flex; gap: 8px; margin-left: auto; }
/* toolbar variants */
.toolbar--wrap { flex-wrap: wrap; }
.toolbar-group { display: flex; gap: 8px; align-items: center; }
.search-box--toolbar { flex: 0 1 240px; min-width: 160px; }


/* === Tag Management === */
.tag-table { width: 100%; border-collapse: collapse; }
.tag-table th { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tag-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; color: var(--text-heading); }
.tag-table tr:hover td { background: var(--bg-card-hover); }
.tag-cell { display: flex; align-items: center; gap: 8px; }
.tag-cell__check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.tag-cell__name { background: var(--accent-tag); color: var(--accent-light); padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid hsl(210 100% 54% / 0.15); }
.tag-count { font-family: var(--font-mono); font-weight: 600; color: var(--accent); white-space: nowrap; }
.tag-actions { display: flex; gap: 4px; white-space: nowrap; }
.tag-table th:first-child, .tag-table td:first-child { width: 40px; }
.tag-table th:nth-child(3), .tag-table td:nth-child(3) { width: 100px; }
.tag-table th:last-child, .tag-table td:last-child { width: 180px; }
.batch-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-surface); border-radius: 10px; border: 1px solid var(--border); margin-bottom: 16px; }
.batch-bar__info { font-size: 13px; color: var(--text-secondary); }
.batch-bar__info strong { color: var(--text-primary); }
.btn--danger { background: var(--color-error-bg); color: var(--color-error-light); }
.btn--danger:hover { background: var(--color-error-bg); }
.select-all { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.select-all input { accent-color: var(--accent); }


/* === Project Select Page === */
.project-select {
  width: 100%; min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding: 60px 0;
  position: relative; overflow-y: auto;
}
.project-select::before {
  content: ''; position: fixed; top: -30%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-bg-subtle) 0%, transparent 70%);
  animation: floatOrb1 20s ease-in-out infinite; pointer-events: none;
}
.project-select::after {
  content: ''; position: fixed; bottom: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, hsl(270 76% 60% / 0.06) 0%, transparent 70%);
  animation: floatOrb2 25s ease-in-out infinite; pointer-events: none;
}
@keyframes floatOrb1 {
  0%,100% { transform: translate(0,0); }
  33% { transform: translate(80px,60px); }
  66% { transform: translate(-40px,30px); }
}
@keyframes floatOrb2 {
  0%,100% { transform: translate(0,0); }
  33% { transform: translate(-60px,-40px); }
  66% { transform: translate(40px,-60px); }
}
.project-select__header { text-align: center; margin-bottom: 52px; position: relative; z-index: 1; }
.project-select__logo { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.project-select__logo svg { width: 36px; height: 36px; }
.project-select__logo .node { fill: var(--accent); }
.project-select__logo .edge { stroke: var(--accent); stroke-width: 1.2; opacity: 0.5; }
.project-select__logo span {
  font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: -0.3px;
}
.project-select__title { font-size: 15px; font-weight: 400; color: var(--text-muted); }
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; width: 100%; max-width: 1000px; padding: 0 32px;
  position: relative; z-index: 1;
}
.project-card {
  background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 28px 24px; border: 1px solid var(--border-light);
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative; overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.4,0,0.2,1) backwards;
}
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--color-purple), var(--color-cyan)); opacity: 0; transition: opacity 0.3s ease;
}
.project-card::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 30%, var(--accent-bg-subtle) 0%, transparent 50%);
  pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
}
.project-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 0 1px var(--accent-bg-subtle), inset 0 1px 0 rgba(255,255,255,0.03);
}
.project-card:hover::before { opacity: 1; }
.project-card:hover::after { opacity: 1; }
.project-card__icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-bg), var(--color-purple-bg));
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.project-card__icon svg { width: 20px; height: 20px; color: var(--accent-light); }
.project-card__name { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.project-card__path { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-bottom: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card__delete {
  position: absolute; top: 28px; right: 24px; z-index: 2;
  width: 28px; height: 28px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.15s ease;
}
.project-card:hover .project-card__delete { opacity: 1; }
.project-card__delete:hover { background: var(--color-error-bg); color: var(--color-error-light); }
.project-card__stats { display: flex; border-top: 1px solid var(--border-light); padding-top: 18px; }
.project-card__stat { flex: 1; text-align: center; position: relative; }
.project-card__stat + .project-card__stat::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px; background: var(--border-light); }
.project-card__stat-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.project-card__stat-num--blue { color: var(--accent); }
.project-card__stat-num--cyan { color: var(--color-cyan); }
.project-card__stat-num--amber { color: var(--color-warning); }
.project-card__stat-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.3px; }
.project-select__footer { text-align: center; margin-top: 48px; font-size: 12px; color: var(--border); position: relative; z-index: 1; }

.project-card--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px dashed var(--border); background: var(--bg-primary);
  cursor: pointer; min-height: 180px;
}
.project-card--add:hover { border-color: var(--accent); background: var(--bg-surface); }
.project-card__icon--add { background: linear-gradient(135deg, var(--color-purple-bg), var(--color-purple-bg)); }
.project-card__icon--add svg { color: var(--color-purple); }

.add-project-form label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.add-project-input-row { display: flex; gap: 8px; }
.add-project-input-row input { flex: 1; background: var(--bg-input); border: 1px solid var(--border-light); border-radius: 8px; padding: 10px 14px; color: var(--text-primary); font-family: var(--font-mono); font-size: 13px; outline: none; }
.add-project-input-row input:focus { border-color: var(--accent); }
.btn-browse { background: var(--color-purple-bg); color: var(--color-purple); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 13px; white-space: nowrap; transition: all 0.15s; }
.btn-browse:hover { background: var(--accent-bg); border-color: var(--accent); }

.dir-browser { margin-top: 12px; background: var(--bg-input); border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.dir-browser__path { padding: 8px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--border-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-browser__list { max-height: 240px; overflow-y: auto; }
.dir-browser__item { padding: 8px 14px; font-size: 13px; color: var(--text-heading); cursor: pointer; transition: background 0.1s; display: flex; align-items: center; gap: 6px; }
.dir-browser__item:hover { background: var(--accent-bg-subtle); }
.dir-browser__item--parent { color: var(--color-purple); font-size: 12px; border-bottom: 1px solid var(--border-light); }

/* === Sidebar Project Info === */
.sidebar-project-info {
  padding: 12px 24px; border-bottom: 1px solid var(--bg-surface);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all 0.15s ease; font-size: 12px; color: var(--text-secondary);
}
.sidebar-project-info:hover { background: var(--bg-hover); color: var(--text-heading); }
.sidebar-project-info svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.15s ease; }
.sidebar-project-info:hover svg { transform: translateX(-2px); }
.sidebar-project-info__name {
  font-family: var(--font-mono); font-weight: 500; color: var(--text-heading);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


/* === Project Select Toolbar (lang + user) === */
.project-select__toolbar {
  position: absolute; top: 20px; right: 32px; z-index: 10;
  display: flex; align-items: center; gap: 16px;
}
.project-select__user {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary);
}
.project-select__user .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
}
.project-select__user .btn--ghost-danger { font-size: 12px; padding: 4px 10px; }

/* === Language Switcher === */
.lang-switcher--topright { position: absolute; top: 20px; right: 32px; z-index: 10; }
.lang-select { padding: 6px 28px 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-primary); background: var(--bg-surface); font-family: inherit; cursor: pointer; transition: all 0.15s ease; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.lang-select:hover { border-color: var(--border-hover); }
.lang-select option { background: var(--bg-surface); color: var(--text-primary); }

/* === Issue Card Actions === */
.issue-card__actions { display: flex; gap: 4px; flex-shrink: 0; }
.issue-card__actions .btn { opacity: 0; transition: opacity 0.15s ease; }
.issue-card:hover .issue-card__actions .btn { opacity: 1; }

/* === Task View === */
.task-groups { display: flex; flex-direction: column; gap: 16px; }
.task-group { background: var(--bg-surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.task-group-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg-primary); border-bottom: 1px solid var(--border); cursor: pointer; }
.task-group-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; display: inline-block; width: 16px; text-align: center; flex-shrink: 0; }
.task-group-header.collapsed .task-group-toggle { transform: rotate(-90deg); }
.task-group-header.collapsed + .task-group-items { display: none; }
.task-group-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.task-group-title { font-weight: 600; color: var(--text-heading); font-size: 14px; }
.task-group-progress { font-size: 13px; color: var(--text-secondary); background: var(--border); padding: 2px 10px; border-radius: 10px; }
.task-group-items { padding: 4px 0; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; transition: background 0.15s; cursor: default; }
.task-item:hover { background: var(--accent-bg-subtle); }
.task-checkbox { cursor: pointer; font-size: 16px; color: var(--text-muted); user-select: none; flex-shrink: 0; }
.task-item.status--done .task-checkbox { color: var(--color-success-dot); }
.task-item.status--skipped .task-checkbox { color: var(--color-error); }
.task-title { flex: 1; font-size: 13px; color: var(--text-heading); }
.task-title.task-done { color: var(--text-muted); }
.task-status-badge { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 500; flex-shrink: 0; }
.task-status--pending { background: var(--color-warning-bg); color: var(--color-warning); }
.task-status--in_progress { background: var(--accent-bg); color: var(--accent); }
.task-status--completed { background: var(--color-success-bg); color: var(--color-success-dot); }
.task-status--skipped { background: var(--color-error-bg); color: var(--color-error); }
.task-status--archived { background: var(--bg-muted); color: var(--text-muted); }
.issue-task-progress { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--accent-tag); color: var(--accent); }
.task-group--archived { opacity: 0.7; }
.task-card--archived { opacity: 0.8; pointer-events: none; }

/* === Task Tree (Node + Children) === */
.task-node { border-bottom: 1px solid var(--border-light); }
.task-node:last-child { border-bottom: none; }
.task-node-header { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 16px; transition: background 0.15s; }
.task-node-header:hover { background: var(--bg-hover); }
.task-node-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; display: inline-block; width: 16px; text-align: center; flex-shrink: 0; }
.task-node-header.collapsed .task-node-toggle { transform: rotate(-90deg); }
.task-node-progress { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); background: var(--border-light); padding: 1px 8px; border-radius: 8px; flex-shrink: 0; }
.task-children { padding-left: 24px; }
.task-children.hidden { display: none; }

/* === Task CRUD Actions === */
.task-actions-group { display: inline-flex; gap: 2px; opacity: 0; transition: opacity 0.15s; margin-left: auto; flex-shrink: 0; }
.task-item:hover .task-actions-group,
.task-node-header:hover .task-actions-group,
.task-group-header:hover .task-actions-group { opacity: 1; }
.task-action-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-muted); transition: all 0.15s; user-select: none; }
.task-action-btn:hover { background: var(--accent-bg); color: var(--accent-light); }
.task-action-btn--danger:hover { background: var(--color-error-bg); color: var(--color-error-light); }
.task-group-header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* === Theme Toggle === */
.sidebar-bottom { border-top: 1px solid var(--bg-surface); }
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px; cursor: pointer;
  transition: all 0.15s; font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--bg-surface);
}
.theme-toggle:hover { color: var(--text-primary); background: hsl(0 0% 50% / 0.06); }
.theme-toggle__icon { width: 16px; height: 16px; flex-shrink: 0; }
.theme-toggle__icon--light { display: none; }
[data-theme="light"] .theme-toggle__icon--dark { display: none; }
[data-theme="light"] .theme-toggle__icon--light { display: block; }
[data-theme="light"] .theme-toggle { border-bottom-color: var(--border); }

/* === Sidebar User Card === */
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 20px; cursor: pointer; transition: all 0.15s; }
.sidebar-user:hover { background: hsl(0 0% 100% / 0.03); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--color-purple)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .sidebar-user:hover { background: hsl(0 0% 0% / 0.04); }


/* === Settings Page === */
.settings-section { margin-bottom: 24px; }
.settings-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.settings-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.settings-stat { background: var(--bg-primary); border-radius: var(--radius); padding: 16px; text-align: center; }
.settings-stat__label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.settings-stat__value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; line-height: 1.2; }
.settings-stat__value.blue { color: var(--accent); }
.settings-stat__value.green { color: var(--color-success); }
.settings-stat__value.purple { color: var(--color-purple); }
.settings-health-grid { display: flex; flex-direction: column; gap: 8px; }
.settings-health-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg-primary); border-radius: var(--radius-sm); font-size: 13px; }
.settings-health-label { color: var(--text-secondary); }
.settings-health-value { font-family: var(--font-mono); font-size: 12px; }
.settings-health-value.ok { color: var(--color-success); }
.settings-health-value.warn { color: var(--color-warning); }
.settings-backup-list { display: flex; flex-direction: column; gap: 4px; }
.settings-backup-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg-primary); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-heading); }
.settings-backup-size { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ============== Auth Page ============== */
.auth-page {
  width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: ''; position: fixed; top: -30%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, hsl(270 76% 60% / 0.08) 0%, transparent 70%);
  animation: authOrb1 20s ease-in-out infinite; pointer-events: none;
}
.auth-page::after {
  content: ''; position: fixed; bottom: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  animation: authOrb2 25s ease-in-out infinite; pointer-events: none;
}
@keyframes authOrb1 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(80px,60px)} 66%{transform:translate(-40px,30px)} }
@keyframes authOrb2 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(-60px,-40px)} 66%{transform:translate(40px,-60px)} }

.auth-card {
  width: 420px; max-width: 90vw; position: relative; z-index: 1;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 32px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px;
}
.auth-logo .node { fill: var(--accent); }
.auth-logo .edge { stroke: var(--accent); stroke-width: 1.2; opacity: 0.5; }
.auth-logo span { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.auth-title { text-align: center; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.auth-desc { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
.auth-error {
  background: var(--color-error-bg); color: #f87171; border: 1px solid var(--color-error);
  border-radius: var(--radius, 8px); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; text-align: center;
}
.auth-page .form-group { margin-bottom: 16px; }
.auth-page .form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.auth-page .form-input {
  width: 100%; padding: 10px 12px; background: var(--bg, #1e1e2e); border: 1px solid var(--border);
  border-radius: var(--radius, 8px); color: var(--text-primary); font-size: 14px; outline: none;
}
.auth-page .form-input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.auth-page .btn--full { width: 100%; display: flex; align-items: center; justify-content: center; margin-top: 8px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-secondary); margin-top: 20px; }
.btn-link { background: none; border: none; color: var(--accent, #6366F1); cursor: pointer; font-size: 13px; padding: 0; }
.btn-link:hover { text-decoration: underline; }
