﻿:root {
    --nav-bg: #1e293b;
    --nav-bg-hover: #334155;
    --nav-active: #2563eb;
    --bg: #f8fafc;
    --panel: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-dim: #64748b;
    --primary: #2563eb;
    --in-bubble: #ffffff;
    --out-bubble: #2563eb;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: "맑은 고딕", "Malgun Gothic", -apple-system, system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
}

/* ─── 로그인 ─── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, #1e293b, #2563eb);
}
.login-card {
    background: #fff; border-radius: 14px; padding: 40px 36px;
    width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { font-size: 30px; font-weight: 800; color: var(--primary); text-align: center; }
.login-sub { text-align: center; color: var(--text-dim); margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.login-form input {
    padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.login-btn {
    margin-top: 6px; padding: 12px; background: var(--primary); color: #fff; border: none;
    border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.login-btn:hover { background: #1d4ed8; }
.login-error {
    background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
    padding: 9px 12px; border-radius: 8px; font-size: 13px;
}

/* ─── 쉘 ─── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.nav {
    width: 200px; flex-shrink: 0; background: var(--nav-bg); color: #cbd5e1;
    display: flex; flex-direction: column;
}
.nav-logo {
    height: 60px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .5px;
}
.nav-menu { flex: 1; overflow-y: auto; padding: 6px 0; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 18px;
    color: #cbd5e1; text-decoration: none; font-size: 13.5px; cursor: pointer;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--nav-bg-hover); color: #fff; }
.nav-item.active { background: var(--nav-bg-hover); color: #fff; border-left-color: var(--nav-active); }
.nav-item.disabled { opacity: .55; }
.nav-icon { width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ef4444; color: #fff; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1;
}
.nav-badge[hidden] { display: none; }
/* 검수 큐 뱃지는 '미처리' 가 아니라 '지금 돌고 있음' 이다 — 빨강은 문제로 읽히므로 파랑으로 구분한다 */
.nav-badge[data-badge="preflightQueue"] { background: #2563eb; }

/* ── 전역 알림 토스트 (nav-badges.js showToast) ── */
.noti-toast-wrap {
    position: fixed; right: 20px; bottom: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 360px; pointer-events: none;
}
.noti-toast {
    pointer-events: auto; cursor: pointer;
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 10px; padding: 12px 12px 12px 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
    transform: translateX(120%); opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}
.noti-toast.show { transform: translateX(0); opacity: 1; }
.noti-toast.hide { transform: translateX(120%); opacity: 0; }
.noti-toast-ico { font-size: 18px; line-height: 1.3; flex-shrink: 0; }
.noti-toast-main { min-width: 0; flex: 1; }
.noti-toast-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.noti-toast-text {
    font-size: 13px; color: var(--text-dim); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.noti-toast-close {
    flex-shrink: 0; background: none; border: none; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--text-dim); padding: 0 2px;
}
.noti-toast-close:hover { color: var(--text); }
@media (max-width: 768px) {
    .noti-toast-wrap { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}
.nav-footer { border-top: 1px solid #334155; padding: 12px 16px; }
.nav-user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: #e2e8f0; }
.nav-user-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.nav-logout-form { margin: 0; }
.nav-logout {
    width: 100%; padding: 7px; background: transparent; color: #94a3b8;
    border: 1px solid #475569; border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.nav-logout:hover { background: #334155; color: #fff; }

/* 데스크톱 알림 켜기 (메뉴 아래 · 사용자 위) */
.nav-noti-btn {
    width: 100%; padding: 7px; margin-bottom: 10px;
    background: transparent; color: #cbd5e1;
    border: 1px solid #475569; border-radius: 6px; cursor: pointer;
    font-size: 12.5px; text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.nav-noti-btn:hover:not(:disabled) { background: #334155; color: #fff; }
.nav-noti-btn.on { color: #22c55e; border-color: #22c55e33; cursor: default; }
.nav-noti-btn:disabled { cursor: default; opacity: .85; }

.content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.content-header { padding: 18px 24px; border-bottom: 1px solid var(--border); background: #fff; }
.content-header h1 { margin: 0; font-size: 18px; }

/* ─── 준비 중 ─── */
.soon { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 12px; }
.soon-icon { font-size: 52px; }
.soon-title { font-size: 18px; font-weight: 700; }
.soon-desc { color: var(--text-dim); max-width: 420px; text-align: center; line-height: 1.6; }
.soon-link { color: var(--primary); text-decoration: none; font-weight: 600; margin-top: 8px; }

/* ─── 알림함 ─── */
/* ── 알림 2-pane 레이아웃(WinApp NotificationControl 마스터-디테일) ── */
.nt-layout { display: flex; flex: 1; overflow: hidden; }
.nt-list-pane { width: 400px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: #f6f8fa; overflow: hidden; }
.nt-detail-pane { flex: 1; display: flex; flex-direction: column; background: #fff; min-width: 0; }
.nt-detail-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #94a3b8; }
.nt-detail-placeholder .bd-empty-icon { font-size: 40px; opacity: .6; }
.nt-detail { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.nt-detail-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.nt-detail-back { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-dim); padding: 0 4px; }
.nt-detail-close { margin-left: auto; background: none; border: none; font-size: 16px; cursor: pointer; color: #94a3b8; padding: 4px 6px; }
.nt-detail-close:hover { color: var(--text); }
.nt-detail-scroll { flex: 1; overflow-y: auto; padding: 22px 26px; min-height: 0; }
.nt-detail-meta { color: #94a3b8; font-size: 12.5px; margin-bottom: 10px; }
.nt-detail-title { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 16px; line-height: 1.45; word-break: break-word; }
.nt-detail-message { color: #334155; font-size: 14px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.nt-detail-link { display: inline-block; margin-top: 18px; color: var(--primary); font-weight: 600; text-decoration: none; }
.nt-detail-link:hover { text-decoration: underline; }
.nt-detail-readers { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 16px; }
.nt-readers-head { font-size: 13px; font-weight: 700; color: #475569; margin-bottom: 10px; }
.nt-readers-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nt-readers-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #64748b; }
.nt-reader-time { color: #94a3b8; flex-shrink: 0; }
.nt-item.selected { border-color: var(--primary); background: #eff6ff; box-shadow: inset 0 0 0 1px var(--primary); }

.nt-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nt-header-actions { display: flex; align-items: center; gap: 10px; }
.nt-filter { display: inline-flex; background: #f1f5f9; border-radius: 999px; padding: 3px; }
.nt-filter-btn {
    border: none; background: transparent; cursor: pointer; padding: 5px 14px;
    border-radius: 999px; font-size: 13px; color: var(--text-dim); font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
}
.nt-filter-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.nt-unread-count {
    background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px;
    min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 700;
}

.nt-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.nt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nt-msg { text-align: center; color: var(--text-dim); padding: 40px 0; }
.nt-msg.err { color: #b91c1c; }

/* WinApp NotificationControl 과 동일한 카드 형태 */
.nt-item {
    position: relative; padding: 11px 16px 11px 22px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; transition: background .12s, border-color .12s;
}
.nt-item:hover { background: #f1f5f9; }
.nt-item.unread { border-color: #cbd5e1; }
.nt-item.read { background: #fafbfc; }
/* 좌측 심각도 바 (색은 인라인 style 로 심각도 fg 지정) */
.nt-sevbar { position: absolute; left: 6px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; }
.nt-main { min-width: 0; }
.nt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nt-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }
/* 유형 태그 pill (배경/글자색은 인라인 style 로 심각도색 지정) */
.nt-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; }
.nt-time { margin-left: auto; color: #94a3b8; font-size: 12px; flex-shrink: 0; }
.nt-title { font-weight: 700; color: #0f172a; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-item.read .nt-title { font-weight: 400; color: #475569; }
.nt-text { color: #94a3b8; font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nt-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; flex-shrink: 0; letter-spacing: .2px; }
.nt-badge.t-chat { background: #dbeafe; color: #1d4ed8; }
.nt-badge.t-flight { background: #f3e8ff; color: #7e22ce; }
.nt-badge.t-call { background: #dcfce7; color: #15803d; }
.nt-badge.t-quote { background: #fef3c7; color: #b45309; }
.nt-badge.t-deadline { background: #fee2e2; color: #b91c1c; }
.nt-badge.t-etc { background: #e2e8f0; color: #475569; }

/* ─── 주문 관리 ─── */
.ord-it-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.ord-it-num { font-weight: 700; font-size: 13.5px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-it-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-dim); }
.ord-paid { color: #15803d; font-weight: 600; }
.ord-unpaid { color: #b91c1c; font-weight: 600; }

.ord-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; flex-shrink: 0; letter-spacing: .2px; }
.ord-badge-lg { padding: 4px 14px; font-size: 12.5px; margin-bottom: 12px; }
.ord-badge.s-received  { background: #e2e8f0; color: #475569; }
.ord-badge.s-designing { background: #dbeafe; color: #1d4ed8; }
.ord-badge.s-printing  { background: #fef3c7; color: #b45309; }
.ord-badge.s-finishing { background: #f3e8ff; color: #7e22ce; }
.ord-badge.s-shipping  { background: #cffafe; color: #0e7490; }
.ord-badge.s-delivered { background: #dcfce7; color: #15803d; }
.ord-badge.s-quote     { background: #fef9c3; color: #a16207; }
.ord-badge.s-etc       { background: #f1f5f9; color: #64748b; }

.ord-detail-body { padding: 22px 32px 36px; }

.ord-stepper { display: flex; align-items: center; padding: 8px 4px 22px; }
.ord-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.ord-step-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #e2e8f0; color: #94a3b8; }
.ord-step-label { font-size: 11.5px; color: #94a3b8; font-weight: 600; }
.ord-step.done .ord-step-dot { background: #22c55e; color: #fff; }
.ord-step.done .ord-step-label { color: #15803d; }
.ord-step.current .ord-step-dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.18); }
.ord-step.current .ord-step-label { color: var(--primary); }
.ord-step-bar { flex: 1; height: 2px; background: #e2e8f0; margin: 0 2px 20px; min-width: 12px; }

.ord-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; }
.ord-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }
.ord-note { flex: 1; min-width: 140px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

.ord-rows { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.ord-row { display: flex; border-bottom: 1px solid #eef2f7; }
.ord-row:last-child { border-bottom: none; }
.ord-row-k { width: 96px; flex-shrink: 0; padding: 11px 14px; background: #f8fafc; color: var(--text-dim); font-weight: 600; font-size: 13px; }
.ord-row-v { padding: 11px 14px; font-size: 13.5px; color: #0f172a; word-break: break-word; }

.ord-sec-title { margin: 24px 0 10px; font-weight: 700; font-size: 14px; color: #0f172a; }
.ord-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ord-timeline li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.ord-tl-txt { font-size: 13px; color: #0f172a; }
.ord-tl-meta { margin-left: auto; font-size: 11.5px; color: var(--text-dim); }
.ord-empty-note { color: var(--text-dim); font-size: 13px; padding: 6px 2px; }

/* ─── 대시보드 ─── */
.dash-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-topbar-right { display: flex; align-items: center; gap: 12px; }
.dash-updated { font-size: 12px; color: var(--text-dim); }
.dash-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.dash-err { padding: 30px; text-align: center; color: #b91c1c; }

.dash-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.dash-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: #fff; border: 1px solid var(--border); border-left-width: 4px; border-radius: 12px; }
.dash-card-ico { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.dash-card-value { font-size: 26px; font-weight: 800; line-height: 1.1; color: #0f172a; letter-spacing: -.5px; }
.dash-card-label { font-size: 13px; color: #334155; font-weight: 600; margin-top: 2px; }
.dash-card-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.dash-card.k-blue   { border-left-color: #2563eb; } .dash-card.k-blue   .dash-card-ico { background: #dbeafe; }
.dash-card.k-amber  { border-left-color: #d97706; } .dash-card.k-amber  .dash-card-ico { background: #fef3c7; }
.dash-card.k-green  { border-left-color: #16a34a; } .dash-card.k-green  .dash-card-ico { background: #dcfce7; }
.dash-card.k-violet { border-left-color: #7c3aed; } .dash-card.k-violet .dash-card-ico { background: #f3e8ff; }
.dash-card.k-rose   { border-left-color: #e11d48; } .dash-card.k-rose   .dash-card-ico { background: #ffe4e6; }

.dash-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.dash-panel-title { font-weight: 700; font-size: 14px; color: #0f172a; margin-bottom: 10px; }
.dash-urgent { border-color: #fecaca; background: #fff5f5; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.dash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border-radius: 9px; }
.dash-li:hover { background: #f8fafc; }
.dash-li.empty { color: var(--text-dim); font-size: 13px; justify-content: center; padding: 18px 0; }
.dash-li.urgent { align-items: center; }
.dash-li-ico { font-size: 18px; flex-shrink: 0; }
.dash-li-main { flex: 1; min-width: 0; }
.dash-li-top { display: flex; align-items: center; gap: 7px; }
.dash-li-title { font-weight: 600; font-size: 13.5px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-li-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-li-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.dash-li-time { font-size: 11.5px; color: #94a3b8; flex-shrink: 0; white-space: nowrap; }
.dash-li-who { font-size: 11.5px; color: #475569; }
.dash-li-who.none { color: #cbd5e1; }
.dash-chip { font-size: 11px; color: #64748b; background: #f1f5f9; border-radius: 6px; padding: 1px 6px; flex-shrink: 0; }
.dash-unread { background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.dash-badge { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.dash-badge.s-new  { background: #dbeafe; color: #1d4ed8; }
.dash-badge.s-proc { background: #fef3c7; color: #b45309; }
.dash-badge.s-done { background: #dcfce7; color: #15803d; }
.dash-badge.s-miss { background: #fee2e2; color: #b91c1c; }
.dash-badge.s-etc  { background: #f1f5f9; color: #64748b; }

.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { text-align: left; padding: 8px 10px; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dash-table td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; }
.dash-td-name { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #0f172a; }
.dash-td-num { text-align: center; }
.dash-td-num.warn { color: #b91c1c; font-weight: 700; }
.dash-td-empty { text-align: center; color: var(--text-dim); padding: 18px 0; }
.dash-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-dot.on { background: #22c55e; }
.dash-dot.off { background: #cbd5e1; }

/* ─── 채팅 ─── */
.chat-layout { display: flex; flex: 1; overflow: hidden; }

.pane-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.pane-header h2 { margin: 0; font-size: 15px; }
.icon-btn { border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--text-dim); }
.icon-btn:hover { color: var(--text); }

/* 목록 */
.chat-list-pane {
    width: 300px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.chat-filter { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.filter-chip {
    flex: 1; padding: 6px 4px; border: 1px solid var(--border); background: #fff; border-radius: 20px;
    font-size: 12px; cursor: pointer; color: var(--text-dim);
}
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.chat-item { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.chat-item:hover { background: #f8fafc; }
.chat-item.active { background: #eff6ff; border-left: 3px solid var(--primary); padding-left: 13px; }
.ci-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ci-name-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ci-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 목록 항목 이름 변경(✎) 버튼 — 평소 숨김, 항목 hover 시 노출 */
.ci-rename {
    border: none; background: transparent; cursor: pointer; padding: 0 3px;
    font-size: 12px; line-height: 1; color: var(--text-dim); flex-shrink: 0;
    opacity: 0; transition: opacity .12s, color .12s;
}
.chat-item:hover .ci-rename { opacity: .6; }
.ci-rename:hover { opacity: 1; color: var(--primary); }
/* 목록 인라인 이름 편집 입력 */
.ci-name-edit {
    font-weight: 700; font-size: 14px; padding: 1px 5px; min-width: 0; width: 100%;
    border: 1px solid var(--primary); border-radius: 5px; outline: none;
}
.ci-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e2e8f0; color: #475569; }
.ci-status.s-new { background: #dbeafe; color: #1d4ed8; }
.ci-status.s-processing { background: #fef3c7; color: #b45309; }
.ci-status.s-done { background: #dcfce7; color: #15803d; }
.ci-bottom { display: flex; gap: 6px; align-items: center; color: var(--text-dim); font-size: 12.5px; }
/* 목록 항목의 최근 대화 일시 (예전 채널명 자리) */
.ci-channel, .ci-time { flex-shrink: 0; font-weight: 600; }
.ci-time { font-variant-numeric: tabular-nums; }
.ci-preview { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 상담별 안읽음 뱃지 (WinApp 목록의 빨간 원형 카운트와 동일) */
.ci-unread {
    flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #ef4444; color: #fff; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1;
}
.list-empty { padding: 30px 16px; text-align: center; color: var(--text-dim); }

/* 대화 */
/* hidden 속성이 클래스의 display 지정을 이기도록 (conv-empty/messages 동시 표시 방지) */
[hidden] { display: none !important; }
.chat-conv-pane { flex: 1; display: flex; flex-direction: column; background: #f0f0f0; min-width: 0; position: relative; }
/* 파일 드래그드롭 오버레이 */
.chat-conv-pane.chat-dragover::after {
    content: "📎 여기에 놓으면 파일이 전송됩니다";
    position: absolute; inset: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: var(--primary);
    background: rgba(37, 99, 235, .07);
    border: 2.5px dashed var(--primary); border-radius: 10px;
    pointer-events: none; z-index: 30;
}
.conv-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid var(--border); background: #fff;
}
.conv-title { display: flex; align-items: center; gap: 10px; }
.conv-head-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* 뒤로(←) 버튼: 데스크톱 숨김, 모바일에서만 노출 (카카오식 마스터-디테일) */
.conv-back { display: none; border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text); padding: 2px 8px 2px 0; flex-shrink: 0; }
.conv-back:hover { color: var(--primary); }
#conv-name { font-weight: 700; font-size: 16px; }
/* 채팅방 이름 변경(✎) 버튼 — 평소엔 흐리게, 헤더 hover 시 또렷하게 */
.conv-rename {
    border: none; background: transparent; cursor: pointer; padding: 2px 4px;
    font-size: 14px; line-height: 1; color: var(--text-dim); opacity: .55;
    border-radius: 6px; flex-shrink: 0; transition: opacity .15s, background .15s, color .15s;
}
.conv-header:hover .conv-rename { opacity: 1; }
.conv-rename:hover { color: var(--primary); background: #eef2ff; opacity: 1; }
.conv-search-btn {
    border: 1px solid var(--border); background: #fff; border-radius: 50%;
    width: 24px; height: 24px; line-height: 1; padding: 0; font-size: 12px;
    cursor: pointer; flex-shrink: 0;
}
.conv-search-btn:hover { background: #eff6ff; border-color: var(--primary); }

/* 대화 내 메시지 검색 바 */
.conv-search {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: #f5f8fc; border-bottom: 1px solid var(--border);
}
.conv-search-icon { flex-shrink: 0; }
.conv-search input {
    flex: 1; min-width: 0; padding: 6px 10px;
    border: 1px solid var(--border); border-radius: 7px; font-size: 13px;
}
.conv-search input:focus { outline: none; border-color: var(--primary); }
.conv-search-count { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.conv-search-nav {
    border: 1px solid var(--border); background: #fff; border-radius: 6px;
    width: 26px; height: 26px; padding: 0; cursor: pointer; font-size: 11px; flex-shrink: 0;
}
.conv-search-nav:hover { background: #eff6ff; border-color: var(--primary); }
.ic-msg.search-hit .ic-bubble { outline: 2px solid #facc15; background: #fef9c3; }
/* 인라인 이름 편집 입력 */
.conv-name-edit {
    font-weight: 700; font-size: 16px; padding: 2px 6px; min-width: 120px;
    border: 1px solid var(--primary); border-radius: 6px; outline: none;
}
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e0e7ff; color: #3730a3; }
.status-select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

.conv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-dim); gap: 8px; }
.conv-empty-icon { font-size: 46px; }

/* 메시지 마크업은 내부채팅과 동일한 .ic-* 구조 재사용 (아바타 + 말풍선 밖 시간).
   간격도 .ic-messages 와 동일하게 3px (.ic-msg margin-top 과 합쳐져 그룹 간격 형성). */
.conv-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 3px; }
.msg { display: flex; max-width: 70%; }
.msg-in { align-self: flex-start; }
.msg-out { align-self: flex-end; }
.msg-bubble { padding: 9px 13px; border-radius: 14px; line-height: 1.5; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.msg-in .msg-bubble { background: var(--in-bubble); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-out .msg-bubble { background: #bad7fb; color: #1a1a1a; border-bottom-right-radius: 4px; }
.msg-author { font-size: 11px; opacity: .8; margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; }
.msg-link { color: inherit; text-decoration: underline; word-break: break-all; }
.msg-link:hover { opacity: .85; }
.msg-time { font-size: 10.5px; opacity: .6; margin-top: 3px; text-align: right; }
.msg-image { max-width: 220px; border-radius: 8px; display: block; }
.msg-file { color: inherit; text-decoration: underline; }
.msg-system { align-self: center; background: #e2e8f0; color: #475569; font-size: 12px; padding: 4px 12px; border-radius: 12px; }
.msg-new { animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: scale(1); opacity: 1; } }

.conv-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: #fff; }
.conv-input textarea {
    flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; font-family: inherit; line-height: 1.4;
    min-height: 84px; max-height: 180px;   /* PC 기본 3줄 높이, 입력 많으면 확장 */
}
.conv-input textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.send-btn {
    align-self: flex-end; padding: 10px 20px; background: var(--primary); color: #fff; border: none;
    border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.send-btn:hover { background: #1d4ed8; }
.attach-btn {
    align-self: flex-end; width: 42px; height: 42px; flex-shrink: 0; padding: 0;
    background: #f1f5f9; border: 1px solid var(--border); border-radius: 10px;
    cursor: pointer; font-size: 18px; line-height: 1;
}
.attach-btn:hover { background: #e2e8f0; }

/* ═══════════════════════════════════════════════
   내부 채팅 (Internal Chat)
   ═══════════════════════════════════════════════ */
.ic-layout { display: flex; flex: 1; overflow: hidden; }
.ic-head-actions { display: flex; gap: 4px; }

/* ── 방 목록 ── */
.ic-list-pane {
    width: 300px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.ic-search-bar { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ic-search-bar input {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.ic-search-bar input:focus { outline: none; border-color: var(--primary); }
.ic-room-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.ic-room-item {
    display: flex; gap: 11px; align-items: center; padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.ic-room-item:hover { background: #f8fafc; }
.ic-room-item.active { background: #eff6ff; }
.ir-avatar {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 17px;
}
.ir-body { flex: 1; min-width: 0; }
.ir-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ir-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ir-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ir-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.ir-preview { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ir-unread {
    flex-shrink: 0; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── 대화 ── */
.ic-conv-pane { flex: 1; display: flex; flex-direction: column; background: #f0f0f0; min-width: 0; }
.ic-conv-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-bottom: 1px solid var(--border); background: #fff;
}
.ic-conv-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ic-room-name { font-weight: 700; font-size: 16px; }
.ic-conv-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ic-room-search {
    border: 1px solid var(--border); background: #fff; border-radius: 50%;
    width: 24px; height: 24px; line-height: 1; padding: 0; font-size: 12px;
    cursor: pointer; flex-shrink: 0;
}
.ic-room-search:hover { background: #eff6ff; border-color: var(--primary); }
.ic-member-count {
    border: none; background: transparent; padding: 0; cursor: pointer;
    font-size: 12px; color: var(--primary); text-align: left;
}
.ic-member-count:hover { text-decoration: underline; }
.ic-conv-actions { display: flex; gap: 6px; }
.ic-conv-head-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* 뒤로(←) 버튼: 데스크톱 숨김, 모바일에서만 노출 (카카오식 마스터-디테일) */
.ic-back { display: none; border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text); padding: 2px 8px 2px 0; flex-shrink: 0; }
.ic-back:hover { color: var(--primary); }
.ghost-btn {
    padding: 6px 10px; border: 1px solid var(--border); background: #fff;
    border-radius: 6px; font-size: 12.5px; cursor: pointer; color: var(--text-dim);
}
.ghost-btn:hover { background: #f1f5f9; color: var(--text); }
.ghost-btn.danger { color: #b91c1c; border-color: #fecaca; }
.ghost-btn.danger:hover { background: #fef2f2; }

.primary-btn {
    padding: 8px 16px; background: var(--primary); color: #fff; border: none;
    border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.primary-btn:hover { filter: brightness(.95); }

/* ─── 담당 업무 (Staff Role) ─── */
.sr-layout { display: flex; flex: 1; overflow: hidden; }
.sr-list-pane { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: #f6f8fa; overflow: hidden; }
.sr-detail-pane { flex: 1; display: flex; flex-direction: column; background: #fff; min-width: 0; }
.sr-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sr-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.sr-staff-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.sr-staff-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.sr-staff-item:hover { background: #eef2f7; }
.sr-staff-item.active { background: #e0ecff; }
.sr-staff-name { font-weight: 600; font-size: 14px; }
.sr-staff-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.sr-staff-sub b { color: var(--primary); }

.sr-detail-scroll { flex: 1; overflow-y: auto; padding: 20px 24px; }
.sr-info-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.sr-info-name { font-size: 17px; font-weight: 700; }
.sr-info-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.sr-section { margin-bottom: 22px; }
.sr-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.sr-section-head h2 { margin: 0; font-size: 15px; }
.sr-section-head h3 { margin: 0; font-size: 13.5px; }
.sr-assign-row { display: flex; gap: 8px; }
.sr-select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; max-width: 220px; }

.sr-assign-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sr-assign-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.sr-assign-item:hover { border-color: #cbd5e1; background: #fafcff; }
.sr-assign-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.sr-assign-actions { display: flex; gap: 6px; flex-shrink: 0; }
.sr-primary { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }

.sr-two { display: flex; gap: 18px; flex-wrap: wrap; }
.sr-sub { flex: 1; min-width: 240px; }
.sr-sub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sr-chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sr-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.sr-chip.on { border-left: 3px solid #16a34a; }
.sr-chip.off { border-left: 3px solid #cbd5e1; opacity: .7; }
.sr-chip-btns { display: flex; gap: 4px; flex-shrink: 0; }
.sr-badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.sr-badge.g { background: #dcfce7; color: #15803d; }
.sr-badge.r { background: #f1f5f9; color: #64748b; }

.sr-mini { padding: 3px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 5px; background: #fff; cursor: pointer; color: var(--text); }
.sr-mini:hover { background: #f1f5f9; }
.sr-mini.danger { color: #b91c1c; border-color: #fecaca; }
.sr-mini.danger:hover { background: #fef2f2; }

.sr-job-text { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; resize: vertical; font-family: inherit; }
.sr-job-text[readonly] { background: #f8fafc; color: var(--text-dim); }
.sr-job-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.sr-muted { color: var(--text-dim); font-size: 12px; }
.sr-empty { padding: 40px; text-align: center; color: var(--text-dim); }

@media (max-width: 860px) {
    .sr-layout { flex-direction: column; }
    .sr-list-pane { width: 100%; max-height: 40%; border-right: none; border-bottom: 1px solid var(--border); }
    .sr-two { flex-direction: column; gap: 12px; }
}

.ic-messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 3px; }
.ic-loading { text-align: center; color: var(--text-dim); padding: 30px; }
.ic-date-divider {
    align-self: center; margin: 14px 0 8px; background: #e2e8f0; color: #475569;
    font-size: 11.5px; padding: 3px 12px; border-radius: 12px;
}

.ic-msg { display: flex; gap: 8px; max-width: 78%; margin-top: 8px; }
.ic-msg.grouped { margin-top: 2px; }
.ic-in { align-self: flex-start; }
.ic-out { align-self: flex-end; flex-direction: row-reverse; }
.ic-msg-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px;
}
.ic-avatar-spacer { background: transparent !important; }
.ic-msg-content { display: flex; flex-direction: column; min-width: 0; }
.ic-out .ic-msg-content { align-items: flex-end; }
.ic-msg-author { font-size: 12px; color: var(--text-dim); margin: 0 0 3px 4px; }

.ic-bubble-row { display: flex; align-items: flex-end; gap: 5px; }
.ic-out .ic-bubble-row { flex-direction: row-reverse; }
.ic-bubble {
    padding: 8px 12px; border-radius: 14px; line-height: 1.5; word-break: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,.05); max-width: 100%;
}
.ic-in .ic-bubble { background: #fff; border: 1px solid var(--border); border-top-left-radius: 4px; }
.ic-out .ic-bubble { background: #96c3f5; color: #1a1a1a; border: 1px solid #64a0e6; border-top-right-radius: 4px; }
/* 고객 상담(카카오/웹)은 같은 .ic-* 마크업을 쓰되 WinApp 고객채팅과 동일한 내 말풍선 색(#BAD7FB, 무테) */
.conv-messages .ic-out .ic-bubble { background: #bad7fb; border-color: transparent; }
.ic-msg-text { white-space: pre-wrap; }
.ic-msg-text.ic-deleted { font-style: italic; opacity: .6; }
.ic-msg-image { max-width: 240px; max-height: 280px; border-radius: 8px; display: block; }
.ic-msg-file { color: inherit; text-decoration: underline; display: inline-block; }
.ic-msg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.ic-msg-time { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
/* 말풍선 옆 날짜 (고객 상담) — 시간 위 한 줄, 시간보다 한 톤 연하게 */
.ic-msg-date { font-size: 10px; color: var(--text-dim); opacity: .7; white-space: nowrap; line-height: 1.2; }
.ic-unread-mark { font-size: 11px; color: #f59e0b; font-weight: 700; line-height: 1; }
.ic-react-btn {
    border: none; background: transparent; cursor: pointer; font-size: 13px; opacity: 0;
    transition: opacity .12s; padding: 0 2px; align-self: center;
}
.ic-msg:hover .ic-react-btn { opacity: .55; }
.ic-react-btn:hover { opacity: 1 !important; }

.ic-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ic-out .ic-reacts { justify-content: flex-end; }
.ic-react-chip {
    border: 1px solid var(--border); background: #fff; border-radius: 12px;
    padding: 1px 8px; font-size: 12px; cursor: pointer; color: #475569;
}
.ic-react-chip.mine { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.ic-react-who { font-size: 11.5px; color: inherit; }
/* 누른 일시 — 이름 옆에 붙지만 먼저 읽히는 건 이름이어야 한다. 한 단계 흐리게, 조금 작게.
   숫자 폭을 고정해(tabular-nums) 여러 명이 눌린 칩에서 자리가 덜 튀게 둔다. */
.ic-react-at { font-size: 10.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.ic-react-cnt { font-weight: 700; opacity: .8; }

.ic-emoji-picker {
    position: absolute; z-index: 1000; background: #fff; border: 1px solid var(--border);
    border-radius: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 4px 6px; display: flex; gap: 2px;
}
.ic-emoji-picker button {
    border: none; background: transparent; font-size: 18px; cursor: pointer;
    width: 32px; height: 32px; border-radius: 50%;
}
.ic-emoji-picker button:hover { background: #f1f5f9; }

.ic-typing {
    padding: 4px 20px; font-size: 12px; font-style: italic; color: #64748b;
    background: var(--bg);
}

.attach-btn {
    align-self: flex-end; width: 40px; height: 40px; border: 1px solid var(--border);
    background: #fff; border-radius: 10px; cursor: pointer; font-size: 17px;
}
.attach-btn:hover { background: #f1f5f9; }

/* ── 모달 ── */
.ic-modal {
    position: fixed; inset: 0; background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.ic-modal-card {
    background: #fff; border-radius: 14px; width: 420px; max-width: 92vw;
    max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.ic-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.ic-modal-head h3 { margin: 0; font-size: 16px; }
.ic-modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ic-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.ic-field input {
    padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text);
}
.ic-field input:focus { outline: none; border-color: var(--primary); }
.ic-member-picker {
    list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px;
}
.ic-pick-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    cursor: pointer; border-bottom: 1px solid #f1f5f9;
}
.ic-pick-item:last-child { border-bottom: none; }
.ic-pick-item:hover { background: #f8fafc; }
.ic-pick-item.selected { background: #eff6ff; }
.ic-pick-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px;
}
.ic-pick-name { flex: 1; font-size: 14px; color: var(--text); }
.ic-pick-online { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.ic-pick-check { color: var(--primary); font-weight: 700; width: 16px; text-align: center; }
.ic-modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 18px; border-top: 1px solid var(--border);
}

/* ═══ 내부채팅 확장: 멘션/답장/검색/팝아웃/핀 ═══ */

/* 팝아웃 모드 — 목록 숨김 */
.ic-popout .ic-list-pane { display: none; }
.ic-popout { height: 100vh; }

/* 방 핀 아이콘 */
.ir-pin { font-size: 11px; margin-right: 3px; }

/* 방 우클릭 컨텍스트 메뉴 */
.ic-ctx-menu {
    position: fixed; z-index: 3000; list-style: none; margin: 0; padding: 4px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 6px 22px rgba(0,0,0,.18); min-width: 150px;
}
.ic-ctx-menu li { padding: 8px 12px; font-size: 13px; cursor: pointer; border-radius: 6px; white-space: nowrap; }
.ic-ctx-menu li:hover { background: #f1f5f9; }
.ic-ctx-menu li.danger { color: #b91c1c; }
.ic-ctx-menu li.danger:hover { background: #fef2f2; }
/* 구분선 — li 로 넣으므로 패딩·hover·커서를 모두 해제한다 */
.ic-ctx-menu li.ic-ctx-sep {
    padding: 0; margin: 4px 6px; height: 1px; background: var(--border);
    cursor: default; border-radius: 0;
}
.ic-ctx-menu li.ic-ctx-sep:hover { background: var(--border); }

/* 토스트 (복사/전달 알림) */
.ic-toast {
    position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(8px);
    background: rgba(15,23,42,.92); color: #fff; padding: 9px 18px; border-radius: 20px;
    font-size: 13px; z-index: 4000; opacity: 0; transition: opacity .2s, transform .2s;
    pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.ic-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 메시지 hover 도구 */
.ic-msg-tools { display: flex; gap: 2px; align-items: center; opacity: 0; transition: opacity .12s; }
.ic-msg:hover .ic-msg-tools { opacity: 1; }
.ic-tool {
    border: none; background: transparent; cursor: pointer; font-size: 13px;
    padding: 2px 3px; color: var(--text-dim); line-height: 1;
}
.ic-tool:hover { color: var(--text); }

/* 답장 인용 헤더 (말풍선 내부) */
.ic-quote {
    border-left: 3px solid currentColor; padding: 3px 8px; margin-bottom: 5px;
    opacity: .82; cursor: pointer; border-radius: 3px; max-width: 100%;
    display: flex; flex-direction: column; gap: 1px; font-size: 12px;
}
.ic-in .ic-quote { background: rgba(0,0,0,.04); }
.ic-out .ic-quote { background: rgba(255,255,255,.16); }
.ic-quote-name { font-weight: 700; }
.ic-quote-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }

/* 답장 미리보기 (입력창 위) */
.ic-reply-preview {
    display: flex; align-items: center; gap: 10px; padding: 8px 18px;
    background: #f0f4f8; border-top: 1px solid var(--border);
}
.ic-reply-bar { width: 3px; align-self: stretch; background: var(--primary); border-radius: 2px; }
.ic-reply-info { flex: 1; min-width: 0; }
.ic-reply-name { font-size: 12px; font-weight: 700; color: var(--primary); }
.ic-reply-text { font-size: 12.5px; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-reply-cancel { border: none; background: transparent; cursor: pointer; font-size: 15px; color: var(--text-dim); }

/* @멘션 하이라이트 */
.ic-mention { color: #1d6fd2; font-weight: 700; }
.ic-out .ic-mention { color: #cfe3ff; }

/* @멘션 입력 팝업 */
.ic-input-wrap { flex: 1; position: relative; display: flex; }
.ic-input-wrap textarea {
    flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; font-family: inherit; line-height: 1.4; max-height: 140px;
}
.ic-input-wrap textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ic-mention-popup {
    position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 1500;
    list-style: none; margin: 0; padding: 4px; min-width: 200px; max-height: 220px; overflow-y: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.ic-mention-popup li {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13.5px;
    cursor: pointer; border-radius: 7px;
}
.ic-mention-popup li.active, .ic-mention-popup li:hover { background: #eff6ff; }
.ic-mention-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; color: #fff; }

/* 검색 결과로 점프 — 하이라이트 */
/* 말풍선 자체를 노란색으로. .ic-in/.ic-out 의 background 를 이기려면 0,3,0 이상이어야 한다.
   클래스가 붙어 있는 동안 계속 유지되어야 하므로 사라지는 애니메이션을 쓰지 않는다. */
.ic-msg.ic-highlight .ic-bubble {
    background: #fef08a;
    border-color: #facc15;
    box-shadow: 0 0 0 3px #fde047;
}

/* 최신으로 점프 버튼 */
.ic-messages-wrap { position: relative; flex: 1; display: flex; min-height: 0; }
.ic-messages-wrap .ic-messages { flex: 1; }
.ic-jump-latest {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; border: none; border-radius: 18px;
    padding: 7px 16px; font-size: 12.5px; font-weight: 700; cursor: pointer; z-index: 50;
    box-shadow: 0 3px 12px rgba(37,99,235,.4);
}
.ic-jump-latest:hover { background: #1d4ed8; }

/* 전체 검색 모달 */
.ic-search-card { width: 560px; height: 70vh; }
.ic-search-input-row { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ic-search-input-row input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.ic-search-input-row input:focus { outline: none; border-color: var(--primary); }
.ic-search-results { flex: 1; overflow-y: auto; padding: 6px 0; }
.ic-search-hint { text-align: center; color: var(--text-dim); padding: 40px 20px; }
.ic-search-group {
    font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase;
    padding: 10px 18px 4px; letter-spacing: .04em;
}
.ic-search-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; cursor: pointer; }
.ic-search-item:hover { background: #f8fafc; }
.ir-avatar.sm {
    width: 30px; height: 30px; border-radius: 8px; font-size: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.ic-sr-name { font-weight: 600; font-size: 14px; }
.ic-sr-body { min-width: 0; }
.ic-sr-meta { font-size: 11.5px; color: var(--text-dim); margin-bottom: 2px; }
.ic-sr-snippet { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-sr-snippet mark { background: #fde047; padding: 0 1px; border-radius: 2px; }

/* ═══════════════════════════════════════════════
   SMS 입금 내역 (Sms)
   ═══════════════════════════════════════════════ */
.sms-layout { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }

/* ── 필터 바 ── */
.sms-filter {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border);
}
.sms-search {
    display: flex; align-items: center; gap: 6px; width: 230px;
    border: 1px solid #d7dee9; border-radius: 9px; padding: 0 10px; height: 34px;
}
.sms-search-icon { color: var(--text-dim); font-size: 13px; }
.sms-search input { flex: 1; border: none; outline: none; font-size: 13.5px; background: transparent; }
.sms-flbl { font-size: 12.5px; color: var(--text-dim); }
.sms-tilde { color: var(--text-dim); }
.sms-date, .sms-select {
    height: 34px; border: 1px solid var(--border); border-radius: 8px;
    padding: 0 8px; font-size: 13.5px; color: var(--text); background: #fff;
}
.sms-select { cursor: pointer; }
.sms-btn {
    height: 32px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
}
.sms-btn.ghost { background: var(--bg); color: var(--text-dim); border-color: var(--border); }
.sms-btn.ghost:hover { background: #f1f5f9; color: var(--text); }
.sms-btn.green { background: #16a34a; color: #fff; }
.sms-btn.green:hover { background: #15803d; }
.sms-btn:disabled { opacity: .6; cursor: default; }
.sms-filter .sms-btn.green { margin-left: auto; }

/* ── 본문: 그리드 + 상세 ── */
.sms-body { display: flex; gap: 10px; flex: 1; min-height: 0; padding: 8px 16px 14px; }
.sms-grid-card {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.sms-grid-scroll { flex: 1; overflow-y: auto; }
.sms-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sms-grid thead th {
    position: sticky; top: 0; z-index: 1; background: #1e293b; color: #fff;
    font-weight: 700; text-align: left; padding: 11px 12px; white-space: nowrap;
}
.sms-grid th.c-amt { text-align: right; }
.sms-grid th.c-date, .sms-grid th.c-acct { text-align: center; }
.sms-grid tbody td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; }
.sms-row { cursor: pointer; }
.sms-row:nth-child(even) { background: #f8fafc; }
.sms-row:hover { background: #f1f5f9; }
.sms-row.selected { background: #dbeafe !important; }
.sms-grid td.c-dep { font-weight: 700; white-space: nowrap; }
.sms-grid td.c-corp { color: var(--primary); }
.sms-grid td.c-amt { text-align: right; font-weight: 700; color: #16a34a; white-space: nowrap; }
.sms-grid td.c-date { text-align: center; color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.sms-grid td.c-acct { text-align: center; font-size: 12px; color: var(--text); white-space: nowrap; }
.sms-grid td.c-acct.is014 { color: #b91c1c; font-weight: 600; }
.sms-empty-row td { text-align: center; color: var(--text-dim); padding: 40px 0 !important; }
.sms-status { padding: 8px 14px; border-top: 1px solid #f1f5f9; font-size: 12px; color: #94a3b8; }

/* ── 상세 (원문) ── */
.sms-detail-card {
    width: 280px; flex-shrink: 0; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.sms-detail-title {
    display: flex; align-items: center; gap: 8px; padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9; font-weight: 700; font-size: 13.5px; color: #475569;
}
.sms-detail-bar { width: 4px; height: 14px; background: var(--primary); border-radius: 2px; }
.sms-detail-body { flex: 1; overflow-y: auto; padding: 16px; }
.sms-detail-empty {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: #94a3b8;
}
.sms-detail-empty-icon { font-size: 40px; }
.sms-dt-head { font-size: 11.5px; color: #94a3b8; margin-bottom: 8px; }
.sms-dt-amt { font-size: 21px; font-weight: 800; color: #16a34a; }
.sms-dt-dep { font-size: 15px; font-weight: 700; margin-top: 2px; }
.sms-dt-corp { font-size: 13.5px; color: var(--primary); margin-top: 2px; }
.sms-dt-rows { margin: 14px 0; display: flex; flex-direction: column; gap: 7px; }
.sms-dt-row { display: flex; gap: 8px; font-size: 13px; }
.sms-dt-label { width: 56px; flex-shrink: 0; color: #94a3b8; }
.sms-dt-val { color: var(--text); word-break: break-all; }
.sms-dt-val.red { color: #b91c1c; }
.sms-dt-rawlabel { font-size: 11.5px; color: #94a3b8; margin-top: 6px; }
.sms-dt-raw {
    margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-family: Consolas, monospace;
    font-size: 12.5px; color: #475569; background: #f8fafc; border: 1px solid #f1f5f9;
    border-radius: 8px; padding: 10px 12px;
}

/* ═══════════════════════════════════════════════
   입금 처리 (Deposit / 발행대기 검수 큐) — 조회 전용
   ═══════════════════════════════════════════════ */
.dp-layout { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--bg); }

/* ── 탭 + 도구 ── */
.dp-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--border);
}
.dp-tabs { display: flex; gap: 4px; }
.dp-tab {
    border: none; background: transparent; padding: 8px 14px; border-radius: 8px;
    font-size: 14px; font-weight: 600; color: var(--text-dim); cursor: pointer;
}
.dp-tab:hover { background: #f1f5f9; }
.dp-tab.active { background: #eff6ff; color: var(--primary); }
.dp-tab-cnt {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
    font-size: 11.5px; font-weight: 700; line-height: 17px; text-align: center;
    background: #e2e8f0; color: #475569; border-radius: 9px;
}
.dp-tab.active .dp-tab-cnt { background: var(--primary); color: #fff; }

.dp-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-search {
    display: flex; align-items: center; gap: 6px; width: 210px;
    border: 1px solid #d7dee9; border-radius: 9px; padding: 0 10px; height: 34px;
}
.dp-search-icon { color: var(--text-dim); font-size: 13px; }
.dp-search input { flex: 1; border: none; outline: none; font-size: 13.5px; background: transparent; }
.dp-issued-only { display: inline-flex; align-items: center; gap: 6px; }
.dp-tilde { color: var(--text-dim); }
.dp-date {
    height: 34px; border: 1px solid var(--border); border-radius: 8px;
    padding: 0 8px; font-size: 13.5px; color: var(--text); background: #fff;
}
.dp-btn {
    height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
}
.dp-btn.ghost { background: var(--bg); color: var(--text-dim); border-color: var(--border); }
.dp-btn.ghost:hover { background: #f1f5f9; color: var(--text); }
.dp-btn.green { background: #16a34a; color: #fff; }
.dp-btn.green:hover { background: #15803d; }
.dp-btn:disabled { opacity: .6; cursor: default; }

/* ── 본문 ── */
.dp-body { display: flex; gap: 10px; flex: 1; min-height: 0; padding: 10px 16px 14px; }
.dp-grid-card {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.dp-grid-scroll { flex: 1; overflow-y: auto; }
.dp-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.dp-grid thead th {
    position: sticky; top: 0; z-index: 1; background: #1e293b; color: #fff;
    font-weight: 700; text-align: left; padding: 10px 12px; white-space: nowrap;
}
.dp-grid th.c-amt { text-align: right; }
.dp-grid th.c-match, .dp-grid th.c-dday, .dp-grid th.c-cnt { text-align: center; }
.dp-grid tbody td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.dp-row { cursor: pointer; }
.dp-row:nth-child(even) { background: #f8fafc; }
.dp-row:hover { background: #f1f5f9; }
.dp-row.selected { background: #dbeafe !important; }
.dp-grid td.c-dep { font-weight: 600; }
.dp-grid td.c-corp { color: var(--primary); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.dp-grid td.c-amt { text-align: right; font-weight: 700; color: #0f172a; }
.dp-grid td.c-date, .dp-grid td.c-biz, .dp-grid td.c-slip { color: var(--text-dim); font-size: 12px; }
.dp-grid td.c-match, .dp-grid td.c-dday, .dp-grid td.c-cnt { text-align: center; }
.dp-empty-row td { text-align: center; color: var(--text-dim); padding: 40px 0 !important; }
.dp-status { padding: 8px 14px; border-top: 1px solid #f1f5f9; font-size: 12px; color: #94a3b8; }

/* 배지 */
.dp-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.dp-badge.gray { background: #e2e8f0; color: #475569; }
.dp-badge.blue { background: #dbeafe; color: #1d4ed8; }
.dp-badge.amber { background: #fef3c7; color: #b45309; }
.dp-badge.red { background: #fee2e2; color: #b91c1c; }

/* ── 상세 ── */
.dp-detail-card {
    width: 290px; flex-shrink: 0; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.dp-detail-title {
    display: flex; align-items: center; gap: 8px; padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9; font-weight: 700; font-size: 13.5px; color: #475569;
}
.dp-detail-bar { width: 4px; height: 14px; background: var(--primary); border-radius: 2px; }
.dp-detail-body { flex: 1; overflow-y: auto; padding: 16px; }
.dp-detail-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #94a3b8; }
.dp-detail-empty-icon { font-size: 40px; }
.dp-dt-head { font-size: 11.5px; color: #94a3b8; margin-bottom: 8px; }
.dp-dt-amt { font-size: 21px; font-weight: 800; color: #0f172a; }
.dp-dt-dep { font-size: 15px; font-weight: 700; margin-top: 2px; }
.dp-dt-corp { font-size: 13.5px; color: var(--primary); margin-top: 2px; }
.dp-dt-corp.gray { color: #94a3b8; }
.dp-dt-rows { margin: 14px 0; display: flex; flex-direction: column; gap: 7px; }
.dp-dt-row { display: flex; gap: 8px; font-size: 13px; }
.dp-dt-label { width: 64px; flex-shrink: 0; color: #94a3b8; }
.dp-dt-val { color: var(--text); word-break: break-all; }
.dp-dt-val .gray, .dp-dt-corp .gray { color: #94a3b8; font-weight: 400; }
.dp-dt-rawlabel { font-size: 11.5px; color: #94a3b8; margin: 6px 0; }
.dp-cands { display: flex; flex-direction: column; gap: 4px; }
.dp-cand {
    display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px;
    background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 6px; padding: 6px 10px;
}
.dp-cand span:first-child { font-family: Consolas, monospace; color: #475569; }
.dp-cand span:last-child { font-weight: 600; }

/* ═══════════════════════════════════════════════
   메일 (Mail / Gmail · WorksMail)
   ═══════════════════════════════════════════════ */
.ml-layout { display: flex; flex: 1; overflow: hidden; }

/* ── 좌: 폴더 + 목록 ── */
.ml-list-pane {
    width: 340px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.ml-folders { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ml-folder {
    border: none; background: transparent; padding: 6px 10px; border-radius: 7px;
    font-size: 12.5px; color: var(--text-dim); cursor: pointer;
}
.ml-folder:hover { background: #f1f5f9; }
.ml-folder.active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.ml-search {
    display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.ml-search-icon { color: var(--text-dim); font-size: 13px; }
.ml-search input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.ml-search input:focus { outline: none; border-color: var(--primary); }
.ml-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.ml-list-msg { padding: 24px 18px; color: var(--text-dim); font-size: 13px; line-height: 1.6; text-align: center; }
.ml-list-msg.err { color: #b91c1c; }
.ml-list-msg code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.ml-retry { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.ml-retry:hover { background: #f8fafc; border-color: var(--primary); color: var(--primary); }
.ml-item { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.ml-item:hover { background: #f8fafc; }
.ml-item.selected { background: #eff6ff; }
.ml-item.unread { background: #fffdf5; }
.ml-it-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ml-it-from { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-item.unread .ml-it-from { color: #0f172a; }
.ml-it-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.ml-it-subject { font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-it-att { font-size: 11px; }
.ml-it-preview { font-size: 12px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-list-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: #94a3b8; }

/* ── 우: 본문 ── */
.ml-read-pane { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.ml-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-dim); }
.ml-empty-icon { font-size: 50px; }
.ml-read { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ml-read-head { padding: 16px 22px; border-bottom: 1px solid var(--border); background: #fff; }
.ml-r-subject { margin: 0 0 10px; font-size: 19px; line-height: 1.35; }
.ml-r-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.ml-r-from b { font-size: 14px; }
.ml-r-email { color: var(--text-dim); font-size: 12.5px; }
.ml-r-date { color: var(--text-dim); font-size: 12.5px; }
.ml-r-to { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; white-space: pre-wrap; }
.ml-r-actions { display: flex; gap: 6px; margin-top: 12px; }
.ml-r-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ml-att {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; text-decoration: none;
    background: #f1f5f9; color: #334155; border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px;
}
.ml-att:hover { background: #e2e8f0; }
.ml-att span { color: var(--text-dim); }
.ml-r-body { flex: 1; width: 100%; border: none; background: #fff; }

/* ── 작성 모달 ── */
.ml-compose-card { width: 560px; max-width: 94vw; }
.ml-compose-body { gap: 10px; }
.ml-compose-body textarea {
    border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; font-size: 14px;
    font-family: inherit; resize: vertical; color: var(--text);
}
.ml-compose-body textarea:focus { outline: none; border-color: var(--primary); }
.ml-c-status { flex: 1; font-size: 12.5px; color: #b91c1c; }

/* ═══════════════════════════════════════════════
   게시판 (Board / 접수업무 메뉴얼) — 프리미엄 스타일
   ═══════════════════════════════════════════════ */
.bd-layout { display: flex; flex: 1; overflow: hidden; background: #f1f5f9; }

/* ── 좌: 목록 ── */
.bd-list-pane {
    width: 380px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.bd-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.bd-cat {
    border: 1px solid var(--border); background: #fff; padding: 6px 13px; border-radius: 999px;
    font-size: 12.5px; color: var(--text-dim); cursor: pointer; transition: all .15s;
}
.bd-cat:hover { background: #f1f5f9; color: var(--text); }
.bd-cat.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; box-shadow: 0 2px 8px rgba(37,99,235,.28); }
.bd-search { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bd-search-icon { color: var(--text-dim); font-size: 13px; }
.bd-search input { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px; background: #f8fafc; transition: all .15s; }
.bd-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

.bd-list { list-style: none; margin: 0; padding: 10px; overflow-y: auto; flex: 1; background: #f8fafc; }
.bd-list-msg { padding: 30px 18px; text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.bd-list-msg.err { color: #b91c1c; }
.bd-item {
    padding: 13px 15px; margin-bottom: 8px; cursor: pointer; background: #fff;
    border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: transform .13s, box-shadow .13s, border-color .13s;
}
.bd-item:hover { transform: translateY(-1px); border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15,23,42,.09); }
.bd-item.selected {
    border-color: var(--primary); background: #f5f9ff;
    box-shadow: inset 3px 0 0 var(--primary), 0 4px 14px rgba(37,99,235,.14);
}
.bd-it-top { display: flex; align-items: center; gap: 7px; }
.bd-it-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-pin { font-size: 12px; }
.bd-it-meta { display: flex; gap: 9px; align-items: center; margin-top: 7px; font-size: 11.5px; color: var(--text-dim); }
.bd-it-stat { margin-left: auto; white-space: nowrap; color: #94a3b8; }
.bd-list-foot { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-dim); background: #fff; }
.bd-pg { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 11px; cursor: pointer; transition: all .13s; }
.bd-pg:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.bd-pg:disabled { opacity: .35; cursor: default; }

/* 카테고리 배지 */
.bd-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; flex-shrink: 0; letter-spacing: .2px; }
.bd-badge.c-feature { background: #dbeafe; color: #1d4ed8; }
.bd-badge.c-bug { background: #fee2e2; color: #b91c1c; }
.bd-badge.c-uiux { background: #f3e8ff; color: #7e22ce; }
.bd-badge.c-general { background: #e2e8f0; color: #475569; }
.bd-badge.c-etc { background: #f1f5f9; color: #64748b; }
/* 접수업무 카테고리 배지 */
.bd-badge.r-receipt { background: #dbeafe; color: #1d4ed8; }
.bd-badge.r-progress { background: #fef3c7; color: #b45309; }
.bd-badge.r-complete { background: #dcfce7; color: #15803d; }
.bd-badge.r-hold { background: #fee2e2; color: #b91c1c; }
.bd-badge.r-etc { background: #f1f5f9; color: #64748b; }
/* Preflight 정보 카테고리 배지 */
.bd-badge.p-notice { background: #fee2e2; color: #b91c1c; }
.bd-badge.p-guide { background: #dbeafe; color: #1d4ed8; }
.bd-badge.p-spec { background: #e0f2fe; color: #0369a1; }
.bd-badge.p-case { background: #fef3c7; color: #b45309; }
.bd-badge.p-faq { background: #f3e8ff; color: #7e22ce; }
.bd-badge.p-etc { background: #f1f5f9; color: #64748b; }
/* 안읽음 표시 — 아직 열어보지 않은 글(개인별). 열면 즉시 사라진다 */
.bd-new {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
    flex-shrink: 0;
}
.bd-item.unread .bd-it-title { font-weight: 800; color: var(--text); }

/* ── 우: 상세/편집 ── */
.bd-main-pane { flex: 1; display: flex; flex-direction: column; background: #f1f5f9; min-width: 0; overflow: hidden; padding: 14px; }
/* 모바일 '← 목록' 뒤로 버튼 — 데스크톱 숨김 */
.bd-mobile-back { display: none; align-items: center; gap: 4px; border: none; background: #fff; color: var(--primary); font-size: 15px; font-weight: 700; padding: 12px 14px; margin: -14px -14px 12px; border-bottom: 1px solid var(--border); cursor: pointer; flex-shrink: 0; }
.bd-mobile-back:hover { background: #f8fafc; }
.bd-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    color: var(--text-dim); background: #fff; border: 1px solid var(--border); border-radius: 16px;
}
.bd-empty-icon {
    width: 92px; height: 92px; display: flex; align-items: center; justify-content: center;
    font-size: 44px; background: #eff6ff; border-radius: 50%;
}
.bd-empty p { text-align: center; line-height: 1.6; }

/* 글 읽기 — 카드 */
.bd-read {
    flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 4px 20px rgba(15,23,42,.05);
}
.bd-read-head { padding: 28px 36px 20px; border-bottom: 1px solid #eef2f7; background: linear-gradient(180deg, #ffffff, #fbfcfe); }
.bd-read-cat { margin-bottom: 12px; }
.bd-read-title { margin: 0 0 14px; font-size: 25px; line-height: 1.32; font-weight: 800; letter-spacing: -.3px; color: #0f172a; }
.bd-read-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; }
.bd-read-meta > span:not(.bd-read-actions) { display: inline-flex; align-items: center; }
.bd-read-meta > span:not(.bd-read-actions):not(:first-child)::before {
    content: "·"; margin-right: 8px; color: #cbd5e1;
}
.bd-read-actions { margin-left: auto; display: flex; gap: 6px; }
.bd-read-actions::before { content: none !important; }
.bd-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.bd-att {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; text-decoration: none;
    background: #f8fafc; color: #334155; border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px; transition: all .13s;
}
.bd-att:hover { background: #eff6ff; border-color: #bfdbfe; color: var(--primary); }
.bd-att span { color: var(--text-dim); }
.bd-read-content {
    padding: 30px 36px; font-size: 15px; line-height: 1.85; color: #1e293b; word-break: break-word;
    background: #fff; flex: 1; max-width: 900px; width: 100%;
}

/* 댓글 */
.bd-comments { background: #f8fafc; border-top: 1px solid #eef2f7; padding: 20px 36px 26px; }
.bd-comments-title { font-weight: 800; font-size: 14px; margin-bottom: 14px; color: #334155; }
.bd-comment-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bd-comment { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.bd-cm-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.bd-cm-head b { font-size: 13px; color: #0f172a; }
.bd-cm-date { color: var(--text-dim); }
.bd-cm-del { margin-left: auto; border: none; background: transparent; cursor: pointer; font-size: 12px; opacity: .55; transition: opacity .12s; }
.bd-cm-del:hover { opacity: 1; }
.bd-cm-body { margin-top: 6px; font-size: 13.5px; line-height: 1.6; word-break: break-word; color: #334155; }
.bd-comment-form { display: flex; gap: 8px; }
.bd-comment-form input { flex: 1; border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; font-size: 14px; background: #fff; transition: all .15s; }
.bd-comment-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* 편집기 — 카드 */
.bd-editor {
    flex: 1; display: flex; flex-direction: column; min-height: 0; background: #fff;
    border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 4px 20px rgba(15,23,42,.05); overflow: hidden;
}
.bd-editor-head { padding: 20px 30px; border-bottom: 1px solid #eef2f7; background: linear-gradient(180deg, #ffffff, #fbfcfe); }
.bd-editor-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.bd-editor-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 22px 30px; min-height: 0; overflow-y: auto; }
.bd-ed-row { display: flex; gap: 10px; }
.bd-ed-cat { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font-size: 14px; height: 46px; background: #f8fafc; cursor: pointer; }
.bd-ed-title { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 16px; font-weight: 600; }
.bd-ed-title:focus, .bd-ed-content:focus, .bd-ed-cat:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.bd-ed-content { flex: 1; min-height: 260px; border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 14.5px; font-family: inherit; line-height: 1.7; resize: vertical; }
.bd-ed-files-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-ed-filebtn { display: inline-block; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 9px 14px; font-size: 13px; color: var(--text-dim); cursor: pointer; transition: all .13s; }
.bd-ed-filebtn:hover { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.bd-ed-filelist { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-ed-file { display: inline-flex; align-items: center; gap: 5px; background: #eff6ff; color: #1d4ed8; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; }
.bd-ed-file button { border: none; background: transparent; cursor: pointer; color: inherit; }
.bd-editor-foot { display: flex; align-items: center; gap: 8px; padding: 16px 30px; border-top: 1px solid #eef2f7; background: #fafbfc; }
.bd-ed-status { flex: 1; font-size: 12.5px; color: #b91c1c; }

/* 목록 스크롤바 */
.bd-list::-webkit-scrollbar, .bd-read::-webkit-scrollbar { width: 10px; }
.bd-list::-webkit-scrollbar-thumb, .bd-read::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
.bd-list::-webkit-scrollbar-thumb:hover, .bd-read::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* ══════════════════════════════════════════════════════════
   모바일 반응형 (기본 대응) — 데스크톱 레이아웃 영향 없음
   ══════════════════════════════════════════════════════════ */
.mobile-topbar { display: none; }

@media (max-width: 768px) {
    /* 모바일 브라우저 URL바를 제외한 '실제 보이는 높이'에 맞춤.
       100vh 는 URL바 포함 높이라 하단(채팅 입력창)이 화면 밖으로 밀려 스크롤해야 보이는 문제 해결. */
    .app-shell { height: 100dvh; }

    /* 상단바 + 햄버거 */
    .mobile-topbar {
        display: flex; align-items: center; gap: 12px; flex-shrink: 0;
        height: 52px; padding: 0 14px; background: var(--nav-bg); color: #fff;
    }
    .mobile-nav-toggle {
        background: transparent; border: none; color: #fff; font-size: 22px;
        line-height: 1; cursor: pointer; padding: 4px 6px;
    }
    .mobile-topbar-title { font-weight: 700; font-size: 16px; letter-spacing: .5px; }

    /* 좌측 네비 → 오프캔버스 드로어 */
    .nav {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
        width: 240px; max-width: 82vw; transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .app-shell.nav-open .nav { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
    .nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150; }

    /* 2단(좌우) 레이아웃 → 세로 스택 */
    .chat-layout, .ic-layout, .ml-layout, .bd-layout, .dp-body, .sms-body {
        flex-direction: column; min-height: 0;
    }
    .chat-list-pane, .ic-list-pane, .ml-list-pane, .bd-list-pane {
        width: 100%; max-height: 38dvh; flex-shrink: 0;
        border-right: none; border-bottom: 1px solid var(--border);
    }
    /* 본문 pane 이 내부 스크롤(최신 메시지로 자동 스크롤)되도록 flex 높이 전파 보정.
       min-height:0 이 없으면 pane 이 콘텐츠 전체 높이로 펼쳐져 스크롤이 안 되고 위(과거)만 보임. */
    .chat-conv-pane, .ic-conv-pane, .ml-read-pane, .bd-main-pane,
    .dp-detail-card, .sms-detail-card { min-height: 0; }
    /* 입금 SMS·입금처리: 목록/상세(원문)를 세로로 균등 분할해 각자 내부 스크롤.
       (상세 카드는 원래 flex-shrink:0 고정폭이라, 세로 스택 시 grid가 공간을 다 먹어
        원문이 0 높이로 찌그러지던 문제 해결) */
    .dp-grid-card, .sms-grid-card { flex: 1 1 0; min-height: 0; }
    .dp-detail-card, .sms-detail-card { flex: 1 1 0; min-height: 0; width: 100%; }

    /* 모달 화면 밖으로 넘치지 않게 */
    .tm-modal, .ic-modal-card, .ic-search-card { max-width: 94vw; }
    .ic-search-card { width: 94vw; }
    .login-card { max-width: 92vw; }

    /* 여백 축소 */
    .content-header { padding: 12px 16px; }
    /* height:100% 기반 페이지가 상단바(52px)와 겹쳐 잘리지 않도록 flex 로 보정 */
    .tm-layout { padding: 12px 14px; height: auto; flex: 1; min-height: 0; }
    /* 모바일은 입력창을 좁게(1줄) — 대화영역 공간 확보 (PC만 3줄) */
    .conv-input textarea { min-height: 40px; }

    /* 게시판/영수증: 데스크톱용 큰 여백·제목을 모바일에 맞게 축소(가독성) */
    .bd-read-head, .bd-editor-head { padding: 16px 16px 12px; }
    .bd-read-title { font-size: 20px; }
    .bd-read-content { padding: 16px; font-size: 14px; }
    .bd-editor-body { padding: 16px; }
    .bd-cats { padding: 9px 12px; }

    /* ─── 모바일 채팅(웹·카카오 상담): 내부채팅과 동일한 .ic-* 마크업 사용 ─── */
    /* 말풍선/시간/아바타 스타일은 아래 공통 .ic-* 규칙이 처리하고,
       여기서는 상담 화면 컨테이너 배경(WinApp 관제센터와 동일한 회색)만 지정한다. */
    .chat-conv-pane { background: #f0f0f0; }
    .conv-messages { padding: 14px 12px; }

    /* 시스템 메시지: 카카오 반투명 캡슐 */
    .msg-system { background: rgba(0,0,0,.14); color: #2c3e50; }

    /* 하단 입력바: 흰 배경 유지 */
    .conv-input { background: #fff; }

    /* ─── 모바일 내부 채팅: 카카오톡 스타일 ─── */
    /* 대화 영역 배경 = 카카오 하늘색 */
    .ic-conv-pane { background: #b2c7d9; }

    /* 보낸사람 이름: 진한 회색 */
    .ic-msg-author { color: #45535f; }

    /* 말풍선 공통: 그림자 제거 */
    .ic-bubble { box-shadow: none; }
    /* 상대(수신): 흰색, 테두리 제거 */
    .ic-in .ic-bubble { background: #ffffff; color: #191919; border: none; }
    /* 나(발신): 카카오 옐로우, 글자 어둡게 */
    .ic-out .ic-bubble { background: #fee500; color: #191919; }

    /* 시간·안읽음: 말풍선 밖(하늘색 배경 위) 가독성 보정 */
    .ic-msg-time { color: #5a6b78; }
    .ic-msg-date { color: #5a6b78; }
    .ic-unread-mark { color: #d9a300; }

    /* ─── 모바일 내부 채팅: 카카오식 마스터-디테일 (목록 ↔ 대화 전환) ─── */
    /* 기본: 방 목록만 전체 화면 (위 공용 규칙의 38dvh 스택 해제).
       min-height:0 필수 — 없으면 pane 이 목록 전체 높이로 늘어나 내부 ul 스크롤이 안 됨 */
    .ic-list-pane { max-height: none; flex: 1; min-height: 0; border-bottom: none; }
    .ic-conv-pane { display: none; }
    /* 방 선택(.ic-mobile-conv) 시: 목록 숨기고 대화 전체 화면 */
    .ic-layout.ic-mobile-conv .ic-list-pane { display: none; }
    .ic-layout.ic-mobile-conv .ic-conv-pane { display: flex; }
    /* 뒤로(←) 버튼 노출 */
    .ic-back { display: inline-flex; align-items: center; }

    /* 알림 2-pane: 모바일은 목록 전체 화면, 상세 선택 시 상세 전체 화면 */
    .nt-layout { flex-direction: column; }
    .nt-list-pane { width: 100%; border-right: none; min-height: 0; }
    .nt-detail-pane { display: none; }
    .nt-layout.nt-mobile-detail .nt-list-pane { display: none; }
    .nt-layout.nt-mobile-detail .nt-detail-pane { display: flex; }
    .nt-detail-back { display: inline-flex !important; align-items: center; }
    /* 대화 헤더 여백·액션 축소 (뒤로 버튼 + 방이름 공간 확보) */
    .ic-conv-header { padding: 10px 12px; }
    .ic-conv-actions .ghost-btn { padding: 5px 8px; font-size: 12px; }
    /* 팝아웃(새 창)은 단일 방 전용 → 항상 대화만, 뒤로 버튼 숨김 */
    .ic-layout.ic-popout .ic-list-pane { display: none; }
    .ic-layout.ic-popout .ic-conv-pane { display: flex; }
    .ic-layout.ic-popout .ic-back { display: none; }

    /* ─── 모바일 상담(카카오/웹): 카카오식 마스터-디테일 (목록 ↔ 대화 전환) ─── */
    /* 터치엔 hover 가 없으므로 목록 이름 변경(✎) 버튼을 항상 노출 */
    .ci-rename { opacity: .6; }
    /* 기본: 상담 목록만 전체 화면 (위 공용 규칙의 38dvh 스택 해제).
       min-height:0 필수 — 없으면 pane 이 목록 전체 높이로 늘어나 내부 ul 스크롤이 안 됨 */
    .chat-list-pane { max-height: none; flex: 1; min-height: 0; border-bottom: none; }
    .chat-conv-pane { display: none; }
    /* 상담 선택(.chat-mobile-conv) 시: 목록 숨기고 대화 전체 화면 */
    .chat-layout.chat-mobile-conv .chat-list-pane { display: none; }
    .chat-layout.chat-mobile-conv .chat-conv-pane { display: flex; }
    /* 뒤로(←) 버튼 노출 + 헤더 여백 축소 */
    .conv-back { display: inline-flex; align-items: center; }
    .conv-header { padding: 10px 12px; }

    /* ─── 모바일 게시판(개선요청/접수업무 메뉴얼): 마스터-디테일 (목록 ↔ 상세) ─── */
    /* 기본: 목록만 전체 화면 (위 공용 규칙의 38dvh 스택 해제) */
    .bd-list-pane { max-height: none; flex: 1; min-height: 0; border-bottom: none; }
    .bd-main-pane { display: none; }
    /* 글 선택/작성(.bd-mobile-detail) 시: 목록 숨기고 상세 전체 화면 */
    .bd-layout.bd-mobile-detail .bd-list-pane { display: none; }
    .bd-layout.bd-mobile-detail .bd-main-pane { display: flex; }
    /* '← 목록' 버튼 노출 */
    .bd-mobile-back { display: flex; }

    /* 날짜 구분선: 반투명 캡슐 */
    .ic-date-divider { background: rgba(0,0,0,.14); color: #2c3e50; }

    /* 리액션 칩: 하늘색 배경 위에서 뜨도록 흰 배경 유지 */
    .ic-react-chip { background: #fff; }
}

/* ─── Preflight 검수 (/Preflight) ─── */
.pf-layout {
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 16px; height: 100%; overflow-y: auto;
}

/* 상단 행: 안내 배너 + 구분/색상 선택 나란히 */
.pf-top-row { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.pf-top-row .pf-notice { flex: 1; min-width: 240px; }

/* 지금 로그인한 접수자 — 올린 건에 남을 이름이라 안내 배너보다 먼저 눈에 들어와야 한다 */
.pf-who {
    display: flex; flex-direction: column; justify-content: center; gap: 2px;
    padding: 10px 16px; white-space: nowrap;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
}
.pf-who-label { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.pf-who-name { font-size: 15px; font-weight: 700; color: var(--text); }

/* 접수자 안내 배너 */
.pf-notice {
    display: flex; gap: 10px; align-items: flex-start;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px;
    padding: 12px 14px; color: #1e40af; line-height: 1.5; font-size: 13.5px;
}
.pf-notice-icon { font-size: 17px; line-height: 1.35; }

/* ══════════════════════════════════════════════════════════════
   Preflight 현황 (/PreflightStatus) — JusonPreflight 작업 큐 대기·진행
   ══════════════════════════════════════════════════════════════ */
.pq-layout {
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 16px; height: 100%; overflow-y: auto;
}
.pq-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pq-stats { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.pq-stat {
    display: flex; align-items: baseline; gap: 8px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    padding: 10px 16px;
}
.pq-stat-label { font-size: 12px; color: var(--text-dim); }
.pq-stat-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pq-top-right { display: flex; align-items: center; gap: 8px; }
.pq-updated { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.pq-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
}
.pq-card-head {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.pq-card-title { font-size: 14px; font-weight: 700; }
/* 카드 머리의 오른쪽 끝으로 밀어 두는 버튼 (검수된 건 새로고침) */
.pq-card-act { margin-left: auto; }
/* 진행률이 무엇을 기준으로 한 값인지 항상 밝혀 둔다 — 실제 % 가 아니라 추정이다 */
.pq-basis { font-size: 11.5px; color: var(--text-dim); }

/* 검수 중 카드 */
.pq-running { display: flex; flex-direction: column; gap: 10px; }
.pq-run {
    background: #f8fafc; border: 1px solid var(--border); border-left: 3px solid #22c55e;
    border-radius: 10px; padding: 10px 12px;
}
.pq-run.over { border-left-color: #ef4444; }
.pq-run-pending { border-left-color: #f59e0b; }
.pq-run-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pq-run-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.pq-run-foot {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums;
}
.pq-dim { font-size: 12px; color: var(--text-dim); }
.pq-rno { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.pq-over { color: #b91c1c; font-weight: 700; }
/* callas 실측 진행률 — 행에서 가장 먼저 읽히도록 크게 */
.pq-pct { font-size: 14px; color: #15803d; }

.pq-chip {
    padding: 1px 7px; border-radius: 9px; font-size: 10.5px; font-weight: 700;
    background: #fef3c7; color: #b45309;
}
.pq-chip.live { background: #dcfce7; color: #15803d; }
.pq-chip.warn { background: #fee2e2; color: #b91c1c; }

/* 진행률 바 */
.pq-bar {
    margin-top: 8px; height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden;
}
.pq-bar-fill {
    display: block; height: 100%; border-radius: 3px; background: #22c55e;
    transition: width .8s linear;
}
/* 멈춘 건은 흐르지 않는다 — indet 의 애니메이션·오프셋까지 함께 끊어야 빨간 바가 미끄러지지 않는다 */
.pq-run.over .pq-bar-fill { background: #ef4444; width: 100%; animation: none; margin-left: 0; }
/* 기준선이 없거나(표본 부족) 아직 접수 전이면 진행률을 알 수 없다 — 흐르는 바로 대체 */
.pq-bar-fill.indet {
    width: 35%; background: #f59e0b;
    animation: pq-indet 1.6s ease-in-out infinite;
}
@keyframes pq-indet {
    0% { margin-left: -35%; } 100% { margin-left: 100%; }
}

/* 대기열·검수된 건 표 — 열이 많아 좁은 화면에서는 가로로도 스크롤된다 */
.pq-scroll { max-height: 420px; overflow: auto; }
.pq-table .c-pos { width: 48px; text-align: center; color: var(--text-dim); }
.pq-table .c-src { width: 70px; }
.pq-table .c-spec { width: 180px; }
/* "3시간 0분"·"2일 5시간" 은 72px 에 안 들어가 두 줄로 접힌다 — 접히면 숫자가 아니라 덩어리로 읽힌다 */
.pq-table .c-wait {
    width: 72px; white-space: nowrap;
    font-variant-numeric: tabular-nums; font-weight: 700;
}
/* 접수번호(주문 시스템 BasicId) / 검수번호(JusonPreflight ReceiptNo) — 둘 다 식별자라 등폭으로 */
.pq-table .c-bid { width: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.pq-table .c-rno { width: 190px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.pq-table .c-file .pq-dim { margin-left: 6px; }
/* 파일명 칸에는 폭을 지정하지 않는다(남는 폭을 받아야 하므로) — 그런데 table-layout:auto 는
   폭이 지정된 열에 남는 폭을 먼저 나눠주고, 지정 없는 열에는 min-content 만 남긴다.
   그래서 좁은 화면에서 파일명이 "명함_양 / 면.pdf" 처럼 한 글자씩 접혔다. 바닥을 못 박는다. */
.pq-table .c-file { min-width: 200px; }
/* 접수번호 칸에는 번호·고객명·접수자가 함께 쌓인다(bidCell 참고).
   한글 값들은 식별자용 등폭 글꼴을 물려받으면 어색해지므로 본문 글꼴로 되돌린다. */
.pq-bid-no { display: block; }
.pq-cust {
    display: block;
    font-family: "맑은 고딕", "Malgun Gothic", -apple-system, system-ui, sans-serif;
    font-size: 12px; color: var(--text); overflow-wrap: anywhere;
}
/* 접수자가 올린 건은 접수번호가 없다 — 그 자리에 올린 사람 이름이 온다. */
.pq-who {
    display: block;
    font-family: "맑은 고딕", "Malgun Gothic", -apple-system, system-ui, sans-serif;
    font-size: 12px; white-space: nowrap; color: var(--text); font-weight: 600;
}
.pq-status { margin-top: 8px; font-size: 12px; color: var(--text-dim); }

/* 멈춘 검수 표 — 워커가 죽은 자리라 카드 자체를 경고색으로 세운다.
   평소에는 비어 있어 섹션이 통째로 숨는다(hidden). */
.pq-stuck-card { border-color: #fca5a5; background: #fffbfb; }
/* worker 는 "머신명:PID" 라 식별자 취급 — 어느 프로세스가 죽었는지 대조하는 값이다 */
.pq-table .c-who {
    width: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
    color: var(--text-dim);
}
/* 마지막 오류는 길이가 들쭉날쭉하다 — 한 줄로 자르고 전체는 title 로 보여준다 */
.pq-table .c-err {
    max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-dim); font-size: 12px;
}

/* 검수된 건 표 — 오류/경고 건수는 숫자 비교가 쉽도록 고정폭 숫자로 */
.pq-table .c-cnt {
    width: 84px; white-space: nowrap; text-align: center;
    font-variant-numeric: tabular-nums; font-weight: 700;
}
.pq-warn-n { color: #b45309; }
/* 검수 전에 처리 실패한 건 — 오류/경고 수가 없는 자리에 '원인이 있다' 는 표시를 둔다.
   원문은 title 로, 온전한 문장은 '보기' 패널의 '처리 실패' 섹션에서 읽는다
   (84px 칸에 Ghostscript 오류 원문을 넣으면 옆 칸 위로 넘친다). */
.pq-err-note {
    color: #b91c1c; font-size: 11.5px; font-weight: 600; white-space: nowrap;
    border-bottom: 1px dotted #fca5a5; cursor: help;
}
/* 보기 + 내려받기(원본·결과·리포트) 버튼 열 — 표 오른쪽 끝 */
/* 보기 · 원본 · 결과 · 리포트 · 재처리 — 다섯 개가 한 줄에 들어가야 한다 */
.pq-table .c-act { width: 232px; white-space: nowrap; text-align: right; }
/* 대기열은 '다시 시도' 하나뿐이다 — 위 폭을 그대로 쓰면 파일명 칸을 그만큼 빼앗는다 */
.pq-table .c-act-slim { width: 92px; }

/* '다시 시도' 결과 — 대기 건수(pq-status)와 달리 사람이 읽고 판단할 문장이라 눈에 띄게 둔다 */
.pq-requeue-msg { color: var(--text); font-weight: 600; }

/* 검수 내용 보기 패널 */
.pq-detail { border-left: 3px solid var(--primary); }
.pq-detail-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.pq-detail-name { font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
/* 항목명 위, 값 아래로 쌓아 좁은 폭에서도 줄이 엉키지 않게 */
.pq-meta {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px 14px; margin: 0 0 14px;
}
.pq-meta-row { min-width: 0; }
.pq-meta dt { font-size: 11.5px; color: var(--text-dim); margin-bottom: 1px; }
.pq-meta dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }

/* callas 한국어 요약 — 섹션(오류/경고/정보)별로 색을 달리해 심각도가 먼저 읽히게 */
.pq-summary { display: flex; flex-direction: column; gap: 8px; }
.pq-sum-sec {
    background: #f8fafc; border: 1px solid var(--border); border-left: 3px solid #94a3b8;
    border-radius: 10px; padding: 8px 12px;
}
.pq-sum-sec.bad { background: #fef2f2; border-color: #fecaca; border-left-color: #ef4444; }
.pq-sum-sec.warn { background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; }
.pq-sum-head { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.pq-sum-sec.bad .pq-sum-head { color: #b91c1c; }
.pq-sum-sec.warn .pq-sum-head { color: #b45309; }
.pq-sum-item { font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.pq-sum-item + .pq-sum-item { border-top: 1px dashed var(--border); padding-top: 3px; margin-top: 3px; }

.pq-detail-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 12px; min-height: 26px;
}
.pq-detail-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 번호 복사 — 값 옆에 붙는 보조 동작이라 링크 모양으로 낮춰 둔다 */
.pf-link.pq-copy { color: var(--text-dim); }
.pf-link.pq-copy:hover { color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   Preflight 통계 (/PreflightStats) — 검수 결과 추이
   현황 화면과 같은 판(.pq-layout)·같은 카드를 쓰고, 아래 규칙만 더한다.
   ══════════════════════════════════════════════════════════════ */
/* 화면 머리 — 카드가 아니라 제목 줄이다 */
.pq-stats-intro { display: flex; align-items: baseline; gap: 10px; flex: 1; flex-wrap: wrap; }
.pq-stats-h { font-size: 16px; font-weight: 800; }

/* 기간 선택 (7·14·30일) */
.pq-range { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pq-range-btn {
    background: var(--panel); border: none; border-left: 1px solid var(--border);
    padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-dim);
}
.pq-range-btn:first-child { border-left: none; }
.pq-range-btn:hover { background: #f1f5f9; }
.pq-range-btn.on { background: var(--primary); color: #fff; font-weight: 700; }

/* 지표 넷 — 차트가 아니라 숫자로 읽는 값들. 옆 요약 타일과 같은 결로 맞춘다. */
.pq-kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px; margin-bottom: 14px;
}
.pq-kpi {
    display: flex; flex-direction: column; gap: 1px;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
}
.pq-kpi-label { font-size: 11.5px; color: var(--text-dim); }
.pq-kpi-value { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pq-kpi-sub { font-size: 11.5px; color: var(--text-dim); }

/* ── 일별 판정 분포 ──
   막대는 얇게, 격자는 뒤로 물린다. 데이터 끝(막대 위)만 4px 둥글리고 기준선에는 붙여 둔다. */
.pq-chart-fig { margin: 0; }
.pq-chart { position: relative; padding-left: 28px; }

/* ⚠ 막대에 얹는 숫자 자리(14px)는 이 박스 **밖**에 둔다(margin-top).
   안쪽 padding 으로 잡으면 눈금선은 132px 기준, 막대는 118px 기준이 되어
   "최댓값 눈금" 이 가장 높은 막대보다 14px 위에 뜬다. */
.pq-plot { position: relative; height: 118px; margin-top: 14px; }
/* 눈금 — 실선이 아니라 점선 hairline. 숫자는 왼쪽 여백에 얹는다. */
.pq-grid {
    position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border);
}
.pq-grid-n {
    position: absolute; right: 100%; top: -7px; margin-right: 5px;
    font-size: 10.5px; font-style: normal; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

/* 막대들 — 눈금선과 같은 박스를 쓴다(그래서 눈금이 막대 높이와 정확히 맞는다) */
.pq-bars {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; gap: 3px;
    border-bottom: 1px solid #c3c2b7;   /* 기준선은 격자보다 진하게 */
}
/* 과녁(hover·포커스)은 열 전체다 — 막대보다 넓어야 얇은 막대를 겨눌 수 있다 */
.pq-col {
    flex: 1; min-width: 0; height: 100%;
    display: flex; align-items: flex-end; justify-content: center;
}
.pq-col:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* 값이 없는 날도 자리를 남긴다 — 막대만 이어 붙이면 주말이 사라져 추이가 거짓이 된다.
   막대는 얇게 둔다: 7일치를 볼 때 열이 넓어져도 막대가 뭉툭해지지 않도록 폭에 상한을 둔다. */
/* ⚠ overflow:hidden 을 쓰지 않는다 — 막대 위에 얹는 숫자(pq-col-total)가 잘려 사라진다.
   둥근 데이터 끝은 맨 위 세그먼트에 직접 준다(아래 :last-child). */
.pq-stack {
    position: relative; width: 100%; max-width: 30px; min-height: 0;
    display: flex; flex-direction: column-reverse;
}
.pq-col:hover .pq-stack { filter: brightness(.94); }

/* 판정 색 — 계열 팔레트가 아니라 **상태 팔레트**다(good/warning/critical + 무채색).
   status 색은 다른 뜻으로 돌려쓰지 않는다.
     통과   good     #0ca30c
     주의   warning  #fab219   ← 흰 배경 대비 1.83:1. 그래서 범례·막대 설명·아래 표가 늘 함께 있다
                                 (색만으로 뜻이 갈리는 자리를 만들지 않는다)
     오류·반려 critical #d03b3b  ← 둘 다 '이 파일로는 못 찍는다' 라 한 칸에 묶었다
     처리실패 무채색  #898781   ← 판정이 아니라 시스템 사고다. 회색인 것이 곧 '판정 없음' 이다
   이 네 색은 흰 배경(#ffffff)에서 인접쌍 CVD ΔE 9.1 / 정상시야 ΔE 18.9 로 분리 게이트를 통과한다.
   다섯째 색을 넣지 않은 이유: 주의(#fab219)와 나란히 두면 정상시야 ΔE 가 15 아래로 떨어진다. */
.pq-seg { display: block; width: 100%; min-height: 4px; box-sizing: border-box; }
/* 데이터 끝만 둥글리고 기준선 쪽은 각지게 붙여 둔다.
   column-reverse 라 마지막 자식이 시각적으로 맨 위다. */
.pq-seg:last-child { border-radius: 4px 4px 0 0; }
/* 세그먼트 사이 2px 은 배경색으로 띄운다 — 붙어 있으면 경계가 색 차이에만 기댄다.
   (column-reverse 에서 두 번째 자식부터의 border-bottom 이 '아래 세그먼트와의 틈' 이다) */
.pq-seg:not(:first-child) { border-bottom: 2px solid var(--panel); }
.pq-seg.s-pass { background: #0ca30c; }
.pq-seg.s-warn { background: #fab219; }
.pq-seg.s-bad { background: #d03b3b; }
.pq-seg.s-failed { background: #898781; }

/* 막대에 얹는 숫자 — 모든 막대에 찍지 않는다(가장 많은 날·마지막 날만) */
.pq-col-total {
    position: absolute; left: 0; right: 0; bottom: 100%;
    text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text-dim);
    font-variant-numeric: tabular-nums; line-height: 13px;
}

/* 날짜 눈금 — 막대와 같은 flex·같은 gap 이라 열이 정확히 맞는다 */
.pq-xrow { display: flex; gap: 3px; margin-top: 4px; }
.pq-col-x {
    flex: 1; min-width: 0; text-align: center;
    font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden;
}

/* 막대 설명 — 접어 놓은 계열(오류·반려)의 내역까지 여기서 갈라 보여준다 */
.pq-tip {
    position: absolute; bottom: 100%; transform: translateX(-50%);
    background: #0f172a; color: #fff; border-radius: 8px; padding: 5px 9px;
    font-size: 11.5px; white-space: nowrap; pointer-events: none; z-index: 5;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

/* 범례 — 계열이 둘 이상이면 항상 둔다. 누르면 아래 목록이 그 판정으로 걸러진다. */
.pq-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pq-leg {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
    padding: 2px 10px 2px 7px; font-size: 11.5px; color: var(--text); cursor: pointer;
}
/* 범례는 현황 화면으로 넘어가는 링크다(a 태그) — 밑줄만 지우고 알약 모양은 그대로 */
.pq-leg { text-decoration: none; }
.pq-leg:hover { border-color: var(--primary); color: var(--primary); }

/* 카드 한 칸이 아니라 화면 전체를 쓰는 통계 페이지에서는 막대를 키운다.
   118px 짜리를 그대로 두면 위쪽에 빈 판만 남는다(내용은 같다 — 높이만 다르다). */
.pq-stats-page .pq-plot { height: 220px; }
.pq-stats-page .pq-stack { max-width: 40px; }
.pq-stats-page .pq-legend { margin-top: 14px; }
.pq-leg-swatch { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.pq-leg-swatch.s-pass { background: #0ca30c; }
.pq-leg-swatch.s-warn { background: #fab219; }
.pq-leg-swatch.s-bad { background: #d03b3b; }
.pq-leg-swatch.s-failed { background: #898781; }

/* 유입 분포 — 차트가 아니라 한 줄 숫자다(계열 색을 판정 색 옆에 두지 않기 위해서다) */
.pq-srcline { margin-top: 8px; font-size: 11.5px; color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   Preflight 현황 — 검수된 건의 조건 (검색·필터·정렬)
   ══════════════════════════════════════════════════════════════ */
.pq-filters {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.pq-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pq-filter-label {
    font-size: 11.5px; color: var(--text-dim); width: 34px; flex-shrink: 0;
}

/* 한 칸 검색 — 무엇을 들고 와도(파일명이든 번호든) 여기 넣는다 */
.pq-search {
    display: flex; align-items: center; gap: 6px; flex: 1; min-width: 220px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
    padding: 5px 10px;
}
.pq-search:focus-within { border-color: var(--primary); }
.pq-search-icon { font-size: 12px; opacity: .6; }
.pq-search input {
    flex: 1; min-width: 0; border: none; outline: none; background: none;
    font-size: 13px; color: var(--text);
}
/* '/' 로 여기에 바로 올 수 있다는 표시 */
.pq-search-key {
    font-size: 10px; color: var(--text-dim); border: 1px solid var(--border);
    border-radius: 4px; padding: 0 4px; line-height: 15px;
}
.pq-filter-reset { flex-shrink: 0; }

/* 조건 칩 — 누른 것만 칠한다(여러 개 고를 수 있다) */
.pq-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.pq-chip-btn {
    background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
    padding: 3px 11px; font-size: 12px; color: var(--text-dim); cursor: pointer;
}
.pq-chip-btn:hover { border-color: #cbd5e1; color: var(--text); }
.pq-chip-btn.on { border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 700; }
/* 판정 칩은 눌렀을 때 그 판정의 색을 쓴다 — 표의 판정 배지와 같은 색이라 눈이 이어진다 */
.pq-chip-btn.pq-chip-v.ok.on { border-color: #15803d; background: #dcfce7; color: #15803d; }
.pq-chip-btn.pq-chip-v.warn.on { border-color: #b45309; background: #fef3c7; color: #b45309; }
.pq-chip-btn.pq-chip-v.bad.on { border-color: #b91c1c; background: #fee2e2; color: #b91c1c; }

.pq-daterange { display: inline-flex; align-items: center; gap: 5px; }
.pq-daterange input, .pq-psize select {
    border: 1px solid var(--border); border-radius: 7px; padding: 3px 7px;
    font-size: 12px; color: var(--text); background: var(--panel);
}
.pq-psize { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }

/* 정렬 가능한 표 머리 — 머리 전체가 버튼이다.
   ⚠ table-layout:fixed 로 못 박는다. auto 로 두면 머리에 들어온 버튼의 min-content 가
     열 폭을 밀어내, '오류/경고'(84px 지정)가 파일명 칸을 빼앗아 파일명이 세 줄로 접혔다.
     폭을 지정하지 않은 파일·사양 칸이 남는 폭을 나눠 갖는다. */
.pq-done-table { table-layout: fixed; }
.pq-done-table th { padding: 0; }
/* fixed 레이아웃에서는 칸이 내용에 맞춰 늘지 않는다 — 공백 없는 긴 파일명은 칸 밖으로 넘친다 */
.pq-done-table .c-file, .pq-done-table .c-spec { overflow-wrap: anywhere; }
/* '처리실패' 는 78px 에 한 줄로 안 들어가 '처리실 / 패' 로 접혔다 — 이 표에서만 넓힌다 */
.pq-done-table .c-status { width: 88px; }
/* 접수번호 칸에는 번호 + 고객명(+ 접수자)이 쌓인다 — 130px 로는 고객명이 접힌다 */
.pq-done-table .c-bid { width: 165px; }
/* 검수번호 뒤에 빈 자리가 남았다 — 이 표는 번호만 들어가므로(대기열과 달리) 190px 이 필요 없다.
   줄인 폭은 폭을 지정하지 않은 파일·사양 칸이 받는다(table-layout:fixed).
   ⚠ 더 줄이면 번호가 두 줄로 접힌다 — 아래 min-width 합계도 함께 고칠 것. */
.pq-done-table .c-rno { width: 150px; }
.pq-done-table .c-status .pf-badge { white-space: nowrap; }
/* 판정이 없는 건(처리 실패)의 원인은 이 좁은 칸에 다 들어가지 않는다 —
   넘쳐서 옆 칸(소요·완료·접수번호) 위로 흐르던 자리다. 칸 안에 가두고 전체는 title·상세로 본다. */
.pq-done-table .c-cnt { overflow: hidden; }
.pq-sort {
    display: flex; align-items: center; gap: 3px; width: 100%;
    background: none; border: none; cursor: pointer; white-space: nowrap;
    padding: 8px 10px; font: inherit; color: var(--text-dim); text-align: left;
}
.pq-done-table .c-cnt .pq-sort, .pq-done-table .c-status .pq-sort { justify-content: center; }
.pq-sort:hover { color: var(--primary); }
.pq-sort.on { color: var(--text); font-weight: 700; }
.pq-sort-ind { font-size: 8px; font-style: normal; line-height: 1; }

/* 행 전체가 상세를 여는 과녁이다 ('보기' 버튼은 키보드용으로 그대로 남는다) */
.pq-done-table tbody tr { cursor: pointer; }
.pq-done-table tbody tr:hover { background: #f8fafc; }
/* 지금 펼쳐 둔 건 — 패널이 목록 아래에 있어 스크롤하면 어느 행이었는지 잃는다 */
.pq-done-table tbody tr.open { background: #eff6ff; box-shadow: inset 3px 0 0 var(--primary); }

/* ══════════════════════════════════════════════════════════════
   Preflight 현황 — 알림
   ══════════════════════════════════════════════════════════════ */
.pq-notify { position: relative; }
.pq-notify-btn.on { color: var(--primary); border-color: var(--primary); font-weight: 700; }
.pq-notify-pop {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: 290px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; box-shadow: 0 10px 26px rgba(15, 23, 42, .14);
}
.pq-notify-title { font-size: 12.5px; font-weight: 700; margin-bottom: 9px; }
.pq-notify-row {
    display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer;
}
.pq-notify-row input[type=checkbox] { margin-top: 2px; cursor: pointer; }
.pq-notify-row strong { display: block; font-size: 12.5px; font-weight: 600; }
.pq-notify-row em { display: block; font-size: 11.5px; font-style: normal; color: var(--text-dim); }
.pq-notify-num { align-items: center; font-size: 12px; color: var(--text-dim); cursor: default; }
.pq-notify-num input {
    width: 52px; border: 1px solid var(--border); border-radius: 6px;
    padding: 2px 6px; font-size: 12px; text-align: right;
}
/* 왜 안 울리는지(권한 차단·미허용)를 그 자리에 적는다 */
.pq-notify-foot {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--text-dim); line-height: 1.45;
}

/* 화면 안 알림 — 흘려보내도 되는 소식(검수 완료 등). 누르면 바로 사라진다. */
.pq-toasts {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
    pointer-events: none;
}
.pq-toast {
    pointer-events: auto; cursor: pointer; max-width: 340px;
    background: #0f172a; color: #fff; border-radius: 10px; padding: 8px 13px;
    font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 18px rgba(15, 23, 42, .22);
    animation: pq-toast-in .18s ease-out;
}
/* 소식의 성격은 색만으로 알리지 않는다 — 문장 자체가 무슨 일인지 말한다.
   색은 눈이 먼저 가게 하는 보조 표시다. */
.pq-toast.ok { background: #14532d; }
.pq-toast.warn { background: #78350f; }
.pq-toast.bad { background: #7f1d1d; }
@keyframes pq-toast-in {
    from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════════════════════════
   Preflight 현황 — 좁은 화면
   ══════════════════════════════════════════════════════════════ */
/* 표는 가로 스크롤로 버티되(열을 지우면 대조할 값이 사라진다), 조건 줄과 지표는 접어 쌓는다. */
@media (max-width: 900px) {
    .pq-filter-label { width: auto; }
    .pq-psize { margin-left: 0; }
    .pq-search { min-width: 100%; }
    .pq-kpis { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
    .pq-notify-pop { width: 260px; }
    /* 열이 많은 표는 폭을 확보해 두고 가로로 넘긴다 — 열을 지우면 대조할 값이 사라지고,
       그냥 좁히면 파일명이 한 글자씩 접혀 읽을 수 없게 된다.
       ⚠ min-width 는 **고정폭 열의 합보다 커야** 한다. 780px 으로 뒀더니 대기열의 고정폭
         합계(48+70+180+72+130+190+92 = 782px)가 이미 그 값을 다 먹어 파일명 칸이 0 이 됐다.
         값을 바꿀 때는 아래 합계도 함께 고쳐 셀 것. */
    .pq-table { min-width: 1000px; }          /* 대기열·멈춘 검수 (고정폭 ~782 + 파일명 여유) */
    .pq-done-table { min-width: 1400px; }     /* 검수된 건 (고정폭 ~1187 + 파일명 여유) */
    .pq-toasts { right: 10px; bottom: 10px; }
    .pq-toast { max-width: calc(100vw - 24px); }
}

/* 진행 중인 검수 — 여러 직원이 같은 화면을 쓰므로 누가 무엇을 돌리는 중인지 보여준다 */
.pf-live {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px 14px;
}
.pf-live-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #92400e; }
.pf-live-title { font-weight: 700; }
.pf-live-count {
    min-width: 18px; padding: 0 6px; border-radius: 9px;
    background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}
/* 살아 있다는 표시 — 폴링 주기(5초)와 무관하게 계속 깜빡인다 */
.pf-live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #f59e0b;
    animation: pf-live-pulse 1.4s ease-in-out infinite;
}
@keyframes pf-live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.pf-live-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pf-live-item {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: #78350f;
}
.pf-live-who { font-weight: 700; }
.pf-live-me {
    padding: 1px 6px; border-radius: 8px;
    background: #f59e0b; color: #fff; font-size: 10.5px; font-weight: 700;
}
.pf-live-file { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pf-live-spec { font-size: 12px; color: #b45309; }
/* 1초마다 다시 그리므로 폭이 고정돼야 숫자가 덜 튄다 */
.pf-live-elapsed { font-size: 12px; color: #b45309; font-variant-numeric: tabular-nums; }

/* callas 진행 단계 (접수 → 대기 → 검수). 진행률(%)을 주지 않으므로 3칸 스텝으로 표시한다 */
.pf-live-stage {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border-radius: 10px;
    background: #fff; border: 1px solid #fcd34d;
    font-size: 11.5px; font-weight: 700; color: #b45309;
    font-variant-numeric: tabular-nums;
}
.pf-live-steps { display: inline-flex; gap: 3px; }
.pf-live-steps i { width: 5px; height: 5px; border-radius: 50%; background: #fde68a; }
.pf-live-steps i.done { background: #b45309; }
/* 현재 단계만 깜빡여 어디까지 왔는지 한눈에 보이게 */
.pf-live-steps i.on { background: #f59e0b; animation: pf-live-pulse 1.4s ease-in-out infinite; }
/* 검수 중은 초록 계열로 — 큐에서 기다리는 중(대기)과 확실히 구분된다 */
.pf-live-stage.s-running { border-color: #86efac; color: #15803d; }
.pf-live-stage.s-running i.done { background: #15803d; }
.pf-live-stage.s-running i.on { background: #22c55e; }

/* 업로드 */
.pf-upload-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
}
.pf-drop {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    border: 2px dashed var(--border); border-radius: 12px;
    padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.pf-drop:hover, .pf-drop.dragging { border-color: var(--primary); background: #eff6ff; }
.pf-drop-icon { font-size: 24px; }
.pf-drop-main { font-size: 15px; color: var(--text); }
.pf-drop-hint { font-size: 12px; color: var(--text-dim); }
.pf-picked {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 12px; padding: 10px 12px;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
}
.pf-picked-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pf-picked-size { font-size: 12px; color: var(--text-dim); }
.pf-msg { margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.pf-msg.error { color: #b91c1c; }
.pf-msg.ok { color: #15803d; font-weight: 600; }

/* 구분/색상 선택 (표지·내지 / 컬러·흑백) — 상단 안내 옆에 컴팩트하게 세로 배치 */
.pf-print-opts {
    display: flex; flex-direction: column; justify-content: center; gap: 8px;
    padding: 10px 14px;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
}
.pf-print-opt { display: flex; align-items: center; gap: 10px; }
.pf-print-label {
    font-size: 13px; font-weight: 600; color: var(--text);
    min-width: 34px;
}
.pf-radio {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: var(--text); cursor: pointer;
}
.pf-radio input { cursor: pointer; }
/* 이력 목록의 파일명 아래 색상 사양 뱃지 */
.pf-file-spec {
    display: block; margin-top: 2px;
    font-size: 11px; color: var(--text-dim);
}

.pf-btn {
    padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
}
.pf-btn:hover { background: #f1f5f9; }
.pf-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.pf-btn.primary:hover { background: #1d4ed8; }
.pf-btn.ghost { color: var(--text-dim); }
.pf-btn:disabled { opacity: .6; cursor: default; }

/* 판정 표기 */
.pf-verdict {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 84px; padding: 10px 16px; border-radius: 10px;
    font-size: 17px; font-weight: 700; background: #f1f5f9; color: var(--text-dim);
}
.pf-verdict.ok { background: #dcfce7; color: #15803d; }
.pf-verdict.warn { background: #fef3c7; color: #b45309; }
.pf-verdict.bad { background: #fee2e2; color: #b91c1c; }
.pf-badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--text-dim);
}
.pf-badge.ok { background: #dcfce7; color: #15803d; }
.pf-badge.warn { background: #fef3c7; color: #b45309; }
.pf-badge.bad { background: #fee2e2; color: #b91c1c; }

/* 검수 결과 */
.pf-result-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
    /* 내부(pf-result-inner)는 스크롤, 하단 그립(pf-result-grip)으로 높이 조절 */
    display: flex; flex-direction: column;
    height: 74vh; min-height: 320px; overflow: hidden;
}
.pf-result-inner { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
/* 하단 드래그 그립 — 끌어서 카드 높이를 늘였다 줄였다 */
.pf-result-grip {
    flex: none; height: 16px; cursor: ns-resize;
    display: flex; align-items: center; justify-content: center;
    border-top: 1px solid var(--border); background: #f8fafc;
    border-radius: 0 0 14px 14px; touch-action: none; user-select: none;
}
.pf-result-grip:hover { background: #eef2f7; }
.pf-result-grip-bar { width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; }
.pf-result-card.resizing { user-select: none; }
.pf-result-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pf-result-meta { min-width: 0; flex: 1; }
.pf-result-close {
    flex: none; align-self: flex-start;
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff;
    color: var(--text-dim); font-size: 14px; line-height: 1; cursor: pointer;
}
.pf-result-close:hover { background: #f1f5f9; color: var(--text); }
.pf-result-file { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.pf-result-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; overflow-wrap: anywhere; }

/* callas 요약 원문 */
.pf-summary {
    margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
    background: #f8fafc; border: 1px solid var(--border);
    font-family: ui-monospace, Consolas, "D2Coding", monospace;
    font-size: 12.5px; line-height: 1.6; color: var(--text);
    white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto;
}

/* 리포트 링크 */
.pf-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-links-msg { font-size: 12px; color: var(--text-dim); }

.pf-items, .pf-history { width: 100%; border-collapse: collapse; font-size: 13px; }
.pf-items th, .pf-history th {
    text-align: left; font-weight: 600; color: var(--text-dim);
    padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.pf-items td, .pf-history td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.pf-items .c-no { width: 36px; color: var(--text-dim); }
.pf-items .c-name { width: 120px; font-weight: 600; }
.pf-items .c-status { width: 78px; }
.pf-empty { text-align: center; color: var(--text-dim); padding: 20px 0; }

/* 댓글 */
.pf-comments { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.pf-comments-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.pf-comments-count {
    display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px;
    border-radius: 999px; background: #f1f5f9; color: var(--text-dim);
    font-size: 12px; font-weight: 600; text-align: center;
}
.pf-comment-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pf-comment {
    padding: 9px 12px; border-radius: 10px;
    background: #f8fafc; border: 1px solid var(--border);
}
.pf-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pf-comment-author { font-size: 12.5px; font-weight: 700; }
.pf-comment-date { font-size: 11.5px; color: var(--text-dim); flex: 1; }
.pf-comment-body { font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-comment-empty { font-size: 13px; color: var(--text-dim); padding: 6px 0; }
.pf-comment-write { display: flex; gap: 8px; align-items: flex-start; }
.pf-comment-write textarea {
    flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px;
    font-family: inherit; font-size: 13px; line-height: 1.5; resize: vertical; min-height: 44px;
}
.pf-comment-write textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.pf-comment-msg { margin-top: 8px; font-size: 12.5px; color: #b91c1c; }

/* 이력 */
.pf-history-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px; display: flex; flex-direction: column; min-height: 0;
}
.pf-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pf-history-title { font-size: 15px; font-weight: 700; }
/* 결과 창이 안 펼쳐진 평상시엔 이력을 한 10개 정도 보여주고, 나머지는 세로 스크롤 (헤더는 고정) */
.pf-history-scroll { overflow: auto; max-height: 428px; }
/* 결과 창(#pf-result)이 펼쳐지면(=hidden 아님) 이력은 한 3개 정도로 줄여 자리를 양보 */
.pf-result-card:not([hidden]) ~ .pf-history-card .pf-history-scroll { max-height: 158px; }
.pf-history thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--panel);
}
.pf-history .c-status { width: 78px; }
.pf-history .c-cmt { width: 62px; }
.pf-cmt-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    background: #eff6ff; color: #1d4ed8; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
/* 검수 소요 시간 — 숫자 비교가 쉽도록 우측 정렬 + 고정폭 숫자 */
.pf-history .c-dur {
    width: 78px; white-space: nowrap; text-align: right;
    color: var(--text-dim); font-variant-numeric: tabular-nums;
}
/* 검수를 실행한 직원 — 이력이 직원 공용이라 남의 건과 구분하는 기준이 된다 */
.pf-history .c-staff {
    width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim);
}
.pf-history .c-date { width: 140px; white-space: nowrap; color: var(--text-dim); }
.pf-history .c-act { width: 210px; white-space: nowrap; text-align: right; }
/* 하단 줄: 왼쪽 건수/안내, 오른쪽 페이저 */
.pf-history-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 8px; min-height: 26px;
}
.pf-history-status { font-size: 12px; color: var(--text-dim); }
.pf-history-pager { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.pf-history-pager .pf-pg-now { font-variant-numeric: tabular-nums; }
.pf-pg {
    border: 1px solid var(--border); background: #fff; border-radius: 8px;
    padding: 3px 10px; cursor: pointer; transition: all .13s;
}
.pf-pg:hover:not(:disabled) { background: #f1f5f9; border-color: #cbd5e1; }
.pf-pg:disabled { opacity: .35; cursor: default; }
.pf-link {
    background: none; border: none; cursor: pointer; padding: 2px 5px;
    font-size: 12px; color: var(--primary);
}
.pf-link:hover { text-decoration: underline; }
.pf-link.danger { color: #b91c1c; }
/* 점검표는 옆 버튼들과 달리 '내려받기' 가 아니라 '새 탭으로 열기' 다 — 라벨만으로
   동작 차이를 알아채기를 바라지 않고 생김새로도 가른다. 목록 행에서는 폭이 없어
   아이콘(📋)이 그 일을 하고, 폭이 있는 상세 패널에서만 테두리를 두른다. */
.pf-link.pq-checklist { font-weight: 600; }
.pq-detail-acts .pf-link.pq-checklist {
    border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.pq-detail-acts .pf-link.pq-checklist:hover { background: #eff6ff; text-decoration: none; }

/* 재처리는 내려받기와 성격이 다르다 — 큐에 일을 새로 넣는 동작이라 색으로 구분한다.
   연타 방지로 disabled 되는 동안에는 눌리지 않는다는 게 보여야 한다. */
.pf-link.pq-redo { color: #b45309; font-weight: 600; }
/* 검수 중 취소는 남의 점유를 걷어내는 동작이다 — 재처리(주황)보다 강하게 세우고,
   카드 오른쪽 끝으로 밀어 파일명·진행률을 읽는 순서를 방해하지 않게 둔다. */
.pf-link.pq-cancel {
    color: #b91c1c; font-weight: 700; margin-left: auto;
    border: 1px solid #fecaca; border-radius: 6px; background: #fff;
}
.pf-link.pq-cancel:hover { background: #fef2f2; }
.pf-link:disabled { color: var(--text-dim); cursor: default; text-decoration: none; }

@media (max-width: 720px) {
    .pf-layout { padding: 10px; }
    /* 좁은 화면: 판정칩과 닫기 버튼은 한 줄, 파일 정보는 아랫줄로 */
    .pf-result-head { flex-wrap: wrap; gap: 10px; }
    .pf-result-meta { flex-basis: 100%; order: 3; }
    .pf-result-close { margin-left: auto; }  /* meta 가 아랫줄로 내려가므로 직접 우측 정렬 */
    .pf-items .c-fix, .pf-history .c-date { display: none; }
}
