/* =========================================================
   KAI HOSTING · Design System (RIZE 토큰 계승) (kaihost.css v1.1)
   ---------------------------------------------------------
   · 공통 CSS 1개로 전 페이지 커버 (프레임워크 무의존)
   · 스킨: body.theme-light / body.theme-dark
   · 레이아웃: sidebar(좌) + topbar(상) + content + footer
   · 시그니처: 모노스페이스 수치(--font-mono) + 상태 시그널 도트
   ========================================================= */

/* ---------- 폰트 ---------- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --font-sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Consolas", "D2Coding", monospace;

  /* 구조 치수 */
  --sidebar-w: 252px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 7px;

  /* 브랜드 코어 (스킨 무관) */
  --kai-cyan: #0E9BB5;
  --kai-teal: #0C8F84;
  --kai-grad: #0E9BB5;
}

/* ---------- 화이트 스킨 ---------- */
body.theme-light {
  --bg: #F2F6F7;
  --panel: #FFFFFF;
  --panel-soft: #F7FBFC;
  --line: #D9E4E8;
  --line-strong: #C3D4DA;

  --ink: #0C1D24;
  --ink-2: #33474F;
  --ink-3: #5C7178;
  --ink-4: #8AA0A7;

  --primary: #0E7D95;
  --primary-strong: #0B6579;
  --primary-soft: #E3F5F9;
  --primary-ink: #FFFFFF;
  --primary-glow: rgba(14,155,181,.35);

  --success: #178A4C;      --success-soft: #E4F6EC;
  --warning: #B25E09;      --warning-soft: #FCF1E0;
  --danger:  #C93434;      --danger-soft:  #FCE9E9;
  --violet:  #6D48D8;      --violet-soft:  #EFEAFB;

  --sidebar-bg: #0B2229;
  --sidebar-ink: #C8DEE4;
  --sidebar-ink-dim: #7C9BA4;
  --sidebar-line: rgba(255,255,255,.10);
  --sidebar-active: rgba(14,155,181,.22);
  --sidebar-active-ink: #FFFFFF;

  --shadow: 0 10px 30px rgba(12,29,36,.07);
  --shadow-sm: 0 2px 8px rgba(12,29,36,.06);
  --scrim: rgba(8,20,25,.45);
}

/* ---------- 다크 스킨 ---------- */
body.theme-dark {
  --bg: #0A161B;
  --panel: #0F2129;
  --panel-soft: #12272F;
  --line: #1D3540;
  --line-strong: #28434F;

  --ink: #E7F2F5;
  --ink-2: #B9CDD3;
  --ink-3: #7E99A1;
  --ink-4: #567077;

  --primary: #2CC5E0;
  --primary-strong: #55D4EA;
  --primary-soft: rgba(44,197,224,.14);
  --primary-ink: #06272E;
  --primary-glow: rgba(44,197,224,.35);

  --success: #37C97E;      --success-soft: rgba(55,201,126,.14);
  --warning: #E8A144;      --warning-soft: rgba(232,161,68,.14);
  --danger:  #F06A6A;      --danger-soft:  rgba(240,106,106,.14);
  --violet:  #A88BF2;      --violet-soft:  rgba(168,139,242,.16);

  --sidebar-bg: #081419;
  --sidebar-ink: #B7CFD6;
  --sidebar-ink-dim: #5E7B84;
  --sidebar-line: rgba(255,255,255,.07);
  --sidebar-active: rgba(44,197,224,.16);
  --sidebar-active-ink: #FFFFFF;

  --shadow: 0 12px 34px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --scrim: rgba(0,0,0,.55);
}

