/* Automazy / dark command surface. Kept separate from legacy component rules. */
:root {
  color-scheme: dark;
  --bg-primary: #06080c;
  --bg-secondary: #0b0f15;
  --bg-tertiary: #141a23;
  --card-bg: #10151d;
  --border-color: rgba(190, 214, 239, .105);
  --border-glow: rgba(128, 198, 246, .28);
  --text-main: #edf3fa;
  --text-muted: #91a0af;
  --accent-primary: #91d8ff;
  --accent-secondary: #b6d4ed;
  --accent-gradient: linear-gradient(135deg, #f2f8ff, #bfd9ee);
  --danger: #f18c94;
  --warning: #efba79;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, .18);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .48);
}
.hidden { display: none !important; }
html { font-size: 16px; }
body.dark-theme { background: #06080c; letter-spacing: -.012em; }
button, input, select, textarea { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(145,216,255,.27); color: white; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #26323f; border-radius: 9px; }

/* Shell */
.sidebar { width: 256px; background: #090c11; border-right: 1px solid #1b232e; }
.sidebar-brand { padding: 27px 24px 26px; min-height: 89px; gap: 12px; border-bottom-color: #1b232e; }
.brand-icon { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle, #172b38, #0c141e 72%); border: 1px solid rgba(145,216,255,.27); color: #a5e2ff; box-shadow: 0 0 22px rgba(56,154,217,.12), inset 0 0 13px rgba(88,185,241,.08); }
.brand-icon svg { width: 42px; height: 42px; }
.brand-text h2 { font-size: 20px; font-weight: 700; letter-spacing: -.065em; }
.brand-text .brand-period { color: var(--accent-primary); }
.brand-text span { font: 500 9px/1.5 var(--font-mono); letter-spacing: .075em; color: #667787; }
.sidebar-section-label, .nav-divider { display: flex; align-items: center; justify-content: space-between; color: #607080; font: 600 10px var(--font-mono); letter-spacing: .13em; }
.sidebar-section-label { padding: 24px 24px 7px; }
.sidebar-section-label span, .nav-divider span:last-child { color: #465666; }
.sidebar-menu { padding: 0 10px 16px; gap: 3px; }
.nav-divider { margin: 20px 14px 9px; padding-top: 21px; border-top: 1px solid #1b232e; }
.nav-btn { min-height: 43px; padding: 10px 13px; border: 1px solid transparent; border-radius: 9px; color: #8291a0; font-size: 12px; font-weight: 500; letter-spacing: 0; transition: background .18s, color .18s, border-color .18s; }
.nav-btn svg { color: #66798b; stroke-width: 1.6; flex: 0 0 auto; }
.nav-btn:hover { color: #e6f1f9; background: #151d26; }
.nav-btn.active { color: #e5f4ff; background: linear-gradient(90deg, rgba(114,177,223,.15), rgba(79,134,173,.055)); border-color: rgba(134,194,236,.15); box-shadow: inset 2px 0 #9ddfff; font-weight: 600; }
.nav-btn.active svg { color: #a4ddfc; }
.badge { font: 600 10px var(--font-mono); background: #1e2935; color: #a7bacb; padding: 3px 7px; }
.sidebar-footer { padding: 19px 20px 22px; border-top-color: #1b232e; }
.sidebar-footer-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; color: #879bad; font: 600 9px var(--font-mono); letter-spacing: .12em; }
.sidebar-footer-heading span:last-child { margin-left: auto; color: #5c9f9b; }
.footer-signal { width: 5px; height: 5px; border-radius: 50%; background: #68c8bb; box-shadow: 0 0 9px #5ec6b5; }
.model-badge { border: 1px solid #263340; background: #111923; color: #b2c5d4; border-radius: 8px; font: 500 11px var(--font-mono); }
.model-badge .dot { background: #7cb8e0; box-shadow: 0 0 9px #7cb8e0; }
.main-wrapper { background: radial-gradient(ellipse 80% 58% at 67% -20%, rgba(39,70,99,.22), transparent 72%), #070a0f; }
.topbar { min-height: 76px; height: auto; background: rgba(8,12,18,.83); border-bottom-color: #1d2833; padding: 13px 34px; gap: 14px; }
.topbar-left { flex-wrap: wrap; }
.topbar-kicker { font: 600 10px var(--font-mono); letter-spacing: .13em; color: #8498a9; }
.topbar-kicker span { margin-left: 8px; color: #415668; }
.topbar-left h1 { font-size: 14px; font-weight: 600; letter-spacing: -.02em; }
.topbar-right { gap: 9px; }
.tenant-selector-wrap { margin-left: 14px; padding: 5px 7px 5px 12px; background: #111821; border-color: #293745; border-radius: 9px; }
.tenant-label { color: #748a9c; font: 600 9px var(--font-mono); letter-spacing: .08em; }
.tenant-select { max-width: 158px; color: #e4eef8; font-size: 12px; font-weight: 600; }
.status-pill, .toggle-pill { min-height: 35px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.status-pill { padding: 6px 10px; }
.status-connected { background: rgba(105,212,192,.09); color: #89d9cb; border-color: rgba(105,212,192,.21); }
.status-disconnected { background: rgba(239,186,121,.07); color: #dbb283; border-color: rgba(239,186,121,.19); }
.toggle-pill { border: 1px solid #293745; background: #111821; }
.toggle-label { font: 600 9px var(--font-mono); letter-spacing: .09em; }
.content-container { padding: 42px clamp(24px, 3vw, 50px) 54px; }

/* Dashboard: one focal surface, supporting metrics, then setup. */
#view-dashboard.tab-view.active { display: flex; flex-direction: column; height: auto; }
#view-dashboard .dashboard-intro { order: 0; }
#view-dashboard .dashboard-columns { order: 1; }
#view-dashboard .stats-grid { order: 2; }
#view-dashboard .setup-panel { order: 3; }
#view-dashboard .legacy-hero { display: none; }
.dashboard-intro { align-items: flex-end; margin: 0 0 28px; }
.eyebrow { color: #8dc8ec; font: 600 10px var(--font-mono); letter-spacing: .15em; }
.eyebrow-line { width: 13px; background: #83c7f4; }
.intro-index { color: #657b8e; }
.dashboard-intro h2 { margin: 12px 0 9px; font-size: clamp(29px, 3vw, 42px); line-height: 1.13; letter-spacing: -.06em; font-weight: 600; }
.dashboard-intro h2 em { font-style: normal; color: #a0cfea; }
.dashboard-intro p { font-size: 13px; color: #8998a8; }
.intro-action { padding: 10px 15px; }
.dashboard-columns { grid-template-columns: minmax(0, 1.44fr) minmax(320px, .86fr); gap: 16px; margin: 0 0 16px; }
.operation-panel, .attention-panel { min-height: 345px; padding: 28px; border: 1px solid #263546; border-radius: 18px; }
.operation-panel { order: -1; display: flex; flex-direction: column; background: radial-gradient(circle at 77% 48%, rgba(48,111,153,.17), transparent 33%), linear-gradient(130deg, #152231 0%, #101923 54%, #0d141d 100%); box-shadow: inset 0 1px rgba(206,231,250,.075), 0 24px 70px rgba(0,0,0,.23); }
.operation-panel::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(157,209,242,.027) 1px, transparent 1px), linear-gradient(90deg, rgba(157,209,242,.027) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(90deg, transparent 12%, #000 100%); pointer-events: none; }
.operation-panel::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(171,216,244,.13); border-radius: inherit; pointer-events: none; }
.operation-copy { position: relative; z-index: 2; width: min(54%, 400px); }
.operation-panel h3 { max-width: 390px; margin: 42px 0 13px; color: #f3f8fd; font-size: clamp(24px, 2.2vw, 34px); font-weight: 600; line-height: 1.17; letter-spacing: -.055em; }
.operation-panel h3 span { color: #99d9fc; }
.operation-panel p { max-width: 335px; min-height: 0; font-size: 13px; line-height: 1.65; color: #a2b4c4; }
.operation-actions { margin-top: 24px; gap: 8px; }
.operation-actions .btn { font-size: 12px; }
.operation-footer { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 22px; color: #7b90a2; font: 600 9px var(--font-mono); letter-spacing: .12em; }
.operation-footer span:first-child { display: flex; align-items: center; gap: 7px; }
.operation-footer i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #87bbdc; box-shadow: 0 0 8px #87bbdc; }
.agent-core { position: absolute; width: 250px; height: 250px; top: 50%; right: 4%; transform: translateY(-52%); display: grid; place-items: center; color: #81c5ef; }
.core-orbit { position: absolute; border-radius: 50%; }
.core-orbit-outer { width: 238px; height: 238px; border: 1px solid rgba(123,197,244,.2); box-shadow: 0 0 45px rgba(47,143,208,.045); }
.core-orbit-outer::before, .core-orbit-outer::after { content: ""; position: absolute; background: #85c8ee; width: 3px; height: 3px; border-radius: 50%; }
.core-orbit-outer::before { top: 24px; left: 35px; }.core-orbit-outer::after { bottom: 35px; right: 26px; }
.core-orbit-middle { width: 197px; height: 197px; border: 2px solid transparent; border-top-color: rgba(136,210,255,.68); border-right-color: rgba(112,193,243,.18); border-bottom-color: rgba(112,193,243,.4); transform: rotate(25deg); box-shadow: inset 0 0 18px rgba(54,164,230,.07); }
.core-orbit-inner { width: 157px; height: 157px; border: 1px dashed rgba(138,209,252,.32); box-shadow: 0 0 28px rgba(56,173,240,.07); }
.core-center { display: grid; place-content: center; justify-items: center; width: 121px; height: 121px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #203e53 0, #162b3b 45%, #101f2b 78%); border: 1px solid rgba(160,219,252,.48); box-shadow: 0 0 43px rgba(91,182,233,.13), inset 0 0 25px rgba(82,188,244,.09); }
.core-sigil { font-size: 49px; font-weight: 500; line-height: 1; letter-spacing: -.12em; color: #d1eeff; }
.core-state { margin-top: 8px; font: 600 8px var(--font-mono); letter-spacing: .12em; color: #a4d4f0; }
.core-cross { position: absolute; left: 50%; width: 1px; height: 9px; background: rgba(158,216,250,.5); }.core-cross-top { top: -3px; }.core-cross-bottom { bottom: -3px; }
.agent-core[data-state="online"] .core-orbit-middle { animation: orbit 30s linear infinite; }
.agent-core[data-state="online"] .core-center { box-shadow: 0 0 49px rgba(91,182,233,.2), inset 0 0 25px rgba(82,188,244,.13); }
.agent-core[data-state="offline"] { filter: saturate(.57); opacity: .88; }
@keyframes orbit { to { transform: rotate(385deg); } }
@media (prefers-reduced-motion: reduce) { .agent-core * { animation: none !important; } }
.attention-panel { background: #10161e; border-color: #23303d; box-shadow: inset 0 1px rgba(255,255,255,.025); }
.panel-head { margin-bottom: 21px; }.panel-head h3 { margin-top: 10px; font-size: 21px; font-weight: 600; }
.attention-count { border-radius: 6px; background: rgba(136,200,240,.1); color: #a9d9f5; font: 600 11px var(--font-mono); }
.text-action { color: #a8cfe7; font-size: 12px; }
.attention-list { max-height: 245px; }
.attention-item { padding: 15px 3px; border-color: #26313e; }
.attention-item:hover, .attention-item:focus-visible { background: rgba(145,216,255,.045); outline-color: rgba(145,216,255,.25); }
.attention-avatar { border-radius: 10px; background: #1d3442; border: 1px solid #31526a; color: #b6e1f9; }
.attention-detail strong { font-size: 13px; }.attention-detail small { font-size: 11px; }.attention-time { color: #a5cce4; }
.empty-check { background: #1e3543; color: #a0d5f4; }
.stats-grid { gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 139px; padding: 22px; align-items: flex-end; border-radius: 15px; background: #10161e; border-color: #23303d; box-shadow: inset 0 1px rgba(255,255,255,.025); }
.stat-card::before { position: absolute; top: 20px; right: 20px; color: #4d6377; font: 500 10px var(--font-mono); letter-spacing: .08em; }
.stat-card:nth-child(1)::before { content: "01"; }.stat-card:nth-child(2)::before { content: "02"; }.stat-card:nth-child(3)::before { content: "03"; }.stat-card:nth-child(4)::before { content: "04"; }
.stat-icon { position: absolute; top: 17px; left: 20px; width: 30px; height: 30px; border-radius: 8px; background: transparent; color: #7ca8c5; }
.stat-icon svg { width: 20px; height: 20px; stroke-width: 1.6; }
.icon-blue, .icon-green, .icon-purple, .icon-yellow { background: transparent; color: #8fbed9; }
.stat-info { display: flex; flex-direction: column-reverse; gap: 7px; }
.stat-value { font-size: 31px; font-weight: 600; line-height: 1; letter-spacing: -.06em; color: #f1f6fb; }
.stat-label { color: #7e90a0; font: 600 10px var(--font-mono); letter-spacing: .09em; }
.setup-panel { margin: 6px 0 0; padding: 28px; background: #0e141b; border: 1px solid #23303d; border-radius: 16px; }
.setup-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.setup-heading p, .setup-live-note { color: #8c9bab; font-size: 12px; }
.setup-eyebrow { color: #8bc6e8; font: 600 10px var(--font-mono); letter-spacing: .12em; }
.setup-progress { background: #1c2e3b; border: 1px solid #315066; color: #acd7f1; border-radius: 8px; font: 600 11px var(--font-mono); }
.setup-step { background: #141d27; border: 1px solid #273644; border-radius: 11px; }
.setup-step:hover, .setup-step:focus-visible { border-color: #84c9f0; }.setup-step.is-done .setup-check { background: #acdafa; color: #09131b; }

/* Shared controls and secondary surfaces. */
.btn { border-radius: 8px; min-height: 36px; transition: transform .18s, background .18s, border-color .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #e5f2fc; color: #0a1520; font-weight: 700; box-shadow: 0 3px 18px rgba(150,207,247,.09); }
.btn-primary:hover { background: #fff; box-shadow: 0 5px 22px rgba(150,207,247,.15); opacity: 1; }
.btn-secondary { background: rgba(157,196,223,.045); color: #d3e2ed; border: 1px solid #344352; }
.btn-secondary:hover { background: #1d2a35; border-color: #526e85; }
.button-spark { color: #1b5677; font-size: 14px; }
.card, .provider-card, .tenant-card, .analytics-metric-card, .pipeline-col { background: #10161e; border-color: #25323f; box-shadow: none; border-radius: 15px; }
.provider-card:hover, .tenant-card:hover { border-color: #426279; box-shadow: 0 14px 34px rgba(0,0,0,.22); }
.provider-connected, .badge-active { background: #1d3a40; border-color: #3c7481; color: #9cddd9; }
.provider-disconnected, .badge-inactive { background: #30262c; border-color: #60434e; color: #ddaab6; }
.masked-key-display, .tenant-card-details { background: #0b1219; border-color: #293946; }
.analytics-metric-val { color: #e9f3fa; letter-spacing: -.04em; }
.tenant-card.active-tenant { border-color: #72b7dd; box-shadow: 0 0 0 1px rgba(114,183,221,.14); }
.pipeline-board { gap: 13px; }.pipeline-header { border-bottom-color: #273441; }.lead-card { background: #18222c; border-color: #2a3847; }.lead-name { font-size: 14px; }
.data-table th { background: #18222d; color: #8fa3b4; font: 600 10px var(--font-mono); letter-spacing: .09em; }.data-table th, .data-table td { border-color: #283541; }.data-table td { color: #cbd6e0; font-size: 13px; }
.tenant-selector-wrap, .form-group input, .form-group select, .code-editor, #contact-search, .preset-btn { border-color: #334252; }
.form-group input, .form-group select, .code-editor, #contact-search { background: #141e27; color: #e8f0f7; border-radius: 9px; }
.form-group label { color: #d9e5ee; font-size: 13px; }.form-group small, .editor-header p { color: #91a0af; }
.preset-btn.active { background: #25394a; color: #b8e3fb; border-color: #6ba6c9; }
.typing-toggle-card { background: #152431; border-color: #31536a; }.toggle-icon-wrap { background: #203949; }
.switch-ios input:checked + .slider-ios { background: #5489a8; border-color: #7fb8d6; }
.modal-backdrop { background: rgba(0,4,9,.78); backdrop-filter: blur(11px); }.modal-card { background: #101720; border: 1px solid #324354; border-radius: 18px; box-shadow: 0 35px 100px rgba(0,0,0,.6); }.modal-header { border-color: #293744; }
.pill-stage, .pill-ai, .pill-human { border-radius: 6px; font-weight: 600; }
.pill-stage { background: #1d3647; color: #a7dafa; }.pill-ai { background: #1a3a3d; color: #8ed9d1; }.pill-human { background: #432b35; color: #eab1bd; }

/* Inbox: purposeful operator surface rather than a WhatsApp clone. */
.chat-container { height: calc(100vh - 163px); min-height: 540px; border: 1px solid #2b3a48; border-radius: 17px; background: #0d131a; box-shadow: 0 20px 62px rgba(0,0,0,.26); }
.chat-sidebar { width: 360px; min-width: 300px; background: #0f161e; border-right-color: #263543; }
.chat-sidebar-header { padding: 19px 16px 12px; background: #131c25; border-bottom-color: #2c3a47; }
.chat-brand-tag { color: #e1edf5; font-size: 14px; font-weight: 600; }.chat-brand-tag svg { stroke: #9bd4f3; }
.icon-refresh-btn { color: #9ab0c0; }.icon-refresh-btn:hover { background: #263745; color: #fff; }
.chat-search { min-height: 37px; padding: 7px 11px; background: #0e151d; border-color: #324251; border-radius: 8px; }.chat-search input { color: #edf4fa; font-size: 12px; }.chat-search input::placeholder { color: #738697; }
.filter-chip { padding: 6px 11px; border-radius: 7px; background: #192430; color: #95a9b9; border-color: #2c3c4a; font-size: 11px; }.filter-chip:hover { background: #21303d; color: #eaf4fa; }.filter-chip.active { background: #254358; color: #caeaff; border-color: #5a95ba; }
.conv-list { background: #0e151d; }.conv-item { padding: 15px 16px; border-bottom-color: #24313e; }.conv-item:hover { background: #182531 !important; }.conv-item.active { background: #1c2d3a !important; box-shadow: inset 2px 0 #9bd6f5; }
.conv-name { color: #e8f1f7; font-size: 14px; font-weight: 600; }.conv-time, .conv-preview { color: #899bac; }.conv-phone, .conv-phone.is-lid { color: #94c7e6; }.conv-avatar { background: #2b4759; color: #d4edfc; border-radius: 12px; }.conv-avatar-img { border-radius: 12px; }
.chat-main { background: #0b121a; }.chat-empty-panel { background: radial-gradient(circle at 50% 48%, rgba(56,119,160,.12), transparent 42%), #0b121a; color: #879aab; }.wa-splash-icon { background: #1d3445; border: 1px solid #426780; }.wa-splash-icon svg { stroke: #a4d7f4; }.wa-web-splash h3 { color: #e9f3fa; font-size: 19px; letter-spacing: -.03em; }.wa-web-splash p { color: #93a5b5; }
.chat-header { background: #15212c; border-bottom-color: #2f4050; }.contact-avatar-circle { border-radius: 10px; background: #2d4b60; }.chat-contact-info h4 { color: #e9f3fa; }.phone-tag, .online-indicator { color: #91a7b8; }.contact-phone-val { color: #a5d2ed; }
.chat-messages { background-color: #0b121a; background-image: radial-gradient(rgba(158,202,231,.025) 1px, transparent 1px); background-size: 24px 24px; }.bubble { border-radius: 12px; box-shadow: none; }.bubble-user { background: #1b2834; color: #e5f0f7; border: 1px solid #2d3f4f; }.bubble-agent { background: #1a3848; color: #e5f0f7; border: 1px solid #386078; }.bubble-human { background: #23404e; color: #e5f0f7; border: 1px solid #4b7387; }
.chat-input-bar { background: #15212c; border-top-color: #30414f; }.chat-input-bar input { background: #0e1822; border: 1px solid #344655; color: #eff7fc; }.chat-input-bar input:focus { background: #111f2b; border-color: #8bc7eb; }.chat-tool-btn { color: #95aabb; }.chat-send-btn { border-radius: 10px; background: #d5edfa; color: #102330; }.chat-send-btn:hover { background: #fff; }
.doc-item.active { background: #1d3545; color: #b4dcf2; }

/* Preview label only exists in the hosted, fictional-data Site. */
.demo-preview-note { margin: 13px 14px 0; background: #14212d; border-color: #35516a; color: #9cb6c9; border-radius: 9px; }
.demo-preview-note strong { color: #b7e1fb; }

@media (max-width: 1350px) { .dashboard-columns { grid-template-columns: minmax(0,1fr) minmax(295px,.7fr); }.agent-core { width: 198px; height: 198px; right: 1%; transform: translateY(-50%) scale(.78); }.operation-copy { width: 64%; } }
@media (max-width: 1120px) { .dashboard-columns { grid-template-columns: 1fr; }.operation-panel { min-height: 340px; }.attention-panel { min-height: 235px; }.operation-copy { width: min(58%,400px); }.agent-core { right: 8%; transform: translateY(-50%) scale(.9); } }

/* =========================================================================
   CENTRAL DE CONFIGURAÇÃO / INTELIGÊNCIA DO AGENTE
   ========================================================================= */
.agent-center-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.agent-subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #233140;
  padding-bottom: 10px;
  overflow-x: auto;
}
.agent-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid #253545;
  background: #101620;
  color: #8fa5b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.agent-subtab-btn:hover {
  background: #17222e;
  color: #e5f1f9;
  border-color: #3b5368;
}
.agent-subtab-btn.active {
  background: linear-gradient(135deg, rgba(82, 168, 226, 0.22), rgba(35, 93, 134, 0.12));
  color: #bfe5ff;
  border-color: #5ba3d3;
  box-shadow: 0 4px 14px rgba(47, 137, 197, 0.15);
}
.agent-subtab-content {
  display: none;
  animation: fadeInSubtab 0.22s ease-out;
}
.agent-subtab-content.active {
  display: block;
}
@keyframes fadeInSubtab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.subtab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1f2c3a;
}

/* Mode Choice Selector Banner */
.agent-mode-choice-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.agent-mode-choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #0d1520;
  border: 1.5px solid #1f2f42;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}
.agent-mode-choice-card:hover {
  background: #131e2d;
  border-color: #3b536f;
  transform: translateY(-1px);
}
.agent-mode-choice-card.active {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.22), rgba(2, 132, 199, 0.16));
  border-color: #38bdf8;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.14);
}
.agent-mode-choice-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: #38bdf8;
}
.choice-card-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.choice-card-content {
  flex: 1;
  min-width: 0;
}
.choice-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.choice-card-title {
  color: #e2f0fb;
  font-size: 13.5px;
  font-weight: 700;
}
.choice-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.choice-badge-tech {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
}
.choice-badge-active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}
.choice-card-desc {
  font-size: 11.5px;
  color: #8fa6b8;
  margin: 0;
  line-height: 1.4;
}

/* Draft Notice Banner */
.draft-alert-banner {
  margin-bottom: 16px;
  padding: 12px 18px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.draft-alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #fde68a;
  flex: 1;
}
.draft-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* N8N Workspace Card */
.n8n-workspace-card {
  background: #0a0f16;
  border: 1px solid #1c2836;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* N8N Visual Workflow Canvas */
.n8n-workflow-canvas {
  background: #06090e;
  border: 1px solid #1a2736;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  position: relative;
  overflow-x: auto;
}
.n8n-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.n8n-canvas-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
}
.n8n-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6d5a;
  box-shadow: 0 0 8px #ff6d5a;
}
.n8n-canvas-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #4ade80;
}
.n8n-pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulseRag 2s infinite ease-in-out;
}
.n8n-nodes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 680px;
}
.n8n-flow-node {
  flex: 1;
  background: #0d1520;
  border: 1.5px solid #1e2c3d;
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}
.n8n-flow-node.active {
  border-color: #ff6d5a;
  background: linear-gradient(135deg, rgba(255, 109, 90, 0.08), rgba(15, 23, 42, 0.6));
  box-shadow: 0 0 16px rgba(255, 109, 90, 0.15);
}
.n8n-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.n8n-node-icon {
  font-size: 20px;
}
.n8n-node-info strong {
  display: block;
  font-size: 12.5px;
  color: #f1f5f9;
}
.n8n-node-info span {
  font-size: 11px;
  color: #94a3b8;
}
.n8n-node-subtag {
  font-size: 10px !important;
  color: #ff6d5a !important;
  font-weight: 600;
}
.n8n-node-meta {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.n8n-node-meta code {
  font-family: monospace;
  font-size: 10.5px;
  color: #64748b;
}
.n8n-node-subnodes {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.n8n-subnode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  background: #111a24;
  border: 1px solid #233446;
  color: #94a3b8;
}
.n8n-subnode-pill.tool-rag strong {
  color: #4ade80;
}
.n8n-subnode-pill.tool-memory strong {
  color: #38bdf8;
}
.n8n-flow-connector {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  color: #3b82f6;
}
.connector-line {
  width: 24px;
  height: 2px;
  background: #2563eb;
}
.connector-arrow {
  font-size: 10px;
}

/* N8N Sub-Mode Toggle */
.n8n-mode-tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #090e15;
  border: 1px solid #1a2736;
  border-radius: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.n8n-tab-toggle-group {
  display: flex;
  gap: 6px;
}
.n8n-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.n8n-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}
.n8n-toggle-btn.active {
  background: #172433;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}
.toggle-pill-rec {
  background: #059669;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.n8n-mode-hint {
  font-size: 11.5px;
  color: #64748b;
}

/* N8N Studio Main Sections */
.n8n-studio-section {
  background: #090e15;
  border: 1px solid #1c2a3a;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.n8n-section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.n8n-section-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}
.n8n-section-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 0 0;
  line-height: 1.4;
}

/* N8N Roteiro Passo a Passo Grid */
.n8n-roteiro-section {
  background: #080d14;
}
.n8n-roteiro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.n8n-roteiro-card {
  background: #0d1520;
  border: 1px solid #1e2c3e;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.18s;
}
.n8n-roteiro-card:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}
.n8n-roteiro-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.n8n-roteiro-step-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}
.n8n-roteiro-step-sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  line-height: 1.3;
}
.n8n-step-textarea {
  min-height: 58px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.45;
}

/* Guided Builder Blocks */
.n8n-panel-content {
  display: none;
}
.n8n-panel-content.active {
  display: block;
}
.n8n-guided-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.n8n-block-card {
  background: #0a1017;
  border: 1px solid #1c2a38;
  border-radius: 12px;
  padding: 18px 20px;
}
.n8n-block-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.n8n-block-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e3a5f;
  color: #38bdf8;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.n8n-block-header strong {
  display: block;
  font-size: 13.5px;
  color: #e2e8f0;
}
.n8n-block-header p {
  font-size: 12px;
  color: #8fa6b8;
  margin: 2px 0 0 0;
}
.form-label-styled {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  display: block;
  margin-bottom: 5px;
}
.n8n-input-control {
  width: 100%;
  box-sizing: border-box;
  background: #06090e;
  border: 1px solid #1e2c3c;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e2e8f0;
  font-size: 12.5px;
}
.n8n-input-control:focus {
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}
.n8n-steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.n8n-step-item {
  background: #070d13;
  border: 1px solid #1a2533;
  border-radius: 8px;
  padding: 12px;
}
.step-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  margin-bottom: 6px;
}
.step-content strong {
  display: block;
  font-size: 12px;
  color: #e2e8f0;
  margin-bottom: 3px;
}
.step-content p {
  font-size: 11px;
  color: #8fa6b8;
  margin: 0;
  line-height: 1.35;
}
.step-content code {
  font-family: monospace;
  color: #38bdf8;
  font-size: 10.5px;
}
.n8n-guards-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.n8n-guard-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #070d13;
  border: 1px solid #1a2533;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.n8n-guard-toggle:hover {
  border-color: #2a3c50;
  background: #0b121a;
}
.n8n-guard-toggle input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  accent-color: #22c55e;
}
.guard-toggle-info strong {
  display: block;
  font-size: 12px;
  color: #f1f5f9;
  margin-bottom: 3px;
}
.guard-toggle-info span {
  font-size: 11px;
  color: #8fa6b8;
  line-height: 1.35;
  display: block;
}
.n8n-guided-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #0b121a;
  border: 1px solid #1d2c3e;
  border-radius: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

/* N8N RAG Highlight Box */
.n8n-rag-highlight-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.25), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.n8n-rag-highlight-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.n8n-rag-icon-pulse {
  font-size: 26px;
  animation: pulseRag 2s infinite ease-in-out;
}
@keyframes pulseRag {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.n8n-rag-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.n8n-rag-title-row strong {
  font-size: 13px;
  color: #93c5fd;
}
.badge-rag-status {
  background: #064e3b;
  color: #6ee7b7;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.n8n-rag-desc {
  font-size: 11.8px;
  color: #94a3b8;
  margin: 3px 0 0 0;
  line-height: 1.4;
}
.highlight-count {
  color: #6ee7b7;
  font-weight: 700;
}
.n8n-rag-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* N8N Presets & Templates */
.n8n-presets-box {
  margin-bottom: 14px;
}
.n8n-presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.n8n-presets-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}
.n8n-presets-sub {
  color: #64748b;
  font-size: 11px;
}
.n8n-templates-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.n8n-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: #111a26;
  border: 1px solid #233345;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.n8n-template-btn:hover {
  background: #182637;
  color: #e2e8f0;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* N8N Variable Chips Container */
.n8n-variables-container {
  padding: 12px 14px;
  background: #0d141e;
  border: 1px solid #1c2b3c;
  border-radius: 10px;
  margin-bottom: 18px;
}
.n8n-variables-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.n8n-variables-header strong {
  font-size: 12px;
  color: #38bdf8;
}
.n8n-var-icon {
  font-size: 14px;
}
.n8n-var-help {
  color: #64748b;
  font-size: 11px;
}
.n8n-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.n8n-var-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: #141f2d;
  border: 1px solid #283e54;
  border-radius: 6px;
  color: #7dd3fc;
  font-family: monospace;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.n8n-var-chip:hover {
  background: #1e3a5f;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}
.n8n-var-chip:active {
  transform: scale(0.96);
}
.n8n-chip-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}
.n8n-chip-badge.badge-var {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}
.n8n-chip-hint {
  font-size: 10.5px;
  color: #64748b;
  margin-left: 2px;
}

/* N8N Editor Section & Toolbar */
.n8n-editor-section {
  margin-bottom: 18px;
}
.n8n-editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.n8n-editor-label {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.n8n-editor-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}
.n8n-char-counter {
  font-size: 11.5px;
  color: #64748b;
  font-family: monospace;
}
.n8n-code-wrapper {
  position: relative;
  border-radius: 10px;
  border: 1px solid #243547;
  background: #06090e;
  overflow: hidden;
  transition: border-color 0.2s;
}
.n8n-code-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}
.n8n-code-editor {
  width: 100% !important;
  box-sizing: border-box !important;
  background: #06090e !important;
  color: #e2e8f0 !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', monospace !important;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
  padding: 14px 16px !important;
  border: none !important;
  outline: none !important;
  resize: vertical !important;
  min-height: 240px !important;
}

/* Live Anti-Error Linter Card */
.n8n-linter-card {
  background: #080d14;
  border: 1px solid #1c2b3c;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 14px;
  margin-bottom: 18px;
}
.n8n-linter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.n8n-linter-title {
  font-size: 13px;
  color: #e2e8f0;
}
.n8n-linter-sub {
  font-size: 11.5px;
  color: #64748b;
  margin: 2px 0 0 0;
}
.n8n-linter-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.linter-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0d1520;
  border: 1px solid #1e2c3e;
}
.linter-check-item.is-ok {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.05);
}
.linter-check-item.is-warn {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}
.lint-icon {
  font-size: 14px;
  font-weight: 800;
}
.lint-icon.lint-ok {
  color: #4ade80;
}
.lint-icon.lint-warn {
  color: #f59e0b;
}
.lint-info strong {
  display: block;
  font-size: 12px;
  color: #e2e8f0;
}
.lint-status-ok {
  font-size: 11px;
  color: #4ade80;
  font-weight: 600;
}
.lint-status-warn {
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
}

/* Guardrails Form Row */
.n8n-guardrails-row {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.form-label-warning {
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 700;
  display: block;
  margin-bottom: 5px;
}
.form-label-info {
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 700;
  display: block;
  margin-bottom: 5px;
}

/* Footer Actions */
.n8n-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
}
.n8n-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.n8n-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.n8n-btn-ai-opt {
  background: #132332 !important;
  border-color: #345575 !important;
  color: #80c2ee !important;
}
.n8n-btn-publish {
  background: linear-gradient(135deg, #16a34a, #059669) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
}

/* Bulk Selection Action Bar in Conversations List */
.conv-bulk-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #111a24;
  border-bottom: 1px solid #1f2f42;
  gap: 8px;
}
.conv-bulk-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.conv-bulk-count {
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  margin-right: 4px;
}
.btn-bulk-chip {
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 5px;
  background: #182635;
  border: 1px solid #283e54;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-bulk-chip:hover {
  background: #1e354e;
  color: #ffffff;
  border-color: #38bdf8;
}
.conv-bulk-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-bulk-purge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  background: #dc2626 !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-bulk-purge:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}
.btn-bulk-cancel {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}
.btn-bulk-cancel:hover {
  color: #ef4444;
}

/* Checkboxes in conv-item */
.conv-select-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 8px;
  flex-shrink: 0;
}
.conv-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #2563eb;
}
.conv-item.selected {
  background: rgba(37, 99, 235, 0.14) !important;
  box-shadow: inset 3px 0 #3b82f6 !important;
}
.bulk-purge-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}
.bulk-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 11.5px;
}
.chip-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chip-name {
  color: #f1f5f9;
  font-weight: 600;
}
.chip-phone {
  color: #fca5a5;
  font-size: 10.5px;
}
.subtab-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #edf5fc;
  letter-spacing: -0.02em;
}
.subtab-header p {
  font-size: 13px;
  color: #8c9faf;
  margin-top: 3px;
}

/* Adaptive dynamic segment questions box */
.dynamic-segment-box {
  margin-top: 24px;
  padding: 20px;
  background: #0f1621;
  border: 1px solid #283a4c;
  border-radius: 14px;
}
.dynamic-segment-box h4 {
  font-size: 15px;
  color: #9cd5fa;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dynamic-segment-box p {
  font-size: 12.5px;
  color: #7b90a2;
  margin-bottom: 16px;
}
.dynamic-questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Behavior toggles grid */
.perm-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.perm-toggle-card {
  padding: 14px 16px;
  background: #111822;
  border: 1px solid #233444;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.perm-toggle-card span {
  font-size: 13px;
  font-weight: 600;
  color: #d6e4f0;
}

/* AI Optimizer Banner & Checklist */
.ai-optimizer-banner {
  padding: 24px;
  background: radial-gradient(circle at 85% 20%, rgba(91, 169, 226, 0.18), transparent 45%), linear-gradient(135deg, #131d28 0%, #0d141d 100%);
  border: 1px solid #2e4458;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.ai-optimizer-banner h3 {
  font-size: 20px;
  font-weight: 700;
  color: #f1f7fd;
}
.ai-optimizer-banner p {
  font-size: 13px;
  color: #9eb2c4;
  margin-top: 4px;
  max-width: 580px;
}
.missing-questions-card {
  background: #131a24;
  border: 1px solid #433320;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.missing-q-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: #0d131b;
  border-radius: 8px;
  border: 1px solid #23303d;
  margin-top: 10px;
}
.missing-q-item strong {
  font-size: 13px;
  color: #fce7b0;
}
.optimizer-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.summary-spec-card {
  background: #101620;
  border: 1px solid #233242;
  border-radius: 12px;
  padding: 16px;
}
.summary-spec-card h5 {
  font-size: 13px;
  color: #92d0f5;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.summary-spec-card p {
  font-size: 12px;
  line-height: 1.5;
  color: #cbd8e5;
}

/* Simulator & Scenarios UI */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.scenario-card-btn {
  padding: 12px 14px;
  background: #121924;
  border: 1px solid #26384a;
  border-radius: 10px;
  color: #cbdde9;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scenario-card-btn:hover {
  background: #192736;
  border-color: #5593be;
  color: #fff;
}
.scenario-card-btn small {
  font-size: 11px;
  color: #798f9f;
  font-weight: 400;
}
.audit-indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.indicator-card {
  background: #111822;
  border: 1px solid #253748;
  border-radius: 12px;
  padding: 14px;
}
.indicator-card .ind-label {
  font-size: 12px;
  color: #8da4b6;
  font-weight: 600;
}
.indicator-card .ind-val {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 8px;
}
.ind-bar {
  height: 6px;
  background: #1c2734;
  border-radius: 6px;
  overflow: hidden;
}
.ind-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

/* =========================================================================
   ENHANCED KNOWLEDGE BASE & CONFLICTS
   ========================================================================= */
.kb-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.kb-actions-left, .kb-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kb-category-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}
.kb-cat-chip {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  background: #121922;
  border: 1px solid #263543;
  color: #8ba0b2;
  cursor: pointer;
  white-space: nowrap;
}
.kb-cat-chip.active, .kb-cat-chip:hover {
  background: #1c2c3b;
  color: #c9e8fb;
  border-color: #4f8ab0;
}
.kb-item-card {
  padding: 12px 14px;
  background: #111720;
  border: 1px solid #233140;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-item-card:hover {
  background: #16202c;
  border-color: #3b5066;
}
.kb-item-card.active {
  background: #192736;
  border-color: #63a9d9;
  box-shadow: inset 3px 0 #89cbf4;
}
.kb-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kb-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ecf3f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #7b91a2;
}
.kb-cat-badge {
  padding: 2px 7px;
  border-radius: 5px;
  background: #1a2734;
  color: #92c6e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9.5px;
}
.kb-priority-pill {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
.kb-unanswered-banner {
  padding: 14px 18px;
  background: linear-gradient(90deg, #1b2836, #121c27);
  border: 1px solid #2f4559;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* =========================================================================
   PIPELINE CRM REDESIGN & KANBAN
   ========================================================================= */
.pipeline-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.pipe-metric-box {
  background: #101620;
  border: 1px solid #233140;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pipe-metric-box .val {
  font-size: 20px;
  font-weight: 700;
  color: #f1f7fc;
  font-family: var(--font-mono);
}
.pipe-metric-box .lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: #7d93a5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pipeline-copilot-card {
  padding: 14px 18px;
  background: radial-gradient(circle at 95% 50%, rgba(93, 172, 230, 0.14), transparent 45%), #0f1621;
  border: 1px solid #2a3c50;
  border-radius: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.copilot-spark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #193144;
  color: #92d4fa;
  display: grid;
  place-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.copilot-content h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #e5f1f9;
}
.copilot-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.copilot-alert-pill {
  font-size: 12px;
  color: #b3c9db;
  display: flex;
  align-items: center;
  gap: 8px;
}
.copilot-alert-pill span {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  background: #25394d;
  color: #8ed0f8;
}

/* Pipeline Kanban columns & Rich lead cards */
.pipeline-container {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 24px;
  min-height: calc(100vh - 310px);
}
.pipeline-col {
  flex: 0 0 295px;
  max-width: 295px;
  background: #0d131b;
  border: 1px solid #202d3c;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 300px);
}
.pipeline-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid #1f2c3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 3px solid #3b82f6;
  border-radius: 13px 13px 0 0;
}
.pipeline-col-header .col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pipeline-col-header .col-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #eef5fb;
}
.pipeline-col-header .col-badge {
  padding: 2px 7px;
  border-radius: 6px;
  background: #172432;
  color: #92b8d4;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.pipeline-col-header .col-sum {
  font-size: 11px;
  color: #6d8396;
  font-family: var(--font-mono);
}
.pipeline-cards-list {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Rich Lead Card */
.lead-card-rich {
  background: #121923;
  border: 1px solid #233344;
  border-radius: 12px;
  padding: 13px;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lead-card-rich:hover {
  transform: translateY(-2px);
  border-color: #4a7496;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.lead-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.lead-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f7fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead-card-phone {
  font-size: 11.5px;
  color: #8da4b6;
  display: flex;
  align-items: center;
  gap: 4px;
}
.temp-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.temp-pill.hot {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.temp-pill.warm {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}
.temp-pill.cold {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}
.lead-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #1a2734;
  margin-top: 2px;
}
.lead-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #86efac;
  font-family: var(--font-mono);
}
.lead-timer {
  font-size: 10.5px;
  color: #71889a;
}
.lead-agent-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
}
.lead-agent-badge.ai {
  background: #172c35;
  color: #7ee2d7;
}
.lead-agent-badge.human {
  background: #39242d;
  color: #fca5a5;
}

/* =========================================================================
   LEAD DETAIL DRAWER (TIMELINE, TASKS, CUSTOM FIELDS)
   ========================================================================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 4, 10, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}
.drawer-panel {
  width: 580px;
  max-width: 95vw;
  height: 100vh;
  background: #0d131c;
  border-left: 1px solid #253648;
  display: flex;
  flex-direction: column;
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.65);
  animation: slideDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #202e3e;
  background: #111924;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #edf5fb;
}
.drawer-header p {
  font-size: 12.5px;
  color: #8da4b7;
  margin-top: 3px;
}
.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 24px;
  background: #0f1622;
  border-bottom: 1px solid #1f2c3b;
  overflow-x: auto;
}
.drawer-tab-btn {
  padding: 7px 13px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: #8aa1b4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.drawer-tab-btn.active {
  background: #1a2837;
  border-color: #3b5670;
  color: #d8edf9;
}
.drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* Timeline events inside drawer */
.timeline-stream {
  position: relative;
  padding-left: 20px;
}
.timeline-stream::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 6px;
  width: 2px;
  background: #1f2d3d;
}
.timeline-node {
  position: relative;
  margin-bottom: 18px;
}
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1b2e3e;
  border: 2px solid #5ba3d3;
}
.timeline-card {
  background: #121a25;
  border: 1px solid #233446;
  border-radius: 10px;
  padding: 12px 14px;
}
.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.timeline-card-header strong {
  font-size: 12.5px;
  color: #d6e7f5;
}
.timeline-card-header span {
  font-size: 11px;
  color: #6e8496;
}
.timeline-card p {
  font-size: 12px;
  color: #9ab0c2;
  line-height: 1.45;
}

.drawer-subbar {
  padding: 14px 24px;
  background: #0f1622;
  border-bottom: 1px solid #1f2c3b;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.drawer-subbar-label {
  font-size: 11px;
  color: #7b91a3;
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}
.drawer-box {
  background: #111925;
  border: 1px solid #203144;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.drawer-box-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #92d0f5;
  margin-bottom: 10px;
}
.drawer-footer {
  padding: 16px 24px;
  background: #0d141e;
  border-top: 1px solid #1e2b3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-empty-state {
  color: #72899d;
  font-size: 12.5px;
  text-align: center;
  padding: 24px 16px;
  background: #0f1622;
  border-radius: 10px;
  border: 1px dashed #203144;
}
.drawer-note-item {
  background: #111925;
  border: 1px solid #203144;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.drawer-note-item span {
  font-size: 11px;
  color: #6d8498;
}
.drawer-note-item p {
  color: #d6e7f5;
  font-size: 12.5px;
  margin: 4px 0 0 0;
  line-height: 1.5;
}
.modal-form-box {
  background: #101824;
  border: 1px solid #213245;
  border-radius: 12px;
  padding: 16px;
}
.modal-form-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #91cff5;
  margin-bottom: 10px;
}
.task-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #111823;
  border: 1px solid #223344;
  border-radius: 9px;
  margin-bottom: 8px;
}
.task-item-row .task-title {
  color: #edf5fb;
  font-size: 13px;
  font-weight: 600;
}
.task-item-row .task-due {
  color: #7a94a9;
  font-size: 11px;
  display: block;
  margin-top: 2px;
}
.task-item-row .task-notes {
  color: #9ab0c2;
  font-size: 11.5px;
  display: block;
}
.task-item-row.done {
  opacity: 0.6;
}
.task-item-row.done .task-title {
  text-decoration: line-through;
}

/* =========================================================================
   SERVICE MODE SWITCHER & AGENT HEADER
   ========================================================================= */
.agent-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0f1620;
  border: 1px solid #233446;
  border-radius: 14px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.mode-selector-group {
  display: inline-flex;
  background: #080d13;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #1f2d3d;
  gap: 4px;
}
.mode-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #7d93a6;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mode-pill-btn:hover {
  color: #d8ebf7;
  background: rgba(255, 255, 255, 0.04);
}
.mode-pill-btn.active {
  background: #1e3144;
  color: #66b5e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1px solid #3d607f;
}

/* =========================================================================
   MENU BOT BUILDER (OPÇÕES & FLUXOS)
   ========================================================================= */
.menu-options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.menu-option-row {
  display: flex;
  gap: 12px;
  background: #0d141d;
  border: 1px solid #223244;
  border-radius: 12px;
  padding: 14px;
  align-items: flex-start;
  transition: border-color 0.2s;
}
.menu-option-row:hover {
  border-color: #3b5368;
}
.option-digit-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #172432;
  border: 1px solid #2f455b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #7bc5f1;
  font-size: 15px;
  flex-shrink: 0;
}
.option-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* =========================================================================
   RAG KNOWLEDGE IN AGENT CENTER
   ========================================================================= */
.agent-rag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.rag-card {
  background: #0d151f;
  border: 1px solid #203142;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.15s, border-color 0.15s;
}
.rag-card:hover {
  transform: translateY(-2px);
  border-color: #385775;
}
.rag-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.rag-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #e2f0fa;
  margin-bottom: 4px;
}
.rag-card-category {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7ea3bf;
}
.rag-card-preview {
  font-size: 12px;
  color: #8da4b7;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================================
   CHAT ATTACHMENT POPOVER & MEDIA PREVIEW BAR
   ========================================================================= */
.chat-attachment-popover {
  position: absolute;
  bottom: 64px;
  left: 14px;
  background: #111a24;
  border: 1px solid #283d52;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 80;
  min-width: 190px;
  animation: popIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.attachment-pop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #d1e5f5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.attachment-pop-item:hover {
  background: #1b2837;
  color: #fff;
}
.attach-icon {
  font-size: 17px;
  width: 24px;
  text-align: center;
}

.chat-media-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111a25;
  border: 1px solid #2a3c4e;
  border-radius: 12px;
  margin: 0 12px 8px 12px;
  padding: 10px 14px;
  position: relative;
  z-index: 20;
}
.media-preview-thumb-box {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #182330;
  border: 1px solid #2e4358;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.media-preview-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.media-filename {
  font-size: 12.5px;
  font-weight: 600;
  color: #e5f2fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-size {
  font-size: 11px;
  color: #7991a3;
}
.media-caption-input {
  background: #090e14;
  border: 1px solid #213242;
  border-radius: 6px;
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  outline: none;
}
.media-caption-input:focus {
  border-color: #5ba3d3;
}
.btn-close-preview {
  background: transparent;
  border: none;
  color: #8fa5b8;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-close-preview:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}
.btn-mic-recording {
  background: #ef4444 !important;
  color: #fff !important;
  animation: pulseMic 1.2s infinite;
}
@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Voice recording live bar in chat input */
.chat-recording-bar {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 20px;
  box-sizing: border-box;
  animation: fadeInRec 0.2s ease-out;
}
@keyframes fadeInRec {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.btn-rec-cancel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-rec-cancel:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.02);
}
.recording-indicator-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.recording-pulse-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: pulseRecDot 1.4s infinite;
}
@keyframes pulseRecDot {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.recording-timer {
  font-family: 'JetBrains Mono', monospace, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #f87171;
  flex-shrink: 0;
}
.recording-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  flex-shrink: 0;
}
.rec-wave-bar {
  width: 3px;
  background: #f87171;
  border-radius: 2px;
  animation: recWaveMotion 1s ease-in-out infinite alternate;
}
.rec-wave-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.rec-wave-bar:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.rec-wave-bar:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.rec-wave-bar:nth-child(4) { height: 10px; animation-delay: 0.4s; }
.rec-wave-bar:nth-child(5) { height: 8px; animation-delay: 0.15s; }
@keyframes recWaveMotion {
  0% { height: 4px; opacity: 0.4; }
  100% { height: 18px; opacity: 1; }
}
.recording-hint {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recording-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-rec-stop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-rec-stop:hover {
  background: #334155;
  color: #fff;
}
.btn-rec-send-direct {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-rec-send-direct:hover {
  background: #059669;
  transform: translateY(-1px);
}
.chat-preview-audio-wrap {
  margin: 6px 0;
  width: 100%;
}
.chat-preview-audio-wrap audio {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  outline: none;
}

/* =========================================================================
   INTELLIGENT AGENT & MENU BOT WIZARDS (AI COMPREHENSION & APPROVAL)
   ========================================================================= */
.wizard-hero-box {
  background: linear-gradient(135deg, rgba(20, 32, 46, 0.95), rgba(12, 19, 28, 0.98));
  border: 1px solid #25394d;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.wizard-hero-box::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.wizard-title {
  font-size: 18px;
  font-weight: 700;
  color: #f1f7fc;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard-subtitle {
  font-size: 13px;
  color: #92a9bc;
  line-height: 1.5;
  max-width: 780px;
  margin-bottom: 18px;
}
.wizard-chips-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.wizard-chip-label {
  font-size: 11px;
  color: #6c8496;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.wizard-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #233446;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  color: #9ac4e2;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.wizard-chip-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}
.wizard-textarea {
  width: 100%;
  background: #090f17;
  border: 1.5px solid #22374b;
  border-radius: 10px;
  padding: 14px 16px;
  color: #f1f7fc;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.wizard-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.btn-wizard-generate {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}
.btn-wizard-generate:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}
.btn-wizard-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Approval Card */
.wizard-approval-card {
  background: #0d1520;
  border: 1.5px solid #23415c;
  border-radius: 14px;
  padding: 24px;
  margin-top: 24px;
  position: relative;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}
.approval-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #1c2e40;
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.approval-title-box h4 {
  font-size: 16px;
  color: #e2f0fb;
  margin: 0 0 4px 0;
  font-weight: 700;
}
.approval-title-box span {
  font-size: 12px;
  color: #8da4b7;
}
.approval-badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.approval-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.approval-box {
  background: #121c27;
  border: 1px solid #223447;
  border-radius: 10px;
  padding: 14px 16px;
}
.approval-box-title {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.approval-box-content {
  font-size: 12.5px;
  color: #cbdbe7;
  line-height: 1.55;
}
.approval-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid #1c2e40;
  padding-top: 18px;
  margin-top: 10px;
}
.btn-approve-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 12px 24px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
  transition: all 0.2s ease;
}
.btn-approve-success:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
  transform: translateY(-1px);
}
.whatsapp-chat-bubble-preview {
  background: #005c4b;
  color: #e9edef;
  border-radius: 10px 10px 2px 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-width: 520px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* =========================================================================
   RBAC - ROLES, USER PROFILE & AUTH STYLING
   ========================================================================= */

/* Topbar User Profile Pill */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111822;
  border: 1px solid #233140;
  border-radius: 10px;
  padding: 4px 8px 4px 6px;
  margin-left: 6px;
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-space;
  background: linear-gradient(135deg, #1e3a5f, #0f243d);
  border: 1px solid #3b82f6;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-meta-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name-text {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 2px;
}

/* Role Badges Variants */
.role-badge-master {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.role-badge-company_admin {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.role-badge-operator {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-logout {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Auth Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 30%, rgba(20, 32, 50, 0.95), rgba(6, 8, 12, 0.98));
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #0f151e;
  border: 1px solid #233346;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(56, 189, 248, 0.08);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
}

.login-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand-icon-wrap {
  margin: 0 auto 12px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.login-brand-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0;
}

.login-brand-header h2 span.brand-dot {
  color: #38bdf8;
  font-weight: 900;
}

.login-tenant-badge {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.tenant-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.tenant-dot {
  width: 6px;
  height: 6px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 8px #38bdf8;
}

.login-brand-header p {
  color: #94a3b8;
  font-size: 13px;
  margin-top: 6px;
}

.login-form-group {
  margin-bottom: 16px;
}

.login-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap .input-lead-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.login-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px 12px 38px;
  background: #090d13;
  border: 1px solid #223244;
  border-radius: 10px;
  color: #fff;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

.login-input-wrap input:focus {
  border-color: #38bdf8;
  outline: none;
  background: #0c121b;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.login-input-wrap input:focus + .input-lead-icon,
.login-input-wrap:focus-within .input-lead-icon {
  color: #38bdf8;
}

.btn-pwd-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s;
}

.btn-pwd-eye:hover {
  color: #cbd5e1;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 12px;
}

.login-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
}

.login-remember-label input[type="checkbox"] {
  accent-color: #38bdf8;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.login-encryption-badge {
  color: #64748b;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.login-error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #fca5a5;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: loginShake 0.35s ease;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.btn-login-submit {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.btn-login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

/* Demo Roles Drawer (Subtle and Collapsed by Default) */
.demo-mode-container {
  margin-top: 24px;
  border-top: 1px solid #1a2533;
  padding-top: 16px;
}

.btn-demo-mode-toggle {
  width: 100%;
  background: transparent;
  border: 1px dashed #243547;
  border-radius: 8px;
  padding: 8px 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.btn-demo-mode-toggle:hover {
  background: #111823;
  color: #94a3b8;
  border-color: #3b82f6;
}

.demo-arrow {
  transition: transform 0.2s ease;
}

.demo-arrow.expanded {
  transform: rotate(180deg);
}

.demo-roles-panel {
  margin-top: 12px;
  transition: all 0.25s ease;
}

.demo-roles-note {
  font-size: 10.5px;
  color: #64748b;
  margin-bottom: 8px;
  text-align: center;
}

.quick-role-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-quick-role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #131c28;
  border: 1px solid #243547;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.btn-quick-role:hover {
  background: #182433;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-quick-role .role-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.btn-quick-role .role-desc {
  font-size: 10px;
  color: #8da2b6;
}

.btn-quick-role .role-badge-pill {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

/* Team Management View */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.team-card {
  background: #0f151e;
  border: 1px solid #213245;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.team-card:hover {
  border-color: #334b66;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.team-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.team-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #94a3b8;
}

.team-card-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 2px;
}

.team-card-info p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.team-card-body {
  border-top: 1px solid #1a2736;
  border-bottom: 1px solid #1a2736;
  padding: 12px 0;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-card-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.team-card-meta-label {
  color: #64748b;
  font-weight: 500;
}

.team-card-meta-val {
  color: #cbd5e1;
  font-weight: 600;
}

.team-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* =========================================================================
   ATTENDANT ASSIGNMENT & TRANSFER STYLES
   ========================================================================= */
.conv-attendant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.conv-attendant-tag.tag-ai {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.conv-attendant-tag.tag-mine {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.conv-attendant-tag.tag-other {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.conv-attendant-tag.tag-queue {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.attendant-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.attendant-pill.pill-ai {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.attendant-pill.pill-mine {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.attendant-pill.pill-other {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.attendant-pill.pill-queue {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

#chat-attendant-filter-bar select {
  font-size: 11px;
  background: #111a24;
  color: #cbd5e1;
  border: 1px solid #2a3b4c;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

#chat-attendant-filter-bar select:focus {
  border-color: #38bdf8;
}

/* =========================================================================
   PWA & SOUND ALERTS & MOBILE RESPONSIVENESS
   ========================================================================= */

/* Topbar Sound Alert Toggle */
.btn-topbar-sound {
  background: #111a24;
  border: 1px solid #233346;
  border-radius: 9px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s ease;
}

.btn-topbar-sound:hover {
  background: #182533;
  border-color: #38bdf8;
  transform: scale(1.05);
}

.btn-topbar-sound.sound-muted {
  opacity: 0.55;
  filter: grayscale(1);
  border-color: #1e293b;
}

/* Topbar PWA Install Button */
.btn-topbar-pwa {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  animation: pwaPulse 2.5s infinite;
}

.btn-topbar-pwa:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.35));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

@keyframes pwaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.3); }
  50% { box-shadow: 0 0 12px 3px rgba(56, 189, 248, 0.2); }
}

/* Floating PWA Mobile Banner */
.pwa-mobile-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 9999;
  background: #0f1622;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideUpBanner 0.3s ease;
}

@keyframes slideUpBanner {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.pwa-banner-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-pwa-dismiss {
  background: none;
  border: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
}

.btn-pwa-dismiss:hover {
  color: #94a3b8;
}

.btn-pwa-install-act {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

/* Mobile Hamburger Button */
.btn-mobile-menu {
  display: none;
  background: none;
  border: 1px solid #243547;
  border-radius: 8px;
  color: #94a3b8;
  padding: 6px 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.btn-chat-back {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  margin-right: 4px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
}

.btn-chat-back:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Mobile Sidebar Backdrop */
.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 998;
}

/* =========================================================================
   RECUPERADOR DE VENDAS & WEBHOOKS UNIVERSAIS
   ========================================================================= */
.recovery-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recovery-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  background: radial-gradient(circle at 85% 30%, rgba(245, 158, 11, 0.08), transparent 45%), #0e1622;
  border: 1px solid #1f2e42;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  gap: 16px;
}

.recovery-header-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #090e15;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #1e2c3d;
}

.recovery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.recovery-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recovery-card {
  background: #0d141e;
  border: 1px solid #1f2e42;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.recovery-card-header {
  padding: 14px 18px;
  background: #111a26;
  border-bottom: 1px solid #1c2a3b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recovery-card-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: #e2f0fb;
  margin: 0;
}

.recovery-card-body {
  padding: 18px;
}

.recovery-url-box {
  display: flex;
  gap: 8px;
  background: #070b10;
  border: 1px solid #233446;
  border-radius: 9px;
  padding: 4px 6px;
  align-items: center;
}

.recovery-url-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
}

.platform-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.plat-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: 5px;
  background: #131c28;
  color: #8daec9;
  border: 1px solid #203144;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.recovery-mode-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-radio-card {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid #203144;
  background: #0b1118;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: flex-start;
}

.mode-radio-card:hover {
  border-color: #3b82f6;
  background: #0e1622;
}

.mode-radio-card input {
  margin-top: 3px;
  cursor: pointer;
}

.mode-radio-content {
  display: flex;
  flex-direction: column;
}

.recovery-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #070b10;
  border: 1px solid #1f2f42;
  border-radius: 8px;
  padding: 10px 12px;
  color: #f1f5f9;
  font-size: 12.5px;
  font-family: var(--font-sans);
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.recovery-textarea:focus {
  border-color: #3b82f6;
}

.template-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tmpl-tab-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #203144;
  background: #0e1520;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tmpl-tab-btn.active {
  background: #1e3a5f;
  color: #93c5fd;
  border-color: #3b82f6;
}

.tmpl-variables-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.recovery-table-container {
  overflow-x: auto;
  max-height: 380px;
  overflow-y: auto;
}

.recovery-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.recovery-table th {
  text-align: left;
  padding: 10px 14px;
  background: #111a26;
  color: #8daec9;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1e2c3d;
  position: sticky;
  top: 0;
  z-index: 2;
}

.recovery-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #15202d;
  color: #e2e8f0;
}

.recovery-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* =========================================================================
   AGENDAMENTOS & GOOGLE CALENDAR
   ========================================================================= */
.calendar-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  background: radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 45%), #0e1622;
  border: 1px solid #1f2e42;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  gap: 16px;
}

.calendar-header-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #090e15;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #1e2c3d;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* =========================================================================
   VISUAL LUXE CALENDAR SYSTEM
   ========================================================================= */
.cal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.cal-kpi-card {
  background: #0e1622;
  border: 1px solid #1f2e42;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.cal-kpi-card:hover {
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.cal-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cal-kpi-val {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

.cal-kpi-label {
  font-size: 11.5px;
  color: #8fa6b8;
  font-weight: 500;
  margin-top: 2px;
}

/* Interactive Calendar Layout */
.cal-interactive-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Main Calendar Card */
.cal-main-calendar-card {
  background: #0e1622;
  border: 1px solid #1f2e42;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
}

.cal-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #1a2736;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.cal-nav-buttons {
  display: flex;
  align-items: center;
  background: #090e15;
  border: 1px solid #1f2f42;
  border-radius: 8px;
  padding: 2px;
}

.cal-nav-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav-btn:hover {
  background: #1e2c3d;
  color: #fff;
}

.cal-nav-today-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-left: 1px solid #1f2f42;
  border-right: 1px solid #1f2f42;
}

.cal-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  padding: 6px 0 10px;
}

.cal-month-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  flex: 1;
}

.cal-day-cell {
  background: #090e15;
  border: 1px solid #162230;
  border-radius: 10px;
  min-height: 72px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  position: relative;
}

.cal-day-cell:hover {
  background: #111a26;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.cal-day-cell.other-month {
  opacity: 0.35;
  background: #06090e;
}

.cal-day-cell.today {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25) inset;
}

.cal-day-cell.today .cal-day-number {
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day-cell.selected {
  background: linear-gradient(145deg, #101c2c, #0e1622);
  border-color: #60a5fa !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.cal-day-cell.selected .cal-day-number {
  color: #93c5fd;
  font-weight: 700;
}

.cal-day-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-day-number {
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.cal-day-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: 4px;
}

.cal-day-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Day Detail Card (Right column) */
.cal-day-detail-card {
  background: #0e1622;
  border: 1px solid #1f2e42;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
}

.cal-day-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #1a2736;
}

.cal-section-box {
  background: #090e15;
  border: 1px solid #172433;
  border-radius: 10px;
  padding: 14px;
}

.cal-slots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  margin-top: 6px;
}

.cal-slot-btn {
  background: #111a26;
  border: 1px solid #233446;
  color: #93c5fa;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cal-slot-btn:hover {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
}

.cal-day-appointments-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 290px;
  margin-top: 6px;
  padding-right: 2px;
}

.cal-day-appt-card {
  background: #101924;
  border: 1px solid #1e2c3d;
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cal-day-appt-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.cal-appt-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.cal-appt-time-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cal-appt-time-pill {
  background: #172535;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.cal-appt-status-badge {
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

.cal-appt-status-badge.is-confirmed {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cal-appt-status-badge.is-other {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.cal-appt-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.cal-appt-btn-cancel {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.cal-appt-btn-cancel:hover {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.cal-appt-btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.cal-appt-btn-delete:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.cal-day-appt-card .meet-link-btn {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.cal-day-appt-card .meet-link-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.cal-appt-body-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cal-appt-lead-name {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 13.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cal-appt-lead-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #8fa6b8;
  min-width: 0;
}

.cal-appt-lead-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8fa6b8;
}

.cal-appt-summary-chip {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-all-appts-card {
  background: #0e1622;
  border: 1px solid #1f2e42;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Sales Recovery Redesign Styles */
.recovery-platform-card {
  background: #090e15;
  border: 1px solid #1c2a3a;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.recovery-platform-card:hover {
  border-color: #3b82f6;
  background: #0d1520;
}

.recovery-delay-pill-btn {
  background: #090e15;
  border: 1px solid #1e2c3d;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.recovery-delay-pill-btn:hover {
  border-color: #3b82f6;
  color: #e2e8f0;
}

.recovery-delay-pill-btn.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Prompt Redesign Styles */
.tone-pill-btn {
  background: #090e15;
  border: 1px solid #1e2c3d;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tone-pill-btn:hover {
  border-color: #3b82f6;
  color: #fff;
}

.tone-pill-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.work-day-pill {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #1e2c3d;
  background: #090e15;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.work-day-pill:hover {
  border-color: #3b82f6;
  color: #e2e8f0;
}

.work-day-pill.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 700;
}

.cal-slot-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background: #111a26;
  border: 1px solid #233446;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #93c5fa;
  margin: 3px;
}

.meet-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  color: #34d399;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.meet-link-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* Sidebar Tenant Box (Desktop hidden, Mobile drawer visible) */
.sidebar-tenant-box {
  display: none;
}

/* =========================================================================
   SISTEMA RESPONSIVO MOBILE NATIVO & PWA (iOS / ANDROID / SAFARI / CHROME)
   ========================================================================= */

@media (max-width: 900px) {
  /* 1. Shell & Base Layout */
  html, body {
    overflow-x: hidden;
    height: 100%;
    -webkit-text-size-adjust: 100%;
  }

  .app-layout {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0 !important;
    background: #070a0f !important;
  }

  .content-container {
    padding: 14px 12px 36px !important;
    flex: 1 1 auto;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    min-height: 0 !important;
  }

  /* When conversations view is active, container MUST NOT scroll or have padding */
  .content-container:has(#view-conversations.active),
  .content-container.chat-active-tab,
  #view-conversations.active {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    height: calc(100dvh - 54px) !important;
    max-height: calc(100dvh - 54px) !important;
    flex: 1 1 auto !important;
  }

  /* 2. Off-canvas Mobile Drawer Navigation */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 300px !important;
    max-width: 84vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1200 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.88) !important;
    background: #0a0e15 !important;
    border-right: 1px solid #1f2e40 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar-brand {
    padding: 18px 16px 14px !important;
    min-height: 64px !important;
    border-bottom: 1px solid #1c2a3b !important;
  }

  .sidebar-tenant-box {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 12px 14px !important;
    padding: 12px !important;
    background: #111822 !important;
    border: 1px solid #233446 !important;
    border-radius: 10px !important;
  }

  .sidebar-tenant-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .sidebar-tenant-label {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #8da6bd !important;
    letter-spacing: 0.08em !important;
    font-family: var(--font-mono) !important;
  }

  .sidebar-btn-new-tenant {
    background: rgba(145, 216, 255, 0.15) !important;
    border: 1px solid rgba(145, 216, 255, 0.3) !important;
    color: #91d8ff !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer;
  }

  .sidebar-tenant-select {
    width: 100% !important;
    background: #090e15 !important;
    border: 1px solid #26384c !important;
    color: #e2e8f0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    outline: none !important;
  }

  .sidebar-menu {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 8px 12px 24px !important;
    gap: 4px !important;
    flex: 1 1 auto !important;
  }

  .nav-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 14px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 13px !important;
  }

  .sidebar-section-label {
    padding: 16px 14px 6px !important;
  }

  .nav-divider {
    margin: 16px 12px 8px !important;
  }

  .sidebar-footer {
    padding: 14px 16px !important;
    border-top: 1px solid #1c2a3b !important;
  }

  /* 3. Topbar Header: Sleek Single Line (54px) - ZERO WRAPPING */
  .topbar {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    background: rgba(9, 14, 21, 0.96) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1px solid #1e2c3c !important;
    position: relative !important;
    top: 0 !important;
    z-index: 500 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .btn-mobile-menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    background: #141f2c !important;
    border: 1px solid #2d4158 !important;
    border-radius: 9px !important;
    color: #e2e8f0 !important;
    cursor: pointer;
    flex-shrink: 0 !important;
    padding: 0 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
  }

  .topbar-kicker {
    display: none !important;
  }

  #page-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #edf4fa !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 140px !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  /* Completely hide bulky desktop items on mobile topbar */
  .topbar .tenant-selector-wrap,
  .tenant-selector-wrap,
  #tenant-selector-wrap,
  #tenant-static-wrap,
  #btn-open-playground,
  #global-ai-toggle {
    display: none !important;
  }

  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    width: auto !important;
    justify-content: flex-end !important;
  }

  /* Theme Switcher Button Compact on Mobile */
  .btn-topbar-theme {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background: #111822 !important;
    border: 1px solid #233446 !important;
  }

  .btn-topbar-theme .theme-pill-label {
    display: none !important;
  }

  .btn-topbar-theme .theme-pill-track {
    margin: 0 !important;
  }

  /* Sound alert toggle button */
  .btn-topbar-sound {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    border: 1px solid #233446 !important;
    background: #111822 !important;
  }

  /* PWA install pill compact */
  .btn-topbar-pwa {
    padding: 0 8px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .btn-topbar-pwa span {
    display: none !important;
  }
  .btn-topbar-pwa::after {
    content: "📲";
    font-size: 14px;
  }

  /* WhatsApp status: compact circle dot indicator */
  #wa-status-pill {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
  }
  #wa-status-text {
    display: none !important;
  }
  #wa-status-pill .status-dot {
    margin: 0 !important;
  }

  /* User profile pill: compact circular avatar */
  .user-profile-pill {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    gap: 0 !important;
    cursor: pointer;
  }
  .user-avatar-badge {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 12px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #1b3552, #0d1e30) !important;
    border: 1.5px solid #3b82f6 !important;
    color: #93c5fd !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.25) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .user-meta-info,
  .btn-logout {
    display: none !important;
  }

  /* 4. Tab 2: WhatsApp Conversations (Native App Experience) */
  #view-conversations {
    padding: 0 !important;
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .chat-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #090e15 !important;
    position: relative !important;
    margin: 0 !important;
  }

  /* State 1: When list is active (DEFAULT on mobile) */
  .chat-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    border-right: none !important;
    background: #0c1219 !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .chat-sidebar-header {
    padding: 10px 12px 8px !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid #1a2533 !important;
    background: #0e151f !important;
  }

  .chat-filter-chips {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    scrollbar-width: none;
    display: flex !important;
    gap: 6px !important;
  }
  .chat-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .conv-list {
    flex: 1 1 auto !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 0 !important;
    background: #090e15 !important;
  }

  .chat-main {
    display: none !important;
  }

  /* State 1: When list is active on mobile (DEFAULT) */
  #view-conversations .chat-sidebar,
  #view-conversations[data-mobile-view="list"] .chat-sidebar {
    display: flex !important;
  }
  #view-conversations:not(.mobile-chat-active):not([data-mobile-view="chat"]) .chat-main {
    display: none !important;
  }

  /* State 2: When active chat is opened on mobile (.mobile-chat-active OR data-mobile-view="chat") */
  #view-conversations.mobile-chat-active .chat-sidebar,
  #view-conversations[data-mobile-view="chat"] .chat-sidebar {
    display: none !important;
  }

  #view-conversations.mobile-chat-active .chat-main,
  #view-conversations[data-mobile-view="chat"] .chat-main {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 110 !important;
    background: #070b10 !important;
  }

  #view-conversations.mobile-chat-active .chat-active-panel,
  #view-conversations[data-mobile-view="chat"] .chat-active-panel {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  .btn-chat-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #e2e8f0 !important;
    cursor: pointer;
    flex-shrink: 0 !important;
    margin-right: 6px !important;
  }

  .chat-header {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 0 10px !important;
    background: #111822 !important;
    border-bottom: 1px solid #1f2c3d !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    z-index: 20 !important;
  }

  .chat-header-user {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .contact-avatar-circle {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    font-size: 13px !important;
  }

  .chat-contact-info {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .chat-contact-info h4 {
    font-size: 13.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    max-width: 130px !important;
  }

  .chat-contact-subline {
    font-size: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 130px !important;
  }

  .chat-controls {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }

  .chat-controls .pill-stage {
    display: none !important;
  }

  .chat-controls .pill-ai {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  .chat-controls .attendant-pill {
    display: none !important;
  }

  .chat-controls .btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    height: 30px !important;
    white-space: nowrap !important;
  }

  .chat-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 12px 10px !important;
    overscroll-behavior-y: contain;
  }

  .chat-input-bar {
    display: flex !important;
    align-items: center !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 8px !important;
    min-height: 54px !important;
    background: #101620 !important;
    border-top: 1px solid #1f2b3a !important;
    flex-shrink: 0 !important;
    z-index: 20 !important;
  }

  #chat-msg-input,
  #manual-msg-input {
    font-size: 15px !important;
    min-height: 38px !important;
    border-radius: 20px !important;
    padding: 0 14px !important;
  }

  /* 5. Dashboard Tab on Mobile */
  .dashboard-intro {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .dashboard-intro h2 {
    font-size: 26px !important;
    line-height: 1.2 !important;
  }

  .dashboard-columns {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 16px !important;
  }

  .operation-panel, .attention-panel {
    min-height: auto !important;
    padding: 20px 16px !important;
  }

  .operation-copy {
    width: 100% !important;
  }

  .agent-core {
    display: none !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 14px !important;
    min-height: 96px !important;
  }

  .stat-value {
    font-size: 24px !important;
  }

  /* 6. Pipeline CRM on Mobile */
  .pipeline-board {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 12px !important;
    padding-bottom: 16px !important;
  }

  .pipeline-column {
    min-width: 82vw !important;
    max-width: 82vw !important;
    scroll-snap-align: start;
    flex-shrink: 0 !important;
  }

  /* 7. Contacts & Tables on Mobile */
  .table-responsive, .contacts-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* 8. Sales Recovery & Calendar on Mobile */
  .recovery-grid,
  .calendar-grid,
  .cal-interactive-layout {
    grid-template-columns: 1fr !important;
  }

  .cal-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==========================================================================
   CAMPAIGN MONITORING HUD & LIVE OUTBOX FEED
   ========================================================================== */
#view-campaigns .campaign-monitoring-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 16px !important;
}

#view-campaigns .campaign-monitoring-grid .calendar-card {
  min-height: 92px !important;
  padding: 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: #0a1017 !important;
  border: 1px solid #162436 !important;
  border-radius: 10px !important;
  transition: transform 0.2s ease, border-color 0.2s ease !important;
}

#view-campaigns .campaign-monitoring-grid .calendar-card:hover {
  border-color: rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-1px) !important;
}

@keyframes hudPulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes hudPulseAmber {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.hud-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.hud-pulse-dot.pulse-green {
  background: #10b981;
  animation: hudPulseGreen 2s infinite ease-in-out;
}

.hud-pulse-dot.pulse-amber {
  background: #f59e0b;
  animation: hudPulseAmber 2s infinite ease-in-out;
}

.hud-pulse-dot.pulse-gray {
  background: #64748b;
  box-shadow: none;
}

@keyframes hudProgressStripes {
  from { background-position: 40px 0; }
  to { background-position: 0 0; }
}

.hud-progress-animated {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  ) !important;
  background-size: 32px 32px !important;
  animation: hudProgressStripes 2s linear infinite !important;
}

.outbox-filter-pill {
  background: #090e15;
  border: 1px solid #1c2b3d;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.outbox-filter-pill:hover {
  background: #142030;
  color: #e2e8f0;
  border-color: #38bdf8;
}

.outbox-filter-pill.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.outbox-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1;
}

.outbox-status-badge.status-read {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.outbox-status-badge.status-delivered {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.outbox-status-badge.status-sent {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.outbox-status-badge.status-sending {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.outbox-status-badge.status-pending {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.outbox-status-badge.status-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.spintax-pill-btn {
  background: #0d1521;
  border: 1px solid #1e2e42;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-mono, monospace);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spintax-pill-btn:hover {
  background: #162436;
  color: #38bdf8;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.spintax-pill-btn.spintax-syntax {
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.spintax-pill-btn.spintax-syntax:hover {
  border-color: #a855f7;
  color: #e9d5ff;
}

/* =========================================================================
   MATERIAIS RAG WIZARD & REGRAS DE TRANSBORDO HUMANO
   ========================================================================= */

.materials-dropzone {
  border: 2px dashed #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.materials-dropzone:hover,
.materials-dropzone.dragover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
  transform: translateY(-1px);
}

.materials-file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090e17;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #e2e8f0;
  transition: border-color 0.2s;
}

.materials-file-chip:hover {
  border-color: #38bdf8;
}

.materials-file-remove {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.materials-file-remove:hover {
  color: #f87171;
}

.handoff-rule-item {
  background: #090e17;
  border: 1px solid #1e2c3d;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.handoff-rule-item:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

.handoff-rule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.handoff-kw-chip {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
}

.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

/* Master Super Admin KPI Cards Layout */
#view-master .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1100px) {
  #view-master .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  #view-master .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

#view-master .stat-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  min-height: 136px !important;
  padding: 18px 20px !important;
  border-radius: 14px !important;
  box-sizing: border-box !important;
  gap: 8px !important;
}

#view-master .stat-card::before {
  display: none !important;
}

#view-master .stat-card > div:first-child {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 4px !important;
}

#view-master .stat-card > div:first-child span:first-child {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#view-master .stat-card > div:first-child span:last-child {
  font-size: 18px !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}

#view-master #master-kpi-mrr,
#view-master #master-kpi-tenants,
#view-master #master-kpi-wa,
#view-master #master-kpi-ai-cost {
  font-size: 26px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  margin: 2px 0 2px !important;
  white-space: nowrap !important;
}

#view-master #master-kpi-mrr-sub,
#view-master #master-kpi-tenants-sub,
#view-master #master-kpi-wa-sub,
#view-master #master-kpi-ai-tokens {
  font-size: 12px !important;
  line-height: 1.3 !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Botão Limpar Dados do Cliente / Conversa (Exclusivo Administrador) */
.btn-purge-data {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.btn-purge-data:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

.btn-purge-data svg {
  flex-shrink: 0;
}

/* Drag and Drop Pipeline Kanban */
.lead-card-rich {
  cursor: grab !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease !important;
}

.lead-card-rich:active {
  cursor: grabbing !important;
}

.lead-card-rich.is-dragging {
  opacity: 0.35 !important;
  transform: scale(0.96) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45) !important;
  border: 1px dashed #3b82f6 !important;
}

.pipeline-col {
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.pipeline-col.drag-over {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4) !important;
  border-radius: 12px !important;
}

.pipeline-cards-list.drag-over {
  background: rgba(59, 130, 246, 0.04) !important;
  border-radius: 8px !important;
}

/* Delete Lead Button on Kanban Card */
.btn-delete-lead-card {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  padding: 3px 5px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0.5 !important;
  transition: all 0.2s ease !important;
}

.lead-card-rich:hover .btn-delete-lead-card {
  opacity: 1 !important;
}

.btn-delete-lead-card:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

/* =========================================================================
   ANIMATED IN-APP CONFIRMATION & ALERT DIALOG (REPLACES NATIVE LOCALHOST POPUPS)
   ========================================================================= */

.app-confirm-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(2, 6, 23, 0.76) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 18px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.app-confirm-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.app-confirm-backdrop.hidden {
  display: none !important;
}

.app-confirm-dialog {
  width: 100% !important;
  max-width: 440px !important;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 22px !important;
  padding: 30px 26px 24px !important;
  box-shadow: 0 30px 65px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  transform: scale(0.92) translateY(12px) !important;
  opacity: 0 !important;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.app-confirm-backdrop.active .app-confirm-dialog {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

/* Ambient glow on top of dialog */
.app-confirm-dialog::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 120px;
  background: radial-gradient(circle, var(--confirm-glow, rgba(239, 68, 68, 0.25)) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.85;
}

/* Animated spring icon wrap */
.app-confirm-icon-wrap {
  width: 64px !important;
  height: 64px !important;
  border-radius: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 18px !important;
  position: relative !important;
  font-size: 28px !important;
  box-shadow: 0 12px 28px -4px var(--confirm-icon-shadow, rgba(239, 68, 68, 0.38)) !important;
  animation: appConfirmIconPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes appConfirmIconPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* Type variants */
.app-confirm-dialog.type-danger {
  --confirm-glow: rgba(239, 68, 68, 0.3);
  --confirm-icon-shadow: rgba(239, 68, 68, 0.4);
}
.app-confirm-dialog.type-danger .app-confirm-icon-wrap {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22) 0%, rgba(185, 28, 28, 0.12) 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
}

.app-confirm-dialog.type-warning {
  --confirm-glow: rgba(245, 158, 11, 0.3);
  --confirm-icon-shadow: rgba(245, 158, 11, 0.4);
}
.app-confirm-dialog.type-warning .app-confirm-icon-wrap {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.12) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
}

.app-confirm-dialog.type-info {
  --confirm-glow: rgba(59, 130, 246, 0.3);
  --confirm-icon-shadow: rgba(59, 130, 246, 0.4);
}
.app-confirm-dialog.type-info .app-confirm-icon-wrap {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(29, 78, 216, 0.12) 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  color: #38bdf8 !important;
}

.app-confirm-content {
  width: 100% !important;
  margin-bottom: 22px !important;
}

.app-confirm-title {
  font-size: 18px !important;
  font-weight: 750 !important;
  color: #f8fafc !important;
  margin: 0 0 9px 0 !important;
  letter-spacing: -0.015em !important;
}

.app-confirm-message {
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  color: #94a3b8 !important;
  margin: 0 !important;
  white-space: pre-line !important;
}

.app-confirm-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.app-confirm-actions .btn {
  flex: 1 !important;
  min-height: 44px !important;
  font-size: 13.5px !important;
  font-weight: 650 !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.18s ease !important;
}

.app-confirm-btn-cancel {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}
.app-confirm-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  transform: translateY(-1px) !important;
}

.app-confirm-btn-confirm {
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.app-confirm-dialog.type-danger .app-confirm-btn-confirm {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.38) !important;
}
.app-confirm-dialog.type-danger .app-confirm-btn-confirm:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5) !important;
  transform: translateY(-1px) !important;
}

.app-confirm-dialog.type-warning .app-confirm-btn-confirm {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.38) !important;
}
.app-confirm-dialog.type-warning .app-confirm-btn-confirm:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5) !important;
  transform: translateY(-1px) !important;
}

.app-confirm-dialog.type-info .app-confirm-btn-confirm {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38) !important;
}
.app-confirm-dialog.type-info .app-confirm-btn-confirm:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px) !important;
}

/* Light Theme support */
body.light-theme .app-confirm-backdrop {
  background: rgba(15, 23, 42, 0.48) !important;
}

body.light-theme .app-confirm-dialog {
  background: #ffffff !important;
  border: 1px solid #d5dfec !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .app-confirm-title {
  color: #0f172a !important;
}

body.light-theme .app-confirm-message {
  color: #475569 !important;
}

body.light-theme .app-confirm-btn-cancel {
  background: #f1f5fa !important;
  border: 1px solid #d5dfec !important;
  color: #334155 !important;
}
body.light-theme .app-confirm-btn-cancel:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* Campaign Detail Modal Styles */
.camp-detail-metrics-funnel {
  background: #080d14;
  border: 1px solid #1a2736;
}
.camp-detail-stat-label {
  color: #8fa6b8;
}
.camp-detail-stat-sub {
  color: #64748b;
}
.camp-detail-saferate-banner {
  background: #0b121b;
  border: 1px solid #1e2c3d;
  color: #cbd5e1;
}
.camp-detail-directive-label {
  color: #cbd5e1;
}
.camp-detail-prompt-box {
  background: #0c131d;
  border: 1px solid #203144;
  color: #e2e8f0;
}
.camp-detail-recipients-heading {
  color: #cbd5e1;
}
.camp-detail-input {
  background: #090e15;
  border: 1px solid #1f2e40;
  color: #ffffff;
}
.camp-detail-select {
  background: #090e15;
  border: 1px solid #1f2e40;
  color: #cbd5e1;
}
.camp-detail-table-wrap {
  border: 1px solid #1a2736;
}
.camp-detail-table-head-row {
  background: #090e15;
  border-bottom: 1px solid #1a2736;
}
.camp-detail-table-head-row th {
  color: #8fa6b8;
}

/* Calendar Schedule Editor Styles */
.cal-preset-btn {
  transition: all 0.15s ease;
}
.cal-mode-btn {
  transition: all 0.15s ease;
}
.cal-time-input {
  transition: border-color 0.15s ease;
}
.cal-time-input:focus {
  border-color: #3b82f6 !important;
}


