/* 열린아파트 서비스 — 남색 사이드바와 연두색 현재 메뉴 */
:root { --navy: #152b39; --ink: #172f3b; --muted: #53656e; --lime: #d6f18a; --green: #315d48;
        --line: #d9dfdb; --bg: #f5f5ef; --paper: #fff; --warn: #8a3b1c; --warn-bg: #fbeee8; --amber: #8a6512; --amber-bg: #f8eed4; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
       color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 17px; word-break: keep-all; }
a { color: var(--green); }
.top { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 12px 16px; background: var(--navy); color: #fff; }
.top .estate { font-size: 18px; }
.top .menu { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.top .menu a { color: #d5dfe3; text-decoration: none; }
.top .menu a:hover { color: var(--lime); }
.top .who { margin-left: auto; color: #bdcbd2; font-size: 15px; }
.top form { margin: 0; }
main { max-width: 44rem; margin: 0 auto; padding: 20px 16px 60px; }
main.wide { max-width: 64rem; }
h1 { font-size: 28px; letter-spacing: -.03em; margin: 8px 0 18px; }
h2 { font-size: 19px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.lead { color: var(--muted); margin-top: -6px; }
.hint, small { color: var(--muted); font-size: 15px; }
small { display: block; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 18px; display: grid; gap: 14px; }
details.card > summary { cursor: pointer; font-weight: 700; }
.stack { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
label { display: grid; gap: 4px; font-weight: 600; font-size: 16px; }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=datetime-local], select, textarea {
  font: inherit; padding: 11px 12px; border: 1px solid #cbd4ce; border-radius: 6px; background: #fff; min-height: 48px; width: 100%; }
fieldset.choices { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
fieldset.choices legend { font-weight: 600; font-size: 16px; padding: 0 4px; }
label.choice { display: flex; align-items: center; gap: 6px; font-weight: 500; min-height: 44px; }
input[type=submit], .btn { font: inherit; font-weight: 700; padding: 10px 16px; min-height: 44px; border: 0; border-radius: 6px;
  background: var(--navy); color: #fff; cursor: pointer; }
input[type=submit] { background: var(--lime); color: var(--navy); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #b9c3be; }
.btn.danger { background: var(--warn-bg); color: var(--warn); border: 1px solid #e8c4b5; }
button.link { background: none; border: 0; color: #bdcbd2; text-decoration: underline; cursor: pointer; font: inherit; font-size: 15px; padding: 0; min-height: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid #e7ebe8; }
.rows > li:first-child { border-top: 0; }
.rows > li > div:first-child { min-width: 0; flex: 1 1 16rem; }
.badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--lime); color: var(--navy); font-size: 13px; font-weight: 800; text-align: center; line-height: 22px; }
.warn { color: var(--warn); }
.flash { padding: 12px 14px; border-radius: 6px; }
.flash.ok { background: #e8f4ec; } .flash.err { background: var(--warn-bg); color: var(--warn); }
.empty { color: var(--muted); margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tabs a { padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 6px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.unit-grid .chip { min-height: 48px; }
.chip.occupied { background: #e4efe0; color: var(--green); border-color: #c6dbbf; }
.chip.pending { background: var(--amber-bg); color: var(--amber); border-color: #e8d5a3; }
.chip.empty { background: #fff; color: var(--muted); border-color: var(--line); }
.code { font-size: 28px; font-weight: 800; letter-spacing: .12em; margin: 0; font-variant-numeric: tabular-nums; }
.list { list-style: none; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.list li { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.list li:last-child { border-bottom: 0; }

/* 3단계: 동대표회의·건의 */
h3 { font-size: 18px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.head-row h1 { margin-bottom: 8px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.eyebrow { margin: 0; color: var(--muted); font-size: 15px; }
.meta { color: var(--muted); margin-top: -10px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #0d1b24; border-radius: 6px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.body p { margin: 0 0 8px; }
.files { margin: 0; padding-left: 20px; }
.tally { margin: 0; font-variant-numeric: tabular-nums; }
.note { margin: 0; padding: 10px 12px; background: #f1f6ee; border-radius: 6px; }
.reply { padding: 12px 14px; background: #f1f4f6; border-left: 3px solid var(--navy); border-radius: 4px; }
.reply p { margin: 6px 0 0; }
.table-wrap { overflow-x: auto; }
table.votes { border-collapse: collapse; width: 100%; font-size: 15px; }
table.votes caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
table.votes th, table.votes td { border-top: 1px solid var(--line); padding: 8px 6px; text-align: left; }
table.votes td input[type=radio] { width: 22px; height: 22px; }
.choice-yes { color: var(--green); font-weight: 700; } .choice-no { color: var(--warn); font-weight: 700; }
.chip.draft, .chip.open { background: var(--amber-bg); color: var(--amber); border-color: #e8d5a3; }
.chip.announced, .chip.adopted { background: #e3edf3; color: var(--navy); border-color: #c4d6e1; }
.chip.held { background: #fff; color: var(--ink); border-color: var(--line); }
.chip.closed, .chip.result-approved { background: #e4efe0; color: var(--green); border-color: #c6dbbf; }
.chip.result-rejected { background: var(--warn-bg); color: var(--warn); border-color: #e8c4b5; }
.chip.result-undecided, .chip.result-deferred { background: #fff; color: var(--muted); border-color: var(--line); }
.list small { display: inline; margin-left: 4px; }

/* 동대표회의 전용(비공개) 표시 */
.list .chip { white-space: nowrap; }
.chip.private { background: #efe9f5; color: #4b2f6b; border-color: #d8cbe6; }
.flash.insider { background: #efe9f5; color: #4b2f6b; margin: 0; }
.card.council-only { border-color: #d8cbe6; }

/* 게시판·자료실 */
.chip.library { background: #e3edf3; color: var(--navy); border-color: #c4d6e1; }
.chip.board { background: #fff; color: var(--muted); border-color: var(--line); }
.chip.pin { background: var(--lime); color: var(--navy); }
.list.posts li.pinned { background: #fbfdf3; }
.list.comments li { align-items: flex-start; }
.list.comments p { margin: 2px 0 0; }
.btn.small { min-height: 36px; padding: 4px 10px; font-size: 15px; }
.rich { font-size: 17px; overflow-x: auto; }
.rich img { max-width: 100%; height: auto; }
.rich table { border-collapse: collapse; }
.rich td, .rich th { border: 1px solid var(--line); padding: 6px 8px; }
.rich-editor { display: grid; gap: 6px; }
.rich-editor .sun-editor { font-family: inherit; }
body .sun-editor-editable { font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif; font-size: 17px; }
table.perm { border-collapse: collapse; width: 100%; font-size: 16px; }
table.perm caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
table.perm caption small { display: inline; margin-left: 6px; font-weight: 400; }
table.perm th, table.perm td { border-top: 1px solid var(--line); padding: 10px 8px; text-align: center; }
table.perm th[scope=row] { text-align: left; }
table.perm th[scope=row] small { font-weight: 400; }
table.perm input[type=checkbox] { width: 22px; height: 22px; }

/* 공통 화면 구조: 본문 폭은 오른쪽 작업 영역 안에서 유지한다. */
:root { --sidebar-width: 248px; }
body { overflow-wrap: anywhere; }
.content-area { min-width: 0; }
.with-sidebar .content-area { margin-left: var(--sidebar-width); }
main { width: 100%; padding-top: 36px; }
.auth-page main { padding-top: 48px; }
main :where(.card, .stack, .row, .head-row, .list, .table-wrap, .rich, form, fieldset) { min-width: 0; }
.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list li { align-items: center; }
.list li > span:first-child { min-width: 0; }
.list li > :last-child { flex-shrink: 0; }
main :where(img, video, input, select, textarea) { max-width: 100%; }
main pre { white-space: pre-wrap; overflow-wrap: anywhere; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid #60882a; outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 60; padding: 12px 18px; border-radius: 8px;
  background: var(--lime); color: var(--navy); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.mobile-bar, .sidebar-backdrop, .sidebar-close { display: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); height: 100dvh;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  background: var(--navy); color: #fff; padding: 22px 14px 16px; }
.sidebar-brand { position: relative; padding: 0 12px 18px; border-bottom: 1px solid #ffffff20; }
.brand-caption { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--lime); }
.sidebar .estate { display: block; font-size: 20px; line-height: 1.4; letter-spacing: -.03em; }
.sidebar-nav { padding: 14px 0; }
.nav-group + .nav-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid #ffffff20; }
.sidebar .nav-heading { margin: 0 12px 10px; color: #aabfc9; font-size: 14px; font-weight: 500; }
.sidebar-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px;
  margin-top: 2px; padding: 8px 14px; border-radius: 8px; color: #e0e8ec; text-decoration: none; font-size: 16px; font-weight: 500; }
.sidebar-link:hover { background: #ffffff10; color: #fff; }
.sidebar-link[aria-current="page"] { background: var(--lime); color: var(--navy); font-weight: 750; }
.sidebar-link .badge { flex-shrink: 0; }
.sidebar-link[aria-current="page"] .badge { background: var(--navy); color: var(--lime); }
.sidebar :where(a, button):focus-visible { outline-color: var(--lime); }
.sidebar-account { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid #ffffff20; }
.account-name { display: block; font-size: 16px; line-height: 1.4; }
.account-role { display: block; color: #aabfc9; font-size: 14px; margin-top: 2px; }
.sidebar-account form { margin: 8px 0 0; }
.sidebar-logout { width: 100%; min-height: 40px; border: 1px solid #ffffff35; border-radius: 8px;
  background: transparent; color: #e0e8ec; font: inherit; font-size: 16px; cursor: pointer; }
.sidebar-logout:hover { background: #ffffff10; }
@media (max-width: 899px) {
  .with-sidebar .content-area { margin-left: 0; padding-top: 64px; }
  main { padding-top: 24px; }
  .mobile-bar { position: fixed; inset: 0 0 auto; z-index: 30; height: 64px; display: flex; align-items: center;
    justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--navy); color: #fff; }
  .mobile-bar .estate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0;
    min-height: 48px; padding: 0 10px; border: 1px solid #ffffff35; border-radius: 8px; background: transparent; color: #fff; font: inherit; font-size: 16px; cursor: pointer; }
  .sidebar { width: min(300px, calc(100vw - 48px)); padding-top: 24px; padding-bottom: max(20px, env(safe-area-inset-bottom));
    visibility: hidden; transform: translateX(-100%); transition: transform .2s ease, visibility .2s; }
  .sidebar-brand { padding-top: 48px; }
  .sidebar-close { position: absolute; top: -12px; right: 0; display: flex; align-items: center; gap: 10px; min-height: 48px;
    padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #e0e8ec; font: inherit; font-size: 16px; cursor: pointer; }
  .sidebar-close span { font-size: 26px; }
  .sidebar-link, .sidebar-logout { min-height: 48px; }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .sidebar { visibility: visible; transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: #0a1725a6; }
  .mobile-bar :focus-visible { outline-color: var(--lime); }
  .btn, input[type=submit], .tabs a, label.choice { min-height: 48px; }
}
@media (max-width: 560px) { .row { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* 집행 공고: 진행 막대와 단계 */
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; }
.flow li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 15px; }
.flow li.done { background: #e4efe0; color: var(--green); border-color: #c6dbbf; font-weight: 700; }
.flow li.now { background: var(--lime); color: var(--navy); border-color: var(--lime); font-weight: 700; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.step { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; padding: 14px 16px; display: grid; gap: 8px; }
.step-requested, .step-draft { border-left-color: var(--amber); }
.step-returned { border-left-color: var(--warn); }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-head small { display: inline; margin-left: auto; }
.step-facts { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.step .flash { margin: 0; }
.signature { margin: 0; color: var(--green); font-weight: 700; font-size: 15px; }
.step-edit { display: grid; gap: 8px; }
.chip.requested { background: var(--amber-bg); color: var(--amber); border-color: #e8d5a3; }
.chip.returned { background: var(--warn-bg); color: var(--warn); border-color: #e8c4b5; }
.chip.announce, .chip.direct, .chip.close, .chip.award { background: #e3edf3; color: var(--navy); border-color: #c4d6e1; }
.chip.contract, .chip.work { background: var(--amber-bg); color: var(--amber); border-color: #e8d5a3; }
.chip.complete { background: #e4efe0; color: var(--green); border-color: #c6dbbf; }

/* 내 정보·임시 비밀번호 */
a.account-name { color: #fff; text-decoration: none; }
a.account-name small { display: inline; color: var(--lime); font-size: 13px; margin-left: 4px; }
a.account-name:hover small { text-decoration: underline; }
.flash.temp-password { background: #fffbe8; border: 1px solid #e8d5a3; display: grid; gap: 4px; }
.flash.temp-password p { margin: 0; }
.flash.temp-password .code { font-size: 22px; letter-spacing: .08em; }

/* 민원 */
.chip.c-received { background: var(--amber-bg); color: var(--amber); border-color: #e8d5a3; }
.chip.c-in_progress { background: #e3edf3; color: var(--navy); border-color: #c4d6e1; }
.chip.c-done { background: var(--lime); color: var(--navy); border-color: var(--lime); }
.chip.c-confirmed { background: #e4efe0; color: var(--green); border-color: #c6dbbf; }
.thread { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.thread li { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-width: 92%; }
.thread li.staff { border-left: 4px solid var(--navy); }
.thread li.resident { border-left: 4px solid var(--lime); margin-left: auto; }
.thread li.event { background: #f6f8f5; }
.thread li p { margin: 6px 0 0; }
.photos { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* 첫 화면: 할 일·새 소식 */
.todos { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.todos a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 72px; border-radius: 8px; background: var(--paper);
  border: 1px solid var(--line); border-left: 4px solid var(--lime); color: var(--ink); text-decoration: none; }
.todos a:hover { border-color: var(--navy); }
.todos .todo-count { flex-shrink: 0; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 22px; background: var(--navy); color: var(--lime);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.todos small { display: block; }
.card.news { gap: 18px; }
.news-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.news-head a { font-size: 15px; }
.card.news .rows > li { padding: 8px 0; align-items: baseline; }

/* 시설 예약 */
.tabs.dates { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.tabs.dates a { flex-direction: column; min-width: 58px; justify-content: center; line-height: 1.2; }
.tabs.dates a small { display: block; font-size: 13px; color: inherit; opacity: .8; }
.slots { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.slots li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.slots .slot-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 7.5rem; }
.slots .slot-state { color: var(--muted); font-size: 15px; flex: 1; }
.slots li form { margin: 0; }
.slots li.full { background: #f1f2ee; }
.slots li.full .slot-time { color: var(--muted); }
.slots li.mine { border-color: var(--green); background: #eef6ea; }
.slots li.mine .slot-state { color: var(--green); font-weight: 700; }

/* 관리비 */
.bill-total { font-size: 30px; font-weight: 800; margin: -6px 0 16px; font-variant-numeric: tabular-nums; }
.bill-total small { display: block; font-size: 15px; font-weight: 400; }
table.bill-items td:not(:first-child), table.bill-items th:not(:first-child), table.bills-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
table.bill-items td.up { color: var(--warn); font-weight: 700; }
table.bill-items td.down { color: var(--green); font-weight: 700; }
table.bills-table { font-size: 14px; white-space: nowrap; }

.card.chair-panel { border: 1px solid var(--lime); box-shadow: inset 4px 0 0 var(--lime); }
