/* DCA Companion (Systematic Investment Plan node) — styles. Loaded globally by Dash from
   /assets, so every rule is scoped under .sip-app. The page kit of the main app
   (assets/app_pages/pages_style.css: .pk-scope, .pk-card, .pk-kpis, .pk-pills, .pk-btn)
   does most of the work; these rules only lay out the node.
   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. */

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

/* ---------- header ---------------------------------------------------------------- */
.sip-top { display: flex; align-items: flex-end; gap: 18px; padding: 0 200px 10px 0; }
.sip-brand h3 { margin: 0; font-size: 1.3rem; color: #cfefff; font-weight: 600; letter-spacing: .2px; }
.sip-brand h3 span { color: #9fb3c8; font-weight: 400; font-size: .95rem; }
.sip-brand > div { color: #9fb3c8; font-size: .78rem; max-width: 960px; line-height: 1.45; }

/* ---------- panic banner ------------------------------------------------------------ */
.sip-banner { display: flex; align-items: center; gap: 12px; border-radius: 10px; padding: 9px 14px; margin-bottom: 10px;
              background: rgba(240,160,48,0.10); border: 1px solid rgba(240,160,48,0.55); color: #f5d6a3; font-size: .8rem; }
.sip-banner.lvl2 { background: rgba(230,103,103,0.10); border-color: rgba(230,103,103,0.55); color: #ffd0cb; }
.sip-banner.lvl3 { background: rgba(230,103,103,0.16); border-color: rgba(230,103,103,0.75); color: #ffd0cb; }
.sip-banner > i { font-size: 1.3rem; color: #f0a030; }
.sip-banner > div { flex: 1; line-height: 1.45; }
.sip-banner b { color: #fff; }

/* ---------- main grid: settings rail + screens ---------------------------------------- */
.sip-main { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .sip-main { grid-template-columns: minmax(0, 1fr); } }
.sip-rail { display: flex; flex-direction: column; gap: 0; }
.sip-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.sip-field { margin-bottom: 8px; min-width: 0; }
.sip-k { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.sip-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.sip-row2.narrow { max-width: 520px; margin-top: 10px; }
.sip-app .pk-pills { margin-bottom: 2px; }
.sip-app .Select-control { height: 30px; }
.sip-app .Select--single > .Select-control .Select-value, .sip-app .Select-placeholder { line-height: 28px !important; }
.sip-app .Select-value-label { color: #e8e8e8 !important; }
.sip-details summary { color: #cfefff; font-weight: 600; font-size: .88rem; cursor: pointer; margin-bottom: 4px; }
.sip-details summary i { color: #f0a030; margin-right: 4px; }
.sip-textarea { width: 100%; min-height: 96px; font-size: .78rem !important; line-height: 1.45; }
.sip-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 6px; }
.sip-actions .pk-btn i { margin-right: 3px; }
.sip-app .pk-btn.acc i { color: #f0a030; }

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

/* ---------- cards, grids, kpis ---------------------------------------------------------- */
.sip-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sip-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.sip-grid2.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 1250px) { .sip-grid2, .sip-grid2.wide-left { grid-template-columns: minmax(0, 1fr); } }
.sip-grid2 > .pk-card { margin-bottom: 0; }
.sip-grid2 { margin-bottom: 12px; }
.sip-graph { width: 100%; }
.sip-kpis { margin: 0 0 10px; }
.sip-kpis .pk-kpi { flex: 1 1 140px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); }
.sip-kpis .pk-kpi.sip-hero { flex: 1.6 1 220px; border-color: rgba(240,160,48,0.45); background: rgba(240,160,48,0.07); }
.sip-kpis .pk-kpi.sip-hero .pk-kv { font-size: 1.6rem; color: #f5d6a3; }
.sip-kpi-s { color: #7f93a6; font-size: .64rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sip-msgs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.sip-msg { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
           padding: 7px 12px; font-size: .8rem; color: #dfe7ee; line-height: 1.45; margin-bottom: 10px; }
.sip-msgs .sip-msg { margin-bottom: 0; }
.sip-msg i { color: #9fb3c8; margin-right: 4px; }
.sip-msg.good { border-color: rgba(63,191,127,0.45); background: rgba(63,191,127,0.08); }
.sip-msg.good i { color: #3fbf7f; }
.sip-msg.warn { border-color: rgba(240,160,48,0.55); background: rgba(240,160,48,0.08); color: #f5d6a3; }
.sip-msg.warn i { color: #f0a030; }
.sip-msg.bad { border-color: rgba(230,103,103,0.55); background: rgba(230,103,103,0.10); color: #ffd0cb; }
.sip-msg.bad i { color: #e66767; }
.sip-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.sip-lead { color: #dfe7ee; font-size: .82rem; line-height: 1.5; margin: 2px 0 8px; }
.sip-list { color: #cfdcea; font-size: .76rem; line-height: 1.5; padding-left: 18px; margin: 6px 0 0; }

/* monthly letter */
.sip-letter { background: linear-gradient(100deg, rgba(240,160,48,0.10), rgba(0,0,0,0.55) 55%);
              border: 1px solid rgba(240,160,48,0.35); border-radius: 10px; padding: 9px 14px 6px; margin-bottom: 10px; }
.sip-letter-h { color: #f5d6a3; font-weight: 600; font-size: .82rem; margin-bottom: 3px; }
.sip-letter-h i { color: #f0a030; margin-right: 4px; }
.sip-letter ol { margin: 0; padding-left: 20px; color: #e8e8e8; font-size: .8rem; line-height: 1.55; }

/* tables */
.sip-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.sip-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; }
.sip-table td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: right;
                font-variant-numeric: tabular-nums; color: #e8e8e8; }
.sip-table th:first-child, .sip-table td:first-child { text-align: left; }
.sip-table.txt2 th:nth-child(2), .sip-table.txt2 td:nth-child(2) { text-align: left; color: #cfdcea; }
.sip-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.sip-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }

/* F3 */
.sip-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: .92rem; color: #e8f4ff; line-height: 1.5; margin-bottom: 10px; }
.sip-summary i { color: #f0a030; }
.sip-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (max-width: 1250px) { .sip-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sip-stat { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.sip-stat-t { color: #9fb3c8; font-size: .66rem; text-transform: uppercase; letter-spacing: .5px; }
.sip-stat-v { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; margin: 1px 0 4px; }
.sip-stat-s { color: #dfe7ee; font-size: .74rem; line-height: 1.4; }
.sip-stat-n { color: #7f93a6; font-size: .66rem; margin-top: 3px; line-height: 1.35; }
.sip-pbar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); margin: 2px 0 6px; overflow: visible; }
.sip-pbar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgba(230,103,103,0.7), rgba(91,127,168,0.7)); }
.sip-pbar-mark { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1px; border-radius: 2px; background: #f0a030; }
.sip-ctrls { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; margin-bottom: 8px; }
.sip-touch-r { font-size: .86rem; color: #dfe7ee; line-height: 1.5; }
.sip-big { font-size: 1.7rem; font-weight: 600; color: #f0a030; font-variant-numeric: tabular-nums; }
.sip-app input.sip-num { width: 80px !important; }

/* F4 */
.sip-quote { font-size: 1.02rem; color: #fff; line-height: 1.55; padding: 4px 4px 4px 16px; border-left: 3px solid #f0a030;
             font-style: italic; white-space: pre-line; }
.sip-commit-card { border-color: rgba(240,160,48,0.35); }

/* footer */
.sip-foot { margin-top: 14px; color: #7f93a6; font-size: .68rem; line-height: 1.5; border-top: 1px solid rgba(255,255,255,0.06);
            padding-top: 8px; }
.sip-foot i { color: #9fb3c8; margin-right: 4px; }
.sip-nowrap { white-space: nowrap; }

/* the shared "Portfolio" chip (shared_assets/universe/picker.py): the rail's first item */
.sip-pfchip { margin-bottom: 8px; }
.sip-pfchip .pfp-chip { width: 100%; }
.sip-pfchip .pfp-chip-tx { flex: 1 1 auto; }