/* ---------- 리셋/베이스 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 앱 셸 ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 28px 34px 40px; max-width: 1520px; width: 100%; }

/* ---------- 사이드바 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  max-height: 100vh;
  z-index: 40;
}
.s-head {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--sidebar-line);
}
.s-logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--kai-grad);
  color: #fff; font-weight: 900; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: .02em; flex: 0 0 auto;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.s-head .nm { color: #fff; font-weight: 800; font-size: 15px; line-height: 1.2; }
.s-head .tag { font-size: 11px; color: var(--sidebar-ink-dim); margin-top: 2px; font-family: var(--font-mono); }

.s-nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; }
.s-section {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sidebar-ink-dim); padding: 14px 10px 6px;
}
.s-nav a, .s-nav .grp-btn {
  width: 100%; height: 40px;
  display: flex; align-items: center; gap: 11px;
  padding: 0 11px; border-radius: 8px;
  color: var(--sidebar-ink); font-weight: 600; font-size: 13.5px;
  background: none; border: 0; text-align: left;
  transition: background .15s ease;
}
.s-nav a:hover, .s-nav .grp-btn:hover { background: rgba(255,255,255,.06); }
.s-nav a.active {
  background: var(--sidebar-active); color: var(--sidebar-active-ink);
  box-shadow: inset 2.5px 0 0 var(--kai-cyan);
}
.s-nav i { font-size: 16px; width: 18px; text-align: center; flex: 0 0 auto; }
.grp .chev { margin-left: auto; font-size: 11px; transition: transform .18s ease; }
.grp.open .chev { transform: rotate(90deg); }
.s-sub { display: none; padding: 2px 0 4px 40px; }
.grp.open .s-sub { display: block; }
.s-sub a { height: 34px; font-size: 13px; font-weight: 500; color: var(--sidebar-ink-dim); }
.s-sub a.active { color: var(--sidebar-active-ink); background: var(--sidebar-active); box-shadow: none; }

.s-foot {
  padding: 13px 16px 15px;
  border-top: 1px solid var(--sidebar-line);
  font-size: 11.5px; color: var(--sidebar-ink-dim);
}
.s-foot .r1 { display: flex; align-items: center; gap: 7px; color: var(--sidebar-ink); font-weight: 700; margin-bottom: 4px; }
.s-foot small { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5; }

/* 시그널 도트 */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2EE28D; display: inline-block;
  box-shadow: 0 0 0 3px rgba(46,226,141,.15);
  animation: kai-pulse 2.2s ease-in-out infinite;
}
.live-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px rgba(232,161,68,.18); }
.live-dot.down { background: var(--danger); box-shadow: 0 0 0 3px rgba(240,106,106,.18); }
@keyframes kai-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ---------- 탑바 ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 36px; padding: 0 13px;
  max-width: 460px; flex: 1;
  color: var(--ink-3);
}
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--ink); }
.search input::placeholder { color: var(--ink-4); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--panel-soft); border-color: var(--line-strong); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--panel);
}
.env-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 12px; font-family: var(--font-mono);
}
.profile { display: flex; align-items: center; gap: 9px; padding-left: 6px; color: inherit; text-decoration: none; }
.profile .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--kai-grad); color: #fff;
  font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.profile .nm { font-weight: 700; font-size: 13px; line-height: 1.2; }
.profile .rl { font-size: 11px; color: var(--ink-3); }
.ml-auto { margin-left: auto; }

/* ---------- 푸터 ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
.footer .brand { font-weight: 800; color: var(--ink-2); }
.footer .sep { color: var(--line-strong); }
.footer .mono { font-family: var(--font-mono); font-size: 11px; }
.footer .links { margin-left: auto; display: flex; gap: 16px; }
.footer .links a:hover { color: var(--primary); }

/* ---------- 페이지 헤드 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head .desc { color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 6px; font-family: var(--font-mono);
}

/* ---------- 그리드 유틸 ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 1200px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
.mb { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 카드 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card .hd {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.card .hd h6 { font-size: 14px; }
.card .hd .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card .hd .ic {
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; flex: 0 0 auto;
}
.card .bd { padding: 17px 18px; }
.card .bd.p-0 { padding: 0; }
.card .ft { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }

/* ---------- KPI ---------- */
.kpi .bd { padding: 15px 17px; }
.kpi .lbl { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kpi .lbl .ic {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.kpi .val {
  font-family: var(--font-mono);
  font-size: 27px; font-weight: 800; letter-spacing: -.02em;
  margin: 9px 0 5px; color: var(--ink);
}
.kpi .val small { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-left: 3px; }
.trend { font-size: 12px; font-weight: 700; font-family: var(--font-mono); }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--ink-4); }

