/* 의정지원 화면 스타일 (2026-12 재구축) */
:root {
  --bg: #F4F6FA; --paper: #FFFFFF; --quiet: #EEF1F6; --line: #DDE2EB; --line-strong: #C5CCD8;
  --ink: #172033; --sub: #4F5B70; --mute: #7A8599;
  --brand: #1F3A8A; --brand-ink: #FFFFFF; --brand-soft: #E7ECFA; --brand-hover: #18307A;
  --ok: #17694A; --ok-soft: #E3F4EC; --warn: #8A5A00; --warn-soft: #FFF3D6; --danger: #B3261E; --danger-soft: #FDE8E6;
  --info: #1D5FA8; --info-soft: #E5F0FB;
  --radius: 14px; --radius-s: 10px; --tap: 44px;
  --shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 4px 14px rgba(23, 32, 51, .05);
  --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.boot { padding: 40px; color: var(--sub); }
[hidden] { display: none !important; }

/* 앱 틀 */
.app { min-height: 100vh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.office-name { color: var(--sub); font-size: 13px; font-weight: 600; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 18px 16px 96px; max-width: 1080px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--mute); text-decoration: none; font-size: 12px; font-weight: 600; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--brand); }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--side) 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 18px 12px; background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; }
  .side .brand { padding: 4px 8px 2px; font-size: 17px; }
  .side .office-name { padding: 0 8px 14px; max-width: none; white-space: normal; }
  .side a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--sub); text-decoration: none; font-weight: 600; font-size: 14px; }
  .side a svg { width: 19px; height: 19px; flex: none; }
  .side a:hover { background: var(--quiet); color: var(--ink); }
  .side a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
  .side .group { margin: 14px 10px 4px; color: var(--mute); font-size: 12px; font-weight: 700; }
  .side .soon { margin-left: auto; font-size: 11px; color: var(--mute); font-weight: 600; }
  .topbar, .tabbar { display: none; }
  .main { padding: 28px 32px 48px; }
}

/* 머리말 */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; line-height: 1.25; }
.head p { margin: 4px 0 0; color: var(--sub); }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 카드·목록 */
.grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: 16px; letter-spacing: -.01em; }
.card h2 small { color: var(--mute); font-weight: 600; font-size: 13px; }
.empty { padding: 14px 4px; color: var(--mute); font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.row { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 11px 2px; background: none; border: 0; text-align: left; cursor: pointer; }
.row:hover { background: var(--quiet); border-radius: 8px; }
.row .main-t { flex: 1; min-width: 0; }
.row .title { font-weight: 650; }
.row .meta { margin-top: 2px; color: var(--sub); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.row .side-t { flex: none; text-align: right; color: var(--sub); font-size: 13px; }
.time { flex: none; width: 52px; color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; padding-top: 1px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--sub); font-size: 13px; }

/* 칩 */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--quiet); color: var(--sub); white-space: nowrap; }
.chip.received { background: var(--info-soft); color: var(--info); }
.chip.department_inquiry { background: var(--warn-soft); color: var(--warn); }
.chip.response_received { background: #EFE8FB; color: #5B3BA0; }
.chip.completed { background: var(--ok-soft); color: var(--ok); }
.chip.on_hold { background: var(--quiet); color: var(--mute); }
.chip.urgent { background: var(--danger); color: #fff; }
.chip.high { background: var(--danger-soft); color: var(--danger); }
.chip.low { background: var(--quiet); color: var(--mute); }
.chip.late { background: var(--danger-soft); color: var(--danger); }
.chip.soon { background: var(--warn-soft); color: var(--warn); }
.chip.cat { background: var(--brand-soft); color: var(--brand); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border-radius: var(--radius-s); border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-hover); }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--quiet); }
.btn.danger { background: var(--paper); color: var(--danger); border-color: #EBB7B2; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }

/* 입력 */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > label, .lbl { font-weight: 650; font-size: 13px; color: var(--sub); }
.field .hint { color: var(--mute); font-size: 12px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--paper); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.inline { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.inline.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 520px) { .inline.three { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; }
.check input { width: 18px; height: 18px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 13px; font-weight: 650; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"] { flex: 1; min-width: 180px; }
.note { padding: 10px 12px; border-radius: var(--radius-s); background: var(--quiet); color: var(--sub); font-size: 13px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.err { padding: 10px 12px; border-radius: var(--radius-s); background: var(--danger-soft); color: var(--danger); font-size: 14px; margin-bottom: 12px; }

/* 시트(모달) */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .38); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .12); }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 18px; max-height: 88vh; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.sheet-foot .grow { margin-right: auto; }

/* 민원 상세 */
.steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 4px; }
.steps button { flex: 1 1 auto; min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 13px; font-weight: 700; cursor: pointer; }
.steps button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--brand); }
.timeline .when { color: var(--mute); font-size: 12px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--mute); font-weight: 600; }
.kv dd { margin: 0; }
.masked { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* 달력 */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--quiet); text-align: center; font-size: 12px; font-weight: 700; color: var(--sub); padding: 6px 0; }
.cal .dow.sun, .cal .day.sun .n { color: #C2362F; }
.cal .dow.sat, .cal .day.sat .n { color: #2459B8; }
.cal .day { min-width: 0; overflow: hidden; background: var(--paper); min-height: 78px; padding: 4px 5px; border: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.cal .day.out { background: #FAFBFD; color: var(--mute); }
.cal .day.out .n { opacity: .5; }
.cal .day .n { font-size: 12px; font-weight: 700; }
.cal .day.today .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; }
.cal .day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .ev { font-size: 11px; line-height: 1.3; padding: 1px 4px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .more { font-size: 11px; color: var(--mute); }
@media (max-width: 640px) { .cal .day { min-height: 54px; } .cal .ev { display: none; } .cal .day .dots { display: flex; gap: 2px; } }
.cal .dots { display: none; }
.cal .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.monthnav { display: flex; align-items: center; gap: 8px; }
.monthnav strong { font-size: 18px; min-width: 120px; text-align: center; }

/* 알림 */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); z-index: 80; padding: 10px 16px; border-radius: 12px; background: #1E2638; color: #fff; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 로그인 */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 24px; }
.auth h1 { margin: 10px 0 4px; font-size: 22px; letter-spacing: -.03em; }
.auth p.sub { margin: 0 0 18px; color: var(--sub); }
.auth .alt { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }

/* 준비 중 화면 */
.soon-list { display: grid; gap: 10px; }
.soon-item { display: flex; gap: 12px; align-items: flex-start; }
.soon-item .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.soon-item h3 { margin: 0; font-size: 15px; }
.soon-item p { margin: 2px 0 0; color: var(--sub); font-size: 13px; }
@media print { .side, .topbar, .tabbar, .head .actions, .toolbar { display: none !important; } .main { padding: 0; } .card { box-shadow: none; } }
