/* ═══════════════════════════════════════════════════════════════
   ENTITY COMMAND CENTER — entity-command-center.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Root variables ─────────────────────────────────────────── */
.ecc-window {
  --ecc-bg:          rgba(10, 14, 28, 0.97);
  --ecc-surface:     rgba(255,255,255,0.045);
  --ecc-surface-hover: rgba(255,255,255,0.08);
  --ecc-surface-active: rgba(99,176,255,0.15);
  --ecc-border:      rgba(255,255,255,0.09);
  --ecc-border-accent: rgba(99,176,255,0.35);
  --ecc-accent:      #63b0ff;
  --ecc-accent-2:    #a78bfa;
  --ecc-danger:      #f87171;
  --ecc-success:     #4ade80;
  --ecc-warn:        #fbbf24;
  --ecc-text:        #e2e8f0;
  --ecc-text-muted:  #7a8aa0;
  --ecc-text-faint:  #3d4f65;
  --ecc-radius:      10px;
  --ecc-radius-sm:   6px;
  --ecc-sidebar-w:   228px;
  --ecc-edit-panel-w: 320px;
  --ecc-topbar-h:    48px;
  --ecc-statusbar-h: 30px;
  --ecc-anim:        200ms cubic-bezier(.4,0,.2,1);
  --ecc-anim-slow:   350ms cubic-bezier(.4,0,.2,1);
}

/* ── Window Shell ────────────────────────────────────────────── */
.ecc-window {
  position: fixed;
  top: 60px;
  left: 5%;
  width: 90%;
  max-width: 1400px;
  height: calc(100vh - 80px);
  background: var(--ecc-bg);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--z-window-active, 500);
  box-shadow:
    0 4px 6px rgba(0,0,0,.35),
    0 24px 64px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.07);
  color: var(--ecc-text);
  font-family: var(--font-main, 'Inter', sans-serif);
  font-size: 13px;
  backdrop-filter: blur(20px) saturate(1.4);
}

/* ── TOPBAR ─────────────────────────────────────────────────── */
.ecc-topbar {
  display: flex;
  align-items: center;
  height: var(--ecc-topbar-h);
  padding: 0 10px 0 14px;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--ecc-border);
  flex-shrink: 0;
  cursor: move;
  user-select: none;
}

.ecc-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.ecc-logo {
  font-size: 18px;
  color: var(--ecc-accent);
  animation: ecc-logo-pulse 4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ecc-logo-pulse {
  0%, 100% { text-shadow: 0 0 8px rgba(99,176,255,.6); }
  50%       { text-shadow: 0 0 20px rgba(167,139,250,.8); }
}

.ecc-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ecc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ecc-topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  cursor: default;
}

.ecc-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: default;
}

/* Search */
.ecc-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 300px;
}

.ecc-search-icon {
  position: absolute;
  left: 9px;
  font-size: 12px;
  opacity: .5;
  pointer-events: none;
}

.ecc-search-input {
  width: 100%;
  height: 30px;
  padding: 0 8px 0 30px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ecc-border);
  border-radius: 20px;
  color: var(--ecc-text);
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--ecc-anim), background var(--ecc-anim), box-shadow var(--ecc-anim);
}
.ecc-search-input:focus {
  border-color: var(--ecc-accent);
  background: rgba(99,176,255,.07);
  box-shadow: 0 0 0 2px rgba(99,176,255,.18);
}
.ecc-search-input::placeholder { color: var(--ecc-text-muted); }

.ecc-search-count {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: var(--ecc-accent);
  pointer-events: none;
}

/* View switcher */
.ecc-view-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ecc-border);
  border-radius: 20px;
  padding: 2px;
}

.ecc-view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  background: transparent;
  border: none;
  color: var(--ecc-text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: background var(--ecc-anim), color var(--ecc-anim);
  white-space: nowrap;
}
.ecc-view-btn svg { flex-shrink: 0; }
.ecc-view-btn:hover { background: rgba(255,255,255,.07); color: var(--ecc-text); }
.ecc-view-btn--active {
  background: var(--ecc-accent);
  color: #0a0e1c !important;
  font-weight: 600;
}

