/* DAEHAN EMS 공통 스타일 - 색은 여기 :root 에서만 바꾸면 전체에 반영됩니다 */
/* 글꼴·왼쪽 메뉴·시계는 common.css */

:root {
  --navy: #12263f;     /* 왼쪽 메뉴 */
  --blue: #245fd3;     /* 강조/버튼 */
  --bg: #f3f6fa;
  --panel: #ffffff;
  --line: #dce4ee;
  --text: #1b3048;
  --muted: #708197;
  --normal: #16a34a;
  --warn: #d97706;
  --abnormal: #dc2626;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Pretendard, "Malgun Gothic", sans-serif; color: var(--text); background: var(--bg); font-size: 14px; }
a { color: var(--blue); }

.app { display: flex; min-height: 100vh; }

.main { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 20px; margin: 0; }
.top-right { display: flex; gap: 16px; align-items: center; color: var(--muted); }
.top-right form { margin: 0; }
.user { color: var(--text); font-weight: 700; }
button.link { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; }

.page { padding: 24px 28px; }
.page h2 { margin: 0 0 16px; font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; border-left: 4px solid var(--blue); }
.card.ok { border-left-color: var(--normal); }
.card.bad { border-left-color: var(--abnormal); }
.card.none { border-left-color: var(--muted); }
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 28px; font-weight: 700; margin-top: 4px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.panel-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head input, .panel-head select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.panel-head input { width: 260px; max-width: 100%; }
.hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #b8c2cf #eef1f5; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-track { background: #eef1f5; border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb { background: #b8c2cf; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
th { background: #f7f9fc; color: var(--muted); font-weight: 700; font-size: 13px; }
td.l { text-align: left; }
td.empty { color: var(--muted); padding: 40px; }
tbody tr:hover { background: #f7faff; }

.st { display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; }
.st-정상 { background: var(--normal); }
.st-미수신 { background: var(--abnormal); }
.st-미연결 { background: var(--muted); }

/* 로그인 */
.login-page { display: grid; place-items: center; min-height: 100vh; background: var(--navy); }
.login-box { background: #fff; padding: 36px; border-radius: 10px; width: 340px; max-width: calc(100% - 32px); display: grid; gap: 14px; }
.login-box h1 { font-size: 17px; margin: 0 0 6px; text-align: center; }
.login-box label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.login-box input { padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.login-alt { display: block; text-align: center; font-size: 13px; margin-top: -6px; }
.login-brand { text-align: center; font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -.3px; }
.login-brand em { font-style: normal; color: var(--blue); }
.login-logo { display: block; width: 170px; height: auto; margin: 0 auto 4px; }
.btn { background: var(--blue); color: #fff; border: 0; padding: 11px; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; }
.err { color: var(--abnormal); margin: 0; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 16px; }
  #clock { display: none; }
  .page { padding: 16px; }
}

/* ── 사업장 현황 표: 행 클릭 → 모니터링 ── */
tr.link { cursor: pointer; }

/* ── 게이트웨이 선택 ── */
.gw-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gw-card { text-decoration: none; color: inherit; display: grid; gap: 6px; }
.gw-code { font-size: 18px; font-weight: 700; }
.empty { color: var(--muted); }

/* ── 실시간 모니터링 ── */
.mon-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.mon-head h2 { margin: 0 0 8px; }
.mon-sub { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.mon-sub select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--text); background: #fff; max-width: 100%; }
.mon-sub .st { min-width: 0; }
.mon-site { text-align: right; }
.mon-site-name { font-size: 22px; font-weight: 700; }
.mon-site-code { color: var(--muted); font-size: 13px; }
.mon-bar { display: flex; gap: 14px; align-items: center; padding: 10px 14px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 10px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--blue); color: #fff; font-weight: 700; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.stack { margin-bottom: 22px; }
.stack h3 { font-size: 16px; margin: 0 0 10px; }
.stack h3 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.scard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 8px; padding: 10px 12px 8px; min-width: 0; }
.scard.off { opacity: .55; }
.scard header { display: flex; gap: 8px; align-items: center; }
.scard .ch { font-size: 11px; font-weight: 700; color: var(--blue); background: #eaf1fd; border-radius: 4px; padding: 2px 6px; }
.scard .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }
.scard .badge { font-size: 11px; font-weight: 700; color: #fff; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.scard .val { margin: 6px 0 2px; display: flex; align-items: baseline; gap: 5px; }
.scard .val b { font-size: 28px; font-variant-numeric: tabular-nums; }
.scard .val small { color: var(--muted); font-size: 13px; }
.scard .ovr { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--abnormal); border-radius: 4px; padding: 2px 6px; }
.scard .meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard .chart { margin-top: 6px; min-height: 90px; }
.scard .ts { color: var(--muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .mon-site { text-align: left; }
  .sgrid { grid-template-columns: 1fr; }
}

/* ── 알람 ── */
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .nbadge.new, .scard.alarmed { animation: none; } }
.alarm-banner { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--abnormal); color: #fff;
                padding: 12px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100% - 32px); }
.alarm-banner a { color: #fff; font-weight: 700; margin-left: 8px; }
.card.warn { border-left-color: var(--warn); }
.btn-sub { font-size: 13px; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.panel-head .btn.small { margin-left: 4px; }
.ast { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.ast-발생 { background: var(--abnormal); animation: blink 1.2s infinite; }
.ast-확인 { background: var(--warn); }
.ast-해결 { background: var(--muted); }
.kind { font-size: 12px; font-weight: 700; white-space: nowrap; }
.k-GW { color: #7c3aed; } .k-COMM, .k-POWER { color: var(--abnormal); } .k-HIGH, .k-LOW { color: var(--warn); }
tr.al-발생 td { background: #fff5f5; }
td small { color: var(--muted); }
.scard .alm { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.scard .alm span { font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 7px; }
.scard .alm .new { background: var(--abnormal); color: #fff; }
.scard .alm .ack { background: #fff3e0; color: #b45309; }
.scard.alarmed { box-shadow: 0 0 0 2px var(--abnormal) inset; }
/* 상·하한 설정 */
input.num { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; text-align: right; }
tr.muted td { color: var(--muted); }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line); text-align: right; }
.panel-foot .btn { padding: 9px 24px; }
.ok-msg { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; padding: 10px 14px; border-radius: 6px; }
.gw-alarm { font-size: 12px; font-weight: 700; border-radius: 4px; padding: 2px 7px; background: #fff3e0; color: #b45309; text-decoration: none; }
.gw-alarm.new { background: var(--abnormal); color: #fff; }
/* 보고서 조건 (templates/core/reports.html) */
.rp-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.rp-title h2 { margin: 0; }
.rp-form { padding: 18px 20px; display: grid; gap: 16px; margin-bottom: 16px; }
.rp-line { display: flex; gap: 14px 20px; flex-wrap: wrap; align-items: flex-end; }
.rp-f { display: grid; gap: 6px; min-width: 0; }
.rp-f > span, .rp-block-h span { font-size: 12px; color: var(--muted); font-weight: 700; }
.rp-f select, .rp-dates input, .ems-dlg select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; max-width: 100%; background: #fff; color: var(--text); }
.rp-f .seg { height: 36px; }
.rp-f .seg button { padding: 0 14px; }
.rp-dates { display: flex; align-items: center; gap: 6px; }
.rp-dates i { color: var(--muted); font-style: normal; padding: 0 2px; }
.rp-dates input { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--text); }
.rp-dates input[type=time] { width: 104px; }
.seg-r { display: inline-flex; align-items: center; cursor: pointer; border-right: 1px solid var(--line); }
.seg-r:last-child { border-right: 0; }
.seg-r input { display: none; }
.seg-r b { padding: 0 14px; line-height: 34px; font-weight: 400; font-size: 13px; color: var(--muted); background: #fff; }
.seg-r input:checked + b { background: var(--blue); color: #fff; font-weight: 700; }
.rp-bottom-l { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.dlg-sec .hint { margin-left: 0; }
.dlg-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.dlg-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.dlg-row { grid-template-columns: auto auto 1fr; gap: 24px; align-items: end; }
.dlg-row select { width: 130px; }
.rp-block { border-top: 1px solid var(--line); padding-top: 14px; }
.rp-block-h { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.rp-block-h small { color: var(--muted); font-size: 12px; }
.rp-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 14px; }
.rp-checks { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.rp-checks label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--blue); background: #eef4ff; color: var(--blue); font-weight: 700; }
.rp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-actions .btn, .rp-actions .btn-line { height: 40px; padding: 0 20px; }
.btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 36px; padding: 0 14px; background: #fff;
  color: var(--blue); border: 1px solid var(--blue); border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-line:hover { background: #eef4ff; }
.btn { display: inline-flex; align-items: center; justify-content: center; }
.btn-del { background: none; border: 1px solid #f1c4c4; color: #c0392b; border-radius: 5px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.btn-del:hover { background: #fdecec; }
.err-msg { color: var(--abnormal); margin: 0; font-weight: 700; }

/* 센서 선택 격자: 8채널씩 */
.sgrid8 { display: flex; gap: 10px; align-items: flex-start; }
.sg-allbox { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--blue);
  border-radius: 6px; color: var(--blue); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sg-rows { flex: 1; display: grid; gap: 6px; min-width: 0; }
.sg-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.sg-item { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; background: #fff; cursor: pointer; min-width: 0; }
.sg-item b { color: var(--blue); font-size: 11px; min-width: 16px; }
.sg-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-item:has(input:checked) { border-color: var(--blue); background: #eef4ff; }
.sg-item.off { background: #f5f7fa; color: #a3afbf; cursor: not-allowed; }
.sg-item.off b { color: #a3afbf; }
@media (max-width: 1100px) { .sg-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 확인창·설정창 (dialog) */
#cfg-dlg { padding: 22px 24px; width: min(980px, calc(100vw - 32px)); }
.ems-dlg h3 { margin: 0 0 14px; font-size: 17px; }
.ems-dlg h3 small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.dlg-sec { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.dlg-sec > b { font-size: 13px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg-btns .btn, .dlg-btns .btn-line { min-width: 84px; height: 38px; }

/* ── 사업장 담당자 첫 화면 (templates/core/site_home.html) ── */
.sh-sites { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sh-sites a { padding: 6px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.sh-sites a.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.sh-head h2 { font-size: 22px; margin: 0 0 4px; }
.sh-sub { color: var(--muted); font-size: 13px; }
.sh-sum { display: flex; gap: 10px; }
.sh-sum .card { min-width: 150px; padding: 10px 16px; }
.sh-sum .card .v { font-size: 24px; }
.sh-h3 { font-size: 15px; margin: 20px 0 10px; }
.sh-gws { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sh-gw { text-decoration: none; color: inherit; display: grid; gap: 6px; }
.sh-gw:hover { box-shadow: 0 2px 10px rgba(18,38,63,.08); }
.sh-gw-top { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.sh-gw-code { color: var(--muted); font-size: 12px; }
.sh-gw dl { margin: 4px 0 0; display: grid; gap: 3px; font-size: 13px; }
.sh-gw dl div { display: flex; justify-content: space-between; }
.sh-gw dt { color: var(--muted); }
.sh-gw dd { margin: 0; font-variant-numeric: tabular-nums; }
.sh-gw em { font-style: normal; color: var(--abnormal); font-weight: 700; }
.sh-go { color: var(--blue); font-size: 12px; text-align: right; }
.sh-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; margin-top: 20px; }
.sh-two > .panel { min-width: 0; }
.sh-clip { white-space: nowrap; }
.sh-new { color: var(--abnormal); }
.sh-empty { padding: 30px; }
.sh-empty h2 { margin: 0 0 8px; }

/* ── 도움말 (templates/core/help.html) ── */
.hp-sec { padding: 6px 20px 16px; margin-bottom: 14px; max-width: 980px; }
.hp-sec h3 { font-size: 15px; margin: 14px 0 10px; }
.hp-sec table { white-space: normal; }
.hp-sec th { width: 150px; text-align: left; background: none; color: var(--text); font-size: 13px; vertical-align: top; }
.hp-sec td { text-align: left; font-size: 13px; line-height: 1.6; }
.hp-sec dt { font-weight: 700; margin-top: 12px; font-size: 13px; }
.hp-sec dd { margin: 4px 0 0; font-size: 13px; line-height: 1.7; }
.hp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }

/* ── 비밀번호 변경 (templates/core/password.html) ── */
.pw-form { max-width: 440px; padding: 20px 22px; display: grid; gap: 10px; }
.pw-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.pw-form input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.pw-form .err { margin: -4px 0 0; font-size: 12px; }
.pw-rule { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.pw-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.pw-btns .btn, .pw-btns .btn-line { min-width: 90px; height: 40px; padding: 0 18px; }
.top-link { color: var(--blue); text-decoration: none; }
.top-link:hover { text-decoration: underline; }

/* ════════════ 휴대폰 화면 (폭 760px 이하) ════════════ */
.tl-short { display: none; }
@media (max-width: 760px) {
  body { font-size: 14px; }
  .top { padding: 10px 14px; gap: 8px; }
  .top h1 { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .top-right { gap: 10px; flex-shrink: 0; font-size: 13px; }
  .top-right .user { display: none; }
  .tl-full { display: none; } .tl-short { display: inline; }
  .page { padding: 14px 12px; }
  .page h2 { font-size: 17px; }
  .ems-msgs { margin: 10px 12px 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 10px 12px; }
  .card .v { font-size: 22px; }
  .panel-head { gap: 8px; padding: 10px 12px; }
  .panel-head .hint { margin-left: 0; width: 100%; }

  /* 사업장 현황 */
  .sh-head { align-items: stretch; }
  .sh-sum { width: 100%; }
  .sh-sum .card { flex: 1; min-width: 0; }
  .sh-two { grid-template-columns: 1fr; }
  .sh-gws { grid-template-columns: 1fr; }

  /* 실시간 모니터링 */
  .mon-head { align-items: flex-start; }
  .mon-sub { gap: 6px 12px; }
  .mon-sub select { width: 100%; }
  .mon-bar { gap: 8px; padding: 8px 10px; }
  .mon-bar .seg button { padding: 6px 8px; }
  .mon-bar .hint { width: 100%; }
  .mon-site-name { font-size: 18px; }
  .scard .val b { font-size: 24px; }

  /* 알람: 표 → 카드 */
  .al-table, .al-table tbody, .al-table tr, .al-table td { display: block; width: 100%; }
  .al-table thead { display: none; }
  .al-table tr { border-bottom: 8px solid var(--bg); padding: 10px 12px; position: relative; }
  .al-table td { border: 0; padding: 2px 0; text-align: left; white-space: normal; font-size: 13px; }
  .al-table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 70px; color: var(--muted); font-size: 12px; }
  .al-table td.c-st, .al-table td.c-kind { display: inline-block; width: auto; margin: 0 6px 6px 0; }
  .al-table td.c-btn { position: absolute; top: 8px; right: 12px; width: auto; }
  .al-table td.c-end:empty, .al-table td.c-btn:empty { display: none; }
  .al-table.one-site .c-site { display: none; }
  .al-table td.c-msg { margin: 4px 0; }

  /* 보고서 */
  .rp-title .btn-line { padding: 0 10px; height: 34px; font-size: 13px; }
  .rp-form { padding: 14px 12px; gap: 14px; }
  .rp-line { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .rp-f select { width: 100%; }
  .rp-f .seg { display: flex; width: 100%; }
  .rp-f .seg button, .rp-f .seg .seg-r { flex: 1; justify-content: center; }
  .rp-f .seg .seg-r b { width: 100%; text-align: center; }
  .rp-dates { display: grid; grid-template-columns: 1fr 124px; gap: 6px; }
  .rp-dates i { display: none; }
  .rp-dates input { width: 100%; min-width: 0; }
  .sgrid8 { flex-direction: column; }
  .sg-allbox { align-self: flex-start; }
  .sg-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-bottom, .rp-bottom-l { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .rp-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .rp-actions .btn, .rp-actions .btn-line { padding: 0 6px; font-size: 13px; }
  #cfg-dlg { padding: 18px 14px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .dlg-row { grid-template-columns: 1fr; gap: 12px; }
  .dlg-row select { width: 100%; }
  .report-wrap { overflow-x: auto; }

  /* 도움말·비밀번호 */
  .hp-sec { padding: 4px 14px 12px; }
  .hp-sec th { width: 96px; }
  .pw-form { padding: 16px 14px; }
}


/* 과거 재생 (core/playback.html) */
.r5-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.r5-bar label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
.r5-bar select, .r5-bar input[type=datetime-local] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; color: var(--text); background: #fff; }
.r5-btn { background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 6px; padding: 6px 14px;
  font: inherit; font-weight: 700; cursor: pointer; }
.r5-btn.ghost { background: #fff; color: var(--blue); }
.r5-btn:disabled { opacity: .4; cursor: default; }
.r5-info { margin-left: auto; color: var(--muted); font-size: 12px; }
.r5-play #slider { flex: 1; min-width: 160px; accent-color: #dc2626; }
.r5-now { font-size: 20px; font-variant-numeric: tabular-nums; color: #dc2626; min-width: 92px; text-align: right; }
.r5-now.hover { color: var(--blue); }
.r5-help { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.r5-empty { color: var(--muted); padding: 40px; text-align: center; background: #fff; border-radius: 8px; }
.r5-stack h3 { font-size: 15px; margin: 18px 0 8px; color: var(--text); }
.r5-stack h3 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.r5-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.r5-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 8px;
  padding: 10px 12px 6px; min-width: 0; }
.r5-card header { display: flex; gap: 8px; align-items: center; }
.r5-card .ch { font-size: 11px; font-weight: 700; color: var(--blue); background: #eaf1fd; border-radius: 4px; padding: 2px 6px; }
.r5-card .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.r5-card .badge { font-size: 11px; font-weight: 700; color: #fff; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.r5-card .val { margin: 4px 0 0; display: flex; align-items: baseline; gap: 5px; }
.r5-card .val b { font-size: 26px; font-variant-numeric: tabular-nums; }
.r5-card .val small { color: var(--muted); font-size: 13px; }
.r5-card .ovr { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #dc2626;
  border-radius: 4px; padding: 2px 6px; }
.r5-card .chart { margin-top: 4px; min-height: 110px; }

/* ── 8. 도움말 ── */
.r5-res button { padding: 6px 12px; }
.r5 a.r5-btn { text-decoration: none; display: inline-block; }
@media (max-width: 760px) {
  .r5-bar { gap: 8px; padding: 10px; }
  .r5-bar label { width: 100%; }
  .r5-bar label select, .r5-bar label input { flex: 1; min-width: 0; }
  .r5-info { margin-left: 0; width: 100%; }
  .r5-play #slider { min-width: 100%; order: 5; }
  .r5-grid { grid-template-columns: 1fr; }
}
.mon-play { font-weight: 700; }

/* 저장자료요청 */
.dr-help { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.dr-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 14px 16px; margin-bottom: 14px; }
.dr-form label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.dr-form input, .dr-form select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.dr-memo input { width: 180px; }
.dr-st { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; background: #708197; }
.dr-st.dr-완료 { background: #16a34a; } .dr-st.dr-전달 { background: #2563eb; } .dr-st.dr-대기 { background: #ca8a04; }
@media (max-width: 760px) { .dr-form label, .dr-memo input { width: 100%; } .dr-form label input, .dr-form label select { flex: 1; min-width: 0; } }
.k-AVG30, .k-AVG60 { color: var(--warn); } .k-PRED { color: #0e7490; } .k-STUCK, .k-SPIKE { color: #b45309; }
.rp-dates .dp-btn, .r5-bar .dp-btn, .dr-form .dp-btn { min-width: 0; }
.rp-dates .dp-btn { width: 100%; }
