/* The card views – the look of the owner's mockup (2026-11-29), scoped to #views so the grid keeps its own style. */
#views {
  --ink: #192c2b; --muted: #687976; --line: #dfe7e3; --green: #166852; --deep: #123e33; --mint: #e7f2ec;
  --paper: #fff; --vbg: #f3f6f3; --amber: #94610c; --amberbg: #fff3d9; --blue: #436a91; --bluebg: #eaf1f9;
  --red: #b23e46; --radius: 16px; --shadow: 0 8px 30px #153e2c07; --soft: #f6f9f4;
  background: var(--vbg); color: var(--ink); font-size: 15px; line-height: 1.4; min-height: calc(100vh - 46px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #views {
    --ink: #e4ece8; --muted: #9aaba6; --line: #2d3a36; --green: #4fbf93; --deep: #12352b; --mint: #1d3a30;
    --paper: #1a2320; --vbg: #121a17; --amber: #f0c26b; --amberbg: #3a2f17; --blue: #8fb6e0; --bluebg: #1d2b3a;
    --red: #ff8a8f; --soft: #1f2b27; --shadow: none;
  }
}
body.cards { height: auto; overflow: auto; }

#views h1, #views h2, #views h3, #views p { margin: 0; }
#views h2 { font-size: 18px; letter-spacing: -.3px; }
#views h3 { font-size: 16px; }
#views button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
#views button:disabled { opacity: .35; cursor: default; }
#views .vcontent { max-width: 1480px; margin: 0 auto; padding: 16px 22px 24px; }
#views .v-focus { max-width: none; }
#views .focus-content { max-width: 1436px; margin-inline: auto; }
#views .num { font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
#views .muted, #views .caption { color: var(--muted); }
#views .caption, #views .small { font-size: 12px; }
#views .positive { color: var(--green); }
#views .negative { color: var(--red); }
#views .row { display: flex; align-items: center; gap: 9px; }
#views .row.wrap { flex-wrap: wrap; justify-content: flex-end; }
#views .between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#views .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
#views .pill { display: inline-flex; font-size: 11px; line-height: 1.7; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }
#views .pill.plan, #views .tag.plan { color: var(--amber); background: var(--amberbg); }
#views .pill.fact, #views .tag.fact { color: var(--blue); background: var(--bluebg); }
#views .pill.mixed { color: #6d5c8f; background: #f0edf7; }
#views .pill.empty { color: var(--muted); background: var(--soft); }
#views .tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
#views .vbtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px;
  background: var(--paper); font-size: 13px; font-weight: 550; white-space: nowrap; }
#views .vbtn:hover:not(:disabled) { background: var(--soft); }
#views .vbtn.soft { background: var(--mint); color: var(--green); border-color: transparent; }
#views .vbtn.primary { background: var(--green); color: #fff; border-color: var(--green); }
#views .vbtn.wide { width: 100%; justify-content: center; margin-top: 14px; }
#views .iconbtn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 18px; }
#views .iconbtn:hover:not(:disabled) { background: var(--soft); }
#views .textbtn { font-size: 13px; color: var(--green); padding: 6px 0; }
#views .seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 9px; }
#views .seg button { padding: 4px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
#views .seg button.active { background: var(--paper); box-shadow: 0 1px 4px #203a1a12; font-weight: 600; }
#views .netline { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; min-height: 16px; }

/* overview */
#views .overview { display: grid; grid-template-columns: 1.3fr 2.3fr; gap: 14px; margin-bottom: 14px; }
#views .forecast { background: var(--deep); color: #fff; padding: 16px 20px; border-radius: var(--radius); }
#views .forecast .eyebrow { color: #d0e4d9; font-size: 13px; }
#views .forecast .big { font-size: 29px; font-weight: 620; letter-spacing: -1px; margin: 3px 0; }
#views .forecast .net { font-size: 13px; color: #b7d0c2; }
#views .forecast .delta { margin-top: 9px; font-size: 12px; color: #bfe3c7; }
#views .overview-metrics { padding: 16px 8px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; }
#views .metric { padding: 0 16px; border-right: 1px solid var(--line); min-width: 0; }
#views .metric:last-child { border: 0; }
#views .metric .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
#views .metric strong { display: block; font-size: 22px; font-weight: 600; white-space: nowrap; }
#views .metric .sub { font-size: 11px; color: var(--muted); margin-top: 6px; display: block; }