/* ---------- 칩/배지 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.chip.g { background: var(--success-soft); color: var(--success); }
.chip.b { background: var(--primary-soft); color: var(--primary); }
.chip.w { background: var(--warning-soft); color: var(--warning); }
.chip.r { background: var(--danger-soft); color: var(--danger); }
.chip.v { background: var(--violet-soft); color: var(--violet); }
.chip.n { background: var(--panel-soft); color: var(--ink-3); border: 1px solid var(--line); }
.chip .mono, .mono { font-family: var(--font-mono); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 37px; padding: 0 15px; border-radius: 8px;
  font-weight: 700; font-size: 13.5px;
  border: 1px solid transparent;
  transition: filter .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-outline { background: var(--panel); border-color: var(--line-strong); color: var(--ink-2); }
.btn-outline:hover { background: var(--panel-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: none; color: var(--ink-3); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }

/* ---------- 테이블 ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 11px 16px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  white-space: nowrap;
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: var(--panel-soft); }
.tbl .strong { font-weight: 700; color: var(--ink); }
.tbl .num { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- 폼 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-weight: 500; font-size: 12px; color: var(--ink-4); }
.input, .select, .textarea {
  width: 100%; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 12px;
  font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder { color: var(--ink-4); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .tr {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line-strong); transition: background .18s ease;
}
.switch .tr::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .tr { background: var(--primary); }
.switch input:checked + .tr::after { transform: translateX(18px); }

/* ---------- 메트릭 바 ---------- */
.metric-list { display: flex; flex-direction: column; gap: 12px; }
.metric-line { display: grid; grid-template-columns: 92px 1fr 48px; align-items: center; gap: 12px; }
.metric-line .label { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.metric-line .bar { height: 8px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); overflow: hidden; }
.metric-line .bar span { display: block; height: 100%; border-radius: 999px; background: var(--kai-grad); }
.metric-line .val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; text-align: right; }