/* Action buttons */
.ecc-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--ecc-border);
  background: var(--ecc-surface);
  color: var(--ecc-text);
  cursor: pointer;
  font-size: 12px;
  transition: background var(--ecc-anim), border-color var(--ecc-anim), color var(--ecc-anim);
  white-space: nowrap;
}
.ecc-action-btn:hover { background: var(--ecc-surface-hover); border-color: var(--ecc-border-accent); }
.ecc-action-btn--primary {
  background: linear-gradient(135deg, rgba(99,176,255,.25), rgba(167,139,250,.2));
  border-color: rgba(99,176,255,.4);
  color: var(--ecc-accent);
  font-weight: 600;
}
.ecc-action-btn--primary:hover {
  background: linear-gradient(135deg, rgba(99,176,255,.38), rgba(167,139,250,.3));
  border-color: var(--ecc-accent);
}
.ecc-action-btn--danger { color: var(--ecc-danger); border-color: rgba(248,113,113,.3); }
.ecc-action-btn--danger:hover { background: rgba(248,113,113,.15); border-color: var(--ecc-danger); }

/* Window control buttons in topbar */
.unified-ctrl-btn {
  position: static !important;
  background: var(--ecc-surface) !important;
}

/* ── BODY (sidebar + main + edit panel) ─────────────────────── */
.ecc-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.ecc-sidebar {
  width: var(--ecc-sidebar-w);
  flex-shrink: 0;
  overflow: hidden;
  border-right: 1px solid var(--ecc-border);
  display: flex;
  flex-direction: column;
  transition: width var(--ecc-anim-slow), opacity var(--ecc-anim-slow);
  background: rgba(255,255,255,.015);
}

.ecc-sidebar.ecc-sidebar--collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.ecc-sidebar-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
  padding: 8px 0 16px;
  min-width: var(--ecc-sidebar-w);
}

.ecc-sidebar-section {
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--ecc-border);
}
.ecc-sidebar-section:last-child { border-bottom: none; }

.ecc-sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ecc-text-muted);
  margin-bottom: 8px;
}
.ecc-sidebar-icon { font-size: 12px; }

.ecc-clear-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ecc-text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 3px;
  transition: color var(--ecc-anim), background var(--ecc-anim);
}
.ecc-clear-btn:hover { color: var(--ecc-danger); background: rgba(248,113,113,.12); }

/* Stats grid */
.ecc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ecc-stat-card {
  background: var(--ecc-surface);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius-sm);
  padding: 8px;
  text-align: center;
  transition: border-color var(--ecc-anim), background var(--ecc-anim);
}
.ecc-stat-card:hover { border-color: var(--ecc-border-accent); background: var(--ecc-surface-hover); }
.ecc-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ecc-accent);
  line-height: 1.1;
}
.ecc-stat-value.warn { color: var(--ecc-warn); }
.ecc-stat-value.danger { color: var(--ecc-danger); }
.ecc-stat-value.success { color: var(--ecc-success); }
.ecc-stat-label {
  font-size: 10px;
  color: var(--ecc-text-muted);
  margin-top: 2px;
}

/* Topic chips */
.ecc-topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ecc-topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  font-size: 11px;
  color: var(--ecc-text-muted);
  cursor: pointer;
  transition: all var(--ecc-anim);
}
.ecc-topic-chip:hover { border-color: var(--ecc-border-accent); color: var(--ecc-text); }
.ecc-topic-chip--active {
  border-color: var(--ecc-accent);
  background: rgba(99,176,255,.15);
  color: var(--ecc-accent);
  font-weight: 600;
}
.ecc-topic-chip-count {
  font-size: 10px;
  opacity: .7;
}

/* Filters */
.ecc-filter-group { margin-bottom: 10px; }
.ecc-filter-group:last-child { margin-bottom: 0; }

.ecc-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ecc-text-muted);
  margin-bottom: 5px;
  cursor: pointer;
}

.ecc-dual-range { position: relative; height: 20px; }
.ecc-range {
  width: 100%;
  height: 4px;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
}
.ecc-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ecc-accent);
  border: 2px solid #0a0e1c;
  cursor: ew-resize;
  box-shadow: 0 0 0 2px rgba(99,176,255,.3);
}
.ecc-range::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ecc-accent);
  border: 2px solid #0a0e1c;
  cursor: ew-resize;
}
.ecc-range-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  width: 100%;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  pointer-events: none;
}
.ecc-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ecc-text-muted);
  margin-top: 4px;
}

.ecc-checkbox { accent-color: var(--ecc-accent); cursor: pointer; }

