/* muju-ui.css — 관제 공통 디자인 층 (2026-10-14)
   모든 화면이 자기 <style> · lucian.css 뒤에 싣는다 — 여기 값이 마지막에 이긴다.
   바꾸는 것: 글꼴(Pretendard Variable) · 오로라 바탕 · 카드의 겹 그림자와 등장 움직임 · 표 · 입력 칸의 초점 ·
   창(dialog) · 메뉴 껍데기(PC 는 왼쪽 사이드바, 폰은 아이콘 알약 줄).
   색은 각 화면의 토큰(--accent · --surface …)을 그대로 쓴다 — 여기서 새 색을 정하지 않는다(빨강 · 파랑 지배색 금지 규칙). */

:root {
  --ui-ease: cubic-bezier(.2, .8, .2, 1);
  --ui-sidebar-w: 252px;
  --ui-shadow-1: 0 1px 2px rgba(24, 18, 56, .06), 0 1px 1px rgba(24, 18, 56, .04);
  --ui-shadow-2: 0 1px 2px rgba(24, 18, 56, .05), 0 10px 28px -14px rgba(52, 36, 140, .22);
  --ui-shadow-3: 0 2px 6px rgba(24, 18, 56, .06), 0 28px 56px -22px rgba(52, 36, 140, .34);
  --ui-aurora-a: rgba(106, 87, 242, .17);
  --ui-aurora-b: rgba(14, 138, 126, .11);
  --ui-aurora-c: rgba(224, 97, 47, .07);
  --ui-hairline: color-mix(in srgb, var(--border, #E5E4E3) 85%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ui-shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --ui-shadow-2: 0 1px 2px rgba(0, 0, 0, .45), 0 14px 32px -16px rgba(0, 0, 0, .7);
    --ui-shadow-3: 0 2px 6px rgba(0, 0, 0, .5), 0 30px 60px -24px rgba(0, 0, 0, .8);
    --ui-aurora-a: rgba(140, 118, 255, .16);
    --ui-aurora-b: rgba(40, 190, 170, .08);
    --ui-aurora-c: rgba(255, 140, 90, .05);
  }
}

/* ── 글꼴 · 바탕 ───────────────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 은은한 오로라 — 화면 맨 뒤에 고정. 인쇄할 때는 안 나온다 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(56vw 46vh at -6% -10%, var(--ui-aurora-a), transparent 70%),
    radial-gradient(48vw 40vh at 106% -4%, var(--ui-aurora-b), transparent 70%),
    radial-gradient(44vw 36vh at 60% 112%, var(--ui-aurora-c), transparent 72%);
}

::selection {
  background: color-mix(in srgb, var(--accent, #6A57F2) 24%, transparent);
}

h1, h2, h3, .page-title, .section-title {
  letter-spacing: -0.02em;
}

.page-title {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
}

/* ── 카드 · 등장 ───────────────────────────────────────────────────────── */
.card {
  border-color: var(--ui-hairline);
  box-shadow: var(--ui-shadow-2);
}

@keyframes ui-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .page > .card,
  .page > section,
  .page > .grid-side,
  .page > .grid-2 {
    animation: ui-rise .5s var(--ui-ease) both;
  }
  .page > :nth-child(2) { animation-delay: 40ms; }
  .page > :nth-child(3) { animation-delay: 80ms; }
  .page > :nth-child(4) { animation-delay: 120ms; }
  .page > :nth-child(5) { animation-delay: 160ms; }
  .page > :nth-child(n+6) { animation-delay: 200ms; }
}

