/* ═══════════════════════════════════════════════════════════════
   AIN Tracing — Cyberpunk APM
   ═══════════════════════════════════════════════════════════════
   تصميم mate cyan/purple مع neon glow على نمط theme-neon.css.
   كل الـ animations عبر transform/opacity لتجنّب layout reflow.
   ═══════════════════════════════════════════════════════════════ */

/* ─── KPI Strip ────────────────────────────────────── */
.trc-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.trc-kpi {
  background: linear-gradient(135deg, rgba(15,23,42,0.85), rgba(10,15,28,0.85));
  border: 1px solid rgba(6,182,212,0.18);
  border-radius: 4px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: all .2s ease;
}
.trc-kpi::before {
  content:'';
  position:absolute;
  top:0; right:0; left:0;
  height:2px;
  background: linear-gradient(90deg, transparent, var(--trc-kpi-c, #06B6D4), transparent);
  opacity:.7;
}
.trc-kpi::after {
  content:'';
  position:absolute;
  inset:-1px;
  border-radius:4px;
  padding:1px;
  background: linear-gradient(135deg, var(--trc-kpi-c,#06B6D4)40, transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events:none;
  opacity:.5;
}
.trc-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(6,182,212,0.12);
}
.trc-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 8px;
}
.trc-kpi-value {
  font-size: 26px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--trc-kpi-c, #06B6D4);
  text-shadow: 0 0 18px var(--trc-kpi-glow, rgba(6,182,212,0.5));
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.trc-kpi-unit {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  text-shadow: none;
}
.trc-kpi-sub {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.trc-kpi-spark {
  margin-left: auto;
  display: inline-block;
}
/* KPI color variants */
.trc-kpi.cy  { --trc-kpi-c:#06B6D4; --trc-kpi-glow: rgba(6,182,212,.5); }
.trc-kpi.gn  { --trc-kpi-c:#22C55E; --trc-kpi-glow: rgba(34,197,94,.5); }
.trc-kpi.am  { --trc-kpi-c:#F59E0B; --trc-kpi-glow: rgba(245,158,11,.5); }
.trc-kpi.rd  { --trc-kpi-c:#EF4444; --trc-kpi-glow: rgba(239,68,68,.5); }
.trc-kpi.pp  { --trc-kpi-c:#A855F7; --trc-kpi-glow: rgba(168,85,247,.5); }
.trc-kpi.bl  { --trc-kpi-c:#3B82F6; --trc-kpi-glow: rgba(59,130,246,.5); }

/* ─── App Cards Grid ──────────────────────────────── */
.trc-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.trc-app {
  background: linear-gradient(160deg, rgba(15,23,42,0.9), rgba(10,15,28,0.95));
  border: 1px solid rgba(6,182,212,0.16);
  border-radius: 6px;
  padding: 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all .25s ease;
}
.trc-app::before {
  content:'';
  position:absolute;
  top:0; left:0; right:0;
  height:3px;
  background: linear-gradient(90deg, transparent, var(--app-c, #06B6D4), transparent);
  opacity:.6;
  transition: opacity .2s;
}
.trc-app::after {
  content:'';
  position:absolute;
  inset:0;
  background: radial-gradient(circle at 80% 20%, var(--app-c,#06B6D4)15, transparent 50%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events:none;
}
.trc-app:hover {
  transform: translateY(-3px);
  border-color: var(--app-c, #06B6D4);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 24px var(--app-c, #06B6D4)25;
}
.trc-app:hover::after { opacity: 1; }
.trc-app:hover::before { opacity:1; }
.trc-app.health-ok   { --app-c: #22C55E; }
.trc-app.health-warn { --app-c: #F59E0B; }
.trc-app.health-err  { --app-c: #EF4444; }
.trc-app.health-err::before { animation: trc-pulse-line 1.5s ease-in-out infinite; }
@keyframes trc-pulse-line { 50% { opacity: 0.2; } }

.trc-app-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.trc-app-name {
  font-size: 16px;
  font-weight: 700;
  color: #e8e8e8;
  margin-bottom: 4px;
  letter-spacing: .3px;
}
.trc-app-meta {
  font-size: 11px;
  color: #64748b;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Health ring */
.trc-ring {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.trc-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
}
.trc-ring-val { font-size: 22px; font-weight: 800; line-height: 1; }
.trc-ring-sub { font-size: 9px; color: #475569; margin-top: 2px; }

.trc-app-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.trc-app-stat {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 3px;
  padding: 8px 10px;
}
.trc-app-stat-l {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  font-weight: 600;
}
.trc-app-stat-v {
  font-size: 17px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #e8e8e8;
  margin-top: 2px;
}
.trc-app-stat-v.cg { color: #22C55E; }
.trc-app-stat-v.cr { color: #EF4444; }
.trc-app-stat-v.ca { color: #F59E0B; }
.trc-app-stat-v.cp { color: #A855F7; }

.trc-app-spark {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #64748b;
}

.trc-app-enter {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(6,182,212,0.06);
  border: 1px dashed rgba(6,182,212,0.2);
  border-radius: 3px;
  color: #06B6D4;
  font-size: 11px;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all .2s;
}
.trc-app:hover .trc-app-enter {
  background: rgba(6,182,212,0.12);
  border-color: rgba(6,182,212,0.5);
}

/* ─── Language Badge ─────────────────────────────── */
.trc-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid;
  letter-spacing: .3px;
}
.trc-lang-icon { font-size: 12px; line-height: 1; }
.trc-lang-name { letter-spacing: .5px; }

/* ─── Status Pills ───────────────────────────────── */
.trc-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  font-family: 'JetBrains Mono', monospace;
}
.trc-pill.ok   { background: rgba(34,197,94,.15);  color: #22C55E; border: 1px solid rgba(34,197,94,.3); }
.trc-pill.warn { background: rgba(245,158,11,.15); color: #F59E0B; border: 1px solid rgba(245,158,11,.3); }
.trc-pill.err  { background: rgba(239,68,68,.15);  color: #EF4444; border: 1px solid rgba(239,68,68,.3); }
.trc-pill.info { background: rgba(6,182,212,.15);  color: #06B6D4; border: 1px solid rgba(6,182,212,.3); }
.trc-pill.pp   { background: rgba(168,85,247,.15); color: #A855F7; border: 1px solid rgba(168,85,247,.3); }

/* ─── Breadcrumb / Header ─────────────────────────── */
.trc-bread {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(6,182,212,0.1);
  border-radius: 3px;
  font-size: 12px;
}
.trc-bread a {
  color: #06B6D4;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
}
.trc-bread a:hover { color: #67e8f9; text-shadow: 0 0 8px rgba(6,182,212,.5); }
.trc-bread .trc-sep { color: #475569; }
.trc-bread .trc-cur { color: #e8e8e8; font-weight: 600; }

.trc-header {
  background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(10,15,28,0.9));
  border: 1px solid rgba(6,182,212,0.18);
  border-radius: 4px;
  padding: 18px 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.trc-header-title {
  font-size: 22px;
  font-weight: 800;
  color: #e8e8e8;
  letter-spacing: .5px;
}
.trc-header-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Cards / Sections ────────────────────────────── */
.trc-card {
  background: rgba(15,23,42,0.65);
  border: 1px solid rgba(6,182,212,0.12);
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}
.trc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(6,182,212,0.08);
  background: rgba(6,182,212,0.03);
}
.trc-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #06B6D4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.trc-card-title::before {
  content:'';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: #06B6D4;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(6,182,212,.6);
}
.trc-card-body { padding: 14px 16px; }

.trc-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .trc-2col { grid-template-columns: 1fr; }
}

/* ─── Table ─────────────────────────────────────── */
.trc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.trc-table th {
  text-align: start;
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #64748b;
  font-weight: 600;
  border-bottom: 1px solid rgba(6,182,212,0.1);
  background: rgba(6,182,212,0.03);
}
.trc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.trc-table tr.trc-row { cursor: pointer; transition: all .12s; }
.trc-table tr.trc-row:hover {
  background: rgba(6,182,212,0.05);
  box-shadow: inset 3px 0 0 #06B6D4;
}
.trc-mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.trc-dim { color: #64748b; }

/* Method badge in tables */
.trc-method {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  background: rgba(6,182,212,0.1);
  color: #06B6D4;
  border: 1px solid rgba(6,182,212,0.25);
}
.trc-method.POST { color:#F59E0B; background:rgba(245,158,11,.1); border-color:rgba(245,158,11,.25); }
.trc-method.PUT  { color:#A855F7; background:rgba(168,85,247,.1); border-color:rgba(168,85,247,.25); }
.trc-method.DELETE { color:#EF4444; background:rgba(239,68,68,.1); border-color:rgba(239,68,68,.25); }

/* Progress bar in tables (for slowest routes) */
.trc-bar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
}
.trc-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #06B6D4, #A855F7);
  box-shadow: 0 0 8px rgba(6,182,212,.4);
  border-radius: 2px;
  transition: width .4s ease;
}

/* ─── Empty / Loading ─────────────────────────────── */
.trc-empty {
  text-align: center;
  padding: 70px 20px;
  color: #64748b;
}
.trc-empty-icon {
  font-size: 56px;
  opacity: .25;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(6,182,212,.4));
}
.trc-empty-title { font-size: 14px; color: #94a3b8; margin-bottom: 6px; font-weight: 600; }
.trc-empty-sub { font-size: 11px; color: #475569; }

.trc-skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: trc-shimmer 1.4s linear infinite;
  border-radius: 2px;
}
@keyframes trc-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─── Topology Container ──────────────────────────── */
.trc-topo {
  height: 380px;
  background: radial-gradient(ellipse at center, rgba(6,182,212,0.04), transparent 70%), #050a14;
  border: 1px solid rgba(6,182,212,0.15);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.trc-topo::before {
  content:'';
  position: absolute;
  inset:0;
  background-image:
    linear-gradient(rgba(6,182,212,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events:none;
}
.trc-topo-canvas {
  width: 100%;
  height: 100%;
  position: relative;
}
.trc-topo-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 14px;
  padding: 8px 12px;
  background: rgba(10,15,28,0.85);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: 3px;
  font-size: 10px;
  color: #94a3b8;
  z-index: 10;
}
[dir="rtl"] .trc-topo-legend { left: auto; right: 10px; }
.trc-topo-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.trc-topo-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* ─── Waterfall ──────────────────────────────────── */
.trc-wf {
  display: flex;
  flex-direction: column;
}
.trc-wf-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background .12s;
}
.trc-wf-row:hover { background: rgba(6,182,212,0.04); }
.trc-wf-row.active {
  background: rgba(6,182,212,0.08);
  box-shadow: inset 3px 0 0 #06B6D4;
}
.trc-wf-name {
  width: 290px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.trc-wf-name-icon {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.trc-wf-name-text {
  min-width: 0;
  overflow: hidden;
}
.trc-wf-name-title {
  font-size: 12px;
  color: #e8e8e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trc-wf-name-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trc-wf-track {
  flex: 1;
  height: 22px;
  background: rgba(255,255,255,0.03);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  min-width: 100px;
}
.trc-wf-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  white-space: nowrap;
  font-weight: 600;
  box-shadow: 0 0 10px currentColor;
}
.trc-wf-ms {
  width: 70px;
  text-align: end;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}

/* ─── Span Detail Drawer ─────────────────────────── */
.trc-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.trc-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.trc-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 520px;
  max-width: 92vw;
  background: linear-gradient(180deg, #0a0f1c, #050a14);
  border-inline-start: 1px solid rgba(6,182,212,0.3);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5), -2px 0 18px rgba(6,182,212,.18);
  z-index: 100;
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
}
/* LTR/RTL aware */
html[dir="ltr"] .trc-drawer { right: 0; transform: translateX(110%); }
html[dir="ltr"] .trc-drawer.open { transform: translateX(0); }
html[dir="rtl"] .trc-drawer { left: 0; transform: translateX(-110%); }
html[dir="rtl"] .trc-drawer.open { transform: translateX(0); }

.trc-drawer-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(6,182,212,0.15);
  background: rgba(6,182,212,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.trc-drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: #e8e8e8;
}
.trc-drawer-close {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}
.trc-drawer-close:hover { color: #EF4444; border-color: rgba(239,68,68,0.4); }
.trc-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.trc-drawer-section {
  margin-bottom: 18px;
}
.trc-drawer-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #06B6D4;
  font-weight: 700;
  margin-bottom: 8px;
}
.trc-kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 12px;
  font-size: 11px;
}
.trc-kv dt {
  color: #64748b;
  font-weight: 500;
  padding: 4px 0;
}
.trc-kv dd {
  color: #e8e8e8;
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
  padding: 4px 0;
}

.trc-sql-box {
  background: rgba(168,85,247,0.05);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: #e8e8e8;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.trc-sql-box .sql-kw  { color: #A855F7; font-weight: 700; }
.trc-sql-box .sql-str { color: #22C55E; }
.trc-sql-box .sql-num { color: #F59E0B; }
.trc-copy {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.3);
  color: #06B6D4;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .15s;
}
.trc-copy:hover { background: rgba(6,182,212,0.2); }

/* ─── Search input ───────────────────────────────── */
.trc-search {
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(6,182,212,0.18);
  color: #e8e8e8;
  border-radius: 3px;
  padding: 7px 12px;
  font-size: 12px;
  width: 260px;
  outline: none;
  transition: all .15s;
}
.trc-search:focus {
  border-color: #06B6D4;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
.trc-search::placeholder { color: #475569; }

/* ─── Distribution bars chart ─────────────────────── */
.trc-dist {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 10px 0;
}
.trc-dist-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trc-dist-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--bar-c, #06B6D4), var(--bar-c, #06B6D4)80);
  border-radius: 2px 2px 0 0;
  position: relative;
  min-height: 2px;
  box-shadow: 0 0 12px var(--bar-c, #06B6D4)50;
  transition: all .3s ease;
}
.trc-dist-bar:hover { filter: brightness(1.3); }
.trc-dist-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #e8e8e8;
  font-weight: 700;
}
.trc-dist-lbl {
  font-size: 10px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Toolbar above tables ─────────────────────────── */
.trc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(6,182,212,0.04);
  border-bottom: 1px solid rgba(6,182,212,0.08);
}
.trc-toolbar-l, .trc-toolbar-r { display: flex; align-items: center; gap: 8px; }

/* ─── Service icon big ──────────────────────────────── */
.trc-service-icon {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(168,85,247,0.1));
  border: 1px solid rgba(6,182,212,0.3);
  color: #06B6D4;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(6,182,212,.25);
  position: relative;
}
.trc-service-icon::after {
  content:'';
  position: absolute;
  inset: -2px;
  border-radius: 9px;
  background: linear-gradient(135deg, #06B6D4, #A855F7);
  z-index: -1;
  opacity: 0.6;
  filter: blur(8px);
}

/* ─── Refresh badge ───────────────────────────────── */
.trc-refresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #64748b;
}
.trc-refresh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: trc-pulse 2s ease-in-out infinite;
}
@keyframes trc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Range selector ──────────────────────────────── */
.trc-range {
  display: inline-flex;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(6,182,212,0.15);
  border-radius: 3px;
  padding: 2px;
  gap: 2px;
}
.trc-range button {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  transition: all .12s;
}
.trc-range button:hover { color: #94a3b8; }
.trc-range button.active {
  background: rgba(6,182,212,0.15);
  color: #06B6D4;
  box-shadow: 0 0 8px rgba(6,182,212,.25);
}

/* ─── Distribution legend (تحت رسم Chart.js) ──────── */
.trc-dist-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(6,182,212,0.08);
}
.trc-dist-leg-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #94a3b8;
}
.trc-dist-leg-item b {
  color: #e8e8e8;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.trc-dist-leg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

/* ─── Filters row (chips) ─────────────────────────── */
.trc-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(6,182,212,0.02);
  border-bottom: 1px solid rgba(6,182,212,0.06);
}
.trc-filter-grp {
  display: flex;
  align-items: center;
  gap: 5px;
}
.trc-filter-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  font-weight: 700;
  margin-inline-end: 3px;
}
.trc-filter-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
}
.trc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8;
  padding: 4px 11px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.trc-chip:hover {
  border-color: rgba(6,182,212,0.4);
  color: #e8e8e8;
}
.trc-chip.active {
  background: rgba(6,182,212,0.15);
  border-color: #06B6D4;
  color: #06B6D4;
  box-shadow: 0 0 10px rgba(6,182,212,0.2);
}
.trc-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 5px currentColor;
}
.trc-chip-bucket {
  background: rgba(6,182,212,0.15);
  border-color: #06B6D4;
  color: #06B6D4;
}
.trc-chip-clear {
  border-color: rgba(239,68,68,0.25);
  color: #EF4444;
  background: rgba(239,68,68,0.06);
}
.trc-chip-clear:hover {
  border-color: #EF4444;
  background: rgba(239,68,68,0.12);
  color: #EF4444;
}