/* GO DESi | Retail P&L — "Influency" layout: floating white sidebar on a cool
   gray canvas, lime + periwinkle accents, black pill buttons, outlined circular
   icon buttons, chunky rounded cards. */
:root {
  --page: #E8EAEF;
  --side: #FFFFFF;
  --card: #FFFFFF;
  --card-soft: #F4F5F8;
  --ink: #15171B;
  --muted: #8B919D;
  --line: #E9EAEF;
  --lime: #D7F14A;
  --lime-deep: #B9D92E;
  --lime-ink: #2A3307;
  --lime-soft: #EFF9C8;
  --blue: #A9C2F6;
  --blue-deep: #3B5BA5;
  --blue-soft: #E4EBFC;
  --black: #15171B;
  --red: #C5493A;
  --red-soft: #FBEAE7;
  /* legacy token names still used by older rules */
  --green: #15171B;
  --green-dark: #5E7A12;
  --mint: #EFF9C8;
  --num-font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --body-font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --r-card: 24px;
  --ring: 0 0 0 4px rgba(185, 217, 46, .30);
  --shadow-card: 0 1px 2px rgba(21, 23, 27, .03), 0 16px 40px -30px rgba(21, 23, 27, .25);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--body-font); color: var(--ink); font-size: 13.5px; min-height: 100vh;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(169, 194, 246, .35), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(215, 241, 74, .22), transparent 60%),
    var(--page); }
button { font-family: var(--body-font); cursor: pointer; }
select, input { font-family: var(--body-font); }

/* ---------- app shell: sidebar + main ---------- */
#app { display: flex; gap: 14px; max-width: 1560px; margin: 14px auto; padding: 0 clamp(10px, 1.6vw, 26px); align-items: flex-start; }
.side { position: sticky; top: 14px; flex: 0 0 184px; background: var(--side); border-radius: 22px; padding: 14px 10px 10px;
  display: flex; flex-direction: column; gap: 5px; min-height: calc(100vh - 28px); max-height: calc(100vh - 28px);
  box-shadow: var(--shadow-card); }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 11px; }
.brand .blogo { width: 29px; height: 29px; flex: none; object-fit: contain; }
.brand b { font-family: var(--num-font); font-weight: 800; font-size: .88rem; letter-spacing: .02em; }
.snav { display: flex; flex-direction: column; gap: 1px; }
.snav button { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: transparent;
  border-radius: 11px; padding: 8px 10px; font-weight: 600; font-size: .8rem; color: #707684; text-align: left;
  white-space: nowrap; transition: background .15s, color .15s; }
