/* =============================================
   MQBot — 무량봇 UI 전용 CSS
   동적 요소 없음 · 기존 at-card 스타일과 통일
   ============================================= */

/* ══════════════════════════════════════════
   카드 헤더 (at-card-header)
   at-card-title + 우측 버튼들
══════════════════════════════════════════ */
.at-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--at-border);
}
.at-card-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 카드 접힌 상태 — 헤더 구분선 + 운영제어 상단선 모두 제거 */
#at-setting-card.at-setting-collapsed .at-card-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
#at-setting-card.at-setting-collapsed #at-ctrl-wide-outer {
    border-top: none;
    padding-top: 0;
}

/* ══════════════════════════════════════════
   전략 설정 카드 잠금 상태
══════════════════════════════════════════ */

/* 잠금 시 카드 테두리 강조 */
#at-setting-card.at-strategy-locked {
    border-color: rgba(239, 68, 68, .35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .15);
}

/* 잠금 시 카드 타이틀 색상 */
#at-setting-card.at-strategy-locked .at-card-title span {
    color: #f87171;
}

/* 잠금 오버레이 — at-setting-body + at-ctrl-wide-outer */
.at-locked-overlay {
    position: relative;
    pointer-events: none;          /* 클릭/드래그/입력 완전 차단 */
    user-select: none;
}
.at-locked-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    border-radius: 6px;
    z-index: 10;
    backdrop-filter: blur(0.5px);
    pointer-events: none;
}

/* 잠금 배지 — 오버레이 위 중앙 텍스트 */
.at-lock-badge-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: 20px;
    color: #f87171;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: .04em;
}
.at-lock-badge-overlay i { font-size: 10px; }

/* 잠금 시 mq-lock-btn 강조 */
.mq-lock-btn.mq-locked {
    background: rgba(239, 68, 68, .15) !important;
    border-color: rgba(239, 68, 68, .35) !important;
    color: #f87171 !important;
}

