/* 팀 업무 대시보드 — 로고 색상: 블루 #1160a8, 그린 #37ad00, 블랙 #000 / 서체: Pretendard */
:root {
  --blue: #1160a8; --blue-600: #0d4f8c; --blue-50: #eaf2fb;
  --green: #37ad00; --green-50: #eef8e8;
  --navy: #0e1a33; --navy-2: #16274a;
  --ink: #111827; --ink-2: #374151; --muted: #6b7280; --line: #e5e7eb; --line-2: #f0f2f5;
  --bg: #f5f7fa; --card: #fff; --red: #dc2626; --amber: #b45309;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; color: var(--ink); background: var(--bg); font-size: 13px; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- 레이아웃 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; flex: none; background: var(--navy); color: #cfd8e8; display: flex; flex-direction: column; padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; padding: 0 22px 18px; }
.brand img { width: 62px; height: 62px; object-fit: contain; }
.nav, .nav-admin { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.nav a, .nav-admin a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.nav a i, .nav-admin a i { width: 18px; text-align: center; color: #9fb0cc; }
.nav a:hover, .nav-admin a:hover { background: var(--navy-2); color: #fff; }
.nav a.active, .nav-admin a.active { background: var(--blue); color: #fff; }
.nav a.active i, .nav-admin a.active i { color: #fff; }
.nav-admin { margin-top: auto; border-top: 1px solid #24365c; padding-top: 14px; }
.nav-label { font-size: 11.5px; color: #8193b2; margin: 0 12px 6px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 10; }
.pending-summary { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
.pending-summary .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }
.pending-summary .sep { width: 1px; height: 14px; background: var(--line); }
.pending-summary #pending-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.pending-summary:hover #pending-text { color: var(--blue); }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }
.env-badge { background: #fff7e6; color: var(--amber); border: 1px solid #fde3b0; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.me { color: var(--muted); }
.link-btn { background: none; border: 0; cursor: pointer; padding: 4px; color: var(--ink-2); }
.link-btn:hover { color: var(--blue); }
.view { padding: 18px 22px 40px; outline: none; }

/* ---------- 공통 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.section-head h2 { font-size: 15.5px; margin: 0; font-weight: 700; }
.page-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 16px; }
.more { color: var(--blue); font-size: 12.5px; font-weight: 500; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; background: #fafbfc; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); border-color: var(--blue-600); }
.btn-danger { color: var(--red); }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-green { background: var(--green-50); color: #2b8a00; }
.badge-gray { background: #f3f4f6; color: var(--muted); }
.badge-red { background: #fee2e2; color: var(--red); }
.badge-amber { background: #fff7e6; color: var(--amber); }
.muted { color: var(--muted); }
.pct { color: var(--green); font-weight: 600; }
.pct.none { color: var(--muted); font-weight: 400; }
.red-flag { color: var(--red); font-weight: 600; margin-left: 4px; font-size: 11.5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-50); border-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- 표 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { background: #f8fafc; color: var(--ink-2); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .center { text-align: center; }
.tbl-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px !important; }

/* ---------- 대시보드 ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.perf-card { padding: 12px 14px; }
.perf-card .section-head { margin-bottom: 6px; }
.perf-tbl th, .perf-tbl td { padding: 5px 10px; }   /* 압축 행높이: 기존 넓은 표 대비 약 30% */
.perf-tbl td.metric { text-align: center; font-variant-numeric: tabular-nums; }
.perf-tbl th.metric { text-align: center; }
.src-note { font-size: 11.5px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.task-col { padding: 12px 10px 6px; display: flex; flex-direction: column; min-width: 0; }
.task-col h3 { font-size: 14.5px; margin: 0 4px 8px; display: flex; align-items: center; justify-content: space-between; }
.task-col h3 small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.task-tbl td, .task-tbl th { padding: 7px 6px; }
.task-tbl { table-layout: fixed; }
.task-tbl th:nth-child(1) { width: 19%; } .task-tbl th:nth-child(3) { width: 28%; } .task-tbl th:nth-child(4) { width: 10%; } .task-tbl th:nth-child(5) { width: 15%; }
/* 폭이 모자라면 D-표시만 날짜 아래 줄로 내려감 (완료 칸 침범 방지) */
.task-tbl td.date { white-space: normal; line-height: 1.25; }
.task-tbl td.date .red-flag { display: inline-block; margin-left: 3px; font-size: 10.5px; white-space: nowrap; }
.task-tbl td.proj, .task-tbl td.title, .task-tbl td.staff { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-tbl td.proj { color: var(--blue-600); font-weight: 600; font-size: 12px; }
.task-foot { display: flex; align-items: center; justify-content: space-between; margin: 6px 4px; }
.task-tbl td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-tbl tr.done td.title { color: var(--muted); }
.chk { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }

.side { display: flex; flex-direction: column; gap: 12px; }
.side-card { padding: 14px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 14px; font-size: 14.5px; font-weight: 600; cursor: pointer; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.side-link:hover { border-color: var(--blue); }
.side-link .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); font-size: 15px; flex: none; }
.side-link .chev { margin-left: auto; color: var(--muted); }
.side-link small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.side-link.disabled { cursor: default; color: var(--muted); }
.side-link.disabled:hover { border-color: var(--line); }
.side-link.disabled .ico { background: #f3f4f6; color: #9ca3af; }
.side-card label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.side-card select { width: 100%; }
.bid-list { list-style: none; margin: 8px 0 10px; padding: 0; }
.bid-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.bid-list li:last-child { border-bottom: 0; }
.count-pill { background: var(--blue-50); color: var(--blue); border-radius: 6px; padding: 1px 7px; font-weight: 700; font-size: 12px; }
.side-foot { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.side-foot a { color: var(--blue); }

/* ---------- 예산 ---------- */
.budget-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.budget-card { padding: 14px; }
.budget-card h4 { margin: 0 0 8px; font-size: 14px; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; display: flex; margin: 8px 0; }
.bar span { display: block; height: 100%; }
.bar .ex { background: var(--blue); } .bar .pl { background: #93c5fd; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--red); font-weight: 600; }

/* ---------- 플레이스홀더 ---------- */
.placeholder { padding: 40px 24px; text-align: center; color: var(--muted); }
.placeholder i { font-size: 28px; color: #cbd5e1; margin-bottom: 10px; display: block; }
.placeholder h2 { color: var(--ink); font-size: 16px; margin: 0 0 6px; }
.notice { background: #fff7e6; border: 1px solid #fde3b0; color: var(--amber); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.notice-blue { background: var(--blue-50); border-color: #cfe1f5; color: var(--blue-600); }

/* ---------- 모달 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal header { padding: 16px 18px 6px; display: flex; justify-content: space-between; align-items: center; }
.modal header h3 { margin: 0; font-size: 16px; }
.modal form { padding: 8px 18px 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.form-error { color: var(--red); font-size: 12.5px; min-height: 18px; margin: 8px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; font-size: 13px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* ---------- 로그인 ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, var(--navy) 0%, #13305e 100%); padding: 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px 32px; width: min(420px, 100%); text-align: center; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.login-logo { width: 220px; max-width: 80%; margin-bottom: 18px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-sub { color: var(--muted); margin: 0 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.login-form label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.login-form input { border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font-size: 14px; }
.login-form input:focus { outline: 2px solid var(--blue-50); border-color: var(--blue); }
.btn-login { margin-top: 14px; background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 12px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.btn-login:hover { background: var(--blue-600); }
.btn-login:disabled { opacity: .6; cursor: wait; }
.pw-logout { margin-top: 12px; }
.dev-accounts { width: 100%; border-collapse: collapse; font-size: 12px; }
.dev-accounts th, .dev-accounts td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line-2); }
.dev-accounts th { color: var(--muted); font-weight: 500; width: 64px; }
.dev-accounts td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.temp-pw { display: flex; align-items: center; gap: 8px; background: var(--blue-50); border: 1px dashed var(--blue); border-radius: 8px; padding: 12px; margin: 10px 0; }
.temp-pw code { font-size: 18px; font-weight: 700; letter-spacing: .06em; color: var(--blue-600); flex: 1; user-select: all; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-google:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn-google:disabled { opacity: .55; cursor: not-allowed; }
.login-note { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
.login-error { background: #fee2e2; color: var(--red); border-radius: 8px; padding: 10px; font-size: 12.5px; margin: 0 0 14px; text-align: left; }
.dev-login { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); text-align: left; }
.dev-login h2 { font-size: 13px; margin: 0 0 4px; color: var(--amber); }
.dev-login p { font-size: 11.5px; color: var(--muted); margin: 0 0 10px; }
.dev-form { display: flex; gap: 8px; }
.dev-form select { flex: 1; }
.dev-form button { background: var(--blue); color: #fff; border: 0; border-radius: 8px; padding: 0 14px; cursor: pointer; font-weight: 600; }

@media (max-width: 1200px) { .task-grid { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .dash { grid-template-columns: 1fr; } .sidebar { width: 64px; } .nav a span, .nav-label { display: none; } .nav a, .nav-admin a { font-size: 0; justify-content: center; } .nav a i, .nav-admin a i { font-size: 15px; } .brand { padding: 0 8px 14px; } .brand img { width: 46px; height: 46px; } }

/* ---------- 업무 관리: 탭 · 페이지 · 완료일 묶음 · 보관 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { padding: 9px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.date-range { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.pager { display: flex; align-items: center; gap: 4px; margin: 12px 0 0; flex-wrap: wrap; }
.pager .muted { margin-left: 8px; font-size: 12.5px; }
.pager-info { margin: 10px 2px 0; font-size: 12.5px; }
.tbl tr.group-row td { background: var(--blue-50); color: var(--blue-600); font-weight: 700; font-size: 12.5px; padding: 6px 10px; }
.archive-months { padding: 12px 14px; margin-bottom: 12px; }
.archive-months h3 { margin: 0 0 8px; font-size: 14px; }
.archive-months ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.archive-months li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.archive-months li span:first-child { font-weight: 600; flex: 1; }

/* ---------- 캘린더 ---------- */
.cal-toolbar { align-items: center; }
.cal-title { font-size: 17px; margin: 0 6px; min-width: 110px; text-align: center; }
.cal { overflow: hidden; }
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px; text-align: center; font-weight: 600; font-size: 12.5px; background: #f8fafc; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.cal-head .sat, .cal-cell.sat .cal-date span { color: var(--blue); }
.cal-head .sun, .cal-cell.sun .cal-date span { color: var(--red); }
.cal-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: #fafcff; }
.cal-cell.out { background: #fafafa; }
.cal-cell.out .cal-date span { opacity: .45; }
.cal-cell.today { background: var(--blue-50); }
.cal-cell.today .cal-date span { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.cal-date small { color: var(--muted); font-weight: 500; font-size: 11px; }
.cal-item { font-size: 11.5px; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--pc) 12%, #fff); border-left: 3px solid var(--pc); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.done { color: var(--muted); text-decoration: line-through; background: #f3f4f6; border-left-color: #cbd5e1; }
.cal-item.overdue { background: #fee2e2; border-left-color: var(--red); color: #991b1b; font-weight: 600; }
.cal-item.virtual { background: #fff; border: 1px dashed var(--pc); border-left-width: 3px; color: var(--ink-2); }
.cal-more { font-size: 11px; color: var(--blue); font-weight: 600; padding-left: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .sep { width: 1px; height: 14px; background: var(--line); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cal-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.cal-key.overdue { background: #fee2e2; border-left: 3px solid var(--red); }
.cal-key.done { background: #f3f4f6; border-left: 3px solid #cbd5e1; }
.cal-key.virtual { border: 1px dashed var(--blue); }
.day-list { list-style: none; margin: 0 0 6px; padding: 0; max-height: 55vh; overflow-y: auto; }
.day-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.day-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.day-main small { color: var(--muted); font-size: 11.5px; }
.day-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; cursor: pointer; }
@media (max-width: 980px) { .cal-cell { min-height: 80px; } .cal-item { font-size: 10.5px; padding: 1px 4px; } }

/* ---------- 구글 캘린더 (보기 전용) ---------- */
.gcal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cal-item.gcal { background: color-mix(in srgb, var(--gc) 14%, #fff); border-left: 3px solid var(--gc); color: #1f2937; }
.cal-item.gcal.allday { background: var(--gc); color: #fff; border-left-color: var(--gc); font-weight: 600; }
.cal-item.gcal b { font-weight: 600; color: color-mix(in srgb, var(--gc) 70%, #000); }
.cal-key.gkey { background: color-mix(in srgb, var(--gc) 14%, #fff); border-left: 3px solid var(--gc); }
.day-sub { font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; font-weight: 600; }
.modal-wide { width: min(720px, 100%); }
.gcal-list { list-style: none; margin: 0 0 6px; padding: 0; }
.gcal-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.gcal-list li .dot { margin-top: 5px; }
.gcal-list code { font-size: 11px; color: var(--muted); }
.gcal-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.color-input { height: 36px; padding: 2px 4px !important; width: 80px !important; }
.gcal-guide { margin-top: 12px; font-size: 12.5px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.gcal-guide summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.gcal-guide ol { margin: 8px 0; padding-left: 18px; line-height: 1.7; }
.gcal-guide p { margin: 6px 0 2px; color: var(--muted); line-height: 1.6; }
.field input[type=checkbox] { width: auto; margin-right: 4px; vertical-align: -2px; }
.gcal-list .day-main .badge { align-self: flex-start; }
.gcal-list .day-main > b + .badge, .gcal-list .day-main { gap: 3px; }

/* ---------- 사업 글자색 ---------- */
.proj-name { font-weight: 600; }
.color-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.color-opt { cursor: pointer; }
.color-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 12.5px; background: #fff; }
.color-opt span i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.color-opt input:checked + span { border-color: currentColor; box-shadow: 0 0 0 2px currentColor inset; }
.color-opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- 크롬 권장 안내 ---------- */
.browser-tip { font-size: 12px; line-height: 1.5; margin: 0; }
.browser-tip .link-btn { font-size: 12px; margin-left: 4px; text-decoration: underline; }

/* ---------- 공유자료 게시판 ---------- */
.search-form { display: flex; gap: 6px; align-items: center; }
.search-form input[type=search] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 200px; }
.post-row { cursor: pointer; }
.post-row:hover td { background: var(--blue-50); }
.post-row.pinned td { background: #fbfcfe; }
.post-row .post-title b { font-weight: 600; }
.pin { color: var(--red); }
.link-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 6px; margin-bottom: 6px; }
.post-view { padding: 4px 20px 12px; }
.post-meta { color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.post-body { white-space: normal; line-height: 1.7; font-size: 13.5px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); word-break: break-word; }
.post-links { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.post-links a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); font-weight: 600; }
.post-links a:hover { background: var(--blue-50); }
.post-links small { color: var(--muted); font-weight: 400; margin-left: auto; }
.color-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 11px; color: var(--muted); }
.color-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.post-view + .modal-actions { padding: 0 20px 18px; }

/* ---------- 구글 시트 실적 연동 ---------- */
.sheets-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheets-bar .neg, .neg { color: var(--red); }
.sa-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; margin-bottom: 8px; line-height: 1.8; }
.sa-box code, #sheets-form code { background: var(--line-2); padding: 2px 6px; border-radius: 5px; font-size: 12px; word-break: break-all; }
.cell-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
#sheets-form textarea[name=key_json] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
@media (max-width: 640px) { .cell-grid { grid-template-columns: 1fr 1fr; } }
.tbl .badge { white-space: nowrap; }

/* ---------- 사이드바 회사 이름 ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand-name { color: #fff; font-size: 19px; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
@media (max-width: 980px) { .brand-name { display: none; } .brand { justify-content: center; } }

/* =====================================================================
   앱 설치(PWA) · 휴대폰 화면
   ===================================================================== */
.m-brand, .bottom-nav { display: none; }
.install-btn { color: var(--blue); font-weight: 600; }
.install-guide { width: min(520px, 100%); }
.install-guide header h3 { display: flex; align-items: center; gap: 8px; }
.install-guide header img { border-radius: 6px; }
.install-body { padding: 4px 18px 0; }
.install-body ol { padding-left: 20px; margin: 6px 0 10px; line-height: 1.75; font-size: 13.5px; }
.install-guide .modal-actions { padding: 0 18px 18px; }
.offline-card img { border-radius: 16px; margin-bottom: 12px; }
.offline-card .btn-login { display: block; text-decoration: none; }
/* 설치된 앱(독립 창)에서는 상단 안전영역 확보 */
.is-app .topbar { padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }

@media (max-width: 720px) {
  body { font-size: 14px; }
  .sidebar { display: none; }
  .layout { min-height: 100dvh; }

  /* 상단: 로고 + 회사명 + 앱 설치 / 아래 줄에 미완료 요약 */
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 14px 6px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 4px; }
  .is-app .topbar { height: auto; }
  .m-brand { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  .m-brand-link { display: flex; align-items: center; gap: 8px; }
  .m-brand-link img { width: 30px; height: 30px; }
  .m-brand-link span { font-weight: 800; font-size: 16.5px; letter-spacing: .02em; color: var(--navy); }
  .m-install { border: 1px solid var(--blue); color: var(--blue); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .pending-summary { width: 100%; font-size: 12.5px; padding: 4px 0 2px; }
  .topbar-right { display: none; }

  .view { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 18px; }
  .page-sub { font-size: 12.5px; }

  /* 하단 메뉴 */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px;
    background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
  .bottom-nav i { font-size: 18px; }
  .bottom-nav a.active { color: var(--blue); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }

  /* 손가락으로 누르기 쉬운 크기 · 아이폰 확대 방지(16px) */
  input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], input[type=search], input[type=password], select, textarea { font-size: 16px; min-height: 42px; }
  .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
  .btn-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
  .chk { width: 22px; height: 22px; }
  .toolbar { gap: 8px; }
  .toolbar > select, .toolbar > .search-form, .toolbar > .date-range { flex: 1 1 100%; }
  .toolbar > .spacer { display: none; }
  .toolbar > .btn { flex: 1 1 auto; justify-content: center; }
  .toolbar > .search-form { min-width: 0; max-width: 100%; }
  .search-form input[type=search] { flex: 1 1 auto; width: auto; min-width: 0; }
  .search-form .btn { flex: none; }
  .date-range { flex-wrap: wrap; }
  .date-range input { flex: 1; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { white-space: nowrap; padding: 10px 14px; }

  /* 대시보드 */
  .dash { gap: 12px; }
  .task-grid { margin-top: 12px; gap: 12px; }
  .task-tbl td, .task-tbl th { padding: 10px 5px; font-size: 13px; }
  .task-tbl th:nth-child(1) { width: 22%; } .task-tbl th:nth-child(3) { width: 24%; } .task-tbl th:nth-child(4) { width: 12%; } .task-tbl th:nth-child(5) { width: 17%; }
  .task-foot { flex-wrap: wrap; gap: 6px; }
  .side-link { padding: 12px; }

  /* 표 → 카드 (mobile.js 가 칸마다 머리글 이름을 data-label 로 붙임) */
  table.m-cards, table.m-cards tbody { display: block; }
  table.m-cards thead { display: none; }
  table.m-cards tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.m-cards tr:last-child { border-bottom: 0; }
  table.m-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; min-height: 26px; }
  table.m-cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: left; flex: none; max-width: 45%; }
  table.m-cards td[data-label=""]::before { display: none; }
  table.m-cards td[data-label=""] { justify-content: flex-end; }
  table.m-cards td:first-child { font-weight: 700; font-size: 14.5px; }
  table.m-cards td.num, table.m-cards td.center { text-align: right; }
  table.m-cards tr.m-full td { display: block; text-align: left; }
  table.m-cards tr.m-full td::before { display: none; }
  table.m-cards tr.group-row td { background: #f8fafc; padding: 6px 4px; font-weight: 600; }
  table.m-cards td[style*="max-width"] { max-width: none !important; }
  .perf-tbl.m-cards td.metric { text-align: right; }
  .post-row td.post-title { font-size: 14.5px; }
  .tbl-wrap { overflow-x: visible; }
  .card > .tbl-wrap > table.m-cards, .card > table.m-cards { font-size: 13.5px; }

  /* 캘린더: 칸에는 색 막대만, 날짜를 누르면 그날 목록 */
  .cal-toolbar .cal-title { flex: 1 1 auto; min-width: 0; }
  .cal-head div { padding: 6px 0; font-size: 11.5px; }
  .cal-cell { min-height: 62px; padding: 4px 3px; gap: 2px; }
  .cal-date { font-size: 12px; margin-bottom: 1px; }
  .cal-date small { display: none; }
  .cal-item { font-size: 0; height: 5px; padding: 0; border-left-width: 0; border-radius: 3px; background: var(--pc); }
  .cal-item.gcal { background: var(--gc); border-left-width: 0; }
  .cal-item.done { background: #cbd5e1; }
  .cal-item.overdue { background: var(--red); }
  .cal-item.virtual { background: #fff; border: 1px dashed var(--pc); }
  .cal-more { font-size: 10px; padding: 0; text-align: center; }
  .cal-legend { font-size: 11.5px; gap: 6px 10px; }

  /* 창은 아래에서 올라오는 시트 형태 */
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { width: 100% !important; max-height: 92dvh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal header { position: sticky; top: 0; background: #fff; z-index: 1; padding: 14px 16px 8px; border-bottom: 1px solid var(--line-2); }
  .modal form { padding: 10px 16px 16px; }
  .form-grid, .cell-grid { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr; }
  .modal-actions { position: sticky; bottom: 0; background: #fff; padding-top: 10px; }
  .modal-actions .btn { flex: 1; justify-content: center; }
  .day-row { flex-wrap: wrap; }
  .gcal-list li { flex-wrap: wrap; }

  /* 더보기 메뉴 */
  .more-body { padding: 8px 16px 16px; }
  .more-me { color: var(--muted); margin: 4px 0 12px; font-size: 13px; }
  .more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .more-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 14px 6px; border: 1px solid var(--line);
    border-radius: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
  .more-item i { font-size: 18px; color: var(--blue); }
  .more-item.active { border-color: var(--blue); background: var(--blue-50); color: var(--blue); }
  .more-label { margin: 16px 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
  .more-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
  .more-actions .btn { justify-content: center; }

  /* 로그인 화면 */
  .login-card { padding: 28px 20px; }
}
@media (min-width: 721px) { .sheet-bg .more-sheet { display: none; } }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check-label input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
@media (max-width: 720px) { .toolbar > .check-label { flex: 0 0 auto; min-height: 36px; font-size: 13.5px; } .check-label input { width: 20px; height: 20px; } }

.pay-method { white-space: nowrap; }
.pay-method i { color: var(--blue); width: 14px; text-align: center; }

/* ---------- 입찰공고 (나라장터 용역) ---------- */
.bid-list li.bid-item { display: block; padding: 0; }
.bid-item a { display: block; padding: 8px 0; min-width: 0; }
.bid-item a:hover .bid-title { color: var(--blue); }
.bid-title { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bid-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bid-meta .red-flag { font-size: 10.5px; }
.bid-tbl { table-layout: fixed; }
.bid-tbl th:nth-child(2) { width: 150px; } .bid-tbl th:nth-child(3) { width: 190px; }
.bid-tbl td.bid-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bid-tbl td.bid-name a { color: var(--ink); font-weight: 600; }
.bid-tbl td.bid-name a:hover { color: var(--blue); text-decoration: underline; }
.bid-tbl td.bid-dl { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bid-tbl tr.bid-canceled td { color: var(--muted); }
.bid-tbl tr.bid-canceled td.bid-name a { color: var(--muted); text-decoration: line-through; }
.kw-row { display: flex; gap: 8px; }
.kw-row input { flex: 1; }
.g2b-kv { grid-template-columns: 110px 1fr; }
.g2b-kv dd { text-align: left; }
@media (max-width: 720px) {
  .bid-tbl.m-cards td.bid-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
  .bid-tbl.m-cards td.bid-name::before { display: none; }
  .kw-row { flex-direction: column; }
}
