/* stonedesk 대시보드 — 공문서 문법의 화면 UI, 모바일 퍼스트, 라이트 전용
   포인트 컬러는 주홍(--accent) 하나만 사용: 섹션 번호·지연·임박·미달 강조 */

:root {
  --paper: #FFFFFF;
  --ink: #171714;
  --body: #3E3E38;
  --muted: #73736B;
  --line: #DCDCD5;
  --track: #ECECE6;
  --plan-tick: #A9A9A0;      /* 계획 눈금 — 무채색 */
  --accent: #C2401F;         /* 주홍 — 유일한 포인트 컬러 */
  --sun: #C97A68;            /* 연한 빨강 — 일요일 */
  --sat: #7690B4;            /* 연한 파랑 — 토요일 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sheet {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 18px 48px;
}

/* ── 문서 헤더 ─────────────────────────── */

.org-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-head .org {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.btn-print {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 3px 10px;
  letter-spacing: 0.06em;
}

.btn-print:hover { background: var(--track); }

.btn-print:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rule-double {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 6px;
  margin: 9px 0 16px;
}

.doc-title {
  margin: 0 0 10px;
  font-family: "Noto Serif KR", "AppleMyungjo", serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.03em;
}

.doc-meta {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-meta li {
  display: flex;
  gap: 12px;
  font-size: 13px;
  padding: 1.5px 0;
}

.doc-meta .label {
  color: var(--muted);
  letter-spacing: 0.14em;
  flex: 0 0 58px;
}

/* ── 섹션 공통 ─────────────────────────── */

.sec { margin-top: 28px; }

.sec-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--ink);
  font-family: "Noto Serif KR", serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.sec-no { color: var(--accent); }

.legend {
  margin-left: auto;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  white-space: nowrap;
}

.legend i {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.legend .lg-fill { width: 13px; height: 3px; background: var(--ink); }
.legend .lg-plan { width: 2px; height: 10px; background: var(--plan-tick); }

/* ── 1. 요약 (개조식) ──────────────────── */

.brief {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief li {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--body);
}

.brief em {
  font-style: normal;
  font-family: "Noto Serif KR", serif;
  font-weight: 700;
  color: var(--ink);
  flex: 0 0 auto;
}

.brief-body { flex: 1; min-width: 0; }
.brief b { color: var(--ink); }
.neg { color: var(--accent); }

/* ── 진행률 밑줄 게이지 ─────────────────── */

.gauge {
  position: relative;
  height: 3px;
  background: var(--track);
  margin-top: 8px;
}

.gauge-lg { height: 5px; margin-top: 10px; }

.gauge i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  background: var(--ink);
}

.gauge .plan {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  background: var(--plan-tick);
}

@media (prefers-reduced-motion: no-preference) {
  .gauge i { animation: gauge-fill 0.7s ease-out; }
  @keyframes gauge-fill { from { width: 0; } }
}

/* ── 2. 과업 목록 ──────────────────────── */

.tasks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task {
  padding: 13px 0 15px;
  border-bottom: 1px solid var(--line);
}

.task:last-child { border-bottom: 0; }

.task-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.task-no {
  font-family: "Noto Serif KR", serif;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--muted);
  flex: 0 0 14px;
}

.task-name {
  margin: 0;
  font-weight: 700;
  font-size: 14.5px;
  flex: 1;
  min-width: 0;
}

.task-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}

.task-edit {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 7px;
}

.task-edit:hover { color: var(--ink); border-color: var(--ink); }

.task-edit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toast {
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.toast-alert { background: var(--accent); }

.task-meta {
  margin: 2px 0 0 22px;
  font-size: 12px;
  color: var(--muted);
}

.task .gauge { margin-left: 22px; }

/* 과업 상세 — 금주 실적 / 차주 계획 / 이슈 / 비고 */

.task-detail { margin: 9px 0 0 22px; }

.td-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
}

.td-label {
  flex: 0 0 30px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.1em;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: center;
  align-self: flex-start;
  padding: 1px 0;
  margin-top: 2px;
}

.td-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  min-width: 0;
}

.td-list li {
  font-size: 12.5px;
  color: var(--body);
  padding: 1px 0;
  padding-left: 11px;
  position: relative;
}

.td-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: 700;
}

.td-text {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--body);
  flex: 1;
  min-width: 0;
}

.td-issue .td-label {
  color: var(--accent);
  border-color: var(--accent);
}

.td-issue .td-text { color: var(--accent); }

/* 과업 내 소통 기록 링크 */

.td-rec-list li { padding-left: 0; }
.td-rec-list li::before { content: none; }

.td-rec-link {
  color: var(--ink);
  text-decoration: none;
}

.td-rec-link:hover .td-rec-kind { border-color: var(--accent); color: var(--accent); }
.td-rec-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.td-rec-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.td-rec-kind {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0 4px;
  margin-right: 5px;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}

.td-rec-att {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}

