/* 경영/통계 화면 모양: 왼쪽 메뉴 나무 170px, 오른쪽 내용 */
.stats { display: grid; contain: size; grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 6px; }
.stats-nav { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; }
.stats-group { background: #fff; border: 1px solid var(--line); padding: 2px 0 3px; flex: 0 0 auto; }
.stats-group-title { font-weight: 700; padding: 1px 6px 2px; white-space: nowrap; }
.stats-item { display: block; width: 100%; height: 19px; line-height: 17px; text-align: left; border: 1px solid transparent; background: none; padding: 0 4px 0 22px; cursor: pointer; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-item::before { content: ""; position: absolute; left: 11px; top: -1px; height: 10px; width: 8px; border-left: 1px dotted #7d8798; border-bottom: 1px dotted #7d8798; }
.stats-item:hover { background: var(--hover); }
.stats-item.on { background: var(--blue-soft); border-color: #a9c0e6; font-weight: 700; }

.stats-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.stats-view { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }
.stats-head { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); padding: 3px 6px; min-height: 32px; flex: 0 0 auto; flex-wrap: wrap; }
.stats-title { font-weight: 700; font-size: 13px; white-space: nowrap; margin-right: 4px; }
.stats-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }
.stats-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; background: #fff; border: 1px solid var(--line); padding: 3px 8px; min-height: 26px; flex: 0 0 auto; }
.stats-sumitem b { font-variant-numeric: tabular-nums; }
.stats-cols { flex: 1 1 auto; display: flex; gap: 6px; min-height: 0; min-width: 0; }
.stats-side { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }
.stats-pad { padding: 10px; }
.stats-how { color: var(--muted); font-size: 11px; padding: 2px 6px 4px; line-height: 1.4; }
.stats-subtitle { font-weight: 700; padding: 3px 6px; background: #f1f4f8; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stats-clip { display: block; max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.stats .grid-wrap { border: 0; }
.stats table.grid td { white-space: nowrap; }
.stats table.grid tr.stats-total td { background: #f1f4f8; font-weight: 700; border-top: 1px solid var(--line); position: sticky; bottom: 0; }
.stats table.grid tr.stats-warn td { background: #fdf3f1; }
.stats table.grid tr.stats-sun td:first-child { color: var(--red); }

/* 가로 막대: 높이 14px, 색 두 가지(파랑, 주황) */
.stats-barcell { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.stats-barcell > span { flex: 0 0 auto; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.stats-bar { flex: 1 1 auto; height: 14px; display: flex; background: #eef1f5; min-width: 40px; }
.stats-bar i { display: block; height: 14px; background: var(--blue); }
.stats-bar i.b2 { background: var(--orange); }
.stats-bar i.gap { background: #fff; flex: 0 0 auto; }
.stats-legend { display: inline-flex; align-items: center; gap: 4px; }
.stats-legend i { display: inline-block; width: 12px; height: 12px; background: var(--blue); margin-left: 6px; }
.stats-legend i.b2 { background: var(--orange); }

/* 요약 표 */
.stats-kv { width: 100%; }
.stats-kv th { text-align: left; width: 46%; }
.stats-kv td { white-space: nowrap; }
.stats-kv.inline th { width: auto; }
.stats-money { table-layout: fixed; }
.stats-money th { text-align: center; }
.stats-money th.g { width: 78px; background: #e7ecf3; font-weight: 700; white-space: normal; word-break: keep-all; }
.stats-money td { white-space: nowrap; }
.stats-money tr.sum th, .stats-money tr.sum td { background: #f6f8fb; font-weight: 700; }
.stats-money .inp { min-height: 22px; text-align: right; }
.stats-money textarea.inp { text-align: left; resize: none; }

/* 일일 장부: 위에 달력, 수입, 지출, 결산이 나란히. 아래에 수입 내역과 지출 내역이 나란히 */
.stats-daily { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.stats-daily-top { display: grid; grid-template-columns: 200px minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: 6px; flex: 0 0 auto; }
.stats-daily-top .panel-body { overflow: hidden; display: flex; flex-direction: column; }
.stats-daily-top .panel-body > .stats-money, .stats-daily-top .stats-stack, .stats-daily-top .stats-desk { flex: 1 1 auto; }
.stats-stack { display: flex; flex-direction: column; }
.stats-stack > .stats-money:first-child { flex: 4 1 auto; }
.stats-stack > .stats-money { flex: 2 1 auto; }
.stats-desk > .stats-money { flex: 1 1 auto; }
.stats-cal .cal { height: 100%; }
.stats-cal .cal-day { padding: 2px 0; }
.stats-desk { display: flex; flex-direction: column; gap: 4px; }
.stats-desk > .row { padding: 0 6px 4px; }
.stats-daily-bottom { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 6px; min-height: 0; }
.stats-daily-bottom > .col { min-width: 0; }
.stats-month { display: grid; grid-template-columns: 1fr 1fr; }
.stats-month > .stats-money { height: 100%; }

/* 경영 분석: 한 화면에 묶음 다섯 개 */
.stats-mg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.stats-mg > .panel.wide { grid-column: span 2; }
.stats-mg-body { display: flex; flex-direction: column; }
.stats-heat th, .stats-heat td { text-align: center; padding: 2px 4px; min-width: 30px; }
.stats-heat tbody th { background: #eef1f6; font-weight: 400; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
