/* 업무 프로그램 공통 화면(prog-kit kit.css 위에) — 문의 관리 */
:root { --brand: #1d4ed8; --brand-soft: #eef2ff; }
body { background: var(--paper); font-size: 15px; }
.login { position: fixed; inset: 0; background: var(--paper); display: grid; place-items: center; padding: 20px; z-index: 50; }
.login-box { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 28px 24px; display: grid; gap: 14px; }
.login-box .eyebrow { margin: 0; }
.login-demo { font-size: 13px; color: var(--muted); margin: 4px 0 0; line-height: 1.6; }
.btn.full { width: 100%; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: #1e40af; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--ink-2); }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; background: #fff; font-size: 16px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input.bad, select.bad, textarea.bad { border-color: var(--danger); background: var(--danger-soft); }
.err { color: var(--danger); font-size: 13px; font-style: normal; margin: 0; min-height: 0; }
.err:empty { display: none; }
.muted { color: var(--muted); font-size: 14px; }

.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 12px 24px; min-height: 60px; flex-wrap: wrap; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.brand b { font-size: 17px; }
.brand span { color: var(--muted); font-size: 14px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a.on { color: var(--ink); border-color: var(--ink); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
@media (max-width: 720px) {
  .top-in { padding-top: 8px; gap: 4px 12px; }
  .nav { order: 3; width: 100%; margin: 0 -12px; }
  .top-r .me { display: none; }
}
.main { padding-top: 24px; padding-bottom: 80px; }
.page-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h select { width: auto; }
.loading { color: var(--muted); padding: 24px 0; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; }
.kpis.four { grid-template-columns: repeat(2, 1fr); }
.kpis > * { padding: 16px; text-decoration: none; display: grid; gap: 2px; }
.kpis > * + * { border-left: 1px solid var(--line); }
.kpis b { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis b.warn { color: var(--danger); }
.kpis span { font-size: 13px; color: var(--muted); }
.kpis a:hover { background: var(--paper); }
@media (min-width: 760px) { .kpis.four { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 759px) { .kpis.four > :nth-child(3) { border-left: 0; } .kpis.four > :nth-child(n+3) { border-top: 1px solid var(--line); } .kpis b { font-size: 24px; } }

.sec { margin-bottom: 24px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rows { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 16px; text-decoration: none; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row:hover { background: #fafafb; }
.row.is-new { box-shadow: inset 3px 0 0 var(--brand); }
.row-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-main b { font-size: 16px; }
.row-sub { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.row-side { grid-column: 2; grid-row: 1 / span 2; text-align: right; display: grid; gap: 2px; align-content: center; font-size: 14px; }
.row-side small { color: var(--muted); font-size: 12.5px; }
.late { color: var(--danger); font-weight: 650; }
.stage { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 4px; background: #f1f1f3; color: var(--ink-2); }
.s-새문의 { background: var(--brand-soft); color: var(--brand); }
.s-계약 { background: var(--ok-soft); color: var(--ok); }
.s-놓침 { background: #f1f1f3; color: var(--faint); }
.s-보류 { background: var(--warn-soft); color: var(--warn); }
.empty-line { padding: 18px 16px; margin: 0; color: var(--muted); }
.more { display: block; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--brand); font-weight: 650; text-decoration: none; }
.note-line { margin: 8px 0; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 28px 20px; text-align: center; }
.empty p { color: var(--muted); }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-bottom: 12px; }
.tools input[type=search] { grid-column: 1 / -1; }
.tools select { grid-column: 1 / -1; }
.me { font-size: 14px; color: var(--muted); }
@media (min-width: 760px) { .tools { grid-template-columns: 1fr 180px auto auto; align-items: center; } .tools input[type=search], .tools select { grid-column: auto; } }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; min-height: 44px; white-space: nowrap; }
.chk input { width: 18px; height: 18px; min-height: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid var(--line-2); background: #fff; border-radius: 99px; min-height: 40px; padding: 0 14px; font-weight: 650; font-size: 14px; color: var(--ink-2); }
.chips button span { color: var(--faint); font-weight: 500; margin-left: 2px; }
.chips button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips button[aria-selected="true"] span { color: #c9cbd1; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 16px 0; color: var(--muted); font-size: 14px; }

.back { display: inline-flex; margin-bottom: 6px; }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.d-sub { margin: 4px 0 0; color: var(--ink-2); }
.d-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-act select { width: auto; }
.stepper { list-style: none; padding: 0; margin: 18px 0 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stepper li { font-size: 13px; font-weight: 650; color: var(--faint); border-top: 3px solid var(--line); padding-top: 6px; }
.stepper li.done { color: var(--ink-2); border-color: var(--brand); }
.stepper li.cur { color: var(--brand); border-color: var(--brand); }
@media (max-width: 520px) { .stepper li { font-size: 11.5px; } }
.stage-note { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; margin: 0 0 10px; }
.stage-note.warn { background: var(--warn-soft); border-color: #eedfbf; }
.d-grid { display: grid; gap: 16px; margin-top: 8px; }
@media (min-width: 980px) { .d-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card .h3 { margin-bottom: 12px; }
#note-form { display: grid; gap: 10px; }
.next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.next > span { font-weight: 650; color: var(--ink-2); margin-right: 4px; }
.next input { width: auto; flex: 1 1 150px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; min-height: 40px; padding: 0 12px; font-size: 14px; }
.chip:hover { border-color: var(--ink); }
.tl-h { margin-top: 24px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 82px 1fr; gap: 0 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; grid-row: 1 / span 2; }
.timeline b { font-size: 13px; }
.timeline p { margin: 2px 0 0; color: var(--ink); }
.timeline li.sys p { color: var(--muted); }
#edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#edit-form .wide, #edit-form .form-act { grid-column: 1 / -1; }
@media (max-width: 520px) { #edit-form { grid-template-columns: 1fr; } }
.form-act { display: flex; align-items: center; gap: 12px; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.dlg { border: 0; border-radius: var(--r); padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.dlg::backdrop { background: rgba(10, 10, 12, .45); }
.dlg-in { padding: 22px 20px; display: grid; gap: 12px; }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-grid .wide { grid-column: 1 / -1; }
@media (max-width: 520px) { .dlg-grid { grid-template-columns: 1fr; } }
.dlg-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 15px; z-index: 60; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--danger); }
table.t td.barc { width: 40%; }
.barc i { display: block; height: 10px; background: var(--brand); border-radius: 2px; }
.barc i.g { background: #b8bcc6; }

.d-grid > *, .dlg-grid > * { min-width: 0; }
input[type=date] { min-width: 0; max-width: 100%; }
