/* Additions for the working app. Tokens only (see css/style.css and DESIGN.md). */

/* Components like .notice set display:flex, which would override the hidden attribute */
[hidden] { display: none !important; }

/* Sidebar items for screens that are not built yet */
.nav-link.is-soon { color: var(--fg-muted); cursor: default; }
.nav-link.is-soon:hover { background: none; }
.nav-link .soon { margin-left: auto; font-size: 12px; font-weight: 500; }

/* Rows that are switched off (사용 중지) */
.table tr.is-off .strong { color: var(--fg-muted); }

.loading-row td { color: var(--fg-muted); }

/* 개인정보 수집·이용 동의 (consent.html) */
.consent-card { max-width: 560px; }
.consent-terms { display: grid; gap: var(--s4); padding: var(--s4); background: var(--bg); border-radius: var(--r-control); }
.consent-check { height: auto; min-height: 40px; padding: var(--s3); align-items: flex-start; }
.consent-check input { margin-top: var(--s1); }

/* 업무 담당자 찾기 창 (person-picker.js) */
.picker-dialog { max-width: 640px; }
.picker-search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s2); align-items: end; }
.picker-results { max-height: 320px; overflow-y: auto; }
.picker-results thead th { position: sticky; top: 0; background: var(--surface); }
@media (max-width: 767px) { .picker-search { grid-template-columns: 1fr; } }

/* 승인 관리 상태별 개수 (review-list.js) — 누른 칸 표시 */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
button.stat[aria-pressed="true"] { background: var(--primary-soft); }
button.stat[aria-pressed="true"] .t-label { color: var(--primary); }

/* 기안문 편집·미리보기 (draft-editor.js · draft-document.js) — A4(210×297mm) 비율의 문서 */
.draft-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); align-items: start; }
@media (min-width: 1280px) {
  .draft-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .draft-side { position: sticky; top: var(--s6); }
}
.draft-section { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-control); }
.draft-paper { background: var(--bg); border-radius: var(--r-surface); padding: var(--s4); overflow-x: auto; }
.draft-doc { width: 100%; max-width: 210mm; aspect-ratio: 210 / 297; margin: 0 auto; padding: var(--s10) var(--s8);
  background: var(--surface); color: var(--fg); font-size: 14px; line-height: 22px; }
.draft-org { text-align: center; font-size: 16px; line-height: 24px; font-weight: 600; }
.draft-doc-title { text-align: center; font-size: 24px; line-height: 32px; font-weight: 700; margin-bottom: var(--s6); }
.draft-sign { margin: 0 0 var(--s6) auto; border-collapse: collapse; }
.draft-sign th, .draft-sign td { border: 1px solid var(--fg); padding: var(--s1) var(--s2); text-align: center;
  font-size: 12px; line-height: 18px; font-weight: 600; min-width: calc(var(--s12) + var(--s4)); }
.draft-sign td { height: var(--s12); }
.draft-sign .draft-sign-head { min-width: 0; width: var(--s6); background: var(--bg); }
.draft-meta { width: 100%; border-collapse: collapse; margin-bottom: var(--s4); }
.draft-meta th, .draft-meta td { border: 1px solid var(--fg); padding: var(--s2) var(--s3); text-align: left; vertical-align: top; }
.draft-meta th { width: 25%; background: var(--bg); font-weight: 600; text-align: center; }
.draft-subject { padding: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--fg); margin-bottom: var(--s4); }
.draft-subject .strong { margin-right: var(--s3); }
.draft-body { display: grid; gap: var(--s4); }
.draft-body h3 { font-size: 14px; line-height: 22px; font-weight: 600; margin-bottom: var(--s1); }
.draft-body .pre { padding-left: var(--s4); white-space: pre-wrap; }
.draft-attach { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); }
.draft-empty { color: var(--fg-muted); }

@media print {
  @page { size: A4; margin: 20mm; }
  body { background: var(--surface); }
  .sidebar, .topbar, .drawer-backdrop, .nav-toggle, #draft-root > .page-header, #draft-root > .notice, #draft-root > .hint,
  .draft-grid > :first-child, .draft-side > :not(:first-child), .draft-side h2 { display: none !important; }
  .main { margin: 0; padding: 0; }
  .draft-grid { display: block; }
  .draft-side { position: static; }
  .draft-paper { padding: 0; background: none; border-radius: 0; overflow: visible; }
  .draft-doc { max-width: none; aspect-ratio: auto; padding: 0; }
  .draft-empty { visibility: hidden; }
}

/* 시스템 알림 (notifications.js) — 확인하지 않은 알림은 굵게 + ‘새 알림’ 표시 */
.noti-link { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); min-width: 0; padding: 0;
  border: 0; background: none; text-align: left; cursor: pointer; }
.noti-link:hover .strong, .noti-link:hover > span:nth-child(2) { text-decoration: underline; text-underline-offset: 2px; }

/* 사이드바 로고 → 역할별 대시보드 */
a.sidebar-brand:hover .t-title { text-decoration: underline; text-underline-offset: 2px; }