.ecc-level-pills { display: flex; gap: 4px; }
.ecc-level-pill {
  flex: 1;
  padding: 4px 0;
  border-radius: 4px;
  border: 1px solid var(--ecc-border);
  background: var(--ecc-surface);
  color: var(--ecc-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--ecc-anim);
  text-align: center;
}
.ecc-level-pill:hover { border-color: var(--ecc-border-accent); color: var(--ecc-text); }
.ecc-level-pill--active {
  background: rgba(99,176,255,.18);
  border-color: var(--ecc-accent);
  color: var(--ecc-accent);
  font-weight: 600;
}

.ecc-select {
  width: 100%;
  background: var(--ecc-surface);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius-sm);
  color: var(--ecc-text);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--ecc-anim);
}
.ecc-select:focus { border-color: var(--ecc-accent); }

/* Nav tree */
.ecc-sidebar-tree-section { flex: 1; }
.ecc-nav-tree { font-size: 11.5px; }

.ecc-nav-node {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px;
  border-radius: 5px;
  cursor: pointer;
  transition: background var(--ecc-anim);
  color: var(--ecc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ecc-nav-node:hover { background: var(--ecc-surface-hover); color: var(--ecc-text); }
.ecc-nav-node--active { background: var(--ecc-surface-active); color: var(--ecc-accent); font-weight: 600; }
.ecc-nav-node--has-children > .ecc-nav-toggle { cursor: pointer; }
.ecc-nav-toggle { font-size: 9px; flex-shrink: 0; transition: transform var(--ecc-anim); }
.ecc-nav-toggle--open { transform: rotate(90deg); }
.ecc-nav-children { padding-left: 12px; }

/* ── MAIN VIEW ──────────────────────────────────────────────── */
.ecc-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ecc-view {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── TILES VIEW ─────────────────────────────────────────────── */
.ecc-tiles-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
  align-content: start;
}

/* SVG tile ring styles (legacy - replaced by CSS ring) */
.ecc-tile-ring { display: none; }

/* CSS conic-gradient ring */
.ecc-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--clr, #63b0ff) var(--pct, 0deg), rgba(255,255,255,0.08) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--ecc-anim-slow);
}
.ecc-ring-inner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ecc-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--clr, #63b0ff);
  line-height: 1;
}

/* Tile card */
.ecc-tile {
  position: relative;
  background: var(--ecc-surface);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius);
  padding: 14px 12px 12px;
  cursor: pointer;
  transition:
    border-color var(--ecc-anim),
    background var(--ecc-anim),
    transform var(--ecc-anim),
    box-shadow var(--ecc-anim);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  animation: ecc-tile-in var(--ecc-anim-slow) both;
  overflow: hidden;
}

@keyframes ecc-tile-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.ecc-tile:hover {
  border-color: var(--ecc-border-accent);
  background: var(--ecc-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.ecc-tile--selected {
  border-color: var(--ecc-accent) !important;
  background: var(--ecc-surface-active) !important;
  box-shadow: 0 0 0 2px rgba(99,176,255,.18) !important;
}

.ecc-tile--attention {
  border-color: rgba(251,191,36,.35) !important;
}
.ecc-tile--attention::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--ecc-warn), transparent);
  border-radius: var(--ecc-radius) var(--ecc-radius) 0 0;
}

/* Tile top row */
.ecc-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.ecc-tile-select {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent;
  cursor: pointer;
  transition: all var(--ecc-anim);
  appearance: none;
  flex-shrink: 0;
}
.ecc-tile-select:checked {
  background: var(--ecc-accent);
  border-color: var(--ecc-accent);
}

/* SVG completion ring */
.ecc-tile-ring-wrap {
  flex-shrink: 0;
}

.ecc-tile-ring {
  display: block;
}

.ecc-tile-ring-track {
  fill: none;
  stroke: rgba(255,255,255,.08);
  stroke-width: 3;
}

.ecc-tile-ring-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset var(--ecc-anim-slow);
}

/* Tile info */
.ecc-tile-info { flex: 1; min-width: 0; }

.ecc-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ecc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.ecc-tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ecc-text-muted);
}

.ecc-tile-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  font-size: 9px;
  font-weight: 700;
  color: var(--ecc-text-muted);
}

