/* @LAYER: VIEW | @PORT: 8002 | @ROLE: 홈 '프리미엄 다크 콘솔' 테마 — 배경·베벨·네온·경고 백라이트·계기판 (CEO 2026-09-21 확정) | @KEY: body.uhd-console / body.uhd-member
 *
 * ★ 왜 (CEO 2026-09-21, 제미나이 의견 4규칙 수용)
 *   "첨단 AI 기술이 적용된 프리미엄 관제 시스템" 인상 — 규칙2 깊이·네온 / 규칙3 경고 우선순위 / 규칙4 타이포·계기판.
 *   규칙1 의 '3.5:6.5 고정 비율' 은 폐기(내용 폭 존중 — launcher_home.css 가 맡는다).
 *
 * ★ 원칙
 *   · 색은 studio :root 변수(--ai-neon #00F0FF · --uhd-red #CC0000)와 기존 mdash 상태색(--ok/--warn/--bad)만 쓴다.
 *   · 로고(.logo-uhdpro/.logo-ai)는 이 파일이 건드리지 않는다(디자인 기준표 §1).
 *   · 외부 이미지 0 — 육각 무늬는 인라인 SVG. 폰(≤820)에서는 흐림·격자를 꺼서 성능을 지킨다.
 *   · 적용 범위 = 콘솔 공통(body.uhd-console: 배경·상단바·타일·관리자 개요 위젯) + 회원 카드(body.uhd-member .mdash-*). CEO 2026-09-21 "관리자 계정도 디자인".
 */

