/* hsmon 해솔 모니터 - TV 다크 테마
   1920x1080 고정 캔버스(#tv)를 창 크기에 맞춰 통째로 축소/확대한다 (dash.js fit). 색은 아래 변수에서만 정한다 */
@font-face {
  font-family: "Pretendard Variable";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations"), url("../fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #070a10;
  --tv: #0b0f17;
  --panel: #121826;
  --panel-2: #182032;
  --line: #222b3c;
  --line-2: #2e3a50;
  --fg: #e8edf4;
  --fg-2: #c3cbd8;
  --muted: #8592a6;
  --accent: #4cc3ff;
  --accent-a: rgba(76, 195, 255, .14);
  --ok: #22c55e;
  --ok-a: rgba(34, 197, 94, .16);
  --warn: #f5b83d;
  --warn-a: rgba(245, 184, 61, .16);
  --bad: #ef4444;
  --bad-a: rgba(239, 68, 68, .18);
  --info: #3b82f6;
  --na: #4b5568;
  --leave: #7cb7ff;
  --holiday: #ff7b7b;
  --on-light: #0b0f17;
  --f-ui: "Pretendard Variable", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ══ TV 캔버스 ══ */
body.tvbody { background: var(--bg); overflow: hidden; height: 100vh; }
.tv { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: var(--tv); color: var(--fg);
      font: 500 18px/1.35 var(--f-ui); letter-spacing: -.01em; display: flex; flex-direction: column; overflow: hidden; }
.tv .tnum, .tv td, .tv .num { font-variant-numeric: tabular-nums; }
.tvh { position: relative; z-index: 3; flex: none; height: 84px; display: flex; align-items: center; gap: 28px; padding: 0 28px;
       background: linear-gradient(180deg, #131a29, #0f1522); border-bottom: 1px solid var(--line); }
.tvh.over { position: absolute; left: 0; right: 0; top: 0; background: rgba(8, 14, 26, .72); backdrop-filter: blur(6px); border-bottom-color: rgba(120, 170, 230, .22); }
.brand { display: flex; align-items: center; gap: 14px; flex: none; }
.brand img { width: 40px; height: auto; opacity: .9; }
.ttl { min-width: 0; }
.ttl h1 { margin: 0; font-size: 34px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
.ttl p { margin: 2px 0 0; font-size: 16px; color: var(--muted); white-space: nowrap; }
.hx { flex: 1; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; flex: none; }
.clock b { font-size: 44px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.clock small { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ctrls { display: flex; gap: 8px; flex: none; }
.tv .ic { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); font-size: 16px;
          display: grid; place-items: center; cursor: pointer; padding: 0; }
.tv .ic:hover { border-color: var(--accent); }
.tv .ic.on { background: var(--warn); color: var(--on-light); border-color: var(--warn); }
.rot { position: relative; z-index: 3; flex: none; height: 4px; background: var(--line); }
.tvh.over + .rot { position: absolute; top: 84px; left: 0; right: 0; background: rgba(34, 43, 60, .6); }
.rot i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #7c9cff); }
.rot i.paused { background: var(--warn); }
.err { position: relative; z-index: 3; flex: none; margin: 12px 28px 0; padding: 10px 16px; border-radius: 10px; background: #3a1d22; color: #ffb3b1; font-size: 18px; }
#full-hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9; padding: 12px 22px; border-radius: 10px; background: var(--warn); color: var(--on-light);
             font: 700 20px var(--f-ui); box-shadow: 0 6px 24px rgba(0, 0, 0, .5); pointer-events: none; }
#offline-badge { position: fixed; right: 16px; bottom: 16px; z-index: 9; padding: 10px 16px; border-radius: 10px; background: #3a1d22; color: #ffb3b1; font: 600 18px var(--f-ui); }
.tvb { flex: 1; min-height: 0; padding: 16px 28px 22px; display: flex; flex-direction: column; gap: 14px; }

/* 머리글 요약 칩 */
.chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2);
        font-size: 16px; color: var(--fg-2); white-space: nowrap; }
.chip b { font-size: 24px; font-weight: 750; color: var(--fg); font-variant-numeric: tabular-nums; }
.chip.bad { background: var(--bad-a); border-color: rgba(239, 68, 68, .45); }
.chip.bad b { color: #ff8a8a; }
.chip.warn { background: var(--warn-a); border-color: rgba(245, 184, 61, .45); }
.chip.warn b { color: var(--warn); }
.chip.ok b { color: var(--ok); }
.chip.dim { opacity: .55; }

/* 깜빡임 (위험) */
@keyframes blink { 45% { opacity: .25; } }
.blink { animation: blink 1.1s steps(1, end) infinite; }

/* ══ 1. 고객 서버 ══ */
table.srv { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 16.5px; }
.srv th { position: sticky; top: 0; background: #0f1522; color: var(--muted); font-size: 14px; font-weight: 600; text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.srv thead tr.grp th { font-size: 13px; color: var(--accent); padding: 4px; border-bottom: 1px solid var(--line); }
.srv thead tr.grp th.g { border-bottom: 2px solid rgba(76, 195, 255, .45); }
.srv td { height: 34px; padding: 0 8px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .022); }
.srv td.r { text-align: right; }
.srv td.c { text-align: center; }
.srv td.nm { font-weight: 700; color: var(--fg); }
.srv td.mut { color: var(--muted); font-size: 15px; }
.srv td.dim { color: var(--fg-2); }
.srv td.os1 { background: rgba(239, 68, 68, .14) !important; }
.srv td.os2 { background: rgba(239, 68, 68, .26) !important; }
.srv td.os3 { background: rgba(239, 68, 68, .42) !important; color: #fff; }
.srv td.os4 { background: rgba(239, 68, 68, .7) !important; color: #fff; font-weight: 750; }
.srv td.up { background: var(--bad) !important; color: #fff; font-weight: 750; }
.srv td.fail b { display: inline-block; min-width: 30px; padding: 1px 8px; border-radius: 6px; background: var(--warn); color: var(--on-light); font-weight: 750; text-align: center; }
.bar { position: relative; height: 12px; border-radius: 6px; background: #1f2838; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, #2bd38a, #16a34a); }
.bar.low i { background: linear-gradient(90deg, #ff6b6b, #dc2626); }
.st { display: inline-block; min-width: 64px; padding: 3px 10px; border-radius: 6px; font-size: 15px; font-weight: 800; letter-spacing: .02em; text-align: center; }
.st.ok { background: var(--ok-a); color: var(--ok); border: 1px solid rgba(34, 197, 94, .4); }
.st.bad { background: var(--bad); color: #fff; }
.ag { width: 20px; height: 20px; vertical-align: middle; }
.ag.ok { color: var(--ok); }
.ag.stop { color: var(--bad); }
.ag.na { color: var(--na); }
.pgn { margin-left: auto; color: var(--muted); font-size: 15px; }

/* ══ 2. 유지보수 대기 ══ */
table.astbl { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 22px; }
.astbl th { background: #0f1522; color: var(--muted); font-size: 16px; font-weight: 600; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
.astbl th.c, .astbl td.c { text-align: center; }
.astbl td { height: 64px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.astbl td.req { font-weight: 650; color: var(--fg); }
.astbl td.mut { color: var(--fg-2); }
.astbl td.num { font-size: 19px; }
.days { display: inline-grid; place-items: center; min-width: 64px; height: 40px; padding: 0 10px; border-radius: 10px; font-size: 26px; font-weight: 800; background: var(--panel-2); }
.days.red { background: var(--bad); color: #fff; }
.days.yellow { background: var(--warn); color: var(--on-light); }
.empty-big { flex: 1; display: grid; place-content: center; text-align: center; gap: 16px; }
.empty-big b { font-size: 52px; font-weight: 800; }
.empty-big span { font-size: 30px; color: var(--muted); }

/* ══ 3. 월간 일정 ══ */
.wt { display: flex; align-items: center; gap: 18px; font-size: 20px; color: var(--fg-2); }
.wt .sky { font-size: 24px; font-weight: 750; color: var(--warn); }
.wt span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wt b { color: var(--fg); font-size: 24px; font-weight: 700; }
.wt small { color: var(--muted); font-size: 14px; }
.wt .ico { width: 20px; height: 20px; background: var(--accent); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.wt .g1 b { color: #4ade80; } .wt .g2 b { color: #60a5fa; } .wt .g3 b { color: #facc15; } .wt .g4 b { color: #f87171; }
.cal { flex: 1; min-height: 0; display: grid; grid-template-rows: 40px repeat(var(--weeks), minmax(0, 1fr)); gap: 6px; }
.cal .wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; min-height: 0; }
.cal .dn { display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--fg-2); background: #0f1522; border-radius: 8px; }
.cal .dn.sun { color: var(--holiday); } .cal .dn.sat { color: var(--leave); }
.day { min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.day .d { font-size: 26px; font-weight: 800; line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.day.sat .d { color: var(--leave); }
.day.sun .d, .day.hol .d { color: var(--holiday); }
.day.other { opacity: .38; }
.day.today { border: 2px solid var(--ok); background: linear-gradient(180deg, rgba(34, 197, 94, .16), var(--panel) 60%); }
.day.today .d::after { content: "오늘"; font-size: 13px; font-weight: 800; color: var(--on-light); background: var(--ok); border-radius: 6px; padding: 2px 7px; }
.ev { font-size: 17px; font-weight: 550; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.holiday { color: var(--holiday); font-weight: 700; }
.ev.leave { color: var(--leave); }
.ev .disk { display: inline-block; width: 12px; height: 12px; margin-left: 6px; vertical-align: 0; border-radius: 3px; background: var(--accent); opacity: .85; }

/* ══ 4. 백업 ══ */
.cards { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
.card { min-width: 0; min-height: 0; border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
        background: linear-gradient(160deg, #1f6fe0, #1650b0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.card.copy { background: linear-gradient(160deg, #f6c445, #e09b12); color: var(--on-light); }
.card.error { background: linear-gradient(160deg, #f05252, #c62828); }
.card.na, .card.unknown { background: linear-gradient(160deg, #3b475c, #2a3446); color: var(--fg-2); }
.card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; white-space: nowrap; }
.card .top i { font-style: normal; font-weight: 800; font-size: 13px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .22); letter-spacing: .03em; }
.card .bot small { font-size: 13px; font-weight: 600; opacity: .85; }
.card .nm { font-size: 26px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.card .bot { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; }
.card .bot img { width: 30px; height: 20px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); }

/* ══ 5·6. 지도 ══ */
.mapbg { position: absolute; inset: 0; z-index: 0; }
.mapbg img.base { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.mapbg svg { position: absolute; left: 0; top: 0; }
.slist { position: absolute; z-index: 1; top: 112px; width: 360px; padding: 14px 16px; background: rgba(0, 20, 50, .72); border: 1px solid rgba(100, 180, 255, .28);
         border-radius: 12px; backdrop-filter: blur(3px); }
.slist div { height: 40px; display: flex; align-items: center; font-size: 19px; font-weight: 650; color: #d8ecff; white-space: nowrap; overflow: hidden; }
.slist.l { left: 20px; } .slist.l div { justify-content: flex-end; }
.slist.r { right: 20px; }
.feedbox { position: absolute; z-index: 1; padding: 16px 22px 18px; background: rgba(4, 12, 28, .8); border: 1px solid rgba(100, 180, 255, .3); border-radius: 14px; backdrop-filter: blur(4px); }
.feedbox h3 { margin: 0 0 8px; font-size: 20px; font-weight: 750; color: #9fd4ff; letter-spacing: .01em; }
.feed { display: flex; flex-direction: column; }
.feed div { height: 34px; display: flex; align-items: center; gap: 10px; font-size: 18px; white-space: nowrap; overflow: hidden; }
.feed time { flex: none; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.feed em { flex: none; font-style: normal; font-weight: 750; color: #9fd4ff; }
.feed span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.feed div.open span { color: #ffb4b4; }
.feed div.open em::after { content: ""; }
.feed .done { flex: none; font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--ok-a); color: var(--ok); }
.feed .wait { flex: none; font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--bad-a); color: #ff8a8a; }
.wtime { position: absolute; z-index: 1; padding: 6px 12px 7px; border-radius: 10px; background: rgba(6, 12, 24, .82); border: 1px solid rgba(255, 230, 0, .35); line-height: 1.05; }
.wtime small { display: block; font-size: 13px; color: #cfd8e6; font-weight: 600; }
.wtime b { font-size: 30px; font-weight: 800; color: #ffe600; font-variant-numeric: tabular-nums; }
.seoul { position: absolute; z-index: 1; left: 1010px; top: 150px; padding: 16px 26px 18px; border-radius: 16px; background: rgba(6, 12, 24, .78); border: 1px solid rgba(255, 230, 0, .4); }
.seoul small { display: block; font-size: 22px; font-weight: 800; letter-spacing: .14em; color: #9be59b; }
.seoul b { font-size: 92px; line-height: 1; font-weight: 850; color: #ffe600; font-variant-numeric: tabular-nums; }

/* ══ 7. 알림 ══ */
.alist { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.al { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: center; gap: 18px; height: 54px; padding: 0 18px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.al time { font-size: 17px; font-variant-numeric: tabular-nums; }
.al span { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al.recent { background: linear-gradient(90deg, rgba(239, 68, 68, .22), var(--panel) 40%); border-color: rgba(239, 68, 68, .45); color: var(--fg); }
.al.recent time { color: #ff9b9b; font-weight: 700; }

/* ══ 8. 소개 ══ */
.intro { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #1b2a4a 0%, #0b0f17 62%); }
.intro .shot { position: absolute; width: 497px; height: 280px; border-radius: 10px; box-shadow: 0 0 100px rgba(0, 0, 0, .5); transform: rotate(-31deg) skew(15deg, -5deg) scale(var(--s)); opacity: 0;
               animation: shotin 1.2s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: var(--d); }
@keyframes shotin { from { opacity: 0; transform: translate(-80px, 100px) rotate(-31deg) skew(15deg, -5deg) scale(calc(var(--s) * .9)); } to { opacity: var(--o); } }
.intro .hero { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.intro .ai { font-size: 260px; font-weight: 900; line-height: .9; color: #fb0051; letter-spacing: -.04em; animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both, bob 3s ease-in-out 1.4s infinite alternate; }
.intro .name { font-size: 104px; font-weight: 300; letter-spacing: -.03em; color: #fff; animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) .15s both; }
.intro .tag { font-size: 36px; font-weight: 300; color: rgba(255, 255, 255, .65); margin-top: 10px; animation: rise 1.2s cubic-bezier(.2, .7, .2, 1) .35s both; }
.intro .logo { position: absolute; right: 48px; top: 120px; width: 220px; opacity: .45; z-index: 2; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes bob { to { transform: translateY(-10px); } }

/* ══ 진입 애니메이션: 목록·카드가 차례로 (화면마다 #tv.anim 재시작) ══ */
#tv.anim .srv tbody tr, #tv.anim .astbl tbody tr, #tv.anim .cards > *, #tv.anim .feed > *, #tv.anim .alist > *, #tv.anim .cal .wk .day {
  animation: fadeup .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 28ms);
}
#tv.anim .feed > * { animation: typein .7s steps(24, end) both; animation-delay: calc(400ms + var(--i, 0) * 700ms); }
#tv.anim .mapbg svg .dot { animation: pop .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); transform-box: fill-box; transform-origin: center; }
#tv.anim .mapbg svg .ln { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1s ease-out forwards; animation-delay: calc(200ms + var(--i, 0) * 40ms); }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes typein { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  #tv .blink, #tv.anim *, .intro * { animation: none !important; opacity: 1 !important; clip-path: none !important; stroke-dashoffset: 0 !important; }
  .intro .shot { opacity: var(--o) !important; }
}

/* ══ 로그인 ══ */
body.page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 20%, #17223a, var(--bg) 70%); color: var(--fg); font: 500 16px/1.5 var(--f-ui); }
.login { width: min(440px, calc(100vw - 32px)); padding: 36px 32px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.login .eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .08em; }
.login .eyebrow img { width: 26px; }
.login h1 { margin: 10px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.login p { margin: 0 0 22px; color: var(--muted); }
.login label { display: block; font-size: 14px; color: var(--fg-2); margin-bottom: 6px; }
.login input { width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #0d1320; color: var(--fg); font: 600 18px var(--f-ui); }
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-a); }
.login .msg { margin: 10px 0 0; color: #ff9b9b; font-weight: 600; }
.login button { margin-top: 18px; width: 100%; height: 50px; border: 0; border-radius: 10px; background: linear-gradient(90deg, #3aaef5, #5b7cfa); color: #fff; font: 750 18px var(--f-ui); cursor: pointer; }
