/* =========================================================
   영농형 태양광 관리 — UI (모노크롬 · "Black & White")
   클로드 디자인: 순백 배경 · 넓은 여백 · 헤어라인 · 타이포 중심.
   장식 최소화, 색은 흑백 명도(블랙 강조 / 수입 블랙·지출 그레이).
   ========================================================= */
:root{
  /* V2 리디자인 — 중립 바탕 + 흰 카드 + 절제된 도메인 색(장부 느낌) */
  --bg:#EEEFEA; --sub:#F6F6F2; --card:#ffffff;
  --ink:#1E241F; --ink-2:#5B615A; --ink-3:#8E938C;
  --line:#DEDFD7; --line-2:#E9EAE2;

  /* 브랜드/강조 = 깊은 농장 초록(절제해서 사용) */
  --accent:#2B6E44; --accent-d:#1E5333; --accent-soft:#E6EEE8;
  --in:#1E5333;   /* 수입 = 초록 */
  --out:#B23A2A;  /* 지출·위험·삭제 = 벽돌 빨강 */
  --sun:#C67A12;  /* 태양광 = 주황 */

  /* 도메인 색 (홈 카드·상세 지표에 아이콘·숫자·점으로만) */
  --green:#2B6E44; --green-soft:#E6EEE8; --green-ink:#1E5333;
  --amber:#C67A12; --amber-soft:#F5ECDA; --amber-ink:#8F560C;
  --blue:#2A57A8;  --blue-soft:#E4E9F2;  --blue-ink:#1E4080;
  --danger:#B23A2A;

  --r:14px; --r-sm:10px; --pill:999px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
  --maxw:560px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%; scroll-padding-bottom:96px}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Pretendard","Pretendard Variable",
              "Apple SD Gothic Neo","Noto Sans KR",system-ui,"Malgun Gothic",sans-serif;
  font-size:calc(17px * var(--fscale, 1)); line-height:1.55; letter-spacing:-.01em;
  padding-bottom:calc(96px + var(--safe-b));
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
.num{font-variant-numeric:tabular-nums; font-feature-settings:"tnum"}
a{color:var(--accent-d); text-decoration:none}
.wrap{max-width:var(--maxw); margin:0 auto; width:100%; padding:0 20px}

/* ── 상단 헤더 (순백 + 헤어라인) ───────────────────── */
.top{position:sticky; top:0; z-index:20; background:rgba(255,255,255,.88);
  backdrop-filter:saturate(180%) blur(14px); -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--line); padding-top:var(--safe-t)}
.top .wrap{display:flex; align-items:center; justify-content:space-between; height:54px}
.word{display:flex; align-items:center; gap:9px; font-weight:700; font-size:1.02rem;
  letter-spacing:-.02em; overflow:hidden; white-space:nowrap; text-overflow:ellipsis}
.word .mk{width:20px; height:20px; border-radius:7px; flex:none;
  background:var(--accent); position:relative}
