/* ============================================
   DevMemory 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
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0F172A;
  color: #F1F5F9;
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}
#app { display: flex; width: 100%; }

/* === Sidebar === */
.sidebar {
  width: 240px;
  background: #0B1120;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1E293B;
}
.logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #F1F5F9;
  border-bottom: 1px solid #1E293B;
}
.logo-icon { width: 28px; height: 28px; }
.logo-icon .node { fill: #3B82F6; }
.logo-icon .edge { stroke: #3B82F6; 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: #94A3B8;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid transparent;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(59,130,246,0.06); color: #CBD5E1; }
.nav-item.active {
  background: rgba(59,130,246,0.1);
  color: #F1F5F9;
  border-left-color: #3B82F6;
  font-weight: 500;
}

/* === Sidebar Decor === */
.sidebar-decor { padding: 12px 20px 16px; border-top: 1px solid #1E293B; 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 === */
.content { flex: 1; padding: 28px 32px; overflow-y: auto; background: #0F172A; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Page Header === */
.page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.page-title { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: #F1F5F9; }
.page-count { font-size: 13px; color: #64748B; }

/* === Stats Grid === */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card { background: #1E293B; border-radius: 12px; padding: 24px; border: 1px solid #334155; transition: all 0.2s ease; }
.stat-card:hover { border-color: #475569; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.stat-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.stat-card__label { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #64748B; }
.stat-card__icon { width: 20px; height: 20px; color: #475569; }
.stat-card__number { font-family: 'JetBrains Mono', monospace; font-size: 36px; font-weight: 700; line-height: 1; margin-bottom: 8px; }
.stat-card--primary .stat-card__number { color: #3B82F6; }
.stat-card--success .stat-card__number { color: #22C55E; }
.stat-card--accent .stat-card__number { color: #F97316; }
.stat-card__detail { font-size: 13px; color: #94A3B8; }
.stat-card__detail strong { color: #F1F5F9; font-weight: 600; }

/* === Stat Link === */
.stat-card__more { font-size: 12px; color: #60A5FA; cursor: pointer; text-decoration: none; white-space: nowrap; }
.stat-card__more:hover { color: #3B82F6; }
.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: #3B82F6; }
.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: #CBD5E1; border-bottom: 1px solid rgba(51,65,85,0.5); }
.stat-list li:last-child { border-bottom: none; }
.stat-list--tags .tag-count { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: #3B82F6; 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: rgba(245,158,11,0.15); color: #FBBF24; }
.badge--info { background: rgba(59,130,246,0.15); color: #60A5FA; }
.badge--success { background: rgba(34,197,94,0.15); color: #4ADE80; }
.badge--muted { background: rgba(148,163,184,0.1); color: #64748B; }

/* === Vector Network === */
.vector-network { margin-top: 24px; background: #1E293B; border-radius: 12px; border: 1px solid #334155; padding: 20px 24px; }
.vector-network__header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.vector-network__label { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #64748B; }
.vector-network__sub { font-size: 12px; color: #475569; }
.vector-graph { width: 100%; height: 360px; user-select: none; cursor: grab; }
.vector-graph:active { cursor: grabbing; }
.vg-edge { stroke: #334155; stroke-width: 1; transition: stroke 0.2s; }
.vg-edge--weak { stroke: #1E293B; 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: 'JetBrains Mono', monospace; font-size: 11px; fill: #94A3B8; text-anchor: middle; pointer-events: none; transition: fill 0.15s; }
.vg-node:hover .vg-node__glow { fill: rgba(59,130,246,0.25) !important; }
.vg-node:hover .vg-node__label { fill: #F1F5F9; }
.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: #64748B; }
.search-input { width: 100%; padding: 9px 32px 9px 36px; border: 1px solid #334155; border-radius: 8px; font-size: 13px; color: #F1F5F9; background: #1E293B; transition: all 0.15s ease; font-family: inherit; }
.search-input:focus { outline: none; border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.search-input::placeholder { color: #475569; }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border: none; background: transparent; color: #64748B; 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: #F1F5F9; background: #334155; }
.search-clear.hidden { display: none; }
.filter-input, .filter-select { padding: 9px 12px; border: 1px solid #334155; border-radius: 8px; font-size: 13px; color: #F1F5F9; background: #1E293B; font-family: inherit; }
.filter-input:focus, .filter-select:focus { outline: none; border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.filter-select option { background: #1E293B; color: #F1F5F9; }

/* === Memory Card === */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.memory-card { background: #1E293B; border-radius: 10px; padding: 18px 20px; border: 1px solid #334155; transition: all 0.15s ease; }
.memory-card:hover { border-color: #475569; box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.memory-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.memory-card__id { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #64748B; background: rgba(51,65,85,0.5); padding: 2px 8px; border-radius: 4px; }
.memory-card__actions { display: flex; gap: 4px; }
.memory-card__content { font-size: 13px; line-height: 1.7; color: #CBD5E1; white-space: pre-wrap; word-break: break-all; }
.memory-card__footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.memory-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: rgba(59,130,246,0.12); color: #60A5FA; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.memory-card__time { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #475569; }

/* === 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: #2563EB; color: #fff; }
.btn--primary:hover { background: #3B82F6; }
.btn--secondary { background: #334155; color: #CBD5E1; }
.btn--secondary:hover { background: #475569; }
.btn--ghost { background: transparent; color: #60A5FA; padding: 4px 10px; }
.btn--ghost:hover { background: rgba(59,130,246,0.1); }
.btn--ghost-danger { background: transparent; color: #F87171; padding: 4px 10px; }
.btn--ghost-danger:hover { background: rgba(239,68,68,0.1); }
.btn--sm { padding: 4px 10px; font-size: 12px; }

/* === Pager === */
.pager { display: flex; align-items: center; gap: 6px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #1E293B; }
.pager__info { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #64748B; margin-right: 8px; }
.pager__btn { padding: 6px 12px; border: 1px solid #334155; border-radius: 6px; background: #1E293B; cursor: pointer; font-size: 13px; color: #94A3B8; font-family: inherit; transition: all 0.15s ease; }
.pager__btn:hover { border-color: #3B82F6; color: #60A5FA; }
.pager__btn--active { background: #2563EB; color: #fff; border-color: #2563EB; }

/* === Issue Card === */
.issue-card { background: #1E293B; border-radius: 10px; padding: 18px 20px; border: 1px solid #334155; transition: all 0.15s ease; }
.issue-card:hover { border-color: #475569; box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.issue-card__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.issue-card__title { font-size: 14px; font-weight: 600; color: #F1F5F9; display: flex; align-items: center; gap: 8px; }
.issue-card__number { font-family: 'JetBrains Mono', monospace; color: #64748B; font-weight: 500; font-size: 13px; }
.issue-card__content { font-size: 13px; line-height: 1.6; color: #94A3B8; }
.issue-card__meta { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #475569; margin-top: 10px; }

/* === Status Panel === */
.status-panel { background: #1E293B; border-radius: 12px; padding: 24px; border: 1px solid #334155; }
.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid #334155; }
.status-item__label { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #64748B; margin-bottom: 6px; }
.status-item__value { font-size: 14px; color: #F1F5F9; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot--ok { background: #22C55E; }
.status-dot--blocked { background: #EF4444; 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: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #64748B; margin-bottom: 10px; }
.status-section__list { display: flex; flex-direction: column; gap: 6px; }
.status-section__item { font-size: 13px; color: #CBD5E1; 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: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-body { position: relative; background: #1E293B; border-radius: 14px; padding: 28px; width: 90%; max-width: 720px; max-height: 80vh; overflow-y: auto; border: 1px solid #334155; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 600; color: #F1F5F9; }
.modal-header .modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #64748B; 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: #334155; color: #F1F5F9; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #334155; }

/* === Form === */
.form-field { margin-bottom: 16px; }
.form-label { display: block; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: #94A3B8; margin-bottom: 6px; }
.form-input, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid #334155; border-radius: 8px; font-size: 13px; color: #F1F5F9; background: #0F172A; 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: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

/* === Empty State === */
.empty-state { text-align: center; padding: 40px; color: #64748B; font-size: 13px; }
