/* 「오늘 한눈에」 — 색은 tokens.css 변수만 */

/* ── 첫 띠: 오늘 돈 흐름 ───────────────────────────── */
.screen-home .hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--sp-6); align-items: center; }
.screen-home .hero-num { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.screen-home .hero-label { font-size: var(--fs-13); color: var(--muted); font-weight: 500; }
.screen-home .hero-main { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--ink); border-radius: var(--r-btn); }
.screen-home .hero-main:hover .hero-value { text-decoration: underline; text-decoration-color: var(--filament); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.screen-home .hero-value { font-size: var(--fs-40); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.screen-home .hero-verdict { font-size: var(--fs-14); color: var(--ink); line-height: 1.6; padding-top: var(--sp-2); border-top: 1px solid var(--line); align-self: stretch; }
.screen-home .hero-chart { cursor: pointer; min-width: 0; }
.screen-home .hero-all { font-size: var(--fs-13); color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--filament); text-underline-offset: 3px; }
.screen-home .hero-all b { font-weight: 600; color: var(--ink); }
/* 입금·출금 막대: 파랑·빨강 대신 먹 계열(입금)과 흐린 회청(출금) — 총괄 결정 3. 방향은 +/− 글자로 */
.screen-home .hero-chart svg [style*="--c-up"] { fill: var(--c-series-2) !important; }
.screen-home .hero-chart svg [style*="--c-down"] { fill: var(--c-series-3) !important; }
.screen-home .hero-chart .chart-legend i[style*="--c-up"] { background: var(--c-series-2) !important; }
.screen-home .hero-chart .chart-legend i[style*="--c-down"] { background: var(--c-series-3) !important; }

/* ── 질문판 공통 ───────────────────────────────────── */
.screen-home .q-body { gap: var(--sp-4); }
.screen-home .q-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; }
.screen-home .q-say { font-size: var(--fs-13); color: var(--ink-2); }
.screen-home .q-sub { font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; margin-top: 2px; }
.screen-home .q-sub-inline { display: block; font-size: var(--fs-12); margin-bottom: 2px; }
.screen-home .q-facts { display: flex; gap: var(--sp-5); flex-wrap: wrap; align-items: flex-end; padding: var(--sp-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.screen-home .q-fact { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-12); min-width: 0; }
.screen-home .q-fact b { font-size: var(--fs-16); font-weight: 600; color: var(--ink); }
.screen-home .q-fact-wide { flex: 1 1 220px; }
/* 둘째 줄 사실(계산서 금일·전일 등) — 위 줄 밑선을 같이 쓴다 */
.screen-home .q-facts + .q-facts { border-top: 0; padding-top: 0; }

/* 사업부 줄(달성 · 수익률) */
.screen-home .q-list, .screen-home .mg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.screen-home .q-row, .screen-home .mg-row {
  display: grid; grid-template-columns: minmax(120px, 34%) minmax(60px, 1fr) minmax(96px, auto); align-items: center; gap: var(--sp-3);
  width: 100%; padding: 6px 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); font-size: var(--fs-13);
  border-radius: 4px;
}
.screen-home .q-list li + li .q-row, .screen-home .mg-list li + li .mg-row { border-top: 1px dashed var(--line); }
.screen-home .q-row:hover .q-name, .screen-home .mg-row:hover .q-name { text-decoration: underline; text-decoration-color: var(--filament); text-underline-offset: 3px; }
.screen-home .q-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.screen-home .q-val { text-align: right; white-space: nowrap; font-weight: 500; }
.screen-home .q-pct { font-weight: 600; color: var(--ink); display: inline-block; min-width: 36px; }

.screen-home .mg-track { position: relative; height: 8px; background: var(--paper); border-radius: 2px; }
.screen-home .mg-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-actual); border-radius: 0 2px 2px 0; }
.screen-home .mg-goal { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--c-target); border-radius: 1px; }
.screen-home .mg-key { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; color: var(--muted); font-size: var(--fs-12); margin-left: auto; }
.screen-home .mg-key i { display: inline-block; width: 2px; height: 12px; background: var(--c-target); border-radius: 1px; }

/* 미수 연령 한 줄 */
.screen-home .ag { display: flex; flex-direction: column; gap: var(--sp-2); }
.screen-home .ag-bar { display: flex; gap: 2px; height: 14px; border-radius: 3px; overflow: hidden; }
.screen-home .ag-seg { flex-basis: 0; min-width: 3px; }
.screen-home .a1 { background: var(--c-series-4); }
.screen-home .a2 { background: var(--c-series-3); }
.screen-home .a3 { background: var(--c-series-2); }
.screen-home .a4 { background: var(--c-series-1); }
.screen-home .ag-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); font-size: var(--fs-12); }
.screen-home .ag-legend li { display: grid; grid-template-columns: 10px 1fr; column-gap: 6px; align-items: center; color: var(--ink-2); }
.screen-home .ag-legend b { grid-column: 2; font-size: var(--fs-14); font-weight: 600; color: var(--ink); }
.screen-home .ag-legend .muted { grid-column: 2; }
.screen-home .ag-dot { width: 10px; height: 10px; border-radius: 2px; }

/* 구매·생산·출고 */
.screen-home .ops-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.screen-home .ops-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: var(--sp-4); align-items: center; padding: var(--sp-3) 0; }
.screen-home .ops-row + .ops-row { border-top: 1px solid var(--line); }
.screen-home .ops-row:first-child { padding-top: 0; }
.screen-home .ops-main { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; min-width: 0; border-radius: var(--r-btn); }
.screen-home .ops-main:hover .ops-value { text-decoration: underline; text-decoration-color: var(--filament); text-underline-offset: 4px; }
.screen-home .ops-value { font-size: var(--fs-28); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.screen-home .ops-side { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.screen-home .ops-spark { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.screen-home .ops-prog { font-size: var(--fs-12); color: var(--muted); white-space: nowrap; }

/* ── 다음 결제·만기 ────────────────────────────────── */
.screen-home .due { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sp-6); }
.screen-home .due-col { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.screen-home .due-loans { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.screen-home .due-loan { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-13); }
.screen-home .due-loan b { font-weight: 600; }
.screen-home .due-loan-r { text-align: right; }
.screen-home .due-loan-r .num { font-weight: 600; }
.screen-home .due-none { font-size: var(--fs-14); color: var(--ink-2); padding: var(--sp-3) var(--sp-4); background: var(--paper); border-radius: var(--r-btn); }

/* ── 반응형 ────────────────────────────────────────── */
@media (max-width: 1023px) {
  .screen-home .hero { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .screen-home .due { grid-template-columns: minmax(0, 1fr); }
  /* 태블릿부터 판 폭이 240px 안팎 — 사업부 줄을 두 줄(이름·숫자 / 아래 계기)로 */
  .screen-home .q-row, .screen-home .mg-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .screen-home .q-row .fil, .screen-home .mg-track { grid-column: 1 / -1; grid-row: 2; }
  .screen-home .q-val { min-width: 0; }
  .screen-home .q-kpis { gap: var(--sp-3); }
  .screen-home .ag-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-home .ops-value { font-size: var(--fs-20); }
  .screen-home .ops-row { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .screen-home .ops-spark { align-items: flex-start; }
}
@media (max-width: 767px) {
  .screen-home .hero-value { font-size: var(--fs-40); }
  .screen-home .q-kpis { gap: var(--sp-3); }
  .screen-home .q-fact-wide { flex-basis: 100%; }
  .screen-home .ops-row { grid-template-columns: minmax(0, 1fr) 132px; gap: var(--sp-3); }
}