/* chart */
#views .chart-card { padding: 14px 18px 10px; margin-bottom: 14px; }
#views .chart-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
#views .chart-legend { display: flex; align-items: center; gap: 13px; font-size: 12px; color: var(--muted); }
#views .legend-line { display: inline-block; width: 18px; border-top: 2px solid var(--green); margin-right: 5px; vertical-align: middle; }
#views .legend-line.dashed { border-top-style: dashed; }
#views .legend-line.old { border-color: #b3beb8; }
#views .chart-wrap { position: relative; }
#views .chart { display: block; width: 100%; height: 160px; overflow: visible; }
#views .chart.tall { height: 230px; }
#views .chart text { fill: var(--muted); font-size: 11px; }
#views .chart .gridline { stroke: var(--line); }
#views .chart .mainline { fill: none; stroke: var(--green); stroke-width: 2.5; }
#views .chart .mainline.dashed { stroke-dasharray: 5 4; }
#views .chart .oldline { fill: none; stroke: #b3beb8; stroke-width: 1.6; }
#views .chart .selline { stroke: var(--green); opacity: .35; }
#views .chart .dot, #views .chart .seldot { fill: var(--green); stroke: var(--paper); stroke-width: 2; }
#views .chart .hit { fill: transparent; cursor: pointer; }
#views .chart .hit:focus { outline: none; fill: #2e79591a; }
#views .charttip { position: absolute; top: 6px; background: var(--deep); color: #fff; border-radius: 9px; padding: 7px 11px; font-size: 12px;
  pointer-events: none; z-index: 3; min-width: 150px; }
#views .charttip strong { display: block; font-size: 14px; margin-top: 2px; }
#views .trendline { border-top: 1px solid var(--line); padding-top: 8px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; }
#views .trendline .seg { margin-left: auto; }

