:root {
  --sun: #f5a623; --sun-deep: #e08a00; --sun-soft: #ffd27a;
  --field: #3c7d3e; --field-deep: #2c5e2e; --field-soft: #6aa86c;
  --ink: #2a2622; --ink-soft: #5b554d; --ink-faint: #8a8278;
  --paper: #fffdf8; --paper-warm: #fff8ec; --paper-field: #f4faf2;
  --line: rgba(60, 125, 62, 0.16); --line-sun: rgba(224, 138, 0, 0.22);
  --warn: #b4531a; --warn-soft: #fdeee3;
  --serif: "Gowun Batang", "Pretendard Variable", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.6;
  -webkit-font-smoothing: antialiased; }
a { color: var(--field-deep); }
button, input, select { font: inherit; }
.hidden { display: none !important; }

/* 상단 */
header.top { position: sticky; top: 0; z-index: 50; background: rgba(255,248,236,0.94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-sun); }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 0.65rem 16px;
  display: flex; align-items: center; gap: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line-sun); }
.brand small { display: block; font-size: 0.7rem; font-weight: 500; color: var(--ink-faint); }
.spacer { flex: 1; }
.who { font-size: 0.85rem; color: var(--ink-soft); }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 999px;
  padding: 0.4rem 0.95rem; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--field-soft); color: var(--field-deep); }