/* ── 배경: 남청 그라데이션 + 청록·파랑 광원 + 육각 무늬 + 바닥 격자 ─────────── */
body.uhd-console .workspace, body.uhd-console .content-area { background: transparent; }
body.uhd-console .app-container {
  background:
    radial-gradient(1100px 560px at 78% -10%, rgba(0,240,255,.13), transparent 60%),
    radial-gradient(900px 520px at 6% 108%, rgba(0,87,255,.18), transparent 60%),
    linear-gradient(180deg, #0a1620 0%, #070d16 55%, #05080f 100%);
  position: relative; isolation: isolate;
}
body.uhd-console .app-container::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'><path d='M28 2 52 16v32L28 62 4 48V16z' fill='none' stroke='%2300F0FF' stroke-opacity='.10' stroke-width='1'/></svg>");
  background-size: 56px 64px; background-position: right top;
  -webkit-mask-image: radial-gradient(700px 420px at 88% 0%, #000 20%, transparent 75%);
          mask-image: radial-gradient(700px 420px at 88% 0%, #000 20%, transparent 75%);
}
body.uhd-console .app-container::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: -1; pointer-events: none; opacity: .35;
  background-image:
    repeating-linear-gradient(90deg, rgba(0,240,255,.07) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(0,240,255,.07) 0 1px, transparent 1px 72px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 70%);
          mask-image: linear-gradient(180deg, transparent, #000 70%);
}
body.uhd-console .top-bar { background: rgba(5,8,15,.55); backdrop-filter: blur(6px); border-bottom-color: rgba(0,240,255,.14); }

/* ── 카드: 유리 + 베벨 + 청록 네온 (규칙2) ─────────────────────────────────── */
body.uhd-member .mdash-card {
  background: linear-gradient(180deg, rgba(18,28,42,.72), rgba(8,12,20,.82));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,240,255,.30); border-radius: 16px; padding: 16px 18px 15px; min-height: 150px;
  box-shadow: 0 14px 32px rgba(0,0,0,.5), 0 0 20px rgba(0,240,255,.12), 0 0 0 1px rgba(0,240,255,.06),
              inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.55), inset 0 0 24px rgba(0,240,255,.04);
}
body.uhd-member .mdash-card::before { width: 0; }
body.uhd-member .mdash-card:hover {
  border-color: rgba(0,240,255,.6);
  box-shadow: 0 18px 38px rgba(0,0,0,.55), 0 0 30px rgba(0,240,255,.24), inset 0 1px 0 rgba(255,255,255,.18), inset 0 -1px 0 rgba(0,0,0,.55);
}
body.uhd-member .mdash-card.g-off {
  border-color: rgba(0,240,255,.14);
  box-shadow: 0 12px 28px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.5);
}
body.uhd-member .mdash-dot { display: none; }
body.uhd-member .mdash-t { font-size: 1rem; color: #f3f5fa; }
body.uhd-member .mdash-n { font-size: 2.15rem; text-shadow: 0 0 14px color-mix(in srgb, var(--tone, #fff) 40%, transparent); }
body.uhd-member .mdash-u { font-size: .8rem; }
body.uhd-member .mdash-go { color: var(--ai-neon); border-bottom-color: rgba(0,240,255,.3); }

/* ── 경고 카드: 브랜드 빨강 백라이트 + 붉은 네온 (규칙3) ───────────────────── */
body.uhd-member .mdash-card.g-bad {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(204,0,0,.34), rgba(204,0,0,.10) 45%, rgba(8,12,20,.86) 80%),
    linear-gradient(180deg, rgba(18,28,42,.72), rgba(8,12,20,.82));
  border-color: rgba(255,48,48,.65);
  box-shadow: 0 14px 32px rgba(0,0,0,.5), 0 0 30px rgba(204,0,0,.42), 0 0 0 1px rgba(204,0,0,.25),
              inset 0 1px 0 rgba(255,120,120,.18), inset 0 -1px 0 rgba(0,0,0,.55), inset 0 0 40px rgba(204,0,0,.12);
}
body.uhd-member .mdash-card.g-bad:hover { box-shadow: 0 18px 38px rgba(0,0,0,.55), 0 0 40px rgba(204,0,0,.55), inset 0 1px 0 rgba(255,120,120,.2); }
/* 경고 카드만 테두리 빛이 은은하게 숨 쉰다(제미나이 추가의견 ① · CEO 2026-09-21 채택). 정상·주의 카드는 움직이지 않는다.
   '움직임 줄이기'를 켠 사용자에겐 끈다. 색은 위와 같은 브랜드 빨강 계열만. */
@keyframes uhd-alert-pulse {
  0%, 100% { box-shadow: 0 14px 32px rgba(0,0,0,.5), 0 0 30px rgba(204,0,0,.42), 0 0 0 1px rgba(204,0,0,.25), inset 0 1px 0 rgba(255,120,120,.18), inset 0 -1px 0 rgba(0,0,0,.55), inset 0 0 40px rgba(204,0,0,.12); border-color: rgba(255,48,48,.65); }
  50%       { box-shadow: 0 14px 32px rgba(0,0,0,.5), 0 0 46px rgba(204,0,0,.7),  0 0 0 1px rgba(204,0,0,.5),  inset 0 1px 0 rgba(255,120,120,.28), inset 0 -1px 0 rgba(0,0,0,.55), inset 0 0 40px rgba(204,0,0,.2);  border-color: rgba(255,48,48,.95); }
}
body.uhd-member .mdash-card.g-bad { animation: uhd-alert-pulse 2.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { body.uhd-member .mdash-card.g-bad { animation: none; } }

/* ── 카드 안 위젯(member_dashboard_widgets.js 가 그린다) ─────────────────────── */
.mdh-body { display: flex; align-items: center; gap: 14px; }
.mdh-ic {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  color: var(--tone, #8b93a4);
  background: color-mix(in srgb, var(--tone, #8b93a4) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone, #8b93a4) 30%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 14px color-mix(in srgb, var(--tone, #8b93a4) 30%, transparent);
}
.mdh-ic svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mdh-lines { margin-top: 12px; }
.mdh-lines .mdash-line { margin-top: 0; line-height: 1.6; }
/* 채널 점 + 연결률 막대 (장치 1대) — 메탈 트랙 + 네온 발광 (규칙4) */
.mdh-chips { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 11px; }
.mdh-chip { font-size: .74rem; color: #9aa3b4; display: inline-flex; align-items: center; gap: 6px; }
.mdh-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.mdh-chip.off i { background: var(--bad); } .mdh-chip.off { color: #fca5a5; }
.mdh-bar { height: 8px; border-radius: 4px; margin-top: 10px; overflow: hidden;
  background: linear-gradient(180deg, #0c1119, #1a2130 50%, #0c1119); border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 1px 2px rgba(0,0,0,.7); }
.mdh-bar b { display: block; height: 100%; border-radius: 4px; position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone, var(--ok)) 70%, #000), var(--tone, var(--ok)) 60%, color-mix(in srgb, var(--tone, var(--ok)) 55%, #fff));
  box-shadow: 0 0 10px color-mix(in srgb, var(--tone, var(--ok)) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.mdh-bar b::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0,0,0,.18) 10px 12px); }
/* 장치 여러 대 — 장치별 줄(문제 장치 먼저) */
.mdh-devs { margin-top: 10px; border-top: 1px solid #1c2030; padding-top: 8px; }
.mdh-dev { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #c8cdd6; line-height: 1.9; }
.mdh-dev i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.mdh-dev.err i { background: var(--bad); } .mdh-dev.err { color: #fca5a5; }
.mdh-dev.wait i { background: var(--warn); } .mdh-dev.wait { color: #fde68a; }
.mdh-dev s { text-decoration: none; color: #6b7280; margin-left: auto; font-size: .7rem; }
.mdh-more { font-size: .72rem; color: #6b7280; margin-top: 2px; }
/* 링 게이지 (발주 필요 재고) */
.mdh-ring { width: 84px; height: 84px; flex: 0 0 auto; position: relative; }
.mdh-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mdh-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.mdh-ring .bg { stroke: #141a26; stroke-width: 9; }
.mdh-ring .rim { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.mdh-ring .fg { stroke: var(--tone, var(--ok)); transition: stroke-dashoffset .6s; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--tone, var(--ok)) 75%, transparent)); }
.mdh-ring .n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.mdh-ring .n b { font-size: 1.35rem; font-weight: 800; color: var(--tone, #fff); letter-spacing: -.5px; text-shadow: 0 0 12px color-mix(in srgb, var(--tone, #fff) 55%, transparent); }
.mdh-ring .n s { text-decoration: none; font-size: .6rem; color: #8b93a4; margin-top: 3px; }
/* 최근 알림 목록 (장치 알림 상태) */
.mdh-list { margin-top: 10px; border-top: 1px solid #1c2030; padding-top: 8px; }
.mdh-li { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #c8cdd6; line-height: 1.9; }
.mdh-li i { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); flex: 0 0 auto; }
.mdh-li s { text-decoration: none; color: #6b7280; margin-left: auto; font-variant-numeric: tabular-nums; }

/* ── 관리자 개요 위젯(.widget) — 회원 카드와 같은 유리·베벨·청록 네온 (CEO 2026-09-21 "관리자 계정도 디자인") ── */
body.uhd-console .widget {
  background: linear-gradient(180deg, rgba(18,28,42,.72), rgba(8,12,20,.82)); backdrop-filter: blur(10px);
  border: 1px solid rgba(0,240,255,.30); border-radius: 16px;
  box-shadow: 0 14px 32px rgba(0,0,0,.5), 0 0 20px rgba(0,240,255,.12), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.55);
}
body.uhd-console .widget-header { color: #f3f5fa; }
body.uhd-console .metric-value { text-shadow: 0 0 10px rgba(0,240,255,.25); }

/* ── 종(알람) 패널 — VMS 알람 페이지와 같은 줄 모양(채널 칩 + 제목 + 메타) ── */
.hap { position: fixed; z-index: 400; width: 360px; max-width: calc(100vw - 16px); max-height: 70vh; display: none; flex-direction: column;
  background: linear-gradient(180deg, rgba(14,22,34,.96), rgba(8,12,20,.98)); border: 1px solid rgba(0,240,255,.35); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 26px rgba(0,240,255,.18), inset 0 1px 0 rgba(255,255,255,.12); }
.hap.on { display: flex; }
.hap-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(0,240,255,.16); }
.hap-h b { font-size: .92rem; color: #f3f5fa; }
.hap-n { font-size: .74rem; color: var(--ai-neon); }
.hap-x { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.14); color: #c8cdd6; border-radius: 7px; padding: 4px 10px; font-size: .74rem; cursor: pointer; font-family: inherit; }
.hap-x:hover { border-color: var(--ai-neon); color: var(--ai-neon); }
.hap-list { overflow: auto; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.hap-a { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 8px 10px; }
.hap-a .ch { flex: 0 0 auto; min-width: 44px; text-align: center; background: #0c1626; border: 1px solid #1c2c42; border-radius: 7px; padding: 4px 6px; font-size: .72rem; color: var(--ai-neon); font-family: 'Orbitron', sans-serif; }
.hap-a .t { font-size: .82rem; font-weight: 600; color: #f3f5fa; }
.hap-a .m { font-size: .7rem; color: #8b93a4; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hap-empty { font-size: .78rem; color: #8b93a4; padding: 12px 6px; text-align: center; }

/* ── 폰: 흐림·격자 끔(배터리·성능) ─────────────────────────────────────────── */
@media (max-width: 820px) {
  body.uhd-member .mdash-card, body.uhd-console .top-bar { backdrop-filter: none; }
  body.uhd-console .app-container::after { display: none; }
}