/* day rail + daily focus */
#views .days-wrap { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
#views .dayrail { display: flex; gap: 7px; overflow-x: auto; padding: 14px 14px 16px; flex: 1; scrollbar-width: thin; }   /* room for the ripple */
#views .daybtn { flex: 1 0 56px; border-radius: 11px; padding: 6px 4px; background: var(--paper); border: 1px solid var(--line); text-align: center; }
#views .daybtn small { display: block; font-size: 11px; color: var(--muted); }
#views .daybtn strong { display: block; font-size: 18px; line-height: 1.5; font-weight: 600; }
#views .daybtn .day-status { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--amber); }
#views .daybtn.fact .day-status { color: var(--blue); }
#views .daybtn.mixed .day-status { color: #75638c; }
#views .daybtn.empty .day-status { color: var(--muted); }
#views .daybtn.missing .day-status { color: var(--red); }
#views .daybtn.today { box-shadow: inset 0 -3px 0 #e2b93b; }
#views .daybtn.selected { background: var(--green); border-color: var(--green); color: #fff; }
#views .daybtn.selected small, #views .daybtn.selected .day-status { color: #dcece2; }
#views .daybtn[data-missing-day]:not(.selected) { background: var(--missing-fill); border-color: var(--missing-frame); color: var(--missing-ink); }
#views .daybtn[data-day-state="open"] { border-color: var(--open-day-frame); }
/* a past day still open: a pulsing frame plus a ring rippling outwards, to pull the eye there (it should be closed) */
#views .daybtn[data-day-state="past-open"] { animation: day-attention 1.2s ease-out infinite; }
#views .daybtn.selected[data-day-state="past-open"] { animation-name: day-attention-selected; }
@keyframes day-attention {
  0% { box-shadow: inset 0 0 0 2px var(--missing-frame), 0 0 0 0 var(--missing-ripple); background-color: var(--missing-fill); }
  50% { box-shadow: inset 0 0 0 4px var(--missing-frame), 0 0 0 6px var(--missing-ripple-mid); background-color: var(--missing-fill-strong); }
  100% { box-shadow: inset 0 0 0 2px var(--missing-frame), 0 0 0 12px var(--missing-ripple-end); background-color: var(--missing-fill); }
}
@keyframes day-attention-selected {
  0% { box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px var(--missing-frame), 0 0 0 0 var(--missing-ripple); }
  50% { box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 6px var(--missing-frame), 0 0 0 6px var(--missing-ripple-mid); }
  100% { box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px var(--missing-frame), 0 0 0 12px var(--missing-ripple-end); }
}
#views .vbtn.cta { font-weight: 700; padding: 9px 18px; box-shadow: 0 2px 8px #205c4840; }
#views .vbtn.cta:hover:not(:disabled) { background: #174837; }
#views .daybtn.today[data-day-state="open"] {
  --missing-frame: var(--open-day-frame); --missing-frame-soft: var(--open-day-soft);
  animation: missing-fact-frame 1.8s ease-in-out infinite alternate;
}
#views .daybtn[data-day-state="closed"] { border-color: var(--closed-day-frame); box-shadow: inset 0 0 0 1px var(--closed-day-frame); }
#views .daybtn[data-day-state="closed"]:not(.selected) { background: var(--closed-day-fill); }
#views .daybtn[data-day-state="closed"]:not(.selected) .day-status { color: var(--closed-day-frame); }
#views .dayhead { margin-bottom: 16px; text-align: center; }
#views .dayhead .row { justify-content: center; flex-wrap: wrap; }
#views .dayhead h2 { font-size: 36px; line-height: 1.2; }
#views .dayhead .pill { font-size: 22px; line-height: 1.3; }
#views .day-lock-state[data-day-state="open"] { background: var(--amberbg); color: var(--amber); }
#views .day-lock-state[data-day-state="past-open"] { background: var(--missing-fill); color: var(--missing-ink); }
#views .day-lock-state[data-day-state="closed"] { background: var(--closed-day-fill); color: var(--closed-day-frame); }
#views .day-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
#views .shop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#views .shop-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
#views .shop-head { padding: 12px 14px 8px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
#views .shop-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 650; font-size: 14px;
  background: var(--shopbg); color: var(--shopink); flex-shrink: 0; }
#views .shop-name { font-size: 15px; font-weight: 650; }
#views .shop-body { padding: 0 14px 10px; }
#views .input-label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
#views .money-edit { display: flex; align-items: center; border: 1px solid var(--line); background: var(--soft); border-radius: 9px; padding: 4px 9px; gap: 5px; }
#views .money-edit:focus-within { border-color: #619b82; box-shadow: 0 0 0 3px #e5efe955; }
#views .money-edit small { font-size: 12px; color: var(--muted); }
#views input.money { background: none; border: 0; width: 100%; min-width: 0; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums;
  outline: 0; }
#views input.money.big { font-size: 22px; font-weight: 600; }
#views input.money.plan { font-style: italic; color: var(--amber); }
#views input.money::placeholder { color: var(--muted); opacity: .8; font-style: italic; font-weight: 400; font-size: 13px; }
#views .ad-heading { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
#views .ad-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 40%); align-items: start; gap: 6px; padding: 4px 0; }
#views .ad-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
#views .ad-label { font-size: 13px; overflow-wrap: anywhere; }
#views .ad-controls { display: inline-flex; gap: 3px; flex-shrink: 0; }
#views .row-plus, #views .row-minus { min-width: 28px; min-height: 28px; padding: 0; border-radius: 6px; flex-shrink: 0;
  font-size: 17px; line-height: 1; }