/* Importance bar */
.ecc-tile-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ecc-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ecc-bar-label {
  font-size: 9px;
  color: var(--ecc-text-faint);
  width: 10px;
  text-align: center;
}
.ecc-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
}
.ecc-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width var(--ecc-anim-slow);
}
.ecc-bar-fill--imp { background: linear-gradient(90deg, var(--ecc-accent), var(--ecc-accent-2)); }
.ecc-bar-fill--conf { background: linear-gradient(90deg, #4ade80, #22d3ee); }
.ecc-bar-val {
  font-size: 9px;
  color: var(--ecc-text-muted);
  width: 22px;
  text-align: right;
}

/* Tile topic pill */
.ecc-tile-topic {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  margin-top: 2px;
  background: rgba(99,176,255,.1);
  color: var(--ecc-accent);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── TABLE VIEW ──────────────────────────────────────────────── */
.ecc-table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ecc-border);
  flex-shrink: 0;
}

.ecc-table-wrap {
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.ecc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ecc-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(10,14,28,.97);
}

.ecc-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ecc-text-muted);
  border-bottom: 1px solid var(--ecc-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--ecc-anim);
}
.ecc-table th:hover { color: var(--ecc-accent); }
.ecc-table th[data-sort-active] { color: var(--ecc-accent); background: rgba(99,176,255,.06); }
.ecc-table th .sort-icon { margin-left: 4px; font-size: 9px; opacity: .5; }
.ecc-table th[data-sort-active] .sort-icon { opacity: 1; font-size: 11px; font-weight: bold; }

.ecc-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background var(--ecc-anim);
  cursor: pointer;
  animation: ecc-row-in var(--ecc-anim-slow) both;
}
@keyframes ecc-row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

.ecc-table tbody tr:hover { background: var(--ecc-surface-hover); }
.ecc-table tbody tr.ecc-row--selected { background: var(--ecc-surface-active); }

.ecc-table td {
  padding: 7px 12px;
  color: var(--ecc-text);
  vertical-align: middle;
}

.ecc-td-name { font-weight: 500; }
.ecc-td-bar {
  width: 80px;
  min-width: 80px;
}
.ecc-td-bar .ecc-bar-track { height: 5px; }
.ecc-td-level {
  width: 50px;
  text-align: center;
  color: var(--ecc-text-muted);
}
.ecc-td-actions {
  width: 60px;
  text-align: right;
  white-space: nowrap;
}
.ecc-td-action-btn {
  background: none;
  border: none;
  color: var(--ecc-text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color var(--ecc-anim), background var(--ecc-anim);
}
.ecc-td-action-btn:hover { color: var(--ecc-accent); background: rgba(99,176,255,.1); }

/* ── TREE VIEW ──────────────────────────────────────────────── */
.ecc-tree-container {
  flex: 1;
  overflow: auto;
  padding: 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.ecc-tree-node-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--ecc-anim);
  animation: ecc-tile-in var(--ecc-anim-slow) both;
}
.ecc-tree-node-row:hover { background: var(--ecc-surface-hover); }
.ecc-tree-node-row.ecc-tree-node--active {
  background: var(--ecc-surface-active);
  color: var(--ecc-accent);
}

.ecc-tree-toggle { font-size: 10px; color: var(--ecc-text-muted); transition: transform var(--ecc-anim); cursor: pointer; width: 14px; text-align: center; flex-shrink: 0; }
.ecc-tree-toggle--open { transform: rotate(90deg); }
.ecc-tree-spacer { width: 14px; flex-shrink: 0; }

.ecc-tree-node-name { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecc-tree-node-imp { font-size: 11px; color: var(--ecc-text-muted); width: 28px; text-align: right; }
.ecc-tree-children { padding-left: 16px; }

/* ── 3D VIEW ─────────────────────────────────────────────────── */
.ecc-3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.ecc-3d-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--ecc-text-muted);
  font-size: 13px;
  pointer-events: none;
}

/* ── SLIDE-IN EDIT PANEL ────────────────────────────────────── */
.ecc-edit-panel {
  width: var(--ecc-edit-panel-w);
  flex-shrink: 0;
  border-left: 1px solid var(--ecc-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255,255,255,.018);
  transform: translateX(100%);
  transition: transform var(--ecc-anim-slow), opacity var(--ecc-anim-slow);
  opacity: 0;
  pointer-events: none;
}

.ecc-edit-panel:not([hidden]) {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.ecc-edit-panel-inner {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

/* Edit header */
.ecc-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--ecc-border);
  flex-shrink: 0;
}

.ecc-edit-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ecc-edit-entity-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
  padding: 3px;
}

.ecc-tile-entity-icon {
  width: 20px; height: 20px;
  border-radius: 4px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 5px;
  flex-shrink: 0;
  background: rgba(255,255,255,.05);
  padding: 1px;
}

#ecc-field-userdata {
  min-height: 140px;
  resize: vertical;
}