.btn-row {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.chip-delay {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 6px;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  vertical-align: 1px;
}

/* 상태별 표현 */
.st-done .task-name { font-weight: 600; }
.st-done .task-pct { color: var(--muted); font-weight: 600; }
.st-done .gauge i { background: var(--muted); }

.st-delayed .task-pct { color: var(--accent); }
.st-delayed .gauge i { background: var(--accent); }

.st-planned .task-pct { color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* ── 3. 마일스톤 목록 ──────────────────── */

.ms-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ms {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.ms:last-child { border-bottom: 0; }

.ms-d {
  flex: 0 0 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 3px 0;
  margin-top: 1px;
}

.ms-body { flex: 1; min-width: 0; }

.ms-title {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
}

.ms-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.ms-note { color: var(--accent); }

.st-imminent .ms-d { border-color: var(--accent); color: var(--accent); }
.st-delayed .ms-d { background: var(--accent); border-color: var(--accent); color: #fff; }
.st-done .ms-d { background: var(--track); border-color: var(--track); color: var(--muted); }
.st-done .ms-title { font-weight: 500; color: var(--body); }

/* ── 소통 기록 (목록·대시보드 공용) ─────── */

.doc-sub {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.sec-link {
  margin-left: auto;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0;
}

.sec-link:hover { color: var(--accent); }

.sec-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 4px;
}

.filter-chip {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 3px 12px;
}

.filter-chip:hover { border-color: var(--ink); color: var(--ink); }

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 타임라인 */

.timeline { margin-top: 6px; }

.tl-day { margin-top: 18px; }

.tl-date {
  margin: 0 0 2px;
  font-family: "Noto Serif KR", serif;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tl-date::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.tl-date.is-sun { color: var(--sun); }
.tl-date.is-sat { color: var(--sat); }

/* 참조용 미니 달력 */

.mini-cal {
  width: 226px;
  margin: 16px 0 2px auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px 8px;
}

@media (max-width: 480px) {
  .mini-cal { margin-left: 0; }
}

.mc-title {
  margin: 0 0 6px;
  font-family: "Noto Serif KR", serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.mc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}

.mc-w {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 3px;
}

.mc-w.is-sun { color: var(--sun); }
.mc-w.is-sat { color: var(--sat); }

.mc-d {
  position: relative;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--body);
  padding: 2px 0 5px;
  line-height: 1.3;
}

.mc-d.is-sun { color: var(--sun); }
.mc-d.is-sat { color: var(--sat); }

.mc-d.is-base {
  background: var(--ink);
  color: #fff !important;
  font-weight: 700;
  border-radius: 2px;
}

.tl-items {
  margin: 0;
  padding: 0 0 0 5px;
  list-style: none;
  border-left: 2px solid var(--line);
  margin-left: 4px;
}

.tl-item {
  position: relative;
  padding: 11px 0 12px 15px;
}

.tl-item + .tl-item { border-top: 1px dashed var(--line); }

.tl-marker {
  position: absolute;
  left: -10px;
  top: 17px;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.tl-meeting .tl-marker { background: var(--ink); }
.tl-call .tl-marker { border-style: dashed; }
.tl-kakao .tl-marker { border-color: var(--muted); background: var(--track); }

.tl-head {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 34px;
}

.tl-body .rec-meta,
.tl-body .rec-summary { margin-left: 42px; }

@media (max-width: 480px) {
  .tl-body .rec-meta,
  .tl-body .rec-summary { margin-left: 0; }
}

.rec-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.rec {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.rec:last-child { border-bottom: 0; }

.rec-list-compact .rec { padding: 10px 0; border-bottom-style: dashed; }

.kind {
  flex: 0 0 46px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 3px 0;
  margin-top: 2px;
  letter-spacing: 0.06em;
}

.kind-meeting { background: var(--ink); color: #fff; }
.kind-mail    { color: var(--ink); }
.kind-call    { color: var(--ink); border-style: dashed; }
.kind-kakao   { background: var(--track); border-color: var(--track); color: var(--body); }

.rec-body { flex: 1; min-width: 0; }

.rec-title {
  display: inline-block;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
}

.rec-title:hover { text-decoration: underline; text-underline-offset: 3px; }

.rec-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rec-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.rec-summary {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--body);
}

.rec-empty {
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── 소통 기록 상세 ─────────────────────── */

.rc-kind-row { margin: 0 0 8px; }
.rc-title { font-size: 19px; }

.rc-summary {
  margin: 0;
  font-size: 14px;
  color: var(--body);
}

.rc-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rc-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.rc-actions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rc-action {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.rc-action:last-child { border-bottom: 0; }

.rc-due {
  flex: 0 0 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  padding: 1px 0;
}

.rc-what {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
}

.rc-who { color: var(--muted); font-size: 12.5px; }

.sec-count {
  margin-left: auto;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.att-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.att {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}

.att:last-child { border-bottom: 0; }

.att-icon { flex: 0 0 20px; text-align: center; }

.att-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.att-name:hover { color: var(--accent); }

.att-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.att-meta {
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}

.att-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* ── 문서 푸터 ─────────────────────────── */

.doc-foot { margin-top: 34px; }

.doc-foot .attach {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--body);
}

.doc-foot .rule { border-top: 1px solid var(--ink); }

.foot-meta {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── 넓은 화면 보정 ─────────────────────── */

@media (min-width: 640px) {
  .sheet { padding: 40px 24px 64px; }
  .doc-title { font-size: 26px; }
  .task-name { font-size: 15px; }
  .ms-title { font-size: 14.5px; }
}