#views .row-plus { background: var(--mint); color: var(--green); }
#views .row-minus { background: var(--soft); color: var(--red); }
#views .row-plus:focus-visible, #views .row-minus:focus-visible { outline: 2px solid var(--cur); outline-offset: 1px; }
#views .ad-amount input.money { font-size: 14px; border: 1px solid transparent; background: var(--soft); padding: 3px 6px; border-radius: 5px; }
#views .ad-amount input.money:focus { border-color: #619b82; }
#views .ad-amount .netline { text-align: right; font-size: 11px; }
#views .shop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 4px 0; }
#views .shop-actions .textbtn { padding: 6px 0; }
#views .save-feedback { color: var(--muted); font-size: 11px; }
#views .ad-total { display: flex; justify-content: space-between; align-items: flex-start; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 12px; }
#views .ad-total strong { font-size: 14px; font-weight: 600; }
#views .ad-total .netline { text-align: right; }
#views .mini-roas { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
#views .mini-roas b { font-size: 13px; color: var(--ink); }
#views .purchase-chip { width: 100%; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; padding: 8px 0 0; }
#views .purchase-chip:hover:not(:disabled) { color: var(--green); }
#views .shop-profit { background: var(--mint); border-top: 1px solid var(--line); padding: 10px 14px; }
#views .shop-profit .label { font-size: 12px; }
#views .shop-profit strong { font-size: 17px; color: var(--green); font-weight: 650; }
#views .shop-profit strong.negative { color: var(--red); }
#views .daily-total { margin: 14px 0; border: 1px solid var(--line); padding: 14px 18px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; background: var(--mint); border-radius: 14px; }
#views .daily-total .label { font-size: 12px; color: var(--muted); }
#views .daily-total strong { display: block; font-size: 20px; font-weight: 600; margin-top: 3px; }
#views .daily-total .total-profit { border-left: 1px solid var(--line); padding-left: 18px; }

/* week + shops */
#views .week-nav { margin-bottom: 12px; }
#views .week-nav-centered { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
#views .week-nav-centered .week-pager { justify-content: center; }
#views .week-nav-centered .iconbtn { width: 42px; height: 42px; background: var(--paper);
  border: 1px solid var(--line); font-size: 24px; }
#views .week-nav-centered .vbtn { min-height: 42px; }
#views .week-board { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 9px; overflow-x: auto; padding-bottom: 6px; }
#views .weekday-card { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; overflow: hidden; min-width: 130px; }
#views .weekday-card.selected { border-color: #79a48d; box-shadow: 0 0 0 2px #d6e7dc66; }
#views .weekday-card.today header { box-shadow: inset 0 -3px 0 #e2b93b; }
#views .weekday-card header { padding: 10px 11px; background: var(--soft); border-bottom: 1px solid var(--line); }
#views .weekday-card .date { font-size: 24px; font-weight: 550; }
#views .weekday-card .day-name { font-size: 12px; color: var(--muted); }
#views .day-sum { padding: 11px; }
#views .day-sum .label, #views .profit-band .label { font-size: 11px; color: var(--muted); }
#views .day-sum strong { font-size: 16px; display: block; font-weight: 600; margin-top: 2px; }
#views .day-sum .netline { font-size: 11px; }
#views .day-sum .spacer { height: 8px; }
#views .mini-shops { padding: 0 11px 9px; }
#views .mini-shop { padding: 6px 0; display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--line); font-size: 11px; }
#views .mini-shop .shop-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--shopink); flex-shrink: 0; }
#views .mini-shop strong { margin-left: auto; font-weight: 550; white-space: nowrap; }
#views .profit-band { background: var(--mint); padding: 10px 11px; }
#views .profit-band strong { display: block; color: var(--green); font-size: 17px; margin-top: 3px; }
#views .edit-day { padding: 8px 11px; display: block; width: 100%; color: var(--green); font-size: 12px; border-top: 1px solid var(--line); text-align: center; }
#views .week-footer { margin: 12px 0 14px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
#views .week-footer .numbers { display: flex; gap: 30px; flex-wrap: wrap; }
#views .week-footer .numbers strong { font-size: 19px; display: block; }
#views .week-footer .numbers .label { font-size: 12px; color: var(--muted); }
#views .shop-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 14px; }
#views .shop-column { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
#views .column-head { padding: 14px 16px; background: var(--shopbg); color: #233; border-bottom: 1px solid var(--line); }
#views .column-head .muted, #views .column-head .label { color: #5b6a5b; }
#views .column-head .shop-avatar { background: #ffffffb0; }
#views .column-head .label { font-size: 12px; margin-top: 10px; }
#views .column-total { font-size: 25px; font-weight: 600; margin-top: 2px; }
#views .column-roas { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: #5b6a5b; }
#views .column-roas strong { color: var(--shopink); }
#views .column-day { display: block; width: 100%; padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; }
#views .column-day:hover { background: var(--soft); }
#views .column-day.selected { background: var(--mint); box-shadow: inset 3px 0 var(--green); }
#views .column-day .d { font-size: 12px; font-weight: 600; }
#views .column-day .pillrow { margin-top: 4px; }
#views .column-day strong { font-size: 15px; font-weight: 600; }
#views .column-day .right { text-align: right; }
#views .column-day .netline { font-size: 11px; }
#views .column-day .mini-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
#views .column-day .mini-meta b { font-weight: 550; color: var(--green); }
#views .column-foot { padding: 10px 14px; color: var(--muted); font-size: 11px; }

