/* Curve Forecast Lab node - styles. Loaded globally by Dash from /assets, so every rule is scoped under .cfl-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, as in Econometrics and Clustering.
   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; bad #e66767, good #3fbf7f. */

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

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

/* ---------- main grid: rail + screens ---------------------------------------------------------- */
.cfl-main { display: grid; grid-template-columns: 318px minmax(0, 1fr); gap: 14px; align-items: start; }
.cfl-rail { display: flex; flex-direction: column; min-width: 0; }
.cfl-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.cfl-field { margin-bottom: 8px; min-width: 0; }
.cfl-k { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.cfl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.cfl-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.cfl-app .Select-control { min-height: 30px; }
.cfl-app .Select--single > .Select-control { height: 30px; }
.cfl-app .Select--single > .Select-control .Select-value, .cfl-app .Select-placeholder { line-height: 28px !important; }
.cfl-app .Select-value-label { color: #e8e8e8 !important; }
.cfl-app .Select--multi .Select-value { font-size: .7rem; margin-top: 3px; }
.cfl-app .VirtualizedSelectOption { white-space: normal; line-height: 1.25; }
.cfl-app .Select-menu-outer { z-index: 30; }
.cfl-checks { display: flex; flex-direction: column; gap: 1px; }
.cfl-checks label { user-select: none; display: flex !important; align-items: baseline; gap: 6px; margin: 0 !important;
                    font-size: .76rem; color: #dfe7ee; cursor: pointer; }
.cfl-grp { color: #7f93a6; font-size: .62rem; text-transform: uppercase; letter-spacing: .6px; margin: 6px 0 2px; }
.cfl-actions { margin: 2px 0 6px; }
.cfl-app .cfl-run { font-weight: 600; padding: 5px 16px; }
.cfl-status { font-size: .74rem; line-height: 1.45; }
.cfl-ok { color: #bfe8c4; }
.cfl-ok i { color: #3fbf7f; }
.cfl-err { color: #ffd0cb; }
.cfl-err i { color: #e66767; }

/* screen tabs (the same look as the other idea apps) */
.cfl-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 8px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.cfl-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; }
.cfl-tabs label:hover { color: #cfefff; }
.cfl-tabs label:has(input:checked) { color: #cfefff; border-bottom-color: #f0a030; }
.cfl-tabs input { display: none; }
.cfl-center { min-width: 0; }
.cfl-wait { color: #9fb3c8; padding: 40px 10px; text-align: center; }
.cfl-wait.cfl-err { color: #ffd0cb; }

/* the bar of what is shown (block, models, reference) */
.cfl-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-end; margin: 0 0 10px; padding: 7px 10px;
           background: rgba(255,255,255,0.04); border-radius: 10px; }
.cfl-bar > div { min-width: 0; }
.cfl-bar .cfl-k { margin-bottom: 2px; }
.cfl-bar .cfl-dd { min-width: 230px; }
.cfl-bar .cfl-dd.wide { min-width: 420px; max-width: 780px; flex: 1 1 420px; }

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

.cfl-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; }
.cfl-summary > b { font-weight: 600; }
.cfl-summary > div { margin-top: 3px; color: #dfe7ee; font-size: .82rem; }
.cfl-say { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; padding: 7px 10px; border-radius: 10px;
           background: rgba(255,255,255,0.04); color: #dfe7ee; font-size: .78rem; line-height: 1.5; }
.cfl-say i { color: #f0a030; margin-top: 3px; }
.cfl-say.warn { background: rgba(230,103,103,0.09); border: 1px solid rgba(230,103,103,0.3); color: #ffe1dd; }
.cfl-say.warn i { color: #e66767; }
.cfl-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.cfl-p { color: #dfe7ee; font-size: .78rem; line-height: 1.55; margin-top: 6px; }
.cfl-app ul.cfl-list { margin: 4px 0 0; padding-left: 20px; color: #dfe7ee; font-size: .78rem; line-height: 1.55; }
.cfl-list li { margin-bottom: 5px; }
.cfl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }

/* controls row above a screen */
.cfl-ctrls { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; margin: 2px 0 10px; }
.cfl-ctrls > div { min-width: 0; }
.cfl-ctrls .cfl-dd { min-width: 240px; max-width: 520px; }
.cfl-app input.cfl-in { height: 30px; min-width: 0; width: 100%; }
.cfl-ctrls .cfl-legs { flex: 1 1 380px; }

/* ---------- tables ------------------------------------------------------------------------------- */
.cfl-scroll { overflow-x: auto; }
.cfl-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.cfl-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; }
.cfl-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; }
.cfl-table th:first-child, .cfl-table td:first-child { text-align: left; white-space: normal; }
.cfl-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.cfl-table td.best { color: #ffd27a; font-weight: 600; }
.cfl-table td.bad { color: #ff9d94; }
.cfl-table td.dim, .cfl-table tr.dim td { color: #7f93a6; }
.cfl-table tr.grp td { color: #7f93a6; font-size: .62rem; text-transform: uppercase; letter-spacing: .6px; padding-top: 9px;
                       border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; }
.cfl-table.txt th, .cfl-table.txt td { text-align: left; white-space: normal; line-height: 1.45; vertical-align: top; }
.cfl-table.txt td:first-child { color: #cfefff; padding-right: 12px; white-space: nowrap; }
.cfl-se { color: #7f93a6; font-size: .68rem; }

.cfl-step { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-size: .78rem; line-height: 1.5; color: #dfe7ee; }
.cfl-step b { color: #e8f4ff; }
.cfl-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; }

.cfl-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); }
.cfl-foot i { color: #9fb3c8; }

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