/* ── 입력 칸 · 초점 ────────────────────────────────────────────────────── */
.input,
.select,
.textarea,
.scope-select {
  transition: border-color .15s var(--ui-ease), box-shadow .15s var(--ui-ease), background-color .15s var(--ui-ease);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: color-mix(in srgb, var(--accent, #6A57F2) 40%, var(--border-strong, #D3D2D2));
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent, #6A57F2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #6A57F2) 18%, transparent);
}

/* ── 표 ────────────────────────────────────────────────────────────────── */
.table th {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--text-hint, #6F6B78);
}

.table tr.is-clickable {
  transition: background-color .15s var(--ui-ease);
}

.table tr.is-clickable:hover {
  background: color-mix(in srgb, var(--accent, #6A57F2) 6%, transparent);
}

/* ── 창(dialog) ────────────────────────────────────────────────────────── */
dialog::backdrop {
  background: rgba(16, 12, 36, .38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dialog {
  border-radius: 24px;
  box-shadow: var(--ui-shadow-3);
  border: 1px solid var(--ui-hairline);
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] {
    animation: ui-pop .28s var(--ui-ease) both;
  }
}

@keyframes ui-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ── 알약 ──────────────────────────────────────────────────────────────── */
.pill {
  gap: 5px;
  letter-spacing: -.01em;
}

/* ── 스크롤 막대 ────────────────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-hint, #6F6B78) 40%, transparent) transparent;
}

/* ── 고르기 칸(공용 스타일을 안 싣는 쪽에도 같은 모양) ─────────────────── */
select.select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong, #D3D2D2);
  border-radius: 12px;
  background: var(--surface, #FFF);
  color: var(--text, #16151B);
  font: inherit;
  font-size: 14px;
}

/* 현황판 표의 기기 ID 는 한 줄로(사이드바가 생겨 본문이 좁아져도 「gr-」 / 「011」로 쪼개지지 않게) */
.device-table .cell-id {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* 사이드바가 있는 중간 폭(1100~1439)에서는 오른쪽 칸을 조금 좁힌다 */
@media (min-width: 1100px) and (max-width: 1439px) {
  body.ui-has-side .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* ── 현황판 「지금 상태」 ─────────────────────────────────────────────── */
.overview {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--accent, #6A57F2) 11%, transparent), transparent 55%),
    var(--surface, #FFF);
}

.overview-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 24px;
}

.overview .headline {
  font-size: clamp(22px, 2.6vw, 34px);
  letter-spacing: -0.03em;
}

.overview-ring {
  width: 136px;
  height: 136px;
}

@media (max-width: 640px) {
  .overview-ring {
    width: 92px;
    height: 92px;
  }
}

.ring-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: var(--surface-2, #F5F3EF);
  stroke-width: 12;
}

.ring-seg {
  fill: none;
  stroke-width: 12;
  transition: stroke-dasharray .9s var(--ui-ease), stroke-dashoffset .9s var(--ui-ease);
}

.ring-seg.seg-meeting { stroke: var(--accent, #6A57F2); }
.ring-seg.seg-lobby { stroke: var(--lobby-seg, #BCB3F8); }
.ring-seg.seg-wait { stroke: var(--warn, #D98A2B); }
.ring-seg.seg-error { stroke: var(--error-seg, #B92A2A); }
.ring-seg.seg-offline { stroke: var(--bad, #D64C4C); }

.ring-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  fill: var(--text, #16151B);
  font-variant-numeric: tabular-nums;
}

.ring-sub {
  font-size: 10.5px;
  font-weight: 650;
  fill: var(--text-hint, #6F6B78);
}

.overview .bar {
  height: 14px;
  gap: 3px;
  background: transparent;
  margin-top: 4px;
}

.overview .bar-seg {
  border-radius: 999px;
  transition: flex-grow .6s var(--ui-ease);
}

.overview .legend {
  gap: 8px;
}

.overview .legend-item {
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2, #F5F3EF) 80%, transparent);
  border: 1px solid var(--ui-hairline);
}

.overview .legend-swatch {
  border-radius: 999px;
}

/* ── 메뉴 껍데기 ───────────────────────────────────────────────────────── */
/* console.js 의 buildTabs 가 그린다: aside.ui-side > (브랜드 · 보는 곳 · 메뉴 · 아래 도움 줄) */
.ui-side {
  background: color-mix(in srgb, var(--surface, #FFF) 78%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--ui-hairline);
}

.ui-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text, #16151B);
  min-width: 0;
}

.ui-logo {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: linear-gradient(135deg, #7C69FF 0%, #6A57F2 45%, #3E9C8F 130%);
  box-shadow: 0 6px 16px -6px rgba(106, 87, 242, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.ui-logo svg {
  width: 22px;
  height: 22px;
}

.ui-brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.ui-brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-brand-sub {
  font-size: 12px;
  color: var(--text-hint, #6F6B78);
  font-weight: 600;
}

.ui-menu {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ui-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text-2, #57535F);
  font-size: 14.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s var(--ui-ease), color .18s var(--ui-ease), box-shadow .18s var(--ui-ease);
}

.ui-link svg {
  width: 19px;
  height: 19px;
  flex: none;
  opacity: .85;
}

.ui-link:hover {
  color: var(--text, #16151B);
  background: color-mix(in srgb, var(--accent, #6A57F2) 8%, transparent);
}

.ui-link.is-active {
  color: var(--accent-text, #5D4DD5);
  background: var(--accent-soft, #EDEBFD);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #6A57F2) 16%, transparent);
}

.ui-link.is-active svg {
  opacity: 1;
}

.ui-scope {
  display: grid;
  gap: 6px;
}

.ui-scope-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-hint, #6F6B78);
}

.ui-scope .scope-select {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-strong, #D3D2D2);
  background: var(--surface, #FFF);
  color: var(--text, #16151B);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.ui-scope .scope-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--warn-text, #8F5A1A);
  overflow-wrap: anywhere;
}

.ui-scope .scope-note:empty {
  display: none;
}

.ui-scope .scope-note.is-error {
  color: var(--bad-text, #B92A2A);
}

.ui-foot {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--text-hint, #6F6B78);
  line-height: 1.5;
}

.ui-foot a {
  color: inherit;
}

/* 위 머리띠의 이름 · 지금 화면 이름 */
.ui-topbrand {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
}

.ui-logo-sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.ui-logo-sm svg {
  width: 17px;
  height: 17px;
}

.ui-crumb {
  display: none;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text, #16151B);
  min-width: 0;
  white-space: nowrap;
}

.ui-crumb-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent-text, #5D4DD5);
  background: var(--accent-soft, #EDEBFD);
}

.ui-crumb-icon svg {
  width: 17px;
  height: 17px;
}

/* 폰 · 작은 창 — 브랜드는 위 머리띠에 있으므로 숨기고, 메뉴를 아이콘 알약 줄로 */
@media (max-width: 1099px) {
  .ui-side {
    position: relative;
    z-index: 10;
  }
  .ui-side-inner {
    max-width: 1200px;
    margin: 0 auto;
  }
  .ui-side .ui-brand,
  .ui-side .ui-foot {
    display: none;
  }
  .ui-menu {
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 12px;
    scroll-snap-type: x proximity;
  }
  .ui-menu::-webkit-scrollbar {
    display: none;
  }
  /* 오른쪽 끝을 흐리게 — 옆으로 더 있다는 표시 */
  .ui-menu {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent);
  }
  .ui-menu > li {
    scroll-snap-align: start;
  }
  .ui-link {
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 14px;
  }
  .ui-link svg {
    width: 17px;
    height: 17px;
  }
  .ui-scope {
    padding: 0 16px 10px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
  }
  .ui-scope .scope-note {
    grid-column: 1 / -1;
  }
}

/* PC — 왼쪽에 붙박이 사이드바, 본문은 그 오른쪽 */
@media (min-width: 1100px) {
  body.ui-has-side {
    padding-left: var(--ui-sidebar-w);
  }
  .ui-side {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--ui-sidebar-w);
    z-index: 40;
    border-bottom: 0;
    border-right: 1px solid var(--ui-hairline);
    overflow-y: auto;
  }
  .ui-side-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 14px 18px;
  }
  .ui-menu {
    flex-direction: column;
  }
  .ui-foot {
    margin-top: auto;
    padding: 12px 10px 0;
    border-top: 1px solid var(--ui-hairline);
  }
  /* 사이드바에 브랜드가 있으므로 위 머리띠에는 이름 대신 지금 화면 이름을 보인다 */
  body.ui-has-side .topbar .brand {
    display: none !important;
  }
  body.ui-has-side .ui-crumb {
    display: inline-flex;
  }
}

@media print {
  body::before,
  .ui-side {
    display: none !important;
  }
  body.ui-has-side {
    padding-left: 0;
  }
}