.word .mk::after{content:""; position:absolute; inset:6px; border-radius:50%;
  background:#fff; opacity:.92}
.menu details{position:relative}
.menu summary{list-style:none; cursor:pointer; width:36px; height:36px; border-radius:9px;
  display:flex; align-items:center; justify-content:center; color:var(--ink-2)}
.menu summary:hover{background:var(--line-2)}
.menu summary::-webkit-details-marker{display:none}
.menu-pop{position:absolute; right:0; top:42px; background:#fff; color:var(--ink);
  border:1px solid var(--line); border-radius:14px; box-shadow:0 18px 44px rgba(20,24,30,.14);
  min-width:226px; padding:6px; display:flex; flex-direction:column; gap:1px; z-index:40}
.menu-pop a,.menu-pop button{display:block; width:100%; text-align:left; padding:12px 12px;
  border:0; background:none; font:inherit; font-size:.95rem; font-weight:500; color:var(--ink);
  border-radius:9px; cursor:pointer}
.menu-pop a:hover,.menu-pop button:hover{background:var(--line-2)}
.menu-pop .danger{color:var(--out)}
.menu-pop form{margin:0}

/* ── 페이지 본문 ──────────────────────────────────── */
.page{max-width:var(--maxw); margin:0 auto; padding:8px 20px 40px}
.h1{font-size:1.9rem; font-weight:800; letter-spacing:-.04em; margin:18px 0 4px}
.lead{color:var(--ink-2); font-size:.92rem; margin:0 0 6px; line-height:1.5}

/* 플래시 */
.flashes{margin:14px 0 0}
.flash{padding:13px 15px; border-radius:12px; margin:8px 0; font-weight:600; font-size:.92rem;
  display:flex; gap:9px; align-items:center; border:1px solid var(--line)}
.flash.ok{background:var(--accent-soft); color:var(--accent-d); border-color:#d7d7da}
.flash.error{background:#f4f4f6; color:#16181d; border-color:#d7d7da}
.flash::before{content:""; width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.6; flex:none}

/* ── 요약(큰 숫자) ────────────────────────────────── */
.stat{padding:24px 0 22px; border-bottom:1px solid var(--line)}
.stat .lab{font-size:.84rem; color:var(--ink-2); font-weight:600}
.stat .fig{font-size:2.7rem; font-weight:800; letter-spacing:-.05em; line-height:1.05; margin:6px 0 0}
.stat .fig.neg{color:var(--out)}
.stat .fig .won{font-size:1.05rem; font-weight:700; color:var(--ink-3); margin-left:5px; letter-spacing:-.02em}
.stat .pair{display:flex; gap:28px; margin-top:18px}
.stat .cell .k{font-size:.8rem; color:var(--ink-2); font-weight:600; display:flex; align-items:center; gap:6px}
.stat .cell .k::before{content:""; width:7px; height:7px; border-radius:50%; background:var(--ink-3)}
.stat .cell.in .k::before{background:var(--in)} .stat .cell.out .k::before{background:var(--out)}
.stat .cell .v{font-size:1.2rem; font-weight:800; margin-top:4px; letter-spacing:-.02em}
.stat .cell.in .v{color:var(--in)} .stat .cell.out .v{color:var(--out)}

/* ── 섹션 ─────────────────────────────────────────── */
.sec{padding:22px 0; border-bottom:1px solid var(--line)}
.sec:last-child{border-bottom:0}
.sec-h{display:flex; align-items:baseline; gap:8px; margin:0 0 6px}
.sec-h h2{font-size:.82rem; font-weight:700; color:var(--ink-3); margin:0; letter-spacing:.02em; text-transform:uppercase}
.sec-h .count{margin-left:auto; font-size:.82rem; font-weight:600; color:var(--ink-3); text-transform:none}

/* ── 리스트(헤어라인 행, 카드 없음) ──────────────── */
.list{margin-top:4px}
.li{display:flex; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--line-2)}
.li:last-child{border-bottom:0}
a.li{color:var(--ink)}
.li .dot{width:9px; height:9px; border-radius:50%; flex:none; background:var(--accent); margin:0 1px}
.li .dot.sun{background:var(--sun)} .li .dot.gray{background:var(--ink-3)}
.li .m{min-width:0; flex:1}
.li .t{font-weight:600; font-size:1rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  display:flex; align-items:center; gap:8px}
.li .d{font-size:.82rem; color:var(--ink-3); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.li .x{flex:none; text-align:right; font-weight:800; font-size:1rem; letter-spacing:-.02em}
.li .x .u{font-size:.76rem; color:var(--ink-3); font-weight:600; margin-left:3px}
.li .act{display:flex; gap:7px; flex:none; align-items:center}
.li .act form{margin:0}
.li.kv .t{font-weight:500; color:var(--ink-2)}
.empty{padding:30px 0; text-align:center; color:var(--ink-3); font-size:.92rem; line-height:1.6}

.x.in{color:var(--in)} .x.out{color:var(--out)}
.x.pos{color:var(--accent-d)} .x.neg{color:var(--out)}

.tag{padding:2px 9px; border-radius:var(--pill); font-size:.72rem; font-weight:700; flex:none;
  border:1px solid var(--line)}
.tag.on{background:var(--accent-soft); color:var(--accent-d); border-color:#d7d7da}
.tag.off{background:var(--sub); color:#868d94}
.auto{padding:1px 7px; border-radius:6px; font-size:.67rem; font-weight:700; background:#ededf0; color:#454b50}
.chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.chip{border:1px solid var(--line); color:var(--ink); padding:7px 13px; border-radius:var(--pill);
  font-size:.85rem; font-weight:600; background:#fff}
.chip b{color:var(--accent-d); font-weight:700}

/* 차트 */
.chart-box{margin-top:8px}
.chart{width:100%; height:auto; display:block}

/* ── 폼 ───────────────────────────────────────────── */
.form{margin-top:6px}
.grid{display:grid; grid-template-columns:1fr 1fr; gap:14px 12px}
.fld{display:flex; flex-direction:column; gap:7px}
.fld.full{grid-column:1/-1}
.fld > span{font-size:.79rem; font-weight:600; color:var(--ink-2); padding-left:1px}
.fld input,.fld select{font:inherit; font-size:1rem; color:var(--ink); width:100%; min-height:50px;
  padding:12px 13px; border:1px solid #dcdde1; border-radius:var(--r-sm); background:#fff;
  -webkit-appearance:none; appearance:none}
.fld input::placeholder{color:var(--ink-3)}
.fld select{padding-right:38px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23a0a6ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center}
.fld input:focus,.fld select:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.help{margin-top:14px; font-size:.84rem; color:var(--ink-2); line-height:1.5}
.help b{color:var(--ink)}

/* 버튼 */
.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:18px}
.btn{flex:1; min-width:130px; display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:52px; padding:0 18px; border:1px solid var(--accent); border-radius:12px; font:inherit;
  font-weight:700; font-size:1rem; cursor:pointer; background:var(--accent); color:#fff;
  text-decoration:none; transition:filter .12s,background .12s; letter-spacing:-.01em}
.btn:active{transform:translateY(.5px)}
.btn:hover{filter:brightness(1.06)}
.btn.sec{background:#fff; color:var(--ink); border-color:#dcdde1}
.btn.line{background:#fff; color:var(--accent-d); border-color:#d7d7da}
.btn.danger{background:#fff; color:var(--out); border-color:#d7d7da}
.mini{min-height:36px; padding:7px 13px; border:1px solid var(--line); border-radius:9px; font:inherit;
  font-weight:600; font-size:.82rem; cursor:pointer; background:#fff; color:var(--ink-2)}
.mini.del{color:var(--out); border-color:#d7d7da}
.mini.go{color:#fff; background:var(--accent); border-color:var(--accent)}
.ibtn{width:36px; height:36px; border:1px solid var(--line); border-radius:9px; cursor:pointer; padding:0;
  display:inline-flex; align-items:center; justify-content:center; background:#fff; color:var(--ink-3)}
.ibtn svg{width:17px; height:17px; stroke:currentColor; stroke-width:1.8; fill:none; stroke-linecap:round; stroke-linejoin:round}
.ibtn.del:hover{color:var(--out); border-color:#d7d7da}

/* 연도 선택 */
.yr{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 0;
  border-bottom:1px solid var(--line)}
.yr span{font-size:.82rem; font-weight:700; color:var(--ink-3); text-transform:uppercase; letter-spacing:.02em}
.yr select{font:inherit; font-size:1.05rem; font-weight:800; color:var(--ink); border:0; background:transparent;
  -webkit-appearance:none; appearance:none; text-align:right; padding-right:22px; letter-spacing:-.02em;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2316181d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right center}

/* 재무 날짜 그룹 */
.dgrp{display:flex; align-items:baseline; gap:9px; margin:20px 0 2px; padding-top:6px}
.dgrp .dd{font-size:1.02rem; font-weight:800; letter-spacing:-.02em}
.dgrp .dw{font-size:.73rem; font-weight:700; color:#fff; background:var(--ink-3); border-radius:6px; padding:1px 7px}
.dgrp .dw.sat{background:var(--in)} .dgrp .dw.sun{background:var(--out)}
.dgrp .dn{margin-left:auto; font-size:.86rem; font-weight:700; color:var(--ink-2)}

/* 서류 링크 */
.arr{color:var(--ink-3); flex:none}
.arr svg{width:18px; height:18px; stroke:currentColor; stroke-width:1.9; fill:none; stroke-linecap:round; stroke-linejoin:round}
.note-box{border:1px solid var(--line); background:var(--sub); border-radius:var(--r); padding:15px 16px;
  color:var(--ink-2); font-size:.88rem; margin-top:18px; line-height:1.55}

/* ── 하단 탭 (순백 + 헤어라인) ─────────────────────── */
.tabs{position:fixed; bottom:0; left:0; right:0; z-index:30; display:flex;
  background:rgba(255,255,255,.92); backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px); border-top:1px solid var(--line);
  padding:7px 6px calc(6px + var(--safe-b))}
.tab{flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:4px 2px;
  text-decoration:none; color:var(--ink-3); font-size:.66rem; font-weight:600}
.tab svg{width:24px; height:24px; stroke:currentColor; stroke-width:1.7; fill:none; stroke-linecap:round; stroke-linejoin:round}
.tab.on{color:var(--accent)}

/* ── 로그인 ───────────────────────────────────────── */
.auth{min-height:100svh; display:flex; align-items:center; justify-content:center; padding:22px; background:var(--bg)}
.auth-card{width:100%; max-width:340px; text-align:center}
.auth-mk{width:52px; height:52px; border-radius:15px; margin:0 auto 16px; background:var(--accent); position:relative}
.auth-mk::after{content:""; position:absolute; inset:16px; border-radius:50%; background:#fff; opacity:.92}
.auth-card h1{font-size:1.34rem; font-weight:800; letter-spacing:-.03em; margin:0 0 2px}
.auth-card .lead{text-align:center; margin:6px 0 0}
.auth-card form{display:flex; flex-direction:column; gap:11px; margin-top:20px}
.auth-card input{padding:14px; border:1px solid #dcdde1; border-radius:12px; font:inherit; font-size:1rem;
  min-height:52px; text-align:center}
.auth-card input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}

/* ── 모달(팝업) ───────────────────────────────────── */
.modal{border:0; border-radius:18px; padding:0; width:calc(100% - 36px); max-width:480px;
  max-height:90vh; overflow:auto; background:#fff; color:var(--ink);
  box-shadow:0 24px 60px rgba(20,24,30,.22)}
.modal::backdrop{background:rgba(20,24,30,.42); backdrop-filter:blur(2px)}
.modal > form{margin:0; padding:20px}
/* 모달 헤더의 닫기(X) 버튼 */
.modal-x{border:0; background:none; font-size:1.5rem; line-height:1; color:var(--ink-3);
  cursor:pointer; padding:0 2px}
.modal-x:hover{color:var(--ink)}
/* 목록 섹션 헤더의 '추가' 버튼 */
.add-btn{font:inherit; font-weight:700; font-size:.85rem; color:#fff; background:var(--accent);
  border:0; border-radius:9px; padding:7px 14px; cursor:pointer}
.sec-h-r{display:flex; align-items:center; gap:10px}
.modal-h{display:flex; align-items:center; justify-content:space-between; margin:0 0 2px}
.modal-h h3{font-size:1.15rem; font-weight:800; letter-spacing:-.03em; margin:0}
.modal .lead{margin:0 0 14px; font-weight:600; color:var(--ink)}
.modal .actions{margin-top:18px}
/* 소 개체 정보 — 요약 카드 */
.cowsum{margin:0 0 16px; padding:4px 14px; background:var(--sub); border-radius:12px}
.cowsum .r{display:flex; justify-content:space-between; gap:14px; padding:9px 0;
  border-bottom:1px solid var(--line-2); font-size:.9rem}
.cowsum .r:last-child{border-bottom:0}
.cowsum .r[hidden]{display:none}
.cowsum .r .k{color:var(--ink-3); font-weight:600; flex:none}
.cowsum .r .v{font-weight:700; color:var(--ink); text-align:right; min-width:0}
/* 소 개체 정보 — 건강·진료·방역 메모(일정처럼 하나씩 추가) */
.memo-add{display:flex; gap:8px; align-items:stretch; flex-wrap:wrap}
.memo-add input[type="date"]{flex:0 0 auto; width:auto}
.memo-add input[type="text"]{flex:1 1 130px; width:auto}
.memo-add .btn{flex:0 0 auto; min-height:50px; display:inline-flex; align-items:center; white-space:nowrap}
.memo-list{list-style:none; margin:10px 0 0; padding:0;
  display:flex; flex-direction:column; gap:6px; max-height:168px; overflow:auto}
.memo-list:empty{margin:0}
.memo-list li{display:flex; align-items:center; gap:10px; padding:9px 12px;
  background:var(--sub); border-radius:10px; font-size:.9rem}
.memo-list li .mi{flex:1; min-width:0; color:var(--ink); font-weight:600; word-break:break-word}
.memo-list li .mx{flex:none; border:0; background:none; cursor:pointer; color:var(--ink-3);
  font-size:1rem; line-height:1; padding:3px 6px; border-radius:7px}
.memo-list li .mx:hover{color:var(--out); background:#fff}
/* 이표번호 자동조회 입력 그룹 */
.ear-lookup{display:flex; gap:8px; align-items:stretch}
.ear-lookup input{flex:1 1 auto; width:auto; min-width:0}
.ear-lookup .btn{flex:0 0 auto; min-width:0; min-height:50px; padding:0 20px}
.btn:disabled{opacity:.55; cursor:default; filter:none}
.ear-msg{display:block; margin-top:7px; font-size:.82rem; font-weight:600;
  color:var(--ink-3); min-height:1.05em; line-height:1.45}
.ear-msg.ok{color:var(--accent-d)}
.ear-msg.err{color:var(--out)}
/* 이력제 전체 이력 결과 패널 (모달이 스크롤하므로 내부 스크롤 없이 전체 표시) */
.trace-result{display:flex; flex-direction:column; gap:12px; margin-top:12px}
.trace-result:empty{margin:0}
.trace-sec{border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff}
.trace-title{background:var(--accent-soft); padding:11px 13px; font-size:.82rem; font-weight:800;
  color:var(--accent-d); letter-spacing:.01em; cursor:pointer; list-style:none;
  display:flex; align-items:center; gap:8px; user-select:none}
.trace-title::-webkit-details-marker{display:none}
.trace-title::before{content:'▸'; font-size:.72rem; transition:transform .15s ease; flex:none}
details[open] > .trace-title::before{transform:rotate(90deg)}
.trace-title .tt{flex:1}
.trace-title .tc{flex:none; font-size:.72rem; font-weight:700; color:var(--accent-d);
  background:#fff; border-radius:20px; padding:1px 9px; min-width:20px; text-align:center}
.trace-title:hover{filter:brightness(.97)}
.trace-empty{padding:11px 13px; font-size:.85rem; color:var(--ink-3)}
.trace-block{padding:5px 13px}
.trace-block + .trace-block{border-top:1px dashed var(--line-2)}
.trace-row{display:flex; justify-content:space-between; gap:14px; padding:8px 0; font-size:.9rem;
  align-items:baseline}
.trace-row .tl{color:var(--ink-3); font-weight:600; flex:none; max-width:42%}
.trace-row .tv{color:var(--ink); font-weight:700; text-align:right; word-break:break-word; line-height:1.4}
/* 신고·이동 이력 표 */
.trace-table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch}
.trace-table{width:100%; border-collapse:collapse; font-size:.82rem}
.trace-table th,.trace-table td{padding:9px 11px; text-align:left; vertical-align:top;
  border-bottom:1px solid var(--line-2)}
.trace-table th{background:var(--sub); color:var(--ink-3); font-weight:700; font-size:.74rem; white-space:nowrap}
.trace-table td{color:var(--ink); font-weight:600; line-height:1.4}
.trace-table td:nth-child(1),.trace-table td:nth-child(2),.trace-table td:nth-child(3){white-space:nowrap}
.trace-table td:nth-child(4){min-width:150px}
.trace-table tr:last-child td{border-bottom:0}
/* 사료 일괄 등록 */
.bulk-feed{display:flex; flex-direction:column; gap:8px; margin-top:4px}
.bf-head,.bf-row{display:grid; grid-template-columns:60px 1fr 1fr 1fr; gap:8px; align-items:center}
.bf-head{font-size:.72rem; font-weight:700; color:var(--ink-3); padding:0 2px}
.bf-head span:not(:first-child){text-align:right}
.bf-name{font-weight:700; font-size:.9rem; color:var(--ink)}
.bulk-feed input{min-height:46px; padding:0 10px; border:1px solid var(--line); border-radius:9px;
  font:inherit; font-size:.95rem; color:var(--ink); width:100%; text-align:right}
.bulk-feed input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
/* 소 정보 — 사료 급여 이력 */
.cow-feeding{margin:0 0 14px; padding:10px 13px; background:var(--sub); border-radius:12px}
.cf-title{font-size:.82rem; font-weight:800; color:var(--ink-2); margin-bottom:6px;
  display:flex; align-items:baseline; gap:8px}
.cf-title small{margin-left:auto; font-weight:700; color:var(--accent-d); font-size:.78rem}
.cf-list{display:flex; flex-direction:column; gap:5px; max-height:160px; overflow:auto}
.cf-row{display:flex; justify-content:space-between; gap:10px; font-size:.86rem; padding:3px 0}
.cf-row .cf-l{color:var(--ink-2); font-weight:600; min-width:0; word-break:break-word}
.cf-row .cf-v{color:var(--ink); font-weight:700; flex:none}
.check{display:flex; align-items:center; gap:9px; margin-top:14px; cursor:pointer;
  font-size:.9rem; font-weight:600; color:var(--ink-2)}
.check input{width:19px; height:19px; accent-color:var(--accent); flex:none}

/* ── 하위 탭(세그먼트) ────────────────────────────── */
.subtabs{display:flex; gap:4px; margin:18px 0 4px; padding:4px;
  background:var(--line-2); border-radius:12px}
.subtabs button{flex:1; min-height:40px; border:0; background:transparent; font:inherit;
  font-weight:700; font-size:.92rem; color:var(--ink-2); border-radius:9px; cursor:pointer;
  letter-spacing:-.01em; transition:background .12s,color .12s}
.subtabs button.on{background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(20,24,30,.1)}
.tabpane[hidden]{display:none}
/* 재무 그룹 상단 네비(재무·직원·통계) — 세그먼트형 링크 */
.group-nav{display:flex; gap:4px; margin:16px 0 4px; padding:4px;
  background:var(--line-2); border-radius:12px}
.group-nav a{flex:1; min-height:42px; display:flex; align-items:center; justify-content:center; gap:5px;
  border-radius:9px; text-decoration:none; color:var(--ink-2); font-weight:700; font-size:.9rem;
  letter-spacing:-.01em; transition:background .12s,color .12s}
.group-nav a.on{background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(20,24,30,.1)}
.gn-badge{min-width:18px; height:18px; padding:0 5px; border-radius:20px; background:var(--out);
  color:#fff; font-size:.68rem; font-weight:800; display:inline-flex; align-items:center; justify-content:center}

/* ── 통계: 요약 타일 ──────────────────────────────── */
.tiles{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:8px}
.tile{border:1px solid var(--line); border-radius:var(--r); padding:14px 15px; background:var(--sub)}
.tile.full{grid-column:1/-1}
.tile .k{font-size:.78rem; font-weight:600; color:var(--ink-2)}
.tile .v{font-size:1.5rem; font-weight:800; letter-spacing:-.03em; margin-top:3px}
.tile .v .u{font-size:.86rem; font-weight:700; color:var(--ink-3); margin-left:3px}

/* ── 홈 날씨 위젯 ─────────────────────────────────── */
.stat-top{display:flex; align-items:flex-start; justify-content:space-between; gap:14px}
.stat-main{min-width:0}
.wx{display:flex; flex-direction:column; gap:7px; flex:none; padding-top:6px}
.wx-row{display:flex; align-items:center; gap:7px; justify-content:flex-end;
  font-size:.86rem; font-weight:600; color:var(--ink-2); white-space:nowrap}
.wx-day{color:var(--ink-3); font-size:.76rem; min-width:24px; text-align:left}
.wx-ic{font-size:1.12rem; line-height:1}
.wx-t{font-variant-numeric:tabular-nums; color:var(--ink); font-weight:700}

/* ── 진행률 바 ────────────────────────────────────── */
.prog{height:8px; background:var(--line); border-radius:999px; overflow:hidden; margin-top:12px}
.prog span{display:block; height:100%; background:var(--ink); border-radius:999px}

/* ── 검색·필터 바 ─────────────────────────────────── */
.filterbar{margin:4px 0 14px; padding:14px; background:var(--sub); border:1px solid var(--line); border-radius:var(--r)}
.filterbar .actions{margin-top:12px}

/* ── 페이지 넘김(< 1/2 >) ─────────────────────────── */
.pager{display:flex; align-items:center; justify-content:center; gap:14px; padding:18px 0 2px}
.pager .pg{display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px;
  border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink);
  font-size:1.15rem; font-weight:700; text-decoration:none}
.pager .pg:hover{background:var(--line-2)}
.pager .pg.off{color:var(--ink-3); border-color:var(--line-2); pointer-events:none}
.pager .pg-n{font-size:.92rem; font-weight:700; color:var(--ink-2); min-width:58px; text-align:center;
  font-variant-numeric:tabular-nums}

/* ── 통계: 금액 표 ────────────────────────────────── */
.rtab{width:100%; border-collapse:collapse; margin-top:16px; font-size:.9rem}
.rtab th,.rtab td{padding:10px 6px; text-align:right; border-bottom:1px solid var(--line-2)}
.rtab th:first-child,.rtab td:first-child{text-align:left; font-weight:700}
.rtab thead th{font-size:.76rem; font-weight:700; color:var(--ink-3); text-transform:uppercase;
  letter-spacing:.02em; border-bottom:1px solid var(--line)}
.rtab td.in{color:#dc2626} .rtab td.out{color:#2563eb}   /* 차트(수입 빨강/지출 파랑)와 통일 */
.rtab td.pos{color:var(--accent-d)} .rtab td.neg{color:var(--out)}
.rtab td.num{font-weight:700; font-variant-numeric:tabular-nums}
.rtab-empty{text-align:center !important; color:var(--ink-3); font-weight:500; padding:20px 0}
.v.neg{color:var(--out)}

@media (min-width:641px){ :root{--maxw:620px} }

/* ── 직원/작업지시/급여 · v1.3 ─────────────────────────── */
.fld textarea{font:inherit; font-size:1rem; color:var(--ink); width:100%; min-height:80px;
  padding:12px 13px; border:1px solid var(--line); border-radius:12px; background:#fff; resize:vertical}
.fld textarea:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.fld > span small{font-weight:500; color:var(--ink-3)}
.li .dot.red{background:#d9534f}
.netline{margin-top:12px; font-size:.95rem; color:var(--ink-2)}
.netline b{color:var(--accent); font-size:1.1rem}
/* 헤더 메뉴: 사용자 표시 */
.menu-user{padding:11px 12px; font-weight:700; border-bottom:1px solid var(--line-2); margin-bottom:4px}
.menu-user .role-tag{font-size:.7rem; font-weight:700; color:var(--ink-3); margin-left:4px}
/* 완료 알림 섹션 강조 */
.alert-sec{border:1px solid #f0c9c7; background:#fdf5f4}
/* 하단 탭 배지 */
.tab{position:relative}
.nav-badge{position:absolute; top:0; right:50%; transform:translateX(20px);
  min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:var(--danger); color:#fff;
  font-size:.66rem; font-weight:800; display:flex; align-items:center; justify-content:center; line-height:1}

/* ============================================================
   V2 직관 리디자인 — 큰 글자 · 흰 카드 · 도메인 색
   (아래 규칙들은 위 기존 규칙을 의도적으로 덮어씁니다)
   ============================================================ */

/* ── 컨테이너를 흰 카드로 ── */
.stat{background:var(--card); border:1px solid var(--line); border-radius:20px;
  padding:20px; margin:14px 0; border-bottom:1px solid var(--line)}
.sec{background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:16px; margin:0 0 14px; border-bottom:1px solid var(--line)}
.sec:last-child{border-bottom:1px solid var(--line)}
.sec-h{margin:0 0 10px}
.sec-h h2{font-size:1.02rem; font-weight:820; color:var(--ink); letter-spacing:-.01em; text-transform:none}
.sec-h .count{font-size:.9rem; color:var(--ink-2)}

/* ── 목록 줄 더 읽기 쉽게 ── */
.li{padding:13px 0; gap:12px}
.li .t{font-size:1.06rem; font-weight:750}
.li .d{font-size:.92rem; color:var(--ink-2)}
.li .dot{width:10px; height:10px; background:var(--accent)}
.li .x{font-size:1.06rem}

/* ── 태그·칩 ── */
.tag{font-size:.78rem; padding:4px 11px; font-weight:800}
.tag.on{background:var(--green-soft); color:var(--green-ink); border-color:#cfe4d4}
.chip{background:var(--sub); border:1px solid var(--line); color:#41503f;
  padding:6px 12px; border-radius:11px; font-size:.92rem; font-weight:700}
.chip b{color:var(--ink-2); font-weight:700}
.chips{display:flex; flex-wrap:wrap; gap:7px}

/* ── 버튼 크게 ── */
.btn{min-height:52px; font-size:1.05rem; border-radius:13px}
.btn.ghost{background:var(--card); color:var(--green-ink); border:1.5px solid var(--green)}
.mini{min-height:42px; padding:8px 15px; font-size:.95rem; border-radius:11px; font-weight:750}
.mini.del{color:var(--danger); border-color:#e6c3bd}
.add-btn{min-height:44px; font-size:.98rem; border-radius:12px; padding:0 16px}

/* ── 하단 탭 크게 ── */
.tabs{padding:9px 6px calc(9px + var(--safe-b))}
.tab{font-size:.74rem; gap:4px; padding:5px 2px}
.tab svg{width:27px; height:27px}
.tab.on{color:var(--accent-d)}

/* ── 홈 허브: 도메인 요약(절제된 아이콘·숫자) ── */
.hub{display:flex; flex-direction:column; gap:10px; margin:14px 0}
.hcard{display:flex; align-items:center; gap:13px; padding:15px 16px; border-radius:var(--r);
  background:var(--card); border:1px solid var(--line); text-decoration:none; color:var(--ink)}
.hcard:active{background:var(--sub)}
.hcard .ic{width:42px; height:42px; border-radius:10px; display:grid; place-items:center; flex:none;
  border:1.5px solid currentColor}
.hcard .ic svg{width:23px; height:23px; stroke:currentColor; fill:none; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round}
.hcard .tx{flex:1; min-width:0}
.hcard .tx .l{font-size:1.05rem; font-weight:800}
.hcard .tx .s{font-size:.85rem; color:var(--ink-2); margin-top:1px}
.hcard .big{font-size:1.5rem; font-weight:820; letter-spacing:-.02em; text-align:right; line-height:1.05;
  font-variant-numeric:tabular-nums; color:var(--ink)}
.hcard .big em{display:block; font-size:.72rem; font-weight:700; color:var(--ink-3); font-style:normal; letter-spacing:0}
.hcard.g .ic{color:var(--green)}  .hcard.g .big{color:var(--green-ink)}
.hcard.a .ic{color:var(--amber)}  .hcard.a .big{color:var(--amber-ink)}
.hcard.b .ic{color:var(--blue)}   .hcard.b .big{color:var(--blue-ink)}
.mini-row{display:grid; grid-template-columns:1fr 1fr 1fr; gap:9px; margin-bottom:4px}
.mtile{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 8px;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  font-size:.9rem; font-weight:700; color:var(--ink); text-decoration:none}
.mtile svg{width:22px; height:22px; stroke:var(--ink-2); fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round}

/* ── 홈: 다가오는 일정 ── */
.up-list{display:flex; flex-direction:column}
.up{display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line-2)}
.up:last-child{border-bottom:0}
.up .dday{flex:none; min-width:58px; white-space:nowrap; text-align:center; font-weight:800; font-size:.86rem;
  padding:6px 8px; border-radius:9px; background:var(--sub); color:var(--ink-2)}
.up .dday.over{background:#f6e3df; color:var(--out)}
.up .dday.today{background:var(--accent-soft); color:var(--accent-d)}
.up .u-m{flex:1; min-width:0}
.up .u-t{font-size:1rem; font-weight:750; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.up .u-d{font-size:.85rem; color:var(--ink-2); margin-top:1px}

/* ── 농축산: 개체 카드(색 띠 없이 담백하게) ── */
.animal{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:14px; margin-bottom:10px}
.animal.sold{opacity:.72}
.a-top{display:flex; align-items:center; justify-content:space-between; gap:8px}
.a-name{font-size:1.12rem; font-weight:820}
.a-ear{font-size:.92rem; color:var(--ink-2); margin:3px 0 10px; font-variant-numeric:tabular-nums}
.a-acts{display:flex; gap:8px; margin-top:12px}
.a-acts .btn{min-height:46px; font-size:.98rem}
.a-sub{display:flex; justify-content:flex-end; gap:8px; margin-top:9px}
.a-sub form{margin:0}
/* 검색 바 */
.searchbar{display:flex; align-items:center; gap:8px; margin:2px 0 12px; padding:0 14px;
  background:var(--card); border:1.5px solid var(--line); border-radius:13px; height:52px}
.searchbar .si{font-size:1.1rem; flex:none; opacity:.75}
.searchbar input{flex:1; border:0; background:transparent; font:inherit; font-size:1.02rem;
  color:var(--ink); outline:none; min-width:0}
.searchbar input::placeholder{color:var(--ink-3)}
.searchbar .sx{flex:none; width:30px; height:30px; border-radius:50%; border:0;
  background:var(--line-2); color:var(--ink-2); font-size:.85rem; cursor:pointer}

/* ── 상세(보기): 큰 정보 칸 ── */
.facts{display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:12px 0}
.fact{background:var(--card); border:1px solid var(--line); border-radius:13px; padding:11px 13px}
.fact .k{font-size:.82rem; color:var(--ink-2); font-weight:700}
.fact .v{font-size:1.1rem; font-weight:800; margin-top:2px}

/* ── 글자 크게 조절 버튼 (헤더) ── */
.fscale{display:flex; align-items:center; gap:5px}
.fscale button{width:34px; height:34px; border-radius:50%; border:1px solid var(--line);
  background:var(--card); font-size:1.1rem; font-weight:900; color:var(--ink); cursor:pointer; line-height:1}
