:root {
  --pri: #0f7a73; --pri-d: #0b5f59; --pri-l: #e4f3f1; --bg: #f3f6f7; --card: #fff; --line: #dde5e8;
  --tx: #1d2b31; --mut: #6a7b84; --bad: #c0392b; --bad-l: #fdecea; --warn: #b45309; --warn-l: #fef3e2; --ok: #1b8a5a; --ok-l: #e5f5ec;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; background: var(--bg); color: var(--tx); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.rail { position: fixed; left: 0; top: 0; bottom: 0; width: 72px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; z-index: 5; }
.rail .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--pri); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }
.rail a { width: 56px; padding: 8px 0 6px; border-radius: 12px; text-decoration: none; color: var(--mut); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; }
.rail a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail a:hover { background: #f0f4f5; }
.rail a.on { background: var(--pri-l); color: var(--pri); border: 1px solid #b9ddd9; }
.main { margin-left: 72px; min-height: 100%; }
.top { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 4; }
.top .ttl { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.top .ttl i { width: 28px; height: 28px; border-radius: 8px; background: var(--pri-l); display: inline-grid; place-items: center; color: var(--pri); font-style: normal; font-size: 13px; }
.who { color: var(--mut); display: flex; gap: 10px; align-items: center; }
.who b { color: var(--tx); font-weight: 600; }
#view { padding: 20px 24px 40px; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 14px; }
.btn:hover { background: #f4f7f8; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.btn.pri:hover { background: var(--pri-d); }
.btn.bad { color: var(--bad); border-color: #efc4be; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd3ce; border-color: var(--pri); }
input[disabled], select[disabled], textarea[disabled] { background: #f3f6f7; color: var(--mut); }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; min-height: 70px; }
label.f { display: block; font-size: 12px; color: var(--mut); margin-bottom: 4px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.split { display: grid; grid-template-columns: minmax(380px, 460px) 1fr; gap: 16px; align-items: start; }
.chips { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 14px; text-align: left; min-width: 74px; }
.chip small { display: block; color: var(--mut); font-size: 11.5px; }
.chip b { font-size: 20px; }
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.chip.on small { color: #d3efec; }
.tools { display: flex; gap: 8px; margin-bottom: 10px; }
.tools select { width: 110px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 8px; text-align: left; border-bottom: 1px solid #edf1f3; white-space: nowrap; }
th { background: #f0f7f6; color: var(--pri-d); font-weight: 600; font-size: 12.5px; position: sticky; top: 0; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: #f7fbfb; }
tbody tr.row.on { background: var(--pri-l); }
.listbox { max-height: calc(100vh - 290px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.cnt { color: var(--mut); font-size: 12.5px; padding-top: 8px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.tag.w { background: var(--warn-l); color: var(--warn); }
.tag.d { background: var(--ok-l); color: var(--ok); }
.tag.x { background: var(--bad-l); color: var(--bad); }
.empty { color: var(--mut); padding: 40px 10px; text-align: center; }

.acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .n { width: 24px; height: 24px; border-radius: 7px; background: var(--pri-l); color: var(--pri); display: grid; place-items: center; font-size: 12.5px; }
.acc > summary .c { margin-left: auto; color: var(--mut); font-weight: 400; font-size: 12.5px; }
.acc .body { padding: 4px 14px 14px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid .span2 { grid-column: span 2; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .sp { flex: 1; }
.hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hd h3 { margin: 0; font-size: 15px; }
.mrow td { padding: 5px 6px; }
.mrow.bad td { background: var(--bad-l); }
.mrow.bad .spec { color: var(--bad); font-weight: 600; }
.spec { color: var(--mut); font-size: 12.5px; }
.note { background: var(--warn-l); color: var(--warn); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }

.sum { display: grid; grid-template-columns: repeat(3, minmax(140px, 220px)); gap: 12px; margin-bottom: 18px; }
.sum .panel b { font-size: 24px; display: block; margin-top: 2px; }
.sec { margin: 22px 0 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card h4 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.card .kv { display: flex; justify-content: space-between; color: var(--mut); font-size: 12.5px; }
.card .kv b { color: var(--tx); font-weight: 600; }
.card .act { display: flex; gap: 6px; margin-top: 4px; }

.tcontrols { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.tcontrols > div { min-width: 120px; }
.tcontrols .eqs { display: flex; gap: 6px; flex-wrap: wrap; }
.eqchip { border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; background: #fff; display: inline-flex; align-items: center; gap: 6px; }
.eqchip.on { background: var(--pri-l); border-color: #9fd3ce; color: var(--pri-d); font-weight: 600; }
.eqchip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chartbox { overflow-x: auto; }
svg text { font-family: inherit; }

.login { max-width: 380px; margin: 9vh auto; }
.login .panel { padding: 28px; }
.login h2 { margin: 0 0 4px; }
.login p { color: var(--mut); margin: 0 0 18px; }
.login .fld { margin-bottom: 12px; }
.login .btn { width: 100%; padding: 10px; }
.login .sw { text-align: center; margin-top: 12px; color: var(--mut); }
.login .sw a { color: var(--pri); cursor: pointer; }
.err { color: var(--bad); margin: 8px 0; min-height: 18px; }
#toast { position: fixed; right: 24px; bottom: 24px; background: #26363d; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; z-index: 9; pointer-events: none; }
#toast.on { opacity: 1; }
#toast.bad { background: var(--bad); }
.banner { background: var(--warn-l); color: var(--warn); padding: 6px 24px; font-size: 12.5px; border-bottom: 1px solid #f3dcb8; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 16px; }
.tabs button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.atbl input, .atbl select { padding: 5px 8px; }
.mrow select { min-width: 120px; }
.mrow input[type=datetime-local] { min-width: 210px; }
.atbl td { padding: 5px 6px; }

@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .listbox { max-height: 320px; } .grid { grid-template-columns: repeat(2, 1fr); } }
