/*
 * 사업전략실 · 인도네시아 바이오에너지 사업 사업관리 — 공통 스타일
 * 색: 그리너리 로고 녹색(#2F4E2A)을 기준으로, 볏짚 금색은 선·점에만 사용
 */
:root {
  --paddy: #2F4E2A;      /* 로고 녹색 */
  --field: #1B2D19;      /* 로그인 화면 왼쪽 판 */
  --straw: #C9A54C;      /* 볏짚 금색 — 선·작은 강조만 */
  --mist: #F2F5F1;       /* 바탕 */
  --ink: #1E2A24;        /* 본문 글자 */
  --muted: #5E6B64;
  --line: #DCE3DE;
  --accent: #1F4D3A;     /* 업무 화면 버튼 */
  --danger: #A32D2D;
  --ok: #27500A;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #FFFFFF; color: var(--ink); }
body { font-family: 'IBM Plex Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid #185FA5; outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ───────── 로그인·초대·재설정 화면 */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: #FFFFFF; }
.gate-art { position: relative; overflow: hidden; background: var(--field); color: #FFFFFF; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.gate-art svg.furrows { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64%; pointer-events: none; }
.gate-art .org { position: relative; font-size: 15px; font-weight: 600; color: var(--straw); letter-spacing: 0.02em; }
.gate-art h1 { position: relative; margin: 18px 0 0; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.18; font-weight: 700; letter-spacing: -0.02em; word-break: keep-all; }
.gate-art h1 span { display: block; }
.gate-art h1 .last { color: #E9EFE6; font-weight: 600; }
.gate-art .mission { position: relative; max-width: 30em; font-size: 15px; line-height: 1.7; color: #C8D3C5; margin: 0; }
.gate-art .place { position: relative; display: flex; align-items: baseline; gap: 10px; margin-top: 10px; font-size: 13px; color: #8FA08B; }
.gate-art .place b { color: var(--straw); font-weight: 600; }

.gate-form { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.gate-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.gate-card .logo { height: 34px; width: auto; align-self: flex-start; }
.gate-card h2 { margin: 6px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.gate-card .lead { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.gate-card form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.field input { height: 46px; border: 1px solid #C9D3CD; border-radius: 8px; padding: 0 14px; font-size: 15px; color: var(--ink); background: #FFFFFF; width: 100%; }
.field input:focus { border-color: var(--paddy); }
.field .pw { position: relative; }
.field .pw input { padding-right: 64px; }
.field .pw button { position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.field .pw button:hover { background: var(--mist); color: var(--ink); }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.btn-primary { height: 48px; border: 0; border-radius: 8px; background: var(--paddy); color: #FFFFFF; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-primary:hover { background: #24401F; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; text-decoration: underline; cursor: pointer; align-self: flex-start; }
.msg { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.55; }
.msg.err { background: #FCEBEB; color: #7A1F1F; border: 1px solid #E3B4B4; }
.msg.ok { background: #EAF3DE; color: var(--ok); border: 1px solid #C2DA9E; }
.msg.info { background: #FFF6DC; color: #4A3A0A; border: 1px solid #EFCB68; }
.gate-foot { font-size: 12px; color: #8A958F; line-height: 1.6; border-top: 1px solid #EEF1EF; padding-top: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .furrows g path { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: plough 2.4s cubic-bezier(.2, .7, .2, 1) forwards; }
  .furrows g path:nth-child(2n) { animation-delay: .12s; }
  .furrows g path:nth-child(3n) { animation-delay: .24s; }
  @keyframes plough { to { stroke-dashoffset: 0; } }
}

@media (max-width: 900px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-art { min-height: auto; padding: 32px 24px 120px; }
  .gate-art svg.furrows { height: 70%; }
  .gate-art .mission, .gate-art .place { display: none; }
  .gate-form { padding: 32px 16px 48px; }
}

/* ───────── 업무 화면 공통 머리줄 */
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 0 14px; border-bottom: 2px solid var(--paddy); }
.brandbar .who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brandbar .who img { height: 26px; width: auto; display: block; }
.brandbar .who .sep { width: 1px; height: 26px; background: var(--line); }
.brandbar .titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brandbar .titles .org { font-size: 12px; color: var(--muted); font-weight: 600; }
.brandbar .titles .name { font-size: 16px; font-weight: 700; color: var(--paddy); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandbar .menu { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.brandbar .menu .me { font-size: 13px; font-weight: 600; color: var(--ink); margin-right: 4px; white-space: nowrap; }
.brandbar .menu a, .brandbar .menu button { height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid #C9D3CD; border-radius: 6px; background: #FFFFFF; color: var(--ink); font-size: 12px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.brandbar .menu a:hover, .brandbar .menu button:hover { border-color: var(--paddy); }
.brandbar .menu a[aria-current="page"] { background: var(--paddy); border-color: var(--paddy); color: #FFFFFF; }
@media (max-width: 640px) { .brandbar .who .sep, .brandbar .who img { display: none; } }

/* ───────── 관리 화면(사용자·기본 설정·내 계정) */
.page { max-width: 1180px; margin: 0 auto; padding: 24px 40px 56px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 640px) { .page { padding: 16px 16px 40px; } }
.page h1 { margin: 6px 0 0; font-size: 24px; font-weight: 700; }
.page .sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #FFFFFF; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.panel .desc { margin: -6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.ctl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.ctl input, .ctl select, .ctl textarea { height: 34px; border: 1px solid #C9D3CD; border-radius: 6px; padding: 0 10px; font-size: 13px; color: var(--ink); background: #FFFFFF; font-weight: 400; min-width: 0; }
.ctl textarea { height: auto; min-height: 56px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.ctl input[type="color"] { width: 44px; padding: 2px; }
.btn { height: 32px; padding: 0 12px; border: 1px solid #C9D3CD; border-radius: 6px; background: #FFFFFF; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn.warn { border-color: #E3B4B4; color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: #F4F7F5; padding: 8px 10px; }
table.grid td { padding: 9px 10px; border-top: 1px solid #EEF1EF; vertical-align: top; }
.scroll-x { overflow-x: auto; border: 1px solid #E3E9E5; border-radius: 8px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 10px; white-space: nowrap; }
.pill.active { background: #EAF3DE; color: var(--ok); }
.pill.invited { background: #FFF6DC; color: #7A5A00; }
.pill.disabled { background: #F1EFE8; color: #444441; }
.pill.locked { background: #FCEBEB; color: var(--danger); }
.pill.admin { background: var(--paddy); color: #FFFFFF; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #FFFFFF; padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 50; max-width: calc(100vw - 32px); }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox input { flex: 1; height: 34px; border: 1px solid #C9D3CD; border-radius: 6px; padding: 0 10px; font-size: 12px; background: var(--mist); }

/* ───────── 기본 설정 화면 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid #C9D3CD; border-radius: 16px; background: #FFFFFF; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--paddy); box-shadow: inset 0 0 0 1px var(--paddy); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .item { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border: 1px solid #E3E9E5; border-radius: 8px; background: #FBFCFB; }
.list .item .code { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 34px; }
.list .item input[type="text"], .list .item input[type="date"] { height: 32px; border: 1px solid #C9D3CD; border-radius: 6px; padding: 0 9px; font-size: 13px; min-width: 0; }
.list .item .grow { flex: 1 1 200px; }
.list .item .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.iconbtn { width: 30px; height: 30px; border: 1px solid #C9D3CD; border-radius: 6px; background: #FFFFFF; color: var(--ink); cursor: pointer; font-size: 13px; line-height: 1; }
.iconbtn:disabled { opacity: .35; cursor: default; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow .ms { font-size: 12px; font-weight: 700; color: var(--paddy); background: #EEF3EC; border-radius: 10px; padding: 3px 9px; white-space: nowrap; }
.flow input { height: 32px; border: 1px solid #C9D3CD; border-radius: 6px; padding: 0 9px; font-size: 13px; width: 150px; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.preview { font-size: 13px; line-height: 1.7; background: #FBFCFB; border: 1px solid #E3E9E5; border-radius: 8px; padding: 12px 14px; }
.preview ul { margin: 4px 0 0; padding-left: 18px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* ───────── 업무 화면 (index.html) */
body.work { background: #FFFFFF; }
.topwrap { max-width: 1440px; margin: 0 auto; padding: 20px 40px 0; }
.topwrap:empty { display: none; }
.app { font-family: 'IBM Plex Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: var(--ink); background: #FFFFFF; box-sizing: border-box; padding-block: 20px 40px; padding-inline: 40px; min-height: 100%; }
.app h1, .app h2 { text-wrap: balance; }
.det-cards { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 900px) { .det-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .topwrap { padding: 12px 16px 0; }
  .app { padding-block: 14px 32px; padding-inline: 16px; }
}
