@font-face {
  font-family: "Montserrat";
  src: url("/montserrat.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --rail: #fefefe;
  --rail-active: #eeeeee;
  --ink: #141414;
  --muted: #636363;
  --subtle: #787878;
  --paper: #f3f3f3;
  --white: #ffffff;
  --line: #e4e4e4;
  --accent: #232323;
  --accent-deep: #080808;
  --accent-soft: #eeeeee;
  --on-accent: #ffffff;
  --monkeys-orange: #ff640a;
  --monkeys-metric: #df5008;
  --monkeys-ink: #82300b;
  --surface-hover: #f0f0f0;
  --panel-background: linear-gradient(130deg, #fffe, #f6f6f6b3);
  --panel-border: #ffffff;
  --panel-shadow: 0 1px 2px #00000012, 0 15px 37px #00000008;
  --focus: #838383;
  --warning-bg: #ececec;
  --warning-text: #484848;
  --license-warning-bg: #fff3eb;
  --license-warning-text: var(--monkeys-ink);
  --license-warning-line: #f4c7ad;
  --danger: #902144;
  --radius: 13px;
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 0; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  color: var(--on-accent);
  background: var(--accent-deep);
  border-radius: 7px;
  transform: translateY(calc(-100% - 12px));
}

.skip-link:focus { transform: none; }

.brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 11px;
  color: #ffffff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: none;
  width: 39px;
  height: 39px;
  place-items: center;
  padding-bottom: 4px;
  border-radius: 10px 10px 10px 3px;
  background: #d5d5d5;
  color: #2e2e2e;
  font: 800 26px/1 "Montserrat", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.085em;
}

.brand-name { font-size: 17px; font-weight: 750; letter-spacing: -.025em; }
.brand-name span { color: #d0d0d0; font-weight: 500; }

.pilot-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 30px;
  background: var(--warning-bg);
  color: var(--warning-text);
  white-space: nowrap;
  font-size: .81rem;
  font-weight: 700;
}

.pilot-chip > span { width: 7px; height: 7px; border-radius: 50%; background: #6a6a6a; }

.access {
  display: grid;
  grid-template-columns: minmax(330px, .95fr) minmax(380px, 1.05fr);
  min-height: 100vh;
  min-height: 100svh;
}

.access-intro {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
  padding: clamp(26px, 5.4vw, 85px);
  color: #f1f1f1;
  background: var(--rail);
}

.intro-content { max-width: 500px; }
.intro-title {
  margin: 20px 0 16px;
  max-width: 12ch;
  font-size: clamp(2rem, 4.8vw, 4.55rem);
  font-weight: 720;
  line-height: 1.04;
  letter-spacing: -.056em;
}

.intro-description { max-width: 38ch; color: #d5d5d5; font-size: clamp(.96rem, 1.5vw, 1.17rem); }
.intro-flow { display: grid; gap: 0; max-width: 390px; margin-top: 34px; color: #e3e3e3; font-size: .95rem; }
.intro-flow > div { position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 0; }
.intro-flow > div + div { border-top: 1px solid #4c4c4c; }
.intro-flow > div > span { width: 10px; height: 10px; border: 2px solid #dcdcdc; border-radius: 50%; }
.intro-flow > div:nth-child(2) > span { background: #b2b2b2; border-color: #b2b2b2; }
.intro-flow > div:nth-child(3) > span { background: #bfbfbf; border-color: #bfbfbf; }
.intro-footnote { color: #c1c1c1; font-size: .83rem; }

.access-main { display: grid; align-items: center; padding: clamp(28px, 6vw, 96px); }
.access-card { width: 100%; max-width: 410px; margin-inline: auto; }
.access-card h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 3.2vw, 2.65rem); letter-spacing: -.045em; }
.access-card > p { color: var(--muted); }
.access-card form { display: grid; gap: 17px; margin-top: 28px; }
.access-card .button { margin-top: 5px; min-height: 46px; }
#access-retry { margin-top: 16px; }
.license-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.access-card .license-actions .button { margin: 0; }
.license-actions .form-error { flex-basis: 100%; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  padding: 24px 17px 20px;
  color: #e3e3e3;
  background: var(--rail);
}

.rail .brand { margin: 1px 8px 31px; }
.rail nav { display: grid; gap: 5px; }
.rail nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font-size: .89rem;
  font-weight: 600;
}

.rail nav button:hover { background: #343434; }
.rail nav button[aria-current="page"] { border-color: #545454; color: white; background: var(--rail-active); }
.rail nav button[aria-current="page"] .nav-icon { color: #dfdfdf; }
.nav-icon { position: relative; display: inline-block; flex: none; width: 16px; height: 16px; color: #bfbfbf; }
.inbox-icon { width: 16px; height: 13px; border: 1.5px solid currentColor; border-radius: 4px; }
.inbox-icon::before { content: ""; position: absolute; top: 3px; left: 3px; right: 3px; height: 1px; background: currentColor; }
.inbox-icon::after { content: ""; position: absolute; bottom: -3px; left: 3px; width: 4px; height: 4px; border-left: 1.5px solid currentColor; transform: skewY(-34deg); }
.faq-icon { border: 1.5px solid currentColor; border-radius: 50%; text-align: center; font-size: 11px; line-height: 13px; font-weight: 700; }
.team-icon::before { content: ""; position: absolute; inset: 0 4px auto; height: 8px; border: 1.5px solid currentColor; border-radius: 50%; }
.team-icon::after { content: ""; position: absolute; inset: auto 1px 0; height: 7px; border: 1.5px solid currentColor; border-radius: 7px 7px 3px 3px; }

.rail-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 16px 3px 0; margin-top: auto; border-top: 1px solid #4e4e4e; }
.rail-account { display: flex; align-items: center; gap: 9px; font-size: .87rem; }
.account-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #515151; color: #efefef; font-weight: 700; }
.sign-out { background: transparent; border: 0; color: #dedede; padding: 6px 9px; border-radius: 6px; font-size: .85rem; }
.sign-out:hover { background: #3c3c3c; }

.main { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 10px clamp(20px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fdfdfd;
  font-weight: 650;
  font-size: .88rem;
}

.page { max-width: 1440px; padding: 28px clamp(20px, 3vw, 44px) 44px; margin-inline: auto; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-header h1 { margin: 0 0 4px; font-size: clamp(1.92rem, 3.45vw, 2.85rem); line-height: 1.04; letter-spacing: -.052em; font-weight: 730; }
.page-header p { color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-height: 41px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; font-size: .88rem; font-weight: 700; text-decoration: none; line-height: 1.35; }
.button > span { font-size: 1.22rem; line-height: 1; font-weight: 500; }
.button.primary { color: var(--on-accent); background: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-deep); }
.button.secondary { color: #444444; background: #ffffff; border-color: #d2d2d2; }
.button.secondary:hover:not(:disabled) { color: var(--accent-deep); background: #f8f8f8; border-color: #b1b1b1; }
.button:disabled { opacity: .55; }
.text-button { padding: 0; color: inherit; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

.funnel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 17px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
}

.funnel-button {
  display: flex;
  min-width: 0;
  min-height: 77px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 10px clamp(7px, 1.15vw, 15px);
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.funnel-button[aria-pressed="true"] { border-color: #d9d9d9; background: var(--accent-soft); }
.funnel-button:hover:not([aria-pressed="true"]) { background: #f4f4f4; }
.funnel-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: .83rem; line-height: 1.2; font-weight: 650; }
.funnel-count { padding-left: 15px; font-size: 1.42rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stage-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5e5e5e; }
.stage-dot[data-stage="novo"] { background: #6e6e6e; }
.stage-dot[data-stage="qualificado"] { background: #686868; }
.stage-dot[data-stage="com_vendedor"] { background: #6a6a6a; }
.stage-dot[data-stage="ganho"] { background: #646464; }
.stage-dot[data-stage="perdido"] { background: #646464; }

.conversation-layout { display: grid; grid-template-columns: minmax(206px, 27%) minmax(0, 1fr); align-items: stretch; min-height: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.inbox { min-width: 0; border-right: 1px solid var(--line); }
.inbox-head { display: grid; gap: 10px; padding: 15px 13px 13px; border-bottom: 1px solid var(--line); }
.inbox-head h2 { font-size: .97rem; letter-spacing: -.015em; }
.search-field { position: relative; display: block; }
.search-field input { padding-left: 34px; padding-right: 8px; height: 37px; font-size: .79rem; border-color: #ececec; border-radius: 7px; background: #f7f7f7; }
.search-icon { position: absolute; top: 12px; left: 12px; width: 11px; height: 11px; border: 1.5px solid #707070; border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; bottom: -3px; right: -4px; width: 5px; height: 1.5px; border-radius: 1px; background: #707070; transform: rotate(45deg); }

.conversation-list { padding: 0; margin: 0; list-style: none; max-height: 62vh; overflow-y: auto; }
.conversation-list > li + li { border-top: 1px solid #eeeeee; }
.conversation-button { position: relative; display: flex; gap: 9px; align-items: flex-start; width: 100%; min-width: 0; padding: 13px; background: transparent; border: 0; text-align: left; color: var(--ink); }
.conversation-button:hover { background: #f9f9f9; }
.conversation-button[aria-current="true"] { background: #f2f2f2; box-shadow: inset 3px 0 var(--accent); }
.conversation-button:focus-visible { outline-offset: -3px; }
.person-avatar { display: grid; flex: none; align-items: center; justify-items: center; width: 32px; height: 32px; border-radius: 50%; color: #494949; background: #eaeaea; font-size: .75rem; font-weight: 750; letter-spacing: -.024em; }
.person-avatar[data-color="rose"] { color: #4e4e4e; background: #e9e9e9; }
.person-avatar[data-color="blue"] { color: #4f4f4f; background: #ededed; }
.person-avatar[data-color="mint"] { color: #555555; background: #ededed; }
.person-avatar[data-color="sand"] { color: #545454; background: #ededed; }
.conversation-summary { display: grid; min-width: 0; flex: 1; gap: 4px; }
.conversation-summary-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.conversation-summary-top strong { min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: .89rem; }
time { white-space: nowrap; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.message-preview { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.stage-tag { display: inline-flex; align-items: center; gap: 5px; width: max-content; min-width: 0; padding: 3px 7px; border-radius: 20px; color: #4f4f4f; background: #f0f0f0; line-height: 1.2; font-size: .73rem; font-weight: 700; }
.stage-tag .stage-dot { width: 6px; height: 6px; }
.stage-tag[data-stage="com_vendedor"] { color: #484848; background: #ededed; }
.stage-tag[data-stage="ganho"] { color: #545454; background: #efefef; }
.stage-tag[data-stage="perdido"] { color: #4e4e4e; background: #eeeeee; }
.inbox-empty { padding: 18px 13px; color: var(--muted); font-size: .85rem; }

.conversation-detail { display: flex; min-width: 0; flex-direction: column; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 17px; min-height: 70px; border-bottom: 1px solid var(--line); }
.contact-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.contact-heading > div { min-width: 0; }
.contact-heading h2 { font-size: 1.09rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.contact-heading p { color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.contact-heading .person-avatar { width: 39px; height: 39px; font-size: .87rem; }
.detail-body { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) minmax(163px, 27%); }
.thread { display: flex; flex-direction: column; min-width: 0; }
.timeline { flex: 1; display: flex; flex-direction: column; gap: 13px; padding: 18px 17px; margin: 0; min-height: 214px; max-height: 53vh; background: #fbfbfb; overflow-y: auto; list-style: none; }
.timeline-message { display: grid; align-self: flex-start; gap: 3px; width: fit-content; max-width: 88%; padding: 9px 11px; border: 1px solid #eaeaea; border-radius: 3px 10px 10px 10px; background: #ffffff; }
.timeline-message[data-author="aurora"], .timeline-message[data-author="vendedor"] { align-self: flex-end; border-radius: 10px 3px 10px 10px; }
.timeline-message[data-author="aurora"] { background: #efefef; border-color: #e2e2e2; }
.timeline-message[data-author="vendedor"] { background: #f0f0f0; border-color: #e7e7e7; }
.message-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .76rem; color: #4b4b4b; }
.message-meta strong { overflow-wrap: anywhere; }
.message-body, .timeline-alert p { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-body { font-size: .89rem; }
.timeline-alert { display: grid; align-self: stretch; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 9px 10px; border: 1px solid #d8d8d8; border-radius: 8px; color: #454545; background: #f0f0f0; font-size: .79rem; }
.alert-mark { display: grid; place-items: center; align-self: start; width: 17px; height: 17px; border-radius: 50%; color: #ffffff; background: #5f5f5f; font-size: .75rem; font-weight: 800; }
.timeline-alert p { margin-top: 1px; }
.timeline-empty { color: var(--muted); font-size: .85rem; }
.composer { display: grid; gap: 8px; padding: 13px 17px; border-top: 1px solid var(--line); }
.composer textarea { min-height: 62px; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.composer-actions > span, .thread-hint { color: var(--muted); font-size: .8rem; }
.thread-hint { padding: 11px 17px; border-top: 1px solid var(--line); }
.handoff { padding: 15px 12px; border-left: 1px solid var(--line); }
.handoff h3 { margin: 0 0 10px; font-size: .88rem; letter-spacing: -.01em; }
.automation-context { margin: 0 0 12px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.handoff-reason { margin: 0 0 12px; padding: 6px 8px; border-left: 2px solid var(--line); color: var(--muted); font-size: .78rem; }
.handoff-reason strong { display: block; color: var(--ink); }
.handoff form { display: grid; gap: 12px; }
.handoff select { min-height: 36px; font-size: .82rem; }
.handoff .button { padding-inline: 8px; font-size: .79rem; white-space: normal; }

.detail-empty { display: grid; place-content: center; justify-items: center; gap: 7px; flex: 1; min-height: 320px; padding: 28px 19px; text-align: center; }
.detail-empty h2 { font-size: 1.17rem; letter-spacing: -.025em; }
.detail-empty p { max-width: 43ch; color: var(--muted); }
.detail-empty .button { margin-top: 6px; }
.empty-symbol { display: grid; place-items: center; width: 47px; height: 47px; margin-bottom: 4px; border-radius: 14px 14px 14px 4px; background: #ebebeb; }
.empty-symbol .nav-icon { color: #5c5c5c; transform: scale(1.28); }

.entity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
.entity-panel { min-width: 0; border: 1px solid var(--line); background: #ffffff; border-radius: var(--radius); }
.entity-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 66px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.entity-head h2 { font-size: 1rem; letter-spacing: -.015em; overflow-wrap: anywhere; }
.entity-count, .entity-empty { color: var(--muted); font-size: .85rem; }
.entity-list { padding: 0; margin: 0; list-style: none; }
.entity-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px 17px; }
.entity-row + .entity-row { border-top: 1px solid var(--line); }
.entity-row strong { flex: 1; min-width: 0; font-size: .88rem; overflow-wrap: anywhere; }
.entity-row .entity-count { max-width: 42%; text-align: right; }
.channel-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 8px; color: #525252; background: #ebebeb; font-size: 1.04rem; font-weight: 720; }
.entity-empty { padding: 19px 17px; }
.faq-item + .faq-item { border-top: 1px solid var(--line); }
.faq-item summary { cursor: pointer; padding: 14px 17px; font-size: .94rem; font-weight: 650; overflow-wrap: anywhere; }
.faq-item summary::marker { color: var(--accent); }
.faq-item > p { max-width: 75ch; padding: 0 17px 15px 32px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.company-profile { margin-bottom: 14px; }
.company-profile .entity-head:last-child { border-bottom: 0; }
.company-profile:has(.profile-guide[hidden]) .entity-head { border-bottom: 0; }
.profile-guide { padding: 14px 17px; }
.profile-guide h3 { font-size: .92rem; margin-bottom: 4px; }
.profile-guide p { max-width: 75ch; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

label { display: grid; gap: 5px; min-width: 0; color: #373737; font-size: .87rem; font-weight: 650; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 41px; padding: 8px 10px; border: 1px solid #d6d6d6; border-radius: 7px; background: #ffffff; color: var(--ink); font-size: .93rem; font-weight: 400; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #717171; }
.field-hint { display: block; margin: 0; color: var(--muted); font-size: .8rem; font-weight: 400; }
.form-error { color: var(--danger); font-size: .83rem; font-weight: 650; }
.license-validity {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 12px clamp(20px, 3vw, 44px) 0;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: .86rem;
}
.license-validity span { color: var(--muted); }
.license-validity time {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
}
.license-validity[data-near-expiry="true"] {
  border-color: var(--license-warning-line);
  background: var(--license-warning-bg);
  color: var(--license-warning-text);
}
.license-validity[data-near-expiry="true"] span { color: inherit; }
.workspace-error { display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; padding: 9px 13px; margin: 12px clamp(20px, 3vw, 44px) 0; border: 1px solid #d8d8d8; border-radius: 8px; color: var(--danger); background: #f1f1f1; font-size: .86rem; }
.announcement { position: fixed; z-index: 4; max-width: min(400px, calc(100% - 30px)); bottom: 15px; right: 15px; padding: 8px 13px; border: 1px solid #d6d6d6; border-radius: 9px; color: #3d3d3d; background: #ededed; box-shadow: 0 4px 15px #2f2f2f12; font-size: .85rem; font-weight: 650; }
.announcement:empty { padding: 0; border: 0; box-shadow: none; }

.dialog { width: min(490px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid #dbdbdb; border-radius: 15px; color: var(--ink); background: #ffffff; box-shadow: 0 18px 55px #1d1d1d4a; overflow-y: auto; }
.dialog::backdrop { background: #27272780; }
.dialog form { padding: 18px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 15px; }
.dialog-head h2 { font-size: 1.28rem; line-height: 1.2; letter-spacing: -.028em; }
.dialog-head p { margin-top: 6px; color: var(--muted); font-size: .88rem; }
.close-button { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: #f2f2f2; font-size: 1.35rem; line-height: 1; }
.close-button:hover { background: #e7e7e7; }
.editor-fields { display: grid; gap: 12px; }
.dialog .form-error { margin-top: 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }

@media (max-width: 1150px) {
  .shell { grid-template-columns: 205px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .conversation-layout { grid-template-columns: minmax(185px, 29%) minmax(0, 1fr); }
  .detail-body { grid-template-columns: minmax(0, 1fr); }
  .handoff { border-top: 1px solid var(--line); border-left: 0; }
  .handoff form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .handoff .form-error { grid-column: 1 / -1; }
  .handoff .button { justify-self: start; }
  .entity-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .access { grid-template-columns: minmax(0, 1fr); }
  .access-intro { gap: 18px; padding: 20px 23px; }
  .intro-title { margin: 9px 0 7px; max-width: none; font-size: clamp(1.65rem, 5.5vw, 2.1rem); }
  .intro-description { max-width: 52ch; }
  .intro-flow { display: none; }
  .access-main { align-items: start; padding: 29px 23px 36px; }
  .access-card { max-width: 460px; }
  .shell { display: block; }
  .rail { position: static; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; height: auto; padding: 12px 13px; }
  .rail nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail nav button { justify-content: center; gap: 6px; min-height: 40px; padding: 6px; text-align: center; font-size: .81rem; line-height: 1.2; }
  .rail .brand { grid-row: 1; margin: 0; }
  .rail .brand-mark { width: 34px; height: 34px; font-size: 23px; }
  .rail-bottom { grid-column: 2; grid-row: 1; padding: 0; margin: 0; border: 0; }
  .rail-account { display: none; }
  .topbar { min-height: 46px; padding-inline: 15px; }
  .page { padding: 19px 15px 32px; }
  .page-header { align-items: flex-start; margin-bottom: 15px; }
  .page-header p { font-size: .9rem; }
  .conversation-layout { grid-template-columns: minmax(0, 1fr); }
  .inbox { border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-list { max-height: 38vh; }
  .detail-empty { min-height: 236px; }
  .workspace-error, .license-validity { margin-inline: 15px; }
}

@media (max-width: 520px) {
  .page-header { display: grid; gap: 10px; }
  .page-header .button { justify-self: start; }
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funnel-button { min-height: 64px; }
  .funnel-count { font-size: 1.26rem; }
  .entity-head { flex-wrap: wrap; }
  .entity-head .button { min-height: 36px; }
  .composer-actions { align-items: end; }
  .composer-actions .button { white-space: normal; }
  .timeline-message { max-width: 95%; }
}

@media (max-width: 345px) {
  .rail nav button .nav-icon { display: none; }
  .pilot-chip { padding-inline: 7px; }
  .topbar { gap: 5px; }
  .conversation-button, .detail-head, .timeline, .composer { padding-inline: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

body {
  background:
    radial-gradient(ellipse at 12% 4%, #fff 0, #ffffff00 53%),
    radial-gradient(ellipse at 99% 65%, #f9f9f9 0, #f9f9f900 70%),
    #eeeeee;
}

.brand { color: #101010; }
.brand-mark { color: #fff; background: #111; }
.brand-name { font-weight: 810; }
.brand-name span { color: #444; }
.access-intro {
  color: var(--ink);
  background: linear-gradient(144deg, #f3f3f3, #e9e9e9 76%, #fcfcfc);
  border-right: 1px solid #e3e3e3;
}
.intro-description, .intro-footnote, .intro-flow { color: #4a4a4a; }
.intro-flow { padding: 6px 17px; border: 1px solid #fff; border-radius: 17px; background: #ffffffa0; box-shadow: 0 12px 24px #1515150a, inset 0 1px #fff; }
.intro-flow > div + div { border-color: #ddd; }
.intro-flow > div > span { border-color: #636363; }
.intro-flow > div:nth-child(2) > span { border-color: #7e7e7e; background: #7e7e7e; }
.intro-flow > div:nth-child(3) > span { border-color: #202020; background: #202020; }
.rail {
  color: #363636;
  background: #ffffffe0;
  border-right: 1px solid #fff;
  box-shadow: 1px 0 16px #16161608;
  backdrop-filter: blur(20px);
}
.rail nav button:hover { background: #f5f5f5; }
.rail nav button[aria-current="page"] { color: #111; border-color: #e2e2e2; background: #eeeeee; }
.rail nav button[aria-current="page"] .nav-icon { color: #262626; }
.nav-icon { color: #686868; }
.rail-bottom { border-color: #e8e8e8; }
.account-avatar { color: #202020; background: #ededed; }
.sign-out { color: #444; }
.sign-out:hover { background: #f0f0f0; }

.topbar {
  background: #ffffffad;
  border-color: #fff;
  box-shadow: 0 1px 14px #11111107;
  backdrop-filter: blur(20px);
}
.topbar-company {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: min(440px, 72%);
  padding: 2px 6px 2px 0;
  border: 0;
  border-radius: 24px 8px 8px 24px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.topbar-company:hover { background: #f2f2f2; }
.company-avatar { position: relative; display: grid; flex: none; place-items: center; width: 36px; height: 36px; overflow: hidden; border: 1px solid #d5d5d5; border-radius: 50%; background: #efefef; }
.company-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }
.company-placeholder { display: grid; place-items: center; color: #363636; font-size: .71rem; font-weight: 750; }
.company-placeholder:empty::before { content: ""; width: 13px; height: 13px; border: 1.5px solid #777; border-radius: 50%; }
.topbar-company-copy { display: grid; min-width: 0; }
.topbar-company-copy strong, .topbar-company-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-company-copy strong { font-size: .85rem; font-weight: 730; }
.topbar-company-copy small { color: #595959; font-size: .7rem; }
.brand-edit-icon { flex: none; width: 12px; height: 4px; border: 1px solid #6a6a6a; border-radius: 1px; transform: rotate(-42deg); }
.remove-logo { justify-self: start; color: var(--danger); }

.pilot-chip { color: #343434; background: #f0f0f0; border: 1px solid #e5e5e5; }
.pilot-chip > span { background: #555; }
.funnel, .conversation-layout, .entity-panel {
  border-color: #fff;
  background: #ffffffca;
  box-shadow: 0 6px 20px #11111109, inset 0 1px #fff;
  backdrop-filter: blur(20px);
}
.funnel-button[aria-pressed="true"] { border-color: #e3e3e3; background: #eeeeee; }
.dialog { background: #fffffff5; box-shadow: 0 18px 55px #15151531, inset 0 1px #fff; backdrop-filter: blur(21px); }
.dialog::backdrop { background: #25252552; backdrop-filter: blur(5px); }

.inbox-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.inbox-title-row .text-button { color: #454545; font-size: .74rem; }
#source-filter, #inbox-channel-filter { min-height: 34px; padding-block: 5px; font-size: .76rem; }
.conversation-tags, .detail-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.detail-tags { flex: 0 0 auto; justify-content: end; max-width: 52%; }
.source-tag { display: inline-block; color: #505050; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.delivery-status { color: #555; font-size: .73rem; }
.delivery-status[data-delivery="uncertain"], .delivery-status[data-delivery="failed"] { color: var(--danger); }

.channel-card + .channel-card { border-top: 1px solid var(--line); }
.channel-card { padding-bottom: 8px; }
.channel-card .entity-row { padding-bottom: 5px; }
.channel-settings { display: grid; gap: 7px; padding: 4px 17px 8px; }
.channel-controls { display: flex; align-items: stretch; flex-wrap: wrap; gap: 7px; }
.channel-controls .button { min-height: 34px; padding: 6px 8px; font-size: .76rem; white-space: normal; }
.connection-state { flex: 0 0 auto; font-size: .73rem; font-weight: 650; color: var(--muted); }
.connection-state[data-state="connected"] { color: #171717; }
.connection-state[data-state="error"], .whatsapp-status-error { color: var(--danger); }
.whatsapp-status-error { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.connected-account { color: #484848; font-size: .81rem; overflow-wrap: anywhere; }
.connection-provider { color: var(--monkeys-ink); font-size: .74rem; font-weight: 650; }
.channel-usage { display: grid; gap: 5px; padding: 8px 0; border-block: 1px solid var(--line); }
.channel-usage-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: .74rem; }
.channel-usage-label strong { color: var(--monkeys-ink); font-size: .98rem; font-variant-numeric: tabular-nums; }
.channel-usage-warning { color: var(--monkeys-ink); font-size: .75rem; font-weight: 650; }
.usage-progress { display: block; width: 100%; height: 8px; accent-color: var(--monkeys-orange); }
#meta-preview-notice { color: var(--monkeys-ink); }
.dialog-content { padding: 18px; }
.whatsapp-connection { display: grid; justify-items: center; gap: 8px; padding: 10px; border-radius: 9px; color: #282828; background: #efefef; text-align: center; font-size: .84rem; }
.whatsapp-qr { width: min(240px, 100%); height: auto; background: #fff; image-rendering: pixelated; }
.meta-options { display: grid; gap: 6px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.meta-options label { display: flex; align-items: baseline; gap: 7px; font-size: .84rem; }
.meta-options input { flex: 0 0 auto; width: auto; min-height: auto; padding: 0; }
#meta-dialog .dialog-actions { flex-wrap: wrap; }

@media (max-width: 800px) {
  .rail { border-right: 0; border-bottom: 1px solid #fff; }
  .access-intro { border-right: 0; border-bottom: 1px solid #e2e2e2; }
}

.dashboard-icon {
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.dashboard-icon::before, .dashboard-icon::after {
  position: absolute;
  content: "";
  background: currentColor;
}
.dashboard-icon::before { width: 1px; inset: 0 auto 0 5px; }
.dashboard-icon::after { height: 1px; inset: 5px 0 auto 0; }
.tag-icon {
  height: 12px;
  width: 13px;
  border: 1.5px solid currentColor;
  border-radius: 3px 5px 5px 3px;
  transform: rotate(-37deg);
}
.tag-icon::after {
  position: absolute;
  content: "";
  inset: 3px auto auto 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}
#tag-filter { min-height: 34px; padding-block: 5px; font-size: .76rem; }
.tag-chip { display: inline-flex; align-items: flex-start; gap: 4px; max-width: 100%; padding: 2px 5px; border-radius: 7px; color: #343434; background: #efefef; font-size: .72rem; line-height: 1.4; overflow-wrap: anywhere; }
.tag-swatch { flex: none; width: 10px; height: 10px; margin-top: 2px; }
.tag-admin-row { justify-content: space-between; }
.tag-admin-row .tag-chip { padding: 0; background: none; font-size: .9rem; font-weight: 650; }
.tag-admin-row .tag-swatch { width: 13px; height: 13px; margin-top: 3px; margin-right: 4px; }
input[type="color"] { width: 52px; min-height: 36px; padding: 4px; cursor: pointer; }
.handoff .assign-tags { grid-template-columns: minmax(0, 1fr); margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.assign-tags fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.assign-tags legend { padding: 0; margin-bottom: 5px; font-size: .87rem; font-weight: 700; }
.tag-options { display: grid; gap: 6px; max-height: 170px; overflow-y: auto; }
.tag-choice { grid-template-columns: auto minmax(0, 1fr); align-items: start; justify-items: start; width: 100%; cursor: pointer; }
.tag-choice input { width: 15px; height: 15px; min-height: 0; margin: 3px 0 0 1px; padding: 0; accent-color: #333; }

@media (max-width: 800px) {
  .rail nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail nav button { justify-content: start; }
}

.topbar-brand { display: flex; align-items: center; gap: 10px; color: #111; white-space: nowrap; }
.topbar-brand .brand-name { font-size: .95rem; }
.exit-icon::before { content: ""; position: absolute; inset: 1px 7px 1px 1px; border: 1.5px solid currentColor; border-right: 0; border-radius: 3px 0 0 3px; }
.exit-icon::after { content: ""; position: absolute; top: 5px; right: 1px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.exit-icon { background: linear-gradient(currentColor, currentColor) center right 2px / 8px 1.5px no-repeat; }
.sign-out { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

@media (min-width: 801px) {
  .shell { grid-template-columns: 82px minmax(0, 1fr); }
  .rail {
    z-index: 3;
    top: 14px;
    width: 58px;
    height: max-content;
    margin: 78px 0 14px 13px;
    padding: 7px;
    border: 1px solid #fff;
    border-radius: 19px;
    background: #ffffffba;
    box-shadow: 0 8px 22px #1a1a1a13, inset 0 1px #fff;
  }
  .rail .brand { justify-content: center; width: 100%; margin: 0 0 7px; }
  .rail .brand-name { display: none; }
  .rail .brand-mark { width: 32px; height: 32px; font-size: 21px; }
  .rail nav { gap: 4px; }
  .rail nav button, .rail .sign-out { position: relative; display: grid; place-items: center; justify-content: stretch; width: 100%; min-height: 40px; padding: 0; border-radius: 10px; }
  .rail nav button[aria-current="page"]::before { content: ""; position: absolute; top: calc(50% - 7px); left: -9px; width: 3px; height: 14px; background: var(--monkeys-orange); border-radius: 4px; }
  .rail-bottom { justify-content: center; margin-top: 6px; padding: 6px 0 0; border-color: #e3e3e3; }
  .dock-label {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    z-index: 1;
    visibility: hidden;
    width: max-content;
    max-width: 180px;
    padding: 5px 8px;
    border: 1px solid #eee;
    border-radius: 7px;
    color: #151515;
    background: #fff;
    box-shadow: 0 4px 11px #17171717;
    font-size: .77rem;
    font-weight: 650;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
  }
  .rail button:is(:hover, :focus-visible) .dock-label { visibility: visible; opacity: 1; }
  .rail button .nav-icon { transition: scale 135ms ease; }
  .rail button:is(:hover, :focus-visible) .nav-icon { scale: 1.15; }
}

@media (max-width: 800px) {
  .topbar-brand .brand-name { display: none; }
  .rail .dock-label { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rail button .nav-icon { transition: none; }
}

.access-brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-toggle {
  display: inline-grid;
  flex: none;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--panel-background);
}
.theme-toggle:hover { background: var(--surface-hover); }
.theme-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transform: rotate(-30deg);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --rail: #1b1b1b;
  --rail-active: #313131;
  --ink: #f3f3f3;
  --muted: #bfbfbf;
  --subtle: #a6a6a6;
  --paper: #141414;
  --white: #222222;
  --line: #414141;
  --accent: #e6e6e6;
  --accent-deep: #fafafa;
  --accent-soft: #353535;
  --on-accent: #181818;
  --monkeys-metric: #ff883e;
  --monkeys-ink: #ffbc93;
  --surface-hover: #3b3b3b;
  --panel-background: linear-gradient(135deg, #2b2b2bf2, #202020e0);
  --panel-border: #454545;
  --panel-shadow: 0 1px 0 #ffffff14 inset, 0 10px 34px #00000040;
  --focus: #e8e8e8;
  --warning-bg: #303030;
  --warning-text: #dedede;
  --license-warning-bg: #32241c;
  --license-warning-text: var(--monkeys-ink);
  --license-warning-line: #76513c;
  --danger: #f4a7bd;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 12% 4%, #2b2b2b 0, #2b2b2b00 53%),
    radial-gradient(ellipse at 99% 65%, #212121 0, #21212100 70%),
    var(--paper);
}

[data-theme="dark"] :is(.brand, .topbar-brand, .company-placeholder, label),
[data-theme="dark"] :is(.sign-out, .connection-state[data-state="connected"]) { color: var(--ink); }
[data-theme="dark"] :is(.brand-name span, .intro-description, .intro-footnote, .intro-flow) { color: var(--muted); }
[data-theme="dark"] .brand-mark { color: var(--on-accent); background: var(--accent); }
[data-theme="dark"] .access-intro {
  background: linear-gradient(144deg, #242424, #1b1b1b 76%, #2a2a2a);
  border-color: var(--line);
}
[data-theme="dark"] .intro-flow {
  border-color: var(--panel-border);
  background: var(--panel-background);
  box-shadow: var(--panel-shadow);
}
[data-theme="dark"] .intro-flow > div + div { border-color: var(--line); }
[data-theme="dark"] .intro-flow > div > span { border-color: var(--subtle); }
[data-theme="dark"] .intro-flow > div:nth-child(2) > span { background: var(--subtle); }
[data-theme="dark"] .intro-flow > div:nth-child(3) > span {
  border-color: var(--accent);
  background: var(--accent);
}

[data-theme="dark"] :is(.rail, .topbar) {
  color: var(--muted);
  background: #252525d9;
  border-color: var(--panel-border);
  box-shadow: var(--panel-shadow);
}
[data-theme="dark"] :is(.rail nav button, .sign-out, .topbar-company):hover { background: var(--surface-hover); }
[data-theme="dark"] .rail nav button[aria-current="page"] {
  color: var(--ink);
  border-color: #565656;
  background: var(--rail-active);
}
[data-theme="dark"] .nav-icon { color: var(--muted); }
[data-theme="dark"] .rail nav button[aria-current="page"] .nav-icon { color: var(--ink); }
[data-theme="dark"] .rail nav button[aria-current="page"]::before { background: var(--monkeys-orange); }
[data-theme="dark"] .rail-bottom { border-color: var(--line); }
[data-theme="dark"] .dock-label { color: var(--ink); }
@media (min-width: 801px) {
  [data-theme="dark"] .dock-label {
    border-color: var(--panel-border);
    background: var(--white);
    box-shadow: var(--panel-shadow);
  }
}

[data-theme="dark"] :is(.pilot-chip, .company-avatar) {
  color: var(--warning-text);
  background: var(--warning-bg);
  border-color: var(--line);
}
[data-theme="dark"] .pilot-chip > span { background: var(--subtle); }
[data-theme="dark"] .company-placeholder:empty::before,
[data-theme="dark"] .brand-edit-icon { border-color: var(--subtle); }
[data-theme="dark"] :is(.topbar-company-copy small, .source-tag, .connected-account, .inbox-title-row .text-button, .message-meta) { color: var(--muted); }
[data-theme="dark"] .delivery-status:not([data-delivery="failed"], [data-delivery="uncertain"]) { color: var(--muted); }

[data-theme="dark"] :is(.funnel, .conversation-layout, .entity-panel) {
  border-color: var(--panel-border);
  background: var(--panel-background);
  box-shadow: var(--panel-shadow);
}
[data-theme="dark"] .funnel-button[aria-pressed="true"] {
  border-color: #565656;
  background: var(--accent-soft);
}
[data-theme="dark"] .funnel-button:hover:not([aria-pressed="true"]),
[data-theme="dark"] .conversation-button:hover { background: var(--surface-hover); }
[data-theme="dark"] .conversation-list > li + li { border-color: var(--line); }
[data-theme="dark"] .conversation-button[aria-current="true"] { background: var(--accent-soft); }
[data-theme="dark"] .stage-dot[data-stage] { background: var(--subtle); }
[data-theme="dark"] :is(.person-avatar, .stage-tag, .channel-icon, .tag-chip, .empty-symbol) {
  color: var(--warning-text);
  background: var(--warning-bg);
}
[data-theme="dark"] .tag-admin-row .tag-chip { background: none; }
[data-theme="dark"] .tag-swatch { outline: 1px solid #ffffff66; outline-offset: 1px; }
[data-theme="dark"] .empty-symbol .nav-icon { color: var(--muted); }

[data-theme="dark"] .timeline { background: #1c1c1c; }
[data-theme="dark"] .timeline-message {
  border-color: var(--line);
  background: #282828;
}
[data-theme="dark"] .timeline-message[data-author="aurora"] { background: #303030; }
[data-theme="dark"] .timeline-message[data-author="vendedor"] { background: #343434; }
[data-theme="dark"] :is(.timeline-alert, .announcement, .whatsapp-connection) {
  color: var(--warning-text);
  border-color: var(--line);
  background: var(--warning-bg);
}
[data-theme="dark"] .alert-mark { color: var(--on-accent); background: var(--accent); }

[data-theme="dark"] :is(input, select, textarea, .search-field input, .button.secondary) {
  border-color: #6e6e6e;
  color: var(--ink);
  background: #222222;
}
[data-theme="dark"] :is(input, textarea)::placeholder { color: var(--subtle); }
[data-theme="dark"] .search-icon { border-color: var(--subtle); }
[data-theme="dark"] .search-icon::after { background: var(--subtle); }
[data-theme="dark"] .button.secondary:hover:not(:disabled) {
  border-color: var(--subtle);
  color: var(--ink);
  background: var(--surface-hover);
}
[data-theme="dark"] .tag-choice input { accent-color: var(--accent); }
[data-theme="dark"] .dialog {
  border-color: var(--panel-border);
  background: #252525f5;
  box-shadow: var(--panel-shadow);
}
[data-theme="dark"] .dialog::backdrop { background: #0b0b0bc9; }
[data-theme="dark"] .close-button { background: var(--warning-bg); }
[data-theme="dark"] .close-button:hover { background: var(--surface-hover); }
[data-theme="dark"] .workspace-error { border-color: var(--line); background: var(--warning-bg); }
