:root {
  --navy: #163172; --navy-2: #0f2457; --slate: #475569; --line: #e3e1dc; --bg: #f4f2ee; --card: #fff;
  --ink: #1b2230; --muted: #6b7280; --ok: #1a7f37; --ok-bg: #e7f4ea; --warn: #b45309; --warn-bg: #fdf1e2;
  --bad: #b42318; --bad-bg: #fde8e6; --info-bg: #e8edf8;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif; color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--navy); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; }
.brand small { display: block; font-weight: 400; font-size: 11px; opacity: .7; }
.role { margin-left: auto; font-size: 13px; display: flex; align-items: center; gap: 6px; opacity: .95; }
.role select { background: var(--navy-2); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 5px 8px; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

.heat { background: var(--bad); color: #fff; padding: 9px 18px; font-size: 14px; font-weight: 600; }
.heat b { margin-right: 6px; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 56px); }
.nav { background: #fff; border-right: 1px solid var(--line); padding: 14px 10px 40px; overflow-y: auto;
  position: sticky; top: 56px; height: calc(100vh - 56px); }
.nav h4 { margin: 16px 10px 4px; font-size: 11px; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.nav a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.nav a:hover { background: var(--bg); }
.nav a.on { background: var(--info-bg); color: var(--navy); font-weight: 600; }
.nav a .sfr { float: right; font-size: 10px; color: var(--muted); margin-top: 3px; }
.main { padding: 22px 26px 90px; min-width: 0; max-width: 1200px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
.head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head .tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.law { font-size: 12px; color: var(--slate); }
.law span { display: inline-block; background: var(--info-bg); color: var(--navy); border-radius: 4px; padding: 1px 6px; margin: 2px 4px 0 0; }

.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 7px 12px; cursor: pointer; font-size: 14px; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--navy); }
.btn.pri { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.bad { color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.kpi b { display: block; font-size: 28px; color: var(--navy); line-height: 1.2; }
.kpi span { font-size: 13px; color: var(--muted); }

.obl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.obl .card { padding: 12px 14px; border-left: 4px solid var(--ok); cursor: pointer; }
.obl .card.미이행 { border-left-color: var(--bad); background: #fffafa; }
.obl .card.일부, .obl .card.점검\ 필요 { border-left-color: var(--warn); }
.obl .no { font-size: 12px; color: var(--muted); }
.obl .t { font-weight: 600; font-size: 14px; margin: 2px 0 6px; }

.chip { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; background: var(--info-bg); color: var(--navy); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.gray { background: #eef0f3; color: var(--slate); }

table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
table.list th { background: #faf9f7; font-weight: 600; font-size: 13px; color: var(--slate); }
table.list tr:hover td { background: #fbfbfd; cursor: pointer; }
table.list td.num { text-align: right; }
.filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.filters input, .filters select { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; }

form.f { display: grid; gap: 14px; max-width: 760px; }
.fld label { display: block; font-size: 13px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
.fld label .req { color: var(--bad); }
.fld input[type=text], .fld input[type=number], .fld input[type=date], .fld input[type=datetime-local], .fld select, .fld textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; }
.fld textarea { min-height: 80px; resize: vertical; }
.checks label { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: 15px; padding: 6px 0; }
.checks input { width: 20px; height: 20px; }
.risk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.risk select { width: auto !important; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.thumbs img { width: 92px; height: 92px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.sig { border: 1px dashed var(--slate); border-radius: 8px; background: #fff; touch-action: none; width: 100%; max-width: 360px; height: 140px; }

dl.detail { display: grid; grid-template-columns: 180px 1fr; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
dl.detail dt, dl.detail dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); }
dl.detail dt { background: #faf9f7; font-size: 13px; font-weight: 600; color: var(--slate); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 6px 16px; border-left: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.map { height: 280px; border-radius: 10px; border: 1px solid var(--line); }

.regs { display: flex; flex-wrap: wrap; gap: 6px; }
.regs .chip { font-size: 13px; }
.matrix { border-collapse: collapse; font-size: 12px; }
.matrix td { width: 30px; height: 26px; text-align: center; border: 1px solid #fff; color: #fff; font-weight: 600; }

.quick { display: none; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; font-size: 14px; }
.qr-box { display: inline-block; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.note { background: var(--info-bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--navy); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .burger { display: block; }
  .nav { position: fixed; top: 52px; left: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: auto; box-shadow: 0 0 24px rgba(0,0,0,.15); }
  body.nav-open .nav { transform: none; }
  .main { padding: 16px 16px 96px; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .brand { font-size: 15px; white-space: nowrap; }
  .top { padding: 10px 12px; gap: 8px; }
  .role { font-size: 0; }
  .role select { font-size: 13px; max-width: 150px; }
  table.list.cards thead { display: none; }
  table.list.cards, table.list.cards tbody, table.list.cards tr, table.list.cards td { display: block; width: 100%; }
  table.list.cards tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.list.cards td { border: 0; padding: 2px 8px; }
  table.list.cards td.hide-m { display: none; }
  dl.detail { grid-template-columns: 1fr; }
  dl.detail dt { border-bottom: 0; padding-bottom: 2px; }
  .quick { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
    border-top: 1px solid var(--line); z-index: 35; padding-bottom: env(safe-area-inset-bottom); }
  .quick a { text-align: center; font-size: 11px; padding: 8px 2px 7px; color: var(--slate); }
  .quick a i { display: block; font-style: normal; font-size: 19px; line-height: 1.2; }
}
@media print {
  .top, .nav, .quick, .heat, .actions, .tools, .noprint, .burger { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, dl.detail { break-inside: avoid; }
  .printhead { display: block !important; }
}
.printhead { display: none; border-bottom: 2px solid var(--navy); margin-bottom: 12px; padding-bottom: 6px; font-size: 12px; color: var(--slate); }
