/* === Outline view === */
.ol-view { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 22px 24px; animation: fadeIn 0.22s ease; }
.ol-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.ol-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.ol-sub { font-size: 12.5px; color: #64748B; margin: 0; }

.ol-table-head {
  display: flex; gap: 8px;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid var(--c-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  font-size: 11.5px; font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.04em;
}
.ol-list {
  border: 1px solid var(--c-border);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.ol-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  background: #fff;
}
.ol-row:last-child { border-bottom: 0; }
.ol-row:hover { background: var(--c-row-hover); }
.ol-row.selected { background: var(--c-primary-50); }
.ol-row.selected::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2.5px; background: var(--c-primary); }

.ol-toggle { width: 18px; height: 18px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; color: #64748B; flex-shrink: 0; border-radius: 3px; padding: 0; }
.ol-toggle:hover { background: rgba(0,0,0,0.06); }

.ol-kind { display: inline-flex; align-items: center; justify-content: center; width: 18px; flex-shrink: 0; }
.ol-kind.kind-empty { color: #CBD5E1; }
.ol-kind.kind-category { color: #2563EB; }
.ol-kind.kind-sales { color: #DB2777; }

.ol-name { font-size: 13.5px; font-weight: 500; color: var(--c-text-1); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-rename { flex: 1; height: 26px; padding: 0 8px; font-size: 13.5px; border: 1px solid var(--c-primary); border-radius: 4px; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.ol-meta { width: 140px; flex-shrink: 0; display: flex; }
.ol-count { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.ol-count.cat { background: #EFF6FF; color: #1D4ED8; }
.ol-count.sales { background: #FCE7F3; color: #BE185D; }
.ol-count.empty { background: #F1F5F9; color: #94A3B8; }

.ol-actions { width: 130px; flex-shrink: 0; display: flex; gap: 4px; justify-content: flex-end; transition: opacity 0.14s; }

.ol-sales-block { background: #FAFBFC; border-bottom: 1px solid var(--c-border); padding-top: 6px; padding-bottom: 6px; padding-right: 14px; }
.ol-sc-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; }
.ol-sc-row:hover { background: #fff; }
.ol-sc-dot { width: 6px; height: 6px; border-radius: 50%; background: #DB2777; flex-shrink: 0; }
.ol-sc-name { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-sc-tags { display: flex; gap: 4px; flex-shrink: 0; }
.ol-sc-cap { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #64748B; flex-shrink: 0; min-width: 50px; text-align: right; }
.ol-sc-price { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; color: var(--c-required); min-width: 70px; text-align: right; flex-shrink: 0; }


/* === Treemap view === */
.tm-view { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 22px 24px; animation: fadeIn 0.22s ease; }
.tm-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.tm-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.tm-sub { font-size: 12.5px; color: #64748B; margin: 0; max-width: 520px; }
.tm-legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: #64748B; }
.tm-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.tm-legend-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.tm-canvas-wrap { background: #FAFBFC; border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; overflow: auto; }
.tm-canvas { position: relative; }

.tm-cell {
  position: absolute;
  border: 1px solid;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s;
  overflow: hidden;
}
.tm-cell:hover { filter: brightness(0.97); }
.tm-cell.selected { box-shadow: 0 0 0 2px var(--c-primary); z-index: 2; }
.tm-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden;
}
.tm-label-name { overflow: hidden; text-overflow: ellipsis; }
.tm-label-count { margin-left: auto; font-size: 10.5px; padding: 1px 6px; background: rgba(255,255,255,0.7); border-radius: 999px; font-weight: 500; flex-shrink: 0; }

.tm-brick {
  position: absolute;
  background: #fff;
  border: 1px solid #FBCFE8;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer;
  transition: all 0.14s;
  overflow: hidden;
}
.tm-brick:hover { border-color: #DB2777; box-shadow: var(--shadow-md); }
.tm-brick-name { font-size: 11.5px; font-weight: 500; color: var(--c-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-brick-price { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 700; color: var(--c-required); }
.tm-brick-dot { position: absolute; right: 8px; top: 8px; width: 6px; height: 6px; border-radius: 50%; }
.tm-brick-dot.on { background: var(--c-success); }
.tm-brick-dot.off { background: #CBD5E1; }


/* === Org-chart view === */
.oc-view { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 22px 24px; animation: fadeIn 0.22s ease; }
.oc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.oc-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.oc-sub { font-size: 12.5px; color: #64748B; margin: 0; }
.oc-zoom { display: flex; align-items: center; gap: 6px; }
.oc-zoom-val { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #64748B; min-width: 36px; text-align: center; }

.oc-canvas-wrap {
  background:
    radial-gradient(circle at 1px 1px, #E2E8F0 1px, transparent 0) 0 0 / 18px 18px,
    #FAFBFC;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: auto;
  max-height: 720px;
}
.oc-canvas { position: relative; min-width: 100%; }
.oc-edges { position: absolute; left: 0; top: 0; pointer-events: none; }

.oc-node {
  position: absolute;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
}
.oc-node:hover { border-color: var(--c-primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.oc-node.selected { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.oc-node-bar { width: 4px; flex-shrink: 0; }
.oc-node-bar.kind-category { background: linear-gradient(180deg, #3B82F6, #2563EB); }
.oc-node-bar.kind-sales { background: linear-gradient(180deg, #EC4899, #DB2777); }
.oc-node-bar.kind-empty { background: #CBD5E1; }
.oc-node-body { flex: 1; min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.oc-node-head { display: flex; align-items: center; gap: 6px; }
.oc-node-kind.kind-category { color: #2563EB; }
.oc-node-kind.kind-sales { color: #DB2777; }
.oc-node-kind.kind-empty { color: #94A3B8; }
.oc-node-name { font-size: 13px; font-weight: 600; color: var(--c-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.oc-node-meta { font-size: 11.5px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.oc-node.oc-root {
  background: linear-gradient(135deg, #1E40AF, #2563EB);
  border: 0;
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  box-shadow: 0 6px 16px rgba(37,99,235,0.25);
}
.oc-root-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.oc-root-text { display: flex; flex-direction: column; gap: 2px; }
.oc-root-name { font-size: 14px; font-weight: 700; color: #fff; }
.oc-root-sub { font-size: 11px; color: rgba(255,255,255,0.75); }

/* === Mode pill style === */
.mode-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 12px; height: 32px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748B;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.mode-pill:hover { color: var(--c-primary); border-color: var(--c-primary); }
.mode-pill.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); box-shadow: 0 2px 6px rgba(37,99,235,0.25); }
.mode-pill.active svg { color: #fff; }
