:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #111b21;
  background: #0b141a;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; min-width: 320px; overflow: hidden; background: linear-gradient(#00a884 0 128px, #e9edef 128px); }
button, input, textarea, select { font: inherit; }

.crm-shell {
  position: fixed; inset: 18px; max-width: 1680px; margin: auto;
  display: grid; grid-template-columns: 360px minmax(480px, 1fr) 300px;
  overflow: hidden; border-radius: 8px; background: #fff;
  box-shadow: 0 8px 30px rgba(11,20,26,.2);
}
.sidebar, .contact-panel { min-height: 0; background: #fff; }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid #d9dee1; }
.brand-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #f0f2f5; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark, .avatar, .conversation-avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(145deg,#00a884,#008069); color: #fff; font-weight: 800; }
.avatar img, .conversation-avatar img, .avatar svg, .conversation-avatar svg { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.brand-mark { width: 42px; height: 42px; font-size: 18px; }
.brand-mark, .nav-logo { position: relative; overflow: hidden; }
.brand-mark img, .nav-logo img { position: absolute; top: -2px; left: 50%; width: 105px; height: 158px; transform: translateX(-50%); object-fit: contain; object-position: center top; }
.brand div { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: #667781; font-size: 12px; }
.logout-button { border: 0; padding: 8px 10px; border-radius: 8px; background: transparent; color: #54656f; cursor: pointer; font-size: 12px; font-weight: 700; }
.logout-button:hover { background: #e2e6e8; color: #111b21; }
.back-link { display: block; padding: 9px 16px 4px; color: #54656f; text-decoration: none; font-size: 11px; }
.back-link:hover { color: #008069; }

.channel-health { display: flex; align-items: center; gap: 8px; margin: 6px 12px 2px; padding: 8px 11px; border-radius: 7px; font-size: 11px; }
.channel-health span { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: #8696a0; }
.channel-health.checking { color: #54656f; background: #f0f2f5; }
.channel-health.ready { color: #02735d; background: #e6f7f2; }
.channel-health.ready span { background: #00a884; box-shadow: 0 0 0 3px rgba(0,168,132,.13); }
.channel-health.blocked { color: #9a471e; background: #fff3e8; }
.channel-health.blocked span { background: #f07c42; }
.channel-health.offline { color: #9c2f36; background: #fdebed; }
.channel-health.offline span { background: #d94752; }
.channel-detail { margin: 3px 16px 8px; color: #667781; font-size: 10px; line-height: 1.35; }
.section-title { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 6px; font-size: 14px; font-weight: 700; }
.section-title b { min-width: 20px; padding: 2px 7px; border-radius: 999px; background: #00a884; color: #fff; text-align: center; font-size: 10px; }
.search { display: flex; align-items: center; gap: 10px; margin: 4px 12px 6px; padding: 8px 13px; border-radius: 8px; background: #f0f2f5; color: #667781; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: #111b21; font-size: 12px; }
.filters { display: flex; gap: 6px; padding: 3px 12px 8px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: 0 0 auto; border: 0; padding: 6px 10px; border-radius: 999px; background: #f0f2f5; color: #54656f; cursor: pointer; font-size: 11px; }
.filters button.active { background: #d9fdd3; color: #008069; font-weight: 700; }
.group-filter { display: flex; align-items: center; gap: 7px; margin: 0 12px 7px; color: #667781; font-size: 9px; font-weight: 700; }
.group-filter select { flex: 1; min-width: 0; border: 0; outline: 0; padding: 6px 8px; border-radius: 7px; background: #f0f2f5; color: #3b4a54; font-size: 10px; }

.conversation-list { flex: 1; min-height: 0; overflow-y: auto; }
.conversation-item { position: relative; width: 100%; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 0; padding: 10px 13px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.conversation-item::after { content: ""; position: absolute; right: 0; bottom: 0; left: 72px; height: 1px; background: #eef0f1; }
.conversation-item:hover, .conversation-item.active { background: #f0f2f5; }
.conversation-avatar { width: 48px; height: 48px; background: linear-gradient(145deg,#7dcfc0,#309e8b); }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 14px; font-weight: 600; }
.conversation-copy span { margin-top: 5px; color: #667781; font-size: 12px; }
.conversation-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.conversation-meta time { color: #667781; font-size: 10px; }
.conversation-state { max-width: 112px; padding: 3px 6px; border-radius: 999px; background: #fff1cf; color: #806000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 800; }
.conversation-state.waiting { background: #e4f0ff; color: #33688e; }
.conversation-state.closed { background: #e8ecee; color: #667781; }
.unread { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: #25d366; color: #fff; font-size: 10px; font-weight: 800; }
.list-empty { padding: 32px 16px; color: #667781; text-align: center; font-size: 12px; }

.chat-panel { position: relative; min-width: 0; display: flex; overflow: hidden; background: #efeae2; }
.chat-panel::before { content: ""; position: absolute; inset: 0; opacity: .42; pointer-events: none; background-image: radial-gradient(circle at 20px 20px,rgba(84,101,111,.11) 1.2px,transparent 1.5px),radial-gradient(circle at 8px 8px,rgba(84,101,111,.07) 1px,transparent 1.3px); background-size: 42px 42px,28px 28px; }
.empty-state { position: relative; z-index: 1; margin: auto; max-width: 430px; padding: 32px; text-align: center; }
.empty-orbit { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: #00a884; color: #fff; font-size: 28px; font-weight: 800; box-shadow: 0 12px 30px rgba(0,128,105,.24); }
.empty-state h2 { margin: 0; font-size: 25px; font-weight: 400; }
.empty-state p { margin: 10px 0 0; color: #667781; font-size: 13px; line-height: 1.55; }
.active-chat { position: relative; z-index: 1; width: 100%; min-height: 0; display: grid; grid-template-rows: 68px minmax(0,1fr) auto; }
.chat-header { display: flex; align-items: center; gap: 11px; padding: 9px 16px; background: #f0f2f5; border-bottom: 1px solid #d9dee1; }
.avatar { width: 42px; height: 42px; }
.avatar.large { width: 76px; height: 76px; font-size: 22px; }
.chat-header h1 { margin: 0; font-size: 15px; font-weight: 600; }
.chat-header p { margin: 4px 0 0; color: #667781; font-size: 11px; }
.chat-header select { margin-left: auto; max-width: 180px; border: 0; outline: 0; padding: 8px 28px 8px 11px; border-radius: 8px; background: #fff; color: #3b4a54; font-size: 11px; }
.finish-conversation-button { margin-left: auto; border: 1px solid #b9d9d2; padding: 8px 10px; border-radius: 8px; background: #fff; color: #008069; cursor: pointer; font-size: 10px; font-weight: 800; }
.finish-conversation-button.reopen { border-color: #d9dee1; color: #54656f; }
.delete-conversation-button { border: 1px solid #efc3c7; padding: 8px 10px; border-radius: 8px; background: #fff; color: #b42332; cursor: pointer; font-size: 10px; font-weight: 800; }
.delete-conversation-button:hover { background: #fff1f2; }
.mobile-back-button { display: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #54656f; font-size: 31px; cursor: pointer; }
.message-list { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 20px 6% 14px; }
.message-row { display: flex; }
.message-row.outbound { justify-content: flex-end; }
.bubble { max-width: min(650px,78%); padding: 7px 9px 5px; border-radius: 8px; background: #fff; box-shadow: 0 1px 1px rgba(11,20,26,.14); }
.inbound .bubble { border-top-left-radius: 2px; }
.outbound .bubble { border-top-right-radius: 2px; background: #d9fdd3; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.bubble footer { display: flex; justify-content: flex-end; align-items: center; gap: 6px; min-height: 14px; margin-top: 3px; color: #667781; font-size: 9px; }
.bubble footer > span:first-child { display: none; }
.message-status { color: #667781; font-weight: 600; }
.message-status.failed { color: #d23f4c; }
.attachment-link { display: block; max-width: 100%; margin-bottom: 7px; padding: 9px 10px; border: 0; border-radius: 7px; background: rgba(255,255,255,.66); color: #008069; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 12px; }
.attachment-processing { display: block; margin-bottom: 7px; color: #667781; font-size: 11px; font-style: italic; }
.bubble.delivery-failed { background: #fff0ed; }
.delivery-error { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; padding: 7px 8px; border-radius: 6px; background: rgba(255,219,214,.82); color: #8e2f37; font-size: 10px; line-height: 1.35; }

.composer { padding: 9px 14px 10px; background: #f0f2f5; border-top: 1px solid #d9dee1; }
.ai-row { display: flex; gap: 7px; margin-bottom: 7px; }
.ai-button { flex: 0 0 auto; border: 0; padding: 7px 10px; border-radius: 999px; background: #e8def8; color: #6846a6; cursor: pointer; font-size: 11px; font-weight: 700; }
.ai-row input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 7px 12px; border-radius: 999px; background: #fff; color: #3b4a54; font-size: 11px; }
.composer > textarea { width: 100%; min-height: 46px; max-height: 140px; resize: vertical; border: 0; outline: 0; padding: 12px 14px; border-radius: 10px; background: #fff; color: #111b21; font-size: 13px; line-height: 1.4; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; }
.composer-footer small { color: #667781; font-size: 9px; }
.send-button { min-width: 82px; border: 0; padding: 9px 16px; border-radius: 999px; background: #00a884; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.send-button:hover { background: #008f72; }
.ai-button:disabled, .send-button:disabled { opacity: .58; }
.composer-message { min-height: 14px; margin: 3px 2px 0; color: #c53f49; font-size: 10px; }

.contact-panel { overflow-y: auto; border-left: 1px solid #d9dee1; }
.contact-hero { padding: 30px 20px 22px; text-align: center; background: #f0f2f5; }
.contact-hero .avatar { margin: 0 auto 13px; }
.contact-hero h2 { margin: 0; font-size: 17px; }
.contact-hero p { margin: 5px 0 0; color: #667781; font-size: 12px; }
.contact-photo-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.contact-photo-tools input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.contact-photo-tools label, .contact-photo-tools button { border: 0; padding: 6px 9px; border-radius: 999px; background: #fff; color: #008069; cursor: pointer; font-size: 9px; font-weight: 800; box-shadow: 0 1px 4px rgba(11,20,26,.1); }
.contact-photo-tools button { color: #8d3941; }
.contact-photo-tools small { width: 100%; color: #7a8a93; font-size: 8px; line-height: 1.35; }
.contact-panel form { display: flex; flex-direction: column; gap: 13px; padding: 20px 18px; }
.contact-panel label { color: #667781; font-size: 10px; font-weight: 600; }
.contact-panel input, .contact-panel textarea, .contact-panel select { width: 100%; display: block; margin-top: 5px; border: 0; border-bottom: 1px solid #d9dee1; outline: 0; padding: 8px 4px; background: #fff; color: #111b21; font-size: 12px; }
.contact-panel input:focus, .contact-panel textarea:focus, .contact-panel select:focus { border-color: #00a884; }
.contact-panel form button { border: 0; padding: 10px 14px; border-radius: 8px; background: #00a884; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.twilio-note { display: flex; flex-direction: column; gap: 3px; margin: 0 18px 18px; padding: 11px 12px; border-radius: 8px; background: #e6f7f2; }
.twilio-note strong { color: #008069; font-size: 11px; }
.twilio-note span { color: #54656f; font-size: 10px; }

* { scrollbar-color: #c8cdd0 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: #c8cdd0; }

@media (max-width: 1180px) { .crm-shell { grid-template-columns: 330px minmax(430px,1fr); } .contact-panel { display: none !important; } }
@media (max-width: 760px) {
  body { background: #fff; }
  .crm-shell { inset: 0; display: block; width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; }
  .sidebar, .chat-panel { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .22s ease; }
  .sidebar { z-index: 2; transform: translateX(0); }
  .chat-panel { z-index: 3; transform: translateX(100%); }
  body.mobile-chat-open .sidebar { transform: translateX(-28%); }
  body.mobile-chat-open .chat-panel { transform: translateX(0); }
  .contact-panel { display: none !important; }
  .mobile-back-button { display: grid; place-items: center; }
  .chat-header { padding: 8px 9px; }
  .chat-header select { max-width: 132px; padding-right: 20px; }
  .message-list { padding: 14px 10px 10px; }
  .bubble { max-width: 88%; }
  .composer { padding: 8px; }
  .ai-row { overflow-x: auto; }
  .ai-row input { min-width: 180px; }
  .composer-footer small { display: none; }
}

/* Aurora Zap: navegação e módulos de gestão */
.crm-shell { grid-template-columns: 190px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.app-nav { position: relative; min-width: 0; display: flex; flex-direction: column; padding: 15px 11px 12px; overflow-y: auto; background: linear-gradient(180deg,#075e54,#064b44); color: #fff; }
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 3px 31px 17px 7px; border-bottom: 1px solid rgba(255,255,255,.13); }
.nav-logo { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #25d366; color: #064b44; font-size: 13px; font-weight: 900; }
.nav-logo { border-radius: 50%; background: #dff3ed; box-shadow: 0 7px 16px rgba(0,0,0,.14); }
.nav-logo img { width: 98px; height: 147px; }
.nav-brand div { display: flex; flex-direction: column; min-width: 0; }
.nav-brand strong { font-size: 15px; }
.nav-brand small { margin-top: 2px; color: #b9ded7; font-size: 10px; }
.nav-menu { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; }
.nav-item, .nav-logout { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; padding: 9px 10px; border-radius: 7px; background: transparent; color: #d9efeb; text-align: left; cursor: pointer; font-size: 11px; font-weight: 650; }
.nav-item > span { width: 17px; color: #9ed4ca; text-align: center; font-size: 15px; }
.nav-item b { min-width: 18px; margin-left: auto; padding: 2px 5px; border-radius: 999px; background: #25d366; color: #064b44; text-align: center; font-size: 9px; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.14); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 #25d366; }
.nav-item.active > span { color: #25d366; }
.nav-collapse { position: absolute; top: 16px; right: 7px; z-index: 2; width: 25px; height: 25px; display: grid; place-items: center; border: 0; padding: 0; border-radius: 6px; background: transparent; color: #d9efeb; cursor: pointer; }
.nav-collapse:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-collapse span { color: #b9ded7; text-align: center; font-size: 11px; }
.nav-collapse strong { display: none; }
.crm-shell.nav-collapsed { grid-template-columns: 64px minmax(0,1fr); }
.nav-collapsed .app-nav { padding-right: 7px; padding-left: 7px; }
.nav-collapsed .nav-brand { height: 33px; justify-content: center; padding: 0; }
.nav-collapsed .nav-logo { display: none; }
.nav-collapsed .nav-brand div { display: none; }
.nav-collapsed .nav-item { justify-content: center; padding-right: 5px; padding-left: 5px; font-size: 0; }
.nav-collapsed .nav-item > span { width: auto; font-size: 17px; }
.nav-collapsed .nav-item b { position: absolute; margin: -19px 0 0 22px; font-size: 8px; }
.nav-collapsed .nav-collapse { right: 19px; }
.nav-collapsed .finance-link { justify-content: center; padding-right: 4px; padding-left: 4px; }
.nav-collapsed .finance-link div { display: none; }
.nav-collapsed .nav-logout { font-size: 0; }
.nav-collapsed .nav-logout::before { content: "↪"; font-size: 17px; }
.finance-link { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 11px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #fff; text-decoration: none; }
.finance-link > span { font-size: 17px; color: #25d366; }
.finance-link div { display: flex; flex-direction: column; }
.finance-link strong { font-size: 11px; }
.finance-link small { margin-top: 2px; color: #add8d0; font-size: 9px; }
.nav-logout { margin-top: 5px; justify-content: center; color: #b9ded7; }
.inbox-layout { min-width: 0; min-height: 0; display: grid; grid-template-columns: 330px minmax(420px, 1fr) 280px; overflow: hidden; }
.icon-action { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #54656f; cursor: pointer; font-size: 22px; }
.icon-action:hover { background: #e2e6e8; }
.chat-actions { display: flex; gap: 3px; margin-left: auto; }
.chat-actions button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #54656f; cursor: pointer; font-size: 18px; }
.chat-actions button:hover { background: #dfe3e5; }
.chat-header select { margin-left: 3px; }
.message-compose-row { display: flex; align-items: center; gap: 8px; }
.message-compose-row textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 120px; resize: vertical; border: 0; outline: 0; padding: 12px 14px; border-radius: 10px; background: #fff; color: #111b21; font-size: 13px; }
.clip-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #54656f; cursor: pointer; font-size: 18px; }
.message-compose-row .send-button { min-width: 42px; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; font-size: 17px; }
.emoji-picker { display: flex; width: min(390px, calc(100% - 60px)); max-height: 270px; flex-direction: column; margin: 8px 0 2px 50px; padding: 7px; border: 1px solid #d9dee1; border-radius: 10px; background: #fff; box-shadow: 0 5px 18px rgba(11,20,26,.12); }
.emoji-picker[hidden] { display: none; }
.emoji-categories { display: flex; gap: 3px; padding: 0 0 6px; border-bottom: 1px solid #e9edef; }
.emoji-categories button { flex: 1; font-size: 16px !important; }
.emoji-categories button.active { background: #dff5ef; box-shadow: inset 0 -2px #00a884; }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; padding-top: 6px; overflow-y: auto; }
.emoji-picker button { border: 0; padding: 5px 2px; border-radius: 6px; background: transparent; cursor: pointer; font-size: 19px; }
.emoji-picker button:hover { background: #e9edef; }
.media-selection { display: flex; align-items: center; gap: 9px; margin: 8px 50px 2px; padding: 7px 9px; border: 1px solid #c7d8d4; border-radius: 9px; background: #fff; }
.media-selection[hidden] { display: none; }
.media-selection img { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; background: #f0f2f5; }
.media-selection-document { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: #eef3f8; font-size: 24px; }
.media-selection-document[hidden] { display: none; }
.media-selection div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.media-selection strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.media-selection small { color: #667781; font-size: 9px; }
.ticket-purpose { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: #008069; font-size: 9px; font-weight: 750; }
.ticket-purpose input { accent-color: #00a884; }
.media-selection button { border: 0; background: transparent; color: #667781; cursor: pointer; font-size: 20px; }
.attachment-image-button { display: block; max-width: 320px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: zoom-in; overflow: hidden; }
.attachment-image { display: block; width: 100%; max-height: 330px; object-fit: contain; border-radius: 8px; background: #eef1f2; }
.media-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 44px; background: rgba(11,20,26,.82); backdrop-filter: blur(3px); }
.media-lightbox[hidden] { display: none; }
.media-lightbox img { max-width: min(900px, 92vw); max-height: 86vh; object-fit: contain; border-radius: 12px; box-shadow: 0 16px 50px rgba(0,0,0,.35); }
.media-lightbox button { position: absolute; top: 16px; right: 20px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; font-size: 26px; }
.template-start-button { width: 100%; border: 0; margin-bottom: 8px; padding: 11px 14px; border-radius: 9px; background: #00a884; color: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.template-start-button:disabled { background: #d8dee1; color: #667781; cursor: default; }
.panel-tabs { display: flex; gap: 2px; padding: 13px 8px 0; overflow-x: auto; border-bottom: 1px solid #eef0f1; }
.panel-tabs button { border: 0; padding: 8px 7px; background: transparent; color: #667781; cursor: pointer; font-size: 9px; }
.panel-tabs button.active { color: #008069; border-bottom: 2px solid #00a884; font-weight: 800; }
.lead-chip { display: inline-block; margin-top: 8px; padding: 4px 9px; border-radius: 999px; background: #d9fdd3; color: #008069; font-size: 9px; font-weight: 700; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 14px 0; }
.quick-actions button { border: 1px solid #d9dee1; padding: 8px 5px; border-radius: 7px; background: #fff; color: #008069; cursor: pointer; font-size: 9px; font-weight: 700; }

.workspace-view { min-width: 0; min-height: 0; overflow-y: auto; background: #f5f7f8; }
.workspace-header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 30px; background: #fff; border-bottom: 1px solid #e1e6e8; }
.workspace-header p { margin: 0 0 5px; color: #008069; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.workspace-header h1 { margin: 0; color: #111b21; font-size: 25px; }
.workspace-header span { display: block; margin-top: 5px; color: #667781; font-size: 12px; }
.workspace-header > button { border: 0; padding: 10px 15px; border-radius: 8px; background: #00a884; color: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.workspace-content { padding: 24px 30px 40px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 13px; margin-bottom: 18px; }
.metric-grid article { min-height: 118px; display: flex; flex-direction: column; padding: 17px; border: 1px solid #e1e6e8; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgba(11,20,26,.035); }
.metric-grid span { color: #667781; font-size: 10px; font-weight: 700; }
.metric-grid strong { margin-top: 9px; color: #075e54; font-size: 27px; }
.metric-grid small { margin-top: auto; color: #8696a0; font-size: 9px; }
.data-card { overflow: hidden; border: 1px solid #e1e6e8; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgba(11,20,26,.035); }
.data-card > h2, .data-card-title { margin: 0; padding: 17px 19px; border-bottom: 1px solid #eef0f1; font-size: 15px; }
.data-card-title { display: flex; align-items: center; justify-content: space-between; }
.data-card-title h2 { margin: 0; font-size: 15px; }
.workspace-search { display: flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 7px; background: #f0f2f5; color: #667781; }
.workspace-search input { width: 180px; border: 0; outline: 0; background: transparent; font-size: 10px; }
.contact-table { padding: 0 10px; }
.contact-table > button { width: 100%; display: grid; grid-template-columns: 43px 1fr auto; align-items: center; gap: 11px; border: 0; border-bottom: 1px solid #eef0f1; padding: 11px 8px; background: #fff; color: #111b21; text-align: left; cursor: pointer; }
.contact-table > button:hover { background: #f7f9f9; }
.contact-table .conversation-avatar { width: 40px; height: 40px; font-size: 11px; }
.contact-table strong, .contact-table small { display: block; }
.contact-table strong { font-size: 12px; }
.contact-table small { margin-top: 3px; color: #667781; font-size: 9px; }
.contact-table em { padding: 5px 8px; border-radius: 999px; background: #e6f7f2; color: #008069; font-size: 8px; font-style: normal; font-weight: 800; }
.contact-create-card { display: grid; grid-template-columns: minmax(220px,.75fr) minmax(420px,1.5fr); gap: 28px; margin-bottom: 18px; padding: 22px; border: 1px solid #cfe6df; border-radius: 12px; background: linear-gradient(135deg,#f3fcf9,#fff); box-shadow: 0 3px 12px rgba(11,20,26,.035); }
.contact-create-card .eyebrow { color: #008069; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.contact-create-card h2 { margin: 7px 0 6px; font-size: 19px; }
.contact-create-card > div > p { margin: 0; color: #667781; font-size: 10px; line-height: 1.5; }
.template-status { margin-top: 18px; padding: 10px 12px; border-radius: 8px; background: #fff3cd; color: #7a5a00; font-size: 10px; font-weight: 700; }
.template-status.approved { background: #e6f7f2; color: #00745f; }
#new-contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#new-contact-form label { color: #54656f; font-size: 10px; font-weight: 700; }
#new-contact-form input, #new-contact-form select, #new-contact-form textarea { width: 100%; display: block; margin-top: 6px; border: 1px solid #d9dee1; border-radius: 8px; outline: 0; padding: 10px 11px; background: #fff; color: #111b21; font: inherit; }
#new-contact-form input:focus, #new-contact-form select:focus, #new-contact-form textarea:focus { border-color: #00a884; box-shadow: 0 0 0 3px rgba(0,168,132,.09); }
#new-contact-form .contact-notes-field, #new-contact-form .consent-check, #new-contact-status, #new-contact-form > button { grid-column: 1 / -1; }
#new-contact-form .consent-check { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border-radius: 8px; background: #eef8f5; }
#new-contact-form .consent-check input { width: 17px; margin: 0; box-shadow: none; }
#new-contact-form .consent-check span { line-height: 1.4; }
#new-contact-status { margin: 0; min-height: 14px; color: #008069; font-size: 10px; }
#new-contact-status.error { color: #c53f49; }
#new-contact-form > button { border: 0; padding: 11px 14px; border-radius: 8px; background: #00a884; color: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
#new-contact-form > button:disabled { opacity: .55; }
.contact-metrics { grid-template-columns: repeat(3,minmax(150px,1fr)); }
.feature-list { padding: 8px 18px 18px; }
.feature-list article { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid #eef0f1; }
.feature-list article > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: #e6f7f2; color: #008069; font-size: 11px; font-weight: 900; }
.feature-list article > div { flex: 1; }
.feature-list strong, .feature-list small { display: block; }
.feature-list strong { font-size: 12px; }
.feature-list small { margin-top: 4px; color: #667781; font-size: 9px; }
.feature-list button { border: 1px solid #d9dee1; padding: 7px 12px; border-radius: 7px; background: #fff; color: #008069; cursor: pointer; font-size: 9px; font-weight: 700; }
.task-workspace { display: flex; flex-direction: column; gap: 14px; }
.task-loading { padding: 30px; color: #667781; text-align: center; }
.task-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.task-metrics article { padding: 15px 17px; border: 1px solid #dfe6e4; border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(11,20,26,.03); }
.task-metrics span { display: block; color: #667781; font-size: 10px; font-weight: 700; }
.task-metrics strong { display: block; margin-top: 5px; color: #075e54; font-size: 24px; }
.task-form { padding: 18px; border: 1px solid #b8dcd4; border-radius: 12px; background: #fff; box-shadow: 0 8px 25px rgba(11,20,26,.06); }
.task-form[hidden] { display: none; }
.task-form-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.task-form-heading small { color: #008069; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.task-form-heading h2 { margin: 3px 0 0; font-size: 17px; }
.task-form-heading button { border: 0; background: transparent; color: #667781; cursor: pointer; font-size: 22px; }
.task-form > label, .task-form-grid label { display: flex; flex-direction: column; gap: 5px; color: #3b4a54; font-size: 10px; font-weight: 750; }
.task-form input, .task-form select, .task-form textarea { width: 100%; border: 1px solid #d9dee1; padding: 9px 10px; border-radius: 8px; outline: 0; background: #fff; color: #111b21; font: inherit; font-size: 12px; }
.task-form input:focus, .task-form select:focus, .task-form textarea:focus { border-color: #00a884; box-shadow: 0 0 0 3px rgba(0,168,132,.09); }
.task-form-grid { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 11px; margin: 11px 0; }
.task-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.task-form-actions span { margin-right: auto; color: #667781; font-size: 10px; }
.task-form-actions span.error { color: #c53f49; }
.task-form-actions button { border: 0; padding: 9px 15px; border-radius: 8px; background: #00a884; color: #fff; cursor: pointer; font-size: 10px; font-weight: 800; }
.task-filters { display: flex; gap: 5px; }
.task-filters button { border: 1px solid #d9dee1; padding: 6px 10px; border-radius: 999px; background: #fff; color: #54656f; cursor: pointer; font-size: 9px; font-weight: 750; }
.task-filters button.active { border-color: #b5e2d8; background: #e2f7f1; color: #007b67; }
.task-list { padding: 8px 18px 18px; }
.task-row { display: flex; align-items: center; gap: 11px; padding: 13px 4px; border-bottom: 1px solid #eef0f1; }
.task-row.completed { opacity: .68; }
.task-row.completed .task-copy strong { text-decoration: line-through; }
.task-row.overdue { border-left: 3px solid #e35d6a; padding-left: 9px; }
.task-check { width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 9px; background: #e2f7f1; color: #008069; cursor: pointer; font-size: 11px; font-weight: 900; }
.task-row.completed .task-check { background: #00a884; color: #fff; }
.task-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.task-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.task-copy span { margin-top: 3px; color: #667781; font-size: 9px; }
.task-copy small { margin-top: 5px; color: #54656f; font-size: 9px; }
.task-priority { padding: 4px 7px; border-radius: 999px; background: #eef1f2; color: #54656f; font-size: 8px; }
.task-priority.high { background: #fff3d8; color: #996b00; }
.task-priority.urgent { background: #fde5e8; color: #b52d3b; }
.task-priority.low { background: #e8f3ff; color: #2b6597; }
.task-actions { display: flex; gap: 5px; }
.task-actions button { border: 1px solid #d9dee1; padding: 6px 9px; border-radius: 7px; background: #fff; color: #008069; cursor: pointer; font-size: 9px; font-weight: 750; }
.task-actions button.danger { color: #c53f49; }
.task-empty { padding: 35px 10px; color: #667781; text-align: center; }
.task-empty span { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 9px; border-radius: 50%; background: #e2f7f1; color: #008069; font-size: 18px; }
.task-empty strong { display: block; color: #3b4a54; font-size: 12px; }
.task-empty p { margin: 5px 0 0; font-size: 10px; }
.integration-grid { display: grid; grid-template-columns: repeat(3,minmax(210px,1fr)); gap: 14px; }
.integration-grid article { min-height: 155px; display: flex; gap: 14px; padding: 20px; border: 1px solid #e1e6e8; border-radius: 11px; background: #fff; }
.integration-logo { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: #25d366; color: #064b44; font-size: 12px; font-weight: 900; }
.integration-logo.ai { background: #dcd3fa; color: #6549a6; }
.integration-logo.cfo { background: #d8eef2; color: #155b77; }
.integration-grid h2 { margin: 1px 0 6px; font-size: 14px; }
.integration-grid p { margin: 0 0 14px; color: #667781; font-size: 10px; line-height: 1.45; }
.integration-grid b { color: #008069; font-size: 9px; }
.bar-chart { display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.bar-chart > div { display: grid; grid-template-columns: 110px 1fr 35px; align-items: center; gap: 12px; font-size: 10px; }
.bar-chart i { position: relative; height: 10px; border-radius: 999px; background: #eef0f1; overflow: hidden; }
.bar-chart i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--value); border-radius: inherit; background: linear-gradient(90deg,#00a884,#25d366); }
.bar-chart b { color: #075e54; text-align: right; }
.automation-form { max-width: 780px; overflow: hidden; border: 1px solid #e1e6e8; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(11,20,26,.04); }
.automation-heading { display: flex; align-items: center; gap: 14px; padding: 20px; border-bottom: 1px solid #eef0f1; }
.automation-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #e6f7f2; color: #008069; font-size: 21px; }
.automation-heading > div { flex: 1; }
.automation-heading h2 { margin: 0; font-size: 16px; }
.automation-heading p { margin: 5px 0 0; color: #667781; font-size: 10px; }
.automation-form > label { display: block; margin: 18px 20px; color: #54656f; font-size: 10px; font-weight: 700; }
.automation-form > .hybrid-option { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid #cfe9e3; border-radius: 9px; background: #f0fbf8; }
.hybrid-option > span { flex: 1; }
.hybrid-option strong, .hybrid-option small { display: block; }
.hybrid-option strong { color: #075e54; font-size: 11px; }
.hybrid-option small { margin-top: 4px; color: #667781; font-size: 9px; font-weight: 500; }
.hybrid-option > .switch { margin: 0; }
.automation-form textarea, .automation-form select { width: 100%; display: block; margin-top: 7px; border: 1px solid #d9dee1; border-radius: 8px; outline: 0; padding: 11px 12px; background: #fff; color: #111b21; font-size: 12px; line-height: 1.45; }
.automation-form textarea:focus, .automation-form select:focus { border-color: #00a884; box-shadow: 0 0 0 3px rgba(0,168,132,.1); }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c5cdd1; transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: #00a884; }
.switch input:checked + span::after { transform: translateX(18px); }
.automation-preview { margin: 18px 20px; padding: 15px; border-radius: 9px; background: #efeae2; }
.automation-preview small { color: #667781; font-size: 9px; }
.automation-preview p { max-width: 440px; margin: 9px 0 0 auto; padding: 10px 12px; border-radius: 8px 2px 8px 8px; background: #d9fdd3; color: #111b21; font-size: 11px; line-height: 1.45; box-shadow: 0 1px 1px rgba(11,20,26,.12); }
.automation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 20px; border-top: 1px solid #eef0f1; }
.automation-actions span { margin-right: auto; color: #667781; font-size: 10px; }
.automation-actions span.success { color: #008069; }
.automation-actions span.error { color: #c53f49; }
.automation-actions button { border: 0; padding: 10px 15px; border-radius: 8px; background: #00a884; color: #fff; cursor: pointer; font-size: 10px; font-weight: 800; }
.automation-actions button:disabled { opacity: .55; }
.group-cards { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 13px; margin-bottom: 18px; }
.group-cards > button { min-height: 125px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid #e1e6e8; padding: 18px; border-radius: 11px; background: #fff; color: #111b21; text-align: left; cursor: pointer; box-shadow: 0 3px 12px rgba(11,20,26,.035); }
.group-cards > button:hover { border-color: #00a884; transform: translateY(-1px); }
.group-cards > button > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #e6f7f2; color: #008069; font-size: 12px; font-weight: 900; }
.group-cards > button > div { flex: 1; }
.group-cards strong, .group-cards small { display: block; }
.group-cards strong { font-size: 12px; }
.group-cards small { margin-top: 6px; color: #667781; font-size: 9px; }
.group-cards b { align-self: flex-end; color: #008069; font-size: 8px; white-space: nowrap; }
.group-help p { margin: 0; padding: 18px 20px; color: #667781; font-size: 11px; line-height: 1.55; }

@media (max-width: 1320px) {
  .crm-shell { grid-template-columns: 168px minmax(0,1fr); }
  .inbox-layout { grid-template-columns: 305px minmax(400px,1fr); }
  .contact-panel { display: none !important; }
  .metric-grid { grid-template-columns: repeat(2,minmax(150px,1fr)); }
  .group-cards { grid-template-columns: repeat(2,minmax(150px,1fr)); }
}
@media (max-width: 860px) {
  .crm-shell { inset: 0; grid-template-columns: 62px minmax(0,1fr); width: 100%; height: 100dvh; border-radius: 0; }
  .app-nav { padding: 10px 7px; }
  .nav-brand { justify-content: center; padding: 3px 0 12px; }
  .nav-brand div, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 9px 5px; }
  .nav-item > span { width: auto; font-size: 17px; }
  .nav-item b { position: absolute; margin: -19px 0 0 22px; font-size: 8px; }
  .finance-link { justify-content: center; padding: 10px 4px; }
  .finance-link div { display: none; }
  .nav-collapse { right: 18px; }
  .nav-logout { font-size: 9px; }
  .inbox-layout { position: relative; display: block; }
  .sidebar, .chat-panel { position: absolute; inset: 0; width: 100%; height: 100%; }
  .sidebar { z-index: 2; transform: translateX(0); }
  .chat-panel { z-index: 3; transform: translateX(100%); transition: transform .22s ease; }
  body.mobile-chat-open .sidebar { transform: translateX(-28%); }
  body.mobile-chat-open .chat-panel { transform: translateX(0); }
  .mobile-back-button { display: grid; place-items: center; }
  .workspace-header, .workspace-content { padding-left: 18px; padding-right: 18px; }
  .integration-grid { grid-template-columns: 1fr; }
  .contact-create-card { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .crm-shell { grid-template-columns: 1fr; padding-bottom: 58px; }
  .app-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; height: 58px; display: flex; flex-direction: row; align-items: center; padding: 5px 7px; overflow-x: auto; }
  .nav-brand, .finance-link, .nav-logout, .nav-collapse { display: none; }
  .nav-menu { width: max-content; flex-direction: row; gap: 4px; padding: 0; }
  .nav-item { width: 48px; height: 46px; }
  .nav-item:nth-child(n+6) { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-grid article { min-height: 100px; padding: 13px; }
  .workspace-header { min-height: 98px; padding: 16px; }
  .workspace-content { padding: 14px; }
  .workspace-search { display: none; }
  #new-contact-form { grid-template-columns: 1fr; }
  #new-contact-form > * { grid-column: 1 !important; }
}
