/* 수급자 관리 > 관리기록 > 기록지 제공대장(연간)
   업무 흐름: 조회 조건 → 대상월 선택 → 입력 → 검토 → Drive 저장 → 출력 */

.crd-shell{
  --crd-ink:#2f2017;
  --crd-brown:#4a2b19;
  --crd-brown-2:#684731;
  --crd-orange:#d56f16;
  --crd-orange-dark:#a94d08;
  --crd-line:#a99580;
  --crd-line-soft:#ddd2c7;
  --crd-paper:#fff;
  --crd-cream:#f7f2ec;
  --crd-cream-2:#eee5db;
  --crd-success:#176b35;
  --crd-warning:#8a4b08;
  --crd-danger:#9f2d26;
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  gap:6px;
  color:var(--crd-ink);
  font-family:var(--font,'Pretendard','Malgun Gothic','맑은 고딕',sans-serif);
  font-size:10px;
}

.crd-shell *{box-sizing:border-box}
.crd-shell button,.crd-shell input,.crd-shell select{font-family:inherit}

/* 문서 정체성과 현재 수급자 */
.crd-head{
  min-height:39px;
  height:39px;
  display:flex;
  align-items:center;
  gap:5px;
  padding:3px 7px;
  overflow-x:auto;
  border:1px solid var(--crd-line);
  border-top:0;
  background:var(--crd-cream);
  white-space:nowrap;
}
.crd-heading{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  padding:0 4px;
}
.crd-heading h3{
  margin:0;
  color:var(--crd-brown);
  font-size:12px;
  font-weight:900;
  line-height:26px;
  white-space:nowrap;
}
.crd-client-meta{
  flex:0 0 auto;
  display:flex;
  align-items:stretch;
  border-left:1px solid var(--crd-line-soft);
  background:#fbf9f6;
}
.crd-client-meta>span{
  min-width:104px;
  display:grid;
  align-content:center;
  gap:2px;
  padding:5px 10px;
  border-right:1px solid var(--crd-line-soft);
  text-align:center;
}
.crd-client-meta>span:last-child{border-right:0}
.crd-client-meta em{
  color:#846f5e;
  font-size:8px;
  font-style:normal;
  font-weight:700;
}
.crd-client-meta b{
  color:var(--crd-brown);
  font-size:11px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.crd-client-meta .crd-sync-state{
  min-width:92px;
  color:#315d3f;
  font-size:9px;
  font-weight:800;
}
.crd-sync-state i{
  width:7px;
  height:7px;
  display:inline-block;
  margin-right:4px;
  border:1px solid #2c7b48;
  background:#e4f4e8;
  vertical-align:-1px;
}

/* 같은 기능군은 같은 높이와 기준선으로 유지 */
.crd-command{
  border:1px solid var(--crd-line);
  background:var(--crd-cream);
}
.crd-command-row{
  min-height:36px;
  display:flex;
  align-items:center;
  gap:5px;
  padding:4px 7px;
  white-space:nowrap;
}
.crd-command-row+.crd-command-row{border-top:1px solid var(--crd-line-soft);background:#fff}
.crd-control-group{display:flex;align-items:center;gap:4px;min-width:0}
.crd-control-label{
  flex:0 0 auto;
  padding:0 2px;
  color:#6f5b4b;
  font-size:8px;
  font-weight:850;
}
.crd-divider{width:1px;height:22px;margin:0 2px;background:var(--crd-line-soft)}
.crd-spacer{flex:1 1 auto;min-width:6px}

.crd-btn{
  min-width:0;
  height:26px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto;
  margin:0!important;
  padding:0 8px!important;
  border:1px solid #755f4c!important;
  border-radius:2px!important;
  background:#fff!important;
  box-shadow:none!important;
  color:var(--crd-ink)!important;
  font-size:9px!important;
  font-weight:800!important;
  line-height:24px!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  cursor:pointer;
}
.crd-btn:hover:not(:disabled){border-color:var(--crd-orange-dark)!important;background:#fff5e9!important;color:#6f3005!important}
.crd-btn:focus-visible{outline:2px solid #ed9a50;outline-offset:1px}
.crd-btn.on,.crd-btn[aria-pressed="true"]{
  border-color:var(--crd-brown)!important;
  background:var(--crd-brown)!important;
  color:#fff!important;
}
.crd-btn.primary{
  border-color:var(--crd-brown)!important;
  background:var(--crd-brown)!important;
  color:#fff!important;
}
.crd-btn.accent{
  border-color:var(--crd-orange-dark)!important;
  background:var(--crd-orange)!important;
  color:#fff!important;
}
.crd-btn.primary:hover:not(:disabled){border-color:#2b190f!important;background:#2b190f!important;color:#fff!important}
.crd-btn.accent:hover:not(:disabled){border-color:#8d3f06!important;background:#b9550b!important;color:#fff!important}
.crd-btn:disabled{
  border-color:#cfc5bb!important;
  background:#ece8e3!important;
  color:#94887d!important;
  opacity:1!important;
  cursor:not-allowed!important;
  transform:none!important;
}
.crd-btn.compact{padding:0 7px!important}
.crd-btn.icon{width:27px;padding:0!important;font-size:14px!important}
.crd-btn.save-action{min-width:80px}

.crd-year{
  height:26px;
  display:flex;
  align-items:center;
  border:1px solid #755f4c;
  background:#fff;
}
.crd-year button{
  width:27px;
  height:24px;
  padding:0;
  border:0;
  background:#fff;
  color:var(--crd-brown);
  font-size:14px;
  font-weight:900;
  line-height:24px;
  cursor:pointer;
}
.crd-year button:hover:not(:disabled){background:#fff1df;color:#8d3f06}
.crd-year button:disabled{color:#aaa;cursor:not-allowed}
.crd-year b{
  min-width:58px;
  height:24px;
  padding:0 6px;
  border-right:1px solid var(--crd-line-soft);
  border-left:1px solid var(--crd-line-soft);
  color:var(--crd-brown);
  font-size:10px;
  line-height:24px;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
.crd-year-display{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  height:24px;
  min-width:58px;
  border-right:1px solid var(--crd-line-soft);
  border-left:1px solid var(--crd-line-soft);
  background:#fff;
}
.crd-year-display:hover{background:#fff1df;}
.crd-year-display:hover b{color:#8d3f06;}
.crd-year-display b{border:0;padding:0 6px;}
.crd-year-native-select{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
  z-index:2;
  font-size:14px;
}
.crd-services{display:flex;align-items:center;gap:0}
.crd-services .crd-btn{min-width:67px;border-right-width:0!important;border-radius:0!important}
.crd-services .crd-btn:first-child{border-radius:2px 0 0 2px!important}
.crd-services .crd-btn:last-child{border-right-width:1px!important;border-radius:0 2px 2px 0!important}

.crd-metrics{display:flex;align-items:stretch;gap:3px;margin-left:auto}
.crd-metric{
  min-width:61px;
  height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:0 7px;
  border:1px solid #c8b9ab;
  background:#fff;
  color:#6e5a49;
  font-size:8px;
  font-weight:700;
}
.crd-metric b{color:var(--crd-brown);font-size:10px;font-weight:900;font-variant-numeric:tabular-nums}
.crd-metric.is-complete{border-color:#9dc5a9;background:#f2faf4;color:#315d3f}
.crd-metric.is-complete b{color:var(--crd-success)}

.crd-selected-summary{
  min-width:116px;
  height:26px;
  display:inline-flex;
  align-items:center;
  padding:0 8px;
  border:1px solid #d3c5b8;
  background:#faf7f3;
  color:#6f5b4b;
  font-size:8px;
  font-weight:750;
}
.crd-selected-summary b{margin:0 2px;color:var(--crd-brown);font-size:10px;font-weight:900}
.crd-dirty{
  height:22px;
  display:none;
  align-items:center;
  padding:0 6px;
  border:1px solid #e6b36f;
  border-radius:2px;
  background:#fff4dd;
  color:#8a4b08;
  font-size:8px;
  font-weight:850;
}
.crd-dirty.show{display:inline-flex}

/* 월별 현황 표 */
.crd-workspace{
  min-height:0;
  position:relative;
  display:grid;
  grid-template-columns:minmax(500px,1fr) 326px;
  gap:6px;
  overflow:auto;
}
.crd-table-region{
  position:relative;
  min-height:0;
  display:grid;
  grid-template-rows:36px minmax(0,1fr);
  border:1px solid var(--crd-line);
  background:#fff;
}
.crd-table-caption{
  display:flex;
  align-items:center;
  gap:0;
  padding:0;
  border-bottom:1px solid var(--crd-line);
  background:var(--crd-cream-2);
}
.crd-table-caption>div:first-child{min-width:0;flex:1 1 auto;height:35px;display:flex;align-items:center;gap:6px;padding:0 7px;border-right:1px solid var(--crd-line)}
.crd-table-caption h4{flex:0 0 auto;margin:0;color:var(--crd-brown);font-size:10px;font-weight:900}
.crd-table-caption [data-crd-summary-text]{
  min-width:0;
  flex:1 1 auto;
  color:#6e5a49;
  font-size:8px;
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.crd-caption-person{width:104px;flex:0 0 104px;height:35px;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 5px;color:#6e5a49;font-size:8px;white-space:nowrap}
.crd-caption-person b{color:var(--crd-brown);font-size:9px;font-weight:900}
.crd-caption-person em{color:#806e60;font-style:normal;font-variant-numeric:tabular-nums}

.crd-table-wrap{
  min-height:0;
  overflow:auto;
  isolation:isolate;
  background:#fff;
}
.crd-table{
  width:100%;
  height:100%;
  min-width:0;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  color:var(--crd-ink);
  font-size:9px;
}
.crd-table thead{position:static}
.crd-table th{
  position:sticky;
  top:0;
  z-index:3;
  height:29px;
  padding:0 4px;
  border-right:1px solid #806a57;
  border-bottom:1px solid #2d1b11;
  background:var(--crd-brown);
  color:#fff!important;
  font-size:8px;
  font-weight:850;
  line-height:1.15;
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
}
.crd-table th:last-child,.crd-table td:last-child{border-right:0}
.crd-table td{
  height:32px;
  padding:2px 4px;
  border-right:1px solid #cfc1b4;
  border-bottom:1px solid #d8ccc0;
  background:#fff;
  color:var(--crd-ink);
  text-align:center;
  vertical-align:middle;
  font-variant-numeric:tabular-nums;
}
.crd-table tbody tr:last-child td{border-bottom:0}
.crd-table tbody tr:hover td{background:#fff8ef}
.crd-table tbody tr{cursor:pointer}
.crd-table tbody tr.is-selected td{background:#fff8ed}
.crd-table tbody tr.is-selected td:first-child{box-shadow:inset 3px 0 0 #efb066}
.crd-table tbody tr.is-active td{border-top:1px solid var(--crd-orange);border-bottom-color:var(--crd-orange);background:#fff0d8}
.crd-table tbody tr.is-active td:first-child{border-left:1px solid var(--crd-orange);box-shadow:inset 3px 0 0 var(--crd-orange)}
.crd-table tbody tr.is-active td:last-child{border-right:1px solid var(--crd-orange)}
.crd-table tbody tr:focus{outline:0}
.crd-table tbody tr:focus-visible td{box-shadow:inset 0 0 0 1px #e78a36}
.crd-table tbody tr.is-empty td{color:#7d7065;background:#fbfaf8}
.crd-table tbody tr.is-empty:hover td{background:#f8f4ef}
.crd-table tbody tr.is-empty.is-active td,
.crd-table tbody tr.is-empty.is-active:hover td{color:var(--crd-ink);background:#fff0d8}
.crd-table tbody tr.is-future{cursor:default}
.crd-table tbody tr.is-future td,
.crd-table tbody tr.is-future:hover td{background:#f3f1ee;color:#8a8179}
.crd-table tbody tr.is-future .crd-month,
.crd-table tbody tr.is-future .crd-cell-value{color:#8a8179}
.crd-table tbody tr.is-future input{cursor:not-allowed}
.crd-table tbody tr:last-child.is-active td{border-bottom:1px solid var(--crd-orange)}
.crd-placeholder-row td{height:32px}
.crd-table td.left{text-align:left}
.crd-table input[type=checkbox]{width:14px;height:14px;margin:0;accent-color:var(--crd-orange);vertical-align:middle}
.crd-month{display:block;color:var(--crd-brown);font-size:10px;font-weight:900;line-height:1.05}
.crd-month-sub,.crd-cell-sub{display:block;margin-top:2px;color:#847264;font-size:7px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crd-cell-value{display:block;color:var(--crd-ink);font-size:10px;font-weight:900;line-height:1.05}
.crd-manual-summary{display:block;color:var(--crd-ink);font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crd-date{white-space:nowrap;font-weight:750}

.crd-state{
  min-width:39px;
  height:19px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  border:1px solid currentColor;
  border-radius:2px;
  background:#fff;
  font-size:8px;
  font-weight:900;
  line-height:17px;
  white-space:nowrap;
}
.crd-state.done{background:#edf8f0;color:var(--crd-success)}
.crd-state.pending{background:#fff4df;color:var(--crd-warning)}
.crd-state.warn{background:#fff0ee;color:var(--crd-danger)}
.crd-state.muted{background:#f0ede9;color:#70655c}
.crd-state.saved{background:#eef3fa;color:#315b92}

.crd-status-overlay{
  position:absolute;
  z-index:8;
  top:36px;
  right:0;
  bottom:0;
  left:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(255,255,255,.86);
  color:#6b5849;
  text-align:center;
}
.crd-status-overlay.show{display:flex}
.crd-status-overlay>div{max-width:430px;display:grid;justify-items:center;gap:6px;padding:12px 16px;border:1px solid #cbbcad;background:#fff;box-shadow:0 3px 10px rgba(54,34,20,.09)}
.crd-status-overlay b{color:var(--crd-brown);font-size:11px;font-weight:900}
.crd-status-overlay span{color:#6f5b4b;font-size:9px;line-height:1.5;word-break:keep-all}
.crd-status-overlay.error>div{border-color:#d4a49f;background:#fff8f7}
.crd-status-overlay.error b{color:var(--crd-danger)}
.crd-status-overlay .crd-btn{margin-top:3px!important}

.crd-loading,.crd-error{
  height:100%;
  min-height:220px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  border:1px solid var(--crd-line,#a99580);
  background:#fff;
  color:#6b5344;
  line-height:1.7;
  text-align:center;
}
.crd-error b{color:var(--crd-danger,#9f2d26)}

/* 모달 입력 구성을 우측 상시 편집 구획으로 사용 */
.crd-editor{
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:39px minmax(0,1fr) 42px;
  border:1px solid var(--crd-line);
  background:#fff;
}
.crd-editor-head{
  min-width:0;
  display:flex;
  align-items:center;
  gap:4px;
  padding:0 6px;
  border-bottom:1px solid #2c190f;
  background:var(--crd-brown);
  color:#fff!important;
}
.crd-editor-head>div:first-child{min-width:0;flex:1 1 auto}
.crd-editor-head h4{margin:0;color:#fff!important;font-size:10px;font-weight:900;line-height:1.15;white-space:nowrap}
.crd-editor-head>span,.crd-editor-head>div:first-child>span{display:block;margin-top:2px;color:#eadfd5!important;font-size:7px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crd-editor-stats{flex:0 0 auto;display:flex;align-items:center;gap:2px}
.crd-editor-stats>span:not(.crd-state){height:21px;display:inline-flex;align-items:center;gap:2px;padding:0 3px;border:1px solid #8b705c;background:#fff;color:#6b5341;font-size:7px;font-weight:750}
.crd-editor-stats b{color:var(--crd-brown);font-size:9px;font-weight:900}
.crd-editor-stats .crd-state{height:21px;border-color:#dbc5b2;line-height:19px}
.crd-editor-body{min-height:0;overflow:auto;padding:6px;background:#f8f4ef}
.crd-editor-loading{grid-row:2/4;display:flex;align-items:center;justify-content:center;padding:18px;color:#725e4e;font-size:9px;line-height:1.55;text-align:center;background:#faf8f5}
.crd-form-section{border:1px solid #c9b9aa;background:#fff}
.crd-form-section+.crd-form-section{margin-top:6px}
.crd-form-section-title{
  height:25px;
  display:flex;
  align-items:center;
  padding:0 8px;
  border-bottom:1px solid #c9b9aa;
  background:#eee5db;
  color:var(--crd-brown,#4a2b19);
  font-size:9px;
  font-weight:900;
}
.crd-form-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;padding:6px}
.crd-field{min-width:0;display:grid;align-content:start;gap:3px;color:#66513f;font-size:8px;font-weight:850}
.crd-field.col-2{grid-column:span 2}.crd-field.col-3{grid-column:span 3}.crd-field.col-4{grid-column:span 4}.crd-field.col-6{grid-column:1/-1}
.crd-field input:not([type=checkbox]),.crd-field select{
  width:100%;
  height:27px;
  margin:0;
  padding:0 7px;
  border:1px solid #8f7864;
  border-radius:2px;
  background:#fff;
  color:var(--crd-ink,#2f2017);
  font-size:9px;
  font-weight:700;
  line-height:25px;
  outline:0;
}
.crd-field input:not([type=checkbox]):focus,.crd-field select:focus{border-color:var(--crd-orange-dark,#a94d08);box-shadow:0 0 0 1px #f2b477}
.crd-choice-boxes{height:27px;display:flex;align-items:stretch;border:1px solid #8f7864;border-radius:2px;overflow:hidden;background:#fff}
.crd-choice-boxes label{min-width:0;flex:1 1 0;display:flex;align-items:center;justify-content:center;gap:3px;padding:0 4px;border-right:1px solid #d8ccc0;background:#fff;color:#4f3a2d;font-size:8px;font-weight:750;white-space:nowrap;cursor:pointer}
.crd-choice-boxes label:last-child{border-right:0}
.crd-choice-boxes label:hover{background:#fff6ea}
.crd-choice-boxes label.on{background:#fff0d9;color:#7e3907;font-weight:900}
.crd-choice-boxes input{width:12px!important;height:12px!important;flex:0 0 12px;margin:0!important;padding:0!important;border:0!important;accent-color:var(--crd-orange,#d56f16)}
.crd-check-row{display:grid;grid-template-columns:68px minmax(0,1fr);border-top:1px solid #c9b9aa}
.crd-check-row:first-of-type{border-top:0}
.crd-check-label{display:flex;align-items:center;padding:0 8px;border-right:1px solid #d8ccc0;background:#faf7f3;color:#66513f;font-size:8px;font-weight:900}
.crd-checks{min-height:31px;display:flex;align-items:center;gap:6px;padding:3px 6px;background:#fff}
.crd-checks label{height:23px;display:inline-flex;align-items:center;gap:3px;color:#3e2c21;font-size:8px;font-weight:750;white-space:nowrap;cursor:pointer}
.crd-checks input{width:13px;height:13px;margin:0;accent-color:var(--crd-orange,#d56f16)}
.crd-editor-foot{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  padding:0 7px;
  border-top:1px solid #c9b9aa;
  background:#f6f1eb;
}
.crd-editor-foot>span{margin-right:auto;color:#725e4e;font-size:8px;font-weight:750;white-space:nowrap}
.crd-editor-foot>span b{color:var(--crd-brown);font-size:10px;font-weight:900}

@media(max-width:1080px){
  .crd-client-meta .crd-sync-state{display:none}
  .crd-metric{min-width:55px;padding:0 5px}
  .crd-command-row{overflow-x:auto}
}
@media(max-width:900px){
  .crd-head{min-height:39px;height:39px}
  .crd-client-meta>span{min-width:86px;padding:4px 7px}
  .crd-command-row{align-items:center;overflow-x:auto}
  .crd-metrics{margin-left:6px}
  .crd-workspace{grid-template-columns:500px 326px;overflow-x:auto}
}
