:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-muted: #eef3ef;
  --ink: #1d2724;
  --muted: #64726d;
  --line: #dce4df;
  --brand: #19191b;
  --brand-strong: #0b0b0d;
  --brand-soft: #eeeeec;
  --accent: #f2643b;
  --accent-strong: #d94e2a;
  --accent-soft: #fff0e9;
  --blue: #2459c9;
  --blue-soft: #e8eefc;
  --gold: #93640f;
  --gold-soft: #fff4d8;
  --red: #b42318;
  --red-soft: #fee4df;
  --green: #23784e;
  --green-soft: #e3f5e9;
  --shadow: 0 18px 50px rgba(29, 39, 36, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

textarea {
  resize: vertical;
}

.login-screen {
  display: grid;
  height: 100vh;
  overflow: auto;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(242, 100, 59, 0.08), rgba(25, 25, 27, 0.04)),
    var(--bg);
}

.login-panel {
  display: grid;
  width: min(100%, 460px);
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand .brand-mark {
  color: #ffffff;
  background: var(--brand);
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span,
.login-copy p,
.future-auth-note span {
  color: var(--muted);
}

.login-copy h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.login-copy p {
  margin: 10px 0 0;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.future-auth-note {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted);
  line-height: 1.4;
}

.future-auth-note strong {
  color: var(--brand);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 28px;
  height: 100vh;
  overflow: hidden;
  padding: 24px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand-strong), var(--brand));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.brand strong,
.brand span,
.user-test-panel strong,
.user-test-panel span,
.user-test-panel small {
  display: block;
}

.brand span,
.user-test-panel span,
.user-test-panel small {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-main {
  display: grid;
  align-content: start;
  gap: 28px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-menu {
  display: grid;
  gap: 8px;
}

.nav-menu a {
  padding: 12px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.data-source-status {
  display: grid;
  gap: 7px;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 7px 9px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.data-source-status--panel {
  gap: 10px;
  align-items: stretch;
}

.data-source-status--supabase-ready {
  border-color: rgba(125, 211, 252, 0.32);
  color: #e0f2fe;
  background: rgba(14, 116, 144, 0.3);
}

.data-source-status--supabase-no-session,
.data-source-status--supabase-unavailable,
.data-source-status--supabase-auth-error {
  border-color: rgba(251, 191, 36, 0.32);
  color: #fef3c7;
  background: rgba(146, 64, 14, 0.28);
}

.data-source-status__header,
.supabase-local-login,
.supabase-local-login label,
.supabase-local-context {
  display: grid;
  gap: 7px;
}

.data-source-status__header small,
.data-source-status__detail,
.supabase-local-login label span,
.supabase-local-context dt {
  color: rgba(255, 255, 255, 0.72);
}

.supabase-local-login input {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 0 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.supabase-local-login input::placeholder {
  color: rgba(255, 255, 255, 0.52);
}

.supabase-local-context {
  margin: 0;
}

.supabase-local-context div {
  display: grid;
  gap: 2px;
}

.supabase-local-context dt,
.supabase-local-context dd {
  margin: 0;
}

.supabase-local-context dd {
  color: #ffffff;
}

.user-test-panel {
  display: grid;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.user-switcher {
  display: grid;
  gap: 8px;
}

.user-switcher span,
.current-user-meta small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.user-switcher select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.user-switcher option {
  color: var(--ink);
  background: #ffffff;
}

.current-user-meta {
  display: grid;
  gap: 3px;
}

.current-user-meta strong {
  color: #ffffff;
}

.main-content {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h1,
.panel h2 {
  margin: 0;
  line-height: 1.15;
}

.page-header h1 {
  font-size: 32px;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
}

.button--primary {
  color: #ffffff;
  background: var(--brand);
}

.button--primary:hover:not(:disabled) {
  background: var(--brand-strong);
}

.button--secondary {
  color: var(--brand);
  background: var(--brand-soft);
}

.button--attention {
  color: #ffffff;
  background: var(--red);
  box-shadow: 0 10px 24px rgba(180, 35, 24, 0.2);
}

.button--attention:hover:not(:disabled) {
  background: #8f1d14;
}

.button--ghost {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.button--full {
  width: 100%;
}

.button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card,
.panel,
.conversation-card,
.lead-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 18px;
}

.kpi-card span,
.lead-strip span,
.conversation-card dt,
.control-details dt,
.summary-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 22px;
}

.filter-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
  font-weight: 750;
}

.filter-chip strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: rgba(242, 100, 59, 0.36);
  color: var(--brand);
  background: var(--brand-soft);
}

.filter-chip.is-active strong {
  color: #ffffff;
  background: var(--brand);
}

.inbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.conversation-list {
  display: grid;
  gap: 14px;
}

.conversation-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.conversation-card:hover {
  border-color: rgba(242, 100, 59, 0.32);
  transform: translateY(-1px);
}

.conversation-card--needs-human {
  border-color: rgba(180, 35, 24, 0.28);
}

.conversation-card--unassigned .avatar {
  color: var(--red);
  background: var(--red-soft);
}

.conversation-card__top {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.conversation-card h2 {
  margin: 0;
  font-size: 18px;
}

.conversation-card__top > div:nth-child(2) {
  min-width: 0;
}

.conversation-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.conversation-card__time {
  display: grid;
  gap: 2px;
  margin-left: auto;
  text-align: right;
}

.conversation-card__time span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.conversation-card__time strong {
  white-space: nowrap;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 800;
}

.conversation-preview {
  display: -webkit-box;
  overflow: hidden;
  min-height: 44px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.conversation-card__badges,
.header-actions,
.sender-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attention-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--surface-muted);
}

.attention-line span {
  color: var(--muted);
  font-size: 13px;
}

.attention-line--urgent {
  border-color: rgba(180, 35, 24, 0.22);
  color: var(--red);
  background: var(--red-soft);
}

.attention-line--urgent span {
  color: #7b2b25;
}

.conversation-card__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.conversation-card dd,
.control-details dd,
.summary-list dd {
  margin: 4px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.conversation-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge--status {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-em_atendimento {
  color: var(--green);
  background: var(--green-soft);
}

.status-finalizado {
  color: #4b5563;
  background: #edf0f2;
}

.status-perdido {
  color: var(--red);
  background: var(--red-soft);
}

.badge--priority {
  color: var(--gold);
  background: var(--gold-soft);
}

.priority-alta {
  color: var(--red);
  background: var(--red-soft);
}

.priority-baixa {
  color: var(--green);
  background: var(--green-soft);
}

.badge--nina-active {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge--nina-paused {
  color: var(--red);
  background: var(--red-soft);
}

.badge--unassigned {
  color: var(--red);
  background: #fff1f0;
}

.action-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.action-pill--urgent {
  color: var(--red);
  background: var(--red-soft);
}

.action-pill--info {
  color: var(--blue);
  background: var(--blue-soft);
}

.action-pill--warning {
  color: var(--gold);
  background: var(--gold-soft);
}

.action-pill--neutral {
  color: #4b5563;
  background: #edf0f2;
}

.panel {
  padding: 18px;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.queue-list div:last-child {
  border-bottom: 0;
}

.queue-list span {
  color: var(--muted);
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.conversation-main,
.conversation-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand);
  font-weight: 750;
}

.lead-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px;
}

.lead-strip strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.nina-state {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 8px;
}

.nina-state span {
  color: var(--muted);
}

.nina-state--active {
  border: 1px solid rgba(36, 89, 201, 0.22);
  background: var(--blue-soft);
}

.nina-state--paused {
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: var(--red-soft);
}

.field-label,
.transfer-form label,
.reply-form label,
.note-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reply-form label span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.transfer-form {
  display: grid;
  gap: 10px;
}

.assignment-warning {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(147, 100, 15, 0.28);
  border-radius: 8px;
  color: #6f4c0c;
  background: var(--gold-soft);
  line-height: 1.4;
}

.assignment-warning strong {
  color: var(--gold);
}

.select,
.reply-form textarea,
.note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.select {
  height: 42px;
  margin-bottom: 12px;
  padding: 0 12px;
}

.control-details {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.role-chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.message-thread {
  display: grid;
  gap: 12px;
}

.message {
  max-width: min(680px, 92%);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.message__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.message__meta strong {
  color: var(--ink);
}

.message--cliente {
  justify-self: start;
  background: #ffffff;
}

.message--nina {
  justify-self: start;
  border-color: rgba(36, 89, 201, 0.2);
  background: var(--blue-soft);
}

.message--corretor {
  justify-self: end;
  border-color: rgba(242, 100, 59, 0.16);
  background: var(--accent-soft);
}

.message--sistema {
  justify-self: center;
  max-width: 560px;
  border-style: dashed;
  background: #f7f4ee;
  text-align: center;
}

.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.legend-dot::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  content: "";
}

.legend-dot--cliente::before {
  background: #ffffff;
  border: 1px solid var(--muted);
}

.legend-dot--nina::before {
  background: var(--blue);
}

.legend-dot--corretor::before {
  background: var(--accent);
}

.legend-dot--sistema::before {
  background: var(--gold);
}

.reply-form,
.note-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reply-form textarea,
.note-form textarea {
  min-height: 92px;
  padding: 12px;
}

.reply-form .button,
.note-form .button {
  justify-self: end;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.summary-note {
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--surface-muted);
  line-height: 1.45;
}

.note-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.note-card {
  padding: 13px;
  border: 1px solid rgba(147, 100, 15, 0.24);
  border-radius: 8px;
  background: var(--gold-soft);
}

.note-card p {
  margin: 0;
  line-height: 1.45;
}

.note-card footer {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfb;
}

.empty-state strong {
  color: var(--ink);
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.supervision-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

.supervision-table th,
.supervision-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.supervision-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.supervision-table td > span:not(.badge):not(.action-pill) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.supervision-table .badge,
.supervision-table .action-pill {
  display: inline-flex;
  margin-top: 0;
}

.table-link {
  color: var(--brand);
  font-weight: 800;
}

.supervision-tab-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding: 3px 0 8px;
  scrollbar-width: thin;
}

.supervision-tab-link {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.supervision-tab-link:hover,
.supervision-tab-link.is-active {
  border-color: rgba(42, 157, 143, 0.42);
  color: var(--brand);
  background: var(--accent-soft);
}

.supervision-overview-panel,
.supervision-security-panel {
  display: grid;
  gap: 14px;
}

.supervision-security-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.supervision-security-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.supervision-security-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.supervision-security-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .inbox-grid,
  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .conversation-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-side .internal-notes {
    grid-column: 1 / -1;
  }

  .lead-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: auto;
    max-height: 46vh;
    gap: 18px;
    overflow: hidden;
  }

  .sidebar-main {
    gap: 18px;
    overflow-y: auto;
  }

  .nav-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer {
    padding-top: 14px;
  }

  .main-content {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
  }

  .page-header,
  .panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .kpi-grid,
  .quick-filters,
  .conversation-side,
  .lead-strip {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 26px;
  }
}

@media (max-width: 560px) {
  .main-content {
    padding: 16px;
  }

  .conversation-card__details,
  .nav-menu {
    grid-template-columns: 1fr;
  }

  .conversation-card__top,
  .attention-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversation-card__time {
    margin-left: 0;
    text-align: left;
  }

  .conversation-card footer {
    flex-direction: column;
  }

  .message {
    max-width: 100%;
  }
}

/* Modern app-style responsive refresh */
:root {
  --bg: #f6f8f5;
  --surface-muted: #f0f5f1;
  --line: #e5ece7;
  --shadow: 0 10px 28px rgba(29, 39, 36, 0.07);
}

body {
  background: var(--bg);
}

.app-shell {
  background: var(--bg);
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: #111113;
}

.brand-mark,
.avatar,
.kpi-card,
.panel,
.conversation-card,
.lead-strip,
.note-card,
.empty-state,
.login-panel,
.future-auth-note,
.nina-state,
.assignment-warning {
  border-radius: 8px;
}

.main-content {
  padding: 18px;
}

.main-content > * {
  width: min(100%, 1240px);
  margin-right: auto;
  margin-left: auto;
}

.page-header {
  align-items: center;
  margin-bottom: 18px;
}

.page-header h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.button {
  border-radius: 999px;
}

.button--secondary {
  border: 1px solid rgba(18, 18, 20, 0.08);
}

.kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  padding: 14px;
  box-shadow: none;
}

.kpi-card strong {
  font-size: 24px;
}

.quick-filters {
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -18px 16px;
  padding: 0 18px 4px;
  scrollbar-width: none;
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(29, 39, 36, 0.05);
}

.filter-chip.is-active {
  color: #ffffff;
  background: var(--brand);
}

.filter-chip.is-active strong {
  color: var(--brand);
  background: #ffffff;
}

.inbox-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.inbox-help {
  order: -1;
}

.conversation-list {
  gap: 12px;
}

.conversation-card {
  gap: 12px;
  border-color: transparent;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(29, 39, 36, 0.06);
}

.conversation-card:hover {
  border-color: rgba(242, 100, 59, 0.24);
  transform: none;
}

.conversation-card__top {
  align-items: flex-start;
}

.conversation-card h2 {
  font-size: 17px;
}

.conversation-card__time {
  min-width: 72px;
}

.conversation-card__time span {
  display: none;
}

.conversation-card__time strong {
  color: var(--brand);
  font-size: 13px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.conversation-preview {
  min-height: auto;
  color: var(--muted);
  line-height: 1.45;
}

.conversation-card__badges,
.header-actions,
.sender-legend,
.supervision-card__chips {
  gap: 6px;
}

.conversation-card__details {
  grid-template-columns: 1fr;
  gap: 8px;
}

.conversation-card__details div:first-child {
  display: none;
}

.conversation-card footer {
  display: block;
  color: var(--muted);
}

.conversation-card footer span:last-child {
  display: none;
}

.badge,
.action-pill {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.badge--responsible {
  color: var(--brand);
  background: var(--brand-soft);
}

.attention-line {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  border: 0;
  padding: 10px 11px;
}

.attention-line span {
  line-height: 1.35;
}

.conversation-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

.conversation-side {
  gap: 14px;
}

.lead-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.messages-panel {
  padding: 14px;
}

.message-thread {
  gap: 10px;
}

.message {
  max-width: 88%;
  border: 0;
  padding: 12px 13px;
  box-shadow: 0 1px 2px rgba(29, 39, 36, 0.05);
}

.message--cliente {
  background: #ffffff;
}

.message--nina {
  background: #eef4ff;
}

.message--corretor {
  background: #e7f6ec;
}

.message--sistema {
  max-width: 92%;
  border: 1px dashed rgba(147, 100, 15, 0.26);
  box-shadow: none;
}

.reply-form textarea,
.note-form textarea {
  min-height: 86px;
  border-color: var(--line);
}

.table-wrap {
  display: none;
}

.supervision-cards {
  display: grid;
  gap: 12px;
}

.supervision-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.supervision-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.supervision-card__header strong,
.supervision-card__header span {
  display: block;
}

.supervision-card__header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.supervision-card__chips {
  display: flex;
  flex-wrap: wrap;
}

.supervision-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.supervision-card__meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.supervision-card__meta dd {
  margin: 4px 0 0;
}

@media (min-width: 720px) {
  .main-content {
    padding: 24px;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .quick-filters {
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
  }

  .conversation-card__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-card__details div:first-child {
    display: block;
  }

  .conversation-card footer {
    display: flex;
  }

  .conversation-card footer span:last-child {
    display: inline;
  }

  .lead-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 881px) {
  .app-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .sidebar {
    padding: 22px 18px;
  }

  .main-content {
    padding: 28px 32px;
  }

  .page-header h1 {
    font-size: 30px;
  }

  .inbox-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
  }

  .inbox-help {
    order: initial;
  }

  .conversation-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (min-width: 1080px) {
  .conversation-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  .table-wrap {
    display: block;
  }

  .supervision-cards {
    display: none;
  }
}

@media (min-width: 1540px) {
  .conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    max-height: 280px;
    gap: 12px;
    padding: 12px 16px;
    background: #111113;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    font-size: 13px;
  }

  .nav-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-menu a {
    display: grid;
    min-height: 36px;
    place-items: center;
    padding: 0 12px;
    border-radius: 999px;
    text-align: center;
  }

  .user-test-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding-top: 10px;
  }

  .user-switcher {
    grid-column: auto;
  }

  .user-switcher select {
    min-height: 38px;
  }

  .current-user-meta {
    display: none;
  }

  .sidebar-footer {
    padding-top: 8px;
  }

  .sidebar-footer .button,
  .user-test-panel .button {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .sidebar {
    max-height: 250px;
  }

  .login-panel {
    padding: 22px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-card strong {
    font-size: 22px;
  }

  .conversation-card {
    padding: 14px;
  }

  .conversation-card__top {
    flex-direction: row;
  }

  .conversation-card__time {
    margin-left: auto;
    text-align: right;
  }

  .message {
    max-width: 100%;
  }

  .supervision-card__header,
  .supervision-card__meta {
    grid-template-columns: 1fr;
  }
}

/* Final visual refactor: modern, app-like mobile and wider desktop canvas */
:root {
  --bg: #f7f9f6;
  --surface: #ffffff;
  --surface-muted: #f1f6f2;
  --line: #dfe8e2;
  --shadow: 0 14px 38px rgba(29, 39, 36, 0.08);
  --shadow-soft: 0 4px 16px rgba(29, 39, 36, 0.06);
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100dvh;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(242, 100, 59, 0.045), rgba(255, 255, 255, 0) 260px),
    var(--bg);
}

.sidebar {
  position: relative;
  height: 100dvh;
  padding: 24px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #0b0b0d 0%, #232326 100%);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.nav-menu a {
  display: flex;
  min-height: 42px;
  align-items: center;
  border-radius: 12px;
  font-weight: 750;
}

.sidebar-footer {
  padding-top: 16px;
}

.main-content {
  height: 100dvh;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 32px;
}

.main-content > * {
  width: min(100%, 1520px);
}

.page-header {
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 32px;
  line-height: 1.08;
}

.page-header p {
  max-width: 860px;
}

.button {
  min-height: 42px;
  border-radius: 999px;
  box-shadow: none;
}

.button--primary,
.button--attention {
  box-shadow: var(--shadow-soft);
}

.button--secondary {
  border: 1px solid rgba(18, 18, 20, 0.1);
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card,
.panel,
.conversation-card,
.lead-strip,
.supervision-card,
.login-panel {
  border-color: rgba(223, 232, 226, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.kpi-card {
  padding: 16px;
}

.kpi-card strong {
  margin-top: 6px;
  font-size: 28px;
}

.quick-filters {
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  margin: 0 0 20px;
  padding: 0;
}

.filter-chip {
  max-width: 100%;
  min-height: 36px;
  border-color: rgba(223, 232, 226, 0.95);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: rgba(242, 100, 59, 0.36);
}

.inbox-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px;
}

.inbox-help {
  position: sticky;
  top: 24px;
  order: initial;
}

.conversation-list {
  gap: 14px;
}

.conversation-card {
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border-color: rgba(223, 232, 226, 0.88);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.conversation-card:hover {
  border-color: rgba(242, 100, 59, 0.28);
  box-shadow: 0 10px 28px rgba(29, 39, 36, 0.09);
  transform: translateY(-1px);
}

.conversation-card__top {
  min-width: 0;
  align-items: center;
}

.conversation-card__top > div:nth-child(2) {
  min-width: 0;
}

.conversation-card h2 {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card p {
  overflow-wrap: anywhere;
}

.conversation-card__time {
  min-width: 72px;
}

.conversation-card__time span {
  display: none;
}

.conversation-card__time strong {
  color: var(--brand);
  font-size: 13px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.conversation-preview {
  min-height: 0;
  margin: 0;
  color: #53635d;
  line-height: 1.42;
}

.conversation-card__badges,
.header-actions,
.sender-legend,
.supervision-card__chips {
  gap: 6px;
}

.badge,
.action-pill {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
  line-height: 1;
}

.badge--responsible {
  color: var(--brand);
  background: var(--brand-soft);
}

.attention-line {
  gap: 10px;
  padding: 10px 12px;
  border-color: transparent;
  border-radius: 12px;
}

.attention-line strong {
  white-space: nowrap;
}

.attention-line span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.conversation-card__details {
  gap: 12px;
}

.conversation-card footer {
  min-width: 0;
  font-size: 12px;
}

.conversation-card footer span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.conversation-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 20px;
}

.conversation-main,
.conversation-side {
  min-width: 0;
}

.conversation-side {
  align-content: start;
}

.conversation-header {
  align-items: flex-start;
}

.lead-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px;
}

.messages-panel {
  padding: 16px;
}

.message-thread {
  gap: 12px;
}

.message {
  max-width: min(720px, 78%);
  border: 0;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(29, 39, 36, 0.06);
}

.message--cliente {
  border-top-left-radius: 6px;
}

.message--nina {
  border-top-left-radius: 6px;
  background: #edf4ff;
}

.message--corretor {
  border-top-right-radius: 6px;
  background: #e6f6ed;
}

.message--sistema {
  max-width: min(620px, 92%);
  border: 1px dashed rgba(147, 100, 15, 0.3);
  border-radius: 14px;
  background: #fff8e6;
  box-shadow: none;
}

.message p {
  line-height: 1.48;
}

.reply-form,
.note-form {
  gap: 10px;
}

.reply-form textarea,
.note-form textarea {
  min-height: 92px;
  border-radius: 14px;
}

.internal-notes {
  border-color: rgba(147, 100, 15, 0.2);
}

.note-card {
  border-radius: 14px;
  background: #fff8e6;
}

.table-panel {
  min-width: 0;
}

.table-wrap {
  display: block;
  overflow-x: auto;
}

.supervision-cards {
  display: none;
}

.supervision-table {
  min-width: 980px;
}

.supervision-table th,
.supervision-table td {
  padding: 13px 12px;
}

@media (min-width: 1540px) {
  .conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1540px) {
  .conversation-layout {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}

@media (max-width: 1180px) {
  .inbox-grid,
  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .inbox-help {
    position: static;
    order: -1;
  }

  .conversation-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-side .internal-notes {
    grid-column: 1 / -1;
  }

  .lead-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
  }

  .sidebar {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand logout"
      "main main";
    gap: 10px 12px;
    height: auto;
    max-height: none;
    padding: 10px 12px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    overflow: visible;
    box-shadow: 0 8px 24px rgba(18, 18, 20, 0.22);
  }

  .sidebar-top {
    grid-area: brand;
    min-width: 0;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 12px;
  }

  .brand strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand span {
    display: none;
  }

  .sidebar-main {
    grid-area: main;
    display: grid;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .nav-menu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-menu a {
    flex: 1 0 132px;
    min-height: 36px;
    justify-content: center;
    padding: 0 12px;
    border-radius: 999px;
    text-align: center;
  }

  .user-test-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding-top: 0;
    border-top: 0;
  }

  .user-switcher {
    min-width: 0;
  }

  .user-switcher span,
  .current-user-meta {
    display: none;
  }

  .user-switcher select {
    min-height: 38px;
    border-radius: 999px;
    text-overflow: ellipsis;
  }

  .sidebar-footer {
    grid-area: logout;
    align-self: center;
    padding: 0;
    border-top: 0;
  }

  .sidebar-footer .button,
  .user-test-panel .button {
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .main-content {
    height: 100%;
    min-height: 0;
    padding: 18px 16px 24px;
  }

  .main-content > * {
    width: 100%;
  }

  .page-header,
  .conversation-header,
  .panel__header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-header h1 {
    font-size: 26px;
  }

  .page-header .button {
    width: 100%;
  }

  .header-actions,
  .sender-legend {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-width: 0;
    padding: 13px;
  }

  .quick-filters {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -16px 16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }

  .quick-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .inbox-grid,
  .conversation-layout,
  .conversation-side,
  .lead-strip {
    grid-template-columns: 1fr;
  }

  .conversation-side .internal-notes {
    grid-column: auto;
  }

  .conversation-card {
    width: 100%;
    border-radius: 18px;
    padding: 15px;
  }

  .conversation-card:hover {
    transform: none;
  }

  .conversation-card__top {
    align-items: flex-start;
  }

  .conversation-card__time {
    margin-left: auto;
    text-align: right;
  }

  .conversation-card__badges {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .attention-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .attention-line strong {
    white-space: normal;
  }

  .conversation-card__details {
    grid-template-columns: 1fr;
  }

  .conversation-card__details div:first-child {
    display: none;
  }

  .conversation-card footer {
    display: block;
  }

  .conversation-card footer span:last-child {
    display: none;
  }

  .lead-strip {
    gap: 10px;
  }

  .messages-panel {
    padding: 12px;
    border-radius: 18px;
  }

  .message {
    max-width: 88%;
    border-radius: 18px;
  }

  .message--cliente,
  .message--nina {
    border-top-left-radius: 6px;
  }

  .message--corretor {
    border-top-right-radius: 6px;
  }

  .message--sistema {
    max-width: 100%;
  }

  .reply-form {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    margin-right: -12px;
    margin-left: -12px;
    padding: 12px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 18px 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 24px rgba(29, 39, 36, 0.06);
  }

  .reply-form textarea {
    min-height: 82px;
  }

  .reply-form .button,
  .note-form .button {
    width: 100%;
    justify-self: stretch;
  }

  .table-wrap {
    display: none;
  }

  .supervision-cards {
    display: grid;
    gap: 12px;
  }

  .supervision-card {
    gap: 12px;
    border-radius: 18px;
    padding: 14px;
  }

  .supervision-card__header {
    align-items: flex-start;
  }

  .supervision-card__header .action-pill {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .sidebar {
    gap: 8px;
    padding: 9px 10px 10px;
  }

  .sidebar-footer .button,
  .user-test-panel .button {
    min-height: 34px;
    padding: 0 10px;
  }

  .nav-menu a {
    flex-basis: 116px;
  }

  .main-content {
    padding: 16px 12px 22px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card strong {
    font-size: 22px;
  }

  .conversation-card__top {
    gap: 10px;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }

  .conversation-card h2 {
    font-size: 16px;
  }

  .message {
    max-width: 100%;
  }

  .supervision-card__header {
    flex-direction: column;
  }

  .supervision-card__meta {
    grid-template-columns: 1fr;
  }
}

/* UNE Rio Grande identity correction: black, white, coral and neutral grays */
:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-muted: #f1f1ef;
  --ink: #19191b;
  --muted: #666b70;
  --line: #e1e2df;
  --brand: #19191b;
  --brand-strong: #0b0b0d;
  --brand-soft: #eeeeec;
  --accent: #f2643b;
  --accent-strong: #d94e2a;
  --accent-soft: #fff0e9;
  --accent-muted: #ffd9ca;
  --shadow: 0 14px 38px rgba(18, 18, 20, 0.08);
  --shadow-soft: 0 5px 18px rgba(18, 18, 20, 0.07);
}

body {
  background: var(--bg);
}

.login-screen,
.app-shell {
  background:
    linear-gradient(180deg, rgba(242, 100, 59, 0.045), rgba(255, 255, 255, 0) 300px),
    var(--bg);
}

.sidebar {
  color: #ffffff;
  border-right-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #0b0b0d 0%, #232326 100%);
}

.brand-mark,
.login-brand .brand-mark {
  color: #ffffff;
  border-color: rgba(242, 100, 59, 0.55);
  background:
    linear-gradient(135deg, rgba(242, 100, 59, 0.95), rgba(242, 100, 59, 0.55)),
    #111113;
}

.brand strong,
.login-brand strong {
  color: #ffffff;
}

.login-brand strong {
  color: var(--ink);
}

.brand span,
.user-test-panel span,
.user-test-panel small {
  color: rgba(255, 255, 255, 0.68);
}

.brand .brand-mark,
.login-brand .brand-mark {
  color: #ffffff;
}

.eyebrow,
.back-link,
.table-link {
  color: var(--accent);
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: #ffffff;
  background: rgba(242, 100, 59, 0.2);
}

.nav-menu a.is-active {
  box-shadow: inset 0 0 0 1px rgba(242, 100, 59, 0.28);
}

.button--primary {
  color: #ffffff;
  background: var(--accent);
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button--secondary {
  color: var(--brand);
  background: var(--brand-soft);
}

.button--secondary:hover:not(:disabled) {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.button--ghost {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.button--ghost:hover:not(:disabled) {
  background: rgba(242, 100, 59, 0.18);
}

.button--attention {
  color: #ffffff;
  background: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(217, 78, 42, 0.22);
}

.button--attention:hover:not(:disabled) {
  background: #bd3f20;
}

.filter-chip {
  color: #555b60;
  background: #ffffff;
}

.filter-chip strong {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: rgba(242, 100, 59, 0.36);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.filter-chip.is-active {
  color: #ffffff;
  background: var(--accent);
}

.filter-chip.is-active strong {
  color: var(--accent-strong);
  background: #ffffff;
}

.kpi-card strong,
.conversation-card__time strong {
  color: var(--brand);
}

.avatar {
  color: var(--brand);
  background: var(--brand-soft);
}

.conversation-card:hover {
  border-color: rgba(242, 100, 59, 0.28);
}

.conversation-card--needs-human {
  border-color: rgba(242, 100, 59, 0.28);
}

.attention-line {
  color: var(--brand);
  background: var(--surface-muted);
}

.attention-line--urgent {
  color: var(--accent-strong);
  border-color: rgba(242, 100, 59, 0.24);
  background: var(--accent-soft);
}

.attention-line--urgent span {
  color: #86402c;
}

.badge--responsible,
.role-chip {
  color: var(--brand);
  background: var(--brand-soft);
}

.badge--unassigned,
.action-pill--urgent {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.action-pill--warning {
  color: #8a4b10;
  background: #fff2d7;
}

.message--corretor {
  border-color: rgba(242, 100, 59, 0.16);
  background: var(--accent-soft);
}

.legend-dot--corretor::before {
  background: var(--accent);
}

.summary-note {
  color: var(--brand);
  background: var(--surface-muted);
}

.internal-notes {
  border-color: rgba(242, 100, 59, 0.18);
}

.note-card {
  border-color: rgba(242, 100, 59, 0.22);
  background: var(--accent-soft);
}

.user-switcher select {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

.current-user-meta strong {
  color: #ffffff;
}

@media (max-width: 880px) {
  .sidebar {
    background: linear-gradient(180deg, #0b0b0d 0%, #202023 100%);
    box-shadow: 0 8px 24px rgba(18, 18, 20, 0.22);
  }

  .nav-menu a:hover,
  .nav-menu a.is-active {
    background: rgba(242, 100, 59, 0.22);
  }
}

/* Operational inbox refinement */
.conversation-card {
  gap: 8px;
  padding: 14px;
}

.conversation-card__top {
  gap: 10px;
}

.conversation-card h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 820;
}

.conversation-card__top p {
  margin-top: 2px;
  color: #6a6f74;
  font-size: 13px;
}

.conversation-preview {
  color: #33363a;
  font-size: 14px;
  line-height: 1.36;
  -webkit-line-clamp: 1;
}

.conversation-card__badges {
  gap: 5px;
}

.conversation-card__badges .badge--responsible {
  display: none;
}

.conversation-card--needs-human {
  border-color: rgba(225, 226, 223, 0.95);
  box-shadow:
    inset 3px 0 0 rgba(242, 100, 59, 0.38),
    var(--shadow-soft);
}

.conversation-card--needs-human:hover {
  border-color: rgba(242, 100, 59, 0.22);
}

.attention-line {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  flex-direction: row;
  justify-content: flex-start;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(225, 226, 223, 0.95);
  border-radius: 999px;
  color: #3b3d40;
  background: #f5f5f3;
  font-size: 12px;
  line-height: 1.1;
}

.attention-line::before {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #8d9398;
  content: "";
}

.attention-line strong {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-line span {
  display: none;
}

.attention-line--urgent {
  color: #8c3c25;
  border-color: rgba(242, 100, 59, 0.18);
  background: #f8f1ee;
}

.attention-line--urgent::before {
  background: var(--accent);
}

.action-pill--urgent {
  color: #8c3c25;
  background: #f8f1ee;
}

.conversation-card__details {
  gap: 10px;
  padding-top: 2px;
}

.conversation-card dt {
  color: #7a7f84;
  font-size: 11px;
}

.conversation-card dd {
  margin-top: 3px;
  color: #2f3235;
  font-size: 13px;
  line-height: 1.28;
}

.conversation-card footer {
  display: block;
  padding-top: 2px;
  color: #777d82;
  font-size: 12px;
  line-height: 1.3;
}

.conversation-card footer span:first-child {
  display: none;
}

.conversation-card footer span:last-child {
  display: inline;
}

.avatar {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

@media (min-width: 881px) {
  .conversation-card {
    padding: 13px 14px;
  }

  .conversation-card__badges {
    max-height: 28px;
    overflow: hidden;
  }

  .conversation-card__details {
    grid-template-columns: minmax(160px, 0.85fr) minmax(220px, 1.15fr);
  }
}

@media (max-width: 880px) {
  .conversation-card {
    gap: 10px;
    padding: 14px;
  }

  .conversation-preview {
    -webkit-line-clamp: 2;
  }

  .conversation-card__badges {
    gap: 6px;
  }

  .conversation-card__details div:first-child {
    display: block;
  }

  .conversation-card footer span:first-child {
    display: none;
  }

  .conversation-card footer span:last-child {
    display: inline;
  }

  .attention-line {
    align-items: center;
    flex-direction: row;
  }
}

/* Product-grade visual system */
:root {
  --bg: #f7f6f3;
  --bg-elevated: #fbfaf7;
  --surface: #ffffff;
  --surface-muted: #f3f2ef;
  --ink: #171719;
  --ink-soft: #303236;
  --muted: #6d7278;
  --muted-soft: #8a8f95;
  --line: #e6e3de;
  --line-strong: #d8d5cf;
  --brand: #171719;
  --brand-strong: #08080a;
  --brand-soft: #efeeeb;
  --accent: #f2643b;
  --accent-strong: #dc4f2a;
  --accent-soft: #fff1eb;
  --accent-ring: rgba(242, 100, 59, 0.22);
  --blue: #2764d8;
  --blue-soft: #edf3ff;
  --gold: #946319;
  --gold-soft: #fff4db;
  --red: #b73827;
  --red-soft: #fff0ed;
  --green: #25704b;
  --green-soft: #eaf7ef;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-soft: 0 10px 28px rgba(17, 17, 19, 0.07);
  --shadow-card: 0 16px 40px rgba(17, 17, 19, 0.08);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 8%, rgba(242, 100, 59, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfaf7 0%, #f6f5f2 40%, #f7f6f3 100%);
}

.app-shell {
  grid-template-columns: 276px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  padding: 22px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 78% 6%, rgba(242, 100, 59, 0.2), transparent 30%),
    linear-gradient(180deg, #101012 0%, #202124 100%);
}

.brand {
  min-width: 0;
  padding: 6px 4px 18px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(242, 100, 59, 0.42);
  border-radius: 14px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(242, 100, 59, 0.96), rgba(242, 100, 59, 0.55)),
    #151517;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.nav-menu {
  gap: 6px;
}

.nav-menu a {
  min-height: 44px;
  gap: 10px;
  padding: 0 12px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.nav-menu a.is-active {
  background:
    linear-gradient(90deg, rgba(242, 100, 59, 0.24), rgba(255, 255, 255, 0.08));
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.user-test-panel {
  gap: 14px;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.user-switcher span,
.current-user-meta small {
  color: rgba(255, 255, 255, 0.56);
}

.user-switcher select {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
}

.current-user-meta {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.main-content {
  padding: 34px;
}

.main-content > * {
  width: min(100%, 1540px);
}

.page-header {
  position: relative;
  align-items: center;
  margin-bottom: 22px;
  padding: 2px 0;
}

.page-header h1 {
  color: var(--ink);
  font-size: 34px;
  font-weight: 830;
  letter-spacing: 0;
}

.page-header p {
  max-width: 680px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.04em;
}

.button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button--primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 26px rgba(242, 100, 59, 0.22);
}

.button--secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.button--ghost {
  color: rgba(255, 255, 255, 0.84);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.button--attention {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #c94422);
  box-shadow: 0 14px 30px rgba(242, 100, 59, 0.24);
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  padding: 16px 16px 15px 62px;
  border: 1px solid rgba(230, 227, 222, 0.92);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.kpi-card::before {
  position: absolute;
  top: 17px;
  left: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 16px;
  font-weight: 900;
  content: "";
}

.kpi-card--total::before,
.kpi-card--open::before {
  content: "●";
}

.kpi-card--waiting::before,
.kpi-card--unassigned::before {
  content: "!";
}

.kpi-card--assigned::before {
  content: "✓";
}

.kpi-card--nina::before {
  content: "N";
}

.kpi-card--priority::before {
  content: "↑";
}

.kpi-card span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.kpi-card strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.quick-filters {
  gap: 8px;
  margin-bottom: 18px;
}

.filter-chip {
  min-height: 36px;
  gap: 8px;
  border: 1px solid rgba(230, 227, 222, 0.94);
  padding: 0 12px;
  color: #555a60;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 3px rgba(17, 17, 19, 0.035);
}

.filter-chip::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c8c5be;
  content: "";
}

.filter-chip:hover {
  color: var(--ink);
  border-color: var(--accent-ring);
  background: #ffffff;
}

.filter-chip.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(242, 100, 59, 0.2);
}

.filter-chip.is-active::before {
  background: #ffffff;
}

.filter-chip strong {
  min-width: 24px;
  height: 24px;
  color: var(--ink);
  background: var(--brand-soft);
}

.filter-chip.is-active strong {
  color: var(--accent-strong);
  background: #ffffff;
}

.inbox-grid {
  grid-template-columns: minmax(0, 1fr) minmax(268px, 320px);
  gap: 18px;
}

.conversation-list {
  gap: 12px;
}

.conversation-card {
  position: relative;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(230, 227, 222, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9)),
    var(--surface);
  box-shadow: 0 10px 28px rgba(17, 17, 19, 0.06);
}

.conversation-card:hover {
  border-color: rgba(242, 100, 59, 0.22);
  box-shadow: var(--shadow-card);
}

.conversation-card--needs-human {
  box-shadow:
    inset 3px 0 0 rgba(242, 100, 59, 0.42),
    0 10px 28px rgba(17, 17, 19, 0.06);
}

.conversation-card__top {
  gap: 12px;
  align-items: flex-start;
}

.conversation-card__identity {
  min-width: 0;
}

.conversation-card h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 840;
}

.conversation-card__identity p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.conversation-card__identity p span + span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.conversation-card__identity p span + span::before {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #b8b4ad;
  content: "";
}

.conversation-card__time {
  min-width: auto;
  margin-left: auto;
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: var(--surface-muted);
  text-align: right;
}

.conversation-card__time strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(242, 100, 59, 0.15);
  color: var(--accent-strong);
  background:
    linear-gradient(135deg, #fff7f3, var(--accent-soft));
  font-size: 13px;
}

.conversation-preview {
  margin: 2px 0 0;
  color: #36393d;
  font-size: 14px;
  line-height: 1.42;
  -webkit-line-clamp: 2;
}

.conversation-card__badges {
  gap: 6px;
  overflow: hidden;
}

.badge,
.action-pill {
  min-height: 26px;
  gap: 6px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  letter-spacing: 0;
}

.badge::before,
.action-pill::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  content: "";
  opacity: 0.8;
}

.badge--responsible {
  color: #3f4246;
  background: #f0efec;
}

.badge--unassigned,
.action-pill--urgent {
  color: #9a4328;
  background: #f8f1ee;
}

.conversation-card__signal {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.conversation-card__signal strong {
  display: inline-flex;
  min-height: 26px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #3e4145;
  background: var(--surface-muted);
  font-size: 11px;
}

.conversation-card__signal--urgent strong {
  color: #9a4328;
  background: #f8f1ee;
}

.conversation-card__signal span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-card__details {
  grid-template-columns: minmax(160px, 0.9fr) minmax(210px, 1.1fr);
  gap: 12px;
  padding-top: 2px;
}

.conversation-card dt {
  color: var(--muted-soft);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.conversation-card dd {
  color: var(--ink-soft);
  font-size: 13px;
}

.conversation-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
  color: var(--muted-soft);
  font-size: 11px;
}

.conversation-card footer span {
  display: inline !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conversation-card footer strong {
  color: var(--muted);
  font-size: 12px;
}

.inbox-help {
  border-radius: 22px;
}

.queue-list div {
  min-height: 42px;
  padding: 8px 0;
}

.queue-list strong {
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-muted);
}

.panel,
.lead-strip,
.supervision-card {
  border-color: rgba(230, 227, 222, 0.94);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.panel__header h2 {
  font-size: 18px;
  font-weight: 820;
}

.conversation-layout {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 20px;
}

.conversation-header {
  padding-bottom: 2px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 14px;
}

.lead-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 14px;
  box-shadow: none;
}

.lead-strip > div {
  min-width: 0;
  border-radius: 16px;
  padding: 11px 12px;
  background: var(--surface-muted);
}

.lead-strip strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.messages-panel {
  display: grid;
  min-height: min(680px, calc(100dvh - 220px));
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 249, 246, 0.92)),
    var(--surface);
}

.message-thread {
  align-content: end;
  gap: 10px;
  border-radius: 18px;
  padding: 6px 2px;
}

.message {
  max-width: min(700px, 74%);
  border: 1px solid rgba(230, 227, 222, 0.75);
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(17, 17, 19, 0.055);
}

.message__meta {
  gap: 5px 8px;
  color: var(--muted-soft);
}

.message__meta strong {
  color: var(--ink-soft);
}

.message p {
  color: var(--ink-soft);
  line-height: 1.48;
}

.message--cliente {
  border-top-left-radius: 7px;
  background: #ffffff;
}

.message--nina {
  border-color: rgba(39, 100, 216, 0.12);
  border-top-left-radius: 7px;
  background: #edf3ff;
}

.message--corretor {
  border-color: rgba(242, 100, 59, 0.16);
  border-top-right-radius: 7px;
  background: #fff1eb;
}

.message--sistema {
  max-width: min(620px, 92%);
  border-color: rgba(148, 99, 25, 0.22);
  border-radius: 16px;
  background: #fff8ea;
  box-shadow: none;
}

.sender-legend {
  gap: 8px;
}

.legend-dot {
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--surface-muted);
}

.reply-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(17, 17, 19, 0.055);
}

.reply-form label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.reply-form textarea {
  min-height: 48px;
  max-height: 150px;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fbfaf8;
}

.reply-form .button {
  min-height: 48px;
  align-self: stretch;
  justify-self: stretch;
}

.action-panel,
.transfer-panel,
.lead-summary,
.internal-notes {
  padding: 16px;
}

.nina-state {
  border-radius: 16px;
  padding: 13px;
}

.nina-state--active {
  border-color: rgba(39, 100, 216, 0.14);
  background: #edf3ff;
}

.nina-state--paused {
  border-color: rgba(242, 100, 59, 0.2);
  background: var(--accent-soft);
}

.select,
.note-form textarea {
  border-color: var(--line);
  border-radius: 14px;
}

.summary-list {
  gap: 10px;
}

.summary-list > div,
.control-details > div {
  border-radius: 14px;
  padding: 10px 11px;
  background: var(--surface-muted);
}

.summary-note {
  border-radius: 16px;
}

.internal-notes {
  border-color: rgba(242, 100, 59, 0.16);
}

.internal-notes .panel-description {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #8c3c25;
  background: #f8f1ee;
  font-weight: 750;
}

.note-form {
  border-top: 0;
  padding-top: 0;
}

.note-card {
  border-radius: 16px;
  background: #fff7ed;
}

.table-panel {
  padding: 16px;
}

.supervision-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.supervision-table thead th {
  border-bottom: 0;
  padding: 8px 12px;
  color: var(--muted-soft);
}

.supervision-table tbody tr {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(17, 17, 19, 0.045);
}

.supervision-table td {
  border-bottom: 0;
  padding: 13px 12px;
}

.supervision-table tbody td:first-child {
  border-radius: 16px 0 0 16px;
}

.supervision-table tbody td:last-child {
  border-radius: 0 16px 16px 0;
}

.table-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.supervision-card {
  border-radius: 20px;
  padding: 15px;
}

.supervision-card__header strong {
  color: var(--ink);
}

.supervision-card__meta > div {
  border-radius: 14px;
  padding: 10px;
  background: var(--surface-muted);
}

@media (min-width: 1540px) {
  .conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .conversation-layout,
  .inbox-grid {
    grid-template-columns: 1fr;
  }

  .conversation-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversation-side .internal-notes {
    grid-column: 1 / -1;
  }
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
  }

  .sidebar {
    height: auto;
    max-height: none;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand logout"
      "main main";
    gap: 8px 10px;
    padding: 10px 10px 9px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 22px 22px;
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 11px;
  }

  .brand strong {
    font-size: 14px;
  }

  .sidebar-main {
    gap: 8px;
  }

  .nav-menu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .nav-menu a {
    min-height: 38px;
    flex: 1 0 132px;
    justify-content: center;
    border-radius: 999px;
  }

  .user-test-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .user-switcher select {
    min-height: 38px;
    border-radius: 999px;
  }

  .current-user-meta {
    display: none;
  }

  .main-content {
    height: 100%;
    min-width: 0;
    padding: 18px 12px 22px;
  }

  .page-header {
    align-items: stretch;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 26px;
  }

  .page-header p {
    font-size: 14px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-card {
    min-height: 92px;
    padding: 13px 12px 13px 52px;
  }

  .kpi-card::before {
    top: 14px;
    left: 12px;
    width: 30px;
    height: 30px;
  }

  .quick-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -12px;
    margin-left: -12px;
    padding: 0 12px 5px;
    scrollbar-width: none;
  }

  .quick-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .conversation-card {
    border-radius: 22px;
    padding: 15px;
  }

  .conversation-card__time {
    padding: 5px 8px;
  }

  .conversation-card__badges {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .conversation-card__badges::-webkit-scrollbar {
    display: none;
  }

  .conversation-card__signal {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .conversation-card__signal span {
    min-width: 0;
    white-space: nowrap;
  }

  .conversation-card__details,
  .lead-strip,
  .conversation-side {
    grid-template-columns: 1fr;
  }

  .conversation-card footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .messages-panel {
    min-height: auto;
    padding: 12px;
  }

  .message {
    max-width: 92%;
  }

  .message--sistema {
    max-width: 100%;
  }

  .reply-form {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    grid-template-columns: 1fr;
    margin-right: -12px;
    margin-left: -12px;
    border-radius: 18px;
  }

  .reply-form .button {
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .supervision-cards {
    display: grid;
  }
}

@media (max-width: 560px) {
  .nav-menu a {
    flex-basis: 112px;
  }

  .nav-icon {
    width: 17px;
    height: 17px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .kpi-card strong {
    font-size: 24px;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }

  .conversation-card h2 {
    font-size: 16px;
  }
}

/* Daily-use fine tuning */
@media (min-width: 881px) {
  .conversation-list {
    gap: 10px;
  }

  .conversation-card {
    gap: 8px;
    padding: 13px 14px;
  }

  .conversation-card__top {
    gap: 10px;
  }

  .conversation-card__identity p {
    margin-top: 2px;
    font-size: 12px;
  }

  .conversation-preview {
    margin-top: 0;
    line-height: 1.34;
    -webkit-line-clamp: 1;
  }

  .conversation-card__badges {
    gap: 5px;
  }

  .conversation-card__signal {
    padding-top: 0;
  }

  .conversation-card__details {
    gap: 10px;
  }

  .conversation-card dd {
    margin-top: 2px;
  }

  .conversation-card footer {
    padding-top: 0;
  }
}

@media (max-width: 880px) {
  .page-header .button {
    width: auto;
    min-height: 38px;
    align-self: flex-start;
    padding: 0 13px;
    font-size: 13px;
  }
}

/* Official UNE Rio Grande logo */
:root {
  --accent: #ff7043;
  --accent-strong: #e65d34;
  --accent-soft: #fff1eb;
  --accent-ring: rgba(255, 112, 67, 0.24);
}

.brand {
  align-items: center;
  gap: 13px;
}

.brand-logo {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 112, 67, 0.28);
  border-radius: 16px;
  padding: 0;
  background: #ff7043;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand .brand-logo,
.login-brand .brand-logo {
  display: grid;
}

.login-brand .brand-logo {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  border-color: rgba(255, 112, 67, 0.32);
  background: #ff7043;
  box-shadow: 0 12px 28px rgba(17, 17, 19, 0.12);
}

.brand strong {
  font-size: 16px;
}

.brand span:not(.brand-mark) {
  font-size: 12px;
}

.login-brand strong {
  color: var(--ink);
  font-size: 17px;
}

.login-brand span:not(.brand-mark) {
  color: var(--muted);
}

@media (max-width: 880px) {
  .brand {
    gap: 9px;
  }

  .brand-logo {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  }

  .brand .brand-logo {
    display: grid;
  }

  .login-brand .brand-logo {
    width: 52px;
    height: 52px;
  }
}

/* Mock operations modules */
.lead-profile,
.timeline-panel,
.distribution-panel {
  display: grid;
  gap: 14px;
}

.lead-profile__section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.lead-profile__section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.lead-profile h3,
.distribution-history h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.profile-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-list > div,
.timeline-event,
.queue-card,
.distribution-history article {
  border: 1px solid rgba(230, 227, 222, 0.8);
  border-radius: 14px;
  padding: 10px;
  background: rgba(247, 246, 243, 0.72);
}

.profile-list dt {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-list dd {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.distribution-reason {
  margin: 0;
  border: 1px solid rgba(255, 112, 67, 0.18);
  border-radius: 14px;
  padding: 10px;
  color: #874027;
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.4;
}

.distribution-reason strong {
  display: block;
  margin-bottom: 4px;
  color: #5f2818;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.distribution-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tag-checkbox span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 750;
}

.tag-checkbox input:checked + span {
  color: #ffffff;
  border-color: transparent;
  background: var(--accent);
}

.tag-checkbox input:disabled + span {
  opacity: 0.62;
}

.tags-form,
.next-action-form {
  display: grid;
  gap: 10px;
}

.next-action-kind {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 850;
}

.next-action-kind--administrativa {
  border-color: rgba(51, 118, 211, 0.16);
  color: #2459a8;
  background: #edf4ff;
}

.next-action-kind--comercial {
  border-color: rgba(42, 157, 143, 0.18);
  color: #24635c;
  background: rgba(42, 157, 143, 0.1);
}

.next-action-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.follow-up-status {
  margin: 0;
  border: 1px solid rgba(42, 157, 143, 0.22);
  border-radius: 12px;
  padding: 8px 10px;
  color: #24635c;
  background: rgba(42, 157, 143, 0.08);
  font-size: 12px;
  font-weight: 750;
}

.follow-up-pending-section,
.follow-up-pending-list,
.follow-up-pending-card,
.follow-up-create-block {
  display: grid;
  gap: 12px;
}

.follow-up-pending-section h3,
.follow-up-create-block h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.follow-up-pending-card {
  border: 1px solid rgba(42, 157, 143, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(42, 157, 143, 0.08);
}

.follow-up-pending-card__header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.follow-up-pending-card__header h3 {
  margin: 2px 0 0;
  color: #1f2f2c;
  font-size: 15px;
  line-height: 1.3;
}

.follow-up-pending-card__status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(42, 157, 143, 0.28);
  border-radius: 999px;
  padding: 0 9px;
  color: #24635c;
  background: #fff;
  font-size: 11px;
  font-weight: 850;
}

.follow-up-pending-card__details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.follow-up-pending-card__details div {
  display: grid;
  gap: 2px;
}

.follow-up-pending-card__details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.follow-up-pending-card__details dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.follow-up-pending-card__actions {
  display: flex;
  justify-content: flex-end;
}

.follow-up-pending-card__button {
  min-height: 36px;
  border: 1px solid rgba(42, 157, 143, 0.34);
  padding: 0 12px;
  background: #ffffff;
  box-shadow: none;
  font-size: 13px;
  line-height: 1;
}

.follow-up-history {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(230, 227, 222, 0.82);
  padding-top: 10px;
}

.follow-up-history h3,
.follow-up-history p {
  margin: 0;
}

.follow-up-history > div > p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.follow-up-history__item {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(230, 227, 222, 0.9);
  border-radius: 14px;
  padding: 10px;
  background: #ffffff;
}

.follow-up-history__item--realizada {
  border-color: rgba(42, 157, 143, 0.22);
  background: rgba(42, 157, 143, 0.06);
}

.follow-up-history__item--substituida {
  opacity: 0.78;
}

.follow-up-history__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.follow-up-history__top strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.follow-up-history__top span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: #24635c;
  background: rgba(42, 157, 143, 0.1);
  font-size: 10px;
  font-weight: 850;
}

.follow-up-history__item--substituida .follow-up-history__top span {
  color: #755219;
  background: #fff8ea;
}

.follow-up-history__item p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.38;
}

.follow-up-history__item dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.follow-up-history__item dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 7px;
}

.follow-up-history__item dt,
.follow-up-history__item dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
}

.follow-up-history__item dt {
  color: var(--muted);
  font-weight: 850;
}

.follow-up-history__item dd {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.team-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(230, 227, 222, 0.86);
  border-radius: 18px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(17, 17, 19, 0.06);
}

.team-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.team-card__header h2,
.team-card__header p {
  margin: 0;
}

.team-card__header h2 {
  color: var(--ink);
  font-size: 18px;
}

.team-card__header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.team-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
}

.team-status--disponivel {
  color: #24635c;
  background: rgba(42, 157, 143, 0.12);
}

.team-status--ocupado {
  color: #755219;
  background: #fff8ea;
}

.team-status--sem_atendimento {
  color: var(--muted);
  background: var(--surface-muted);
}

.team-status--atrasado {
  color: #9a2d1d;
  background: var(--red-soft);
}

.team-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.team-metrics div {
  border: 1px solid rgba(230, 227, 222, 0.82);
  border-radius: 12px;
  padding: 9px;
  background: rgba(247, 246, 243, 0.62);
}

.team-metrics dt,
.team-metrics dd {
  margin: 0;
}

.team-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.team-metrics dd {
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.team-last-touch {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(230, 227, 222, 0.82);
  padding-top: 10px;
}

.team-last-touch span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.team-last-touch strong {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.team-management-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.team-management-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.team-management-phase-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  padding: 9px 10px;
  color: #3d4653;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.35;
}

.team-management-phase-note strong {
  color: #1f2937;
  white-space: nowrap;
}

.team-management-list {
  display: grid;
  gap: 7px;
}

.team-management-card {
  display: grid;
  gap: 8px;
  scroll-margin-top: 18px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.team-management-card--inactive {
  background: #fbfaf8;
}

.team-management-card--expanded {
  border-color: rgba(242, 100, 59, 0.36);
  box-shadow: 0 10px 22px rgba(31, 37, 45, 0.08);
}

.team-management-card--focused {
  animation: teamManagementFocus 900ms ease;
}

@keyframes teamManagementFocus {
  0% {
    background: #fff7ed;
    border-color: rgba(242, 100, 59, 0.62);
  }
  100% {
    background: #ffffff;
  }
}

.team-management-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(420px, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.team-management-person {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-member-name-button {
  width: fit-content;
  max-width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 880;
  letter-spacing: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: left;
}

.team-member-name-button:hover,
.team-member-name-button:focus-visible {
  color: var(--accent-strong);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.team-management-person span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.team-management-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.team-management-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.team-member-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 850;
}

.team-summary-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--ink-soft);
  background: rgba(247, 246, 243, 0.74);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.team-summary-pill small {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.team-summary-pill strong {
  font-weight: 850;
}

.team-member-status--active {
  color: #17663d;
  background: #e4f5eb;
}

.team-member-status--inactive {
  color: #8f231b;
  background: #ffe8e4;
}

.team-management-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border-top: 1px solid var(--ux-border-soft);
  padding-top: 8px;
}

.team-management-details div {
  min-width: 0;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(247, 246, 243, 0.68);
}

.team-management-details dt {
  margin: 0 0 4px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-management-details dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.team-member-edit-form,
.team-member-status-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--ux-border-soft);
  padding-top: 10px;
}

.team-member-reassignment-form {
  background: #fff9f5;
  border-radius: 8px;
  padding: 10px;
}

.team-member-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.team-member-form-grid label,
.team-member-status-form label,
.team-member-toggle {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.team-member-form-grid label span,
.team-member-status-form label span,
.team-member-toggle span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-member-form-wide {
  grid-column: 1 / -1;
}

.team-member-edit-form textarea.input,
.team-member-status-form textarea.input {
  min-height: 74px;
  resize: vertical;
}

.team-member-toggle {
  align-content: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 9px;
  background: rgba(247, 246, 243, 0.68);
}

.team-member-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.button.team-action-button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
}

.button.team-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.team-action-button--neutral,
.button.team-action-button--edit,
.button.team-action-button--cancel {
  border-color: #cad3df;
  color: #233040;
  background: #f6f8fb;
}

.button.team-action-button--edit,
.button.team-action-button--save {
  border-color: #9bb8f1;
  color: #183f91;
  background: #edf4ff;
}

.button.team-action-button--save {
  color: #ffffff;
  background: #2459c9;
}

.button.team-action-button--inactive {
  border-color: #efb39b;
  color: #8f2d15;
  background: #fff1ea;
}

.button.team-action-button--reactivate {
  border-color: #9dd6b0;
  color: #17663d;
  background: #eaf8ef;
}

.button.team-action-button--locked,
.button.team-action-button--locked:disabled {
  border-color: #d7dde7;
  color: #6b7280;
  background: #eef2f6;
  opacity: 1;
}

@media (max-width: 980px) {
  .team-management-row {
    grid-template-columns: minmax(180px, 1fr);
  }

  .team-management-actions {
    justify-content: flex-start;
  }

  .team-management-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .team-management-details,
  .team-member-form-grid {
    grid-template-columns: 1fr;
  }

  .team-management-summary,
  .team-management-actions,
  .team-management-header-actions,
  .team-member-form-actions {
    display: grid;
  }

  .team-management-phase-note {
    display: grid;
  }

  .team-management-phase-note strong {
    white-space: normal;
  }
}

.next-action-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.next-action-form textarea,
.next-action-form .input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 11px;
  color: var(--ink);
  background: #ffffff;
}

.message--nota_interna {
  justify-self: end;
  max-width: min(620px, 72%);
  border: 1px solid rgba(198, 145, 19, 0.34);
  border-radius: 17px;
  border-top-right-radius: 6px;
  color: #5f4710;
  background: #fff3bf;
  box-shadow: 0 4px 12px rgba(97, 70, 8, 0.08);
}

.message--nota_interna small {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: #6d4e04;
  background: rgba(255, 214, 102, 0.68);
  font-size: 11px;
  font-weight: 850;
}

.message--nota_interna p {
  color: #3f3109;
}

.message--nina {
  border-color: rgba(82, 91, 210, 0.26);
  background: #eef0ff;
  box-shadow: 0 4px 12px rgba(82, 91, 210, 0.08);
}

.message--nina .message__meta strong {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  color: #343c9a;
  background: rgba(82, 91, 210, 0.12);
  font-weight: 900;
}

.message--nina p {
  color: #28306f;
}

.note-form--inline {
  margin-top: 12px;
  border: 1px solid rgba(255, 112, 67, 0.18);
  border-radius: 18px;
  padding: 12px;
  background: #fffaf7;
}

.note-form--inline label span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.timeline-list {
  display: grid;
  gap: 9px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 2px;
}

.timeline-event {
  display: grid;
  gap: 6px;
  position: relative;
}

.timeline-event::before {
  position: absolute;
  top: 13px;
  left: -5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.timeline-event__heading {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.timeline-event .timeline-event__category {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid rgba(42, 157, 143, 0.18);
  border-radius: 999px;
  margin-top: 0;
  padding: 2px 7px;
  color: #24635c;
  background: #e7f6f3;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.timeline-event .timeline-event__meta {
  margin-top: 0;
}

.timeline-event strong,
.queue-card strong,
.distribution-history strong {
  color: var(--ink);
  font-size: 13px;
}

.timeline-event span,
.distribution-history span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-event p,
.distribution-history p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.timeline-event small {
  color: var(--muted);
  font-size: 12px;
}

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.queue-card {
  display: grid;
  gap: 10px;
}

.queue-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.queue-card span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 750;
}

.distribution-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.distribution-config-note,
.distribution-config-form {
  margin-top: 14px;
  border: 1px solid rgba(230, 227, 222, 0.9);
  border-radius: 18px;
  padding: 14px;
  background: #ffffff;
}

.distribution-config-note {
  display: grid;
  gap: 4px;
}

.distribution-config-note strong {
  color: var(--ink);
  font-size: 13px;
}

.distribution-config-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.distribution-config-form {
  display: grid;
  gap: 12px;
}

.distribution-config-form h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.lead-import-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.lead-import-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 1.1fr);
  gap: 12px;
  align-items: stretch;
}

.lead-import-upload,
.lead-import-safety,
.lead-import-extra-columns,
.lead-import-confirmation,
.lead-import-draft-form,
.lead-import-staging-save,
.lead-import-batches,
.lead-import-batch-detail {
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(247, 246, 243, 0.68);
}

.lead-import-upload {
  display: grid;
  gap: 8px;
}

.lead-import-upload p,
.lead-import-upload small,
.lead-import-safety span,
.lead-import-confirmation span,
.lead-import-table-note,
.lead-import-batches-table td span,
.lead-import-batch-metadata dd {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.lead-import-file-box {
  display: grid;
  gap: 7px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-file-box input {
  width: 100%;
  border: 1px dashed rgba(36, 89, 201, 0.28);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #ffffff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 650;
}

.lead-import-safety {
  display: grid;
  gap: 7px;
  align-content: start;
}

.lead-import-safety strong,
.lead-import-extra-columns strong {
  color: var(--ink);
  font-size: 13px;
}

.lead-import-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.lead-import-summary-card {
  display: grid;
  gap: 4px;
  min-height: 74px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.lead-import-summary-card span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.25;
  text-transform: uppercase;
}

.lead-import-summary-card strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.lead-import-summary-card--success {
  border-color: rgba(35, 120, 78, 0.2);
  background: #edf8f1;
}

.lead-import-summary-card--risk {
  border-color: rgba(180, 35, 24, 0.18);
  background: #fff0ed;
}

.lead-import-summary-card--warning {
  border-color: rgba(148, 99, 25, 0.2);
  background: #fff8ea;
}

.lead-import-summary-card--neutral {
  background: #f3f4f6;
}

.lead-import-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.lead-import-section-heading h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.lead-import-section-heading > span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.lead-import-mapping {
  display: grid;
  gap: 10px;
}

.lead-import-draft-form,
.lead-import-staging-save,
.lead-import-batches,
.lead-import-batch-detail {
  display: grid;
  gap: 12px;
}

.lead-import-batch-detail {
  scroll-margin-top: 16px;
}

.lead-import-batch-detail:focus {
  outline: 2px solid rgba(36, 89, 201, 0.36);
  outline-offset: 2px;
}

.lead-import-batch-detail--highlight {
  animation: lead-import-detail-highlight 1.6s ease-out;
}

@keyframes lead-import-detail-highlight {
  0% {
    border-color: rgba(36, 89, 201, 0.54);
    box-shadow: 0 0 0 4px rgba(36, 89, 201, 0.18);
  }

  100% {
    border-color: var(--ux-border-soft);
    box-shadow: none;
  }
}

.lead-import-draft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lead-import-draft-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lead-import-draft-grid label span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-draft-notes {
  grid-column: 1 / -1;
}

.lead-import-draft-grid textarea.input {
  min-height: 76px;
  resize: vertical;
}

.lead-import-mapping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lead-import-mapping-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lead-import-mapping-grid label span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-mapping-grid .select {
  height: 38px;
  min-height: 38px;
  margin-bottom: 0;
  border-radius: 8px;
}

.lead-import-extra-columns {
  display: grid;
  gap: 8px;
}

.lead-import-extra-columns div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-import-extra-columns span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #4b5563;
  background: #edf0f2;
  font-size: 11px;
  font-weight: 800;
}

.lead-import-table-wrap {
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  background: #ffffff;
}

.lead-import-batches-wrap {
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  background: #ffffff;
}

.lead-import-table,
.lead-import-batches-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
}

.lead-import-table th,
.lead-import-table td,
.lead-import-batches-table th,
.lead-import-batches-table td {
  border-bottom: 1px solid var(--ux-border-soft);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.lead-import-table th,
.lead-import-batches-table th {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-table td,
.lead-import-batches-table td {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.lead-import-table td strong,
.lead-import-table td span,
.lead-import-batches-table td strong,
.lead-import-batches-table td span {
  display: block;
  overflow-wrap: anywhere;
}

.lead-import-table td strong,
.lead-import-batches-table td strong {
  color: var(--ink);
  font-size: 13px;
}

.lead-import-table td span + span,
.lead-import-batches-table td span + span {
  margin-top: 3px;
}

.lead-import-batches-table th.lead-import-batches-actions,
.lead-import-batches-table td.lead-import-batches-actions {
  position: sticky;
  left: 0;
  width: 112px;
  min-width: 112px;
  background: #ffffff;
  z-index: 2;
}

.lead-import-batches-table th.lead-import-batches-actions {
  z-index: 3;
}

.lead-import-batch-row--selected {
  background: rgba(36, 89, 201, 0.06);
}

.lead-import-batch-row--selected td.lead-import-batches-actions {
  background: #eef4ff;
}

.button--compact {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.lead-import-batch-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.lead-import-batch-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.lead-import-batch-metadata div {
  min-width: 0;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.lead-import-batch-metadata dt {
  margin: 0 0 4px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-batch-metadata dd {
  overflow-wrap: anywhere;
}

.lead-import-row-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-import-detail-actions,
.manual-lead-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  text-align: right;
}

.lead-import-detail-actions > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.detail-close-button {
  border: 1px solid var(--ux-border);
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  opacity: 1;
}

.detail-close-button:hover,
.detail-close-button:focus-visible {
  border-color: var(--accent);
  color: var(--ink);
  background: #eef4ff;
}

.manual-lead-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.manual-lead-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
  gap: 12px;
  align-items: start;
}

.manual-lead-form,
.manual-lead-list,
.manual-lead-detail,
.manual-lead-decision-form,
.manual-lead-matches {
  display: grid;
  gap: 12px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(247, 246, 243, 0.68);
}

.manual-lead-form h3,
.manual-lead-list h3,
.manual-lead-detail h3,
.manual-lead-matches h4 {
  margin: 0;
  letter-spacing: 0;
}

.manual-lead-form p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.manual-lead-form-grid,
.manual-lead-detail-grid,
.manual-lead-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.manual-lead-form-grid label,
.manual-lead-decision-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.manual-lead-form-grid label span,
.manual-lead-decision-grid label span,
.manual-lead-long-text span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.manual-lead-form-wide,
.manual-lead-decision-grid label:last-child {
  grid-column: 1 / -1;
}

.manual-lead-form textarea.input,
.manual-lead-decision-form textarea.input {
  min-height: 74px;
  resize: vertical;
}

.manual-lead-form .select,
.manual-lead-decision-form .select {
  margin-bottom: 0;
}

.manual-lead-list__header,
.manual-lead-request-card__header,
.manual-lead-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.manual-lead-list__header > span,
.manual-lead-section-heading > span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.manual-lead-request-cards,
.manual-lead-match-grid {
  display: grid;
  gap: 10px;
}

.manual-lead-request-card,
.manual-lead-match-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.manual-lead-request-card--selected {
  border-color: rgba(36, 89, 201, 0.34);
  background: #eef4ff;
}

.manual-lead-request-card__header h4 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.manual-lead-card-meta,
.manual-lead-detail-grid {
  margin: 0;
}

.manual-lead-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.manual-lead-card-meta div,
.manual-lead-detail-grid div {
  min-width: 0;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.manual-lead-card-meta dt,
.manual-lead-detail-grid dt {
  margin: 0 0 4px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.manual-lead-card-meta dd,
.manual-lead-detail-grid dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manual-lead-status,
.manual-lead-match-type {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #374151;
  background: #edf0f2;
  font-size: 11px;
  font-weight: 850;
}

.manual-lead-status--pending_validation,
.manual-lead-status--review_required {
  color: #7a5413;
  background: #fff4d8;
}

.manual-lead-status--approved,
.manual-lead-status--linked_to_existing {
  color: #17663d;
  background: #e4f5eb;
}

.manual-lead-status--rejected,
.manual-lead-status--cancelled {
  color: #8f231b;
  background: #ffe8e4;
}

.manual-lead-status--transferred_existing,
.manual-lead-status--kept_existing {
  color: #2459c9;
  background: #eaf0ff;
}

.manual-lead-long-text {
  display: grid;
  gap: 5px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.manual-lead-long-text p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .manual-lead-layout,
  .manual-lead-form-grid,
  .manual-lead-detail-grid,
  .manual-lead-decision-grid,
  .manual-lead-card-meta {
    grid-template-columns: 1fr;
  }

  .manual-lead-list__header,
  .manual-lead-request-card__header,
  .manual-lead-section-heading,
  .lead-import-detail-actions,
  .manual-lead-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.lead-import-row-filter {
  min-height: 36px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  font-weight: 850;
  opacity: 1;
}

.lead-import-row-filter.lead-import-row-filter--idle {
  color: var(--ink-soft);
  border-color: var(--ux-border);
  background: #ffffff;
}

.lead-import-row-filter.lead-import-row-filter--idle:hover:not(:disabled) {
  color: var(--ink);
  border-color: rgba(242, 100, 59, 0.42);
  background: var(--accent-soft);
}

.lead-import-row-filter.lead-import-row-filter--active {
  color: var(--accent-strong);
  border-color: rgba(242, 100, 59, 0.58);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(242, 100, 59, 0.18);
}

.lead-import-row-filter:disabled {
  color: var(--muted);
  background: #f7f8f6;
}

.lead-import-status,
.lead-import-action {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.lead-import-status--success {
  color: #1f6845;
  background: #edf8f1;
}

.lead-import-status--risk {
  color: #8f2f24;
  background: #fff0ed;
}

.lead-import-status--warning {
  color: #755219;
  background: #fff8ea;
}

.lead-import-status--neutral,
.lead-import-action {
  color: #4b5563;
  background: #edf0f2;
}

.lead-import-review-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.lead-import-review-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--ux-border-soft);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.lead-import-review-card__header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lead-import-review-card__header div {
  min-width: 0;
}

.lead-import-review-card__header span:first-child {
  display: block;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-review-card__header h4 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.lead-import-review-card__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(250px, 0.9fr);
  gap: 10px;
  min-width: 0;
}

.lead-import-review-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  align-content: start;
}

.lead-import-review-field--decision {
  grid-row: span 2;
}

.lead-import-review-field__label {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-review-field__value {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lead-import-review-field__value strong {
  color: var(--ink);
  font-size: 13px;
}

.lead-import-review-field__value > span {
  display: block;
}

.lead-import-review-field__value .lead-import-action {
  justify-self: start;
}

.lead-import-action-form {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.lead-import-action-form label {
  display: grid;
  gap: 4px;
}

.lead-import-action-form label > span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lead-import-action-form .select,
.lead-import-action-form .input {
  width: 100%;
  min-height: 32px;
  font-size: 12px;
}

.lead-import-action-feedback {
  display: block;
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1.35;
}

.lead-import-action-feedback--success {
  color: #1f6845;
}

.lead-import-action-feedback--warning {
  color: #755219;
}

.lead-import-action-feedback--risk {
  color: #8f2f24;
}

.lead-import-row--has-feedback {
  border-color: rgba(31, 104, 69, 0.24);
  background: #f7fbf8;
}

.lead-import-row--highlight {
  outline: 2px solid #8fc8a7;
  outline-offset: -2px;
}

.lead-import-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 1180px) {
  .lead-import-layout,
  .lead-import-summary,
  .lead-import-batch-summary,
  .lead-import-batch-metadata,
  .lead-import-draft-grid,
  .lead-import-mapping-grid {
    grid-template-columns: 1fr;
  }

  .lead-import-section-heading,
  .lead-import-confirmation {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-import-section-heading > span {
    text-align: left;
  }

  .lead-import-review-card__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .lead-import-review-field--decision {
    grid-row: auto;
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .lead-import-review-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-import-review-card__grid {
    grid-template-columns: 1fr;
  }

  .lead-import-review-field--decision {
    grid-column: auto;
  }
}

.duty-schedule-form__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  align-items: end;
}

.duty-schedule-form__top label,
.duty-slot {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.duty-schedule-form__top label span,
.duty-slot span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.duty-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duty-day-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(230, 227, 222, 0.9);
  border-radius: 14px;
  padding: 12px;
  background: rgba(247, 246, 243, 0.72);
}

.duty-day-card__header h4 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.duty-day-card__slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.queue-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.queue-slots legend {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.queue-slots label {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.queue-slots label span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 880px) {
  .distribution-grid {
    grid-template-columns: 1fr;
  }

  .queue-slots {
    grid-template-columns: 1fr;
  }

  .duty-schedule-form__top,
  .duty-schedule-grid,
  .duty-day-card__slots {
    grid-template-columns: 1fr;
  }

  .next-action-actions {
    grid-template-columns: 1fr;
  }

  .timeline-list {
    max-height: none;
  }

  .message--nota_interna {
    max-width: 100%;
  }
}

/* Conversation side tabs */
.conversation-side {
  align-content: start;
}

.conversation-control-panel {
  gap: 11px;
  padding: 14px;
}

.conversation-control-panel .panel__header {
  margin-bottom: 2px;
}

.conversation-control-panel .panel__header h2 {
  font-size: 17px;
}

.conversation-control-panel .role-chip {
  margin-left: 0;
  white-space: nowrap;
}

.conversation-control-panel .nina-state {
  margin-bottom: 0;
  padding: 10px 11px;
}

.conversation-control-panel .field-label {
  margin-bottom: 3px;
}

.conversation-control-panel .select,
.transfer-inline .select {
  margin-bottom: 0;
}

.control-details--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.control-details--compact > div {
  min-width: 0;
}

.control-details--compact dd {
  overflow-wrap: anywhere;
}

.control-primary-action {
  display: grid;
  gap: 8px;
}

.transfer-form--compact {
  gap: 8px;
}

.transfer-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.transfer-inline .button {
  min-height: 42px;
  padding-inline: 13px;
}

.conversation-tabs {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.side-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.conversation-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow-x: visible;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.conversation-tab-nav::-webkit-scrollbar {
  display: none;
}

.conversation-tab-nav label {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.conversation-tab-nav label:hover {
  border-color: rgba(255, 112, 67, 0.3);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.conversation-tabs label[for="side-tab-resumo"] {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
}

.conversation-tabs:has(#side-tab-notas:checked) label[for="side-tab-resumo"],
.conversation-tabs:has(#side-tab-linha:checked) label[for="side-tab-resumo"],
.conversation-tabs:has(#side-tab-lead:checked) label[for="side-tab-resumo"],
.conversation-tabs:has(#side-tab-distribuicao:checked) label[for="side-tab-resumo"],
.conversation-tabs:has(#side-tab-auditoria:checked) label[for="side-tab-resumo"] {
  border-color: var(--line);
  color: var(--muted);
  background: #ffffff;
}

.conversation-tabs:has(#side-tab-notas:checked) label[for="side-tab-notas"],
.conversation-tabs:has(#side-tab-linha:checked) label[for="side-tab-linha"],
.conversation-tabs:has(#side-tab-lead:checked) label[for="side-tab-lead"],
.conversation-tabs:has(#side-tab-distribuicao:checked) label[for="side-tab-distribuicao"],
.conversation-tabs:has(#side-tab-auditoria:checked) label[for="side-tab-auditoria"] {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
}

.conversation-tab-panels {
  min-height: 0;
  overflow: hidden;
}

.conversation-tab-panel {
  display: none;
  gap: 12px;
  min-height: 0;
  padding-right: 3px;
  overflow-y: auto;
}

.conversation-tab-panel--resumo {
  display: grid;
}

.conversation-tabs:has(#side-tab-notas:checked) .conversation-tab-panel--resumo,
.conversation-tabs:has(#side-tab-linha:checked) .conversation-tab-panel--resumo,
.conversation-tabs:has(#side-tab-lead:checked) .conversation-tab-panel--resumo,
.conversation-tabs:has(#side-tab-distribuicao:checked) .conversation-tab-panel--resumo,
.conversation-tabs:has(#side-tab-auditoria:checked) .conversation-tab-panel--resumo {
  display: none;
}

.conversation-tabs:has(#side-tab-notas:checked) .conversation-tab-panel--notas,
.conversation-tabs:has(#side-tab-linha:checked) .conversation-tab-panel--linha,
.conversation-tabs:has(#side-tab-lead:checked) .conversation-tab-panel--lead,
.conversation-tabs:has(#side-tab-distribuicao:checked) .conversation-tab-panel--distribuicao,
.conversation-tabs:has(#side-tab-auditoria:checked) .conversation-tab-panel--auditoria {
  display: grid;
}

.tab-section {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(230, 227, 222, 0.82);
  border-radius: 16px;
  padding: 12px;
  background: rgba(247, 246, 243, 0.72);
}

.tab-section h2,
.tab-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.tab-section--notice {
  border-color: rgba(255, 112, 67, 0.18);
  color: #874027;
  background: var(--accent-soft);
}

.tab-section--notice strong {
  color: #6f351f;
  font-size: 13px;
}

.tab-section--notice span {
  color: #874027;
  font-size: 12px;
  line-height: 1.4;
}

.note-form--side {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(230, 227, 222, 0.82);
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
}

.note-form--side textarea {
  min-height: 108px;
}

.note-list--tab {
  display: grid;
  gap: 9px;
}

.timeline-list--compact {
  max-height: 280px;
}

@media (min-width: 1181px) {
  .conversation-side {
    position: sticky;
    top: 24px;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
  }

  .conversation-tab-panel {
    height: 100%;
  }
}

@media (max-width: 1180px) {
  .conversation-side {
    grid-template-columns: 1fr;
  }

  .conversation-tabs {
    overflow: visible;
  }

  .conversation-tab-panels {
    overflow: visible;
  }

  .conversation-tab-panel {
    max-height: min(680px, 68dvh);
  }
}

@media (max-width: 560px) {
  .conversation-control-panel {
    padding: 12px;
  }

  .control-details--compact,
  .transfer-inline {
    grid-template-columns: 1fr;
  }

  .conversation-tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .conversation-tab-panel {
    max-height: 64dvh;
  }
}

/* Compact WhatsApp-like conversation refactor */
.conversation-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
}

.conversation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 10px;
}

.conversation-header .back-link {
  margin-bottom: 4px;
  font-size: 12px;
}

.conversation-header h1 {
  margin-top: 2px;
  font-size: clamp(22px, 2.5vw, 30px);
  line-height: 1.08;
}

.conversation-header p {
  margin-top: 5px;
  font-size: 13px;
}

.conversation-header .header-actions {
  align-content: start;
  gap: 6px;
}

.lead-strip {
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px;
  border-radius: 16px;
}

.lead-strip > div {
  border-radius: 12px;
  padding: 8px 9px;
}

.lead-strip span {
  font-size: 9px;
}

.lead-strip strong {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.25;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: min(760px, calc(100dvh - 190px));
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 0, rgba(255, 112, 67, 0.05), transparent 28%),
    linear-gradient(180deg, #fffdfb, #f7f5f1);
}

.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(230, 227, 222, 0.82);
  padding: 10px 13px;
}

.chat-panel__header h2 {
  margin: 0;
  font-size: 16px;
}

.chat-panel .sender-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-panel .legend-dot {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.chat-panel .message-thread {
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 10px;
}

.message {
  max-width: min(620px, 72%);
  border-radius: 17px;
  padding: 9px 11px;
  box-shadow: 0 4px 12px rgba(17, 17, 19, 0.045);
}

.message__meta {
  gap: 4px 7px;
  font-size: 11px;
}

.message__meta time {
  color: var(--muted-soft);
}

.message p {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.38;
}

.message--cliente {
  justify-self: start;
  border-color: rgba(230, 227, 222, 0.92);
  border-top-left-radius: 6px;
  background: #ffffff;
}

.message--nina {
  justify-self: end;
  border-color: rgba(82, 91, 210, 0.26);
  border-top-right-radius: 6px;
  background: #eef0ff;
  box-shadow: 0 4px 12px rgba(82, 91, 210, 0.08);
}

.message--nina .message__meta strong {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  color: #343c9a;
  background: rgba(82, 91, 210, 0.12);
  font-weight: 900;
}

.message--nina p {
  color: #28306f;
}

.message--sugestao_nina,
.message--nina_intervencao {
  justify-self: end;
  max-width: min(560px, 72%);
  border-color: rgba(42, 157, 143, 0.26);
  border-style: solid;
  border-radius: 17px;
  border-top-right-radius: 6px;
  padding: 9px 11px;
  background: #e7f6f3;
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.09);
}

.message--sugestao_nina .message__meta,
.message--nina_intervencao .message__meta {
  color: #27746a;
}

.message--sugestao_nina .message__meta strong,
.message--nina_intervencao .message__meta strong {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  color: #24635c;
  background: rgba(42, 157, 143, 0.14);
  font-weight: 900;
}

.message--sugestao_nina small,
.message--nina_intervencao small {
  display: inline-flex;
  min-height: 20px;
  margin-top: 5px;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  color: #24635c;
  background: rgba(42, 157, 143, 0.12);
  font-size: 10px;
  font-weight: 850;
}

.message--sugestao_nina p,
.message--nina_intervencao p {
  color: #1f554f;
}

.message--corretor {
  justify-self: end;
  border-color: rgba(255, 112, 67, 0.18);
  border-top-right-radius: 6px;
  background: #fff1eb;
}

.message--sistema {
  justify-self: center;
  max-width: min(520px, 86%);
  border: 1px dashed rgba(148, 99, 25, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff8ea;
}

.message--sistema .message__meta {
  display: none;
}

.message--sistema p {
  margin: 0;
  color: #755219;
  font-size: 12px;
}

.message--nota_interna {
  justify-self: end;
  max-width: min(560px, 72%);
  border-color: rgba(198, 145, 19, 0.34);
  border-style: solid;
  border-radius: 17px;
  border-top-right-radius: 6px;
  padding: 9px 11px;
  background: #fff3bf;
  box-shadow: 0 4px 12px rgba(97, 70, 8, 0.08);
}

.message--nota_interna .message__meta {
  color: #715616;
}

.message--nota_interna .message__meta strong {
  color: #4f3b09;
}

.message--nota_interna small {
  min-height: 20px;
  margin-top: 5px;
  padding: 0 7px;
  color: #6d4e04;
  background: rgba(255, 214, 102, 0.68);
  font-size: 10px;
}

.message--nota_interna p {
  color: #3f3109;
}

.conversation-composer {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(230, 227, 222, 0.9);
  padding: 9px 10px 10px;
  background: rgba(255, 255, 255, 0.96);
}

.composer-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.composer-toolbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.composer-toolbar::-webkit-scrollbar {
  display: none;
}

.composer-tool {
  display: inline-flex;
  min-height: 31px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.composer-tool:disabled {
  cursor: default;
  opacity: 0.5;
}

.tool-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.conversation-composer .composer-tool--message {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
}

.conversation-composer:has(#composer-mode-note:checked) .composer-tool--message {
  border-color: var(--line);
  color: var(--muted);
  background: #ffffff;
}

.conversation-composer:has(#composer-mode-nina:checked) .composer-tool--message {
  border-color: var(--line);
  color: var(--muted);
  background: #ffffff;
}

.conversation-composer:has(#composer-mode-note:checked) .composer-tool--note {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
}

.conversation-composer:has(#composer-mode-nina:checked) .composer-tool--nina {
  border-color: transparent;
  color: #ffffff;
  background: #525bd2;
}

.composer-mode-hint {
  display: none;
  border: 1px solid rgba(255, 112, 67, 0.2);
  border-radius: 12px;
  padding: 7px 9px;
  color: #874027;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 750;
}

.conversation-composer:has(#composer-mode-note:checked) .composer-mode-hint--note {
  display: block;
}

.composer-panels {
  display: grid;
}

.composer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.composer-form--note,
.composer-form--nina {
  display: none;
}

.conversation-composer:has(#composer-mode-note:checked) .composer-form--message,
.conversation-composer:has(#composer-mode-nina:checked) .composer-form--message {
  display: none;
}

.conversation-composer:has(#composer-mode-note:checked) .composer-form--note {
  display: grid;
}

.conversation-composer:has(#composer-mode-nina:checked) .composer-form--nina {
  display: grid;
}

.composer-form textarea {
  width: 100%;
  min-height: 42px;
  max-height: 112px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfaf8;
  resize: vertical;
}

.composer-form .button {
  min-height: 42px;
  padding-inline: 15px;
}

.assignment-warning--compact {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 6px 9px;
  font-size: 11px;
  line-height: 1.25;
}

.conversation-side {
  display: grid;
  gap: 10px;
}

.conversation-side-summary {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 18px;
}

.side-summary__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.side-summary__top strong {
  display: block;
  margin-top: 1px;
  color: var(--ink);
  font-size: 15px;
}

.side-summary__meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 0;
}

.side-summary__meta > div {
  border-radius: 12px;
  padding: 8px 9px;
  background: var(--surface-muted);
}

.side-summary__meta dt {
  color: var(--muted-soft);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.side-summary__meta dd {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.nina-compact {
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
}

.nina-compact--active {
  color: #244f9f;
  background: #edf4ff;
}

.nina-compact--paused {
  color: #9a4a2b;
  background: var(--accent-soft);
}

.side-summary__action {
  min-height: 38px;
}

.conversation-modules {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
}

.conversation-tab-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  padding-bottom: 0;
}

.conversation-tab-nav label {
  display: grid;
  min-height: 48px;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 14px;
  padding: 5px 3px;
  font-size: 9px;
  line-height: 1;
  text-align: center;
}

.conversation-tab-nav .tool-icon {
  width: 16px;
  height: 16px;
}

.conversation-tabs label[for="side-tab-perfil"] {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
}

.conversation-tabs:has(#side-tab-resumo:checked) label[for="side-tab-perfil"],
.conversation-tabs:has(#side-tab-notas:checked) label[for="side-tab-perfil"],
.conversation-tabs:has(#side-tab-distribuicao:checked) label[for="side-tab-perfil"],
.conversation-tabs:has(#side-tab-funil:checked) label[for="side-tab-perfil"],
.conversation-tabs:has(#side-tab-proxima:checked) label[for="side-tab-perfil"],
.conversation-tabs:has(#side-tab-auditoria:checked) label[for="side-tab-perfil"] {
  border-color: var(--line);
  color: var(--muted);
  background: #ffffff;
}

.conversation-tabs label[for="side-tab-resumo"] {
  border-color: var(--line);
  color: var(--muted);
  background: #ffffff;
}

.conversation-tabs:has(#side-tab-resumo:checked) label[for="side-tab-resumo"],
.conversation-tabs:has(#side-tab-notas:checked) label[for="side-tab-notas"],
.conversation-tabs:has(#side-tab-linha:checked) label[for="side-tab-linha"],
.conversation-tabs:has(#side-tab-distribuicao:checked) label[for="side-tab-distribuicao"],
.conversation-tabs:has(#side-tab-funil:checked) label[for="side-tab-funil"],
.conversation-tabs:has(#side-tab-proxima:checked) label[for="side-tab-proxima"],
.conversation-tabs:has(#side-tab-auditoria:checked) label[for="side-tab-auditoria"] {
  border-color: transparent;
  color: #ffffff;
  background: var(--accent);
}

.conversation-tab-panels {
  min-height: 0;
}

.conversation-tab-panel {
  gap: 9px;
  padding-right: 2px;
}

.conversation-tab-panel--resumo {
  display: none;
}

.conversation-tab-panel--perfil {
  display: grid;
}

.conversation-tabs:has(#side-tab-resumo:checked) .conversation-tab-panel--perfil,
.conversation-tabs:has(#side-tab-notas:checked) .conversation-tab-panel--perfil,
.conversation-tabs:has(#side-tab-linha:checked) .conversation-tab-panel--perfil,
.conversation-tabs:has(#side-tab-distribuicao:checked) .conversation-tab-panel--perfil,
.conversation-tabs:has(#side-tab-funil:checked) .conversation-tab-panel--perfil,
.conversation-tabs:has(#side-tab-proxima:checked) .conversation-tab-panel--perfil,
.conversation-tabs:has(#side-tab-auditoria:checked) .conversation-tab-panel--perfil {
  display: none;
}

.conversation-tabs:has(#side-tab-resumo:checked) .conversation-tab-panel--resumo,
.conversation-tabs:has(#side-tab-notas:checked) .conversation-tab-panel--notas,
.conversation-tabs:has(#side-tab-linha:checked) .conversation-tab-panel--linha,
.conversation-tabs:has(#side-tab-distribuicao:checked) .conversation-tab-panel--distribuicao,
.conversation-tabs:has(#side-tab-funil:checked) .conversation-tab-panel--funil,
.conversation-tabs:has(#side-tab-proxima:checked) .conversation-tab-panel--proxima,
.conversation-tabs:has(#side-tab-auditoria:checked) .conversation-tab-panel--auditoria {
  display: grid;
}

.conversation-tabs:has(#side-tab-lead:checked) .conversation-tab-panel--lead {
  display: none;
}

.tab-section {
  gap: 8px;
  border-radius: 14px;
  padding: 10px;
}

.tab-section h2,
.tab-section h3 {
  font-size: 13px;
}

.profile-list {
  gap: 6px;
}

.profile-list > div {
  border-radius: 11px;
  padding: 8px 9px;
}

.profile-list dd {
  font-size: 12px;
}

.tag-checkbox span {
  min-height: 25px;
  padding: 0 8px;
  font-size: 11px;
}

.next-action-form textarea,
.next-action-form .input {
  border-radius: 12px;
  padding: 8px 9px;
  font-size: 12px;
}

.note-list--tab .note-card {
  padding: 10px;
}

.note-list--tab .note-card p {
  font-size: 13px;
}

.timeline-list {
  max-height: none;
  gap: 7px;
}

.timeline-event {
  border-radius: 12px;
  padding: 8px 9px;
}

.timeline-event::before {
  display: none;
}

.timeline-event strong,
.timeline-event p {
  font-size: 12px;
}

.timeline-event span,
.timeline-event small {
  font-size: 11px;
}

.transfer-form--side .transfer-inline {
  grid-template-columns: 1fr;
}

.transfer-form--side .button {
  width: 100%;
}

@media (min-width: 1181px) {
  .conversation-main {
    min-height: calc(100dvh - 56px);
  }

  .conversation-side {
    top: 18px;
    max-height: calc(100dvh - 36px);
  }

  .conversation-modules {
    min-height: 0;
  }

  .conversation-tab-panel {
    height: 100%;
    overflow-y: auto;
  }
}

@media (max-width: 1180px) {
  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .conversation-side {
    grid-template-columns: 1fr;
  }

  .conversation-tab-panel {
    max-height: min(540px, 60dvh);
    overflow-y: auto;
  }
}

@media (max-width: 880px) {
  .conversation-header {
    grid-template-columns: 1fr;
  }

  .conversation-header .header-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .lead-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-panel {
    min-height: calc(100dvh - 210px);
  }

  .chat-panel__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-panel .sender-legend {
    justify-content: flex-start;
  }

  .message {
    max-width: 88%;
  }

  .message--sistema,
  .message--nota_interna {
    max-width: 96%;
  }

  .composer-form {
    grid-template-columns: 1fr;
  }

  .composer-form .button {
    width: 100%;
  }

  .conversation-tab-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .conversation-tab-nav label {
    min-width: 72px;
  }
}

@media (max-width: 560px) {
  .lead-strip {
    grid-template-columns: 1fr 1fr;
  }

  .composer-tool span {
    display: none;
  }

  .composer-tool {
    min-width: 36px;
    padding: 0 9px;
  }

  .conversation-tab-panel {
    max-height: 58dvh;
  }
}

/* Viewport-locked conversation layout */
.main-content:has(.conversation-layout) {
  overflow: hidden;
}

.conversation-layout {
  align-items: stretch;
  height: calc(100dvh - 56px);
  min-height: 0;
}

.conversation-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.conversation-drawer-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mobile-details-toggle,
.side-drawer-close {
  display: none;
}

.conversation-header,
.lead-strip {
  flex: 0 0 auto;
}

.conversation-header {
  margin-bottom: 8px;
}

.lead-strip {
  margin-bottom: 10px;
}

.chat-panel {
  height: 100%;
  min-height: 0;
}

.chat-panel .message-thread {
  height: 100%;
  min-height: 0;
  overscroll-behavior: contain;
}

.conversation-composer {
  flex: 0 0 auto;
}

.conversation-side {
  height: 100%;
  min-height: 0;
}

.conversation-modules {
  min-height: 0;
}

.conversation-tab-panels {
  min-height: 0;
  overflow: hidden;
}

.conversation-tab-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-width: 1181px) {
  .conversation-layout {
    height: calc(100dvh - 56px);
  }

  .conversation-side {
    position: sticky;
    top: 0;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: none;
    overflow: hidden;
  }
}

@media (max-width: 1180px) {
  .conversation-layout {
    height: calc(100dvh - 44px);
  }

  .conversation-main {
    min-height: 0;
  }
}

@media (max-width: 880px) {
  .main-content:has(.conversation-layout) {
    height: 100%;
    overflow: hidden;
    padding: 12px;
  }

  .conversation-layout {
    display: grid;
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
  }

  .conversation-main {
    height: 100%;
    min-height: 0;
  }

  .conversation-header {
    gap: 8px;
    margin-bottom: 7px;
  }

  .conversation-header h1 {
    font-size: 21px;
  }

  .conversation-header p {
    font-size: 12px;
  }

  .conversation-header .header-actions {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .mobile-details-toggle {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border: 1px solid rgba(255, 112, 67, 0.26);
    border-radius: 999px;
    padding: 0 9px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 11px;
    font-weight: 850;
  }

  .lead-strip {
    gap: 6px;
    margin-bottom: 8px;
    padding: 7px;
  }

  .lead-strip > div {
    padding: 7px 8px;
  }

  .lead-strip span {
    font-size: 8px;
  }

  .lead-strip strong {
    font-size: 11px;
  }

  .chat-panel {
    min-height: 0;
  }

  .chat-panel__header {
    padding: 8px 10px;
  }

  .chat-panel__header h2 {
    font-size: 15px;
  }

  .chat-panel .message-thread {
    padding: 10px;
  }

  .conversation-composer {
    padding: 8px;
  }

  .composer-toolbar {
    gap: 5px;
  }

  .composer-form textarea {
    min-height: 40px;
  }

  .composer-form .button {
    min-height: 40px;
  }

  .conversation-side {
    position: fixed;
    z-index: 60;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: min(76dvh, 620px);
    min-height: 0;
    max-height: none;
    overflow: hidden;
    border: 1px solid rgba(230, 227, 222, 0.95);
    border-radius: 24px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px rgba(17, 17, 19, 0.24);
    transform: translateY(calc(100% + 18px));
    transition: transform 180ms ease;
  }

  .conversation-drawer-toggle:checked ~ .conversation-side {
    transform: translateY(0);
  }

  .side-drawer-close {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: var(--brand);
    font-size: 12px;
    font-weight: 850;
  }

  .conversation-side-summary {
    padding: 10px;
    box-shadow: none;
  }

  .conversation-modules {
    overflow: hidden;
  }

  .conversation-tab-panel {
    max-height: none;
    height: 100%;
  }
}

@media (max-width: 560px) {
  .main-content:has(.conversation-layout) {
    padding: 10px;
  }

  .conversation-layout {
    height: 100%;
  }

  .lead-strip {
    grid-template-columns: repeat(5, minmax(98px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }

  .lead-strip::-webkit-scrollbar {
    display: none;
  }

  .chat-panel .legend-dot {
    font-size: 10px;
  }

  .message {
    max-width: 92%;
  }

  .message p {
    font-size: 13px;
  }
}

.funnel-state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.funnel-current-stage,
.operational-status-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(230, 227, 222, 0.9);
  border-radius: 12px;
  padding: 10px;
  background: rgba(247, 246, 243, 0.62);
}

.funnel-current-stage {
  border-color: rgba(255, 112, 67, 0.26);
  background: #fff7f2;
}

.funnel-current-stage span,
.operational-status-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.funnel-current-stage strong,
.operational-status-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.12;
}

.funnel-current-stage small,
.operational-status-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.funnel-operation-note {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid rgba(42, 157, 143, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f3faf8;
  color: #285f58;
  font-size: 12px;
  line-height: 1.45;
}

.funnel-operation-note p {
  margin: 0;
}

.funnel-operation-note strong {
  color: #1f514b;
  font-size: 12px;
  font-weight: 850;
}

.operational-status-control,
.timeline-update-form,
.lead-timeline-section {
  display: grid;
  gap: 8px;
}

.lead-timeline-list .timeline-event {
  border: 1px solid rgba(230, 227, 222, 0.76);
  background: rgba(255, 255, 255, 0.74);
}

.badge--interest,
.badge--duplicate {
  border-color: rgba(42, 157, 143, 0.2);
  color: #24635c;
  background: #e7f6f3;
}

.badge--duplicate {
  border-color: rgba(82, 91, 210, 0.2);
  color: #343c9a;
  background: #eef0ff;
}

.lead-interests-section {
  display: grid;
  gap: 10px;
}

.interest-list {
  display: grid;
  gap: 8px;
}

.interest-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(230, 227, 222, 0.82);
  border-radius: 12px;
  padding: 10px;
  background: rgba(247, 246, 243, 0.62);
}

.interest-item--primary {
  border-color: rgba(255, 112, 67, 0.22);
  background: #fff7f2;
}

.interest-item strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.interest-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.interest-item dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.interest-item dl div {
  display: grid;
  gap: 2px;
}

.interest-item dt,
.interest-item dd {
  margin: 0;
}

.interest-item dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.interest-item dd {
  color: var(--ink-soft);
  font-size: 12px;
}

@media (max-width: 560px) {
  .funnel-state-grid {
    grid-template-columns: 1fr;
  }
}

/* Final conversation usability pass */
.conversation-layout {
  gap: 10px;
}

.conversation-header.page-header {
  gap: 8px;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: 16px;
}

.conversation-header .back-link {
  margin-bottom: 2px;
  font-size: 11px;
}

.conversation-header .eyebrow {
  font-size: 9px;
}

.conversation-header h1 {
  margin-top: 1px;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.06;
}

.conversation-header p {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
}

.conversation-header .header-actions {
  gap: 5px;
}

.conversation-header .badge {
  min-height: 21px;
  padding: 0 7px;
  font-size: 9px;
}

.lead-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 7px;
  padding: 5px;
  border-radius: 13px;
}

.lead-strip > div {
  min-height: 38px;
  border-radius: 9px;
  padding: 5px 7px;
}

.lead-strip span {
  font-size: 8px;
  line-height: 1.1;
}

.lead-strip strong {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.18;
}

.chat-panel__header {
  padding: 7px 10px;
}

.chat-panel__header h2 {
  font-size: 14px;
}

.chat-panel .legend-dot {
  min-height: 19px;
  padding: 0 6px;
  font-size: 10px;
}

.chat-panel .message-thread {
  gap: 6px;
  padding: 10px 12px 8px;
}

.message {
  position: relative;
  max-width: min(560px, 70%);
  border-radius: 13px;
  padding: 6px 28px 6px 8px;
  box-shadow: 0 2px 8px rgba(17, 17, 19, 0.035);
}

.message[data-reply-target-message] {
  cursor: pointer;
}

.message__meta {
  display: flex;
  align-items: center;
  gap: 4px 6px;
  padding-right: 18px;
  font-size: 10px;
  line-height: 1.15;
}

.message__meta strong {
  font-size: 10px;
  line-height: 1.15;
}

.message__meta span {
  font-size: 10px;
}

.message__meta time {
  margin-left: auto;
  font-size: 9px;
  white-space: nowrap;
}

.message small {
  min-height: 16px;
  margin-top: 3px;
  padding: 0 6px;
  font-size: 9px;
  line-height: 16px;
}

.message .message__body {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.32;
}

.message__reply-button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 999px;
  color: currentColor;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  opacity: 0.68;
}

.message__reply-button:hover,
.message:focus-within .message__reply-button,
.message:hover .message__reply-button {
  opacity: 1;
}

.message__reply-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.message__reply-quote {
  display: grid;
  gap: 2px;
  margin: 4px 0 5px;
  border-left: 3px solid rgba(17, 17, 19, 0.24);
  border-radius: 8px;
  padding: 5px 7px;
  color: inherit;
  background: rgba(255, 255, 255, 0.48);
}

.message__reply-quote strong {
  font-size: 10px;
  line-height: 1.15;
}

.message__reply-quote span {
  color: inherit;
  font-size: 11px;
  line-height: 1.25;
  opacity: 0.82;
}

.message--cliente {
  border-top-left-radius: 5px;
}

.message--corretor,
.message--nina,
.message--nota_interna,
.message--sugestao_nina,
.message--nina_intervencao {
  border-top-right-radius: 5px;
}

.message--nina .message__meta strong,
.message--sugestao_nina .message__meta strong,
.message--nina_intervencao .message__meta strong {
  min-height: 17px;
  padding: 0 6px;
}

.message--nota_interna,
.message--sugestao_nina,
.message--nina_intervencao {
  padding: 6px 28px 6px 8px;
}

.message--sistema {
  padding: 5px 10px;
}

.message--sistema .message__body {
  font-size: 11px;
}

.conversation-composer {
  position: sticky;
  z-index: 5;
  bottom: 0;
  gap: 6px;
  padding: 7px 8px;
}

.composer-tool {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

.tool-icon {
  width: 14px;
  height: 14px;
}

.composer-mode-hint {
  padding: 5px 8px;
  font-size: 11px;
}

.composer-form {
  gap: 6px;
}

.composer-form textarea {
  min-height: 36px;
  border-radius: 13px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.3;
}

.composer-form .button {
  min-height: 36px;
  padding-inline: 12px;
}

.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(82, 91, 210, 0.18);
  border-left: 3px solid #525bd2;
  border-radius: 12px;
  padding: 6px 7px 6px 9px;
  color: #343c9a;
  background: #f0f2ff;
}

.reply-preview div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.reply-preview strong {
  font-size: 11px;
  line-height: 1.15;
}

.reply-preview span {
  overflow: hidden;
  color: #52598f;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(82, 91, 210, 0.2);
  border-radius: 999px;
  color: #343c9a;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 880px) {
  .conversation-header.page-header {
    gap: 6px;
    margin-bottom: 5px;
    padding: 7px 8px;
  }

  .conversation-header h1 {
    font-size: 18px;
  }

  .lead-strip {
    grid-template-columns: repeat(5, minmax(108px, 1fr));
    overflow-x: auto;
    scrollbar-width: none;
  }

  .lead-strip::-webkit-scrollbar {
    display: none;
  }

  .message {
    max-width: 88%;
  }
}

@media (max-width: 560px) {
  .chat-panel .message-thread {
    padding: 8px;
  }

  .message {
    max-width: 92%;
  }

  .message .message__body {
    font-size: 12px;
  }
}

/* High-density conversation workspace */
.main-content:has(.conversation-layout) {
  padding: 10px;
  overflow: hidden;
}

.conversation-layout {
  grid-template-columns: minmax(0, 1fr) minmax(276px, 318px);
  gap: 8px;
  height: calc(100dvh - 20px);
  min-height: 0;
}

.conversation-main {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  min-height: 0;
}

.conversation-header.page-header {
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  border: 1px solid rgba(230, 227, 222, 0.74);
  border-radius: 12px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.conversation-header__identity {
  min-width: 0;
}

.conversation-header .back-link {
  display: inline-flex;
  margin: 0 0 1px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.conversation-header h1 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header p {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header .header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  max-width: 310px;
}

.conversation-header .badge {
  min-height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 8px;
  line-height: 18px;
}

.lead-strip {
  display: flex;
  min-height: 24px;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 5px;
  border: 1px solid rgba(230, 227, 222, 0.74);
  border-radius: 12px;
  padding: 3px 7px;
  background: rgba(255, 247, 242, 0.68);
  box-shadow: none;
}

.lead-strip__item {
  display: inline-flex;
  min-width: 0;
  min-height: 18px;
  align-items: baseline;
  gap: 3px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  white-space: nowrap;
}

.lead-strip > .lead-strip__item {
  min-height: 18px;
  border: 0;
  padding: 0;
}

.lead-strip__item > span {
  display: inline;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: none;
}

.lead-strip__item > strong {
  display: inline;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  border: 1px solid rgba(230, 227, 222, 0.82);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(25, 25, 27, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf8, #f6f2eb);
  background-size: 18px 18px, auto;
}

.chat-panel__header {
  min-height: 30px;
  border-bottom: 1px solid rgba(230, 227, 222, 0.76);
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.7);
}

.chat-panel__header .eyebrow {
  display: none;
}

.chat-panel__header h2 {
  font-size: 13px;
  line-height: 1.1;
}

.chat-panel .sender-legend {
  gap: 4px;
}

.chat-panel .legend-dot {
  min-height: 17px;
  padding: 0 5px;
  font-size: 9px;
  line-height: 17px;
}

.chat-panel .message-thread {
  height: auto;
  min-height: 0;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px;
  scrollbar-width: thin;
}

.message {
  max-width: min(520px, 68%);
  border-radius: 12px;
  padding: 5px 26px 5px 8px;
  box-shadow: 0 1px 5px rgba(17, 17, 19, 0.035);
}

.message__meta {
  gap: 3px 5px;
  padding-right: 16px;
  font-size: 9px;
}

.message__meta strong,
.message__meta span,
.message__meta time {
  font-size: 9px;
}

.message small {
  min-height: 14px;
  margin-top: 2px;
  padding: 0 5px;
  font-size: 8px;
  line-height: 14px;
}

.message .message__body {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.28;
}

.message__reply-button {
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
}

.message__reply-button svg {
  width: 12px;
  height: 12px;
}

.message__reply-quote {
  margin: 3px 0 4px;
  border-radius: 7px;
  padding: 4px 6px;
}

.message__reply-quote strong {
  font-size: 9px;
}

.message__reply-quote span {
  font-size: 10px;
}

.message--sistema {
  max-width: min(440px, 78%);
  padding: 4px 9px;
}

.message--sistema .message__body {
  font-size: 10px;
}

.conversation-composer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  gap: 5px;
  border-top: 1px solid rgba(230, 227, 222, 0.82);
  padding: 6px 7px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 28px rgba(17, 17, 19, 0.05);
}

.composer-toolbar {
  gap: 4px;
  overflow: visible;
}

.composer-tool {
  min-height: 26px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 10px;
}

.tool-icon {
  width: 13px;
  height: 13px;
}

.composer-mode-hint {
  border-radius: 9px;
  padding: 4px 7px;
  font-size: 10px;
}

.composer-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.composer-form textarea {
  min-height: 34px;
  max-height: 92px;
  border-radius: 12px;
  padding: 7px 9px;
  font-size: 12px;
}

.composer-form .button {
  min-height: 34px;
  padding-inline: 11px;
  white-space: nowrap;
}

.reply-preview {
  min-height: 34px;
  border-radius: 10px;
  padding: 5px 6px 5px 8px;
}

.reply-preview strong,
.reply-preview span {
  font-size: 10px;
}

.reply-preview button {
  width: 22px;
  height: 22px;
}

.conversation-side {
  gap: 6px;
  min-width: 0;
  max-width: 318px;
  overflow: hidden;
}

.conversation-side-summary {
  gap: 6px;
  border-radius: 14px;
  padding: 8px;
  box-shadow: none;
}

.side-summary__top {
  gap: 6px;
}

.side-summary__top strong {
  font-size: 12px;
}

.side-summary__meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.side-summary__meta > div {
  border-radius: 9px;
  padding: 5px 6px;
}

.side-summary__meta dt {
  font-size: 8px;
}

.side-summary__meta dd {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.nina-compact {
  border-radius: 9px;
  padding: 5px 7px;
  font-size: 10px;
  line-height: 1.2;
}

.side-summary__action {
  min-height: 32px;
}

.conversation-modules {
  gap: 6px;
  border-radius: 14px;
  padding: 7px;
  overflow: hidden;
}

.conversation-tab-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.conversation-tab-nav label {
  min-height: 34px;
  border-radius: 10px;
  padding: 3px 2px;
  font-size: 8px;
}

.conversation-tab-nav .tool-icon {
  width: 13px;
  height: 13px;
}

.conversation-tab-panels {
  min-height: 0;
  overflow: hidden;
}

.conversation-tab-panel {
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0;
  scrollbar-width: thin;
}

.tab-section {
  gap: 6px;
  border-radius: 12px;
  padding: 8px;
}

.tab-section h2,
.tab-section h3 {
  font-size: 12px;
}

.profile-list,
.timeline-list,
.follow-up-history-list,
.note-list--tab {
  gap: 5px;
}

.profile-list > div,
.timeline-event,
.interest-item {
  border-radius: 10px;
  padding: 6px 7px;
}

.timeline-event strong,
.timeline-event p,
.profile-list dd,
.interest-item dd {
  font-size: 11px;
}

.timeline-event span,
.timeline-event small,
.profile-list dt,
.interest-item dt {
  font-size: 9px;
}

@media (min-width: 1181px) {
  .conversation-layout {
    height: calc(100dvh - 20px);
  }

  .conversation-side {
    top: 0;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(100dvh - 20px);
  }
}

@media (max-width: 1180px) {
  .main-content:has(.conversation-layout) {
    padding: 8px;
  }

  .conversation-layout {
    height: calc(100dvh - 16px);
  }
}

@media (max-width: 880px) {
  .main-content:has(.conversation-layout) {
    padding: 6px;
  }

  .conversation-layout {
    height: calc(100dvh - 12px);
    overflow: hidden;
  }

  .conversation-main {
    min-width: 0;
  }

  .conversation-header.page-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    margin-bottom: 4px;
    padding: 5px 6px;
  }

  .conversation-header h1 {
    font-size: 16px;
  }

  .conversation-header p {
    font-size: 9px;
  }

  .conversation-header .header-actions {
    max-width: 142px;
  }

  .mobile-details-toggle {
    min-height: 22px;
    padding: 0 7px;
    font-size: 9px;
  }

  .lead-strip {
    overflow: visible;
    gap: 3px 6px;
    margin-bottom: 4px;
    padding: 3px 6px;
  }

  .lead-strip__item {
    flex: 1 1 calc(50% - 6px);
    white-space: normal;
  }

  .lead-strip__item > span,
  .lead-strip__item > strong {
    font-size: 9px;
  }

  .chat-panel__header {
    display: none;
  }

  .message {
    max-width: 88%;
  }

  .composer-toolbar {
    flex-wrap: wrap;
    overflow: visible;
  }

  .composer-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .composer-form .button {
    min-width: 74px;
    padding-inline: 8px;
  }

  .conversation-side {
    right: 6px;
    bottom: 6px;
    left: 6px;
    max-width: none;
    height: min(78dvh, 620px);
    border-radius: 18px;
    padding: 7px;
  }

  .conversation-tab-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .conversation-header .header-actions {
    max-width: 112px;
  }

  .conversation-header .badge {
    min-height: 16px;
    padding: 0 5px;
    font-size: 7px;
    line-height: 16px;
  }

  .lead-strip__item {
    flex-basis: 100%;
  }

  .chat-panel .message-thread {
    padding: 7px;
  }

  .message {
    max-width: 92%;
    padding-right: 24px;
  }

  .composer-tool span {
    display: none;
  }

  .composer-tool {
    width: 30px;
    min-width: 30px;
    padding: 0;
  }
}

/* Mocked Nina global operations */
.operation-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(148, 99, 25, 0.24);
  border-radius: 14px;
  padding: 9px 12px;
  color: #755219;
  background: #fff8ea;
  font-size: 13px;
}

.operation-alert strong,
.operation-alert span {
  line-height: 1.25;
}

.nina-global-panel,
.nina-global-audit,
.nina-team-status {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.nina-global-status {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.nina-global-status--active {
  color: #24635c;
  background: rgba(42, 157, 143, 0.12);
}

.nina-global-status--disabled,
.badge--nina-global-disabled,
.nina-compact--global-disabled {
  color: #755219;
  background: #fff8ea;
}

.badge--nina-global-disabled {
  border: 1px solid rgba(148, 99, 25, 0.2);
}

.nina-state-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.nina-state-explainer article,
.nina-global-details > div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(230, 227, 222, 0.84);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(247, 246, 243, 0.72);
}

.nina-state-explainer strong {
  color: var(--ink);
  font-size: 12px;
}

.nina-state-explainer span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.nina-global-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.nina-global-details--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nina-global-details dt {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nina-global-details dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.nina-global-actions {
  display: grid;
  gap: 8px;
}

.nina-global-form {
  display: grid;
  gap: 8px;
}

.nina-global-button-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.nina-reactivate-form {
  display: contents;
}

.nina-global-action-button {
  width: auto;
  min-width: 132px;
  min-height: 44px;
  padding-inline: 16px;
}

.nina-global-actions--active .nina-global-action-button:not(.button--attention),
.nina-global-actions--disabled .nina-global-action-button:not(.button--primary) {
  min-width: 116px;
  min-height: 40px;
  padding-inline: 13px;
  box-shadow: none;
}

.nina-disable-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nina-disable-options label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--ink-soft);
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.nina-disable-options input {
  accent-color: var(--accent);
}

.nina-reason-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(200px, 0.8fr);
  gap: 8px;
  align-items: end;
}

.nina-reason-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.nina-reason-grid label span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 11px;
  color: var(--ink);
  background: #ffffff;
}

.nina-reason-grid .select {
  height: 38px;
  min-height: 38px;
  margin-bottom: 0;
  border-radius: 12px;
}

.conversation-global-nina-alert {
  display: inline-flex;
  width: fit-content;
  max-width: calc(100% - 20px);
  min-height: 24px;
  align-items: center;
  margin: 7px 10px 0;
  border: 1px solid rgba(148, 99, 25, 0.2);
  border-radius: 999px;
  padding: 0 9px;
  color: #755219;
  background: #fff8ea;
  font-size: 11px;
  font-weight: 850;
}

.composer-mode-hint--global {
  display: block;
  border-color: rgba(148, 99, 25, 0.22);
  color: #755219;
  background: #fff8ea;
}

@media (max-width: 880px) {
  .operation-alert,
  .nina-global-panel .panel__header,
  .nina-team-status .panel__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nina-state-explainer,
  .nina-global-details,
  .nina-global-details--compact,
  .nina-global-actions,
  .nina-reason-grid {
    grid-template-columns: 1fr;
  }

  .nina-global-button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .nina-global-action-button,
  .nina-global-actions--active .nina-global-action-button:not(.button--attention),
  .nina-global-actions--disabled .nina-global-action-button:not(.button--primary) {
    width: 100%;
    min-height: 42px;
  }
}

/* Safe visual polish pass: product finish without changing behavior */
:root {
  --ux-border: rgba(222, 220, 214, 0.82);
  --ux-border-soft: rgba(222, 220, 214, 0.56);
  --ux-shadow-subtle: 0 10px 26px rgba(17, 17, 19, 0.06);
  --ux-shadow-hover: 0 16px 38px rgba(17, 17, 19, 0.09);
  --ux-radius-card: 8px;
}

.main-content {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}

.panel,
.kpi-card,
.conversation-card,
.supervision-card,
.team-card,
.lead-strip,
.login-panel {
  border-color: var(--ux-border);
  border-radius: var(--ux-radius-card);
  box-shadow: var(--ux-shadow-subtle);
}

.panel,
.conversation-card,
.supervision-card,
.team-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    var(--surface);
}

.panel__header {
  gap: 12px;
  border-bottom: 1px solid var(--ux-border-soft);
  padding-bottom: 10px;
}

.panel__header h2,
.tab-section h2,
.tab-section h3 {
  letter-spacing: 0;
}

.panel-description {
  max-width: 760px;
}

.button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 820;
}

.button--primary,
.button--attention {
  box-shadow: 0 10px 20px rgba(242, 100, 59, 0.18);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.86);
}

.button:disabled,
.composer-tool:disabled,
.select:disabled,
.input:disabled,
textarea:disabled {
  cursor: not-allowed;
  filter: grayscale(0.1);
  opacity: 0.56;
}

.badge,
.action-pill,
.filter-chip,
.nina-global-status {
  border-radius: 999px;
  font-weight: 820;
}

.badge,
.action-pill {
  min-height: 24px;
  border: 1px solid transparent;
  padding-inline: 8px;
}

.badge::before,
.action-pill::before {
  opacity: 0.62;
}

.operation-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
  gap: 8px 10px;
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 12px;
  box-shadow: none;
}

.operation-alert::before {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: currentColor;
  background: rgba(255, 255, 255, 0.72);
  content: "i";
  font-size: 12px;
  font-weight: 900;
}

.operation-alert strong {
  align-self: center;
  color: inherit;
  font-size: 13px;
}

.operation-alert span {
  grid-column: 2;
  color: inherit;
  font-size: 12px;
  opacity: 0.88;
}

.operation-alert--success {
  border-color: rgba(35, 120, 78, 0.22);
  color: #1f6845;
  background: #edf8f1;
}

.operation-alert--success::before {
  content: "✓";
}

.operation-alert--risk,
.operation-alert--blocked,
.operation-alert--nina {
  border-color: rgba(180, 35, 24, 0.18);
  color: #8f2f24;
  background: #fff0ed;
}

.operation-alert--risk::before {
  content: "!";
}

.operation-alert--blocked::before,
.operation-alert--nina::before {
  content: "!";
}

.operation-alert--local,
.operation-alert--inbox-source:not(.operation-alert--risk):not(.operation-alert--blocked):not(.operation-alert--success) {
  border-color: rgba(36, 89, 201, 0.18);
  color: #244f9e;
  background: #f0f4ff;
}

.operation-alert--local::before,
.operation-alert--inbox-source:not(.operation-alert--risk):not(.operation-alert--blocked):not(.operation-alert--success)::before {
  content: "L";
}

.operation-alert-inline {
  gap: 7px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: none;
}

.operation-alert-inline::before {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  content: "i";
  font-size: 10px;
  font-weight: 900;
}

.operation-alert-inline--success {
  border-color: rgba(35, 120, 78, 0.22);
  color: #1f6845;
  background: #edf8f1;
}

.operation-alert-inline--success::before {
  content: "✓";
}

.operation-alert-inline--risk,
.operation-alert-inline--blocked {
  border-color: rgba(180, 35, 24, 0.18);
  color: #8f2f24;
  background: #fff0ed;
}

.operation-alert-inline--risk::before,
.operation-alert-inline--blocked::before {
  content: "!";
}

.operation-alert-inline--local {
  border-color: rgba(36, 89, 201, 0.18);
  color: #244f9e;
  background: #f0f4ff;
}

.operation-alert-inline--local::before {
  content: "L";
}

.data-source-status--panel {
  border-radius: 8px;
  box-shadow: none;
}

.data-source-status__header span {
  font-weight: 880;
}

.supabase-local-context {
  border-radius: 8px;
}

.conversation-card {
  gap: 9px;
  padding: 14px;
}

.conversation-card:hover {
  box-shadow: var(--ux-shadow-hover);
}

.conversation-card__top {
  align-items: center;
}

.conversation-card h2 {
  font-size: 15px;
}

.conversation-card__time {
  border-radius: 8px;
}

.conversation-preview {
  color: #42474c;
}

.conversation-card__badges {
  gap: 5px;
}

.conversation-card__signal {
  padding: 8px 9px;
  border: 1px solid rgba(230, 227, 222, 0.76);
  border-radius: 8px;
  background: rgba(247, 246, 243, 0.68);
}

.conversation-card__signal strong {
  min-height: 22px;
}

.conversation-card footer {
  display: none;
}

.queue-list div {
  border-bottom: 1px solid var(--ux-border-soft);
}

.queue-list div:last-child {
  border-bottom: 0;
}

.chat-panel {
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf9, #f8f4ee);
}

.conversation-header.page-header,
.lead-strip {
  border-radius: 8px;
}

.lead-strip {
  background: rgba(255, 247, 242, 0.78);
}

.message {
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(17, 17, 19, 0.035);
}

.message--cliente {
  border-color: rgba(222, 220, 214, 0.86);
}

.message--corretor {
  background: #fff4ee;
}

.message--nina {
  background: #f0f2ff;
}

.message--nota_interna {
  border: 1px solid rgba(176, 127, 10, 0.34);
  border-left: 4px solid #c69113;
  background: #fff4cc;
}

.message--nota_interna small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-weight: 900;
}

.message--nota_interna small::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.message--sugestao_nina,
.message--nina_intervencao {
  border: 1px dashed rgba(42, 157, 143, 0.34);
  background: #eaf7f4;
}

.conversation-composer {
  border-radius: 0 0 8px 8px;
}

.composer-tool {
  min-height: 32px;
  border-radius: 8px;
}

.composer-tool:disabled {
  background: #f7f6f3;
}

.composer-mode-hint {
  border-radius: 8px;
}

.composer-form textarea,
.next-action-form textarea,
.transfer-form textarea,
.input,
.select {
  border-radius: 8px;
}

.conversation-side {
  max-width: 330px;
}

.conversation-side-summary,
.conversation-modules,
.tab-section {
  border-radius: 8px;
}

.conversation-tab-nav {
  gap: 5px;
}

.conversation-tab-nav label {
  min-height: 38px;
  border-radius: 8px;
  font-size: 9px;
}

.conversation-tab-nav label:hover {
  background: rgba(255, 112, 67, 0.08);
}

.funnel-current-stage,
.operational-status-card,
.profile-list > div,
.timeline-event,
.interest-item,
.follow-up-pending-card,
.follow-up-history__item {
  border-radius: 8px;
}

.funnel-current-stage {
  border-left: 3px solid var(--accent);
}

.operational-status-card {
  border-left: 3px solid #525bd2;
}

.tab-section:has([data-supabase-assign-owner-form]),
.tab-section:has([data-supabase-transfer-form]) {
  border-left: 3px solid #2459c9;
}

.tab-section:has([data-supabase-duty-rule-form]),
.tab-section:has([data-supabase-redistribute-lead-form]) {
  border-left: 3px solid var(--accent);
}

.tab-section--reopen-closed {
  border-left: 3px solid #b45309;
}

.tab-section:has([data-supabase-duplicate-interest-form]) {
  border-left: 3px solid #2a9d8f;
}

.nina-desired-state-panel,
.openclaw-readonly-panel {
  border-radius: 8px;
}

.nina-desired-state-panel {
  border-left: 4px solid var(--accent);
}

.openclaw-readonly-panel {
  border-left: 4px solid #2459c9;
}

.nina-state-explainer article,
.nina-global-details > div,
.queue-card,
.duty-day-card,
.distribution-config-note {
  border-radius: 8px;
}

.nina-global-action-button {
  min-height: 40px;
}

.team-card {
  padding: 16px;
}

.team-status,
.follow-up-pending-card__status {
  border-radius: 999px;
}

@media (max-width: 880px) {
  .operation-alert {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .operation-alert span {
    grid-column: 2;
  }

  .conversation-card {
    padding: 13px;
  }

  .conversation-card__badges {
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .conversation-card__badges::-webkit-scrollbar {
    display: none;
  }

  .conversation-card__signal span {
    white-space: normal;
  }

  .composer-tool {
    min-width: 36px;
    min-height: 36px;
  }

  .conversation-tab-nav label {
    min-height: 42px;
    font-size: 9px;
  }

  .conversation-side {
    border-radius: 12px;
  }

  .supervision-security-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .page-header h1 {
    font-size: 24px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-card {
    min-height: 84px;
    padding: 12px 12px 12px 48px;
  }

  .lead-strip {
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }

  .lead-strip__item {
    min-width: 0;
    white-space: normal;
  }

  .message {
    max-width: 94%;
  }

  .composer-form {
    grid-template-columns: 1fr;
  }

  .composer-form .button {
    width: 100%;
  }

  .conversation-tab-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .supervision-security-grid {
    grid-template-columns: 1fr;
  }
}