.ecc-edit-entity-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ecc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecc-edit-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.ecc-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid var(--ecc-border);
  background: var(--ecc-surface);
  color: var(--ecc-text);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--ecc-anim);
}
.ecc-edit-btn:hover { background: var(--ecc-surface-hover); }
.ecc-edit-btn--primary {
  flex: 1;
  height: 34px;
  background: linear-gradient(135deg, var(--ecc-accent), var(--ecc-accent-2));
  border-color: transparent;
  color: #0a0e1c;
  font-weight: 700;
  font-size: 13px;
}
.ecc-edit-btn--primary:hover { opacity: .9; }
.ecc-edit-btn--danger { color: var(--ecc-danger); border-color: rgba(248,113,113,.25); }
.ecc-edit-btn--danger:hover { background: rgba(248,113,113,.15); }

/* Completion bar */
.ecc-completion-bar {
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--ecc-border);
  flex-shrink: 0;
}
.ecc-completion-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ecc-text-muted);
  margin-bottom: 5px;
}
.ecc-completion-track {
  height: 5px;
  background: rgba(255,255,255,.07);
  border-radius: 3px;
  overflow: hidden;
}
.ecc-completion-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ecc-accent), var(--ecc-accent-2));
  transition: width var(--ecc-anim-slow);
}

/* Edit tabs */
.ecc-edit-tabs {
  display: flex;
  border-bottom: 1px solid var(--ecc-border);
  flex-shrink: 0;
}

.ecc-edit-tab {
  flex: 1;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--ecc-text-muted);
  font-size: 11.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--ecc-anim), border-color var(--ecc-anim);
  font-weight: 500;
}
.ecc-edit-tab:hover { color: var(--ecc-text); }
.ecc-edit-tab--active { color: var(--ecc-accent); border-bottom-color: var(--ecc-accent); font-weight: 600; }

/* Tab contents */
.ecc-edit-tab-content {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ecc-field-group { display: flex; flex-direction: column; gap: 5px; }

.ecc-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ecc-text-muted);
  font-weight: 500;
}

.ecc-field-value-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--ecc-accent);
}

.ecc-field-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius-sm);
  color: var(--ecc-text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--ecc-anim), box-shadow var(--ecc-anim);
  box-sizing: border-box;
}
.ecc-field-input:focus {
  border-color: var(--ecc-accent);
  box-shadow: 0 0 0 2px rgba(99,176,255,.15);
}

.ecc-field-textarea {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius-sm);
  color: var(--ecc-text);
  font-size: 12.5px;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color var(--ecc-anim), box-shadow var(--ecc-anim);
  box-sizing: border-box;
  font-family: inherit;
}
.ecc-field-textarea:focus {
  border-color: var(--ecc-accent);
  box-shadow: 0 0 0 2px rgba(99,176,255,.15);
}
.ecc-field-textarea::placeholder { color: var(--ecc-text-muted); }

.ecc-field-range {
  width: 100%;
  height: 4px;
  appearance: none;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  accent-color: var(--ecc-accent);
}
.ecc-field-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ecc-accent);
  border: 2px solid #0a0e1c;
  box-shadow: 0 0 0 2px rgba(99,176,255,.25);
}
.ecc-field-range::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ecc-accent);
  border: 2px solid #0a0e1c;
}

/* Entity meta */
.ecc-entity-meta {
  background: var(--ecc-surface);
  border-radius: var(--ecc-radius-sm);
  padding: 8px;
  font-size: 11px;
  color: var(--ecc-text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ecc-meta-row { display: flex; justify-content: space-between; }
.ecc-meta-val { color: var(--ecc-text); font-weight: 500; }

/* Connection list */
.ecc-connection-list { display: flex; flex-direction: column; gap: 6px; }
.ecc-conn-parent { border-left: 3px solid var(--ecc-accent) !important; margin-bottom: 8px !important; }
.ecc-edit-btn--graph { background: transparent; border: 1px solid var(--ecc-border); color: var(--ecc-text-muted); font-size: 13px; border-radius: 4px; padding: 2px 6px; cursor: pointer; transition: border-color var(--ecc-anim), color var(--ecc-anim); }
.ecc-edit-btn--graph:hover { border-color: var(--ecc-accent); color: var(--ecc-accent); }

.ecc-connection-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--ecc-surface);
  border: 1px solid var(--ecc-border);
  border-radius: var(--ecc-radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--ecc-anim);
}
.ecc-connection-item:hover { border-color: var(--ecc-border-accent); background: var(--ecc-surface-hover); }
.ecc-connection-arrow { color: var(--ecc-text-muted); font-size: 10px; }