/* 접기 버튼 */
.at-collapse-btn {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(51,65,85,.4);
    border: 1px solid var(--at-border);
    border-radius: 5px;
    color: var(--at-muted);
    cursor: pointer;
    transition: background .15s;
    font-size: 11px;
}
.at-collapse-btn:hover { background: rgba(99,102,241,.2); color: #a5b4fc; }

/* ══════════════════════════════════════════
   잠금 버튼
══════════════════════════════════════════ */
.mq-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(51,65,85,.4);
    border: 1px solid var(--at-border);
    border-radius: 5px;
    color: var(--at-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.mq-lock-btn:hover { background: rgba(251,191,36,.15); color: #fbbf24; border-color: rgba(251,191,36,.3); }
.mq-lock-btn.mq-locked { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }
.mq-lock-btn i { font-size: 11px; }

/* ══════════════════════════════════════════
   종목 수 뱃지
══════════════════════════════════════════ */
.mq-stock-count {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(59,130,246,.15);
    border: 1px solid rgba(59,130,246,.25);
    border-radius: 10px;
    color: #93c5fd;
    font-size: 10.5px;
    font-weight: 700;
}
.mq-stock-count.mq-count-full {
    background: rgba(239,68,68,.15);
    border-color: rgba(239,68,68,.3);
    color: #f87171;
}

/* ══════════════════════════════════════════
   ZONE B2: 무량봇 종목 관리
══════════════════════════════════════════ */
.mq-stocks-guide {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 10px;
    background: rgba(59,130,246,.06);
    border: 1px solid rgba(59,130,246,.15);
    border-radius: 6px;
    font-size: 11.5px;
    color: #94a3b8;
    margin-bottom: 10px;
}
.mq-stocks-guide i { color: #60a5fa; }
.mq-stocks-guide strong { color: #93c5fd; }
.mq-stocks-guide-sub {
    margin-left: auto;
    font-size: 10.5px;
    color: #475569;
}

/* 종목 목록 컨테이너 */
.mq-stock-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 40px;
    margin-bottom: 12px;
}

/* 빈 상태 */
.mq-stock-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    color: #334155;
    font-size: 12px;
}
.mq-empty-icon { font-size: 16px; color: #1e293b; }

/* ══════════════════════════════════════════
   종목 행 — 단일 1줄 가로 레이아웃
   [SIG][MKT][종목명───][진입일][현재가][투자금][원화평가][보유주][전체B/S][당일B/S][수익%][버튼]
══════════════════════════════════════════ */
.mq-stock-list { display: flex; flex-direction: column; gap: 5px; }

/* ──────────────────────────────────────────
   Grid 컬럼 정의 (헤더·데이터 공통)
   SIG(44) MKT(40) 종목명(minmax) 진입일(62)
   현재가(90) 투자원금(90) 평가금액(90)
   보유주(66) 전체B/S(82) 당일B/S(82) 수익률(70) 버튼(auto)
────────────────────────────────────────── */
:root {
    --mq-cols: 44px 40px minmax(88px,1fr) 62px 90px 90px 90px 66px 82px 82px 70px auto;
    --mq-gap: 0 8px;
    --mq-px: 10px 14px;
}

/* 헤더 행 (레이블)
   ★ 데이터 행과 완벽 정렬을 위해
     border: 1px solid transparent (너비 동일) + padding 동일하게 맞춤 */
.mq-stock-header {
    display: grid;
    grid-template-columns: var(--mq-cols);
    gap: var(--mq-gap);
    padding: 5px 14px;
    border: 1px solid transparent;        /* 데이터 행 border 1px와 너비 동일하게 */
    border-bottom-color: rgba(51,65,85,.35); /* 하단선만 표시 */
    margin-bottom: 4px;
    box-sizing: border-box;
    font-size: 9px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.mq-stock-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 금액 3개 컬럼(현재가·투자원금·평가금액) 헤더 — 미묘하게 구분 */
.mq-sh-price-group { color: #60a5fa; opacity: .7; }
.mq-sh-r { text-align: right; }
.mq-sh-c { text-align: center; }

.mq-stock-row {
    display: grid;
    grid-template-columns: var(--mq-cols);
    align-items: center;
    gap: var(--mq-gap);
    /* border(1px) 포함 총 좌우 공간이 헤더와 동일하도록
       padding-left는 border-left 두께 보정값 포함 */
    padding: 9px 14px 9px 14px;
    background: rgba(15,23,42,.45);
    border: 1px solid rgba(51,65,85,.45);
    /* border-left를 outline 방식(box-shadow inset)으로 대체 →
       레이아웃 너비에 영향 없이 좌측 컬러 바 표현 */
    border-left: 1px solid rgba(51,65,85,.45); /* 기본값 유지 */
    border-radius: 7px;
    transition: background .15s, box-shadow .15s;
    cursor: pointer;
    min-width: 0;
    box-sizing: border-box;
}
.mq-stock-row:hover { background: rgba(30,41,59,.7); }
/* box-shadow inset으로 좌측 컬러 바 — 레이아웃 비영향 */
.mq-stock-row.mq-status-running { box-shadow: inset 3px 0 0 #10b981; }
.mq-stock-row.mq-status-stopped { box-shadow: inset 3px 0 0 #475569; }
.mq-stock-row.mq-status-watch   { box-shadow: inset 3px 0 0 #3b82f6; }

/* 기준가 수신 텍스트 배지 */
.mq-row-sig {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    width: fit-content;
    max-width: 42px;
}
.mq-sig-ok {
    background: rgba(74,222,128,.15);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,.25);
}
.mq-sig-no {
    background: rgba(248,113,113,.12);
    color: #f87171;
    border: 1px solid rgba(248,113,113,.2);
}

/* 시장 배지 */
.mq-row-market {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .03em;
    white-space: nowrap;
    width: fit-content;
    max-width: 38px;
}
.mq-mkt-kp { background: rgba(99,102,241,.18); color: #a5b4fc; }
.mq-mkt-kq { background: rgba(16,185,129,.15); color: #34d399; }

/* 종목명 */
.mq-row-name {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    transition: color .15s;
    letter-spacing: -.01em;
}
.mq-stock-row:hover .mq-row-name { color: #a5b4fc; }

/* 진입일 */
.mq-row-entry {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

/* ── 금액 3개 컬럼 공통 베이스 ── */
.mq-row-price,
.mq-row-invested,
.mq-row-holdvalue {
    font-size: 11px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: -.015em;
}

/* 현재가 — 조금 더 밝게 + 틱 색상 */
.mq-row-price {
    color: #94a3b8;
    font-weight: 600;
}
.mq-row-price.up { color: #f87171; }
.mq-row-price.dn { color: #60a5fa; }

/* 투자 원금 — 차분한 회색 */
.mq-row-invested {
    color: #64748b;
    font-weight: 500;
}

/* 평가금액 — 약간 강조 */
.mq-row-holdvalue {
    color: #94a3b8;
    font-weight: 700;
}

/* 보유 주식수 */
.mq-row-holdqty {
    font-size: 11px;
    color: #64748b;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 500;
}

/* 전체/당일 거래 수량 */
.mq-stat-trades,
.mq-stat-today {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.mq-stat-buy  { color: #f87171; font-weight: 700; }   /* 매수 — 빨강 */
.mq-stat-sell { color: #60a5fa; font-weight: 700; }   /* 매도 — 파랑 */

/* 수익률 % */
.mq-row-pnl {
    font-size: 11.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    letter-spacing: -.01em;
}
.mq-row-pnl.pos { color: #f87171; }
.mq-row-pnl.neg { color: #60a5fa; }

/* 행 버튼 그룹 — 수익률과 간격 확보 */
.mq-row-btns {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
    padding-left: 10px;  /* 수익률 컬럼과 시각적 분리 */
}
.mq-run-btn, .mq-del-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.mq-run-start {
    background: rgba(16,185,129,.15);
    border-color: rgba(16,185,129,.3);
    color: #34d399;
}
.mq-run-start:hover { background: rgba(16,185,129,.28); }
.mq-run-stop {
    background: rgba(239,68,68,.12);
    border-color: rgba(239,68,68,.25);
    color: #f87171;
}
.mq-run-stop:hover { background: rgba(239,68,68,.25); }
.mq-del-btn {
    background: rgba(51,65,85,.3);
    border-color: rgba(51,65,85,.6);
    color: #475569;
    padding: 4px 8px;
}
.mq-del-btn:hover { background: rgba(239,68,68,.1); color: #f87171; border-color: rgba(239,68,68,.3); }

/* ══════════════════════════════════════════
   종목 클릭 차트 패널 (슬라이드다운)
══════════════════════════════════════════ */
.mq-stock-chart-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .35s ease, opacity .25s ease, margin .25s ease;
    margin-top: 0;
    background: rgba(10,18,35,.7);
    border: 1px solid rgba(99,102,241,.25);
    border-radius: 8px;
}
.mq-stock-chart-panel.open {
    max-height: 420px;
    opacity: 1;
    margin-top: 10px;
    overflow: visible;
}

/* 패널 헤더 */
.mq-scp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 8px;
    border-bottom: 1px solid rgba(51,65,85,.5);
}
.mq-scp-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.mq-scp-dot {
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}
.mq-scp-dot.sig-ok { color: #4ade80; }
.mq-scp-dot.sig-no { color: #f87171; }

.mq-scp-title strong {
    font-size: 13px;
    font-weight: 800;
    color: #e2e8f0;
}
.mq-scp-code {
    font-size: 10px;
    color: #475569;
    font-variant-numeric: tabular-nums;
}
.mq-scp-pnl {
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}
.mq-scp-pnl.pos { color: #f87171; }
.mq-scp-pnl.neg { color: #60a5fa; }

.mq-scp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    color: #64748b;
    flex-wrap: wrap;
    margin-top: 3px;
}
.mq-scp-meta span { white-space: nowrap; }

.mq-scp-close {
    background: rgba(51,65,85,.35);
    border: 1px solid rgba(51,65,85,.6);
    color: #64748b;
    border-radius: 5px;
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.mq-scp-close:hover { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }

/* 탭 바 */
.mq-scp-tabs {
    display: flex;
    gap: 0;
    padding: 0 14px;
    border-bottom: 1px solid rgba(51,65,85,.4);
    background: rgba(15,23,42,.3);
}
.mq-scp-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 10.5px;
    font-weight: 700;
    color: #475569;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    letter-spacing: .02em;
    white-space: nowrap;
}
.mq-scp-tab i { font-size: 10px; }
.mq-scp-tab:hover { color: #94a3b8; }
.mq-scp-tab.active {
    color: #a5b4fc;
    border-bottom-color: #6366f1;
}

/* 차트 영역 */
.mq-scp-chart-wrap {
    position: relative;
    height: 240px;
    padding: 12px 14px 8px;
}
.mq-scp-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}
.mq-scp-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1e293b;
    font-size: 11.5px;
    pointer-events: none;
}
.mq-scp-empty i { font-size: 20px; color: #1e293b; }

/* 행 포커스 강조 */
.mq-stock-row.mq-row-focused {
    border-color: rgba(99,102,241,.5) !important;
    box-shadow: 0 0 0 1px rgba(99,102,241,.2);
    background: rgba(30,41,59,.75) !important;
}

/* ── 구형 수익 차트 섹션 (숨김 처리 — 패널로 대체) ── */
.mq-chart-section { display: none; }
.mq-hint { color: #334155; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ══════════════════════════════════════════
   통합 카드 내부 레이아웃
   상단 2열: 시그널&지표(좌) + 시스템모니터(우)
   하단 전체폭: 종목 목록 + 차트
══════════════════════════════════════════ */

/* 상단 2열 그리드 */
.mq-top-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 14px;
    align-items: start;
    margin-bottom: 0;
}

/* 좌: 시그널&지표 영역 */
.mq-top-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* 우: 시스템 모니터 영역 */
.mq-top-right {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 1px solid var(--at-border);
    padding-left: 14px;
}

/* 상단↔하단 구분선 */
.mq-divider {
    border: none;
    border-top: 1px solid var(--at-border);
    margin: 14px 0;
}

/* ══════════════════════════════════════════
   시그널 & 지표 섹션
══════════════════════════════════════════ */

/* 카드 헤더 전략 뱃지 */
.mq-strat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(251,146,60,.1);
    border: 1px solid rgba(251,146,60,.22);
    border-radius: 5px;
    color: #fb923c;
    font-size: 10.5px;
    font-weight: 700;
}

.mq-signal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 타임프레임 행 */
.mq-sig-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.mq-sig-row-label {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--at-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    min-width: 80px;
}
.mq-sig-row-label i { margin-right: 3px; }

/* 타임프레임 체크박스 */
.mq-tf-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.mq-tf-cb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(15,23,42,.5);
    border: 1px solid rgba(51,65,85,.6);
    border-radius: 5px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    user-select: none;
}
.mq-tf-cb:hover { background: rgba(30,41,59,.8); }
.mq-tf-cb input[type=checkbox] { display: none; }
.mq-tf-cb span { font-size: 11.5px; font-weight: 700; color: #475569; }
.mq-tf-cb small { font-size: 9px; color: #334155; }
.mq-tf-cb:has(input:checked) {
    background: rgba(59,130,246,.12);
    border-color: rgba(59,130,246,.35);
}
.mq-tf-cb:has(input:checked) span { color: #93c5fd; }

/* ── 지표 레이아웃: 5열 가로 ── */
.mq-ind-layout {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    border-top: 1px solid var(--at-border);
    padding-top: 12px;
}

/* 카테고리 블록 */
.mq-ind-cat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 카테고리 레이블 */
.mq-ind-cat-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 3px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mq-ind-cat-label i { font-size: 9px; }
.mq-ind-cat-label.ind-trend  { color: #a5b4fc; background: rgba(99,102,241,.1);  border: 1px solid rgba(99,102,241,.2); }
.mq-ind-cat-label.ind-vol    { color: #93c5fd; background: rgba(59,130,246,.1);  border: 1px solid rgba(59,130,246,.2); }
.mq-ind-cat-label.ind-mom    { color: #fdba74; background: rgba(251,146,60,.1);  border: 1px solid rgba(251,146,60,.2); }
.mq-ind-cat-label.ind-vol2   { color: #6ee7b7; background: rgba(16,185,129,.1);  border: 1px solid rgba(16,185,129,.2); }
.mq-ind-cat-label.ind-pat    { color: #c4b5fd; background: rgba(139,92,246,.1);  border: 1px solid rgba(139,92,246,.2); }

/* 지표 목록 */
.mq-ind-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* 지표 체크박스 */
.mq-ind-cb {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    background: rgba(15,23,42,.4);
    border: 1px solid rgba(51,65,85,.4);
    border-radius: 4px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    user-select: none;
}
.mq-ind-cb:hover { background: rgba(30,41,59,.7); }
.mq-ind-cb input[type=checkbox] { display: none; }
.mq-ind-cb .fas { font-size: 10px; color: #334155; flex-shrink: 0; width: 12px; text-align: center; }
.mq-ind-cb span { font-size: 11px; font-weight: 600; color: #475569; }

/* 체크된 상태 — 카테고리별 색상 */
.mq-ind-cb.ind-trend:has(input:checked) { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.25); }
.mq-ind-cb.ind-trend:has(input:checked) span { color: #a5b4fc; }
.mq-ind-cb.ind-trend:has(input:checked) .fas { color: #6366f1; }

.mq-ind-cb.ind-vol:has(input:checked)   { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.25); }
.mq-ind-cb.ind-vol:has(input:checked) span { color: #93c5fd; }
.mq-ind-cb.ind-vol:has(input:checked) .fas { color: #3b82f6; }

.mq-ind-cb.ind-mom:has(input:checked)   { background: rgba(251,146,60,.08); border-color: rgba(251,146,60,.25); }
.mq-ind-cb.ind-mom:has(input:checked) span { color: #fdba74; }
.mq-ind-cb.ind-mom:has(input:checked) .fas { color: #f97316; }

.mq-ind-cb.ind-vol2:has(input:checked)  { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.25); }
.mq-ind-cb.ind-vol2:has(input:checked) span { color: #6ee7b7; }
.mq-ind-cb.ind-vol2:has(input:checked) .fas { color: #10b981; }

.mq-ind-cb.ind-pat:has(input:checked)   { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.25); }
.mq-ind-cb.ind-pat:has(input:checked) span { color: #c4b5fd; }
.mq-ind-cb.ind-pat:has(input:checked) .fas { color: #8b5cf6; }

/* ══════════════════════════════════════════
   시스템 모니터 섹션 (mq-top-right 내부)
══════════════════════════════════════════ */
.mq-monitor-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mq-block-header {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--at-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}
.mq-block-header i { font-size: 10px; }

/* 상태 보드 */
.mq-status-board {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mq-status-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 7px;
    background: rgba(15,23,42,.4);
    border-radius: 5px;
    border: 1px solid rgba(51,65,85,.3);
}
.mq-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #334155;
}
.mq-dot-ok   { background: #10b981; box-shadow: 0 0 4px rgba(16,185,129,.5); }
.mq-dot-warn { background: #fbbf24; box-shadow: 0 0 4px rgba(251,191,36,.4); }
.mq-dot-err  { background: #ef4444; box-shadow: 0 0 4px rgba(239,68,68,.4); }
.mq-dot-off  { background: #334155; }
.mq-status-name { font-size: 11px; color: #64748b; flex: 1; }
.mq-status-val  { font-size: 11px; font-weight: 600; color: #94a3b8; white-space: nowrap; }

/* 기준가 수신 목록 */
.mq-ref-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 160px;
    overflow-y: auto;
}
.mq-ref-empty { font-size: 11px; color: #334155; padding: 6px 0; }
.mq-ref-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    background: rgba(15,23,42,.3);
    border-radius: 4px;
    font-size: 11px;
}
.mq-ref-sign { font-size: 10px; }
.mq-ref-name { flex: 1; color: #94a3b8; }
.mq-ref-val  { color: #cbd5e1; font-weight: 600; font-variant-numeric: tabular-nums; }
.mq-ref-val.mq-blink { color: #f87171; }

/* 경고 영역 */
.mq-alert-area {
    margin-top: 8px;
    padding: 7px 10px;
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.25);
    border-radius: 6px;
}
.mq-alert-msg {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: #f87171;
}
.mq-alert-msg i { font-size: 12px; }

/* ══════════════════════════════════════════
   Lock 모달
══════════════════════════════════════════ */
.mq-lock-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mq-lock-modal-overlay.hidden { display: none; }

.mq-lock-modal {
    background: #0f172a;
    border: 1px solid rgba(99,102,241,.3);
    border-radius: 10px;
    width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,.7);
    overflow: hidden;
}
.mq-lock-modal-header {
    padding: 14px 16px;
    background: rgba(99,102,241,.08);
    border-bottom: 1px solid rgba(99,102,241,.15);
    font-size: 13px;
    font-weight: 700;
    color: #a5b4fc;
    display: flex;
    align-items: center;
    gap: 7px;
}
.mq-lock-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mq-lock-modal-body p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}
.mq-lock-pw-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(15,23,42,.8);
    border: 1px solid rgba(99,102,241,.25);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
}
.mq-lock-pw-input:focus { border-color: rgba(99,102,241,.55); }
.mq-lock-err {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #f87171;
}
.mq-lock-modal-footer {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid rgba(51,65,85,.4);
}
.mq-lock-cancel-btn {
    padding: 6px 14px;
    background: rgba(51,65,85,.4);
    border: 1px solid var(--at-border);
    border-radius: 5px;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s;
}
.mq-lock-cancel-btn:hover { background: rgba(51,65,85,.7); color: #94a3b8; }
.mq-lock-confirm-btn {
    padding: 6px 16px;
    background: rgba(99,102,241,.2);
    border: 1px solid rgba(99,102,241,.35);
    border-radius: 5px;
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.mq-lock-confirm-btn:hover { background: rgba(99,102,241,.35); }