/* ---------- 알림 아이템 ---------- */
.item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .ic {
  width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.item .tt { font-weight: 700; font-size: 13.5px; }
.item .ds { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 서비스 상태 스트립 (KAI 시그니처) ---------- */
.svc-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 8px;
  background: var(--panel-soft); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.svc-pill .port { color: var(--ink-4); font-size: 11px; }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  height: 38px; padding: 0 15px; border: 0; background: none;
  font-weight: 700; font-size: 13.5px; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 코드/프리 ---------- */
.code-preview {
  background: var(--panel-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  overflow-x: auto; color: var(--ink-2); margin: 0;
}

/* ---------- 토스트 ---------- */
.toast {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.toast.success { background: var(--success-soft); color: var(--success); }
.toast.error { background: var(--danger-soft); color: var(--danger); }
.toast.warning { background: var(--warning-soft); color: var(--warning); }

/* ---------- 로그인 ---------- */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 34px 32px 30px;
}
.login-card .s-logo { width: 44px; height: 44px; font-size: 18px; border-radius: 11px; }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.login-brand .nm { font-size: 18px; font-weight: 800; }
.login-brand .tag { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }

/* ---------- 모바일 ---------- */
.scrim {
  display: none; position: fixed; inset: 0;
  background: var(--scrim); z-index: 35;
}
.scrim.show { display: block; }
@media (max-width: 992px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .hide-sm { display: none !important; }
  .content { padding: 18px 16px 26px; }
  .footer { padding: 13px 16px; }
}
@media (min-width: 993px) { .only-sm { display: none !important; } }

/* =========================================================
   KAI HOSTING · Extensions (v1.1)
   ---------------------------------------------------------
   · 업무 스위트 카드 레일 (APX/ERP/DealView/OnValue/FinView)
   · APX 통합관제: CPU 코어 게이지 + 큐(Q) 레인
   · 스플릿 로그인 (브랜드 패널 + 폼 패널)
   · 스킨 도트 스위처 (5스킨 실시간 전환)
   ========================================================= */

/* ---------- 여백 리듬 상향 ---------- */
.mb { margin-bottom: 18px; }
.grid { gap: 18px; }
.page-head { margin-bottom: 24px; }
.card .bd { padding: 19px 20px; }
.card .hd { padding: 16px 20px; }

/* ---------- 스킨 도트 스위처 ---------- */
.skin-dots { display: inline-flex; align-items: center; gap: 7px; padding: 0 4px; }
.skin-dots .sd {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent; padding: 0; background-clip: content-box;
  transition: transform .15s ease, border-color .15s ease;
}
.skin-dots .sd:hover { transform: scale(1.15); }
.skin-dots .sd.on { border-color: var(--ink-4); }
.skin-dots .sd[data-skin="teal"]    { background-color: #0E9BB5; }
.skin-dots .sd[data-skin="blue"]    { background-color: #2B7BE4; }
.skin-dots .sd[data-skin="violet"]  { background-color: #7C4DE0; }
.skin-dots .sd[data-skin="crimson"] { background-color: #E23B4E; }
.skin-dots .sd[data-skin="emerald"] { background-color: #12A85E; }

/* ---------- 업무 스위트 레일 (히어로) ---------- */
.suite-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1360px) { .suite-rail { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .suite-rail { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .suite-rail { grid-template-columns: 1fr; } }

.suite {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 20px 17px;
  display: flex; flex-direction: column; gap: 13px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.suite::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--kai-grad);
  opacity: 0; transition: opacity .18s ease;
}
.suite:hover, .suite:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.suite:hover::before, .suite:focus-within::before { opacity: 1; }

.suite .top { display: flex; align-items: center; gap: 12px; }
.suite .ic {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px;
  background: var(--primary-soft); color: var(--primary);
}
.suite .nm { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.suite .cat { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4); font-family: var(--font-mono); margin-top: 2px; }
.suite .desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; min-height: 39px; }
.suite .stats {
  display: flex; align-items: stretch; gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px; margin-top: auto;
}
.suite .st { flex: 1; min-width: 0; }
.suite .st + .st { border-left: 1px solid var(--line); padding-left: 14px; margin-left: 14px; }
.suite .st .k { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--ink-4); text-transform: uppercase; }
.suite .st .v { font-family: var(--font-mono); font-size: 16px; font-weight: 800; margin-top: 3px; letter-spacing: -.02em; }
.suite .st .v small { font-size: 11px; color: var(--ink-3); font-weight: 700; margin-left: 2px; }
.suite .go {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-4); font-size: 13px;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.suite:hover .go { color: var(--primary); background: var(--primary-soft); }

/* ---------- APX 관제 : CPU 코어 게이지 ---------- */
.apx-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; }
@media (max-width: 860px) { .apx-wrap { grid-template-columns: 1fr; } }
.apx-h {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 13px; font-family: var(--font-mono);
}
.apx-h .v { color: var(--primary); }
.core-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
@media (max-width: 560px) { .core-grid { grid-template-columns: repeat(2, 1fr); } }
.core {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-soft); padding: 10px 11px 11px;
}
.core .id { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); font-weight: 700; }
.core .pct { font-family: var(--font-mono); font-size: 15px; font-weight: 800; margin: 3px 0 7px; }
.core .g { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.core .g span { display: block; height: 100%; border-radius: 999px; background: var(--kai-grad); }
.core.hot .pct { color: var(--warning); }
.core.hot .g span { background: linear-gradient(90deg, var(--warning), var(--danger)); }

/* ---------- APX 관제 : 큐(Q) 레인 ---------- */
.q-lane { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.q-lane:last-child { border-bottom: 0; }
.q-lane .nm { width: 118px; flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.q-lane .track { flex: 1; height: 9px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--line); overflow: hidden; }
.q-lane .track span { display: block; height: 100%; border-radius: 999px; background: var(--kai-grad); }
.q-lane.warn .track span { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.q-lane .depth { width: 76px; flex: 0 0 auto; text-align: right; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.q-lane .depth small { color: var(--ink-4); font-weight: 600; }

/* ---------- 딜뷰 AI 스코어 배지 ---------- */
.ai-score {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-weight: 800; font-size: 12px;
  color: var(--primary);
}
.ai-score i { font-size: 11px; }

/* ---------- 랭킹 리스트 (온밸류/핀뷰) ---------- */
.rank { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank .no {
  width: 24px; height: 24px; border-radius: 7px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 800;
  background: var(--panel-soft); border: 1px solid var(--line); color: var(--ink-3);
}
.rank:first-child .no { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.rank .tt { font-weight: 700; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .sub { font-size: 11.5px; color: var(--ink-4); margin-top: 1px; font-family: var(--font-mono); }
.rank .val { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; font-weight: 800; flex: 0 0 auto; }

/* =========================================================
   로그인 (스플릿) · 고급 + 심플
   ========================================================= */
.lg-shell { min-height: 100vh; display: flex; background: var(--bg); }

/* 좌 : 브랜드 패널 */
.lg-brand {
  flex: 1.1; min-width: 0;
  background:
    radial-gradient(900px 520px at 12% -10%, var(--primary-glow), transparent 60%),
    radial-gradient(700px 500px at 105% 110%, var(--primary-glow), transparent 55%),
    var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  padding: 46px 54px;
  position: relative; overflow: hidden;
}
.lg-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 30% 30%, #000 30%, transparent 100%);
}
.lg-brand > * { position: relative; z-index: 1; }
.lg-brand .head { display: flex; align-items: center; gap: 13px; }
.lg-brand .head .nm { color: #fff; font-weight: 800; font-size: 17px; }
.lg-brand .head .tag { font-size: 11.5px; color: var(--sidebar-ink-dim); font-family: var(--font-mono); margin-top: 2px; }
.lg-brand .mid { margin: auto 0; padding: 48px 0; }
.lg-brand h1 {
  color: #fff; font-size: clamp(26px, 3vw, 36px);
  line-height: 1.28; letter-spacing: -.02em; font-weight: 800;
  max-width: 430px;
}
.lg-brand h1 em { font-style: normal; background: var(--kai-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-brand .sub { margin-top: 14px; font-size: 14px; color: var(--sidebar-ink-dim); max-width: 420px; line-height: 1.65; }
.lg-svc { margin-top: 34px; display: flex; flex-direction: column; gap: 2px; max-width: 430px; }
.lg-svc .row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--sidebar-line);
}
.lg-svc .row:last-child { border-bottom: 0; }
.lg-svc .row i { width: 20px; text-align: center; font-size: 15px; color: var(--sidebar-ink-dim); }
.lg-svc .row .nm { font-weight: 700; font-size: 13.5px; color: var(--sidebar-ink); }
.lg-svc .row .ds { font-size: 12px; color: var(--sidebar-ink-dim); margin-left: 2px; }
.lg-svc .row .live-dot { margin-left: auto; }
.lg-brand .foot { font-family: var(--font-mono); font-size: 11px; color: var(--sidebar-ink-dim); display: flex; gap: 14px; flex-wrap: wrap; }

/* 우 : 폼 패널 */
.lg-form {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
  background: var(--panel);
}
.lg-box { width: 100%; max-width: 372px; }
.lg-box .ttl { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.lg-box .dsc { margin-top: 7px; font-size: 13.5px; color: var(--ink-3); }
.lg-box .stack { margin-top: 28px; }
.lg-box .input { height: 44px; border-radius: 10px; }
.lg-btn {
  width: 100%; height: 46px; border-radius: 10px; border: 0;
  background: var(--kai-grad); color: #fff;
  font-weight: 800; font-size: 14.5px; letter-spacing: .01em;
  box-shadow: 0 8px 22px var(--primary-glow);
  transition: filter .15s ease, transform .12s ease;
}
.lg-btn,
.lg-btn:hover,
.lg-btn:focus,
.lg-btn:active {
  color: #fff !important;
  font-weight: 800;
}
.lg-btn:hover { filter: brightness(1.06); }
.lg-btn:active { transform: translateY(1px); }
.lg-meta { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lg-meta .cp { font-size: 11.5px; color: var(--ink-4); font-family: var(--font-mono); }

@media (max-width: 920px) {
  .lg-shell { flex-direction: column; }
  .lg-brand { flex: none; padding: 30px 24px 26px; }
  .lg-brand .mid { padding: 26px 0 4px; margin: 0; }
  .lg-svc { display: none; }
  .lg-brand .foot { display: none; }
  .lg-form { padding: 34px 22px 46px; align-items: flex-start; }
}

/* =========================================================
   KAI HOSTING · Sidebar v1.1 패치
   ---------------------------------------------------------
   · 활성 메뉴 리디자인 (RIZE와 차별화):
     그라디언트 보더 필 + 그라디언트 아이콘 칩 — 스킨 즉시 반영
   · 메뉴/아코디언 글씨 +1px
   ========================================================= */

/* ----- 글씨 +1px & 아이콘 칩 자리 ----- */
.s-nav a, .s-nav .grp-btn { font-size: 14.5px; height: 42px; gap: 10px; }
.s-sub a { font-size: 14px; height: 37px; }
.s-nav a > i:first-child, .s-nav .grp-btn > i:first-child {
  width: 27px; height: 27px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15.5px; border-radius: 8px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

/* ----- 활성 메뉴: 그라디언트 보더 필 (스킨 컬러 = --kai-grad / --primary-glow) ----- */
.s-nav a.active {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--sidebar-bg), var(--sidebar-bg)) padding-box,
    var(--kai-grad) border-box;
  color: #fff;
  box-shadow:
    inset 0 0 0 999px var(--sidebar-active),
    0 6px 16px var(--primary-glow);
}
.s-nav a.active > i:first-child {
  background: var(--kai-grad);
  color: #fff;
  box-shadow: 0 3px 9px var(--primary-glow);
}

/* ----- 서브(아코디언) 활성: 그라디언트 도트 마커 ----- */
.s-sub { padding-left: 36px; }
.s-sub a { gap: 9px; }
.s-sub a::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--sidebar-line); flex: 0 0 auto;
  transition: background .18s ease, box-shadow .18s ease;
}
.s-sub a.active {
  background: var(--sidebar-active);
  color: #fff; box-shadow: none; border: 0;
}
.s-sub a.active::before {
  background: var(--kai-grad);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.s-sub a:hover::before { background: var(--sidebar-ink-dim); }

/* ---------- 브랜드(로고+타이틀) 홈 링크 ---------- */
.s-head .s-brand {
  display: flex; align-items: center; gap: 11px;
  border-radius: 10px; padding: 2px; margin: -2px;
  transition: opacity .15s ease;
}
.s-head .s-brand:hover { opacity: .85; }
.s-head .s-brand:hover .s-logo { box-shadow: 0 4px 14px var(--primary-glow); }

/* =========================================================
   사이드바 접기 (상단 왼쪽 « 토글) · 데스크톱 전용
   ========================================================= */
@media (min-width: 993px) {
  .sidebar { transition: width .2s ease, flex-basis .2s ease; }

  body.sb-collapsed .sidebar { width: 76px; flex: 0 0 76px; }

  /* 브랜드: 로고만 */
  body.sb-collapsed .s-head { justify-content: center; padding: 18px 10px 16px; }
  body.sb-collapsed .s-head .s-brand { gap: 0; }
  body.sb-collapsed .s-head .s-brand > div { display: none; }

  /* 섹션 라벨 → 얇은 구분선 */
  body.sb-collapsed .s-section {
    font-size: 0; padding: 8px 14px;
  }
  body.sb-collapsed .s-section::after {
    content: ""; display: block; height: 1px; background: var(--sidebar-line);
  }

  /* 메뉴: 아이콘만 (텍스트 노드 숨김) */
  body.sb-collapsed .s-nav { padding: 12px 8px; }
  body.sb-collapsed .s-nav a,
  body.sb-collapsed .s-nav .grp-btn {
    font-size: 0; gap: 0; justify-content: center; padding: 0;
  }
  body.sb-collapsed .s-nav a > i:first-child,
  body.sb-collapsed .s-nav .grp-btn > i:first-child { font-size: 16.5px; }
  body.sb-collapsed .s-nav .grp-btn .chev { display: none; }
  body.sb-collapsed .s-nav a > span { display: none !important; }
  body.sb-collapsed .s-sub { display: none !important; }

  /* 푸터: 라이브 도트만 */
  body.sb-collapsed .s-foot { padding: 13px 0 15px; text-align: center; }
  body.sb-collapsed .s-foot .r1 { justify-content: center; font-size: 0; gap: 0; margin: 0; }
  body.sb-collapsed .s-foot small { display: none; }
}

/* =========================================================
   화이트 사이드바 (body.sb-white · 라이트 테마 전용)
   ---------------------------------------------------------
   · 탑바 사이드바 아이콘으로 화이트/다크 전환
   · 변수는 .sidebar 스코프에만 재정의 → 로그인 브랜드 패널 등
     다른 --sidebar-* 사용처에는 영향 없음
   · 다크 테마에서는 자동으로 기존 딥 컬러 유지
   ========================================================= */
body.theme-light.sb-white .sidebar {
  --sidebar-bg: #FFFFFF;
  --sidebar-ink: #44565E;
  --sidebar-ink-dim: #8AA0A7;
  --sidebar-line: #E2EAED;
  --sidebar-active-ink: var(--primary-strong);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
body.theme-light.sb-white .s-head .nm { color: var(--ink); }
body.theme-light.sb-white .s-nav a:hover,
body.theme-light.sb-white .s-nav .grp-btn:hover { background: rgba(12,29,36,.05); }
body.theme-light.sb-white .s-nav a.active,
body.theme-light.sb-white .s-sub a.active { color: var(--primary-strong); }
body.theme-light.sb-white .s-foot .r1 { color: var(--ink-2); }

/* =========================================================
   v1.5 · 플랫 리디자인 (그라디언트 전면 제거)
   ---------------------------------------------------------
   · 활성 메뉴: 솔리드 프라이머리 필 (그라디언트 보더 폐기)
   · 게이지/레인 경고색: 단색
   · 로그인 브랜드 패널: 플랫 딥 컬러 (라디얼 글로우 제거)
   ========================================================= */

/* ----- 활성 메뉴: 솔리드 필 ----- */
.s-nav a.active {
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.s-nav a.active > i:first-child {
  background: rgba(255,255,255,.18);
  color: var(--primary-ink);
  box-shadow: none;
}
body.theme-light.sb-white .s-nav a.active { color: var(--primary-ink); }

/* ----- 서브 활성: 플랫 도트 ----- */
.s-sub a.active::before {
  background: var(--primary);
  box-shadow: none;
}

/* ----- 브랜드 로고/아바타: 플랫 (kai-grad 가 단색화되어 자동 반영) ----- */
.s-logo { box-shadow: none; }
.s-head .s-brand:hover .s-logo { box-shadow: 0 3px 10px var(--primary-glow); }

/* ----- 게이지/레인 경고: 단색 ----- */
.core.hot .g span { background: var(--danger); }
.q-lane.warn .track span { background: var(--warning); }

/* ----- 로그인: 플랫 브랜드 패널 ----- */
.lg-brand {
  background: var(--sidebar-bg);
}
.lg-brand::after {
  mask-image: none;
  opacity: .5;
}
.lg-brand h1 em {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--primary-strong);
}
body.theme-light .lg-brand h1 em { color: var(--kai-cyan); }
.lg-btn { box-shadow: 0 4px 14px var(--primary-glow); }

/* ----- 스위트 카드 호버 헤어라인: 단색 (kai-grad 단색화로 자동) ----- */

/* =========================================================
   v1.5.1 · 솔리드 필 → 아코디언 메뉴 전용
   ---------------------------------------------------------
   · 상위 메뉴 활성: 은은한 플랫 틴트 + 화이트 텍스트 (차분)
   · 아코디언 서브 활성: 스킨 솔리드 필 (강조는 여기만)
   ========================================================= */

/* ----- 상위 메뉴 활성: 차분한 틴트 ----- */
.s-nav a.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-ink);
  box-shadow: none;
}
.s-nav a.active > i:first-child {
  background: none;
  color: var(--primary);
}
body.theme-light.sb-white .s-nav a.active > i:first-child { color: var(--primary); }

/* ----- 아코디언 서브 활성: 솔리드 필 ----- */
.s-sub a.active {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 4px 12px var(--primary-glow);
}
.s-sub a.active::before {
  background: rgba(255,255,255,.55);
}
body.theme-light.sb-white .s-sub a.active { color: var(--primary-ink); }