.snav button svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .85; }
.snav button:hover { color: var(--ink); background: #F6F7FA; }
.snav button.on { background: var(--card-soft); color: var(--ink); font-weight: 700;
  box-shadow: inset 0 0 0 1px #ECEDF1, 0 6px 16px -12px rgba(21, 23, 27, .4); }
.snav button.on svg { opacity: 1; }
.snav button .dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-deep); opacity: 0; }
.snav button.on .dot { opacity: 1; }
.side-card { margin-top: auto; background: var(--card-soft); border-radius: 16px; padding: 12px 12px 11px; text-align: left; }
.side-card .sic { width: 30px; height: 30px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; margin-bottom: 7px; }
.side-card .sic svg { width: 14px; height: 14px; stroke: var(--lime-ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-card .t { font-family: var(--num-font); font-weight: 800; font-size: .84rem; }
.side-card .s { color: var(--muted); font-size: .7rem; margin: 2px 0 8px; line-height: 1.35; }
.btn-black { display: block; width: 100%; border: none; border-radius: 999px; background: var(--black); color: #fff;
  font-weight: 700; font-size: .78rem; padding: 8px 14px; transition: background .15s; }
.btn-black:hover { background: #2B2E35; }

.main { flex: 1; min-width: 0; padding-bottom: 36px; }

/* ---------- header ---------- */
.mhead { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.mhead h1 { font-family: var(--num-font); font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.mhead .sub { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.newpill { background: var(--blue-soft); color: var(--blue-deep); border-radius: 999px; padding: 7px 14px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; }
.mh-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.icbtn { width: 35px; height: 35px; border-radius: 50%; border: 1px solid #DFE1E7; background: var(--card);
  display: grid; place-items: center; transition: border-color .15s, background .15s; }
.icbtn:hover { border-color: #B9BDC7; background: #FAFBFC; }
.icbtn svg { width: 15px; height: 15px; stroke: var(--ink); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.who { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid #DFE1E7;
  border-radius: 999px; padding: 4px 12px 4px 5px; }
.who .av { width: 27px; height: 27px; border-radius: 50%; background: var(--lime); color: var(--lime-ink);
  display: grid; place-items: center; font-weight: 800; font-size: .72rem; font-family: var(--num-font); }
.who .wt { line-height: 1.15; }
.who .w1 { font-size: .68rem; color: var(--muted); font-weight: 600; }
.who .w2 { font-size: .78rem; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- loading / error / login ---------- */
.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--page); z-index: 100; }
.loading-box { text-align: center; color: var(--muted); font-weight: 600; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #D8DBE1; border-top-color: var(--lime-deep);
  margin: 0 auto 14px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-t { font-family: var(--num-font); font-size: 1.2rem; color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.err-m { max-width: 480px; }
.login-box { display: flex; flex-direction: column; gap: 12px; width: min(360px, 92vw); background: var(--card);
  border-radius: 26px; padding: 32px 28px; box-shadow: 0 30px 70px -30px rgba(21, 23, 27, .4); text-align: center; }
.login-logo { width: 62px; height: 62px; margin: 0 auto 2px; object-fit: contain; }
.login-t { font-family: var(--num-font); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.login-s { color: var(--muted); font-size: .88rem; margin-bottom: 6px; }
.login-box .note { text-align: left; }

/* ---------- filter bar ---------- */
.fbar { position: relative; background: var(--card); border-radius: 20px; padding: 12px 16px;
  margin: 0 0 10px; display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow-card); }
.frow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.flab { flex: none; width: 58px; font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #A0A5B0; }
.pop-grid label { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #A0A5B0; }
.chipseg { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid transparent; background: var(--card-soft); border-radius: 999px; padding: 6px 13px;
  font-weight: 600; font-size: .81rem; color: #565C68; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { background: #fff; border-color: #C6CAD2; color: var(--ink); }
.chip.on { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.fdiv { width: 1px; align-self: stretch; background: var(--line); margin: 0 6px; }
.msgrow { display: flex; gap: 9px; flex-wrap: wrap; flex: 1; align-items: center; justify-content: flex-end; }
.ms-slot { flex: 1 1 170px; min-width: 160px; max-width: 250px; }
.sel-sm { min-height: 38px; border-radius: 999px; width: auto; padding: 6px 12px; font-size: .85rem; }
.f-pair { display: flex; gap: 6px; align-items: center; }
.sel, .ms-btn { min-height: 37px; border-radius: 999px; border: 1px solid #E4E6EB; background: var(--card-soft); color: var(--ink);
  font-weight: 600; font-size: .86rem; padding: 6px 14px; transition: border-color .15s, box-shadow .15s, background .15s; width: 100%; }
.sel:hover, .ms-btn:hover { border-color: #C6CAD2; background: #fff; }
.sel:focus, .ms-btn:focus { outline: none; border-color: var(--lime-deep); background: #fff; box-shadow: var(--ring); }
.btn { min-height: 37px; border-radius: 999px; border: none; background: var(--black); color: #fff;
  font-weight: 700; font-size: .86rem; padding: 6px 18px; transition: background .15s; white-space: nowrap; width: auto; }
.btn:hover { background: #2B2E35; }
.btn:focus { outline: none; box-shadow: var(--ring); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid #DFE1E7; }
.btn-ghost:hover { background: var(--card-soft); color: var(--ink); border-color: #B9BDC7; }
.btn-sm { min-height: 34px; padding: 5px 16px; font-size: .84rem; }

/* multiselect */
.ms { position: relative; }
.ms-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.ms-btn .ph { color: #A6ABB5; font-weight: 500; }
.ms-btn .caret { color: #A0A5B0; font-size: .7rem; flex: none; }
.ms-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 230px; max-width: 320px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 24px 50px -20px rgba(21, 23, 27, .25); max-height: 300px; overflow: auto; }
.ms-opt { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 10px; font-weight: 500; font-size: .9rem; }
.ms-opt:hover { background: var(--card-soft); }
.ms-opt input { accent-color: var(--lime-deep); width: 15px; height: 15px; }
.ms-clear { display: block; width: 100%; border: none; background: var(--lime-soft); border-radius: 10px; padding: 7px;
  font-weight: 700; color: #55660F; margin-bottom: 6px; }
.ms-tagwrap { display: flex; gap: 4px; flex-wrap: wrap; overflow: hidden; }
.ms-tag { background: var(--lime); color: var(--lime-ink); border-radius: 999px; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; white-space: nowrap; }

/* more-filters popover */
.pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 16px 18px; width: min(560px, 94vw); box-shadow: 0 30px 60px -22px rgba(21, 23, 27, .3); }
.pop-h { font-family: var(--num-font); font-weight: 700; font-size: 1rem; }
.pop-s { color: var(--muted); font-size: .83rem; margin: 2px 0 12px; }
.pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pop-grid > div { display: flex; flex-direction: column; gap: 5px; }
@media (max-width: 560px) { .pop-grid { grid-template-columns: 1fr; } }

/* chips & notes */
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
.fchip { background: var(--card); color: #565C68; border-radius: 999px; padding: 5px 13px;
  font-size: .78rem; font-weight: 600; box-shadow: 0 1px 2px rgba(21, 23, 27, .05); }
.fchip b { color: #55660F; }
.note { background: #FBF4E3; border: 1px solid #EFDFB9; color: #8A6A1F; border-radius: 14px; padding: 9px 14px;
  font-size: .86rem; margin: 6px 0 10px; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(182px, 1fr)); gap: 11px; margin: 2px 0 12px; }
.kpi { background: var(--card); border-radius: 18px; padding: 13px 14px 10px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-card); }
.kpi .krow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kpi .kic { width: 30px; height: 30px; border-radius: 10px; background: var(--card-soft); display: grid; place-items: center; }
.kpi .kic svg { width: 14px; height: 14px; stroke: var(--ink); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi .karr { width: 27px; height: 27px; border-radius: 50%; border: 1px solid #DFE1E7; background: var(--card);
  display: grid; place-items: center; font-weight: 700; font-size: .78rem; color: var(--ink); }
.kpi .karr.down { color: var(--red); }
.kpi .v { font-family: var(--num-font); color: var(--ink); font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em;
  line-height: 1.05; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi .d { display: inline-block; font-size: .67rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; letter-spacing: 0; }
.kpi .l { color: var(--ink); font-size: .78rem; font-weight: 700; margin-top: 5px; }
.kpi .s { color: var(--muted); font-size: .7rem; margin-top: 1px; }
.kpi svg.spk { display: block; margin-top: 7px; height: 24px; }
.d.up { background: var(--lime-soft); color: #55660F; }
.d.down { background: var(--red-soft); color: #BA4433; }
.d.flat { background: var(--card-soft); color: var(--muted); }
/* the lime hero card */
.kpi.hero { background: var(--lime); }
.kpi.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .5), transparent 65%); }
.kpi.hero .kic { background: rgba(255, 255, 255, .5); }
.kpi.hero .kic svg { stroke: var(--lime-ink); }
.kpi.hero .karr { background: var(--card); border-color: transparent; }
.kpi.hero .v, .kpi.hero .l { color: var(--lime-ink); }
.kpi.hero .s { color: #57661B; }
.kpi.hero .d.up, .kpi.hero .d.down, .kpi.hero .d.flat { background: rgba(255, 255, 255, .55); color: var(--lime-ink); }

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g21 { grid-template-columns: 1.65fr 1fr; }
.g12 { grid-template-columns: 1fr 1.25fr; }
.g231 { grid-template-columns: 2.3fr 1fr; }
@media (max-width: 980px) { .g2, .g21, .g12, .g231 { grid-template-columns: 1fr; } }
.card { background: var(--card); border-radius: 20px; padding: 19px 21px; box-shadow: var(--shadow-card); min-width: 0;
  margin-bottom: 14px; }
.grid .card, .kpis .kpi { margin-bottom: 0; }
.card-h { font-family: var(--num-font); font-weight: 800; font-size: 1rem; color: var(--ink); margin: 0 0 2px; letter-spacing: -.01em; }
.card-s { color: var(--muted); font-size: .78rem; margin: 0 0 10px; }
.caption { color: var(--muted); font-size: .8rem; margin: 4px 0 10px; }
.chart { width: 100%; }
/* card header with a round icon chip, like "Statistics" / "Visitors" */
.ch-row { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 10px; }
.ch-ic { width: 33px; height: 33px; border-radius: 50%; border: 1px solid #E4E6EB; background: var(--card);
  display: grid; place-items: center; flex: none; }
.ch-ic svg { width: 15px; height: 15px; stroke: var(--ink); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ch-row .card-h { margin-top: 1px; }
.ch-row .right { margin-left: auto; }

/* ---------- Statistics card: two big numbers ---------- */
.bigstats { display: flex; gap: 0; margin: 4px 0 4px; flex-wrap: wrap; }
.bigstat { flex: 1 1 170px; padding: 4px 22px 9px 0; }
.bigstat + .bigstat { border-left: 1px dashed var(--line); padding-left: 22px; }
.bigstat .bl { color: var(--muted); font-size: .76rem; font-weight: 600; }
.bigstat .bv { font-family: var(--num-font); font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; margin: 3px 0 2px;
  font-variant-numeric: tabular-nums; }
.bigstat .bd { font-size: .78rem; font-weight: 700; }
.bigstat .bd.pos { color: #55800F; }
.bigstat .bd.neg { color: var(--red); }
.bigstat .bd span { color: var(--muted); font-weight: 500; }

/* ---------- bubbles + progress (the "Visitors" card) ---------- */
.bub-wrap { display: flex; align-items: center; justify-content: center; min-height: 215px; padding: 6px 0 2px; }
.bub { border-radius: 50%; display: grid; place-content: center; text-align: center; flex: none; }
.bub .bv { font-family: var(--num-font); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.bub .bl { font-size: .7rem; font-weight: 600; opacity: .75; margin-top: 1px; }
.bub.b1 { background: var(--lime); color: var(--lime-ink); z-index: 2; }
.bub.b2 { background: var(--blue); color: #1D2F5E; margin-left: -6px; z-index: 1; }
.bub.b3 { background: #E7E9EE; color: var(--ink); margin-left: -12px; align-self: flex-end; z-index: 3; }
.prg { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); }
.prg .pl2 { flex: 0 0 118px; font-size: .82rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prg .pbar { flex: 1; height: 7px; border-radius: 999px; background: var(--card-soft); overflow: hidden; }
.prg .pbar i { display: block; height: 100%; border-radius: 999px; }
.prg .pv { flex: 0 0 44px; text-align: right; font-weight: 800; font-size: .84rem; font-family: var(--num-font); }

/* ---------- insights ---------- */
.insight { display: flex; gap: 11px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line);
  font-size: .9rem; color: var(--ink); line-height: 1.45; }
.insight:last-child { border-bottom: none; }
.insight .ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: .85rem; }

/* ---------- generic data table ---------- */
.twrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
table.dt { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; }
table.dt th { position: sticky; top: 0; z-index: 2; background: var(--card-soft); color: #8B919D; padding: 10px 12px;
  text-align: right; font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
table.dt th.l { text-align: left; }
table.dt th .arr { font-size: .7rem; color: #7B9312; }
table.dt td { padding: 8px 12px; text-align: right; border-bottom: 1px solid #F2F3F6; white-space: nowrap;
  color: var(--ink); background: #fff; font-variant-numeric: tabular-nums; font-weight: 500; }
table.dt td.l { text-align: left; }
table.dt tr:hover td { background: #F8FAF0; }
td .bar { position: relative; display: block; min-width: 110px; height: 18px; background: var(--card-soft); border-radius: 999px; overflow: hidden; }
td .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #E4F3A2, var(--lime-deep)); border-radius: 999px; }
td .bar b { position: relative; z-index: 1; font-style: normal; font-size: .76rem; padding-left: 8px; line-height: 18px; display: block; text-align: left; font-weight: 700; }
.neg { color: var(--red); }
.pos { color: #55800F; }
.tsearch { min-height: 40px; border-radius: 999px; border: 1px solid #E4E6EB; background: var(--card-soft); padding: 8px 16px;
  font-size: .9rem; width: min(340px, 100%); margin-bottom: 10px; font-weight: 500; }
.tsearch:focus { outline: none; border-color: var(--lime-deep); background: #fff; box-shadow: var(--ring); }
.tfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tfoot .cnt { color: var(--muted); font-size: .8rem; }

/* ---------- P&L statement table ---------- */
.plwrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; max-height: 70vh; }
table.pl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; }
table.pl th { position: sticky; top: 0; background: var(--card-soft); color: #8B919D; padding: 10px 12px; text-align: right;
  font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  border-bottom: 1px solid var(--line); z-index: 2; }
table.pl th:first-child { text-align: left; left: 0; z-index: 3; background: var(--card-soft); }
table.pl td { padding: 7px 12px; text-align: right; border-bottom: 1px solid #F2F3F6; white-space: nowrap;
  color: var(--ink); background: white; font-variant-numeric: tabular-nums; font-weight: 500; }
table.pl td:first-child { text-align: left; position: sticky; left: 0; background: white; z-index: 1; }
table.pl tr.sub td { background: #F7F8F2; font-weight: 700; }
table.pl tr.total td { background: var(--lime-soft); font-weight: 800; border-top: 2px solid var(--lime-deep); }
table.pl tr.pct td { color: var(--muted); font-style: italic; font-size: .8rem; }
table.pl tr.ind td:first-child { padding-left: 26px; color: #565C68; }
table.pl td.neg { color: var(--red); }
table.pl td.tot { background: #F7F8F2; font-weight: 700; }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; background: #E7E9EE; border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: transparent; border-radius: 999px; padding: 6px 15px; font-weight: 600;
  color: #707684; font-size: .86rem; }
.seg button.on { background: var(--black); color: #fff; font-weight: 700; }
.controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.controls .lbl { font-size: .72rem; font-weight: 700; color: #A0A5B0; text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }

/* ---------- explorer ---------- */
.ex-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ex-controls label { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #A0A5B0; margin-bottom: 5px; }

/* ---------- segmented cost rows + dot legend ---------- */
.leg { display: flex; flex-wrap: wrap; gap: 13px; margin: 2px 0 10px; font-size: .76rem; font-weight: 600; color: #565C68; }
.leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.srow .snm { flex: 0 0 136px; font-weight: 700; font-size: .84rem; line-height: 1.25; }
.srow .sbar { flex: 1; height: 16px; border-radius: 999px; background: var(--card-soft); overflow: hidden; display: flex; }
.srow .sbar i { height: 100%; }
.srow .spv { flex: 0 0 96px; text-align: right; font-weight: 800; font-size: .82rem; font-family: var(--num-font); }
.srow .spv small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; margin-top: 2px; }
.srow .snm .srsm { display: block; color: var(--muted); font-weight: 500; font-size: .7rem; margin-top: 1px; }
@media (max-width: 640px) { .srow .snm { flex-basis: 96px; font-size: .78rem; } .srow .spv { flex-basis: 78px; } }

/* ---------- upload dropzone ---------- */
.dz { border: 2px dashed #D6D9E0; border-radius: 20px; background: var(--card-soft); padding: 36px 20px 30px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; }
.dz:hover { border-color: var(--lime-deep); background: #FBFDF0; }
.dz:focus-visible { outline: none; border-color: var(--lime-deep); box-shadow: var(--ring); }
.dz.over { border-color: var(--lime-deep); background: var(--lime-soft); }
.dz-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--lime); display: grid; place-items: center;
  margin-bottom: 3px; box-shadow: 0 10px 22px -10px rgba(185, 217, 46, .8); }
.dz-ic svg { width: 23px; height: 23px; stroke: var(--lime-ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dz-t { font-family: var(--num-font); font-weight: 800; font-size: 1.04rem; }
.dz-s { color: var(--muted); font-size: .78rem; max-width: 500px; line-height: 1.55; }
.dz .btn-ghost { margin-top: 8px; }
.dz-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fpill { display: inline-flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid #E4E6EB;
  border-radius: 999px; padding: 7px 8px 7px 15px; font-weight: 600; font-size: .82rem;
  box-shadow: 0 1px 2px rgba(21, 23, 27, .05); }
.fpill .fsz { color: var(--muted); font-weight: 500; font-size: .74rem; }
.fpill .fx { border: none; background: var(--card-soft); color: var(--muted); width: 22px; height: 22px; border-radius: 50%;
  font-size: .95rem; line-height: 1; display: grid; place-items: center; padding: 0; }
.fpill .fx:hover { background: var(--red-soft); color: var(--red); }

/* ---------- data page ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.step { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: none; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-weight: 800;
  display: grid; place-items: center; flex: none; font-size: .85rem; }
code { background: var(--card-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: .85em; }

.foot { color: var(--muted); font-size: .8rem; margin-top: 24px; line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  /* column direction: cross-axis is width, so items must stretch, not flex-start */
  #app { flex-direction: column; align-items: stretch; gap: 10px; margin: 10px auto; }
  .main { width: 100%; }
  .side { position: static; flex: none; width: 100%; min-height: 0; border-radius: 20px; padding: 12px;
    flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; }
  .brand { padding: 0 6px; }
  .brand b { display: none; }
  .snav { flex-direction: row; gap: 4px; }
  .snav button { white-space: nowrap; padding: 9px 12px; }
  .snav button .dot { display: none; }
  .side-card { display: none; }
  .mhead { flex-wrap: wrap; }
  .mhead h1 { font-size: 1.3rem; }
  .who .wt { display: none; }
  .who { padding: 5px 6px; }
  .kpi .v { font-size: 1.5rem; }
}
/* ---------- phones: bottom icon nav, stacked layout ---------- */
@media (max-width: 640px) {
  #app { margin: 8px auto; padding: 0 8px; gap: 8px; }
  .side { display: contents; }
  .brand, .side-card { display: none !important; }
  /* the nav becomes a floating bottom bar of icon buttons */
  .snav { position: fixed; z-index: 90; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    flex-direction: row; justify-content: flex-start; background: var(--card); border-radius: 999px; padding: 7px;
    gap: 2px; box-shadow: 0 14px 34px -8px rgba(21, 23, 27, .4); overflow-x: auto; scrollbar-width: none; }
  .snav::-webkit-scrollbar { display: none; }
  .snav button { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%;
    display: grid; place-items: center; font-size: 0; gap: 0; }
  .snav button svg { width: 20px; height: 20px; opacity: 1; }
  .snav button .dot { display: none; }
  .snav button.on { background: var(--lime); box-shadow: none; }
  .snav button.on svg { stroke: var(--lime-ink); }
  .main { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  /* header */
  .mhead { padding: 6px 2px 12px; gap: 10px; flex-wrap: wrap; }
  .mhead h1 { font-size: 1.3rem; }
  .mhead .sub { display: none; }
  .newpill { padding: 6px 11px; font-size: .72rem; }
  .icbtn { width: 36px; height: 36px; }
  /* filter bar stacks */
  .fbar { padding: 12px 14px; gap: 10px; border-radius: 18px; }
  .flab { width: 100%; }
  .fdiv { display: none; }
  .chip { padding: 7px 12px; font-size: .8rem; }
  .msgrow { flex: 1 1 100%; justify-content: flex-start; }
  .ms-slot { flex: 1 1 100%; max-width: none; }
  .msgrow .btn { flex: 1; }
  .pop { left: 0; right: 0; width: auto; }
  /* cards */
  .card { padding: 16px; border-radius: 18px; margin-bottom: 12px; }
  .grid { gap: 12px; margin-bottom: 12px; }
  .kpis { gap: 10px; margin: 2px 0 12px; }
  .kpi { padding: 16px 16px 12px; border-radius: 20px; }
  .kpi .v { font-size: 1.45rem; }
  .kpi .kic { width: 38px; height: 38px; }
  .kpi .karr { width: 34px; height: 34px; }
  /* big stats stack with a top divider instead of a side one */
  .bigstat { flex: 1 1 100%; padding: 8px 0; }
  .bigstat + .bigstat { border-left: none; border-top: 1px dashed var(--line); padding-left: 0; }
  .bigstat .bv { font-size: 1.5rem; }
  /* bubbles never overflow a narrow screen */
  .bub-wrap { min-height: 160px; }
  .bub { max-width: 37vw; aspect-ratio: 1; height: auto !important; }
  .bub .bv { font-size: .95rem; }
  .prg .pl2 { flex: 0 0 92px; font-size: .78rem; }
  /* tables: tighter cells, horizontal swipe stays */
  table.dt td, table.dt th, table.pl td, table.pl th { padding: 7px 9px; font-size: .8rem; }
  .tsearch { width: 100%; }
  .foot { font-size: .72rem; padding: 0 2px; }
}

@media print {
  .side, .fbar, .btn, .tsearch, .icbtn, .who { display: none !important; }
  body, #app { background: #fff; }
  .card, .kpi { box-shadow: none; border: 1px solid #ddd; }
}
