/* SOT Distribution Server - Admin Manager (Phase 4-1) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0b1120;
  --bg-2: #0f172a;
  --panel: #16213a;
  --panel-2: #1e2b48;
  --line: #2a3a5c;
  --text: #e6edf7;
  --muted: #93a4c3;
  --primary: #3b82f6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --accent: #38bdf8;
  --sidebar-w: 248px;
  --header-h: 60px;
  --radius: 12px;

  /* 스크롤바 (다크 테마 통일) */
  --scrollbar-width: 8px;
  --scrollbar-track: #0f1622;       /* 배경과 유사 */
  --scrollbar-thumb: #313a4d;       /* 기본 thumb */
  --scrollbar-thumb-hover: #4a556b; /* hover thumb */
  --scrollbar-thumb-active: #5a657d;/* active thumb */
  --scrollbar-radius: 8px;

  /* 아이콘 색상 체계 (테마 통일) */
  --icon-muted: #8b97a7;   /* 기본 */
  --icon-hover: #c2cbd6;   /* hover 시 */
  --icon-active: #ffffff;  /* active/선택 */
  --icon-primary: #3b82f6; /* Primary */
  --icon-success: #22c55e; /* 성공/정상 */
  --icon-warning: #f59e0b; /* 경고/대기 */
  --icon-danger: #ef4444;  /* 오류/실패 */
  --icon-info: #06b6d4;    /* 정보 */
}
html, body { height: 100%; }
body {
  font-family: "Pretendard", "Segoe UI", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, #0d1730, #0a1124);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #04122b; font-weight: 800; display: grid; place-items: center; letter-spacing: .5px;
}
.brand-text strong { display: block; font-size: 15px; }
.brand-text span { font-size: 11px; color: var(--muted); }
.nav-menu { flex: 1; padding: 10px 10px 20px; }
.nav-group { margin-bottom: 12px; }
.nav-group-title {
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px;
  padding: 10px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #c7d3ea; text-decoration: none; font-size: 13.5px; margin-bottom: 2px; transition: .15s;
}
.nav-item:hover { background: var(--panel-2); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(59,130,246,.25), rgba(56,189,248,.12)); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item .ic { width: 18px; height: 18px; flex: none; }
.sidebar-foot { padding: 12px 18px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }

/* ---------- Main / Header ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px; background: rgba(15,23,42,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 { font-size: 16px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.hdr-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); }
.hdr-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.hdr-status.online { color: #b6f3cf; } .hdr-status.online .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.hdr-status.offline { color: #f9c2c2; } .hdr-status.offline .dot { background: var(--danger); }
.hdr-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.hdr-admin { font-size: 13px; color: var(--muted); }
.hdr-key { display: flex; align-items: center; gap: 6px; }
.hdr-key input { width: 150px; }

.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn .ic { width: 18px; height: 18px; }

.page-head { padding: 18px 24px 0; }
.page-head h2 { font-size: 20px; }
.content { padding: 16px 24px 40px; flex: 1; }

/* ---------- Inputs / Buttons ---------- */
input, select, textarea {
  background: #0a1226; border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-size: 13px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.btn { border: none; cursor: pointer; font-weight: 600; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: #04122b; background: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #052e16; }
.btn-warning { background: var(--warning); color: #3a2606; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #042b33; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-head h3 { font-size: 15px; }
.center-card { text-align: center; padding: 40px; }
.center-card .ic { width: 40px; height: 40px; color: var(--accent); margin-bottom: 10px; }
.inline-key { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.inline-key input { width: 260px; }

.stat-card { display: flex; flex-direction: column; gap: 6px; min-height: 96px; justify-content: center; }
.stat-card .stat-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.stat-card .stat-top .ic { width: 16px; height: 16px; }
.stat-card .stat-val { font-size: 26px; font-weight: 800; }
.stat-card .stat-sub { font-size: 12px; color: var(--muted); }
.stat-accent-1 { border-top: 3px solid var(--primary); }
.stat-accent-2 { border-top: 3px solid var(--success); }
.stat-accent-3 { border-top: 3px solid var(--warning); }
.stat-accent-4 { border-top: 3px solid var(--info); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--panel-2); }
.muted { color: var(--muted); }
.err { color: #fca5a5; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- Badges ---------- */
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 700; display: inline-block; }
.badge-ok { background: rgba(34,197,94,.18); color: #86efac; }
.badge-no { background: rgba(148,163,184,.14); color: var(--muted); }
.badge-warn { background: rgba(245,158,11,.18); color: #fcd34d; }
.badge-info { background: rgba(6,182,212,.18); color: #67e8f9; }
.badge-danger { background: rgba(239,68,68,.18); color: #fca5a5; }
.badge-muted { background: rgba(148,163,184,.14); color: var(--muted); }

/* ---------- Progress ---------- */
.progress { background: #0a1226; border: 1px solid var(--line); border-radius: 999px; height: 12px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.progress.warn > span { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress.danger > span { background: linear-gradient(90deg, var(--danger), #f87171); }
.usage-row { display: grid; grid-template-columns: 120px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 10px; }
.usage-row .ulabel { font-size: 13px; }
.usage-row .uval { text-align: right; font-size: 12.5px; color: var(--muted); }

/* ---------- Pipeline ---------- */
.pipeline { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.pipe-stage { flex: 1; min-width: 130px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.pipe-stage .pname { font-weight: 700; }
.pipe-stage .pcount { font-size: 24px; font-weight: 800; color: var(--accent); }
.pipe-stage .pdesc { font-size: 11px; color: var(--muted); }
.pipe-arrow { display: grid; place-items: center; padding: 0 6px; color: var(--muted); font-size: 22px; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="text"], .toolbar select { min-width: 150px; }
.spacer { flex: 1; }

/* ---------- Explorer ---------- */
.explorer { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
.tree { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: 70vh; overflow: auto; }
.tree-node { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tree-node:hover { background: var(--panel-2); }
.tree-node.active { background: rgba(59,130,246,.2); }
.tree-node.child { padding-left: 22px; font-size: 12.5px; color: var(--muted); }
.tree-node .ic { width: 16px; height: 16px; flex: none; color: var(--icon-muted); }
.tree-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Upload (drag&drop) ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--muted); transition: .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--accent); background: rgba(56,189,248,.08); color: var(--text); }
.upload-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }

/* ---------- Code / log ---------- */
.codebox { background: #060b18; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: "Consolas", "D2Coding", monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow: auto; }
.log-view { background: #060b18; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: "Consolas", monospace; font-size: 12px; max-height: 62vh; overflow: auto; }
.log-line { padding: 1px 0; border-bottom: 1px solid rgba(42,58,92,.4); white-space: pre-wrap; word-break: break-all; }

/* ---------- Misc ---------- */
.loading { padding: 40px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; }
.kv .k { color: var(--muted); }
.section-gap { margin-top: 16px; }
.note { background: rgba(6,182,212,.1); border: 1px solid rgba(6,182,212,.3); color: #a5f0ff; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; }
.note.warn { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #fde2a7; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 10px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .25s; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 3px solid var(--success); }
.toast-warn { border-left: 3px solid var(--warning); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }

/* ---------- Login ---------- */
.login-view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(59,130,246,.18), transparent), var(--bg); z-index: 60; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.login-brand .brand-mark { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.login-card h1 { font-size: 18px; text-align: center; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card .field { margin-bottom: 12px; }
.login-card input { width: 100%; padding: 10px 12px; }
.login-btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.login-err { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
.login-foot { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- Dashboard ---------- */
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.link, .link-sm { color: var(--accent); text-decoration: none; }
.link:hover, .link-sm:hover { text-decoration: underline; }
.link-sm { font-size: 12.5px; }

/* KPI 카드 */
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpi-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }
.kpi-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi-icon .ic { width: 22px; height: 22px; }
.kpi-blue   { background: rgba(59,130,246,.16); } .kpi-blue .ic   { color: var(--icon-primary); }
.kpi-green  { background: rgba(34,197,94,.16); }  .kpi-green .ic  { color: var(--icon-success); }
.kpi-purple { background: rgba(139,92,246,.18); }  .kpi-purple .ic { color: #a78bfa; }
.kpi-cyan   { background: rgba(6,182,212,.16); }  .kpi-cyan .ic   { color: var(--icon-info); }
.kpi-amber  { background: rgba(245,158,11,.16); } .kpi-amber .ic  { color: var(--icon-warning); }

/* 2단/하단 레이아웃 */
.dash-main { display: grid; grid-template-columns: 1fr 360px; gap: 16px; margin-top: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

/* 카드 헤더 아이콘 정렬 + 푸터 */
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { width: 16px; height: 16px; color: var(--icon-muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card-foot .legend { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.block-btn { display: flex; justify-content: center; width: 100%; margin-top: 14px; }

/* 프로젝트 요약 채널 셀 */
.tbl-compact th, .tbl-compact td { padding: 8px 10px; }
.ch-yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(34,197,94,.16); }
.ch-yes .ic { width: 13px; height: 13px; color: var(--icon-success); }
.ch-yes.sm { width: 16px; height: 16px; } .ch-yes.sm .ic { width: 10px; height: 10px; }
.ch-no { color: #4b5b78; }

/* 최근 업로드 리스트 */
.up-list { display: flex; flex-direction: column; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(42,58,92,.5); }
.up-item:last-child { border-bottom: none; }
.up-file-ic { width: 36px; height: 36px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; color: var(--muted); }
.up-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.up-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-size, .up-time { font-size: 12px; color: var(--muted); flex: none; }
.up-time { width: 46px; text-align: right; }

/* 서버 상태 패널 */
.srv-list { display: flex; flex-direction: column; }
.srv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(42,58,92,.55); font-size: 13px; }
.srv-row:last-child { border-bottom: none; }
.srv-row .k { color: var(--muted); flex: none; }
.srv-row .v { font-weight: 600; text-align: right; word-break: break-all; }
.ok-text { color: #86efac; }

/* 빠른 작업 */
.qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); text-decoration: none; font-size: 11px; text-align: center; transition: .15s; }
.qa-tile:hover { border-color: var(--accent); background: rgba(56,189,248,.08); transform: translateY(-1px); }
.qa-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; }
.qa-ic .ic { width: 18px; height: 18px; }
.qa-blue   { background: rgba(59,130,246,.16); } .qa-blue .ic   { color: var(--icon-primary); }
.qa-green  { background: rgba(34,197,94,.16); }  .qa-green .ic  { color: var(--icon-success); }
.qa-amber  { background: rgba(245,158,11,.16); } .qa-amber .ic  { color: var(--icon-warning); }
.qa-cyan   { background: rgba(6,182,212,.16); }  .qa-cyan .ic   { color: var(--icon-info); }
.qa-purple { background: rgba(139,92,246,.18); }  .qa-purple .ic { color: #a78bfa; }

/* 최근 작업 로그 */
.act-list { display: flex; flex-direction: column; }
.act-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(42,58,92,.5); font-size: 12.5px; }
.act-item:last-child { border-bottom: none; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; box-shadow: 0 0 6px var(--success); }
.act-dot.fail { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.act-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { color: var(--muted); font-size: 11.5px; flex: none; }

/* 도넛 차트 (저장소) */
.donut-wrap { display: flex; align-items: center; gap: 20px; padding: 6px 0; flex-wrap: wrap; }
.donut { --p: 0; width: 150px; height: 150px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--donut-color) calc(var(--p) * 1%), #1b2740 0); }
.donut::after { content: ''; position: absolute; width: 108px; height: 108px; border-radius: 50%; background: var(--panel); }
.donut-center { position: relative; z-index: 1; text-align: center; }
.dc-val { font-size: 17px; font-weight: 800; } .dc-sub { font-size: 11px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.donut-legend .lg b { color: var(--text); font-weight: 700; }
.donut-legend .sw { width: 13px; height: 13px; border-radius: 4px; flex: none; }

/* 파이프라인 원형 */
.pl-flow { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; padding: 8px 0; }
.pl-node { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; text-align: center; }
.pl-circle { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); }
.pl-circle .ic { width: 24px; height: 24px; }
.pl-name { font-size: 12.5px; font-weight: 700; }
.pl-count { font-size: 11px; color: var(--muted); }
.pl-desc { font-size: 10.5px; color: var(--muted); }
.pl-arrow { color: var(--muted); align-self: flex-start; margin-top: 26px; letter-spacing: 2px; font-size: 14px; flex: none; }
.pl-blue   { background: rgba(59,130,246,.16); border-color: rgba(59,130,246,.4); } .pl-blue .ic   { color: var(--icon-primary); }
.pl-amber  { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.4); } .pl-amber .ic  { color: var(--icon-warning); }
.pl-purple { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.4); }  .pl-purple .ic { color: #a78bfa; }
.pl-green  { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.4); }  .pl-green .ic  { color: var(--icon-success); }

/* 푸터 */
.app-footer { margin-top: auto; padding: 14px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.app-footer strong { color: var(--text); font-weight: 700; }

/* 헤더 브레드크럼 / 칩 */
.breadcrumb { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.breadcrumb .ic { width: 18px; height: 18px; flex: none; color: var(--icon-muted); }
.breadcrumb .crumb-cur { color: var(--text); font-weight: 600; white-space: nowrap; }
.hdr-admin-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--text); }
.hdr-admin-chip .av { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #04122b; }
.hdr-admin-chip .av .ic { width: 14px; height: 14px; }

@media (max-width: 1200px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .dash-main { grid-template-columns: 1fr; } }
@media (max-width: 900px)  { .dash-bottom { grid-template-columns: 1fr; } }
@media (max-width: 620px)  { .kpi-row { grid-template-columns: 1fr 1fr; } .qa-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Scrollbar (dark, theme unified) ---------- */
/* Firefox 계열: scrollbar-color 는 상속되므로 html 에 한 번만 지정 */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
/* WebKit 계열(Chrome/Edge/Safari): 모든 스크롤 영역에 일괄 적용 */
::-webkit-scrollbar { width: var(--scrollbar-width); height: var(--scrollbar-width); }
::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: var(--scrollbar-radius); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--scrollbar-radius);
  border: 2px solid var(--scrollbar-track); /* 트랙과 자연스러운 경계 */
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-thumb:active { background: var(--scrollbar-thumb-active); }
::-webkit-scrollbar-corner { background: var(--scrollbar-track); }

/* ---------- Icons (theme unified) ---------- */
/* 채움형 아이콘은 currentColor 를 따르고, stroke 기반(hash/log 등)은 인라인 속성으로 동작 */
.ic { fill: currentColor; flex-shrink: 0; vertical-align: middle; transition: color .15s ease; }

/* 상태별 아이콘 색상 (스펙: .icon-* / 코드 호환: .ic-*) */
.icon-muted,   .ic-muted   { color: var(--icon-muted); }
.icon-primary, .ic-primary { color: var(--icon-primary); }
.icon-success, .ic-success { color: var(--icon-success); }
.icon-warning, .ic-warning { color: var(--icon-warning); }
.icon-danger,  .ic-danger  { color: var(--icon-danger); }
.icon-info,    .ic-info    { color: var(--icon-info); }
.icon-active,  .ic-active  { color: var(--icon-active); }
.icon-hover:hover, .ic-hover:hover { color: var(--icon-hover); }

/* 컨텍스트별 자동 색상 */
.nav-item .ic { color: var(--icon-muted); }
.nav-item:hover .ic { color: var(--icon-hover); }
.nav-item.active .ic { color: var(--icon-active); }
.card-head .ic,
.stat-card .stat-top .ic { color: var(--icon-muted); }
.icon-btn .ic { color: var(--icon-muted); }
.icon-btn:hover .ic { color: var(--icon-hover); }
/* 버튼 내부 아이콘은 버튼 텍스트(currentColor)를 그대로 사용 → 별도 지정 불필요 */

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hdr-key, .hdr-admin, .hdr-admin-chip, .hdr-clock { display: none; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .scrim { display: block; }
  .main { margin-left: 0; }
  .explorer { grid-template-columns: 1fr; }
}
@media (min-width: 961px) { #btnSidebar { display: none; } }
