/* dependency-map.html — page-specific styles */

:root {
    --bg: #0c1015;
    --surface: #12171f;
    --surface2: #19202b;
    --surface3: #202a38;
    --border: #273445;
    --border2: #324157;
    --accent: #5ba3eb;
    --accent2: #2d89e5;
    --text: #d8e9fa;
    --text2: #8f9aa9;
    --text3: #8b96a6;
    --init-color: #8a98f6;
    --epic-color: #4898e8;
    --cap-color: #34d399;
    --feat-color: #8c99a8;
    --score-hi: #4ade80;
    --score-med: #fbbf24;
    --score-lo: #f87171;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'IBM Plex Sans', sans-serif;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg); color: var(--text); font-family: var(--sans);
    height: 100vh; overflow: hidden;
  }

  /* ── APP LAYOUT / SIDEBAR (from score-rank.html) ── */
  .app-container { display: flex; height: 100vh; }
  .sidebar {
    width: 280px; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1); color: white; padding: 24px 0;
    box-shadow: 2px 0 25px rgba(0,0,0,0.3); transition: all 0.3s ease;
    overflow-y: auto; flex-shrink: 0;
  }
  .sidebar.collapsed { width: 80px; }

  .sidebar .logo { display: flex; align-items: center; font-size: 20px; font-weight: 600; color: white; }
  .sidebar .logo img { height: 32px; }
  .nav-item {
    display: flex; align-items: center; padding: 12px 24px; cursor: pointer; transition: all 0.3s ease;
    border: none; background: none; color: white; width: 100%; text-align: left; position: relative;
    border-radius: 0 25px 25px 0; margin: 4px 0; font-size: 14px; font-family: inherit;
  }

  .nav-item.active-page {
    background: linear-gradient(135deg, rgba(43,139,230,0.3), rgba(84,104,242,0.3));
    border-left: 4px solid #5468f2; color: white; font-weight: 500; box-shadow: 0 4px 20px rgba(84,104,242,0.3);
  }
  .nav-item .material-icons { margin-right: 12px; font-size: 20px; flex-shrink: 0; color: inherit; }
  .sidebar.collapsed .nav-text { display: none; }
  .nav-text { flex: 1; white-space: nowrap; overflow: hidden; }
  .main-content { flex: 1; display: flex; flex-direction: column; background: rgba(255,255,255,0.02); min-width: 0; overflow: hidden; }
  .main-header {
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 28px; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  }
  .main-header .header-left { display: flex; align-items: center; gap: 16px; }
  .main-header .menu-btn { background: none; border: none; cursor: pointer; color: #f2f5f9; display: flex; }
  .main-header .header-title { font-size: 24px; font-weight: 700; background: linear-gradient(135deg, #ff6b00, #ff9933); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
  .header-stats { display: flex; gap: 18px; }

  .stat-val { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--accent); line-height: 1; }
  .stat-val.warn { color: var(--score-lo); }
  .next-step-btn { display:inline-flex; align-items:center; gap:5px; background:var(--accent2); border:1px solid var(--accent); color:#fff; font-weight:600; font-size:12px; border-radius:5px; padding:7px 13px; cursor:pointer; transition:all .15s; white-space:nowrap; }
  .next-step-btn:hover { background:var(--accent); }
  .next-step-btn .material-icons { font-size:16px; }
  .stat-label { font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text3); }

  /* ── TOOLBAR ── */
  .toolbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px 20px; display: flex; align-items: center; gap: 10px;
    flex-shrink: 0; flex-wrap: wrap;
  }
  .toolbar-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text3); white-space: nowrap; }
  .btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
    border-radius: 4px; border: 1px solid var(--border2); background: var(--surface2);
    color: var(--text2); font-family: var(--sans); font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
  }
  .btn:hover { background: var(--surface3); border-color: var(--accent); color: var(--text); }
  .btn.active { background: var(--accent2); border-color: var(--accent); color: white; }
  .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
  .divider { width: 1px; height: 20px; background: var(--border2); margin: 0 4px; }
  .legend { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
  .legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); }

  /* ── MAP AREA ── */
  .workspace { flex: 1; display: flex; min-height: 0; }
  .map-outer { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
  .map-cols {
    height: 30px; flex-shrink: 0; position: relative; background: var(--surface);
    border-bottom: 1px solid var(--border); overflow: hidden;
  }
  .map-cols-inner { position: absolute; top: 0; left: 0; height: 100%; will-change: transform; }
  .col-head {
    position: absolute; top: 0; height: 30px; display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    padding-left: 4px;
  }
  .map-scroll { flex: 1; overflow: auto; position: relative; }
  svg.map { display: block; }
  .node-g { cursor: pointer; }
  .node-g:hover .node-rect { stroke-width: 2.4; }
  .node-rect { transition: stroke-width .12s; }
  .node-label { font-family: var(--sans); font-size: 11px; fill: var(--text); pointer-events: none; }
  .node-caret { font-family: var(--mono); font-size: 11px; fill: var(--text2); pointer-events: none; }
  .link { fill: none; }
  .node-g.faded { opacity: .18; }
  .node-flash .node-rect { stroke: #fff !important; stroke-width: 3 !important; }

  /* ── SIDE PANEL: critical dependencies ── */
  .crit-panel {
    width: 300px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; min-height: 0;
  }
  .crit-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
  .crit-head h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
  .crit-head h3 .material-icons { font-size: 17px; color: var(--score-lo); }
  .crit-head p { font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.5; }
  .crit-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
  .crit-row {
    display: flex; align-items: flex-start; gap: 8px; padding: 8px 9px; border-radius: 6px;
    background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--score-lo);
    cursor: pointer; transition: all .15s;
  }
  .crit-row:hover { border-color: var(--accent); background: var(--surface3); }
  .crit-main { flex: 1; min-width: 0; }
  .crit-name { font-size: 12px; color: var(--text); line-height: 1.3; }
  .crit-ctx { font-size: 9.5px; color: var(--text3); margin-top: 3px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crit-tag { font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; margin-top: 1px; }
  .crit-score { font-family: var(--mono); font-size: 11px; font-weight: 600; flex-shrink: 0; }

  /* tooltip */
  #tip {
    position: fixed; pointer-events: none; z-index: 999; display: none;
    background: var(--surface3); border: 1px solid var(--border2);
    border-radius: 6px; padding: 9px 11px; font-size: 11px; color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 260px;
  }
  #tip .tt { font-family: var(--mono); font-weight: 600; margin-bottom: 6px; font-size: 12px; }
  #tip .tr { display: flex; justify-content: space-between; gap: 16px; color: var(--text2); line-height: 1.7; }
  #tip .tr b { color: var(--text); font-family: var(--mono); }

  @media (max-width: 1024px){ .crit-panel { display: none; } }
  @media (max-width: 768px){ .sidebar{ width: 80px; } .sidebar .nav-text{ display: none; } }

/* PROCESS-SUBMENU-CSS */
  .nav-item.section-header { background: rgba(43,139,230,0.2); border-left:4px solid #2b8be6; color:#cdd4df; font-weight:600; margin:8px 0 4px 0; box-shadow:0 4px 15px rgba(43,139,230,0.2); }
  .expand-icon { margin-left:auto; transition:transform .3s ease; font-size:18px; flex-shrink:0; }
  .nav-item.section-header.expanded .expand-icon { transform: rotate(90deg); }
  .nav-subitems { max-height:0; overflow:hidden; transition:max-height .3s ease; }
  .nav-subitems.expanded { max-height:1400px; }
  .sidebar.collapsed .nav-subitems { display:none; }
  .sidebar.collapsed .expand-icon { display:none; }
  .nav-subitems .nav-item { padding-left:46px; font-weight:400; margin:2px 0; font-size:13px; }
  .nav-subitems .nav-item .material-icons { font-size:18px; }
  .nav-subitems .nav-item:hover { background:rgba(255,255,255,0.1); transform:translateX(8px); }
  .nav-subitems .nav-item.active-page { background:rgba(84,104,242,0.2); border-left:3px solid #5468f2; box-shadow:none; }

  .process-progress-pct { color:#fff; font-weight:600; background:linear-gradient(135deg,#2b8be6,#5468f2); padding:3px 10px; border-radius:20px; }

  .process-step { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:9px; flex:1; cursor:pointer; background:none; border:none; font-family:inherit; padding:0; }
