
        :root { 
            --bg-dark: #0f172a; 
            --bg-panel: #1e293b; 
            --bg-card: #27354f;
            --text-main: #ffffff; 
            --text-muted: #94a3b8; 
            --accent-green: #34d399; 
            --accent-red: #f87171; 
            --accent-blue: #60a5fa; 
            --accent-gold: #fcd34d; 
            --accent-cyan: #22d3ee; 
            --accent-purple: #c084fc; 
        }
        body { margin: 0; font-family: 'Pretendard', 'Malgun Gothic', sans-serif; background-color: var(--bg-dark); color: var(--text-main); display: flex; flex-direction: column; height: 100vh; overflow-y: auto; padding-bottom: 80px; box-sizing: border-box; }
        
        #auth-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: var(--bg-dark); z-index: 9999999; display: flex; align-items: center; justify-content: center; transition: opacity 0.5s ease-out; }
        /* CEO_SHIELD_PC_LOGIN_BACKGROUND_HIDE_S238: 로그인 전 CRM 화면 노출 방지 */
        body:not(.ceo-authenticated) > :not(#auth-screen) { visibility:hidden !important; pointer-events:none !important; }
        .auth-box { background: var(--bg-panel); padding: 50px 40px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); text-align: center; width: 90%; max-width: 360px; box-sizing: border-box; }
        
        .logo-container { display: flex; justify-content: center; align-items: center; margin-bottom: 20px; perspective: 1000px; }
        .shield-logo { width: 90px; height: 110px; filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.4)); animation: floatingLogo 4s ease-in-out infinite; }
        .shield-path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: drawShield 2s ease-out forwards; }
        .shield-inner { opacity: 0; transform: scale(0.8); transform-origin: center; animation: popInShield 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 1.2s; }
        .shield-text { opacity: 0; animation: popInShield 1s ease-out forwards 1.8s; }

        @keyframes drawShield { to { stroke-dashoffset: 0; } }
        @keyframes popInShield { to { opacity: 1; transform: scale(1); } }
        @keyframes floatingLogo { 0% { transform: translateY(0px); filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3)); } 50% { transform: translateY(-8px); filter: drop-shadow(0 0 25px rgba(251, 191, 36, 0.6)); } 100% { transform: translateY(0px); filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3)); } }

        .auth-box h2 { color: var(--accent-gold); margin-top: 0; margin-bottom: 10px; font-size: 24px; letter-spacing: 2px; font-weight: 900; }
        .auth-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 35px; letter-spacing: 1px; }
        .auth-input-group { text-align: left; margin-bottom: 20px; }
        .auth-input-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-weight: bold; }
        .auth-input { width: 100%; padding: 14px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: white; font-size: 15px; box-sizing: border-box; outline: none; transition: 0.3s; }
        .auth-input:focus { border-color: rgba(90, 133, 248, 0.6); background: rgba(0,0,0,0.5); box-shadow: 0 0 10px rgba(90, 133, 248, 0.2); }
        .auth-btn { width: 100%; padding: 16px; background-color: var(--accent-blue); color: white; border: none; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s; margin-top: 10px; }
        .auth-btn:hover { background-color: #486ed6; transform: translateY(-1px); }

        .sidebar { position: fixed; bottom: 0; left: 0; width: 100%; height: 75px; background-color: rgba(30, 41, 59, 0.95); backdrop-filter: blur(10px); border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: row; justify-content: space-around; align-items: center; z-index: 1000; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -5px 20px rgba(0,0,0,0.4); overflow-x: auto; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; }
        .sidebar::-webkit-scrollbar { display: none; }
        .sidebar h2 { display: none; }
        .nav-btn { background: transparent; border: none; color: #64748b; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 11px; font-weight: 700; width: 100%; min-width: 60px; height: 100%; cursor: pointer; transition: 0.2s; position: relative; padding: 0 10px; }
        .nav-btn span:first-child { font-size: 22px; transition: transform 0.2s; }
        .nav-btn.active { color: var(--accent-cyan); }
        .nav-btn.active span:first-child { transform: translateY(-2px); }
        .nav-btn.active::after { content: ''; position: absolute; top: -1px; width: 30px; height: 3px; background-color: var(--accent-cyan); border-radius: 0 0 4px 4px; box-shadow: 0 2px 5px rgba(34, 211, 238, 0.5); }

        .main-content { padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; box-sizing: border-box; }
        .header-title { display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; }
        .header-title h1 { margin: 0; font-size: 20px; color: white; display: flex; justify-content: space-between; align-items: center; }
        .db-status { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); border: 1px solid rgba(34, 211, 238, 0.3); font-weight: bold; }

        .summary-container { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .summary-card { background: var(--bg-panel); padding: 20px 15px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); box-shadow: 0 8px 20px rgba(0,0,0,0.2); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
        .summary-card.full-width { grid-column: 1 / -1; padding: 15px; }
        .summary-title { font-size: 12px; color: var(--text-muted); font-weight: bold; margin-bottom: 8px; }
        .summary-value { font-size: 22px; font-weight: 900; color: var(--text-main); }
        .val-gold { color: var(--accent-gold); text-shadow: 0 0 15px rgba(252, 211, 77, 0.3); }
        .val-blue { color: var(--accent-blue); text-shadow: 0 0 15px rgba(96, 165, 250, 0.3); }

        .chart-wrapper { position: relative; width: 100%; height: 180px; }

        .search-filter-box { display: flex; flex-direction: column; gap: 10px; background: var(--bg-panel); padding: 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
        .search-row { display: flex; gap: 8px; }
        .form-control-sm { padding: 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: white; font-size: 14px; outline: none; box-sizing: border-box; transition: 0.2s; }
        .form-control-sm:focus { border-color: var(--accent-blue); background: rgba(0,0,0,0.5); }

        .table-wrapper { width: 100%; }
        table { width: 100%; border-collapse: collapse; display: block; }
        thead { display: none; } 
        tbody { display: flex; flex-direction: column; gap: 16px; width: 100%; }
        
        tr { display: flex; flex-direction: column; background: var(--bg-card); border-radius: 16px; padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.03); position: relative; }
        
        td[data-label="기업명"] { border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 12px; margin-bottom: 12px; display: flex; justify-content: flex-start; align-items: center; }
        td[data-label="기업명"]::before { display: none; }
        td[data-label="기업명"] .company-link { font-size: 18px; font-weight: 900; color: white; text-decoration: none; display: flex; align-items: center; gap: 8px; cursor: pointer; }
        td[data-label="기업명"] .company-link::before { content: '🏢'; font-size: 16px; }
        td[data-label="기업명"] .company-link:hover { color: var(--accent-gold); }
        
        td:not([data-label="기업명"]):not(:last-child) { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; color: #e2e8f0; }
        td:not([data-label="기업명"]):not(:last-child)::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); font-size: 13px; }
        
        td:last-child { margin-top: 15px; padding-top: 15px; border-top: 1px dashed rgba(255,255,255,0.08); display: flex; justify-content: center; }
        td:last-child::before { display: none; }

        .badge { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; }
        .badge-kibo { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); border: 1px solid rgba(96, 165, 250, 0.4); }
        .badge-shinbo { background: rgba(192, 132, 252, 0.15); color: var(--accent-purple); border: 1px solid rgba(192, 132, 252, 0.4); }
        .badge-jungjin { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); border: 1px solid rgba(52, 211, 153, 0.4); }
        .badge-sojin { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); border: 1px solid rgba(248, 113, 113, 0.4); }
        .badge-local { background: rgba(252, 211, 77, 0.15); color: var(--accent-gold); border: 1px solid rgba(252, 211, 77, 0.4); }

        .fund-status-wrap { display:flex; align-items:center; gap:10px; width:100%; justify-content:flex-end; flex-wrap:wrap; }
        .fund-status-dot { width:10px; height:10px; border-radius:50%; flex:0 0 10px; box-shadow:0 0 10px currentColor; }
        .fund-status-select { min-width:112px; padding:8px 30px 8px 12px; border-radius:999px; font-size:12px; font-weight:900; color:white; background:#111827; border:1px solid rgba(255,255,255,0.12); outline:none; cursor:pointer; }
        .fund-status-date { font-size:11px; color:var(--text-muted); white-space:nowrap; }
        .status-assigned { color:#FACC15; }
        .status-phone-consult { color:#22D3EE; }
        .status-company-meeting { color:#34D399; }
        .status-received { color:#8B5CF6; }
        .status-approved { color:#3B82F6; }
        .status-hold { color:#FB923C; }
        .status-rejected { color:#EF4444; }
        .status-unset { color:#94A3B8; }

        /* 구형 화면 클래스 호환 */
        .status-waiting { color:#FACC15; }
        .status-summary-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; grid-column:1 / -1; }

        .role-kpi-panel {
            grid-column: 1 / -1;
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
            margin: 0 0 18px;
            padding: 14px;
            border-radius: 14px;
            border: 1px solid rgba(56,189,248,.18);
            background: linear-gradient(135deg, rgba(14,116,144,.12), rgba(15,23,42,.72));
        }
        .role-kpi-header {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:12px;
            margin-bottom:12px;
            flex-wrap:wrap;
        }
        .role-kpi-title {
            font-size:14px;
            font-weight:900;
            color:#e0f2fe;
        }
        .role-kpi-scope {
            font-size:11px;
            color:#94a3b8;
            font-weight:800;
        }
        .role-kpi-grid {
            display:grid;
            grid-template-columns:repeat(4,minmax(0,1fr));
            gap:10px;
        }
        .role-kpi-card {
            min-width:0;
            padding:13px 12px;
            border-radius:11px;
            background:rgba(2,6,23,.55);
            border:1px solid rgba(148,163,184,.14);
        }
        .role-kpi-label {
            font-size:11px;
            color:#94a3b8;
            font-weight:800;
            margin-bottom:7px;
        }
        .role-kpi-value {
            font-size:21px;
            line-height:1.15;
            font-weight:950;
            color:#f8fafc;
            word-break:break-all;
        }
        .role-kpi-unit {
            margin-left:3px;
            font-size:11px;
            font-weight:800;
            color:#94a3b8;
        }
        .role-kpi-sub {
            margin-top:6px;
            font-size:10px;
            line-height:1.4;
            color:#64748b;
        }
        @media (max-width:900px) {
            .role-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
        }
        @media (max-width:480px) {
            .role-kpi-grid { grid-template-columns:1fr; }
        }
        .status-summary-card { background:rgba(0,0,0,0.22); border:1px solid rgba(255,255,255,0.06); border-radius:12px; padding:12px; text-align:center; }
        .status-summary-label { font-size:11px; color:var(--text-muted); margin-bottom:5px; font-weight:800; }
        .status-summary-value { font-size:20px; font-weight:900; }

        /* V3 CRM 카드 압축 및 헤더 상태 표시 */
        tr { padding: 16px; }
        td[data-label="기업명"] { padding-bottom: 10px; margin-bottom: 8px; }
        td:not([data-label="기업명"]):not(:last-child) { padding: 4px 0; }
        td:last-child { margin-top: 10px; padding-top: 10px; }

        .company-title-row { width:100%; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
        .company-title-left { display:flex; align-items:center; gap:10px; min-width:0; }
        .company-status-badge { display:inline-flex; align-items:center; gap:7px; padding:6px 11px; border-radius:999px; font-size:11px; font-weight:900; border:1px solid currentColor; background:rgba(15,23,42,0.7); white-space:nowrap; }
        .company-status-badge .fund-status-dot { width:8px; height:8px; flex-basis:8px; }

        .status-control-panel { display:flex; justify-content:flex-end; align-items:center; gap:10px; flex-wrap:wrap; width:100%; }
        .status-elapsed { padding:5px 9px; border-radius:999px; background:rgba(255,255,255,0.06); color:#cbd5e1; font-size:11px; font-weight:800; white-space:nowrap; }
        .consultant-name { color:var(--accent-cyan); font-weight:800; }

        .client-source-badge { display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:900;white-space:nowrap;border:1px solid currentColor; }
        .client-source-badge.master { color:#60a5fa;background:rgba(59,130,246,.10); }
        .client-source-badge.partner { color:#facc15;background:rgba(250,204,21,.10); }
        .client-source-badge.consultant { color:#34d399;background:rgba(52,211,153,.10); }
        .client-source-badge.submaster { color:#67e8f9;background:rgba(34,211,238,.10); }
        .client-source-badge.freelancer { color:#c084fc;background:rgba(168,85,247,.10); }
        .source-summary-strip { display:none;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 12px;padding:10px 12px;border-radius:12px;background:rgba(15,23,42,.70);border:1px solid rgba(148,163,184,.18); }
        .source-summary-strip.visible { display:flex; }
        .source-summary-chip { padding:6px 10px;border-radius:999px;font-size:11px;font-weight:900;border:1px solid rgba(148,163,184,.25);color:#cbd5e1; }
        .source-summary-chip[hidden] { display:none !important; }
        @media (max-width:700px) { .company-title-left {align-items:flex-start;flex-wrap:wrap;} .client-source-badge{font-size:9px;} }

        .toolbar-row { display:flex; gap:8px; flex-wrap:wrap; }
        .btn-consultant-manage, .btn-history {
            border:1px solid rgba(34,211,238,0.35);
            background:rgba(34,211,238,0.10);
            color:var(--accent-cyan);
            padding:9px 12px;
            border-radius:8px;
            font-size:12px;
            font-weight:900;
            cursor:pointer;
        }
        .btn-history {
            border-color:rgba(192,132,252,0.35);
            background:rgba(192,132,252,0.10);
            color:var(--accent-purple);
        }

        .agency-control {
            width:100%;
            min-width:185px;
            display:flex;
            flex-direction:column;
            gap:7px;
        }
        .agency-recommendation {
            display:flex;
            align-items:center;
            justify-content:space-between;
            gap:7px;
            padding:7px 9px;
            border-radius:8px;
            background:rgba(192,132,252,.08);
            border:1px solid rgba(192,132,252,.20);
        }
        .agency-recommendation-label {
            color:#cbd5e1;
            font-size:10px;
            font-weight:800;
            white-space:nowrap;
        }
        .agency-actual-label {
            color:#22d3ee;
            font-size:10px;
            font-weight:900;
            margin-bottom:2px;
        }
        .agency-select {
            width:100%;
            box-sizing:border-box;
            padding:9px 10px;
            border-radius:8px;
            border:1px solid rgba(34,211,238,.42);
            background:#111827;
            color:#ffffff;
            font-size:12px;
            font-weight:900;
            outline:none;
            cursor:pointer;
        }
        .agency-select:focus {
            border-color:#22d3ee;
            box-shadow:0 0 0 3px rgba(34,211,238,.12);
        }
        .agency-select:disabled {
            opacity:.58;
            cursor:wait;
        }
        .actual-loan-box {
            margin-top:10px;
            padding-top:10px;
            border-top:1px dashed rgba(255,255,255,.14);
        }
        .actual-loan-label {
            color:#facc15;
            font-size:11px;
            font-weight:900;
            margin-bottom:6px;
        }
        .actual-loan-input-row {
            display:grid;
            grid-template-columns:minmax(0,1fr) 58px;
            border:1px solid rgba(250,204,21,.48);
            border-radius:9px;
            overflow:hidden;
            background:#111827;
        }
        .actual-loan-input {
            width:100%;
            min-width:0;
            box-sizing:border-box;
            padding:11px 12px;
            border:0;
            background:transparent;
            color:#ffffff;
            font-size:14px;
            font-weight:900;
            text-align:right;
            outline:none;
        }
        .actual-loan-input::placeholder {
            color:#64748b;
            font-weight:700;
        }
        .actual-loan-input-row:focus-within {
            border-color:#facc15;
            box-shadow:0 0 0 3px rgba(250,204,21,.12);
        }
        .actual-loan-input:disabled {
            opacity:.58;
            cursor:wait;
        }
        .actual-loan-unit {
            display:flex;
            align-items:center;
            justify-content:center;
            border-left:1px solid rgba(250,204,21,.26);
            background:rgba(250,204,21,.09);
            color:#fde68a;
            font-size:11px;
            font-weight:900;
            white-space:nowrap;
        }
        .actual-loan-state {
            min-height:15px;
            margin-top:4px;
            color:#94a3b8;
            font-size:9px;
            text-align:right;
        }
        .actual-loan-state.saved { color:#34d399; }
        .actual-loan-state.error { color:#f87171; }

        .loan-result-grid {
            display:grid;
            grid-template-columns:repeat(2,minmax(0,1fr));
            gap:7px;
            margin-top:9px;
        }
        .loan-result-item {
            padding:8px 9px;
            border-radius:8px;
            background:rgba(15,23,42,.72);
            border:1px solid rgba(255,255,255,.08);
        }
        .loan-result-label {
            color:#94a3b8;
            font-size:9px;
            font-weight:800;
            margin-bottom:3px;
        }
        .loan-result-value {
            color:#ffffff;
            font-size:12px;
            font-weight:900;
            text-align:right;
        }
        .loan-result-value.rate { color:#34d399; }
        .loan-result-value.diff { color:#fbbf24; }
        .loan-result-value.over { color:#f87171; }
        .loan-last-update {
            margin-top:7px;
            padding:7px 9px;
            border-radius:8px;
            background:rgba(255,255,255,.035);
            color:#94a3b8;
            font-size:9px;
            line-height:1.55;
            text-align:right;
        }
        .loan-last-update strong {
            color:#cbd5e1;
            font-weight:900;
        }
        @media(max-width:760px) {
            .loan-result-grid { grid-template-columns:1fr; }
        }

        .agency-save-state {
            min-height:14px;
            color:#94a3b8;
            font-size:9px;
            text-align:right;
        }
        .agency-save-state.saved { color:#34d399; }
        .agency-save-state.error { color:#f87171; }

        .consultant-select {            min-width:130px;
            padding:8px 28px 8px 10px;
            border-radius:8px;
            background:#111827;
            color:white;
            border:1px solid rgba(34,211,238,0.35);
            font-weight:800;
            outline:none;
        }
        .history-panel {
            display:none;
            margin-top:10px;
            padding:12px;
            border-radius:10px;
            background:rgba(0,0,0,0.22);
            border:1px solid rgba(192,132,252,0.25);
        }
        .history-panel.open { display:block; }
        .history-item {
            display:flex;
            justify-content:space-between;
            gap:12px;
            padding:7px 0;
            border-bottom:1px dashed rgba(255,255,255,0.08);
            font-size:12px;
        }
        .history-item:last-child { border-bottom:none; }
        .modal-backdrop {
            display:none;
            position:fixed;
            inset:0;
            z-index:999999;
            background:rgba(0,0,0,0.72);
            align-items:center;
            justify-content:center;
            padding:20px;
        }
        .modal-backdrop.open { display:flex; }
        .consultant-modal {
            width:min(680px, 96vw);
            max-height:85vh;
            overflow:auto;
            background:var(--bg-panel);
            border:1px solid rgba(34,211,238,0.25);
            border-radius:16px;
            padding:20px;
            box-shadow:0 20px 70px rgba(0,0,0,0.55);
        }
        .modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
        .modal-header h3 { margin:0; color:var(--accent-cyan); }
        .modal-close { background:transparent; color:white; border:none; font-size:24px; cursor:pointer; }
        .consultant-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
        .consultant-form-grid input {
            width:100%;
            box-sizing:border-box;
            padding:11px;
            border-radius:8px;
            background:rgba(0,0,0,0.3);
            border:1px solid rgba(255,255,255,0.1);
            color:white;
        }
        .consultant-form-actions { display:flex; gap:8px; margin-top:10px; }
        .consultant-list { margin-top:18px; display:flex; flex-direction:column; gap:8px; }
        .consultant-row {
            display:grid;
            grid-template-columns:1.2fr 1fr 1.3fr auto;
            gap:8px;
            align-items:center;
            background:rgba(0,0,0,0.20);
            padding:10px;
            border-radius:10px;
        }
        .consultant-row input {
            width:100%;
            box-sizing:border-box;
            padding:8px;
            border-radius:7px;
            background:#111827;
            border:1px solid rgba(255,255,255,0.1);
            color:white;
        }
        .btn-save-sm, .btn-delete-sm {
            padding:8px 10px;
            border-radius:7px;
            cursor:pointer;
            font-weight:900;
            border:1px solid transparent;
        }
        .btn-save-sm { background:rgba(52,211,153,0.12); color:var(--accent-green); border-color:rgba(52,211,153,0.3); }
        .btn-delete-sm { background:rgba(248,113,113,0.12); color:var(--accent-red); border-color:rgba(248,113,113,0.3); }

        .crm-summary-alert { grid-column:1/-1; padding:14px 16px; border-radius:12px; border:1px solid rgba(248,113,113,.35); background:rgba(248,113,113,.08); display:flex; justify-content:space-between; align-items:center; font-weight:900; }
        .crm-summary-alert strong { color:#f87171; font-size:20px; }
        .consultant-dashboard {
            grid-column:1/-1;
            width:100%;
            min-width:0;
            display:grid;
            grid-template-columns:repeat(5,minmax(0,1fr));
            gap:11px;
            align-items:start;
        }
        .consultant-dashboard-card {
            min-width:0;
            border:1px solid rgba(34,211,238,.20);
            background:linear-gradient(155deg,rgba(15,23,42,.96),rgba(2,6,23,.84));
            border-radius:12px;
            padding:12px;
            box-shadow:0 8px 18px rgba(0,0,0,.16);
        }
        .consultant-dashboard-name {
            display:flex;
            align-items:center;
            min-height:24px;
            color:var(--accent-cyan);
            font-size:13px;
            font-weight:950;
            margin-bottom:9px;
            padding-bottom:8px;
            border-bottom:1px solid rgba(148,163,184,.14);
        }
        .consultant-dashboard-stats {
            display:grid;
            grid-template-columns:repeat(2,minmax(0,1fr));
            gap:6px;
            font-size:11px;
        }
        .consultant-dashboard-stat {
            min-width:0;
            min-height:30px;
            padding:6px 7px;
            background:rgba(255,255,255,.045);
            border:1px solid rgba(148,163,184,.08);
            border-radius:8px;
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:8px;
        }
        .consultant-dashboard-stat span {
            min-width:0;
            color:#cbd5e1;
            white-space:nowrap;
        }
        .consultant-dashboard-stat strong {
            flex:0 0 auto;
        }
        @media (max-width:1699px) {
            .consultant-dashboard { grid-template-columns:repeat(4,minmax(0,1fr)); }
        }
        @media (max-width:1399px) {
            .consultant-dashboard { grid-template-columns:repeat(3,minmax(0,1fr)); }
        }
        @media (max-width:999px) {
            .consultant-dashboard { grid-template-columns:repeat(2,minmax(0,1fr)); }
        }
        @media (max-width:599px) {
            html, body {
                width:100%;
                max-width:100%;
                overflow-x:hidden;
            }

            .main-content,
            .summary-container,
            .consultant-dashboard,
            .consultant-dashboard-card {
                width:100%;
                max-width:100%;
                min-width:0;
                box-sizing:border-box;
            }

            .consultant-dashboard {
                display:grid;
                grid-template-columns:1fr;
                grid-auto-flow:row;
                gap:10px;
                overflow:visible;
                padding:0;
            }

            .consultant-dashboard-card {
                padding:10px;
                border-radius:12px;
            }

            .consultant-dashboard-name {
                min-height:22px;
                margin-bottom:8px;
                padding-bottom:7px;
                font-size:13px;
            }

            .consultant-dashboard-stats {
                grid-template-columns:repeat(2,minmax(0,1fr));
                gap:6px;
                font-size:11px;
            }

            .consultant-dashboard-stat {
                min-height:31px;
                padding:6px 8px;
            }

            .consultant-performance-extra {
                grid-template-columns:repeat(4,minmax(0,1fr)) !important;
                gap:4px;
            }

            .consultant-performance-extra-item {
                min-width:0;
                font-size:8px;
                line-height:1.25;
                word-break:keep-all;
            }

            .consultant-performance-extra-item strong {
                display:block;
                margin-top:3px;
                font-size:10px;
                white-space:normal;
                word-break:break-word;
            }

            .consultant-performance-summary {
                grid-template-columns:repeat(2,minmax(0,1fr));
                width:100%;
                max-width:100%;
                padding:10px;
                gap:8px;
            }

            .consultant-performance-summary-card {
                padding:10px;
            }

            .consultant-performance-summary-value {
                font-size:15px;
            }

            #performance_dashboard_guide {
                width:100%;
                max-width:100%;
                box-sizing:border-box;
            }
        }
        .consultant-inline-row,.status-inline-row,.next-contact-row { width:100%; display:flex; justify-content:flex-end; align-items:center; gap:9px; flex-wrap:wrap; }
        .consultant-inline-label,.next-contact-label { color:var(--text-muted); font-size:12px; font-weight:800; }
        .recent-change-box { width:100%; margin-top:10px; padding:9px 11px; border-radius:9px; background:rgba(0,0,0,.18); text-align:right; font-size:11px; color:var(--text-muted); line-height:1.6; }
        .recent-change-box strong { display:block; color:var(--accent-cyan); font-size:12px; }
        .history-title { color:var(--accent-purple); font-weight:900; margin-bottom:8px; font-size:12px; }
        .history-item-left { display:flex; flex-direction:column; gap:3px; }
        .history-author { color:var(--text-muted); font-size:10px; }
        .memo-panel { width:100%; margin-top:12px; padding:12px; border-radius:10px; background:rgba(0,0,0,.18); border:1px solid rgba(52,211,153,.2); box-sizing:border-box; }
        .memo-title { color:var(--accent-green); font-weight:900; margin-bottom:10px; }
        .memo-input-row { display:grid; grid-template-columns:135px 1fr auto; gap:8px; align-items:start; }
        .memo-input-row input,.memo-input-row textarea,.next-contact-input { background:#111827; color:white; border:1px solid rgba(255,255,255,.12); border-radius:8px; padding:9px; box-sizing:border-box; outline:none; }
        .memo-input-row textarea { min-height:64px; resize:vertical; }
        .memo-save-btn { padding:10px 12px; border-radius:8px; border:1px solid rgba(52,211,153,.35); background:rgba(52,211,153,.12); color:var(--accent-green); font-weight:900; cursor:pointer; }
        .memo-list { margin-top:10px; display:flex; flex-direction:column; gap:7px; }
        .memo-item { display:grid; grid-template-columns:75px 1fr auto; gap:8px; align-items:start; padding:8px 0; border-bottom:1px dashed rgba(255,255,255,.08); font-size:12px; }
        .memo-date { color:var(--accent-gold); font-weight:900; }
        .memo-text { white-space:pre-wrap; color:#e2e8f0; }
.memo-item.partner .memo-text,
.memo-item.partner .history-author { color:#ffffff !important; }
.memo-item.consultant .memo-text,
.memo-item.consultant .history-author { color:var(--accent-green) !important; }
.memo-item.master .memo-text,
.memo-item.master .history-author { color:#ffffff !important; }
.memo-author-role { font-size:10px; font-weight:800; margin-left:5px; opacity:.9; }
        .memo-delete { border:none; background:transparent; color:var(--accent-red); cursor:pointer; font-weight:900; }
        .memo-pagination { display:flex; justify-content:center; align-items:center; gap:8px; margin-top:10px; }
        .memo-page-btn { min-width:54px; padding:6px 10px; border:1px solid rgba(96,165,250,.35); border-radius:8px; background:rgba(30,64,175,.16); color:#bfdbfe; font-size:11px; font-weight:900; cursor:pointer; }
        .memo-page-btn:disabled { opacity:.35; cursor:default; }
        .memo-page-info { color:var(--text-muted); font-size:11px; font-weight:800; }
        .next-contact-row { margin-top:10px; }
        .contact-overdue { color:#f87171; font-weight:900; padding:5px 8px; border-radius:999px; background:rgba(248,113,113,.1); }

        .contact-schedule-card {
            width:100%;
            margin-top:12px;
            padding:14px;
            border-radius:12px;
            background:rgba(59,130,246,0.08);
            border:1px solid rgba(59,130,246,0.24);
            box-sizing:border-box;
        }
        .contact-schedule-title {
            color:var(--accent-blue);
            font-weight:900;
            font-size:13px;
            margin-bottom:10px;
        }
        .contact-schedule-body {
            display:flex;
            justify-content:flex-end;
            align-items:center;
            gap:10px;
            flex-wrap:wrap;
        }
        .contact-calendar-button {
            width:74px;
            height:58px;
            border-radius:14px;
            border:2px solid rgba(255,255,255,0.85);
            background:#ffffff;
            color:#0f172a;
            display:inline-flex;
            align-items:center;
            justify-content:center;
            cursor:pointer;
            box-shadow:0 0 0 3px rgba(59,130,246,0.10), 0 8px 18px rgba(0,0,0,0.28);
            transition:transform .15s ease, box-shadow .15s ease;
            padding:0;
        }
        .contact-calendar-button:hover {
            transform:translateY(-1px) scale(1.03);
            box-shadow:0 0 0 4px rgba(59,130,246,0.18), 0 10px 22px rgba(0,0,0,0.34);
        }
        .contact-calendar-button:active {
            transform:scale(0.98);
        }
        .contact-calendar-icon {
            font-size:34px;
            line-height:1;
            filter:drop-shadow(0 1px 0 rgba(0,0,0,0.12));
        }
        .contact-calendar-hint {
            color:#e2e8f0;
            font-size:12px;
            font-weight:900;
            padding:7px 10px;
            border-radius:999px;
            border:1px dashed rgba(255,255,255,0.22);
            background:rgba(255,255,255,0.06);
            animation:calendarPulse 1.8s ease-in-out infinite;
        }
        @keyframes calendarPulse {
            0%,100% { opacity:.72; transform:translateX(0); }
            50% { opacity:1; transform:translateX(3px); }
        }
        .contact-date-display {
            min-width:120px;
            text-align:center;
            color:#ffffff;
            font-weight:900;
            font-size:13px;
            padding:8px 12px;
            border-radius:10px;
            background:rgba(15,23,42,0.72);
            border:1px solid rgba(255,255,255,0.12);
        }
        .custom-calendar-backdrop {
            display:none;
            position:fixed;
            inset:0;
            z-index:1000000;
            background:rgba(0,0,0,0.72);
            align-items:center;
            justify-content:center;
            padding:20px;
        }
        .custom-calendar-backdrop.open { display:flex; }
        .custom-calendar {
            width:min(380px, 94vw);
            background:#111827;
            border:1px solid rgba(255,255,255,0.16);
            border-radius:18px;
            box-shadow:0 24px 80px rgba(0,0,0,0.55);
            overflow:hidden;
        }
        .custom-calendar-header {
            display:flex;
            align-items:center;
            justify-content:space-between;
            gap:12px;
            padding:16px;
            background:#1e293b;
            border-bottom:1px solid rgba(255,255,255,0.08);
        }
        .custom-calendar-title {
            color:#ffffff;
            font-weight:900;
            font-size:16px;
        }
        .custom-calendar-nav {
            width:38px;
            height:38px;
            border-radius:10px;
            border:1px solid rgba(255,255,255,0.16);
            background:#0f172a;
            color:#ffffff;
            font-size:20px;
            cursor:pointer;
        }
        .custom-calendar-weekdays,
        .custom-calendar-days {
            display:grid;
            grid-template-columns:repeat(7, 1fr);
            gap:6px;
            padding:12px 14px 0;
        }
        .custom-calendar-weekdays div {
            text-align:center;
            font-size:11px;
            font-weight:900;
            color:#94a3b8;
            padding:5px 0;
        }
        .custom-calendar-days {
            padding-top:6px;
            padding-bottom:14px;
        }
        .custom-calendar-day {
            aspect-ratio:1;
            border:none;
            border-radius:10px;
            background:#0f172a;
            color:#e2e8f0;
            font-weight:900;
            cursor:pointer;
        }
        .custom-calendar-day:hover {
            background:#2563eb;
            color:#ffffff;
        }
        .custom-calendar-day.today {
            outline:2px solid #facc15;
        }
        .custom-calendar-day.selected {
            background:#3b82f6;
            color:#ffffff;
        }
        .custom-calendar-day.muted {
            opacity:0.28;
            cursor:default;
        }
        .custom-calendar-footer {
            display:flex;
            justify-content:flex-end;
            gap:8px;
            padding:12px 14px 16px;
            border-top:1px solid rgba(255,255,255,0.08);
        }
        .custom-calendar-time-row {
            display:grid;
            grid-template-columns:auto minmax(0,1fr) auto;
            align-items:center;
            gap:10px;
            padding:13px 14px;
            border-top:1px solid rgba(255,255,255,0.08);
            background:rgba(15,23,42,.72);
        }
        .custom-calendar-time-label {
            color:#cbd5e1;
            font-size:12px;
            font-weight:900;
        }
        .custom-calendar-time-input {
            min-width:0;
            padding:9px 11px;
            border-radius:9px;
            border:1px solid rgba(96,165,250,.38);
            background:#0f172a;
            color:#fff;
            font-weight:900;
            color-scheme:dark;
        }
        .custom-calendar-action {
            padding:9px 13px;
            border-radius:9px;
            border:1px solid rgba(255,255,255,0.14);
            background:#0f172a;
            color:#ffffff;
            font-weight:900;
            cursor:pointer;
        }

        .crm-toast {
            position:fixed;
            right:24px;
            bottom:28px;
            z-index:1000002;
            min-width:220px;
            padding:13px 16px;
            border-radius:12px;
            background:#0f172a;
            border:1px solid rgba(52,211,153,0.45);
            color:#ffffff;
            font-weight:900;
            box-shadow:0 18px 50px rgba(0,0,0,0.45);
            opacity:0;
            transform:translateY(12px);
            pointer-events:none;
            transition:opacity .2s ease, transform .2s ease;
        }
        .crm-toast.show {
            opacity:1;
            transform:translateY(0);
        }
        .custom-calendar-action.primary {
            background:#2563eb;
            border-color:#3b82f6;
        }
        .contact-state {
            padding:6px 10px;
            border-radius:999px;
            font-size:11px;
            font-weight:900;
            white-space:nowrap;
        }
        .contact-state.future { color:#34d399; background:rgba(52,211,153,0.10); }
        .contact-state.today { color:#facc15; background:rgba(250,204,21,0.10); }
        .contact-state.overdue { color:#f87171; background:rgba(248,113,113,0.10); }
        .memo-compose {
            display:grid;
            grid-template-columns:1fr auto;
            gap:8px;
            align-items:start;
        }
        .memo-compose textarea {
            width:100%;
            min-height:72px;
            resize:vertical;
            background:#111827;
            color:white;
            border:1px solid rgba(255,255,255,0.12);
            border-radius:8px;
            padding:10px;
            box-sizing:border-box;
        }
        .memo-meta-hint {
            margin-top:7px;
            color:var(--text-muted);
            font-size:11px;
        }


        .partner-selector-wrap{position:relative;margin-bottom:10px;z-index:70}
        .partner-selector-button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;border-radius:11px;border:1px solid rgba(250,204,21,.32);background:rgba(250,204,21,.08);color:#fff;font-size:13px;font-weight:900;cursor:pointer;text-align:left}
        .partner-selector-button:hover{border-color:#facc15;background:rgba(250,204,21,.13)}
        .partner-selector-main{display:flex;align-items:center;gap:10px;min-width:0}
        .partner-selector-icon{font-size:20px}
        .partner-selector-text{display:flex;flex-direction:column;gap:2px;min-width:0}
        .partner-selector-label{color:#fde68a;font-size:10px;font-weight:800}
        .partner-selector-name{color:#fff;font-size:14px;font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
        .partner-selector-arrow{color:#facc15;font-size:16px;transition:transform .15s ease}
        .partner-selector-wrap.open .partner-selector-arrow{transform:rotate(180deg)}
        .partner-selector-menu{display:none;position:absolute;left:0;right:0;top:calc(100% + 6px);max-height:310px;overflow:auto;padding:7px;border-radius:12px;border:1px solid rgba(96,165,250,.30);background:#0f172a;box-shadow:0 20px 50px rgba(0,0,0,.50)}
        .partner-selector-wrap.open .partner-selector-menu{display:block}
        .partner-selector-option{width:100%;display:flex;align-items:center;gap:10px;padding:11px 12px;border:none;border-radius:9px;background:transparent;color:#e2e8f0;font-size:13px;font-weight:800;cursor:pointer;text-align:left}
        .partner-selector-option:hover{background:rgba(59,130,246,.16);color:#fff}
        .partner-selector-option.active{background:rgba(59,130,246,.26);color:#fff;outline:1px solid rgba(96,165,250,.55)}
        .partner-selector-option small{margin-left:auto;color:#94a3b8;font-size:10px}
        #partner_db_selector{display:none!important}

        .partner-context-card {
            display:flex;
            align-items:center;
            justify-content:space-between;
            gap:12px;
            padding:12px 14px;
            border-radius:12px;
            border:1px solid rgba(250,204,21,0.28);
            background:rgba(250,204,21,0.08);
            margin-bottom:10px;
        }
        .partner-context-label {
            color:#fde68a;
            font-size:11px;
            font-weight:800;
        }
        .partner-context-name {
            color:#ffffff;
            font-size:15px;
            font-weight:900;
        }
        .partner-context-icon {
            font-size:24px;
        }

        .dashboard-toolbar {
            position:relative;
            z-index:50;
            display:flex;
            gap:8px;
            flex-wrap:wrap;
            align-items:center;
            pointer-events:auto;
        }
        .dashboard-toolbar button {
            position:relative;
            z-index:51;
            pointer-events:auto;
            touch-action:manipulation;
        }
        .btn-consultant-summary {
            border:1px solid rgba(96,165,250,0.35);
            background:rgba(59,130,246,0.12);
            color:#bfdbfe;
            padding:9px 12px;
            border-radius:8px;
            font-size:12px;
            font-weight:900;
            cursor:pointer;
        }
        .btn-consultant-summary.active {
            background:rgba(59,130,246,0.28);
            border-color:#60a5fa;
            color:#ffffff;
        }
        .master-storage-monitor { display:none; margin:12px 0; padding:16px; border:1px solid rgba(34,211,238,.28); border-radius:14px; background:linear-gradient(135deg,rgba(8,47,73,.72),rgba(15,23,42,.94)); }
        .master-storage-monitor.visible { display:block; }
        .storage-monitor-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
        .storage-monitor-title { color:#67e8f9; font-size:14px; font-weight:900; }
        .storage-monitor-sub { margin-top:4px; color:#94a3b8; font-size:10px; }
        .storage-refresh-btn { padding:8px 12px; border:1px solid rgba(34,211,238,.38); border-radius:8px; background:rgba(8,145,178,.16); color:#a5f3fc; font-size:11px; font-weight:900; cursor:pointer; }
        .storage-monitor-grid { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:9px; }
        .storage-monitor-card { padding:12px; border:1px solid rgba(255,255,255,.09); border-radius:11px; background:rgba(2,6,23,.44); }
        .storage-monitor-label { color:#94a3b8; font-size:10px; font-weight:800; }
        .storage-monitor-value { margin-top:5px; color:#f8fafc; font-size:18px; font-weight:900; }
        .storage-monitor-value.warning { color:#facc15; }
        .storage-monitor-value.danger { color:#fb7185; }
        .storage-usage-track { height:8px; margin-top:12px; overflow:hidden; border-radius:999px; background:#0f172a; }
        .storage-usage-bar { width:0; height:100%; border-radius:999px; background:#22c55e; transition:width .25s ease; }
        .storage-monitor-foot { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:9px; color:#94a3b8; font-size:10px; }
        .storage-monitor-error { color:#fca5a5; font-weight:800; }
        @media(max-width:900px){.storage-monitor-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}

        .work-dashboard {
            display:grid;
            grid-template-columns:repeat(4,minmax(150px,1fr));
            gap:10px;
            margin:12px 0;
        }
        .work-kpi-card {
            border:1px solid rgba(255,255,255,0.09);
            background:rgba(0,0,0,0.20);
            border-radius:12px;
            padding:14px;
        }
        .work-kpi-label {
            color:var(--text-muted);
            font-size:11px;
            font-weight:800;
            margin-bottom:7px;
        }
        .work-kpi-value {
            color:#ffffff;
            font-size:24px;
            font-weight:900;
        }
        .work-kpi-value.red { color:#f87171; }
        .work-kpi-value.yellow { color:#facc15; }
        .work-kpi-value.purple { color:#a78bfa; }
        .work-kpi-value.blue { color:#60a5fa; }

        .consultant-dashboard.hidden {
            display:none;
        }

        @media(max-width:1000px){
            .work-dashboard{grid-template-columns:repeat(2,1fr);}
        }
        @media(max-width:560px){
            .work-dashboard{grid-template-columns:1fr;}
        }


        .btn-system-diagnostic{display:none;border:1px solid rgba(34,211,238,.42);background:rgba(8,145,178,.12);color:#67e8f9;padding:9px 12px;border-radius:8px;font-size:12px;font-weight:900;cursor:pointer}
        .btn-system-diagnostic:hover{border-color:#22d3ee;background:rgba(8,145,178,.22)}
        .diag-backdrop{display:none;position:fixed;inset:0;z-index:1000100;background:rgba(0,0,0,.76);align-items:center;justify-content:center;padding:18px}
        .diag-backdrop.open{display:flex}
        .diag-modal{width:min(920px,96vw);max-height:92vh;overflow:auto;background:#111827;border:1px solid rgba(34,211,238,.30);border-radius:18px;box-shadow:0 24px 90px rgba(0,0,0,.65)}
        .diag-header{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 18px;background:#172033;border-bottom:1px solid rgba(255,255,255,.08)}
        .diag-title{color:#22d3ee;font-size:17px;font-weight:900}
        .diag-close{border:0;background:transparent;color:#fff;font-size:25px;cursor:pointer}
        .diag-body{padding:16px 18px 20px}
        .diag-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
        .diag-card{padding:12px;border-radius:11px;background:#0f172a;border:1px solid rgba(255,255,255,.08)}
        .diag-card-label{color:#94a3b8;font-size:10px;font-weight:800;margin-bottom:5px}
        .diag-card-value{color:#fff;font-size:13px;font-weight:900;overflow-wrap:anywhere}
        .diag-card-value.ok{color:#34d399}.diag-card-value.warn{color:#fbbf24}.diag-card-value.error{color:#f87171}
        .diag-section{margin-top:15px;padding:14px;border-radius:12px;background:rgba(15,23,42,.62);border:1px solid rgba(255,255,255,.08)}
        .diag-section-title{color:#e2e8f0;font-size:13px;font-weight:900;margin-bottom:10px}
        .diag-actions{display:flex;flex-wrap:wrap;gap:8px}
        .diag-action{border:1px solid rgba(96,165,250,.32);background:rgba(59,130,246,.12);color:#bfdbfe;padding:9px 11px;border-radius:8px;font-size:11px;font-weight:900;cursor:pointer}
        .diag-action.danger{border-color:rgba(248,113,113,.34);background:rgba(239,68,68,.10);color:#fca5a5}
        .diag-log{max-height:140px;overflow:auto;padding:10px;border-radius:9px;background:#090f1d;color:#cbd5e1;font-family:monospace;font-size:10px;white-space:pre-wrap;overflow-wrap:anywhere}
        .diag-test-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
        .diag-test-item{display:flex;align-items:center;gap:8px;padding:8px 9px;border-radius:8px;background:#0b1220;border:1px solid rgba(255,255,255,.06);color:#cbd5e1;font-size:11px;font-weight:800}
        .diag-test-item.pass{border-color:rgba(52,211,153,.28);color:#6ee7b7}.diag-test-item.fail{border-color:rgba(248,113,113,.30);color:#fca5a5}
        .diag-test-icon{width:18px;text-align:center}
        @media(max-width:760px){.diag-grid{grid-template-columns:1fr}.diag-test-list{grid-template-columns:1fr}}

        .health-summary {
            display:grid;
            grid-template-columns:repeat(4,minmax(0,1fr));
            gap:9px;
            margin-top:14px;
        }
        .health-summary-card {
            padding:12px;
            border-radius:11px;
            background:#0b1220;
            border:1px solid rgba(255,255,255,.07);
            text-align:center;
        }
        .health-summary-label {
            color:#94a3b8;
            font-size:10px;
            font-weight:800;
            margin-bottom:4px;
        }
        .health-summary-value {
            color:#fff;
            font-size:21px;
            font-weight:900;
        }
        .health-summary-value.pass { color:#34d399; }
        .health-summary-value.fail { color:#f87171; }
        .health-summary-value.time { color:#60a5fa; }
        .health-status-banner {
            margin-top:12px;
            padding:14px;
            border-radius:11px;
            text-align:center;
            font-size:15px;
            font-weight:900;
            border:1px solid rgba(255,255,255,.08);
            background:#0b1220;
            color:#cbd5e1;
        }
        .health-status-banner.ok {
            border-color:rgba(52,211,153,.35);
            background:rgba(16,185,129,.10);
            color:#6ee7b7;
        }
        .health-status-banner.warn {
            border-color:rgba(251,191,36,.35);
            background:rgba(245,158,11,.10);
            color:#fde68a;
        }
        .health-status-banner.fail {
            border-color:rgba(248,113,113,.38);
            background:rgba(239,68,68,.10);
            color:#fca5a5;
        }
        .health-progress {
            height:10px;
            margin-top:12px;
            border-radius:999px;
            overflow:hidden;
            background:#0b1220;
            border:1px solid rgba(255,255,255,.07);
        }
        .health-progress-bar {
            height:100%;
            width:0%;
            background:linear-gradient(90deg,#22c55e,#06b6d4);
            transition:width .3s ease;
        }
        .diag-test-detail {
            margin-left:auto;
            color:#94a3b8;
            font-size:9px;
            font-weight:700;
            text-align:right;
        }
        .diag-test-item.running {
            border-color:rgba(96,165,250,.30);
            color:#93c5fd;
        }
        @media(max-width:760px) {
            .health-summary { grid-template-columns:repeat(2,1fr); }
        }
        @media(max-width:768px){ .memo-input-row{grid-template-columns:1fr;} }

        @media(max-width:768px){
            .consultant-form-grid { grid-template-columns:1fr; }
            .consultant-row { grid-template-columns:1fr; }
        }

        .action-buttons { display: flex; gap: 10px; justify-content: center; width: 100%; }
        .btn-sm-tax { background: rgba(52, 211, 153, 0.1); color: var(--accent-green); border: 1px solid rgba(52, 211, 153, 0.3); padding: 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: bold; flex: 1; text-align: center; display: flex; justify-content: center; align-items: center; gap: 5px; transition: 0.2s; }
        .btn-sm-tax:hover { background: var(--accent-green); color: white; }
        .btn-sm-del { background: rgba(248, 113, 113, 0.1); color: var(--accent-red); border: 1px solid rgba(248, 113, 113, 0.3); padding: 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: bold; flex: 1; text-align: center; display: flex; justify-content: center; align-items: center; gap: 5px; transition: 0.2s; }
        .btn-sm-del:hover { background: var(--accent-red); color: white; }

        .empty-state { text-align: center; padding: 40px 20px !important; color: var(--text-muted) !important; font-size: 14px !important; background: var(--bg-panel); border-radius: 16px; border: 1px dashed rgba(255,255,255,0.1); justify-content: center !important; }
        .empty-state::before { display: none !important; }

        .pagination-panel { display: flex; justify-content: center; gap: 8px; padding: 20px 0 10px 0; flex-wrap: wrap; }
        .page-btn { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: bold; transition: 0.2s; cursor: pointer; }
        .page-btn.active { background: var(--accent-blue); color: white; border-color: var(--accent-blue); box-shadow: 0 4px 10px rgba(96, 165, 250, 0.4); }

        /* 🚨 PC/모바일 메뉴 텍스트 반응형 전환 로직 */
        .nav-text-mobile { display: none; }
        @media (max-width: 768px) {
            .nav-text-pc { display: none !important; }
            .nav-text-mobile { display: block !important; }
        }
    
.activity-history-loading,
        .activity-history-empty {
            padding:12px;
            color:#94a3b8;
            font-size:11px;
            text-align:center;
        }
        .activity-history-section {
            margin-top:10px;
            padding-top:9px;
            border-top:1px dashed rgba(148,163,184,.20);
        }
        .activity-history-heading {
            display:flex;
            align-items:center;
            justify-content:space-between;
            gap:8px;
            margin-bottom:7px;
            color:#cbd5e1;
            font-size:11px;
            font-weight:900;
        }
        .activity-history-count {
            color:#67e8f9;
            font-size:10px;
        }
        .activity-history-item {
            display:flex;
            justify-content:space-between;
            gap:12px;
            padding:8px 0;
            border-bottom:1px solid rgba(148,163,184,.10);
            font-size:11px;
        }
        .activity-history-item:last-child { border-bottom:none; }
        .activity-history-main {
            min-width:0;
            display:flex;
            flex-direction:column;
            gap:3px;
        }
        .activity-history-title {
            color:#e2e8f0;
            font-weight:900;
            word-break:break-word;
        }
        .activity-history-actor {
            color:#94a3b8;
            font-size:10px;
        }
        .activity-history-time {
            flex:0 0 auto;
            color:#64748b;
            font-size:10px;
            text-align:right;
        }

        .consultant-performance-summary {
            grid-column:1/-1;
            width:100%;
            min-width:0;
            display:grid;
            grid-template-columns:repeat(4,minmax(0,1fr));
            gap:12px;
            margin:0 0 4px;
            padding:14px;
            box-sizing:border-box;
            border-radius:14px;
            border:1px solid rgba(96,165,250,.18);
            background:rgba(15,23,42,.72);
        }
        .consultant-performance-summary-card {
            min-width:0;
            padding:14px;
            border-radius:11px;
            background:rgba(2,6,23,.58);
            border:1px solid rgba(148,163,184,.14);
        }
        .consultant-performance-summary-label {
            font-size:10px;
            color:#94a3b8;
            font-weight:800;
            margin-bottom:5px;
        }
        .consultant-performance-summary-value {
            font-size:18px;
            color:#f8fafc;
            font-weight:950;
        }
        .consultant-performance-rank {
            display:inline-flex;
            min-width:24px;
            height:24px;
            align-items:center;
            justify-content:center;
            margin-right:7px;
            border-radius:999px;
            background:rgba(59,130,246,.15);
            color:#93c5fd;
            font-size:11px;
            font-weight:950;
        }
        .consultant-performance-extra {
            display:grid;
            grid-template-columns:repeat(2,minmax(0,1fr));
            gap:6px;
            margin-top:7px;
            padding-top:7px;
            border-top:1px dashed rgba(148,163,184,.15);
        }
        .consultant-performance-extra-item {
            min-width:0;
            font-size:10px;
            color:#94a3b8;
        }
        .consultant-performance-extra-item strong {
            display:block;
            margin-top:2px;
            color:#e2e8f0;
            font-size:12px;
        }
        .performance-alert {
            color:#fb7185 !important;
        }
        @media (max-width:900px) {
            .consultant-performance-summary,
            .consultant-performance-extra {
                grid-template-columns:repeat(2,minmax(0,1fr));
            }
        }
        @media (max-width:480px) {
            .consultant-performance-summary {
                grid-template-columns:repeat(2,minmax(0,1fr));
            }
            .consultant-performance-extra {
                grid-template-columns:repeat(2,minmax(0,1fr)) !important;
            }
            .consultant-performance-extra-item {
                padding:5px 4px;
                border-radius:7px;
                background:rgba(255,255,255,.025);
            }
        }

        .timeline-modal-backdrop {
            position:fixed; inset:0; z-index:1000000; display:none;
            align-items:center; justify-content:center; padding:22px;
            box-sizing:border-box; background:rgba(2,6,23,.82);
            backdrop-filter:blur(6px);
        }
        .timeline-modal-backdrop.open { display:flex; }
        .timeline-modal {
            width:min(860px,100%); max-height:min(820px,92vh);
            display:flex; flex-direction:column; overflow:hidden;
            border-radius:18px; border:1px solid rgba(34,211,238,.32);
            background:linear-gradient(160deg,#17233a,#0b1220);
            box-shadow:0 28px 80px rgba(0,0,0,.58);
        }
        .timeline-modal-header {
            display:flex; justify-content:space-between; align-items:flex-start;
            gap:16px; padding:18px 20px;
            border-bottom:1px solid rgba(148,163,184,.16);
            background:rgba(15,23,42,.72);
        }
        .timeline-modal-title { margin:0; color:#67e8f9; font-size:18px; font-weight:950; }
        .timeline-modal-subtitle { margin-top:5px; color:#94a3b8; font-size:11px; line-height:1.5; }
        .timeline-close-btn {
            flex:0 0 auto; width:34px; height:34px; border-radius:9px;
            border:1px solid rgba(248,113,113,.32);
            background:rgba(248,113,113,.09); color:#fda4af;
            font-size:20px; font-weight:900; cursor:pointer;
        }
        .timeline-summary {
            display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
            gap:9px; padding:14px 20px;
            border-bottom:1px solid rgba(148,163,184,.12);
        }
        .timeline-summary-card {
            min-width:0; padding:11px 12px; border-radius:10px;
            border:1px solid rgba(148,163,184,.12);
            background:rgba(2,6,23,.42);
        }
        .timeline-summary-label { color:#94a3b8; font-size:10px; font-weight:800; margin-bottom:5px; }
        .timeline-summary-value { color:#f8fafc; font-size:14px; font-weight:950; word-break:break-word; }
        .timeline-body { overflow-y:auto; padding:18px 20px 24px; }
        .customer-timeline { position:relative; padding-left:28px; }
        .customer-timeline::before {
            content:''; position:absolute; top:8px; bottom:8px; left:9px;
            width:2px; border-radius:999px;
            background:linear-gradient(#22d3ee,rgba(96,165,250,.20));
        }
        .timeline-item {
            position:relative; margin-bottom:13px; padding:13px 14px;
            border-radius:12px; border:1px solid rgba(148,163,184,.13);
            background:rgba(15,23,42,.68);
        }
        .timeline-item:last-child { margin-bottom:0; }
        .timeline-dot {
            position:absolute; left:-26px; top:17px; width:11px; height:11px;
            border-radius:50%; border:3px solid #0f172a;
            box-shadow:0 0 0 1px rgba(34,211,238,.45); background:#22d3ee;
        }
        .timeline-item.status .timeline-dot { background:#8b5cf6; }
        .timeline-item.assignment .timeline-dot { background:#38bdf8; }
        .timeline-item.memo .timeline-dot { background:#34d399; }
        .timeline-item.contact .timeline-dot { background:#facc15; }
        .timeline-item.loan .timeline-dot { background:#fb923c; }
        .timeline-item.created .timeline-dot { background:#cbd5e1; }
        .timeline-item-head {
            display:flex; justify-content:space-between; align-items:flex-start;
            gap:12px; margin-bottom:6px;
        }
        .timeline-item-title { color:#e2e8f0; font-size:12px; font-weight:950; }
        .timeline-item-time { flex:0 0 auto; color:#64748b; font-size:10px; text-align:right; }
        .timeline-item-description {
            color:#cbd5e1; font-size:12px; line-height:1.6; word-break:break-word;
        }
        .timeline-item-actor { margin-top:7px; color:#64748b; font-size:10px; }
        .timeline-empty,.timeline-loading,.timeline-error {
            padding:36px 15px; text-align:center; color:#94a3b8; font-size:12px;
        }
        .timeline-error { color:#fda4af; }
        @media (max-width:720px) {
            .timeline-modal-backdrop { padding:8px; align-items:flex-end; }
            .timeline-modal { width:100%; max-height:94vh; border-radius:16px 16px 0 0; }
            .timeline-summary { grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; }
            .timeline-modal-header { padding:15px; }
            .timeline-body { padding:15px 13px 22px; }
        }

        .btn-notification-center {
            position:relative;
            display:inline-flex;
            align-items:center;
            gap:7px;
            padding:9px 12px;
            border-radius:9px;
            border:1px solid rgba(251,191,36,.38);
            background:rgba(251,191,36,.08);
            color:#fde68a;
            font-weight:900;
            cursor:pointer;
        }
        .notification-badge {
            display:none;
            min-width:18px;
            height:18px;
            padding:0 5px;
            align-items:center;
            justify-content:center;
            border-radius:999px;
            background:#ef4444;
            color:#fff;
            font-size:10px;
            font-weight:950;
            box-shadow:0 0 0 2px #0f172a;
        }
        .notification-badge.show { display:inline-flex; }
        .notification-modal-backdrop {
            position:fixed;
            inset:0;
            z-index:1000005;
            display:none;
            align-items:center;
            justify-content:center;
            padding:20px;
            box-sizing:border-box;
            background:rgba(2,6,23,.84);
            backdrop-filter:blur(6px);
        }
        .notification-modal-backdrop.open { display:flex; }
        .notification-modal {
            width:min(940px,100%);
            max-height:min(820px,92vh);
            display:flex;
            flex-direction:column;
            overflow:hidden;
            border-radius:18px;
            border:1px solid rgba(251,191,36,.28);
            background:linear-gradient(155deg,#17233a,#0b1220);
            box-shadow:0 30px 90px rgba(0,0,0,.60);
        }
        .notification-modal-header {
            display:flex;
            align-items:flex-start;
            justify-content:space-between;
            gap:16px;
            padding:18px 20px;
            border-bottom:1px solid rgba(148,163,184,.14);
        }
        .notification-modal-title {
            margin:0;
            color:#fde68a;
            font-size:18px;
            font-weight:950;
        }
        .notification-modal-subtitle {
            margin-top:5px;
            color:#94a3b8;
            font-size:11px;
        }
        .notification-close {
            width:34px;
            height:34px;
            border-radius:9px;
            border:1px solid rgba(248,113,113,.30);
            background:rgba(248,113,113,.08);
            color:#fda4af;
            font-size:20px;
            font-weight:900;
            cursor:pointer;
        }
        .notification-summary-grid {
            display:grid;
            grid-template-columns:repeat(auto-fit,minmax(105px,1fr));
            gap:8px;
            padding:14px 20px;
            border-bottom:1px solid rgba(148,163,184,.12);
        }
        .notification-summary-card {
            min-width:0;
            padding:10px;
            border-radius:10px;
            border:1px solid rgba(148,163,184,.12);
            background:rgba(2,6,23,.45);
            cursor:pointer;
        }
        .notification-summary-card:hover {
            border-color:rgba(34,211,238,.34);
            background:rgba(15,23,42,.80);
        }
        .notification-summary-label {
            color:#94a3b8;
            font-size:9px;
            font-weight:850;
            line-height:1.35;
        }
        .notification-summary-value {
            margin-top:5px;
            color:#f8fafc;
            font-size:18px;
            font-weight:950;
        }
        .notification-body {
            overflow-y:auto;
            padding:16px 20px 22px;
        }
        .notification-toolbar {
            display:flex;
            justify-content:space-between;
            align-items:center;
            gap:10px;
            margin-bottom:12px;
            color:#94a3b8;
            font-size:11px;
        }
        .notification-reset-btn {
            padding:7px 10px;
            border-radius:8px;
            border:1px solid rgba(96,165,250,.26);
            background:rgba(59,130,246,.08);
            color:#bfdbfe;
            font-size:10px;
            font-weight:900;
            cursor:pointer;
        }
        .notification-list {
            display:flex;
            flex-direction:column;
            gap:9px;
        }
        .crm-notification-pager-s365 {
            display:grid;
            grid-template-columns:minmax(0,1fr) auto auto auto auto;
            align-items:center;
            gap:10px;
            margin:10px 0;
            padding:10px 12px;
            border:1px solid rgba(96,165,250,.24);
            border-radius:10px;
            background:rgba(15,23,42,.62);
            color:#cbd5e1;
            font-size:11px;
        }
        .crm-notification-pager-s365 button,
        .crm-notification-pager-s365 select {
            min-height:34px;
            padding:6px 10px;
            border:1px solid rgba(96,165,250,.30);
            border-radius:8px;
            background:#10223a;
            color:#e2e8f0;
            font-size:11px;
            font-weight:850;
        }
        .crm-notification-pager-s365 button:not(:disabled) { cursor:pointer; }
        .crm-notification-pager-s365 button:disabled { opacity:.38; cursor:default; }
        .crm-notification-pager-s365 label { display:flex;align-items:center;gap:6px;white-space:nowrap; }
        .notification-item {
            display:grid;
            grid-template-columns:auto minmax(0,1fr) auto;
            gap:11px;
            align-items:center;
            padding:12px 13px;
            border-radius:11px;
            border:1px solid rgba(148,163,184,.12);
            background:rgba(15,23,42,.64);
            cursor:pointer;
        }
        .notification-item:hover {
            transform:translateY(-1px);
            border-color:rgba(34,211,238,.32);
        }
        .notification-icon {
            width:32px;
            height:32px;
            display:flex;
            align-items:center;
            justify-content:center;
            border-radius:9px;
            background:rgba(255,255,255,.05);
            font-size:16px;
        }
        .notification-main { min-width:0; }
        .notification-title {
            color:#e2e8f0;
            font-size:12px;
            font-weight:950;
        }
        .notification-description {
            margin-top:4px;
            color:#94a3b8;
            font-size:10px;
            line-height:1.45;
            word-break:break-word;
        }
        .notification-company {
            color:#67e8f9;
            font-weight:900;
        }
        .notification-priority {
            padding:5px 7px;
            border-radius:999px;
            font-size:9px;
            font-weight:950;
            white-space:nowrap;
        }
        .notification-priority.high {
            background:rgba(239,68,68,.12);
            color:#fda4af;
        }
        .notification-priority.medium {
            background:rgba(251,191,36,.12);
            color:#fde68a;
        }
        .notification-priority.low {
            background:rgba(59,130,246,.12);
            color:#bfdbfe;
        }
        .notification-empty {
            padding:40px 12px;
            text-align:center;
            color:#94a3b8;
            font-size:12px;
        }
        @media (max-width:900px) {
            .notification-summary-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
        }
        @media (max-width:560px) {
            .notification-modal-backdrop { padding:7px; align-items:flex-end; }
            .notification-modal {
                max-height:94vh;
                border-radius:16px 16px 0 0;
            }
            .notification-summary-grid {
                grid-template-columns:repeat(2,minmax(0,1fr));
                padding:11px;
            }
            .notification-modal-header { padding:15px; }
            .notification-body { padding:13px 11px 20px; }
            .notification-item { grid-template-columns:auto minmax(0,1fr); }
            .notification-priority {
                grid-column:2;
                justify-self:start;
            }
        }

        .consultant-work-banner {
            display:none; grid-column:1/-1; width:100%; box-sizing:border-box;
            margin:0 0 12px; padding:12px 14px; border-radius:12px;
            border:1px solid rgba(34,211,238,.22);
            background:linear-gradient(135deg,rgba(8,145,178,.13),rgba(59,130,246,.08));
            color:#cbd5e1; font-size:11px; line-height:1.55;
        }
        .consultant-work-banner strong { color:#67e8f9; font-size:12px; }
        body[data-account-role="consultant"] .consultant-work-banner { display:block; }
        .consultant-readonly-badge {
            display:inline-flex; align-items:center; gap:5px;
            padding:7px 10px; border-radius:8px;
            border:1px solid rgba(52,211,153,.24);
            background:rgba(52,211,153,.08);
            color:#6ee7b7; font-size:11px; font-weight:900;
        }

        .btn-assignment-history {
            display:inline-flex;
            align-items:center;
            gap:7px;
            padding:9px 12px;
            border-radius:9px;
            border:1px solid rgba(167,139,250,.34);
            background:rgba(139,92,246,.09);
            color:#ddd6fe;
            font-weight:900;
            cursor:pointer;
        }
        .assignment-history-backdrop {
            position:fixed;
            inset:0;
            z-index:1000008;
            display:none;
            align-items:center;
            justify-content:center;
            padding:18px;
            box-sizing:border-box;
            background:rgba(2,6,23,.88);
            backdrop-filter:blur(7px);
        }
        .assignment-history-backdrop.open { display:flex; }
        .assignment-history-modal {
            width:min(1120px,100%);
            max-height:92vh;
            overflow:hidden;
            display:flex;
            flex-direction:column;
            border-radius:18px;
            border:1px solid rgba(167,139,250,.28);
            background:linear-gradient(155deg,#17233a,#0a1120);
            box-shadow:0 30px 90px rgba(0,0,0,.62);
        }
        .assignment-history-header {
            display:flex;
            align-items:flex-start;
            justify-content:space-between;
            gap:16px;
            padding:18px 20px;
            border-bottom:1px solid rgba(148,163,184,.14);
        }
        .assignment-history-title {
            margin:0;
            color:#ddd6fe;
            font-size:18px;
            font-weight:950;
        }
        .assignment-history-subtitle {
            margin-top:5px;
            color:#94a3b8;
            font-size:11px;
            line-height:1.45;
        }
        .assignment-history-close {
            width:34px;
            height:34px;
            border-radius:9px;
            border:1px solid rgba(248,113,113,.30);
            background:rgba(248,113,113,.08);
            color:#fda4af;
            font-size:20px;
            font-weight:900;
            cursor:pointer;
        }
        .assignment-history-filters {
            display:grid;
            grid-template-columns:1.3fr repeat(2,minmax(150px,.7fr)) auto auto;
            gap:8px;
            padding:13px 20px;
            border-bottom:1px solid rgba(148,163,184,.12);
        }
        .assignment-history-input,
        .assignment-history-select {
            width:100%;
            min-width:0;
            box-sizing:border-box;
            padding:9px 10px;
            border-radius:9px;
            border:1px solid rgba(148,163,184,.18);
            background:rgba(2,6,23,.55);
            color:#e2e8f0;
            font-size:11px;
            outline:none;
        }
        .assignment-history-action {
            padding:9px 12px;
            border-radius:9px;
            border:1px solid rgba(34,211,238,.28);
            background:rgba(8,145,178,.09);
            color:#67e8f9;
            font-size:11px;
            font-weight:900;
            cursor:pointer;
            white-space:nowrap;
        }
        .assignment-history-body {
            overflow:auto;
            padding:14px 20px 22px;
        }
        .assignment-history-summary {
            display:grid;
            grid-template-columns:repeat(4,minmax(0,1fr));
            gap:8px;
            margin-bottom:12px;
        }
        .assignment-history-summary-card {
            padding:10px 12px;
            border-radius:10px;
            border:1px solid rgba(148,163,184,.12);
            background:rgba(2,6,23,.46);
        }
        .assignment-history-summary-label {
            color:#94a3b8;
            font-size:9px;
            font-weight:850;
        }
        .assignment-history-summary-value {
            margin-top:5px;
            color:#f8fafc;
            font-size:17px;
            font-weight:950;
        }
        .assignment-history-table-wrap {
            overflow:auto;
            border:1px solid rgba(148,163,184,.12);
            border-radius:12px;
        }
        .assignment-history-table {
            width:100%;
            min-width:920px;
            border-collapse:collapse;
        }
        .assignment-history-table th,
        .assignment-history-table td {
            padding:10px 11px;
            border-bottom:1px solid rgba(148,163,184,.10);
            text-align:left;
            font-size:10px;
            vertical-align:middle;
        }
        .assignment-history-table th {
            position:sticky;
            top:0;
            z-index:2;
            background:#111b2d;
            color:#94a3b8;
            font-weight:900;
        }
        .assignment-company {
            color:#67e8f9;
            font-weight:950;
        }
        .assignment-arrow {
            color:#fbbf24;
            font-weight:950;
        }
        .assignment-current-badge {
            display:inline-flex;
            padding:4px 7px;
            border-radius:999px;
            background:rgba(52,211,153,.10);
            color:#6ee7b7;
            font-size:9px;
            font-weight:900;
        }
        .assignment-history-empty {
            padding:36px 12px;
            text-align:center;
            color:#94a3b8;
            font-size:12px;
        }
        @media (max-width:820px) {
            .assignment-history-filters {
                grid-template-columns:1fr 1fr;
                padding:11px;
            }
            .assignment-history-filters .assignment-history-input {
                grid-column:1/-1;
            }
            .assignment-history-body { padding:12px 10px 20px; }
            .assignment-history-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
        }
        @media (max-width:560px) {
            .assignment-history-backdrop { padding:6px; align-items:flex-end; }
            .assignment-history-modal {
                max-height:95vh;
                border-radius:16px 16px 0 0;
            }
            .assignment-history-header { padding:14px; }
            .assignment-history-filters { grid-template-columns:1fr; }
            .assignment-history-filters .assignment-history-input { grid-column:auto; }
        }
