:root { color: #17201d; background: #f5f7f5; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-synthesis: none; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.auth-shell { align-items: center; background: radial-gradient(circle at 75% 15%, #dcefe6, transparent 35%), #f5f7f5; display: grid; min-height: 100dvh; padding: 28px; place-items: center; }
.login-card { background: #fff; border: 1px solid #e1e8e3; border-radius: 24px; box-shadow: 0 24px 80px #18352a14; max-width: 430px; padding: 34px; width: 100%; }
.brand-mark { align-items: center; background: #173c2f; border-radius: 13px; color: #d5f36c; display: flex; font-size: 1.05rem; font-weight: 900; height: 46px; justify-content: center; letter-spacing: -.08em; width: 46px; }
.brand-mark.small { border-radius: 9px; font-size: .8rem; height: 32px; width: 32px; }
.eyebrow { color: #718079; font-size: .68rem; font-weight: 800; letter-spacing: .13em; margin: 0 0 8px; }
.login-card h1, .topbar h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.065em; line-height: 1; margin: 0; }
.intro { color: #68756f; line-height: 1.6; margin: 0; }
form { display: grid; gap: 15px; margin-top: 24px; }
label { color: #51605a; display: grid; font-size: .78rem; font-weight: 750; gap: 7px; }
input, select, textarea { background: #f7f9f7; border: 1px solid #dce5df; border-radius: 10px; color: #17201d; min-height: 46px; outline: 0; padding: 11px 13px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { background: #fff; border-color: #8dbb55; box-shadow: 0 0 0 3px #dff0c5; }
.password-input { position: relative; }
.password-input input { padding-right: 60px; }
.password-input button { background: transparent; color: #597365; font-size: .75rem; font-weight: 800; min-height: 38px; padding: 5px; position: absolute; right: 6px; top: 4px; }
.primary-button { background: #173c2f; border-radius: 10px; color: #fff; font-weight: 800; min-height: 50px; padding: 13px 18px; }
.primary-button:hover { background: #235944; }
.secondary-button, .logout-button { background: #edf2ee; border-radius: 9px; color: #375449; font-weight: 750; min-height: 40px; padding: 9px 14px; }
.message { font-size: .86rem; font-weight: 700; min-height: 1.2em; }
.message.error { color: #bd4237; }
.message.success { color: #28754b; }
.crm-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: #173c2f; color: #eaf5ed; display: flex; flex-direction: column; min-height: 100dvh; padding: 25px 18px 20px; }
.side-brand { align-items: center; display: flex; font-size: .9rem; font-weight: 800; gap: 11px; letter-spacing: -.02em; padding: 0 8px; }
.main-nav { display: grid; gap: 6px; margin-top: 60px; }
.nav-item { align-items: center; background: transparent; border-radius: 9px; color: #a8c2b5; display: flex; font-size: .88rem; font-weight: 700; gap: 12px; min-height: 45px; padding: 10px 12px; text-align: left; }
.nav-item:hover, .nav-item.active { background: #285844; color: #fff; }
.nav-icon { color: #d5f36c; font-size: 1.25rem; line-height: 1; width: 20px; }
.sidebar-bottom { border-top: 1px solid #ffffff1c; display: grid; gap: 17px; margin-top: auto; padding: 20px 8px 0; }
.signed-user { align-items: center; display: flex; gap: 10px; min-width: 0; }
.avatar { align-items: center; background: #d5f36c; border-radius: 50%; color: #173c2f; display: flex; flex: 0 0 auto; font-size: .72rem; font-weight: 900; height: 34px; justify-content: center; width: 34px; }
.signed-user strong, .signed-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signed-user strong { font-size: .78rem; }
.signed-user small { color: #a8c2b5; font-size: .7rem; margin-top: 3px; }
.logout-button { background: #ffffff12; color: #d9e9df; font-size: .78rem; text-align: left; }
.workspace { min-width: 0; padding: 40px clamp(22px, 4vw, 70px) 70px; }
.topbar { align-items: flex-start; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.topbar h1 { font-size: clamp(2rem, 3vw, 3rem); margin: 4px 0 0; }
.topbar-actions { align-items: center; display: flex; gap: 13px; padding-top: 15px; }
.live-dot { color: #4d6a5a; font-size: .75rem; font-weight: 750; }
.live-dot::before { background: #83ba4e; border-radius: 50%; content: ''; display: inline-block; height: 7px; margin: 0 7px 1px 0; width: 7px; }
.stats-grid { display: grid; gap: 15px; grid-template-columns: repeat(4, 1fr); margin-bottom: 38px; }
.stat-card { background: #fff; border: 1px solid #e1e8e3; border-radius: 15px; display: grid; gap: 8px; min-height: 135px; padding: 20px; }
.stat-card.accent { background: #dff0c5; border-color: #dff0c5; }
.stat-label { color: #607168; font-size: .75rem; font-weight: 750; }
.stat-card strong { color: #173c2f; font-size: 2.25rem; letter-spacing: -.07em; line-height: 1; }
.stat-card small { color: #799087; font-size: .72rem; }
.stat-card.warning { background: #fff7e8; border-color: #f2dfb7; }
.stat-card.warning strong { color: #a8661c; }
.stat-card.success { background: #eef8e8; border-color: #d4e9c5; }
.stat-card.success strong { color: #3d7438; }
.dashboard-panel { display: grid; gap: 18px; }
.lark-dashboard-embed { background: #fff; border: 1px solid #e1e8e3; border-radius: 15px; min-height: 620px; overflow: hidden; }
.lark-dashboard-embed iframe { border: 0; display: block; height: min(78dvh, 900px); min-height: 620px; width: 100%; }
.dashboard-toolbar { align-items: end; display: flex; justify-content: space-between; gap: 20px; }
.dashboard-period-label { color: #304b3d; font-size: .92rem; font-weight: 800; margin: 0; }
.dashboard-periods { background: #eaf0eb; border-radius: 10px; display: flex; gap: 3px; padding: 4px; }
.dashboard-period { background: transparent; border-radius: 7px; color: #6d8075; font-size: .75rem; font-weight: 800; min-height: 34px; padding: 7px 12px; }
.dashboard-period:hover, .dashboard-period.active { background: #fff; box-shadow: 0 2px 8px #173c2f10; color: #173c2f; }
.dashboard-filters { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-filters select { background: #fff; font-size: .78rem; }
.dashboard-stats { grid-template-columns: repeat(4, 1fr); margin: 0; }
.dashboard-stats .stat-card { min-height: 125px; padding: 17px; }
.dashboard-stats .stat-card strong { font-size: 1.95rem; }
.dashboard-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { background: #fff; border: 1px solid #e1e8e3; border-radius: 15px; min-width: 0; padding: 20px; }
.chart-card-wide { grid-column: span 2; }
.chart-heading { align-items: start; display: flex; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.chart-heading h2 { color: #243d31; font-size: 1.05rem; letter-spacing: -.035em; margin: 0; }
.chart-note { color: #92a098; font-size: .7rem; padding-top: 2px; text-align: right; }
.chart-area { min-height: 250px; }
.chart-empty { align-items: center; color: #93a097; display: flex; font-size: .78rem; justify-content: center; min-height: 190px; text-align: center; }
.chart-legend { color: #75877c; display: flex; font-size: .7rem; gap: 17px; margin-bottom: 4px; }
.chart-legend span { align-items: center; display: inline-flex; gap: 6px; }
.legend-dot { border-radius: 50%; display: inline-block; height: 7px; width: 7px; }
.legend-dot.leads { background: #83ba4e; }
.legend-dot.followups { background: #173c2f; }
.trend-svg { display: block; height: 220px; overflow: visible; width: 100%; }
.trend-svg line { stroke: #e9efea; stroke-width: 1; }
.trend-svg text { fill: #93a098; font-size: 11px; }
.trend-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.trend-line.leads { stroke: #83ba4e; }
.trend-line.followups { stroke: #173c2f; }
.bar-list, .funnel-list { display: grid; gap: 15px; }
.bar-row { display: grid; gap: 7px; }
.bar-label { align-items: baseline; display: flex; font-size: .75rem; gap: 8px; justify-content: space-between; }
.bar-label strong { color: #385246; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label span { color: #89978f; flex: 0 0 auto; font-size: .68rem; }
.bar-track, .funnel-track { background: #edf2ed; border-radius: 20px; height: 8px; overflow: hidden; }
.bar-track svg, .funnel-track svg { display: block; height: 8px; width: 100%; }
.bar-track rect { fill: #6da644; }
.funnel-row { align-items: center; display: grid; gap: 10px; grid-template-columns: 54px minmax(0, 1fr) 38px; }
.funnel-level { color: #536b5c; font-size: .72rem; font-weight: 850; }
.funnel-track rect { fill: #4d8860; }
.funnel-row strong { color: #294636; font-size: .75rem; text-align: right; }
.sales-table-wrap { overflow-x: auto; }
.sales-table { border-collapse: collapse; min-width: 520px; width: 100%; }
.sales-table th { color: #91a098; font-size: .67rem; letter-spacing: .06em; padding: 0 12px 10px; text-align: left; text-transform: uppercase; }
.sales-table td { border-top: 1px solid #edf1ed; color: #4f6658; font-size: .78rem; padding: 12px; }
.sales-table td:first-child { color: #263f32; font-weight: 800; }
.sales-table td:last-child { color: #4c8a3f; }
.content-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.campaign-panel { min-width: 0; }
.campaign-heading { align-items: start; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.campaign-title-line { align-items: baseline; display: flex; gap: 10px; }
.campaign-title-line h2 { margin: 0; }
.campaign-count { color: #4d7837; font-size: .78rem; font-weight: 800; }
.campaign-heading .muted { margin: 0; }
.campaign-status { font-size: .7rem; margin-top: 4px !important; }
.campaign-actions { align-items: center; display: flex; gap: 13px; }
.campaign-tabs { border-bottom: 1px solid #dce5df; display: flex; gap: 5px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 0; scrollbar-width: thin; }
.campaign-tab { align-items: center; background: transparent; border-bottom: 2px solid transparent; color: #718079; display: inline-flex; flex: 0 0 auto; font-size: .78rem; font-weight: 800; gap: 8px; min-height: 42px; padding: 8px 12px; }
.campaign-tab:hover, .campaign-tab.active { border-bottom-color: #83ba4e; color: #173c2f; }
.campaign-tab-index { align-items: center; background: #edf2ee; border-radius: 50%; color: #6b7d72; display: inline-flex; font-size: .66rem; height: 22px; justify-content: center; width: 22px; }
.campaign-tab.active .campaign-tab-index { background: #d5f36c; color: #173c2f; }
.campaign-purpose { border-bottom: 1px solid #e1e8e3; margin-bottom: 14px; padding: 0 0 12px; }
.campaign-purpose-row { min-height: 36px; }
.campaign-description-trigger { background: transparent; color: #718079; display: block; font-size: .82rem; min-height: 36px; overflow: hidden; padding: 4px 0; text-align: left; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.campaign-description-trigger:hover { color: #173c2f; }
.campaign-description-trigger:focus-visible { border-radius: 4px; outline: 3px solid #dff0c5; outline-offset: 3px; }
.campaign-description { color: #41584b; font-size: .82rem; line-height: 1.55; margin: 0; max-width: 820px; white-space: pre-wrap; }
.campaign-description-trigger.campaign-description { white-space: nowrap; }
.campaign-description-form { align-items: center; display: flex; gap: 10px; margin: 0; }
.campaign-description-form input { background: transparent; border: 0; border-bottom: 1px solid #9fc76a; border-radius: 0; min-height: 36px; padding: 5px 0; }
.campaign-description-form input:focus { box-shadow: none; }
.campaign-description-form .message { font-size: .72rem; min-height: 0; }
.email-history-section { background: #fff; border: 1px solid #e1e8e3; border-radius: 12px; display: grid; gap: 12px; margin-top: 16px; padding: 14px; }
.email-history-section-head { align-items: center; display: flex; justify-content: space-between; }
.email-history-section-head strong { color: #243d31; font-size: .82rem; }
.campaign-email-history { display: grid; gap: 8px; }
.campaign-workspace { display: grid; gap: 28px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
dialog#campaignPancakeDialog, dialog#campaignEmailDialog { max-width: min(1400px, calc(100vw - 30px)); }
.campaign-marketing-layout { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 360px); }
.campaign-suggestions-sidebar { background: #fff; border: 1px solid #e1e8e3; border-radius: 11px; min-width: 0; overflow: hidden; }
.campaign-suggestions-sidebar .pancake-suggestions { max-height: 390px; overflow-y: auto; }
.campaign-suggestions-sidebar .suggestions-list { max-height: none; }
.campaign-email-composer { min-width: 0; }
@media (max-width: 760px) { .campaign-marketing-layout { grid-template-columns: 1fr; } .campaign-suggestions-sidebar { order: 2; } }
.campaign-list-column { min-width: 0; }
.campaign-list-heading { align-items: baseline; display: flex; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.campaign-list-heading .eyebrow { margin: 0; }
.campaign-list { max-height: min(72dvh, 2200px); }
.campaign-composer-tabs { border-bottom: 1px solid #e1e8e3; display: flex; gap: 4px; margin: -2px 0 2px; }
.campaign-composer-tab { background: transparent; border-bottom: 2px solid transparent; color: #718079; font-size: .74rem; font-weight: 800; min-height: 40px; padding: 8px 10px; }
.campaign-composer-tab:hover, .campaign-composer-tab.active { border-bottom-color: #70a92f; color: #365344; }
.campaign-composer-tab:focus-visible { border-radius: 4px; outline: 3px solid #dff0c5; outline-offset: 2px; }
#campaignPancakeComposer { display: grid; gap: 14px; }
.campaign-image-preview { align-items: center; background: #f7faf5; border: 1px solid #dce8d4; border-radius: 9px; display: flex; gap: 10px; padding: 8px 10px; }
.campaign-image-preview img { border-radius: 7px; height: 58px; object-fit: contain; width: 58px; }
.campaign-image-preview span { color: #55705f; font-size: .72rem; }
.email-history-row { background: #f7faf5; border: 1px solid #dce8d4; border-radius: 10px; display: grid; gap: 8px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; padding: 12px; }
@media (max-width: 760px) { .email-history-row { grid-template-columns: 1fr; } }
.email-history-row strong { color: #173c2f; font-size: .78rem; }
.email-history-row small { color: #62766b; display: block; font-size: .72rem; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-history-row div:nth-child(2) { display: grid; gap: 3px; }
.email-history-row div:nth-child(2) span { color: #62766b; font-size: .7rem; }
.email-history-status { align-items: center; display: flex; flex-direction: column; gap: 8px; justify-content: center; text-align: center; }
.email-history-status > :first-child { background: #edf4df; border-radius: 20px; color: #456b33; font-size: .66rem; font-weight: 800; padding: 4px 8px; }
.email-history-actions { display: flex; gap: 6px; }
.email-history-actions button { background: #fff; border: 1px solid #d4dfcd; border-radius: 7px; color: #456b33; font-size: .66rem; font-weight: 700; min-height: 30px; padding: 0 10px; }
.email-history-actions button:hover { background: #edf4df; }
.email-history-actions button:disabled { cursor: wait; opacity: .55; }
.lead-column, .detail-panel { min-width: 0; }
.section-title { align-items: end; display: flex; justify-content: space-between; margin-bottom: 17px; }
.section-title-actions { align-items: center; display: flex; gap: 12px; }
.section-title h2 { font-size: 1.35rem; letter-spacing: -.04em; margin: 0; }
.result-count { color: #87958d; font-size: .75rem; }
.period-tabs { border-bottom: 1px solid #dce5df; display: flex; gap: 4px; margin-bottom: 13px; overflow-x: auto; scrollbar-width: thin; }
.period-tab { background: transparent; border-bottom: 2px solid transparent; color: #77877e; flex: 0 0 auto; font-size: .76rem; font-weight: 800; min-height: 38px; padding: 7px 11px; }
.period-tab:hover, .period-tab.active { border-bottom-color: #83ba4e; color: #173c2f; }
.filters { display: grid; gap: 8px; grid-template-columns: minmax(210px, 1.7fr) repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 13px; }
.lead-dynamic-filters { display: contents; }
.search-field { align-items: center; background: #fff; border: 1px solid #e1e8e3; border-radius: 10px; display: flex; gap: 8px; padding-left: 12px; }
.search-field span { color: #7c8c83; font-size: 1.35rem; }
.search-field input { background: transparent; border: 0; min-height: 43px; padding-left: 0; }
.search-field input:focus { box-shadow: none; }
.filters select { background: #fff; font-size: .78rem; min-height: 45px; }
.lead-list { display: grid; gap: 8px; max-height: min(72dvh, 2200px); overflow: auto; overscroll-behavior: contain; padding: 0 5px 5px 0; scrollbar-gutter: stable; scrollbar-width: thin; }
.lead-list-more { color: #89968f; font-size: .72rem; padding: 10px; text-align: center; }
.lead-table-head, .lead-card { align-items: center; display: grid; gap: 13px; grid-template-columns: var(--lead-columns, minmax(190px, 1.7fr) minmax(105px, .85fr) 105px 90px 115px); }
.lead-table-head { color: #89968f; font-size: .68rem; font-weight: 800; letter-spacing: .06em; padding: 0 18px 7px; text-transform: uppercase; }
.lead-card { background: #fff; border: 1px solid #e1e8e3; border-radius: 13px; contain: layout paint; content-visibility: auto; contain-intrinsic-size: 72px; cursor: pointer; padding: 12px 18px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lead-card:hover, .lead-card.selected { border-color: #9fc76a; box-shadow: 0 8px 22px #173c2f0d; transform: translateY(-1px); }
.lead-name { align-items: center; display: flex; gap: 11px; min-width: 0; }
.lead-avatar { align-items: center; background: #edf4df; border-radius: 10px; color: #58773e; display: flex; flex: 0 0 auto; font-size: .78rem; font-weight: 900; height: 38px; justify-content: center; width: 38px; }
.lead-name strong, .lead-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-name strong { font-size: .9rem; }
.lead-list:not(.campaign-list) .lead-name { align-items: flex-start; }
.lead-list:not(.campaign-list) .lead-name strong { overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.lead-list:not(.campaign-list) .lead-name > div { min-width: 0; }
.lead-name small, .lead-sale, .lead-date { color: #819087; font-size: .73rem; margin-top: 4px; }
.lead-sale, .lead-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-level { min-width: 0; }
.level-pill { background: #f0f4ee; border-radius: 20px; color: #55705f; display: inline-block; font-size: .68rem; font-weight: 800; padding: 5px 8px; }
.empty-state, .empty-detail { color: #89968f; padding: 50px 20px; text-align: center; }
.error-state { color: #bd4237; }
.loading-state { align-items: center; color: #718079; display: flex; font-size: .82rem; gap: 10px; justify-content: center; min-height: 150px; }
.loading-spinner { animation: spin .8s linear infinite; border: 3px solid #dce8d7; border-radius: 50%; border-top-color: #6da644; height: 22px; width: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }
.detail-panel { background: #fff; border: 1px solid #e1e8e3; border-radius: 16px; min-height: 490px; }
.detail-panel-label { padding: 22px 25px 0; }
.detail-panel-label .eyebrow { margin-bottom: 0; }
.detail-view-tabs { border-bottom: 1px solid #e1e8e3; display: flex; gap: 5px; overflow-x: auto; }
.detail-view-tab { background: transparent; border-bottom: 2px solid transparent; color: #718079; font-size: .7rem; font-weight: 850; letter-spacing: .06em; min-height: 42px; padding: 8px 10px; white-space: nowrap; }
.detail-view-tab:hover, .detail-view-tab.active { border-bottom-color: #83ba4e; color: #173c2f; }
.detail-conversation-tab { align-items: center; display: inline-flex; gap: 6px; }
.detail-conversation-channel-icons { align-items: center; display: inline-flex; gap: 3px; margin-left: 2px; }
.detail-conversation-channel-icon .pancake-platform-icon { font-size: .62rem; height: 16px; width: 16px; }
.detail-tab-content { min-width: 0; }
.detail-content { padding: 25px; }
.detail-top { align-items: flex-start; display: flex; gap: 13px; justify-content: space-between; }
.detail-heading { display: flex; gap: 12px; min-width: 0; }
.detail-heading h2 { font-size: 1.5rem; letter-spacing: -.05em; margin: 0; overflow-wrap: anywhere; }
.detail-heading p { color: #76857c; font-size: .77rem; margin: 5px 0 0; }
.care-button { background: #d5f36c; border-radius: 9px; color: #173c2f; font-size: .76rem; font-weight: 850; padding: 11px 13px; white-space: nowrap; }
.campaign-care-cell { min-width: 0; }
.campaign-care-button { font-size: .68rem; min-height: 34px; padding: 7px 9px; }
.campaign-care-button.campaign-care-recontact, .care-button.care-button-recontact { background: #fff0b8; color: #765b19; }
.campaign-care-button.campaign-care-recontact:hover, .care-button.care-button-recontact:hover { background: #ffe79a; }
.care-button:hover { background: #c7e85b; }
.care-button:disabled { background: #eef2ef; color: #7b8b82; cursor: not-allowed; font-size: .7rem; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0; }
.detail-tag { background: #f1f5f1; border-radius: 7px; color: #5f7267; font-size: .7rem; font-weight: 750; padding: 7px 9px; }
.detail-section { border-top: 1px solid #e9eeea; padding: 18px 0 0; }
.detail-section + .detail-section { margin-top: 18px; }
.detail-section h3 { color: #63736a; font-size: .7rem; letter-spacing: .1em; margin: 0 0 10px; text-transform: uppercase; }
.detail-section p { color: #384b40; font-size: .82rem; line-height: 1.55; margin: 0; white-space: pre-wrap; }
.detail-facts { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.fact span { color: #8a9990; display: block; font-size: .68rem; margin-bottom: 4px; }
.fact strong { font-size: .79rem; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 0; }
.timeline-item { border-left: 2px solid #d5f36c; margin-left: 4px; padding: 0 0 17px 15px; position: relative; }
.timeline-item::before { background: #9fc76a; border: 3px solid #fff; border-radius: 50%; content: ''; height: 7px; left: -6px; position: absolute; top: 1px; width: 7px; }
.timeline-item strong { display: block; font-size: .78rem; }
.timeline-item small { color: #829087; display: block; font-size: .7rem; margin-top: 4px; }
.timeline-item p { font-size: .76rem; margin-top: 7px; }
.empty-icon { color: #bad18e; font-size: 3rem; }
.empty-detail h3 { color: #43564b; font-size: 1rem; margin: 10px 0 6px; }
.empty-detail p { font-size: .8rem; line-height: 1.5; margin: 0 auto; max-width: 230px; }
dialog { background: transparent; border: 0; max-width: min(680px, calc(100vw - 30px)); padding: 0; width: 100%; }
#careDialog { max-width: min(980px, calc(100vw - 30px)); }
#addLeadDialog { max-width: min(860px, calc(100vw - 30px)); }
dialog::backdrop { background: #10251e80; backdrop-filter: blur(3px); }
.care-form { background: #fff; border-radius: 18px; gap: 16px; margin: 0; max-height: 92dvh; overflow-y: auto; padding: 32px; }
.dialog-head { align-items: flex-start; display: flex; justify-content: space-between; }
.dialog-head h2 { font-size: 1.5rem; letter-spacing: -.05em; margin: 3px 0 0; }
.icon-button { background: #eef2ef; border-radius: 50%; color: #52655a; font-size: 1.35rem; height: 34px; width: 34px; }
.dialog-lead { background: #f1f6eb; border-radius: 8px; color: #55743d; font-size: .78rem; font-weight: 800; margin: 0; padding: 10px 12px; }
.form-two { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.lead-channel-hint { background: #f7faf5; border: 1px solid #dce8d4; border-radius: 10px; color: #55705f; display: grid; gap: 4px; padding: 11px 13px; }
.lead-channel-hint strong { color: #365344; font-size: .78rem; }
.lead-channel-hint span { font-size: .74rem; line-height: 1.45; }
#careContent, #careNote, #careInsight, #rejectionReason { min-height: 118px; resize: vertical; }
@media (max-width: 760px) { .content-grid, .campaign-workspace { grid-template-columns: 1fr; } .detail-panel { min-height: auto; } }
@media (max-width: 1180px) { .dashboard-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .crm-shell { display: block; } .sidebar { min-height: auto; padding: 14px 16px; } .main-nav { display: flex; gap: 4px; margin: 18px 0 0; overflow-x: auto; } .nav-item { flex: 0 0 auto; } .sidebar-bottom { align-items: center; border: 0; display: flex; justify-content: space-between; margin: 14px 0 0; padding: 0; } .workspace { padding: 28px 18px 50px; } .stats-grid, .dashboard-stats { grid-template-columns: repeat(2, 1fr); } .dashboard-grid { grid-template-columns: 1fr; } .chart-card-wide { grid-column: auto; } }
@media (max-width: 800px) { .lark-dashboard-embed iframe { height: 72dvh; min-height: 520px; } }
@media (max-width: 760px) { .lead-list { padding-bottom: 4px; } .lead-table-head, .lead-card { min-width: 680px; } .campaign-list .lead-table-head, .campaign-list .lead-card { min-width: 0; } }
@media (max-width: 590px) { .login-card { padding: 30px 23px; } .topbar { display: block; } .topbar-actions { justify-content: space-between; padding-top: 20px; } .dashboard-toolbar { align-items: start; display: block; } .dashboard-periods { margin-top: 13px; overflow-x: auto; width: max-content; max-width: 100%; } .dashboard-filters { grid-template-columns: 1fr; } .filters { grid-template-columns: 1fr 1fr; } .search-field { grid-column: 1 / -1; } .campaign-heading { display: block; } .campaign-actions { justify-content: space-between; margin-top: 17px; } .campaign-description-actions { align-items: stretch; flex-direction: column; } .campaign-description-actions .primary-button { width: 100%; } .lead-list { max-height: 70dvh; } .lead-table-head { display: none; } .lead-card { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; padding: 14px; } .lead-card > [data-label]::before { color: #9aa69f; content: attr(data-label); display: block; font-size: .62rem; font-weight: 800; margin-bottom: 3px; } .lead-name { grid-row: span 2; } .lead-sale, .lead-date, .lead-level { margin-top: 0; text-align: right; } .form-two { grid-template-columns: 1fr; } .care-form { padding: 21px; } }
.pancake-toolbar, .pancake-link-row { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; margin-bottom: 9px; }
.pancake-link-row { grid-template-columns: minmax(0, 1fr) auto; }
.pancake-toolbar select, .pancake-toolbar input, .pancake-link-row select { background: #f7f9f7; min-height: 40px; }
.pancake-toolbar .secondary-button:disabled, .pancake-link-row .secondary-button:disabled { cursor: wait; opacity: .65; }
.pancake-platform-tabs { display: flex; gap: 7px; margin-bottom: 10px; overflow-x: auto; }
.pancake-platform-tab { align-items: center; background: #f1f5f1; border: 1px solid transparent; border-radius: 9px; color: #5d7165; display: inline-flex; font-size: .72rem; font-weight: 800; gap: 5px; padding: 8px 10px; white-space: nowrap; }
.pancake-platform-tab.active { background: #173c2f; border-color: #173c2f; color: #fff; }
.pancake-open-tab { margin-left: auto; text-decoration: none; }
.pancake-open-tab:not(:disabled) { background: #edf4df; border-color: #dbe8ca; color: #55743d; }
.pancake-open-tab:disabled, .pancake-open-tab[aria-disabled="true"] { cursor: not-allowed; opacity: .5; }
.pancake-platform-tab .pancake-platform-icon { height: 19px; width: 19px; }
.pancake-link-status { align-items: center; color: #55705f; display: flex; font-size: .72rem; gap: 5px; margin: 0 0 9px; }
.pancake-link-status .pancake-platform-icon { height: 18px; width: 18px; }
.pancake-load-button { background: #1683e8; border: 1px solid #0d6fcb; color: #fff; font-weight: 850; margin-left: 5px; }
.pancake-load-button:hover { background: #0d6fcb; }
.pancake-load-button:disabled { background: #78b7ed; color: #fff; }
.pancake-linked { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.pancake-linked-button { background: #edf4df; border-radius: 8px; color: #55743d; font-size: .72rem; font-weight: 800; padding: 8px 10px; }
.pancake-linked-button.active { background: #173c2f; color: #fff; }
.pancake-thread { border: 1px solid #e1e8e3; border-radius: 11px; overflow: hidden; }
.pancake-thread-head { align-items: center; background: #f1f6eb; display: flex; justify-content: space-between; padding: 10px 12px; }
.pancake-thread-head strong { color: #365344; font-size: .78rem; }
.pancake-chat-layout { align-items: start; display: grid; gap: 12px; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .75fr); }
.pancake-chat-main { min-width: 0; }
.pancake-suggestions-column { background: #fff; border: 1px solid #e1e8e3; border-radius: 11px; min-width: 0; overflow: hidden; position: sticky; top: 10px; }
.pancake-suggestions-column-head { background: #f1f6eb; border-bottom: 1px solid #e1e8e3; display: grid; gap: 3px; padding: 11px 12px; }
.pancake-suggestions-column-head strong { color: #365344; font-size: .78rem; }
.pancake-suggestions-column-head .muted { font-size: .66rem; }
.pancake-suggestions-column .pancake-suggestions { max-height: min(70dvh, 680px); overflow-y: auto; }
.pancake-suggestions-column .suggestions-list { gap: 6px; max-height: none; }
.pancake-suggestions-column .suggestion-card { gap: 5px; padding: 6px 7px; }
.pancake-suggestions-column .suggestion-card-body { gap: 6px; }
.pancake-suggestions-column .suggestion-card strong { font-size: .7rem; }
.pancake-suggestions-column .suggestion-card span { font-size: .64rem; line-height: 1.25; }
.pancake-suggestions-column .suggestion-card-copy > span:last-child { max-height: 6.25em; }
.pancake-suggestions-column .suggestion-card .suggestion-code { font-size: .58rem; }
.pancake-suggestions-column .suggestion-thumbnail { padding: 3px; width: 62px; }
.pancake-suggestions-column .suggestion-thumbnail img { height: 54px; width: 54px; }
.pancake-suggestions-column .suggestion-thumbnail small { font-size: .52rem; }
.pancake-suggestions-column .suggestion-use-button { font-size: .64rem; min-height: 26px; padding: 0 8px; }
.pancake-chat-main .pancake-composer-tabs, .pancake-chat-main #pancakeSuggestions { display: none !important; }
.pancake-messages { display: grid; gap: 5px; max-height: min(58dvh, 620px); overflow-y: auto; padding: 9px 10px; }
.pancake-message { background: #f1f4f1; border-radius: 9px 9px 9px 2px; max-width: 94%; padding: 6px 8px; }
.pancake-message.staff { background: #e4f2ce; border-radius: 10px 10px 2px 10px; justify-self: end; }
.pancake-message small { color: #809087; display: block; font-size: .58rem; margin-bottom: 2px; }
.pancake-message.incoming small { color: #587066; }
.pancake-message.outgoing small { color: #55743d; }
.pancake-message p { color: #30483a; font-size: .7rem; line-height: 1.35; margin: 0; white-space: pre-wrap; }
.pancake-attachment { display: block; margin-bottom: 6px; }
.pancake-attachment img { border-radius: 8px; display: block; max-height: 220px; max-width: min(100%, 300px); object-fit: contain; }
.pancake-attachment-label { color: #55705f; display: block; font-size: .74rem; margin-bottom: 6px; }
.pancake-send { align-items: start; border-top: 1px solid #e9eeea; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; margin: 0; padding: 10px; }
.pancake-send-actions { align-self: center; align-items: stretch; display: flex; flex-direction: column; gap: 4px; width: 76px; }
.pancake-send-actions button { font-size: .68rem; min-height: 30px; padding: 6px 8px; }
.pancake-composer-tabs { border-bottom: 1px solid #e1e8e3; display: flex; gap: 4px; margin-top: 10px; padding: 0 10px; }
.pancake-composer-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: #718079; cursor: pointer; font-size: .74rem; font-weight: 800; padding: 8px 10px; }
.pancake-composer-tab.active { border-bottom-color: #70a92f; color: #365344; }
.pancake-suggestions { padding: 10px; }
.suggestions-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 8px; }
.suggestion-view-tabs { border-bottom: 1px solid #e1e8e3; display: flex; gap: 4px; margin: -2px 0 8px; overflow-x: auto; padding-bottom: 2px; }
.suggestion-view-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: #718079; cursor: pointer; font-size: .68rem; font-weight: 800; padding: 6px 8px; white-space: nowrap; }
.suggestion-view-tab.active { border-bottom-color: #70a92f; color: #365344; }
.suggestions-list { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.suggestion-card { background: #f7faf5; border: 1px solid #dce8d4; border-radius: 9px; display: grid; gap: 9px; padding: 9px 10px; text-align: left; }
.suggestion-card:hover { background: #edf5e6; border-color: #b8d49d; }
.suggestion-card-body { align-items: start; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; }
.suggestion-card-copy { display: grid; gap: 3px; min-width: 0; }
.suggestion-card strong { color: #365344; font-size: .76rem; }
.suggestion-card span { color: #718079; font-size: .7rem; line-height: 1.35; }
.suggestion-card-copy > span:last-child { max-height: 6.75em; overflow-y: auto; padding-right: 4px; }
.suggestion-card .suggestion-code { color: #70a92f; font-size: .64rem; font-weight: 800; letter-spacing: .04em; }
.suggestion-thumbnail { align-items: center; background: #fff; border: 1px solid #dce8d4; border-radius: 8px; display: grid; gap: 3px; justify-items: center; padding: 4px; width: 92px; }
.suggestion-thumbnail img { border-radius: 6px; display: block; height: 82px; max-width: 82px; object-fit: contain; width: 82px; }
.suggestion-thumbnail small { color: #718079; font-size: .6rem; }
.suggestion-use-button { justify-self: start; min-height: 30px; padding: 0 10px; }
.suggestion-card-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion-regenerate-button { min-height: 30px; padding: 0 10px; }
.pancake-suggestions-column .suggestion-card-actions { gap: 4px; }
.pancake-suggestions-column .suggestion-regenerate-button { font-size: .64rem; min-height: 26px; padding: 0 8px; }
.email-compose-field { display: grid; gap: 6px; margin-top: 12px; }
.email-compose-field input, .email-compose-field textarea { width: 100%; }
.email-compose-form { display: grid; gap: 4px; grid-column: 1 / -1; }
.email-compose-form .email-compose-field { grid-column: auto; }
.email-compose-form .primary-button { justify-self: start; margin-top: 6px; }
.pancake-send-fields { display: grid; gap: 7px; min-width: 0; }
.pancake-send textarea { font-size: .7rem; line-height: 1.35; min-height: 42px; resize: none; }
#campaignPancakeMessage { font-size: .72rem; line-height: 1.4; min-height: 360px; }
#pancakeMessage { height: 180px; min-height: 180px !important; }
.pancake-attachment-row { align-items: center; display: flex; gap: 8px; min-height: 30px; }
.pancake-image-preview { align-items: center; background: #f7faf5; border: 1px solid #dce8d4; border-radius: 7px; display: flex; gap: 6px; padding: 3px 6px 3px 3px; }
.pancake-image-preview img { border-radius: 5px; height: 34px; object-fit: cover; width: 34px; }
.pancake-image-preview span { color: #55705f; font-size: .66rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pancake-file-button { align-items: center; background: #edf4df; border: 1px solid #dbe8ca; border-radius: 7px; color: #55743d; cursor: pointer; display: inline-flex; font-size: .72rem; font-weight: 800; min-height: 32px; padding: 0 10px; }
.pancake-file-button:focus-within, .pancake-file-button:focus-visible { outline: 3px solid rgba(112, 169, 47, .3); outline-offset: 2px; }
.pancake-clear-image { font-size: .68rem; min-height: 30px; padding: 0 8px; }
@media (max-width: 590px) { .pancake-toolbar { grid-template-columns: 1fr; } .pancake-link-row, .pancake-send { grid-template-columns: 1fr; } .pancake-send-actions { width: 100%; } }
@media (max-width: 900px) { .pancake-chat-layout { grid-template-columns: 1fr; } .pancake-suggestions-column { position: static; } .pancake-suggestions-column .pancake-suggestions { max-height: 360px; } }

.settings-panel { max-width: 900px; }
#pancakeConfigPanel { display: grid; gap: 18px; grid-template-columns: minmax(0, .85fr) minmax(0, 1.1fr) minmax(0, 1.1fr); max-width: 1800px; }
.config-column { min-width: 0; }
.config-column-left { background: #fff; border: 1px solid #e1e8e3; border-radius: 12px; padding: 16px; }
.config-column-right { min-width: 0; }
.config-column-right #aiBoxConfigPanel { max-width: none; }
@media (max-width: 1200px) { #pancakeConfigPanel { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } #emailConfigPanel { grid-column: 2; grid-row: 1; } }
@media (max-width: 900px) { #pancakeConfigPanel { grid-template-columns: 1fr; } #emailConfigPanel { grid-column: auto; grid-row: auto; } }
.ai-box-config-form { background: #fff; border: 1px solid #e1e8e3; border-radius: 12px; margin-top: 16px; padding: 16px; }
.lark-env-section { border-top: 1px solid #e1e8e3; margin-top: 24px; padding-top: 8px; }
.display-config-toolbar { align-items: end; display: flex; gap: 14px; justify-content: space-between; margin-bottom: 16px; }
.display-config-toolbar label { color: #65766c; display: grid; font-size: .72rem; font-weight: 800; gap: 6px; max-width: 320px; width: 100%; }
.display-config-toolbar select { background: #fff; }
.display-config-editor { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.display-field-section { background: #fff; border: 1px solid #e1e8e3; border-radius: 12px; min-width: 0; padding: 15px; }
.display-field-section-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 10px; }
.display-field-section-head .eyebrow { margin-bottom: 3px; }
.display-field-list { display: grid; gap: 6px; }
.display-field-row { align-items: center; background: #f8faf8; border: 1px solid #e7eee8; border-radius: 8px; display: flex; gap: 8px; justify-content: space-between; min-height: 46px; padding: 7px 9px; }
.display-field-row.selected { background: #f0f7e8; border-color: #d4e7c1; }
.display-field-row[draggable="true"] { cursor: grab; }
.display-field-row.dragging { cursor: grabbing; opacity: .45; }
.display-field-row.fixed { background: #f1f4f1; }
.display-field-row label { align-items: center; display: flex; gap: 9px; min-width: 0; }
.display-drag-handle { color: #87958d; cursor: grab; font-size: 1rem; letter-spacing: 0; line-height: 1; user-select: none; }
.display-field-row label > span { min-width: 0; }
.display-field-row strong, .display-field-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.display-field-row strong { color: #385246; font-size: .78rem; }
.display-field-row small { color: #87958d; font-size: .67rem; margin-top: 2px; }
.display-field-row input { min-height: auto; width: auto; }
.display-field-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.display-move { border-radius: 7px; font-size: .8rem; height: 30px; padding: 0; width: 30px; }
.lead-extra { color: #718079; font-size: .73rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.display-settings-panel .config-dialog-actions { margin-top: 12px; }
.error-state, .message.error { color: #bd4237; }
.display-settings-panel .message { margin: 10px 0 0; }
@media (max-width: 900px) { .display-config-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 590px) { .display-config-toolbar { align-items: stretch; display: grid; } .display-config-toolbar label { max-width: none; } .display-config-editor { grid-template-columns: 1fr; } }
.pancake-config-dialog, .lark-config-dialog { max-width: min(560px, calc(100vw - 30px)); }
.error-text { color: #a63f35; }
.success-text { color: #2f7651; }
.pancake-config-form { background: #fff; border: 1px solid #e1e8e3; border-radius: 15px; padding: 20px; }
.config-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.checkbox-label { align-items: center; display: flex; gap: 8px; }
.checkbox-label input { min-height: auto; width: auto; }
.field-hint { color: #718079; display: block; font-size: .7rem; margin-top: 4px; }
.report-metric-fieldset { border: 1px solid #d8ddda; margin: 0; padding: 12px; }
.report-metric-fieldset legend { color: #59655f; font-size: .72rem; font-weight: 800; padding: 0 5px; }
.report-metric-list { display: grid; gap: 9px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 590px) { .report-metric-list { grid-template-columns: 1fr; } }
.optional-field input { background: #f7f9f7; }
.config-list { display: grid; gap: 10px; margin-top: 18px; }
.config-item { align-items: center; background: #fff; border: 1px solid #e1e8e3; border-radius: 12px; display: flex; gap: 12px; justify-content: space-between; padding: 14px; }
.config-item-main { align-items: center; display: flex; gap: 10px; min-width: 0; }
.config-item strong, .config-item small { display: block; }
.config-item small { color: #718079; font-size: .72rem; margin-top: 4px; }
.config-item > div { display: flex; gap: 7px; }
.config-item-actions { flex-wrap: wrap; justify-content: flex-end; }
.danger-button { background: #fff0ed; border: 1px solid #f0c8c0; border-radius: 9px; color: #b14338; font-weight: 750; min-height: 40px; padding: 9px 14px; }
.danger-button:hover { background: #ffe3de; }
.pancake-platform-icon { align-items: center; border-radius: 8px; color: #fff; display: inline-flex; flex: 0 0 auto; font-family: Arial, sans-serif; font-size: .95rem; font-weight: 900; height: 27px; justify-content: center; line-height: 1; width: 27px; }
.pancake-platform-icon.facebook { background: #1877f2; }
.pancake-platform-icon.zalo { background: #0068ff; font-size: .78rem; }
.pancake-platform-icon.email { background: #d87932; font-size: .82rem; }
.pancake-platform-icon.phone { background: #2f7eae; font-size: .72rem; }
.pancake-linked-button .pancake-platform-icon, .pancake-thread-head .pancake-platform-icon { height: 20px; margin-right: 4px; vertical-align: -4px; width: 20px; }
.email-channel-card { align-items: start; background: #f7faf5; border: 1px solid #dce8d4; border-radius: 12px; display: grid; gap: 13px; grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
.email-channel-icon { align-items: center; background: #d87932; border-radius: 10px; color: #fff; display: flex; flex: 0 0 auto; font-size: 1.25rem; font-weight: 900; height: 42px; justify-content: center; width: 42px; }
.email-channel-card .eyebrow { margin-bottom: 4px; }
.email-compose-field, .email-open-client { grid-column: 1 / -1; }
.email-channel-address { color: #315b43; font-size: .9rem; font-weight: 800; overflow-wrap: anywhere; }
.email-channel-contact { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.phone-call-button { align-items: center; background: #2f7eae; border-radius: 50%; color: #fff; display: inline-flex; font-size: .9rem; height: 28px; justify-content: center; text-decoration: none; width: 28px; }
.phone-call-button:hover, .phone-call-button:focus-visible { background: #216489; }
.conversation-phone-button { flex: 0 0 auto; margin-left: 2px; }
.email-channel-status { font-size: .72rem; margin: 5px 0 0; }
.email-channel-status.allowed { color: #3d7438; }
.email-channel-status.blocked { color: #a8661c; }
.muted { color: #89968f; font-size: .76rem; }
.error-state, .message.error { color: #bd4237; }

/* Giao diện xanh dương đồng bộ */
:root { color: #17344f; background: #f5f9fc; }
.auth-shell { background: radial-gradient(circle at 75% 15%, #dff2ff, transparent 35%), #f5f9fc; }
.login-card, .chart-card, .detail-panel, .email-history-section, .pancake-suggestions-column, .ai-box-config-form, .ai-box-playground, .display-field-section, .pancake-config-form, .config-item, .lark-dashboard-embed { border-color: #dbe7ef; }
.login-card { box-shadow: 0 24px 80px #123b6614; }
.brand-mark, .sidebar { background: #123b66; }
.brand-mark { color: #a9ddff; }
.eyebrow { color: #6d8799; }
.intro { color: #667f93; }
label { color: #4d687d; }
input, select, textarea { background: #f7fbfe; border-color: #d9e6ef; color: #17344f; }
input:focus, select:focus, textarea:focus { border-color: #55a7d6; box-shadow: 0 0 0 3px #dff2ff; }
.password-input button { color: #55758c; }
.primary-button { background: #123b66; }
.primary-button:hover { background: #1f5c91; }
.secondary-button, .logout-button { background: #eaf2f7; color: #2d5675; }
.message.success { color: #2675a8; }
.nav-item { color: #aac7d8; }
.nav-item:hover, .nav-item.active { background: #1f5c91; }
.nav-icon { color: #a9ddff; }
.avatar { background: #a9ddff; color: #123b66; }
.signed-user small { color: #aac7d8; }
.logout-button { background: #ffffff12; color: #d8ebf7; }
.live-dot { color: #52758e; }
.live-dot::before { background: #4aa3d8; }
.stat-card { border-color: #dbe7ef; }
.stat-card.accent { background: #dff2ff; border-color: #cbe8f7; }
.stat-label { color: #61798d; }
.stat-card strong { color: #123b66; }
.stat-card small { color: #7891a2; }
.stat-card.success { background: #eaf6fc; border-color: #cce6f5; }
.stat-card.success strong { color: #2e7ea9; }
.lark-dashboard-embed { box-shadow: 0 10px 28px #123b6608; }
.dashboard-period-label { color: #2a587a; }
.dashboard-periods { background: #eaf3f8; }
.dashboard-period { color: #6a8496; }
.dashboard-period:hover, .dashboard-period.active { color: #123b66; box-shadow: 0 2px 8px #123b6610; }
.chart-heading h2 { color: #203e59; }
.chart-note, .chart-empty, .chart-legend { color: #91a4b1; }
.legend-dot.leads, .trend-line.leads { background: #4aa3d8; stroke: #4aa3d8; }
.legend-dot.followups, .trend-line.followups { background: #123b66; stroke: #123b66; }
.trend-svg line { stroke: #e7f0f5; }
.trend-svg text { fill: #91a5b3; }
.bar-label strong { color: #315a78; }
.bar-label span { color: #899eab; }
.bar-track, .funnel-track { background: #e9f1f6; }
.bar-track rect { fill: #3f8fc2; }
.funnel-level { color: #4c6f8a; }
.funnel-track rect { fill: #3b82b5; }
.funnel-row strong { color: #2b5776; }
.sales-table th { color: #91a4b1; }
.sales-table td { border-color: #e8f0f5; color: #4e718b; }
.sales-table td:first-child { color: #244762; }
.sales-table td:last-child { color: #2d82b8; }
.campaign-count { color: #2f7eae; }
.campaign-tabs { border-color: #d9e6ef; }
.campaign-tab, .campaign-composer-tab, .suggestion-view-tab { color: #6d8799; }
.campaign-tab:hover, .campaign-tab.active { border-bottom-color: #4aa3d8; color: #123b66; }
.campaign-tab-index { background: #eaf2f7; color: #6b8596; }
.campaign-tab.active .campaign-tab-index { background: #a9ddff; color: #123b66; }
.campaign-purpose { border-color: #dbe7ef; }
.campaign-description-trigger { color: #6d8799; }
.campaign-description-trigger:hover { color: #123b66; }
.campaign-description-trigger:focus-visible { outline-color: #dff2ff; }
.campaign-description { color: #3e607a; }
.campaign-description-form input { border-color: #68b5df; }
.email-history-section-head strong { color: #203e59; }
.campaign-composer-tab:hover, .campaign-composer-tab.active, .suggestion-view-tab.active { border-bottom-color: #3f96c7; color: #315f7d; }
.campaign-image-preview, .email-history-row { background: #f6fbfe; border-color: #d7eaf4; }
.campaign-image-preview span, .email-history-row small, .email-history-row div:nth-child(2) span { color: #52748c; }
.email-history-row strong { color: #123b66; }
.email-history-status > :first-child { background: #e7f4fb; color: #3d7497; }
.email-history-actions button { border-color: #cfe3ee; color: #3d7497; }
.email-history-actions button:hover { background: #e7f4fb; }
.result-count, .muted { color: #899eab; }
.period-tabs { border-color: #d9e6ef; }
.period-tab { color: #6d8799; }
.period-tab:hover, .period-tab.active { border-bottom-color: #4aa3d8; color: #123b66; }
.search-field, .lead-card { border-color: #dbe7ef; }
.search-field span { color: #718da0; }
.lead-table-head { color: #899eab; }
.lead-card:hover, .lead-card.selected { border-color: #68b5df; box-shadow: 0 8px 22px #123b660d; }
.lead-avatar { background: #e7f4fb; color: #3d7497; }
.lead-name small, .lead-sale, .lead-date { color: #8198a8; }
.level-pill { background: #edf4f8; color: #52748c; }
.empty-state, .empty-detail, .loading-state { color: #899eab; }
.loading-spinner { border-color: #d7eaf4; border-top-color: #3f8fc2; }
.detail-view-tabs { border-color: #dbe7ef; }
.detail-view-tab { color: #6d8799; }
.detail-view-tab:hover, .detail-view-tab.active { border-bottom-color: #4aa3d8; color: #123b66; }
.detail-heading p { color: #718da0; }
.care-button { background: #a9ddff; color: #123b66; }
.care-button:hover { background: #8bd0f5; }
.care-button:disabled { background: #edf3f7; color: #7c91a0; }
.detail-tag { background: #edf4f8; color: #5b7489; }
.detail-section { border-color: #e7eff4; }
.detail-section h3 { color: #607d90; }
.detail-section p { color: #38566f; }
.fact span { color: #899eac; }
.timeline-item { border-color: #a9ddff; }
.timeline-item::before { background: #68b5df; }
.empty-icon { color: #a9d8f2; }
.empty-detail h3 { color: #3f6079; }
dialog::backdrop { background: #102a4080; }
.care-form { background: #fff; }
.icon-button { background: #edf3f7; color: #526f85; }
.dialog-lead { background: #e8f5fb; color: #3d7497; }
.lead-channel-hint { background: #f6fbfe; border-color: #d7eaf4; color: #52748c; }
.lead-channel-hint strong { color: #315f7d; }
.pancake-toolbar select, .pancake-toolbar input, .pancake-link-row select, .optional-field input { background: #f7fbfe; }
.pancake-platform-tab { background: #edf4f8; color: #5b7890; }
.pancake-platform-tab.active { background: #123b66; border-color: #123b66; }
.pancake-open-tab:not(:disabled), .pancake-linked-button, .pancake-file-button { background: #e7f4fb; border-color: #d1e8f4; color: #3d7497; }
.pancake-link-status, .pancake-attachment-label { color: #52748c; }
.pancake-linked-button.active { background: #123b66; color: #fff; }
.pancake-thread { border-color: #dbe7ef; }
.pancake-thread-head, .pancake-suggestions-column-head { background: #eef7fb; border-color: #dbe7ef; }
.pancake-thread-head strong, .pancake-suggestions-column-head strong { color: #315f7d; }
.pancake-message { background: #edf4f8; }
.pancake-message.staff { background: #dceffc; }
.pancake-message small, .pancake-message.incoming small { color: #52758b; }
.pancake-message.outgoing small { color: #3d7497; }
.pancake-message p { color: #31556d; }
.pancake-send { border-color: #e7eff4; }
.pancake-composer-tab, .suggestion-view-tab { color: #6d8799; }
.suggestion-card { background: #f6fbfe; border-color: #d7eaf4; }
.suggestion-card:hover { background: #e7f4fb; border-color: #a9d8f2; }
.suggestion-card strong { color: #315f7d; }
.suggestion-card span, .suggestion-thumbnail small { color: #6d8799; }
.suggestion-card .suggestion-code { color: #3f96c7; }
.suggestion-thumbnail, .pancake-image-preview { border-color: #d7eaf4; background: #fff; }
.pancake-image-preview span { color: #52748c; }
.pancake-file-button:focus-within, .pancake-file-button:focus-visible { outline-color: rgba(63, 150, 199, .3); }
.email-channel-card { background: #f6fbfe; border-color: #d7eaf4; }
.email-channel-address, .email-channel-status.allowed { color: #2f7eae; }
.ai-box-playground h3 { color: #315a78; }
.ai-box-output { background: #f0f7fb; border-color: #dbe7ef; color: #31556d; }
.display-config-toolbar label { color: #607d90; }
.display-field-row { background: #f7fbfd; border-color: #e1edf4; }
.display-field-row.selected { background: #e6f4fb; border-color: #c8e5f2; }
.display-field-row.fixed { background: #edf4f8; }
.display-field-row strong { color: #315a78; }
.display-field-row small, .field-hint, .config-item small { color: #6d8799; }
.lead-extra { color: #6d8799; }
.success-text { color: #2b78aa; }

/* Tinh chỉnh theo bảng màu Lark */
:root { color: #1f2329; background: #f5f8ff; }
.auth-shell { background: radial-gradient(circle at 75% 15%, #e8f0ff, transparent 35%), #f5f8ff; }
.brand-mark, .sidebar { background: #0e3b8e; }
.brand-mark { color: #bfd4ff; }
.primary-button { background: #1456f0; }
.primary-button:hover { background: #0f45c7; }
.secondary-button, .logout-button { background: #eaf0ff; color: #1b4eb8; }
.nav-item { color: #c3d4ff; }
.nav-item:hover, .nav-item.active { background: #336df4; color: #fff; }
.nav-icon { color: #bfd4ff; }
.avatar { background: #bfd4ff; color: #0e3b8e; }
.signed-user small { color: #c3d4ff; }
.logout-button { background: #ffffff1c; color: #fff; }
.live-dot { color: #4e6685; }
.live-dot::before { background: #4e83fd; }
.login-card, .chart-card, .detail-panel, .email-history-section, .pancake-suggestions-column, .ai-box-config-form, .ai-box-playground, .display-field-section, .pancake-config-form, .config-item, .lark-dashboard-embed, .stat-card, .lead-card, .search-field { border-color: #d8e2f2; }
.stat-card.accent { background: #e3edff; border-color: #c8d9ff; }
.stat-card strong, .email-history-row strong { color: #0e3b8e; }
.stat-card.success { background: #e8f0ff; border-color: #c8d9ff; }
.stat-card.success strong { color: #1456f0; }
.dashboard-period-label { color: #174aaf; }
.dashboard-periods, .campaign-tab-index { background: #eaf0ff; }
.dashboard-period:hover, .dashboard-period.active { color: #0e3b8e; }
.chart-heading h2, .email-history-section-head strong { color: #1f2329; }
.legend-dot.leads, .trend-line.leads { background: #4e83fd; stroke: #4e83fd; }
.legend-dot.followups, .trend-line.followups { background: #1456f0; stroke: #1456f0; }
.bar-track rect, .funnel-track rect { fill: #336df4; }
.campaign-tab:hover, .campaign-tab.active, .period-tab:hover, .period-tab.active, .detail-view-tab:hover, .detail-view-tab.active { border-bottom-color: #4e83fd; color: #1456f0; }
.campaign-tab.active .campaign-tab-index { background: #bfd4ff; color: #0e3b8e; }
.campaign-description-trigger:hover { color: #1456f0; }
.lead-card:hover, .lead-card.selected { border-color: #4e83fd; box-shadow: 0 8px 22px #1456f01a; }
.lead-avatar { background: #e8f0ff; color: #174aaf; }
.level-pill, .detail-tag { background: #edf3ff; color: #2859ad; }
.loading-spinner { border-color: #d7e3fb; border-top-color: #336df4; }
.care-button { background: #4e83fd; color: #fff; }
.care-button:hover { background: #1456f0; }
.care-button:disabled { background: #edf1f7; color: #7a8494; }
.timeline-item { border-color: #bfd4ff; }
.timeline-item::before { background: #4e83fd; }
.dialog-lead, .lead-channel-hint { background: #eaf0ff; color: #2859ad; }
.pancake-platform-tab.active, .pancake-linked-button.active { background: #1456f0; border-color: #1456f0; }
.pancake-open-tab:not(:disabled), .pancake-linked-button, .pancake-file-button { background: #e8f0ff; border-color: #c8d9ff; color: #2859ad; }
.pancake-thread-head, .pancake-suggestions-column-head { background: #edf3ff; }
.pancake-message.staff { background: #e0ebff; }
.suggestion-card { background: #f7faff; border-color: #cddcff; }
.suggestion-card:hover { background: #e8f0ff; border-color: #9ebcff; }
.suggestion-card strong, .suggestion-card .suggestion-code { color: #1456f0; }
.suggestion-card .suggestion-code { color: #336df4; }
.display-field-row.selected { background: #e8f0ff; border-color: #c8d9ff; }
.success-text, .message.success, .email-channel-address, .email-channel-status.allowed { color: #1456f0; }

/* Bảng màu Facebook: sáng, trung tính, xanh nổi bật */
:root { color: #1c1e21; background: #f0f2f5; }
.auth-shell { background: radial-gradient(circle at 75% 15%, #e7f3ff, transparent 35%), #f0f2f5; }
.login-card, .chart-card, .detail-panel, .email-history-section, .pancake-suggestions-column, .ai-box-config-form, .ai-box-playground, .display-field-section, .pancake-config-form, .config-item, .lark-dashboard-embed, .stat-card, .lead-card, .search-field { border-color: #dddfe2; }
.login-card { box-shadow: 0 24px 80px #1c1e2114; }
.brand-mark, .sidebar { background: #145dbf; }
.brand-mark { color: #e7f3ff; }
.eyebrow { color: #65676b; }
.intro { color: #65676b; }
label { color: #4b4f56; }
input, select, textarea { background: #f5f6f7; border-color: #ccd0d5; color: #1c1e21; }
input:focus, select:focus, textarea:focus { background: #fff; border-color: #1877f2; box-shadow: 0 0 0 3px #e7f3ff; }
.password-input button { color: #385898; }
.primary-button { background: #1877f2; }
.primary-button:hover { background: #166fe5; }
.secondary-button, .logout-button { background: #e4e6eb; color: #1c1e21; }
.message.success, .success-text { color: #1877f2; }
.nav-item { color: #dbeaff; }
.nav-item:hover, .nav-item.active { background: #1877f2; color: #fff; }
.nav-icon { color: #e7f3ff; }
.avatar { background: #e7f3ff; color: #145dbf; }
.signed-user small { color: #dbeaff; }
.logout-button { background: #ffffff20; color: #fff; }
.workspace { background: #f0f2f5; }
.live-dot { color: #65676b; }
.live-dot::before { background: #1877f2; }
.stat-card.accent { background: #e7f3ff; border-color: #cfe3ff; }
.stat-label { color: #65676b; }
.stat-card strong { color: #1c1e21; }
.stat-card small { color: #65676b; }
.stat-card.success { background: #e7f3ff; border-color: #cfe3ff; }
.stat-card.success strong { color: #1877f2; }
.dashboard-period-label { color: #1c1e21; }
.dashboard-periods, .campaign-tab-index { background: #e4e6eb; }
.dashboard-period { color: #65676b; }
.dashboard-period:hover, .dashboard-period.active { color: #1877f2; box-shadow: 0 2px 8px #1c1e2112; }
.chart-heading h2, .email-history-section-head strong { color: #1c1e21; }
.chart-note, .chart-empty, .chart-legend { color: #65676b; }
.legend-dot.leads, .trend-line.leads { background: #42b72a; stroke: #42b72a; }
.legend-dot.followups, .trend-line.followups { background: #1877f2; stroke: #1877f2; }
.trend-svg line { stroke: #e4e6eb; }
.trend-svg text { fill: #65676b; }
.bar-track, .funnel-track { background: #e4e6eb; }
.bar-track rect, .funnel-track rect { fill: #1877f2; }
.bar-label strong, .funnel-level { color: #1c1e21; }
.bar-label span, .chart-note, .sales-table th { color: #65676b; }
.funnel-row strong, .sales-table td:first-child { color: #1c1e21; }
.sales-table td { border-color: #e4e6eb; color: #65676b; }
.sales-table td:last-child, .campaign-count { color: #1877f2; }
.campaign-tabs, .period-tabs, .detail-view-tabs { border-color: #ccd0d5; }
.campaign-tab, .campaign-composer-tab, .suggestion-view-tab, .period-tab, .detail-view-tab { color: #65676b; }
.campaign-tab:hover, .campaign-tab.active, .period-tab:hover, .period-tab.active, .detail-view-tab:hover, .detail-view-tab.active { border-bottom-color: #1877f2; color: #1877f2; }
.campaign-tab-index { color: #65676b; }
.campaign-tab.active .campaign-tab-index { background: #b3d7ff; color: #145dbf; }
.campaign-purpose { border-color: #dddfe2; }
.campaign-description-trigger { color: #65676b; }
.campaign-description-trigger:hover { color: #1877f2; }
.campaign-description { color: #4b4f56; }
.campaign-description-form input { border-bottom-color: #1877f2; }
.campaign-image-preview, .email-history-row { background: #f5f6f7; border-color: #dddfe2; }
.campaign-image-preview span, .email-history-row small, .email-history-row div:nth-child(2) span { color: #65676b; }
.email-history-row strong { color: #1c1e21; }
.email-history-status > :first-child { background: #e7f3ff; color: #385898; }
.email-history-actions button { border-color: #ccd0d5; color: #385898; }
.email-history-actions button:hover { background: #e7f3ff; }
.result-count, .muted, .lead-table-head { color: #65676b; }
.search-field span { color: #65676b; }
.lead-card { background: #fff; }
.lead-card:hover, .lead-card.selected { border-color: #1877f2; box-shadow: 0 8px 22px #1c1e2114; }
.lead-avatar { background: #e7f3ff; color: #385898; }
.lead-name small, .lead-sale, .lead-date { color: #65676b; }
.level-pill, .detail-tag { background: #e4e6eb; color: #4b4f56; }
.empty-state, .empty-detail, .loading-state { color: #65676b; }
.loading-spinner { border-color: #d8dadf; border-top-color: #1877f2; }
.detail-heading p { color: #65676b; }
.care-button { background: #1877f2; color: #fff; }
.care-button:hover { background: #166fe5; }
.care-button:disabled { background: #e4e6eb; color: #8a8d91; }
.detail-section { border-color: #e4e6eb; }
.detail-section h3 { color: #65676b; }
.detail-section p { color: #4b4f56; }
.fact span, .timeline-item small { color: #65676b; }
.timeline-item { border-color: #b3d7ff; }
.timeline-item::before { background: #1877f2; }
.empty-icon { color: #b3d7ff; }
.empty-detail h3 { color: #4b4f56; }
dialog::backdrop { background: #1c1e2180; }
.icon-button { background: #e4e6eb; color: #4b4f56; }
.dialog-lead, .lead-channel-hint { background: #e7f3ff; color: #385898; }
.lead-channel-hint { border-color: #cfe3ff; }
.pancake-toolbar select, .pancake-toolbar input, .pancake-link-row select, .optional-field input { background: #f5f6f7; }
.pancake-platform-tab { background: #e4e6eb; color: #4b4f56; }
.pancake-platform-tab.active, .pancake-linked-button.active { background: #1877f2; border-color: #1877f2; }
.pancake-open-tab:not(:disabled), .pancake-linked-button, .pancake-file-button { background: #e7f3ff; border-color: #cfe3ff; color: #385898; }
.pancake-thread { border-color: #dddfe2; }
.pancake-thread-head, .pancake-suggestions-column-head { background: #f5f6f7; border-color: #dddfe2; }
.pancake-thread-head strong, .pancake-suggestions-column-head strong { color: #1c1e21; }
.pancake-message { background: #e4e6eb; }
.pancake-message.staff { background: #dbeaff; }
.pancake-message p { color: #1c1e21; }
.suggestion-card { background: #f5f6f7; border-color: #dddfe2; }
.suggestion-card:hover { background: #e7f3ff; border-color: #b3d7ff; }
.suggestion-card strong { color: #1c1e21; }
.suggestion-card span, .suggestion-thumbnail small { color: #65676b; }
.suggestion-card .suggestion-code { color: #1877f2; }
.suggestion-thumbnail, .pancake-image-preview { border-color: #dddfe2; }
.pancake-file-button:focus-within, .pancake-file-button:focus-visible { outline-color: rgba(24, 119, 242, .3); }
.email-channel-card { background: #f5f6f7; border-color: #dddfe2; }
.email-channel-address, .email-channel-status.allowed { color: #1877f2; }
.ai-box-output { background: #f5f6f7; border-color: #dddfe2; color: #1c1e21; }
.display-config-toolbar label { color: #65676b; }
.display-field-row { background: #f5f6f7; border-color: #e4e6eb; }
.display-field-row.selected { background: #e7f3ff; border-color: #cfe3ff; }
.display-field-row.fixed { background: #e4e6eb; }
.display-field-row strong { color: #1c1e21; }
.display-field-row small, .field-hint, .config-item small, .lead-extra { color: #65676b; }

/* Sidebar tối, chữ trắng */
.brand-mark, .sidebar { background: #08244a; color: #fff; }
.side-brand, .side-brand span, .sidebar .nav-item, .sidebar .signed-user, .sidebar .signed-user strong, .sidebar .signed-user small, .sidebar .logout-button { color: #fff; }
.sidebar .nav-item { background: transparent; }
.sidebar .nav-item:hover { background: #123d73; color: #fff; }
.sidebar .nav-item.active { background: #1877f2; color: #fff; }
.sidebar .nav-icon { color: #fff; }
.sidebar .signed-user small { color: #e0ebff; }
.sidebar .avatar { background: #fff; color: #08244a; }
.sidebar .logout-button { background: #123d73; color: #fff; }
.sidebar .logout-button:hover { background: #1877f2; }

/* Hội thoại: khu vực tìm và gắn tối giản */
.pancake-platform-tabs { align-items: center; gap: 4px; margin-bottom: 6px; }
.pancake-platform-tab { border-radius: 7px; font-size: .68rem; gap: 4px; min-height: 32px; padding: 5px 8px; }
.pancake-platform-tab .pancake-platform-icon { height: 17px; width: 17px; }
.pancake-open-tab { display: none !important; margin-left: auto; }
.pancake-link-status { align-items: center; font-size: .66rem; gap: 4px; line-height: 1.35; margin: 3px 0 6px; }
.pancake-link-status .pancake-platform-icon { height: 16px; width: 16px; }
.pancake-toolbar, .pancake-link-row { gap: 5px; margin-bottom: 6px; }
.pancake-toolbar { grid-template-columns: minmax(120px, .9fr) minmax(150px, 1.4fr) auto; }
.pancake-link-row { grid-template-columns: minmax(0, 1fr) auto; }
.pancake-toolbar select, .pancake-toolbar input, .pancake-link-row select { font-size: .7rem; min-height: 35px; padding: 7px 9px; }
.pancake-toolbar .secondary-button, .pancake-link-row .secondary-button { min-height: 35px; padding: 7px 10px; }
.pancake-linked { align-items: center; background: #f5f6f7; border: 1px solid #dddfe2; border-radius: 7px; gap: 5px; margin: 5px 0 7px; padding: 4px; }
.pancake-linked-button { flex: 1 1 auto; min-width: 0; overflow: hidden; padding: 6px 8px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.pancake-linked > .secondary-button { min-height: 30px; padding: 5px 8px; }
.pancake-connection-error { font-size: .66rem; margin: 4px 0; }
.pancake-toolbar select, .pancake-link-row select { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 590px) {
  .pancake-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .pancake-toolbar select { grid-column: 1 / -1; }
}

/* Danh sách lead: mật độ gần với bảng Lark */
#leadWorkspace .section-title { margin-bottom: 12px; }
#leadWorkspace .section-title h2 { font-size: 1.08rem; letter-spacing: -.035em; }
#leadWorkspace .section-title .eyebrow { font-size: .6rem; margin-bottom: 4px; }
#leadWorkspace .result-count { font-size: .68rem; }
#leadWorkspace .lead-list { gap: 4px; }
#leadWorkspace .lead-table-head,
#leadWorkspace .lead-card { gap: 8px; min-width: 0; }
#leadWorkspace .lead-table-head { font-size: .6rem; letter-spacing: .04em; padding: 0 10px 5px; }
#leadWorkspace .lead-card { border-radius: 7px; min-height: 44px; padding: 6px 10px; }
#leadWorkspace .lead-card:hover,
#leadWorkspace .lead-card.selected { transform: none; }
#leadWorkspace .lead-name { gap: 8px; min-width: 0; }
#leadWorkspace .lead-avatar { border-radius: 7px; font-size: .64rem; height: 30px; width: 30px; }
#leadWorkspace .lead-name > div,
#leadWorkspace .lead-sale,
#leadWorkspace .lead-level,
#leadWorkspace .lead-extra { min-width: 0; }
#leadWorkspace .lead-name strong { font-size: .78rem; line-height: 1.2; overflow: hidden; overflow-wrap: normal; text-overflow: ellipsis; white-space: nowrap; }
#leadWorkspace .lead-name small,
#leadWorkspace .lead-sale,
#leadWorkspace .lead-date,
#leadWorkspace .lead-extra { font-size: .64rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leadWorkspace .level-pill { font-size: .64rem; padding: 4px 7px; }
@media (min-width: 591px) {
  #leadList .lead-grid-0 { grid-template-columns: minmax(0, 2.1fr); }
  #leadList .lead-grid-1 { grid-template-columns: minmax(0, 2.1fr) minmax(120px, 1fr); }
  #leadList .lead-grid-2 { grid-template-columns: minmax(0, 2.1fr) repeat(2, minmax(120px, 1fr)); }
  #leadList .lead-grid-3 { grid-template-columns: minmax(0, 2.1fr) repeat(3, minmax(120px, 1fr)); }
  #leadList .lead-grid-4 { grid-template-columns: minmax(0, 2.1fr) repeat(4, minmax(120px, 1fr)); }
  #leadList .lead-grid-5 { grid-template-columns: minmax(0, 2.1fr) repeat(5, minmax(120px, 1fr)); }
  #leadWorkspace #leadList:not(.has-extra-columns) .lead-table-head,
  #leadWorkspace #leadList:not(.has-extra-columns) .lead-card { grid-template-columns: minmax(0, 2.1fr) minmax(0, .9fr) 92px 105px; }
  #leadWorkspace .campaign-care-cell { min-width: 0; }
  #leadWorkspace .campaign-care-button { border-radius: 6px; font-size: .6rem; min-height: 28px; padding: 5px 7px; }
  #campaignPanel .campaign-grid-0 { grid-template-columns: minmax(150px, 1.55fr) 78px 70px; }
  #campaignPanel .campaign-grid-1 { grid-template-columns: minmax(150px, 1.55fr) minmax(110px, 1fr) 78px 70px; }
  #campaignPanel .campaign-grid-2 { grid-template-columns: minmax(150px, 1.55fr) repeat(2, minmax(110px, 1fr)) 78px 70px; }
  #campaignPanel .campaign-grid-3 { grid-template-columns: minmax(150px, 1.55fr) repeat(3, minmax(110px, 1fr)) 78px 70px; }
  #campaignPanel .campaign-grid-4 { grid-template-columns: minmax(150px, 1.55fr) repeat(4, minmax(110px, 1fr)) 78px 70px; }
  #campaignPanel .campaign-grid-5 { grid-template-columns: minmax(150px, 1.55fr) repeat(5, minmax(110px, 1fr)) 78px 70px; }
}

/* Chiến dịch dùng cùng mật độ card với các bảng lead */
#campaignPanel .campaign-heading { margin-bottom: 12px; }
#campaignPanel .campaign-heading > div:first-child > .eyebrow,
#campaignViewNote,
#campaignStatus { display: none; }
#campaignPanel .campaign-title-line h2 { font-size: 1.08rem; letter-spacing: -.035em; }
#campaignPanel .campaign-heading .eyebrow,
#campaignPanel .campaign-list-heading .eyebrow { font-size: .6rem; margin-bottom: 4px; }
#campaignPanel .campaign-count,
#campaignPanel .campaign-list-heading .muted,
#campaignPanel .campaign-status,
#campaignPanel #campaignUpdatedAt { font-size: .64rem; }
#campaignPanel .campaign-actions { gap: 6px; }
#campaignPanel .campaign-actions .secondary-button,
#campaignPanel .campaign-actions .primary-button { font-size: .64rem; min-height: 34px; padding: 7px 9px; }
#campaignPanel .campaign-tabs { margin-bottom: 10px; }
#campaignPanel .campaign-tab { font-size: .68rem; min-height: 36px; padding: 6px 9px; }
#campaignPanel .campaign-tab-index { font-size: .58rem; height: 19px; width: 19px; }
#campaignPanel .campaign-list { gap: 4px; }
#campaignPanel .lead-table-head,
#campaignPanel .lead-card { gap: 8px; min-width: 0; }
#campaignPanel .lead-table-head { font-size: .6rem; letter-spacing: .04em; padding: 0 10px 5px; }
#campaignPanel .lead-card { border-radius: 7px; min-height: 44px; padding: 6px 10px; }
#campaignPanel .lead-card:hover,
#campaignPanel .lead-card.selected { transform: none; }
#campaignPanel .lead-name { gap: 8px; min-width: 0; }
#campaignPanel .lead-avatar { border-radius: 7px; font-size: .64rem; height: 30px; width: 30px; }
#campaignPanel .lead-name > div,
#campaignPanel .lead-sale,
#campaignPanel .lead-level,
#campaignPanel .campaign-care-cell { min-width: 0; }
#campaignPanel .lead-name strong { font-size: .78rem; line-height: 1.2; overflow: hidden; overflow-wrap: normal; text-overflow: ellipsis; white-space: nowrap; }
#campaignPanel .lead-name small,
#campaignPanel .lead-sale { font-size: .64rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#campaignPanel .level-pill { font-size: .64rem; padding: 4px 7px; }
#campaignPanel .campaign-care-button { border-radius: 6px; font-size: .6rem; min-height: 28px; padding: 5px 7px; }
#campaignPanel .campaign-progress { color: #4c8b42; font-size: .72rem; font-weight: 800; text-align: center; }

.campaign-overview { border-bottom: 1px solid #dddfe2; margin-bottom: 14px; padding: 2px 0 14px; }
.campaign-overview-head { align-items: end; display: flex; justify-content: space-between; margin-bottom: 8px; }
.campaign-overview-head h3 { color: #1c1e21; font-size: .9rem; margin: 0; }
.campaign-overview-head .eyebrow { margin-bottom: 3px; }
.campaign-overview-list { display: grid; gap: 6px; }
.campaign-summary-item { align-items: center; background: #f5f6f7; border: 1px solid #dddfe2; border-radius: 8px; display: grid; gap: 10px; grid-template-columns: minmax(180px, 1.2fr) minmax(260px, 1.6fr) auto; padding: 9px 11px; }
.campaign-summary-main { min-width: 0; }
.campaign-summary-main strong, .campaign-summary-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-summary-main strong { color: #1c1e21; font-size: .76rem; }
.campaign-summary-main small { color: #65676b; font-size: .66rem; margin-top: 3px; }
.campaign-summary-facts { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.campaign-summary-facts span { color: #65676b; font-size: .65rem; }
.campaign-summary-facts b { color: #4b4f56; font-weight: 800; }
.campaign-summary-status { align-items: end; display: grid; gap: 3px; justify-items: end; }
.campaign-status-pill { background: #e4e6eb; border-radius: 20px; color: #4b4f56; font-size: .62rem; font-weight: 800; padding: 4px 8px; white-space: nowrap; }
.campaign-status-pill.running, .campaign-status-pill.queued { background: #e7f3ff; color: #385898; }
.campaign-status-pill.completed { background: #e6f4ea; color: #26743d; }
.campaign-status-pill.completed_with_errors, .campaign-status-pill.failed { background: #fff0ed; color: #a63f35; }
.campaign-status-pill.paused { background: #fff7e8; color: #8a641d; }
.campaign-summary-status small { color: #65676b; font-size: .62rem; }
.campaign-meta-fields { margin-top: 0; }
dialog#campaignCreateDialog { max-width: min(560px, calc(100vw - 30px)); }
@media (max-width: 800px) { .campaign-summary-item { grid-template-columns: 1fr; } .campaign-summary-status { align-items: start; justify-items: start; } }

/* Nút thao tác hội thoại: nhẹ, ít chiếm chỗ */
.pancake-toolbar .secondary-button,
.pancake-link-row .secondary-button,
.pancake-linked > .secondary-button { font-size: .64rem; font-weight: 700; }
