:root {
  --green: #217346;
  --green-dark: #185c37;
  --green-soft: #e8f2ec;
  --line: #d4d4d4;
  --head: #f0f0f0;
  --text: #252423;
  --muted: #5f6368;
  --red: #b3261e;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 12px/1.4 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; color: var(--text); background: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 로그인 */
.login { height: 100%; display: grid; place-items: center; background: var(--head); }
.login-box { width: 280px; padding: 24px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); display: grid; gap: 12px; }
.login-title { font-size: 15px; font-weight: 600; }
.login label { display: grid; gap: 4px; color: var(--muted); }
.login input { padding: 6px 8px; border: 1px solid var(--line); }
.login button { padding: 7px; background: var(--green); color: #fff; border: 0; cursor: pointer; }
.login-err { margin: 0; min-height: 1.4em; color: var(--red); }

/* 틀 */
.app { height: 100%; display: flex; flex-direction: column; }
.titlebar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--green); color: #fff; }
.tb-file { font-weight: 600; }
.tb-spacer { flex: 1; }
.tb-home { padding: 2px 8px; border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; font-weight: 600; cursor: pointer; }
.tb-home.on { background: #fff; color: var(--green-dark); border-color: #fff; cursor: default; }
.tb-mode { margin-left: 8px; font-weight: 400; opacity: .9; }
.dbbtn { padding: 1px 8px; border: 1px solid var(--green); background: var(--green); color: #fff; line-height: 14px; cursor: pointer; }
.tb-pick { display: flex; align-items: center; gap: 6px; }
.tb-pick select { padding: 2px 6px; border: 1px solid rgba(255,255,255,.5); background: #fff; color: var(--text); }
.tb-btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); padding: 2px 8px; cursor: pointer; }
.ribbon { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 12px; background: var(--head); border-bottom: 1px solid var(--line); }
.ribbon label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.ribbon input { padding: 3px 6px; border: 1px solid var(--line); background: #fff; }
.ribbon button { padding: 4px 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.formulabar { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 26px; }
.fb-name { width: 64px; padding: 4px 8px; border-right: 1px solid var(--line); text-align: center; }
.fb-fx { padding: 4px 10px; color: var(--muted); font-style: italic; border-right: 1px solid var(--line); }
.fb-text { flex: 1; padding: 4px 8px; max-height: 4.4em; overflow: auto; white-space: pre-wrap; }

.work { flex: 1; display: flex; min-height: 0; }
.side, .center { display: flex; flex-direction: column; min-height: 0; }
.side { background: #fafafa; }
.side.left { width: 400px; border-right: 1px solid var(--line); }
.side.right { width: 420px; border-left: 1px solid var(--line); }
.center { flex: 1; min-width: 0; }
.pane-head { padding: 6px 12px; background: var(--head); border-bottom: 1px solid var(--line); font-weight: 600; }
.pane-body { flex: 1; min-height: 0; overflow: auto; }

/* 탭: 가운데는 위쪽, 왼쪽은 아래쪽(시트 탭) */
.tabs { display: flex; overflow-x: auto; background: var(--head); }
.tabs button { flex: none; padding: 6px 12px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button small { margin-left: 4px; }
/* 새 건 표시: 탭 이름 마지막 글자 위의 빨간 점 */
.tl { position: relative; }
.tl.new::after { content: ''; position: absolute; top: -4px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: #e02424; }
.tabs button.on { background: #fff; color: var(--green-dark); font-weight: 600; }
.toptabs { border-bottom: 1px solid var(--line); }
.toptabs button.on { box-shadow: inset 0 -2px 0 var(--green); }
.bottomtabs { display: block; border-top: 1px solid var(--line); }
.tabrow { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabrow:last-child { border-bottom: 0; }
.rowlabel { flex: none; width: 76px; padding: 6px 8px; background: #e4e4e4; color: #4d4d4d; font-weight: 600; border-right: 1px solid var(--line); }
.bottomtabs button { border-right: 1px solid var(--line); }
.bottomtabs button.on { box-shadow: inset 0 -2px 0 var(--green); }

/* 컨셉 단계: 계정컨셉 양식의 선택 줄, 계정리스트의 거르기 줄 */
.stagepick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stagepick button, .stagechips button { padding: 4px 6px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.stagepick button.on, .stagechips button.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.stagepick button:disabled { cursor: default; color: var(--muted); }
.stagepick button.on:disabled { color: #fff; }
.stagechips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 12px; vertical-align: middle; font-weight: 400; }
.stagechips small { margin-left: 4px; color: inherit; opacity: .7; }
/* 사진 진행상황: 단계별 머리글 칸 + 체크 칸 */
.photostages { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); }
.form .photostages label, .right-body .photostages label { display: grid; gap: 0; color: inherit; border-right: 1px solid var(--line); }
.photostages label:last-child { border-right: 0; }
.photostages span { padding: 5px 2px; background: #3b4a63; color: #fff; font-weight: 600; text-align: center; line-height: 1.3; }
.photostages input[type=checkbox] { width: 18px; height: 18px; margin: 7px auto; padding: 0; }
.drop { border: 1px solid var(--line); background: #fff; padding: 6px 8px; display: grid; gap: 4px; }
.drop b { margin-right: 8px; }
.form { padding: 12px; display: grid; gap: 9px; }
.form h2, .side.right h2 { margin: 0; font-size: 13px; }
.form label, .side.right label { display: grid; gap: 3px; color: var(--muted); }
.form label.check { display: flex; align-items: center; gap: 6px; color: var(--text); }
.form input:not([type=checkbox]), .form select, .form textarea,
.side.right input, .side.right textarea { padding: 5px 7px; border: 1px solid var(--line); background: #fff; color: var(--text); width: 100%; }
.form textarea { min-height: 150px; resize: vertical; }
.form textarea.short, .side.right textarea { min-height: 64px; resize: vertical; }
.form :disabled { background: #f1f1f1; color: #555; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.acts button { padding: 5px 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.acts button.pri { background: var(--green); border-color: var(--green); color: #fff; }
.acts button.warn { border-color: var(--red); color: var(--red); }
.concept { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 7px 9px; white-space: pre-wrap; }
.concept b { display: block; }

/* 가운데: 구역 띠 + 표 */
.band { position: sticky; left: 0; padding: 7px 12px; background: var(--green-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 600; color: var(--green-dark); }
.band small { font-weight: 400; color: var(--muted); margin-left: 8px; }
.scroll-x { overflow-x: auto; }
.grid { border-collapse: collapse; table-layout: fixed; margin-bottom: 14px; }
.grid th, .grid td { border: 1px solid var(--line); height: 24px; padding: 4px 7px; line-height: 14.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid thead th { background: var(--head); font-weight: 400; color: var(--muted); text-align: center; }
.grid thead tr.names th { color: var(--text); font-weight: 600; text-align: left; }
.grid .rownum { width: 36px; padding: 4px; background: var(--head); color: #4d4d4d; font-weight: 600; text-align: center; }
.grid tbody tr.sel td { background: var(--green-soft); }
.grid tbody tr.sel .rownum { background: #cfe3d6; color: var(--green-dark); }
.grid td.cur { outline: 2px solid var(--green); outline-offset: -2px; }
.grid tr.gone td:not(.rownum) { color: #999; text-decoration: line-through; }
.grid a { color: #0b57d0; }
.grid td.empty { color: var(--muted); text-align: center; height: 36px; }
.st { display: inline-block; padding: 0 6px; border-radius: 2px; line-height: 18px; }
.st-원고등록, .st-수정완료 { background: #ffed99; }
.st-수정요청 { background: #ffc799; }
.st-승인 { background: #cce0ff; }
.st-게시중 { background: #d1f0d1; }
.st-삭제됨 { background: #e0e0e0; }

/* 스케쥴표(달력) */
.cal { width: 100%; min-width: 640px; }
.cal thead tr.names th { text-align: center; }
.cal thead th.sun, .cal .dnum.sun { color: var(--red); }
.cal td.daycell { height: 104px; padding: 3px; vertical-align: top; white-space: normal; }
.cal td.daycell.out { background: #fafafa; }
.cal td.daycell.today { box-shadow: inset 0 0 0 2px var(--green); }
.cal .dnum { font-size: 10.6px; font-weight: 600; color: #4d4d4d; padding: 0 2px 2px; }
.chip { display: block; width: 100%; margin-bottom: 2px; padding: 1px 5px; border: 1px solid transparent; border-left: 3px solid #999; border-radius: 2px; background: #eee; text-align: left; font-size: 10.6px; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chip.t-후기 { border-left-color: #7b3fb5; }
.chip.t-여론글 { border-left-color: var(--green); }
.chip.t-여론댓글 { border-left-color: #0b57d0; }
.chip.st-원고등록, .chip.st-수정완료 { background: #ffed99; }
.chip.st-수정요청 { background: #ffc799; }
.chip.st-승인 { background: #cce0ff; }
.chip.st-게시중 { background: #d1f0d1; }
.chip.st-삭제됨 { background: #e0e0e0; text-decoration: line-through; color: #999; }
.chip.slot { background: #fff; border: 1px dashed #999; border-left: 3px solid #7b3fb5; color: var(--muted); }
.chip.slot.late { border-color: var(--red); color: var(--red); }
.chip.cur { outline: 2px solid var(--green); outline-offset: -1px; }
.chip.more { background: none; border-left-color: transparent; color: var(--muted); }

/* 라이안 화면의 일정: 월 이동 버튼, 달력 옆 그날 목록 */
.calnav { display: inline-flex; align-items: center; gap: 4px; margin-left: 12px; vertical-align: middle; }
.calnav b { min-width: 92px; text-align: center; color: var(--text); }
.calnav button { padding: 2px 9px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 400; cursor: pointer; }
.calsplit { display: flex; align-items: flex-start; }
.calmain { flex: 1; min-width: 0; overflow-x: auto; }
.daylist { flex: none; width: 340px; border-left: 1px solid var(--line); background: #fff; }
.dayhead { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; background: var(--head); border-bottom: 1px solid var(--line); }
.dayrow { padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dayrow:hover { background: #f7faf8; }
.dayrow.on { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.dayline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dayline b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dayline .muted { flex: none; font-size: 10.6px; }
.daytype { flex: none; padding: 0 5px; border-radius: 2px; color: #fff; font-size: 10.6px; line-height: 16px; }
.daytype.t-후기 { background: #7b3fb5; }
.daytype.t-여론글 { background: var(--green); }
.daytype.t-여론댓글 { background: #0b57d0; }
.daysum { margin-top: 6px; display: grid; gap: 5px; }
.dayfacts { display: flex; flex-wrap: wrap; gap: 4px; }
.dayfacts span { padding: 1px 6px; border: 1px solid var(--line); background: #fff; }
.dayexcerpt { white-space: pre-wrap; overflow-wrap: anywhere; color: #444; }
.dayempty { padding: 14px 10px; margin: 0; }
.cal td.daycell.selday { background: var(--green-soft); }
@media (max-width: 1500px) {
  .calsplit { display: block; }
  .daylist { width: auto; border-left: 0; border-top: 1px solid var(--line); }
}

/* 업체 글자(B·A·S)와 라이안 일정표의 업체 거르기 */
.vcode { display: inline-block; min-width: 14px; margin-right: 4px; padding: 0 3px; border-radius: 2px; background: #555; color: #fff; font-weight: 700; font-size: 10.6px; line-height: 14px; text-align: center; text-decoration: none; }
.vcode.v-brite { background: #7b4a2a; }
.vcode.v-adp { background: #0e7490; }
.vcode.v-think { background: #ea7a0c; }
.vendorchips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 12px; vertical-align: middle; font-weight: 400; }
.vendorchips button { padding: 3px 8px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.vendorchips button.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); font-weight: 600; }

/* 일정 달력의 유형 선택: 달력 칸의 유형 색과 같은 배경색 */
.typechips { display: inline-flex; gap: 4px; margin-left: 12px; vertical-align: middle; }
.typechips button { padding: 3px 12px; border: 0; border-radius: 2px; color: #fff; font-weight: 400; opacity: .4; cursor: pointer; }
.typechips button.on { opacity: 1; font-weight: 600; }
.typechips .t-전체 { background: #555; }
.typechips .t-후기 { background: #7b3fb5; }
.typechips .t-여론글 { background: var(--green); }
.typechips .t-여론댓글 { background: #0b57d0; }

/* 월 탭, 계정리스트 검색 */
.subtabs { border-bottom: 1px solid var(--line); background: #fff; }
.subtabs button { padding: 5px 11px; }
.subtabs button.on { box-shadow: inset 0 -2px 0 var(--green); }
.band select { margin-left: 12px; padding: 3px 6px; border: 1px solid var(--line); background: #fff; font-weight: 400; }
.band input { margin-left: 12px; width: 280px; max-width: 60%; padding: 3px 6px; border: 1px solid var(--line); background: #fff; font-weight: 400; }

/* 사진 붙여넣기 */
.pastebox { border: 1px dashed #999; background: #fff; padding: 14px 8px; text-align: center; color: var(--muted); cursor: pointer; }
.pastebox:focus { outline: 2px solid var(--green); outline-offset: -2px; color: var(--green-dark); }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border: 1px solid var(--line); background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; line-height: 18px; cursor: pointer; }
.thumbs.big .thumb { width: 120px; height: 120px; }

/* 오른쪽: 요약 */
.right-body { padding: 12px; display: grid; gap: 10px; align-content: start; }
.side.right h2 { display: flex; align-items: center; gap: 8px; }
.sum-list { margin: 0; display: grid; grid-template-columns: 76px 1fr; gap: 4px 8px; }
.sum-list dt { color: var(--muted); }
.sum-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.textbox { background: #fff; border: 1px solid var(--line); padding: 7px 9px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.note { background: #fff4e5; border: 1px solid #ffc799; padding: 6px 8px; white-space: pre-wrap; }
.sec { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.muted { color: var(--muted); }

.bottom { display: flex; align-items: center; border-top: 1px solid var(--line); background: var(--head); }
.bt-file { padding: 4px 12px; font-weight: 600; color: var(--green-dark); }
.statusbar { margin-left: auto; padding: 4px 12px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); background: #323232; color: #fff; padding: 8px 16px; border-radius: 3px; z-index: 10; }

@media (max-width: 1000px) {
  .work { flex-direction: column; overflow: auto; }
  .side.left, .side.right { width: auto; border: 0; border-bottom: 1px solid var(--line); }
  .side, .center { flex: none; }
  .pane-body { overflow: visible; }
}
