/* Econometrics node - styles. Loaded globally by Dash from /assets, so every rule is scoped under .ecn-app.
   The page kit of the main app (assets/app_pages/pages_style.css: .pk-scope, .pk-card, .pk-kpis, .pk-pills,
   .pk-chip, .pk-btn) does most of the work; these rules lay out the node, in the same way as Seasonality and
   Factor Construction.
   Tokens: panels rgba(0,0,0,0.6), chips rgba(255,255,255,0.06), radius 10px, text #e8e8e8, muted #9fb3c8,
   headings #cfefff, accent #f0a030; serious #e66767, handled #3fbf7f. */

.ecn-app { color: #e8e8e8; font-size: 13px; }
.ecn-app * { box-sizing: border-box; }

/* ---------- header (leave ~200px on the right for the app toolbar) ---------------------------- */
.ecn-top { display: flex; align-items: flex-end; gap: 18px; padding: 0 200px 10px 0; }
.ecn-brand h3 { margin: 0; font-size: 1.3rem; color: #cfefff; font-weight: 600; letter-spacing: .2px; }
.ecn-brand h3 span { color: #9fb3c8; font-weight: 400; font-size: .95rem; }
.ecn-brand > div { color: #9fb3c8; font-size: .78rem; max-width: 1040px; line-height: 1.45; }

/* ---------- main grid: rail + screens ---------------------------------------------------------- */
.ecn-main { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.ecn-rail { display: flex; flex-direction: column; min-width: 0; }
.ecn-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.ecn-field { margin-bottom: 8px; min-width: 0; }
.ecn-k { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.ecn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.ecn-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ecn-row21 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.ecn-chipbox { margin-bottom: 8px; }
.ecn-chipbox .pfp-chip { width: 100%; }
.ecn-chipbox .pfp-chip-tx { flex: 1 1 auto; }
.ecn-app .Select-control { min-height: 30px; }
.ecn-app .Select--single > .Select-control { height: 30px; }
.ecn-app .Select--single > .Select-control .Select-value, .ecn-app .Select-placeholder { line-height: 28px !important; }
.ecn-app .Select-value-label { color: #e8e8e8 !important; }
.ecn-app .Select--multi .Select-value { font-size: .72rem; margin-top: 3px; }
.ecn-app .VirtualizedSelectOption { white-space: normal; line-height: 1.25; }
.ecn-app input.ecn-num, .ecn-app input.ecn-date { width: 100%; height: 30px; }
.ecn-app input.ecn-add { flex: 1 1 120px; min-width: 0; height: 30px; }
.ecn-checks label { user-select: none; }
.ecn-xsel { margin-bottom: 6px; }
.ecn-xrows { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.ecn-xrow { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 5px; }
.ecn-xrow2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 5px; align-items: start; }
.ecn-xname { color: #cfdcea; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
             margin-bottom: 3px; }
.ecn-actions { margin: 2px 0 6px; }
.ecn-app .ecn-run { font-weight: 600; padding: 5px 16px; }
.ecn-hint { color: #7f93a6; font-size: .68rem; }
.ecn-status { font-size: .74rem; }
.ecn-ok { color: #bfe8c4; }
.ecn-ok i { color: #3fbf7f; }
.ecn-err { color: #ffd0cb; }
.ecn-err i { color: #e66767; }

/* screen tabs (the same look as the other idea apps) */
.ecn-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.ecn-tabs label { display: inline-flex !important; margin: 0 !important; cursor: pointer; padding: 2px 0 7px;
                  color: #7f93a8; font-size: 1rem; font-weight: 600; border-bottom: 2px solid transparent;
                  transition: color .15s, border-color .15s; }
.ecn-tabs label:hover { color: #cfefff; }
.ecn-tabs label:has(input:checked) { color: #cfefff; border-bottom-color: #f0a030; }
.ecn-tabs input { display: none; }
.ecn-center { min-width: 0; }
.ecn-wait { color: #9fb3c8; padding: 40px 10px; text-align: center; }
.ecn-wait.ecn-err { color: #ffd0cb; }

/* ---------- cards, grids, kpis ------------------------------------------------------------------ */
.ecn-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ecn-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 2px; }
.ecn-grid2 > .pk-card { margin-bottom: 10px; }
.ecn-top2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.ecn-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; margin-bottom: 2px; }
.ecn-grid3 > .pk-card { padding: 4px 6px; }
.ecn-narrow { max-width: 760px; }
.ecn-graph { width: 100%; }
.ecn-kpis { margin: 0 0 10px; }
.ecn-kpis .pk-kpi { flex: 1 1 140px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); min-width: 0; }
.ecn-kpis .pk-kpi.ecn-hero { flex: 1.4 1 190px; border-color: rgba(240,160,48,0.45); background: rgba(240,160,48,0.07); }
.ecn-kpis .pk-kpi.ecn-hero .pk-kv { font-size: 1.45rem; }
.ecn-kpis .pk-kl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecn-kpi-s { color: #7f93a6; font-size: .64rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ecn-summary { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-left: 3px solid #f0a030;
               border-radius: 10px; padding: 10px 14px; font-size: .86rem; color: #e8f4ff; line-height: 1.55; margin-bottom: 10px; }
.ecn-summary > i { color: #f0a030; }
.ecn-summary > b { font-weight: 600; }
.ecn-summary > div { margin-top: 3px; color: #dfe7ee; font-size: .82rem; }
.ecn-say { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 7px 10px; border-radius: 10px;
           background: rgba(255,255,255,0.04); color: #dfe7ee; font-size: .78rem; line-height: 1.5; }
.ecn-say i { color: #f0a030; margin-top: 3px; }
.ecn-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.ecn-note.warn { color: #f5d6a3; }

/* ---------- issues ------------------------------------------------------------------------------ */
.ecn-issue { border: 1px solid rgba(255,255,255,0.08); border-left: 3px solid #6f8295; border-radius: 10px;
             padding: 8px 11px; margin-top: 8px; background: rgba(255,255,255,0.03); }
.ecn-issue.sev2 { border-left-color: #e66767; }
.ecn-issue.sev1 { border-left-color: #f0a030; }
.ecn-issue.ok { border-left-color: #3fbf7f; opacity: .9; }
.ecn-issue-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ecn-issue-t { color: #e8f4ff; font-weight: 600; font-size: .84rem; line-height: 1.35; }
.ecn-issue-why { color: #cfdcea; font-size: .76rem; line-height: 1.5; margin-top: 4px; }
.ecn-done { color: #bfe8c4; font-size: .76rem; margin-top: 4px; }
.ecn-done i { color: #3fbf7f; }
.ecn-app ul.ecn-ev { margin: 5px 0 0; padding-left: 18px; color: #9fb3c8; font-size: .72rem; line-height: 1.5; }
.ecn-fixes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ecn-app .ecn-fixes .pk-btn { white-space: normal; text-align: left; line-height: 1.3; }
.ecn-fixes .pk-btn i { opacity: .8; }

/* controls row above a screen */
.ecn-ctrls { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; margin-bottom: 10px; }
.ecn-ctrls > div { min-width: 0; }
.ecn-ctrls .ecn-dd { min-width: 320px; max-width: 560px; }

/* ---------- tables ------------------------------------------------------------------------------- */
.ecn-scroll { overflow-x: auto; }
.ecn-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.ecn-table th { color: #9fb3c8; font-weight: 500; font-size: .64rem; text-transform: uppercase; letter-spacing: .4px;
                text-align: right; padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.1); vertical-align: bottom; }
.ecn-table td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: right;
                font-variant-numeric: tabular-nums; color: #e8e8e8; white-space: nowrap; }
.ecn-table th:first-child, .ecn-table td:first-child { text-align: left; white-space: normal; }
.ecn-table td:nth-child(2):not(:last-child) { white-space: normal; }
.ecn-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.ecn-table td.ecn-fam { color: #cfefff; font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .5px;
                        text-align: left; padding-top: 10px; border-bottom-color: rgba(255,255,255,0.1); }
.ecn-table.txt th, .ecn-table.txt td { text-align: left; white-space: normal; line-height: 1.45; vertical-align: top; }
.ecn-table.txt td:first-child { white-space: nowrap; color: #cfefff; padding-right: 14px; }
.ecn-table.tests th:nth-child(2), .ecn-table.tests td:nth-child(2) { text-align: left; color: #cfdcea; }
.ecn-table td.ecn-stat { color: #9fb3c8; font-size: .72rem; white-space: normal; }
.ecn-table tr:has(td.ecn-stat):first-of-type td { border-top: 1px solid rgba(255,255,255,0.14); }
.ecn-se { color: #7f93a6; }
.ecn-compare th { text-transform: none; font-size: .7rem; white-space: normal; min-width: 150px; }
.ecn-colh { display: inline-flex; align-items: center; gap: 4px; }
.ecn-app .ecn-x { background: none; border: none; color: #7f93a6; cursor: pointer; padding: 0 3px; font-size: .78rem; }
.ecn-app .ecn-x:hover { color: #f0a030; }
.ecn-details { margin-top: 8px; }
.ecn-details summary { color: #9fb3c8; font-size: .72rem; cursor: pointer; }

/* guide */
.ecn-step { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-size: .78rem; line-height: 1.5; color: #dfe7ee; }
.ecn-step b { color: #e8f4ff; }
.ecn-step-n { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(240,160,48,0.6); color: #f5d6a3;
              display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 600; }

.ecn-foot { color: #6f8295; font-size: .68rem; line-height: 1.45; margin-top: 12px; padding-top: 8px;
            border-top: 1px solid rgba(255,255,255,0.06); }
.ecn-foot i { color: #9fb3c8; }

/* ---------- narrow screens ----------------------------------------------------------------------- */
@media (max-width: 1500px) { .ecn-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1320px) { .ecn-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) {
  .ecn-main { grid-template-columns: minmax(0, 1fr); }
  .ecn-top { padding-right: 120px; }
  .ecn-grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ecn-top { padding-right: 0; padding-top: 34px; }
  .ecn-brand > div { display: none; }
  .ecn-tabs { gap: 4px 14px; }
  .ecn-tabs label { font-size: .88rem; }
  .ecn-ctrls .ecn-dd { min-width: 0; width: 100%; }
  .ecn-ctrls > div { flex: 1 1 100%; }
  .ecn-kpis .pk-kpi { flex: 1 1 45%; }
}
