/* Marketing > Traffic (Testing) -- adjusted-traffic view.
   Provisional / not-approved styling is deliberate: the amber banner and the
   "modeled" chips must stay loud until Marketing signs the metric off. */

.tr-empty { padding: 28px; color: var(--muted, #6B7280); font-size: 14px; }

/* --- Provisional banner ------------------------------------------------ */
.tr-banner {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-left: 5px solid #B45309;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #7C2D12;
}
.tr-banner .tr-banner-title {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #92400E;
  margin-bottom: 6px;
}
.tr-banner p { margin: 0 0 6px; }
.tr-banner p:last-child { margin-bottom: 0; }
.tr-banner b { color: #7C2D12; }

/* --- Sub-tab segmented control ----------------------------------------- */
.tr-subtabs {
  display: flex; gap: 4px; background: #EEF1F5; border: 1px solid var(--line, #E5E7EB);
  border-radius: 12px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap;
}
.tr-subtab {
  flex: 1 1 0; min-width: 180px; text-align: left; cursor: pointer;
  border: 1px solid transparent; background: transparent; border-radius: 9px;
  padding: 9px 14px; display: flex; flex-direction: column; gap: 2px;
}
.tr-subtab:hover { background: #FFFFFF; }
.tr-subtab.on { background: #FFFFFF; border-color: #4472C4; box-shadow: 0 1px 3px rgba(31,58,95,.08); }
.tr-subtab .tr-subtab-label { font-size: 14px; font-weight: 700; color: #1F3A5F; }
.tr-subtab .tr-subtab-note { font-size: 11px; color: var(--muted, #6B7280); }
.tr-subtab.on .tr-subtab-note { color: #4472C4; }

/* --- Fidelity / framing notes ------------------------------------------ */
.tr-fidnote {
  background: #EEF3FA; border: 1px solid #C7D3E3; border-left: 4px solid #4472C4;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.55; color: #1F3A5F;
}
.tr-fidnote-integrity { background: #FCE9D3; border-color: #F0C48A; border-left-color: #B45309; color: #7C2D12; }

/* --- Controls ---------------------------------------------------------- */
.tr-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line, #E5E7EB); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px;
}
.tr-cgroup { display: flex; align-items: center; gap: 7px; }
.tr-clabel {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted, #6B7280);
}
.tr-select, .tr-controls input[type="date"] {
  font-size: 13px; font-family: inherit; font-weight: 600; color: #1F3A5F;
  background: #F5F6F8; border: 1px solid var(--line, #E5E7EB);
  border-radius: 8px; padding: 7px 10px; cursor: pointer;
}
.tr-select.tr-scope { min-width: 240px; }
.tr-pills {
  display: flex; gap: 3px; background: #F5F6F8;
  border: 1px solid var(--line, #E5E7EB); border-radius: 8px; padding: 3px;
}
.tr-pill {
  border: none; background: transparent; padding: 6px 13px; font-size: 12.5px;
  font-weight: 600; color: var(--muted, #6B7280); border-radius: 6px; cursor: pointer;
}
.tr-pill.on { background: #1F3A5F; color: #fff; }
.tr-btn {
  border: 1px solid var(--line, #E5E7EB); background: #fff; border-radius: 8px;
  padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: #1F3A5F; cursor: pointer;
}
.tr-btn:hover { border-color: #4472C4; }
.tr-fixed {
  font-size: 13px; font-weight: 700; color: #7C2D12; background: #FDE68A;
  border: 1px solid #F59E0B; border-radius: 8px; padding: 6px 10px;
}

/* --- KPI row ----------------------------------------------------------- */
.tr-kpis {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px;
}
.tr-kpis.tr-kpis-4 { grid-template-columns: repeat(4, 1fr); }
.tr-kpis.tr-kpis-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1200px) { .tr-kpis, .tr-kpis.tr-kpis-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .tr-kpis, .tr-kpis.tr-kpis-4, .tr-kpis.tr-kpis-3 { grid-template-columns: repeat(2, 1fr); } }
.tr-kpi {
  background: #fff; border: 1px solid var(--line, #E5E7EB);
  border-radius: 10px; padding: 13px 14px;
}
.tr-kpi.tr-kpi-modeled { border-color: #F59E0B; background: #FFFBEB; }
.tr-kpi .tr-kpi-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted, #6B7280); margin-bottom: 5px;
  display: flex; align-items: center; gap: 6px;
}
.tr-kpi .tr-kpi-flag { margin: 0 0 4px; }
.tr-kpi .tr-kpi-value { font-size: 21px; font-weight: 700; color: #1F3A5F; }
.tr-kpi .tr-kpi-delta { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.tr-kpi .tr-kpi-sub { font-size: 11px; color: var(--muted, #6B7280); margin-top: 5px; }
.tr-up { color: #1E7F4C; } .tr-down { color: #C0392B; }

.tr-chip {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.tr-chip-modeled { background: #FDE68A; color: #92400E; }
.tr-chip-measured { background: #DCFCE7; color: #166534; }
.tr-chip-official { background: #E3ECF7; color: #1F3A5F; }
.tr-chip-warn { background: #FCE9D3; color: #B45309; }

/* --- Validation reference panel (Cali's Model) ------------------------- */
.tr-refpanel { background: #F8FAFC; border-color: #C7D3E3; }
.tr-refpanel table { margin-top: 6px; }

/* --- Deletion inline bars ---------------------------------------------- */
.tr-bar-wrap {
  position: relative; display: inline-flex; align-items: center; justify-content: flex-end;
  width: 100%; min-width: 92px; height: 18px;
}
.tr-bar {
  position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #F0C48A, #C0392B); opacity: .32;
}
.tr-bar-val { position: relative; z-index: 1; font-weight: 700; padding-right: 4px; }

/* --- Notes / framing panel (deletion tab) ------------------------------ */
.tr-placeholder {
  font-size: 12.5px; line-height: 1.6; color: var(--muted, #6B7280);
  background: #FAFBFC; border: 1px dashed var(--line, #E5E7EB); border-radius: 8px;
  padding: 14px 16px; font-style: italic;
}
.tr-notesbody { font-size: 13px; line-height: 1.6; color: var(--text, #1F2937); }
.tr-notesbody p { margin: 0 0 10px; }
.tr-notesbody b { color: #1F3A5F; }
.tr-notesbody ol { margin: 0 0 10px; padding-left: 20px; }
.tr-notesbody li { margin: 0 0 8px; }

/* --- Market cards ------------------------------------------------------ */
.tr-markets {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px;
}
@media (max-width: 1100px) { .tr-markets { grid-template-columns: repeat(2, 1fr); } }
.tr-mkt {
  background: #F7F8FA; border: 1px solid var(--line, #E5E7EB); border-radius: 9px;
  padding: 10px 13px; cursor: pointer;
}
.tr-mkt:hover { border-color: #4472C4; }
.tr-mkt-name {
  font-size: 11.5px; font-weight: 700; color: #1F3A5F; text-transform: uppercase;
  letter-spacing: .03em; margin-bottom: 5px;
}
.tr-mkt-row {
  display: flex; justify-content: space-between; font-size: 11.5px;
  color: var(--muted, #6B7280); padding: 2px 0;
}

/* --- Panels / tables --------------------------------------------------- */
.tr-panel {
  background: #fff; border: 1px solid var(--line, #E5E7EB); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 18px;
}
.tr-panel h3 {
  margin: 0 0 12px; font-size: 13px; color: #1F3A5F; text-transform: uppercase;
  letter-spacing: .04em;
}
.tr-panel-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.tr-panel-head h3 { margin: 0; }
.tr-note { font-size: 11.5px; color: var(--muted, #6B7280); margin-bottom: 10px; line-height: 1.5; }
.tr-chart { height: 280px; position: relative; }
.tr-legend { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.tr-legend .tr-li {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--muted, #6B7280); cursor: pointer; user-select: none;
}
.tr-legend .tr-li.off { opacity: .35; }
.tr-legend .tr-sw { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.tr-tip {
  position: absolute; background: #1F2937; color: #fff; font-size: 11px;
  padding: 6px 9px; border-radius: 6px; pointer-events: none; opacity: 0;
  transition: opacity .1s; white-space: nowrap; z-index: 10;
}

.tr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tr-table th {
  text-align: left; padding: 8px 9px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted, #6B7280);
  border-bottom: 1.5px solid var(--line, #E5E7EB); cursor: pointer; white-space: nowrap;
}
.tr-table td { padding: 8px 9px; border-bottom: 1px solid var(--line, #E5E7EB); }
.tr-table tr:hover td { background: #FAFBFC; }
.tr-table tr.tr-click { cursor: pointer; }
.tr-table tr.tr-excl td { color: var(--muted, #6B7280); font-style: italic; background: #FAFAFA; }
.tr-num { text-align: right; font-variant-numeric: tabular-nums; }
.tr-pct { font-weight: 700; }

.tr-badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.tr-badge-traffic { background: #F8D7D3; color: #C0392B; }
.tr-badge-alarm   { background: #FCE9D3; color: #B45309; }
.tr-badge-track   { background: #E3ECF7; color: #4472C4; }
.tr-badge-nocomp  { background: #EDEDED; color: #6B7280; }

.tr-flags { display: flex; flex-direction: column; gap: 9px; }
.tr-flag {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.5; background: #F1F2F4;
}
.tr-flag.tr-flag-warn { background: #FCE9D3; }
.tr-flag .tr-flag-tag {
  font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0; width: 96px; color: #1F3A5F;
}
.tr-foot {
  font-size: 11.5px; color: var(--muted, #6B7280); line-height: 1.6;
  padding-top: 4px;
}
