/* Home dashboard, 3rd round (2026-10-19) — one block per store with flat rows (결과 · 원인 · 성과 꼬리표 · 일별), a right
   rail (products like a holdings list + the month calendar). No boxes inside boxes, no prose; definitions behind (i).
   Follows the V1 theme tokens in base.css / theme.css. Channel colours = one purple family (classes, not inline styles:
   the CSP blocks style attributes). */
.dash { --dash-grid: #eae8ef; --ch-0: #7452cf; --ch-1: #a992e8; --ch-2: #cdbff3; --ch-3: #e3dbf7; --ch-4: #5b3fae; --ch-5: #8f78d8; --ch-6: #b9a8ea; --ch-7: #d7ccf4; }
:root[data-theme="dark"] .dash { --dash-grid: #2c2b36; --ch-0: #8d6ee0; --ch-1: #6f54b8; --ch-2: #524089; --ch-3: #3c3163; --ch-4: #b9a0ff; --ch-5: #7d62cf; --ch-6: #5e4aa0; --ch-7: #463a77; }
.dash-ch-0 { fill: var(--ch-0); background: var(--ch-0); } .dash-ch-1 { fill: var(--ch-1); background: var(--ch-1); } .dash-ch-2 { fill: var(--ch-2); background: var(--ch-2); } .dash-ch-3 { fill: var(--ch-3); background: var(--ch-3); }
.dash-ch-4 { fill: var(--ch-4); background: var(--ch-4); } .dash-ch-5 { fill: var(--ch-5); background: var(--ch-5); } .dash-ch-6 { fill: var(--ch-6); background: var(--ch-6); } .dash-ch-7 { fill: var(--ch-7); background: var(--ch-7); }
.dash .muted { color: var(--muted); }
.dash .empty { padding: 34px 20px; }
.dash .empty.small { padding: 14px 0; font-size: 12px; text-align: left; }
/* two columns: store blocks left, products + calendar right */
.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dash-main { min-width: 0; }
.dash-side { min-width: 0; display: grid; gap: 18px; align-content: start; }
/* (i) definitions on hover / focus */
.dash-i { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 9px; font-style: italic; font-weight: 700; margin-left: 5px; cursor: help; position: relative; vertical-align: middle; flex: none; }
.dash-i::after { content: attr(data-tip); position: absolute; left: 18px; top: 50%; transform: translateY(-50%); background: var(--ink); color: var(--white); border-radius: 8px; padding: 6px 10px; font-size: 11px; font-style: normal; font-weight: 400; line-height: 1.5; width: max-content; max-width: 320px; white-space: normal; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 6; }
.dash-i:hover::after, .dash-i:focus::after { opacity: 1; }
.dash-i:focus { outline: none; border-color: var(--accent); }
/* store block: head line then flat rows separated by one thin line each */
.dash-block { margin-bottom: 18px; padding: 0; }
.dash-block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px 12px; border-bottom: 1px solid var(--line); }
.dash-block-head .dash-co { font-size: 13px; padding: 4px 10px; }
.dash-block-when { font-size: 13px; font-weight: 650; color: var(--ink); }
.dash-block-cmp, .dash-block-note { font-size: 11px; color: var(--muted); }
.dash-co { font-size: 10px; padding: 2px 6px; border-radius: 5px; font-weight: 600; white-space: nowrap; display: inline-block; }
.dash-co-1 { background: #e3f3ee; color: #2f7a65; }
.dash-co-2 { background: #ebe8fb; color: #5a4fb0; }
.dash-co-3 { background: #e6eefb; color: #2f5fa3; }
.dash-co-4 { background: #fbebe3; color: #b0552e; }
:root[data-theme="dark"] .dash-co-1 { background: #0f3d31; color: #9fe1cb; }
:root[data-theme="dark"] .dash-co-2 { background: #2a2560; color: #cecbf6; }
:root[data-theme="dark"] .dash-co-3 { background: #0f3560; color: #b5d4f4; }
:root[data-theme="dark"] .dash-co-4 { background: #4a2414; color: #f5c4b3; }
.dash-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); align-items: start; }
.dash-row:last-child { border-bottom: 0; }
.dash-row-label { font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; padding-top: 4px; }
.dash-row-label small { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.dash-row-body { min-width: 0; display: grid; gap: 8px; }
.dash-stockout { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.dash-stockout ul { margin: 4px 0; padding-left: 18px; }
.dash-stockout small { display: block; color: var(--muted); font-size: 11px; }
/* metrics: a flat line, thin vertical dividers, label (i) / value / change / compared value */
.dash-ms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-m { min-width: 0; padding: 2px 16px 2px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label label" "value vs" "under under"; align-items: center; gap: 1px 8px; border-left: 1px solid var(--line); padding-left: 16px; }
.dash-m:first-child { border-left: 0; padding-left: 0; }
.dash-m > small { grid-area: label; font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; }
.dash-m > b { grid-area: value; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.25; letter-spacing: -.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-m > b i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.dash-m .dash-vs { grid-area: vs; justify-self: end; }
.dash-m-under { grid-area: under; font-size: 11px; color: var(--muted); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-vs { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-vs.good { color: var(--green); }
.dash-vs.bad { color: var(--red); }
.dash-vs.flat { color: var(--muted); font-weight: 500; }
.dash-vs.note { color: var(--accent); }
/* 성과 꼬리표: counts on one line, lists only behind 전체 보기 */
.dash-tags-line { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding-top: 3px; }
.dash-tag-n { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.dash-tag-n b { color: var(--ink); font-weight: 600; }
.dash-all { margin-left: auto; font-size: 11.5px; color: var(--accent); font-weight: 600; white-space: nowrap; padding: 2px 0; }
.dash-all:hover { text-decoration: underline; }
.dash-tag-lists { display: grid; gap: 0 22px; padding-top: 6px; }
.dash-tag-lists-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-tag-lists-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-tag-col { min-width: 0; }
.dash-sub { font-size: 11px; color: var(--muted); padding: 4px 0 6px; border-bottom: 1px solid var(--line); }
.dash-sub b { color: var(--ink); font-size: 12px; }
.dash-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.dash-check:last-child { border-bottom: 0; }
.dash-check-media { flex: none; }
.dash-check-body { min-width: 0; flex: 1; }
.dash-check-body strong { display: block; font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.dash-check-body small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.dash-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-thumb-empty { display: grid; place-items: center; font-weight: 700; color: var(--accent); background: var(--accent-bg); }
.dash-thumb.small { width: 34px; height: 42px; border-radius: 6px; font-size: 13px; flex: none; }
/* daily trend */
.dash-row-chart .dash-row-body { gap: 4px; }
.dash-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-segs { display: flex; gap: 2px; background: var(--bg); border-radius: 8px; padding: 2px; flex: none; }
.dash-seg { font-size: 12px; padding: 5px 12px; color: var(--muted); border-radius: 6px; white-space: nowrap; flex: none; }
.dash-seg.on { background: var(--white); color: var(--accent); font-weight: 650; box-shadow: 0 1px 4px #22222214; }
.chart-legend { margin: 0; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin: 0 12px 0 0; }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; margin: 0; }
.dash-chart-wrap { position: relative; }
.dash-chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: none; }
.dash-chart text { font: 11px Pretendard, system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.dash-chart .dash-day { fill: var(--ink); font-weight: 500; }
.dash-chart .dash-dow { font-size: 10px; }
.dash-chart .dash-day.wk, .dash-chart .dash-dow.wk { fill: var(--muted); }
.dash-chart .dash-grid { stroke: var(--dash-grid); stroke-width: 1; }
.dash-chart .dash-baseline { stroke: var(--line); stroke-width: 1; }
.dash-chart .dash-bar { transition: opacity .15s; }
.dash-chart .dash-bar.prov { opacity: .5; }
.dash-chart .dash-bar.dim { opacity: .35; }
.dash-chart .dash-cross { stroke: var(--muted); stroke-width: 1; pointer-events: none; }
.dash-chart .dash-cross[hidden] { display: none; }
.dash-tip { position: absolute; top: 6px; left: 8px; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.7; box-shadow: 0 6px 20px #22222218; pointer-events: none; z-index: 3; white-space: nowrap; }
.dash-tip.right { left: auto; right: 8px; }
.dash-tip-date { color: var(--muted); margin-bottom: 2px; }
.dash-tip b { font-weight: 650; font-variant-numeric: tabular-nums; }
.dash-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.dash-table-toggle { font-size: 11px; color: var(--muted); }
.dash-table-toggle summary { cursor: pointer; padding: 4px 0; }
.dash-table-toggle table { font-variant-numeric: tabular-nums; }
.dash-table-toggle .table-wrap { max-height: 260px; overflow: auto; }
/* right rail: products like a holdings list */
.dash-rail { padding: 0 0 6px; }
.dash-rail-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.dash-rail-head h2 { font-size: 14px; display: inline-flex; align-items: center; }
.dash-rail-head .dash-all { margin-left: auto; }
.dash-rail-tabs { margin: 0 16px 6px; }
.dash-rail-tabs .dash-seg { flex: 1; text-align: center; }
.dash-prow { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); }
.dash-prow-body { min-width: 0; flex: 1; }
.dash-prow-body strong { display: block; font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.dash-prow-body small { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dash-ptag { color: var(--accent); font-weight: 600; }
.dash-prow-num { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.dash-prow-num b { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.dash-prow-num small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
/* month calendar in the rail */
.mcal-nav { display: flex; gap: 2px; }
.mcal-nav .iconbtn { width: 26px; height: 26px; font-size: 14px; }
.mcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 0 16px; }
.mcal-wd { font-size: 10px; color: var(--muted); text-align: center; padding: 5px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mcal-day { min-height: 52px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px; font-size: 10px; overflow: hidden; }
.mcal-day.blank { background: var(--bg); }
.mcal-day.today { background: var(--accent-bg); }
.mcal-date { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 10.5px; color: var(--ink); padding: 0; }
.mcal-day.today .mcal-date { background: var(--accent); color: #fff; font-weight: 700; }
button.mcal-date:hover { background: var(--accent-bg); }
.mcal-ev { display: block; width: 100%; border: 0; border-radius: 3px; background: var(--accent-bg); color: var(--accent); font-size: 9px; text-align: left; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.mcal-ev.task { color: var(--muted); background: var(--bg); }
.mcal-more { display: block; font-size: 9px; color: var(--muted); padding: 1px 4px; }
.mcal-note { font-size: 10.5px; padding: 8px 16px 6px; }
/* stock widget (에드모어, a store chosen): product rows with tags, every option on open */
#dash-stock { margin-bottom: 18px; }
#dash-stock .panel-head { align-items: center; gap: 12px; }
#dash-stock .panel-head .subtitle { font-size: 11px; margin-top: 4px; color: var(--muted); }
#dash-stock .panel-head .dash-segs { flex: none; }
.dash-level { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dash-level-red { background: var(--red); }
.dash-level-yellow { background: var(--orange); }
.dash-product > summary { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 20px; font-size: 12px; cursor: pointer; border-top: 1px solid var(--line); list-style: none; color: var(--ink); }
.dash-product > summary::-webkit-details-marker { display: none; }
.dash-product > summary:hover, .dash-product[open] > summary { background: var(--accent-bg); }
.dash-product-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-product-name::before { content: '▸'; color: var(--muted); margin-right: 8px; }
.dash-product[open] > summary .dash-product-name::before { content: '▾'; }
.dash-product-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.dash-product-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dash-product-extra { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-options { padding: 4px 20px 10px 44px; display: grid; gap: 2px; }
.dash-option { display: grid; grid-template-columns: minmax(0, 1.6fr) 70px 90px 80px 90px 90px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 11.5px; padding: 6px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dash-option:first-child { border-top: 0; }
.dash-option.off { opacity: .55; }
.dash-option b { font-weight: 600; }
.dash-option-tag { text-align: right; }
.dash-negative { padding: 6px 20px 10px; }
.dash-more { font-size: 11px; padding: 8px 0 2px; color: var(--muted); }
#dash-stock .dash-more { padding: 10px 20px 16px; }
/* footer line */
.dash-wheel { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 10px 16px; font-size: 11px; color: var(--muted); }
.dash-wheel a { color: var(--accent); }
.dash-wheel-sep { opacity: .5; }
.dash-wheel-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.dash-run { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.dash-run-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 3px; }
.dash-run-dot.ok { background: var(--green); }
.dash-run-dot.bad { background: var(--red); }
/* dark theme tweaks: base.css hard-codes a few light inks */
:root[data-theme="dark"] .dash th, :root[data-theme="dark"] .dash td { color: var(--muted); }
:root[data-theme="dark"] .dash th { background: var(--bg); border-color: var(--line); }
:root[data-theme="dark"] .dash td { border-color: var(--line); }
:root[data-theme="dark"] .dash td strong { color: var(--ink); }
:root[data-theme="dark"] .dash .badge { background: var(--accent-bg); color: var(--accent); }
:root[data-theme="dark"] .dash .badge.green { background: #0f2e1c; color: #4ade80; }
:root[data-theme="dark"] .dash .badge.red { background: #3a1515; color: #f87171; }
:root[data-theme="dark"] .dash .badge.orange { background: #2d2308; color: #fbbf24; }
:root[data-theme="dark"] .dash .badge.gray { background: var(--bg); color: var(--muted); }
:root[data-theme="dark"] .dash .btn { background: var(--white); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .dash-i::after { background: #000; color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 1280px) { .dash-layout { grid-template-columns: 1fr; } .dash-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } .dash-m > b { font-size: 19px; } }
@media (max-width: 960px) {
  .dash-row { grid-template-columns: 1fr; gap: 8px; }
  .dash-row-label small { display: inline; margin-left: 6px; }
  .dash-tag-lists-3, .dash-tag-lists-2 { grid-template-columns: 1fr; }
  .dash-side { grid-template-columns: 1fr; }
  .dash-product > summary { grid-template-columns: 1fr 1fr; }
  .dash-product-name { grid-column: 1 / -1; }
  .dash-option { grid-template-columns: 1fr 1fr 1fr; }
  .dash-options { padding-left: 20px; }
}
@media (max-width: 720px) {
  .dash-row { padding: 12px 15px; }
  .dash-block-head { padding: 14px 15px 10px; }
  .dash-ms { grid-template-columns: 1fr; gap: 8px; }
  .dash-m { border-left: 0; padding-left: 0; }
  .dash-chart-head { flex-direction: column; align-items: flex-start; }
}