/* Edit actions */
.ecc-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--ecc-border);
  flex-shrink: 0;
}

.ecc-save-status {
  font-size: 11px;
  color: var(--ecc-success);
  transition: opacity var(--ecc-anim);
}

/* ── STATUSBAR ───────────────────────────────────────────────── */
.ecc-statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--ecc-statusbar-h);
  padding: 0 12px;
  background: rgba(255,255,255,.018);
  border-top: 1px solid var(--ecc-border);
  flex-shrink: 0;
  font-size: 11px;
  color: var(--ecc-text-muted);
}

.ecc-statusbar-sep { opacity: .3; }
.ecc-statusbar-spacer { flex: 1; }

/* Autosave */
.ecc-autosave {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ecc-accent);
}
.ecc-autosave-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ecc-accent);
  animation: ecc-blink .9s ease-in-out infinite;
}
@keyframes ecc-blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .2; }
}

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.ecc-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ecc-text-muted);
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.ecc-empty-icon { font-size: 40px; opacity: .3; }
.ecc-empty-title { font-size: 15px; font-weight: 600; color: var(--ecc-text); }
.ecc-empty-sub { font-size: 12px; }

/* ── SKELETON LOADING ────────────────────────────────────────── */
.ecc-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: ecc-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes ecc-skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── HIGHLIGHT from search ───────────────────────────────────── */
.ecc-highlight {
  background: rgba(251,191,36,.35);
  color: var(--ecc-text);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ecc-window {
    left: 2%;
    width: 96%;
    top: 50px;
    height: calc(100vh - 60px);
  }
  .ecc-sidebar {
    position: absolute;
    height: 100%;
    z-index: 10;
    top: 0;
    left: 0;
    background: rgba(10,14,28,.97);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  .ecc-view-btn span:last-child { display: none; }
  .ecc-action-btn span:last-child { display: none; }
  .ecc-edit-panel { width: min(var(--ecc-edit-panel-w), 85vw); }
}

/* ─── SYSTEM ENTITIES ─────────────────────────────────────────────── */
.ecc-sys-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ecc-accent, #63b0ff);
  margin-right: 4px;
  opacity: .8;
  vertical-align: middle;
}

.ecc-tile--system {
  border-color: rgba(99,176,255,.3);
  background: linear-gradient(135deg, rgba(99,176,255,.06) 0%, var(--ecc-bg, #0d111e) 100%);
}

.ecc-tile--system::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #63b0ff 0%, transparent 100%);
  border-radius: 8px 8px 0 0;
}

/* System notice in edit panel */
.ecc-system-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 0 12px 8px;
  background: rgba(99,176,255,.1);
  border: 1px solid rgba(99,176,255,.25);
  border-radius: 6px;
  font-size: 11px;
  color: #63b0ff;
}

/* Locked name field */
.ecc-field-readonly {
  opacity: .6;
  cursor: not-allowed;
  background: rgba(255,255,255,.03) !important;
}

.ecc-panel--system .ecc-edit-entity-name::after {
  content: ' ⚙';
  font-size: 12px;
  color: #63b0ff;
  opacity: .7;
}

/* System entity table row */
.ecc-row--system td:first-child {
  color: var(--ecc-accent, #63b0ff);
}

/* ─── INLINE CREATE STRIP ─────────────────────────────────────────── */
.ecc-create-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(99,176,255,.07);
  border-bottom: 1px solid rgba(99,176,255,.2);
  animation: ecc-slide-down .15s ease;
}

@keyframes ecc-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);      opacity: 1; }
}

.ecc-create-icon {
  font-size: 18px;
  color: var(--ecc-accent, #63b0ff);
  line-height: 1;
}

.ecc-create-name-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--ecc-text, #e8eaf6);
  font-size: 13px;
  outline: none;
}
.ecc-create-name-input:focus {
  border-color: var(--ecc-accent, #63b0ff);
  background: rgba(99,176,255,.07);
}

/* ─── DIRTY INDICATOR ─────────────────────────────────────────────── */
.ecc-dirty-dot {
  color: #f59e0b;
  font-size: 10px;
  margin-right: 4px;
  vertical-align: middle;
  animation: ecc-pulse 1.5s ease-in-out infinite;
}

@keyframes ecc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}