/* dashboard */
#views .dashboard { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
#views .dashboard .chart-card { margin: 0; }
#views .dash-left { display: flex; flex-direction: column; gap: 14px; }
#views .dash-stores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
#views .dash-store { text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 13px; padding: 13px; }
#views .dash-store:hover { border-color: #89b49b; }
#views .dash-store .label { font-size: 12px; color: var(--muted); margin-top: 10px; }
#views .dash-store .dvalue { font-size: 23px; font-weight: 600; margin-top: 2px; }
#views .dash-store .bottom { display: flex; justify-content: space-between; font-size: 12px; border-top: 1px solid var(--line); padding-top: 9px; margin-top: 10px; color: var(--muted); }
#views .dash-focus { padding: 18px; }
#views .dash-focus h2 { font-size: 24px; margin-top: 3px; }
#views .dash-focus > .caption { margin: 4px 0 14px; display: block; }
#views .dash-total { background: var(--mint); border-radius: 12px; padding: 13px; margin: 10px 0; }
#views .dash-total .label { font-size: 12px; color: var(--muted); }
#views .dash-total strong { font-size: 26px; color: var(--green); font-weight: 600; display: block; margin-top: 3px; }
#views .dash-shop-row { display: flex; align-items: center; padding: 9px 0; gap: 9px; border-bottom: 1px solid var(--line); }
#views .dash-shop-row .shop-name { font-size: 13px; }
#views .dash-shop-row .right { text-align: right; margin-left: auto; }
#views .dash-shop-row strong { font-size: 14px; font-weight: 550; }
#views .compare-box { padding: 16px 18px; }
#views .compare-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding-top: 11px; gap: 10px; }
#views .compare-row strong { font-size: 15px; font-weight: 600; }
#views .mini-progress { height: 5px; background: var(--soft); border-radius: 4px; margin-top: 6px; }
#views .mini-progress span { display: block; height: 100%; background: #9fb8a9; border-radius: 4px; }
#views .mini-progress span.now { background: var(--green); }

@media (max-width: 1150px) {
  #views .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #views .dashboard { grid-template-columns: minmax(0, 1.4fr) 300px; }
  #views .overview { grid-template-columns: 1.15fr 1.9fr; }
}
@media (max-width: 800px) {
  #views .vcontent { padding: 12px 12px 20px; }
  #views .overview, #views .dashboard { grid-template-columns: 1fr; }
  #views .daily-total { grid-template-columns: repeat(2, 1fr); }
  #views .daily-total .total-profit { border-left: 0; padding-left: 0; }
  #views .dash-focus { order: -1; }
}
@media (max-width: 520px) {
  #views .week-nav-centered { grid-template-columns: 1fr; text-align: center; }
  #views .shop-grid { grid-template-columns: 1fr; }
  #views .overview-metrics { grid-template-columns: 1fr; padding: 4px 14px; }
  #views .metric { padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  #views .forecast .big { font-size: 25px; }
  #views .days-wrap > .iconbtn { display: none; }
  #views .dash-stores { grid-template-columns: 1fr 1fr; }
  #views .dash-store .dvalue { font-size: 19px; }
  #views .shop-board { grid-template-columns: repeat(4, 240px); }
}