.btn.primary { background: var(--field); border-color: var(--field); color: #fff; }
.btn.primary:hover { background: var(--field-deep); color: #fff; }

/* 로그인 */
#login { max-width: 380px; margin: 12vh auto 0; padding: 2rem 1.6rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); }
#login h1 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 0.2rem; }
#login p { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 1.2rem; }
.field { margin-bottom: 0.8rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.25rem; }
.field input { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.field select { padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }  /* 칸 높이를 입력칸과 맞춤 */
.pick2 { display: flex; gap: 0.4rem; max-width: 34rem; }  /* 조합·모임 두 칸 같은 너비 */
.pick2 select { flex: 1; min-width: 0; }
.field input:focus { outline: 2px solid var(--field-soft); outline-offset: -1px; }
#login .btn.primary { width: 100%; padding: 0.7rem; font-size: 0.95rem; border-radius: 10px; }
.msg { font-size: 0.86rem; margin-top: 0.8rem; min-height: 1.2em; }
.msg.err { color: var(--warn); }

/* 본문 */
main { max-width: 1280px; margin: 0 auto; padding: 1.4rem 16px 4rem; }
h1.title { font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2rem); }
.lead { color: var(--ink-faint); font-size: 0.88rem; margin-bottom: 1.2rem; }
.tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tab { background: none; border: none; padding: 0.6rem 0.9rem; font-size: 0.92rem; font-weight: 600;
  color: var(--ink-faint); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--field-deep); border-bottom-color: var(--field); }
.tab .n { font-size: 0.75rem; font-weight: 700; color: var(--ink-faint); margin-left: 0.2rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem; margin-bottom: 1.4rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.card .k { font-size: 0.8rem; color: var(--ink-faint); font-weight: 600; }
.card .v { font-size: 1.7rem; font-weight: 800; color: var(--field-deep); font-variant-numeric: tabular-nums; line-height: 1.3; }
.card .v small { font-size: 0.8rem; font-weight: 600; color: var(--ink-faint); margin-left: 0.15rem; }
.card .s { font-size: 0.78rem; color: var(--ink-soft); }
.card.sun .v { color: var(--sun-deep); }

.section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.2rem; overflow: hidden; }
.section-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); background: var(--paper-field); }
.section-head h2 { font-size: 1rem; }
.section-head .note { font-size: 0.8rem; color: var(--ink-faint); }
.section-head input, .section-head select { padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 0.85rem; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th { text-align: left; font-size: 0.76rem; color: var(--ink-faint); font-weight: 700; padding: 0.55rem 0.8rem; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 0.55rem 0.8rem; border-bottom: 1px solid rgba(60,125,62,0.08); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.faint { color: var(--ink-faint); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 999px; background: #eef5ec; font-size: 0.85rem; }
.chip button { border: none; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: #777; padding: 0; }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.08rem 0.5rem; border-radius: 999px;
  background: var(--paper-field); color: var(--field-deep); border: 1px solid var(--line); white-space: nowrap; margin: 0 0.15rem 0.15rem 0; }
.pill.sun { background: #fff6e2; color: var(--sun-deep); border-color: var(--line-sun); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(180,83,26,0.25); }
.pill.gray { background: #f3f1ee; color: var(--ink-faint); border-color: #e6e2dc; }
.empty { padding: 1.6rem 1rem; text-align: center; color: var(--ink-faint); font-size: 0.9rem; }
.blocked { padding: 1rem; font-size: 0.88rem; color: var(--warn); background: var(--warn-soft); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } .hide-sm { display: none; } }
.bars { padding: 0.8rem 1rem; }
.bar { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; align-items: center; gap: 0.6rem; font-size: 0.85rem; margin: 0.3rem 0; }
.bar .track { height: 10px; background: var(--paper-field); border-radius: 5px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--field-soft); border-radius: 5px; }
.bar .cnt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.8rem 1rem; }

/* 동작 버튼·모달 */
.acts { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.act { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 0.12rem 0.5rem;
  font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.act:hover { border-color: var(--field-soft); color: var(--field-deep); }
.act.go { background: var(--field); border-color: var(--field); color: #fff; }
.act.stop { color: var(--warn); border-color: rgba(180,83,26,0.3); }
.role-badge { font-size: 0.72rem; font-weight: 700; padding: 0.08rem 0.5rem; border-radius: 999px; white-space: nowrap;
  background: #fff6e2; color: var(--sun-deep); border: 1px solid var(--line-sun); }
.role-badge.low { background: var(--paper-field); color: var(--field-deep); border-color: var(--line); }
.scope { display: flex; align-items: center; gap: 0.5rem; margin: -0.4rem 0 1rem; font-size: 0.85rem; color: var(--ink-soft); }
.scope select { padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.overlay { position: fixed; inset: 0; background: rgba(42,38,34,0.4); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.3rem 1.3rem 1rem; width: 100%; max-width: 420px; }
.modal h3 { font-size: 1.05rem; margin-bottom: 0.9rem; }
.modal .field select, .modal .field input { width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.4rem; margin-top: 0.6rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.8rem 1rem; border-top: 1px solid var(--line); align-items: flex-end; }
.form-row .field { margin: 0; flex: 1 1 140px; }
.form-row .field input, .form-row .field select { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 0.87rem; }

/* 관리 쪽 사이를 오가는 줄 (261027 콘솔 나눔) */
.consolenav { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; gap: 0.2rem; flex-wrap: wrap; }
.consolenav a { padding: 0.45rem 0.8rem; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  border-bottom: 2px solid transparent; }
.consolenav a:hover { color: var(--field-deep); }
.consolenav a.on { color: var(--field-deep); border-bottom-color: var(--field); }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--field-soft); }
.go-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.go-tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem;
  text-decoration: none; color: var(--ink); }
.go-tile:hover { border-color: var(--field-soft); }
.go-tile h2 { font-size: 1.05rem; margin-bottom: 0.25rem; color: var(--field-deep); }
.go-tile p { font-size: 0.85rem; color: var(--ink-soft); }
.go-tile.soon { opacity: 0.7; }
a.tab { text-decoration: none; }
.crumb { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 0.2rem; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--field-deep); text-decoration: underline; }
.go-tile h2 .n { font-size: 0.85rem; font-weight: 700; color: var(--ink-faint); margin-left: 0.2rem; }

/* 사람 정보 위 칸: 무엇 | 값 한 줄씩 (261106) */
dl.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.55rem 1rem; padding: 1rem 1.2rem; margin: 0; font-size: 0.93rem; }
dl.kv dt { color: var(--ink-faint); }
dl.kv dd { margin: 0; }
@media (max-width: 560px) { dl.kv { grid-template-columns: 6rem 1fr; } }
