﻿@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #c7ccd5;
  --line-soft: #e4e8ef;
  --text: #101418;
  --muted: #596171;
  --blue: #075bc5;
  --blue-2: #2874e3;
  --blue-soft: #e7f0ff;
  --green: #009f68;
  --green-soft: #c9f8df;
  --red: #c91414;
  --red-soft: #ffd8d8;
  --dark: #111b2d;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 42px rgba(15, 23, 42, 0.09);
  --radius: 12px;
  --radius-sm: 9px;
  --tap-size: 44px;
  --topbar-height: 58px;
}

.modal-card.service-order-detail-card {
  display: flex;
  flex-direction: column;
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-color: #d8e1ee;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.service-order-detail-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 10px;
  overflow: auto;
}

.service-order-detail-card .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #ffffff;
}

.service-order-detail-card .modal-header > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 12px;
  min-width: 0;
}

.service-order-detail-card .modal-header > div::before {
  content: "";
  grid-row: 1 / 4;
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background:
    linear-gradient(#2563eb, #2563eb) 50% 10px / 12px 2px no-repeat,
    linear-gradient(#2563eb, #2563eb) 50% 16px / 14px 2px no-repeat,
    linear-gradient(#2563eb, #2563eb) 50% 22px / 10px 2px no-repeat,
    #eff6ff;
}

.service-order-detail-card .modal-header .eyebrow,
.service-order-detail-card .modal-header h2,
.service-order-detail-card .modal-header p {
  grid-column: 2;
}

.service-order-detail-card .modal-header .eyebrow {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.service-order-detail-card .modal-header h2 {
  margin-top: 1px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.12;
}

.service-order-detail-card .modal-header p {
  margin-top: 2px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.service-order-detail-card .modal-header .icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #64748b;
}

.service-order-detail-card .modal-header .icon-button:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #0f172a;
}

.service-order-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-order-detail-section {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
}

.service-order-detail-summary-item {
  display: grid;
  align-content: center;
  min-height: 70px;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
}

.service-order-detail-summary-item:nth-child(3n) {
  border-right: 1px solid #dbe3ef;
}

.service-order-detail-summary-item:nth-last-child(-n + 3) {
  border-bottom: 1px solid #dbe3ef;
}

.service-order-detail-summary small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.service-order-detail-summary strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-detail-section {
  padding: 15px 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.service-order-detail-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.25;
}

.service-order-detail-section h3::before {
  content: "";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background:
    linear-gradient(#2563eb, #2563eb) 50% 50% / 10px 2px no-repeat,
    #eff6ff;
}

.service-order-detail-description h3::before {
  background:
    linear-gradient(#2563eb, #2563eb) 50% 8px / 10px 2px no-repeat,
    linear-gradient(#2563eb, #2563eb) 50% 14px / 12px 2px no-repeat,
    #eff6ff;
}

.service-order-detail-attachments h3::before {
  background:
    radial-gradient(circle at 8px 9px, #2563eb 0 2px, transparent 2.5px),
    linear-gradient(135deg, transparent 52%, #2563eb 53% 59%, transparent 60%),
    #eff6ff;
}

.service-order-detail-section p {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.service-order-detail-description-content {
  display: grid;
  gap: 4px;
}

.service-order-detail-description-content strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-detail-list {
  display: grid;
  gap: 8px;
}

.service-order-media-grid {
  display: grid;
  gap: 10px;
}

.service-order-media-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 88px;
  padding: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.service-order-media-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.service-order-media-card.is-unavailable {
  cursor: default;
}

.service-order-media-card.is-unavailable:hover {
  border-color: #dbe3ef;
  box-shadow: none;
  transform: none;
}

.service-order-media-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.service-order-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-order-media-loading {
  padding: 0 8px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.service-order-media-info {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.service-order-media-info strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-media-info small {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.service-order-detail-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.service-order-detail-list-item strong {
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.service-order-detail-list-item span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.service-order-detail-section .empty-table-message {
  display: grid;
  min-height: 62px;
  place-items: center;
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.service-order-detail-card .modal-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line-soft);
  background: #ffffff;
}

.service-order-image-preview-backdrop {
  z-index: 260;
  background: rgba(15, 23, 42, 0.68);
}

.service-order-image-preview-card {
  width: min(940px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-color: #d8e1ee;
  background: #ffffff;
}

.service-order-image-preview-card .modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.service-order-image-preview-stage {
  display: grid;
  place-items: center;
  min-height: min(62vh, 620px);
  padding: 18px;
  background: #0f172a;
}

.service-order-image-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  border-radius: 8px;
  object-fit: contain;
}

@media (max-width: 760px) {
  .service-order-detail-backdrop {
    padding: 12px;
  }

  .service-order-detail-card {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .service-order-detail-body {
    padding: 14px;
  }

  .service-order-detail-summary {
    grid-template-columns: 1fr;
  }

  .service-order-detail-summary-item,
  .service-order-detail-summary-item:nth-child(3n),
  .service-order-detail-summary-item:nth-last-child(-n + 3) {
    border: 1px solid #dbe3ef;
  }

  .service-order-detail-list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-order-detail-list-item span {
    flex: initial;
  }

  .service-order-media-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .service-order-media-thumb {
    width: 56px;
    height: 56px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 246, 250, 0.48);
  backdrop-filter: blur(9px) saturate(1.08);
  -webkit-backdrop-filter: blur(9px) saturate(1.08);
}

.loading-card {
  display: grid;
  min-width: min(330px, 86vw);
  gap: 10px;
  justify-items: center;
  padding: 28px 30px;
  border: 1px solid rgba(199, 204, 213, 0.84);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  color: var(--text);
  text-align: center;
}

.loading-card strong {
  font-size: 22px;
  line-height: 1.2;
}

.loading-card span:last-child {
  color: var(--muted);
  font-size: 15px;
}

.loading-coreflow-logo {
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(7, 91, 197, 0.22));
  transform-origin: 50% 50%;
  animation: coreflow-loader-spin 1.15s linear infinite;
}

@keyframes coreflow-loader-spin {
  from {
    transform: rotate(0deg) scale(0.98);
  }
  50% {
    transform: rotate(180deg) scale(1.04);
  }
  to {
    transform: rotate(360deg) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-coreflow-logo {
    animation: none;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: var(--tap-size);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(40, 116, 227, 0.28);
  outline-offset: 2px;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(480px, 1.15fr) minmax(520px, 1fr);
  min-height: 100vh;
  background: #f4f7fb;
}

.login-visual {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  padding: 54px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8, 15, 28, 0.88), rgba(8, 15, 28, 0.78)),
    linear-gradient(135deg, #0d1a2b, #213247);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 25% 0 0;
  background:
    linear-gradient(90deg, transparent 0 15%, rgba(190, 207, 222, 0.12) 15% 16%, transparent 16% 28%, rgba(190, 207, 222, 0.16) 28% 29%, transparent 29% 48%, rgba(190, 207, 222, 0.14) 48% 49%, transparent 49% 76%, rgba(190, 207, 222, 0.12) 76% 77%, transparent 77%),
    linear-gradient(180deg, rgba(214, 225, 235, 0.10), rgba(11, 20, 34, 0.84)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 128px);
  border-top: 8px solid rgba(5, 12, 22, 0.55);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: fit-content;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.brand-logo-login {
  height: 68px;
  max-width: 340px;
  filter: none;
}

.brand-logo-sidebar {
  height: 58px;
  max-width: 210px;
}

.office-visual {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 22%;
  height: 210px;
  opacity: 0.45;
}

.office-visual span {
  position: absolute;
  bottom: 0;
  border: 2px solid rgba(189, 208, 226, 0.3);
  background: rgba(10, 21, 36, 0.18);
}

.office-visual span:nth-child(1) { left: 18%; width: 18%; height: 120px; }
.office-visual span:nth-child(2) { left: 42%; width: 16%; height: 160px; }
.office-visual span:nth-child(3) { right: 18%; width: 15%; height: 132px; }
.office-visual span:nth-child(4) { left: 31%; width: 22%; height: 18px; }
.office-visual span:nth-child(5) { right: 31%; width: 18%; height: 18px; }

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin-bottom: 120px;
}

.login-copy h1 {
  max-width: 620px;
  margin: 0 0 28px;
  font-size: 30px;
  line-height: 1.32;
}

.login-copy p {
  max-width: 540px;
  margin: 0;
  color: #8f9aad;
  font-size: 20px;
  line-height: 1.45;
}

.login-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: #8f9aad;
  font-size: 14px;
  font-weight: 700;
}

.login-footer a {
  color: inherit;
  text-decoration: none;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px;
}

.login-card {
  display: grid;
  gap: 28px;
  width: min(500px, 100%);
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-card h2 {
  margin: 0 0 14px;
  font-size: 30px;
}

.login-card p {
  margin: 0;
  color: #303744;
  font-size: 16px;
  line-height: 1.5;
}

.login-card label {
  display: grid;
  gap: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.label-row a,
.login-help a {
  color: var(--blue);
  text-decoration: none;
}

.login-input {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: #7a828f;
}

.login-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

.login-submit,
.sso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 64px;
  border-radius: 5px;
  font-size: 20px;
}

.login-submit {
  border: 1px solid #0149ad;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.sso-button {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  color: #111;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.login-status {
  min-height: 24px;
  color: var(--red) !important;
}

.login-status[data-state="success"] {
  color: var(--green) !important;
}

.login-help {
  text-align: center;
}

.app-mfa-card {
  gap: 22px;
}

.app-mfa-card .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-mfa-card form,
.app-mfa-setup {
  display: grid;
  gap: 16px;
}

.app-mfa-setup {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.app-mfa-setup img {
  justify-self: center;
  width: min(100%, 220px);
  aspect-ratio: 1;
  border: 8px solid #fff;
  border-radius: 8px;
  background: #fff;
}

.app-mfa-setup p {
  color: var(--muted);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: var(--topbar-height);
  z-index: 80;
  width: 300px;
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #eef2f7;
  overflow: hidden;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 24px 26px 18px;
}

.brand small {
  display: block;
  margin-top: 0;
  color: #2f3540;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
  align-content: start;
  padding: 18px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b8c2d1 transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #b8c2d1;
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav-item,
.plain-action {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #202631;
  text-align: left;
  text-decoration: none;
}

.nav-item {
  min-height: 56px;
  padding: 10px 22px;
  border-radius: 5px;
  font-size: 18px;
  line-height: 1.25;
}

.nav-item.is-active {
  background: var(--blue-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.nav-parent-item {
  position: relative;
  margin-bottom: 2px;
}

.nav-parent-item::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .18s ease;
  opacity: .72;
}

.nav-parent-item.is-expanded::after {
  transform: rotate(45deg);
}

.nav-subitem {
  display: none;
  min-height: 42px;
  margin-top: -6px;
  margin-left: 42px;
  padding: 8px 14px;
  font-size: 15px;
}

.nav-subitem.is-expanded {
  display: flex;
}

.nav-subitem::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: .42;
}

.nav-subitem.is-active::before {
  opacity: 1;
}

.plain-action {
  padding: 12px 22px;
  font-size: 17px;
}

.sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #eef2f7;
}

.main-area {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin-left: 300px;
  padding-top: var(--topbar-height);
  overflow-x: hidden;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--topbar-height);
  padding: 8px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-license {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.topbar-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.topbar-license-text {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  gap: 4px;
  color: #101828;
  white-space: nowrap;
}

.topbar-license-text span {
  color: #344054;
  font-size: 13px;
}

.topbar-license-text strong {
  overflow: hidden;
  max-width: 340px;
  color: #101828;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 28vw);
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #0b5ed7;
}

/* ===== Sino de notificacoes (cabecalho) ===== */
.notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e8f1fd;
  color: #2563eb;
  cursor: pointer;
  transition: background .15s ease;
}
.notif-bell:hover { background: #dcebfc; }
.notif-bell.is-open { background: #d3e4fb; }

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #c93b3b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: 92vw;
  max-height: min(560px, 80vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  z-index: 4000;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 12px;
}
.notif-panel-title { font-size: 17px; font-weight: 700; color: var(--text); }
.notif-count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fce7ee;
  color: #b0355a;
  font-size: 12px;
  font-weight: 700;
}

.notif-panel-body { flex: 1; overflow-y: auto; padding: 2px 0 4px; }

.notif-section-label {
  padding: 12px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #9aa1ac;
  text-transform: uppercase;
}

.notif-item {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid #f3f4f7;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.notif-item:hover { background: #f7f9fc; }
.notif-section-label + .notif-item { border-top: 0; }

.notif-item-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.notif-item-ico svg { width: 18px; height: 18px; }
.notif-ico-agenda { background: #e1f5ee; color: #0f6e56; }
.notif-ico-overdue { background: #fbeaf0; color: #993556; }
.notif-ico-today { background: #faeeda; color: #854f0b; }

.notif-item-main { min-width: 0; flex: 1; }
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-client {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}
.notif-item-time.is-overdue { color: #993556; }
.notif-item-time.is-today { color: #854f0b; }
.notif-item-time svg { width: 13px; height: 13px; flex: 0 0 auto; }

.notif-empty { padding: 30px 18px; text-align: center; color: #9aa1ac; font-size: 13px; }
.notif-loading { padding: 24px 18px; text-align: center; color: #9aa1ac; font-size: 13px; }

.notif-panel-footer {
  flex: 0 0 auto;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-top: 1px solid #eef0f3;
  background: #fff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notif-panel-footer:hover { background: #f7f9fc; }

/* ===== Tarefas internas (Agenda + Tarefas lado a lado) ===== */
.internal-tasks-filters { align-items: flex-end; }
.internal-tasks-period {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}
.internal-tasks-period select {
  min-width: 168px;
  padding: 9px 12px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.internal-tasks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.internal-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #e6e9ee;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.internal-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
}
.internal-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.internal-panel-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
}
.internal-panel-icon.agenda {
  background-color: #e1f5ee;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f6e56' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
.internal-panel-icon.tasks {
  background-color: #faeeda;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23854f0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E");
}
.internal-panel-add {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 9px;
}
.internal-panel-body {
  flex: 1;
  padding: 4px 18px 8px;
  min-height: 120px;
}
.internal-panel-foot {
  border-top: 1px solid #eef0f3;
  padding: 12px 18px;
  text-align: center;
}
.internal-panel-foot .ghost-link {
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}
.internal-panel-empty {
  padding: 34px 8px;
  text-align: center;
  color: #9aa1ac;
  font-size: 13px;
}

/* Agenda (painel esquerdo) */
.internal-day-label {
  margin: 14px 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa1ac;
}
.internal-day-label:first-child { margin-top: 6px; }
.internal-appt {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 10px;
  cursor: pointer;
}
.internal-appt-time {
  flex: 0 0 40px;
  padding-top: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}
.internal-appt-card {
  flex: 1;
  min-width: 0;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  background: #f5f7fa;
  padding: 9px 12px;
  transition: background 0.15s ease;
}
.internal-appt:hover .internal-appt-card { background: #eef2f8; }
.internal-appt-card.type-technical { border-left-color: #0f6e56; }
.internal-appt-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}
.internal-appt-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: #6b7280;
}
.internal-appt-meta svg { width: 12px; height: 12px; flex: 0 0 auto; }

/* Tarefas (painel direito) */
.internal-task {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 12px;
  margin: 0 -12px;
  border-top: 1px solid #f1f3f6;
}
.internal-panel-body > .internal-task:first-child { border-top: 0; }
.internal-task.is-overdue {
  background: #fdf6f8;
  border-radius: 10px;
  border-top: 0;
  margin-bottom: 6px;
}
.internal-task-check {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border: 2px solid #c3cad4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.internal-task-check:hover { border-color: #1d9e75; }
.internal-task.is-done .internal-task-check {
  background: #1d9e75;
  border-color: #1d9e75;
}
.internal-task-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.internal-task.is-done .internal-task-check svg { opacity: 1; }
.internal-task-main { flex: 1; min-width: 0; }
.internal-task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.internal-task.is-done .internal-task-title {
  text-decoration: line-through;
  color: #9aa1ac;
  font-weight: 500;
}
.internal-task-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #6b7280;
}
.internal-task.is-overdue .internal-task-sub { color: #993556; font-weight: 600; }
.internal-task-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.internal-task-badge.alta { background: #fbeaf0; color: #993556; }
.internal-task-badge.media { background: #faeeda; color: #854f0b; }
.internal-task-badge.baixa { background: #eef0f3; color: #6b7280; }

.internal-task-modal-card {
  width: 460px;
  max-width: calc(100vw - 32px);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}
.internal-task-modal-card form { display: flex; flex-direction: column; }

/* Cabecalho */
.internal-task-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid #eef0f3;
}
.internal-task-modal-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: #faeeda;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23854f0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E");
}
.internal-task-modal-heading { flex: 1; min-width: 0; }
.internal-task-modal-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa1ac;
}
.internal-task-modal-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}
.internal-task-modal-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #9aa1ac;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.internal-task-modal-close:hover { color: #4b5563; }

/* Corpo */
.internal-task-modal-body { padding: 20px 24px 18px; }
.internal-task-field { margin-bottom: 14px; }
.internal-task-field:last-of-type { margin-bottom: 0; }
.internal-task-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.internal-task-label .req { color: #c93b3b; }
.internal-task-label .opt { font-weight: 400; color: #aeb4bd; }
.internal-task-modal-body input[type="text"],
.internal-task-modal-body input[type="date"],
.internal-task-modal-body input[type="time"],
.internal-task-modal-body select,
.internal-task-modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  background: #fff;
}
.internal-task-modal-body select { cursor: pointer; }
.internal-task-modal-body textarea { min-height: 64px; resize: vertical; }
.internal-task-modal-body input:focus,
.internal-task-modal-body select:focus,
.internal-task-modal-body textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Prioridade (pilulas) */
.internal-task-priority {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.internal-priority-pill {
  padding: 11px 8px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.internal-priority-pill:hover { border-color: #b6bdc7; }
.internal-priority-pill.is-selected { border-width: 2px; padding: 10px 7px; }
.internal-priority-pill[data-priority="baixa"].is-selected {
  border-color: #9aa1ac; background: #f1f3f6; color: #4b5563;
}
.internal-priority-pill[data-priority="media"].is-selected {
  border-color: #b98418; background: #faeeda; color: #854f0b;
}
.internal-priority-pill[data-priority="alta"].is-selected {
  border-color: #c25b7c; background: #fbeaf0; color: #993556;
}

/* Prazo (data + hora) */
.internal-task-due {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
.internal-task-due-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.internal-due-chip {
  padding: 4px 12px;
  border: 1px solid #e0e4ea;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
}
.internal-due-chip:hover { background: #f5f7fa; border-color: #cfd5de; }

.internal-task-required-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: #9aa1ac;
}
#internalTaskFormStatus:empty { display: none; }
#internalTaskFormStatus { margin: 10px 0 0; font-size: 12px; color: #c93b3b; }

/* Rodape */
.internal-task-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f7f8fa;
  border-top: 1px solid #eef0f3;
}
.internal-task-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.internal-task-submit-check {
  width: 15px;
  height: 15px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

@media (max-width: 1100px) {
  .internal-tasks-grid { grid-template-columns: 1fr; }
}

/* Badge CPF/CNPJ ao lado do rotulo do documento no cadastro de cliente */
.doc-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.doc-kind-badge {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #e8f1fd;
  color: #2563eb;
}
.doc-kind-badge[data-kind="cpf"] { background: #e1f5ee; color: #0f6e56; }
.doc-kind-badge[data-kind="cnpj"] { background: #e8f1fd; color: #2563eb; }

/* Agenda compartilhada (modal de compromisso) */
.appointment-share-hint {
  margin: 8px 0 10px;
  font-size: 12px;
  color: #6b7280;
}
.appointment-share-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 12px;
  max-height: 190px;
  overflow-y: auto;
}
.appointment-share-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.appointment-share-item:hover { background: #f5f7fa; }
.appointment-share-item input { width: 16px; height: 16px; flex: 0 0 auto; }
.appointment-share-name { display: flex; flex-direction: column; line-height: 1.25; color: var(--text); min-width: 0; }
.appointment-share-name small { color: #9aa1ac; font-size: 11px; }
.appointment-share-empty { font-size: 13px; color: #9aa1ac; padding: 6px 2px; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 6px 3px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.user-menu:hover,
.user-menu.is-open {
  background: #f2f6fb;
}

.topbar-user-copy {
  min-width: 0;
}

.topbar-profile-menu {
  position: absolute;
  right: 94px;
  top: calc(100% + 10px);
  z-index: 150;
  width: min(324px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
}

.topbar-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #eef2f7;
}

.profile-menu-avatar {
  width: 52px;
  height: 52px;
  border: 2px solid #e6efff;
  box-shadow: 0 0 0 3px #f8fbff;
}

.topbar-profile-card strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: #101828;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile-card small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.profile-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #17c964;
}

.topbar-profile-actions {
  display: grid;
  padding: 6px 0;
}

.topbar-profile-actions button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 55px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #ffffff;
  color: #172033;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.topbar-profile-actions button:hover {
  background: #f8fafc;
}

.topbar-profile-actions button:nth-child(1),
.topbar-profile-actions button:nth-child(4),
.topbar-profile-actions button:nth-child(7) {
  margin-top: 6px;
}

.topbar-profile-actions button:last-child {
  border-bottom: 0;
  color: #ef4444;
}

.profile-menu-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #2563eb;
}

.profile-menu-icon::before,
.profile-menu-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.profile-menu-icon-pause {
  color: #f59e0b;
}

.profile-menu-icon-pause::before {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-pause::after {
  width: 7px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.profile-menu-icon-user::before {
  top: 3px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-user::after {
  bottom: 3px;
  width: 15px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.profile-menu-icon-shield {
  color: #6d5dfc;
}

.profile-menu-icon-shield::before {
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 10px 10px;
  clip-path: polygon(50% 0, 100% 20%, 88% 78%, 50% 100%, 12% 78%, 0 20%);
}

.profile-menu-icon-key {
  color: #16a34a;
}

.profile-menu-icon-key::before {
  left: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-key::after {
  left: 10px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 5px 4px 0 -1px currentColor;
}

.profile-menu-icon-support {
  color: #7c3aed;
}

.profile-menu-icon-support::before {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-menu-icon-support::after {
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 8px 0 0 -1px #ffffff, -8px 0 0 -1px #ffffff;
}

.profile-menu-icon-terms {
  color: #667085;
}

.profile-menu-icon-terms::before {
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.profile-menu-icon-terms::after {
  width: 7px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.profile-menu-icon-logout {
  color: #ef4444;
}

.profile-menu-icon-logout::before {
  left: 2px;
  width: 12px;
  height: 15px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
}

.profile-menu-icon-logout::after {
  right: 1px;
  width: 12px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -4px 0 -1px currentColor, 4px 4px 0 -1px currentColor;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.user-menu strong,
.user-menu small {
  display: block;
  text-align: right;
}

.user-menu strong {
  max-width: 180px;
  overflow: hidden;
  color: #101828;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu small {
  color: #667085;
  font-size: 11px;
  line-height: 1.15;
}

.avatar,
.mini-avatar,
.letter-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
}

.avatar {
  width: 38px;
  height: 38px;
  color: #fff;
  background: #237083;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen {
  display: none;
  padding: 44px 40px 64px;
}

.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 40px 0;
  padding: 16px 18px;
  border: 1px solid #f1c96b;
  border-radius: 8px;
  background: #fff7df;
}

.connection-panel[data-state="success"] {
  border-color: #91dfbd;
  background: #e9fff3;
}

.connection-panel strong,
.connection-panel p {
  margin: 0;
}

.connection-panel p {
  margin-top: 4px;
  color: #4b5563;
}

.admin-login-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-login-form input {
  width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.admin-login-form .primary-button,
.connection-panel > .secondary-button {
  min-height: 42px;
  padding: 0 18px;
  font-size: 15px;
}

.screen.is-visible {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.page-heading h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.page-heading p {
  margin: 8px 0 0;
  color: #2f3540;
  font-size: 20px;
}

.compact-heading {
  align-items: center;
  margin-bottom: 26px;
}

.heading-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: var(--radius-sm);
  font-size: 19px;
}

.primary-button {
  border: 1px solid #0149ad;
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

/* Acoes do POP: tres botoes na mesma linha sem quebrar o texto, com espacamento
   confortavel e quebra de linha graciosa em telas estreitas. */
.email-pop-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.email-pop-actions .primary-button,
.email-pop-actions .secondary-button {
  flex: 1 1 auto;
  min-height: 50px;
  padding: 0 20px;
  font-size: 16px;
  white-space: nowrap;
}

.email-pop-actions #savePopButton {
  flex: 1 1 140px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.metrics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2.3fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(280px, 2.3fr);
  gap: 30px;
  margin-bottom: 40px;
}

.status-card,
.compact-metric,
.latency-card {
  min-height: 264px;
  padding: 32px;
}

.status-card {
  position: relative;
  display: grid;
  align-content: space-between;
}

.eyebrow {
  display: block;
  color: #252b35;
  font-size: 20px;
  line-height: 1.4;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.success-ring {
  position: absolute;
  right: 30px;
  top: 30px;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--green-soft);
}

.success-ring::after {
  content: "\2713";
  position: absolute;
  inset: 9px;
  display: grid;
  place-items: center;
  border: 3px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-weight: 700;
}

.uptime-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.uptime-row small {
  color: #39404b;
  text-transform: uppercase;
}

.uptime-row span {
  color: var(--blue);
  font-family: Consolas, monospace;
  font-size: 22px;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #dce6f5;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.compact-metric {
  display: grid;
  align-content: center;
  gap: 20px;
}

.compact-metric strong,
.latency-card strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.compact-metric small,
.latency-card small {
  color: #404754;
  line-height: 1.5;
}

.positive {
  color: var(--green) !important;
}

.mini-lines {
  display: flex;
  gap: 6px;
}

.mini-lines span {
  width: 36px;
  height: 5px;
  border-radius: 20px;
  background: var(--blue);
}

.mini-lines span:last-child {
  background: #b7d3f7;
}

.latency-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 72px;
}

.bars span {
  width: 10px;
  border-radius: 3px 3px 0 0;
  background: #b9d7f4;
}

.bars span:nth-child(1) { height: 34px; }
.bars span:nth-child(2) { height: 48px; }
.bars span:nth-child(3) { height: 42px; }
.bars span:nth-child(4) { height: 64px; background: #357bd8; }
.bars span:nth-child(5) { height: 39px; }
.bars span:nth-child(6) { height: 44px; background: var(--blue); }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 386px;
  gap: 30px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
}

.card-header h2,
.right-stack h2,
.permissions-card h2,
.smtp-card h2,
.webhook-card h2,
.integrations-card h2,
.general-card h2,
.placeholder-card h2 {
  margin: 0;
  font-size: 23px;
}

.card-header a,
.ghost-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 18px;
  text-decoration: none;
}

.client-demands-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.client-demands-filter {
  border: 1px solid var(--primary-soft);
  background: #fff;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.client-demands-filter:hover {
  background: var(--primary-soft);
}

.client-demands-filter.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th {
  padding: 20px 30px;
  background: var(--panel-soft);
  color: #2c3340;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  padding: 28px 30px;
  border-top: 1px solid var(--line-soft);
  font-size: 18px;
  vertical-align: middle;
}

.activity-card td:first-child,
.activity-card td:nth-child(2),
.users-table td:first-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.row-icon {
  color: var(--blue);
}

.mini-avatar {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  color: #fff;
  background: #153b48;
  font-size: 9px;
}

.mini-avatar.muted {
  color: #111;
  background: #d9dee7;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pill.success {
  background: var(--green-soft);
  color: #00784e;
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.pill.neutral {
  background: #e5e8eb;
  color: #252b35;
}

.pill.admin {
  background: #d8e8ff;
  color: var(--blue);
}

.right-stack {
  display: grid;
  gap: 30px;
}

.insights-card,
.nodes-card {
  padding: 30px;
}

.timeline {
  display: grid;
  gap: 28px;
  margin: 28px 0 0;
  padding-left: 24px;
  border-left: 3px solid #d7dce5;
}

.timeline li {
  position: relative;
  padding-left: 4px;
  font-size: 18px;
}

.timeline li::marker {
  color: var(--blue);
}

.timeline small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.timeline .danger strong {
  color: var(--red);
}

.node-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}

.node-row div {
  flex: 1;
}

.node-row strong,
.node-row small {
  display: block;
}

.node-row small {
  margin-top: 4px;
  color: #2f3540;
}

.node-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #76d4b0;
}

.dashboard-calendar-card {
  margin-bottom: 28px;
  overflow: hidden;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr)) minmax(260px, 0.85fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 28px;
}

.dashboard-summary-card,
.dashboard-calendar-compact-card {
  min-height: 272px;
  overflow: hidden;
}

.dashboard-summary-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0;
  background: #ffffff;
}

.dashboard-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
}

.dashboard-summary-header h2 {
  margin: 0;
  color: #12213a;
  font-size: 17px;
}

.dashboard-summary-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 0 20px 14px;
}

.dashboard-summary-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f7;
}

.dashboard-summary-item:last-child {
  border-bottom: 0;
}

.dashboard-summary-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--blue);
  font-size: 10px;
}

.dashboard-summary-dot.contract {
  color: #f08d2f;
}

.dashboard-summary-dot.implementation {
  color: #08775a;
}

.dashboard-summary-dot.request {
  color: #0b66d8;
}

.dashboard-summary-copy {
  min-width: 0;
}

.dashboard-summary-copy strong,
.dashboard-summary-copy span,
.dashboard-summary-copy small {
  display: block;
}

.dashboard-summary-copy strong {
  overflow: hidden;
  color: #182233;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-copy span,
.dashboard-summary-copy small,
.dashboard-summary-meta {
  color: #5f6b7d;
  font-size: 12px;
}

.dashboard-summary-meta {
  text-align: right;
  white-space: nowrap;
}

.dashboard-summary-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-summary-progress span {
  width: 88px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf2;
}

.dashboard-summary-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.dashboard-summary-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-top: 1px solid #edf1f7;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-summary-footer::after {
  content: '?';
  margin-left: 8px;
  font-size: 18px;
}

.dashboard-summary-list .empty-state {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-calendar-compact-card {
  margin: 0;
  cursor: pointer;
}

.dashboard-charts-grid .dashboard-calendar-compact-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}

.dashboard-calendar-compact-card .dashboard-calendar-header {
  padding: 16px 16px 10px;
}

.dashboard-calendar-compact-card .dashboard-calendar-header h2 {
  font-size: 16px;
}

.dashboard-calendar-compact-card .dashboard-calendar-actions {
  gap: 5px;
}

.dashboard-calendar-compact-card .dashboard-calendar-actions .primary-button,
.dashboard-calendar-compact-card .dashboard-calendar-actions .secondary-button,
.dashboard-calendar-compact-card .dashboard-calendar-actions .icon-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.dashboard-calendar-compact-card .dashboard-calendar-weekdays span {
  padding: 7px 3px;
  font-size: 10px;
}

.dashboard-calendar-compact-card .calendar-day {
  min-height: 30px;
  padding: 4px;
}

.dashboard-calendar-compact-card .calendar-day strong {
  font-size: 11px;
}

.dashboard-calendar-compact-card .calendar-day.is-today > strong {
  width: 18px;
  height: 18px;
}

.dashboard-calendar-compact-card .calendar-day ul,
.dashboard-calendar-compact-card .calendar-day small {
  display: none;
}

.dashboard-calendar-compact-card .calendar-day.has-events::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--blue);
}

.dashboard-calendar-compact-card .dashboard-calendar-legend {
  justify-content: center;
  padding: 9px 12px;
  font-size: 11px;
}

.dashboard-calendar-full-card {
  display: none;
}

.dashboard-calendar-modal {
  place-items: center;
  padding: 12px;
  backdrop-filter: blur(8px);
}

.dashboard-calendar-modal-card {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 24px));
  height: min(820px, calc(100dvh - 24px));
  max-height: none;
  overflow: hidden;
  padding: 0;
}

.dashboard-calendar-modal-header {
  padding: 14px 24px 8px;
}

.dashboard-calendar-modal-header .eyebrow {
  font-size: 13px;
}

.dashboard-calendar-modal-header h2 {
  margin-top: 2px;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.05;
}

.dashboard-calendar-modal-header p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.25;
}

.dashboard-calendar-modal-actions {
  justify-content: flex-end;
  padding: 0 24px 8px;
}

.dashboard-calendar-modal .dashboard-calendar-weekdays,
.dashboard-calendar-modal .dashboard-calendar-grid {
  flex-shrink: 0;
  /* Respiro nas laterais para os dias/grade nao encostarem nas bordas do modal
     (mesma margem lateral dos filtros/legenda). Aplicado nos dois para as 7
     colunas continuarem alinhadas. */
  margin-left: 24px;
  margin-right: 24px;
}
.dashboard-calendar-modal .dashboard-calendar-grid {
  margin-bottom: 10px;
}

.dashboard-calendar-modal .dashboard-calendar-grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: repeat(6, minmax(0, 1fr));
}

.dashboard-calendar-modal .calendar-day {
  min-height: 0;
  padding: 6px 7px;
  overflow: hidden;
}

.dashboard-calendar-modal .calendar-day ul {
  gap: 3px;
  margin-top: 5px;
}

.dashboard-calendar-modal .calendar-event {
  min-height: 25px;
  padding: 4px 5px;
  font-size: 10px;
}

.dashboard-calendar-modal .calendar-day small {
  margin-top: 3px;
  font-size: 10px;
}

.dashboard-presentation-card {
  margin-bottom: 28px;
  overflow: hidden;
}

.dashboard-presentation-card .card-header {
  padding-bottom: 18px;
}

.dashboard-presentation-card h2 {
  margin: 5px 0 0;
}

.dashboard-presentation-table {
  min-width: 780px;
}

.dashboard-presentation-table td {
  padding-top: 18px;
  padding-bottom: 18px;
}

.dashboard-presentation-table td:first-child strong,
.dashboard-presentation-table td:first-child small {
  display: block;
}

.dashboard-presentation-table td:first-child small {
  margin-top: 4px;
  color: var(--muted);
}

#screen-dashboard > .metrics-grid,
#screen-dashboard > .dashboard-layout {
  display: none;
}

.dashboard-calendar-header,
.dashboard-calendar-actions,
.dashboard-calendar-filters,
.dashboard-calendar-legend {
  display: flex;
  align-items: center;
}

.dashboard-calendar-header {
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 14px;
}

.dashboard-calendar-header h2 {
  margin: 5px 0 0;
  text-transform: capitalize;
}

.dashboard-calendar-actions {
  gap: 8px;
}

.dashboard-calendar-actions .primary-button,
.dashboard-calendar-actions .secondary-button {
  min-height: 40px;
  padding: 0 15px;
  font-size: 15px;
}

.dashboard-calendar-filters {
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
}

.calendar-filter {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.calendar-filter.is-active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.calendar-filter-field {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-filter-field select,
.calendar-filter-field input {
  min-height: 35px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
}

.calendar-search-field {
  margin-left: auto;
}

.calendar-search-field input {
  width: min(240px, 100%);
}

.dashboard-calendar-weekdays,
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dashboard-calendar-weekdays {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.dashboard-calendar-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 126px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-outside {
  background: #f8fafc;
  color: #a3adba;
}

.calendar-day.is-today > strong {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}

.calendar-day ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.calendar-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  width: 100%;
  padding: 5px 6px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 3px solid currentColor;
  border-radius: 3px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.calendar-event.technical {
  color: #075eb5;
  background: #e8f2ff;
}

.calendar-event.commercial {
  color: #08775a;
  background: #e8f8f1;
}

.calendar-event.overdue {
  color: #b91c1c;
  background: #fee2e2;
}

.calendar-event.cancelled {
  opacity: 0.58;
  text-decoration: line-through;
}

.calendar-event time {
  font-weight: 700;
}

.calendar-event span {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-calendar-legend {
  justify-content: flex-end;
  gap: 18px;
  padding: 13px 24px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dashboard-calendar-legend .technical {
  background: #075eb5;
}

.dashboard-calendar-legend .commercial {
  background: #08775a;
}

.breadcrumb {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.breadcrumb span {
  color: #111;
  margin: 0 6px;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 306px)) 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.user-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.small-stat {
  min-height: 118px;
  padding: 24px;
}

.small-stat strong {
  display: block;
  margin: 10px 0;
  font-size: 26px;
}

.small-stat small {
  color: var(--muted);
}

.users-table-card {
  margin-bottom: 30px;
}

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
}

.tabs,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.tabs button,
.table-actions button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #111;
}

.tabs button.is-selected {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}

.letter-avatar {
  width: 34px;
  height: 34px;
  margin-right: 16px;
  border-radius: 12px;
}

.letter-avatar.blue {
  background: #dce5ff;
}

.letter-avatar.red {
  color: var(--red);
  background: #ffdcdc;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
}

.status-dot.active { background: #13b879; }
.status-dot.inactive { background: #aaaeb7; }
.status-dot.flagged { background: var(--red); }

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
  color: #313844;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
}

.pagination button.current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.permissions-card {
  margin-bottom: 30px;
}

.permissions-card h2 {
  padding: 22px 24px 0;
}

.permission-table-wrap {
  overflow-x: auto;
  padding-top: 18px;
}

.permission-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(150px, 1fr));
  min-width: 860px;
}

.permission-grid > * {
  min-height: 46px;
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
}

.permission-check-cell {
  display: grid;
  place-items: center;
}

.permission-grid input {
  justify-self: center;
  align-self: center;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.permission-head,
.permission-section {
  background: var(--panel-soft);
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.permission-section {
  grid-column: 1 / -1;
  min-height: 36px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.permissions-card .form-actions {
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
}

.utility-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dashed-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 230px;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.dashed-card h2,
.dashed-card p {
  margin: 0;
}

.dashed-card p {
  max-width: 440px;
  color: #404754;
}

.sales-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.sales-metric {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 230px;
  padding: 28px;
}

.sales-metric > .icon {
  position: absolute;
  right: 26px;
  top: 28px;
  color: var(--blue);
}

.sales-metric .eyebrow {
  max-width: 170px;
  font-size: 14px;
  font-weight: 700;
}

.sales-metric strong {
  font-size: 34px;
  line-height: 1.28;
}

.sales-metric small {
  color: var(--blue);
  font-size: 15px;
  line-height: 1.35;
}

.pipeline-card {
  margin-bottom: 32px;
  padding: 34px;
}

.pipeline-card h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 34px;
  font-size: 22px;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 134px;
}

.pipeline-step {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 22px 18px;
  color: #0c1625;
  text-align: center;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}

.pipeline-step:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.pipeline-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
}

.pipeline-step.muted { background: #e5e7ea; }
.pipeline-step.soft { background: #dce6ff; }
.pipeline-step.mid { background: #d0e0f4; }
.pipeline-step.active {
  background: var(--blue-2);
  color: #fff;
}

.pipeline-step small {
  color: inherit;
  font-size: 11px;
  text-transform: uppercase;
}

.pipeline-step strong {
  font-size: 28px;
  line-height: 1;
}

.pipeline-step span {
  font-size: 13px;
}

.proposal-clients-card {
  margin-bottom: 32px;
}

.proposal-clients-table {
  width: 100%;
  border-collapse: collapse;
}

.proposal-clients-table th,
.proposal-clients-table td {
  padding: 18px 22px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.proposal-clients-table th {
  background: var(--panel-soft);
  color: #273244;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.proposal-clients-table td strong,
.proposal-clients-table td small {
  display: block;
}

.proposal-clients-table td small {
  margin-top: 5px;
  color: var(--muted);
}

.proposal-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  max-width: 220px;
}

.proposal-row-actions .ghost-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.proposal-row-actions .danger-action {
  color: #dc2626;
}

.service-requests-panel,
.service-request-form-panel,
.service-request-detail-panel,
.conversations-panel {
  margin-bottom: 28px;
}

.screen.requests-chat-screen {
  height: calc(100dvh - 78px);
  min-height: 0;
  overflow: hidden;
  padding-block: 14px;
}

.screen.requests-chat-screen .conversations-panel {
  height: var(--conversation-panel-height, 100%);
  margin-bottom: 0;
}

.conversations-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  height: var(--conversation-panel-height, clamp(560px, calc(100dvh - 205px), 860px));
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  padding: 0;
  margin-bottom: 24px;
  background: #fff;
}

.conversations-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 22px;
  background: #eef2f7;
}

.conversation-panel-resize {
  position: absolute;
  left: 50%;
  bottom: -20px;
  z-index: 9;
  width: 140px;
  height: 18px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: ns-resize;
}

.conversation-panel-resize::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 7px;
  height: 3px;
  border-radius: 999px;
  background: rgba(100, 116, 139, .38);
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.conversation-panel-resize:hover,
.conversation-panel-resize:focus-visible {
  outline: none;
}

.conversation-panel-resize:hover::before,
.conversation-panel-resize:focus-visible::before {
  background: rgba(21, 91, 199, .68);
  box-shadow: 0 0 0 5px rgba(21, 91, 199, .08);
  transform: scaleX(1.12);
}

.conversations-panel.is-resizing {
  user-select: none;
}

.conversation-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 10px;
  border-right: 1px solid var(--line-soft);
  background: #f8fafc;
}

.conversation-search {
  position: relative;
}

.conversation-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.conversation-search .icon {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
}

.conversation-channel-tabs,
.conversation-filter-row {
  display: grid;
  gap: 5px;
  width: 100%;
}

.conversation-channel-tabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.conversation-filter-row {
  grid-template-columns: minmax(56px, .85fr) minmax(92px, 1.25fr) minmax(62px, .9fr) 34px 34px;
}

.conversation-channel-tabs button,
.conversation-filter,
.conversation-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 27px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #273244;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.conversation-channel-tabs button {
  width: 100%;
}

.conversation-channel-tabs button span {
  display: inline-grid;
  place-items: center;
  min-width: 12px;
  font-size: 12px;
  line-height: 1;
}

.conversation-channel-tabs button b,
.conversation-filter b {
  font-size: 10px;
  line-height: 1;
}

.conversation-tool {
  width: 34px;
  height: 27px;
  padding: 0;
  font-size: 13px;
}

.conversation-channel-tabs button.is-active,
.conversation-filter.is-active,
.conversation-tool.is-active {
  border-color: #8b5cf6;
  color: #6d28d9;
  background: #f3e8ff;
}

.conversation-channel-tabs .channel-facebook span { color: #1877f2; }
.conversation-channel-tabs .channel-instagram span { color: #c026d3; }
.conversation-channel-tabs .channel-telegram span { color: #229ed9; }
.conversation-channel-tabs .channel-web span { color: #0ea5e9; }
.conversation-channel-tabs .channel-dashboard span { color: #ef476f; }

.conversation-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 0 2px 84px 0;
}

.conversation-new-button {
  position: absolute;
  left: 24px;
  bottom: 20px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #b586ce;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(111, 70, 155, .28);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.conversation-new-button:hover {
  background: #9a6fbe;
  box-shadow: 0 18px 38px rgba(111, 70, 155, .36);
  transform: translateY(-2px);
}

.conversation-new-button span {
  display: block;
  width: 28px;
  height: 28px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5C4 4.12 5.12 3 6.5 3h11C18.88 3 20 4.12 20 5.5v8c0 1.38-1.12 2.5-2.5 2.5H9.2L4 21V5.5zM6.5 5C6.22 5 6 5.22 6 5.5v10.86L8.42 14H17.5c.28 0 .5-.22.5-.5v-8c0-.28-.22-.5-.5-.5h-11z'/%3E%3C/svg%3E") center / 28px 28px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5C4 4.12 5.12 3 6.5 3h11C18.88 3 20 4.12 20 5.5v8c0 1.38-1.12 2.5-2.5 2.5H9.2L4 21V5.5zM6.5 5C6.22 5 6 5.22 6 5.5v10.86L8.42 14H17.5c.28 0 .5-.22.5-.5v-8c0-.28-.22-.5-.5-.5h-11z'/%3E%3C/svg%3E") center / 28px 28px no-repeat;
}

.conversation-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.conversation-item.is-active,
.conversation-item:hover {
  border-color: #8b5cf6;
  box-shadow: 0 10px 24px rgba(109, 40, 217, .12);
}

.conversation-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-weight: 900;
}

.conversation-avatar img,
.client-contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conversation-item-body,
.conversation-item-body span {
  display: grid;
  min-width: 0;
}

.conversation-item-body > span:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.conversation-item-body strong,
.conversation-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item-body em,
.conversation-item-body small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.conversation-unread {
  position: absolute;
  right: 42px;
  bottom: 10px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: #7c3aed;
  font-size: 11px;
}

.conversation-archive-button {
  position: absolute;
  right: 9px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  opacity: .78;
  transition: background .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}

.conversation-archive-button::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 13h4'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 13h4'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.conversation-item:hover .conversation-archive-button,
.conversation-archive-button:focus-visible {
  opacity: 1;
}

.conversation-archive-button:hover,
.conversation-archive-button:focus-visible {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #2563eb;
}

.conversation-status-badge {
  width: fit-content;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #155bc7;
  background: #dbeafe;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.conversation-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 5px;
}

.conversation-badge-row .conversation-status-badge,
.conversation-badge-row .conversation-department-badge {
  margin-top: 0;
}

.conversation-department-badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.conversation-status-badge.active {
  color: #5b21b6;
  background: #ede9fe;
}

.conversation-status-badge.automated {
  color: #075985;
  background: #e0f2fe;
}

.conversation-status-badge.waiting {
  color: #b45309;
  background: #fef3c7;
}

.conversation-status-badge.resolved {
  color: #047857;
  background: #dcfce7;
}

.conversation-list-empty,
.conversation-empty-state {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: 420px;
  color: var(--muted);
  text-align: center;
}

.conversation-list-empty strong,
.conversation-empty-state h2 {
  margin: 0;
  color: var(--ink);
}

.conversation-empty-bubble,
.conversation-empty-icon {
  position: relative;
  width: 74px;
  height: 54px;
  border-radius: 50%;
  background: #8b5cf6;
  opacity: .86;
}

.conversation-empty-bubble::after,
.conversation-empty-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: -9px;
  width: 22px;
  height: 18px;
  border-radius: 0 0 0 18px;
  background: inherit;
  transform: rotate(-18deg);
}

.conversation-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  background: #eef2f7;
}

.conversation-chat {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.conversation-chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.conversation-chat-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.conversation-chat-header strong,
.conversation-chat-header span {
  display: block;
}

.conversation-header-avatar {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  overflow: hidden;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-weight: 900;
}

.conversation-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conversation-chat-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.conversation-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.conversation-action-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-color: #cfe0f6;
  color: #155bc7;
  background: #ffffff;
}

.conversation-action-icon:hover {
  border-color: #155bc7;
  background: #edf5ff;
}

.conversation-action-primary {
  border-color: #155bc7;
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 12px 26px rgba(37, 99, 235, .24);
}

.conversation-action-primary:hover {
  color: #ffffff;
  background: #1d4ed8;
}

.conversation-action-icon .icon {
  width: 24px;
  height: 24px;
  background: currentColor;
}

.conversation-action-icon .satisfaction-mark-icon {
  color: #f59e0b;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2a9 9 0 1 0 9 9h-2a7 7 0 1 1-7-7V2zm7 1h2v3h3v2h-3v3h-2V8h-3V6h3V3zM7.8 9.2a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zm6.4 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zM6.8 12.8h8.4a4.5 4.5 0 0 1-8.4 0z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 2a9 9 0 1 0 9 9h-2a7 7 0 1 1-7-7V2zm7 1h2v3h3v2h-3v3h-2V8h-3V6h3V3zM7.8 9.2a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zm6.4 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4zM6.8 12.8h8.4a4.5 4.5 0 0 1-8.4 0z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.conversation-action-icon .create-request-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7V4zm6.5 1.5h4v2h-4v-2zm0 4h4v2h-4v-2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7V4zm6.5 1.5h4v2h-4v-2zm0 4h4v2h-4v-2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.conversation-action-icon .link-client-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 14a4.5 4.5 0 1 1 3.18-7.68l1.06 1.06-1.42 1.42-1.06-1.06A2.5 2.5 0 1 0 7.5 12h3v2h-3zm6-4h3a4.5 4.5 0 1 1-3.18 7.68l-1.06-1.06 1.42-1.42 1.06 1.06A2.5 2.5 0 1 0 16.5 12h-3v-2zM8 11h8v2H8v-2z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 14a4.5 4.5 0 1 1 3.18-7.68l1.06 1.06-1.42 1.42-1.06-1.06A2.5 2.5 0 1 0 7.5 12h3v2h-3zm6-4h3a4.5 4.5 0 1 1-3.18 7.68l-1.06-1.06 1.42-1.42 1.06 1.06A2.5 2.5 0 1 0 16.5 12h-3v-2zM8 11h8v2H8v-2z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
}

.conversation-action-icon .transfer-attendance-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h9.2l-2.6-2.6L15 3l5 5-5 5-1.4-1.4L16.2 9H7V7zm10 10H7.8l2.6 2.6L9 21l-5-5 5-5 1.4 1.4L7.8 15H17v2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h9.2l-2.6-2.6L15 3l5 5-5 5-1.4-1.4L16.2 9H7V7zm10 10H7.8l2.6 2.6L9 21l-5-5 5-5 1.4 1.4L7.8 15H17v2z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.conversation-action-icon .start-attendance-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7L8 5z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7L8 5z'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.conversation-action-icon .finish-attendance-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.2 16.6-4.1-4.1L3.7 14l5.5 5.5L20.7 8 19.3 6.6 9.2 16.6z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.2 16.6-4.1-4.1L3.7 14l5.5 5.5L20.7 8 19.3 6.6 9.2 16.6z'/%3E%3C/svg%3E") center / 21px 21px no-repeat;
}

.conversation-satisfaction-panel {
  position: absolute;
  top: 62px;
  right: 18px;
  z-index: 5;
  width: min(390px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .18);
}

.conversation-satisfaction-panel[hidden] {
  display: none;
}

.conversation-transfer-panel {
  position: absolute;
  top: 62px;
  right: 18px;
  z-index: 6;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(15, 23, 42, .18);
}

.conversation-transfer-panel[hidden] {
  display: none;
}

.conversation-transfer-header,
.conversation-transfer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-transfer-header strong {
  font-size: 14px;
}

.conversation-transfer-header .icon-button {
  width: 30px;
  height: 30px;
}

.conversation-transfer-panel label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 12px;
  font-weight: 900;
}

.conversation-transfer-panel select {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.conversation-transfer-status {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.conversation-transfer-status.is-error {
  color: #b91c1c;
}

.conversation-transfer-status.is-success {
  color: #15803d;
}

.conversation-transfer-actions {
  justify-content: flex-end;
}

.conversation-transfer-actions button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.conversation-link-modal {
  z-index: 260;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
}

.conversation-link-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 32px));
  max-height: none;
  overflow: visible;
  padding: 28px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.conversation-link-card h2,
.conversation-link-card p {
  margin: 0;
}

.conversation-link-card h2 {
  color: #142039;
  font-size: 28px;
  line-height: 1.1;
}

.conversation-link-card p {
  color: var(--muted);
}

.conversation-link-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.conversation-link-card label {
  position: relative;
  display: grid;
  gap: 8px;
  color: #142039;
  font-weight: 900;
}

.conversation-link-card input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.conversation-linked-client {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.conversation-linked-client small {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.conversation-linked-client strong {
  color: #142039;
  font-size: 16px;
  line-height: 1.25;
}

.conversation-link-card .client-search-results {
  position: static;
  z-index: auto;
  max-height: none;
  overflow: visible;
  margin-top: -4px;
  box-shadow: none;
}

.conversation-link-card .client-search-results button {
  border-radius: 10px;
}

.conversation-link-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.conversation-link-status.is-error {
  color: #b91c1c;
}

.conversation-link-status.is-success {
  color: #15803d;
}

.conversation-link-submit {
  justify-self: stretch;
  min-height: 50px;
  border-color: #16a34a;
  background: #16a34a;
  color: #ffffff;
}

.conversation-link-submit:hover {
  border-color: #15803d;
  background: #15803d;
}

.service-request-link-client-backdrop {
  z-index: 270;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(9px);
}

.service-request-link-client-card {
  width: min(640px, calc(100vw - 32px));
  max-height: min(88vh, 620px);
  overflow: visible;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.service-request-link-client-card .modal-header {
  align-items: flex-start;
  gap: 18px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.service-request-link-client-card .modal-header > div {
  display: grid;
  gap: 6px;
}

.service-request-link-client-card .eyebrow {
  color: #64748b;
  font-size: 13px;
  letter-spacing: .08em;
}

.service-request-link-client-card h2,
.service-request-link-client-card p {
  margin: 0;
}

.service-request-link-client-card h2 {
  color: #142039;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
}

.service-request-link-client-card .modal-header p {
  max-width: 52ch;
  color: #64748b;
  font-size: 15px;
  line-height: 1.35;
}

.service-request-link-client-card .icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 28px;
}

#serviceRequestLinkClientForm {
  display: grid;
  gap: 14px;
  padding: 22px 28px 28px;
}

.service-request-link-field {
  position: relative;
  display: grid;
  gap: 8px;
  color: #142039;
  font-size: 14px;
  font-weight: 900;
}

.service-request-link-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  background: #ffffff;
  color: #142039;
  font: inherit;
  font-weight: 700;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.service-request-link-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.service-request-link-client-results {
  position: static;
  max-height: 190px;
  overflow: auto;
  border-radius: 12px;
  box-shadow: none;
}

.service-request-link-client-results button {
  padding: 12px 14px;
  border-radius: 0;
}

#serviceRequestLinkClientStatus {
  min-height: 20px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e6;
  color: #b45309;
  font-size: 14px;
  font-weight: 800;
}

#serviceRequestLinkClientStatus:empty {
  display: none;
}

#serviceRequestLinkClientStatus.is-success,
#serviceRequestLinkClientStatus.success,
#serviceRequestLinkClientStatus[data-state="success"] {
  background: #ecfdf5;
  color: #047857;
}

#serviceRequestLinkClientStatus.is-error,
#serviceRequestLinkClientStatus.error,
#serviceRequestLinkClientStatus[data-state="error"] {
  background: #fef2f2;
  color: #b91c1c;
}

#confirmServiceRequestLinkClientButton {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 900;
}

.conversation-satisfaction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.conversation-satisfaction-header strong {
  font-size: 14px;
}

.conversation-satisfaction-header .icon-button {
  width: 30px;
  height: 30px;
}

.conversation-satisfaction-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.conversation-satisfaction-options button {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.conversation-satisfaction-options button:hover,
.conversation-satisfaction-options button.is-selected {
  border-color: #8b5cf6;
  background: #f8f5ff;
}

.conversation-satisfaction-options button:nth-child(1) { color: #16a34a; }
.conversation-satisfaction-options button:nth-child(2) { color: #65a30d; }
.conversation-satisfaction-options button:nth-child(3) { color: #ca8a04; }
.conversation-satisfaction-options button:nth-child(4) { color: #ea580c; }
.conversation-satisfaction-options button:nth-child(5) { color: #dc2626; }

.satisfaction-face {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fbbf24;
}

.satisfaction-face::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: 8px 0 0 #1f2937;
}

.satisfaction-face::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 15px;
  width: 12px;
  height: 5px;
  border: 2px solid #1f2937;
  border-top: 0;
  border-radius: 0 0 14px 14px;
}

.satisfaction-face.neutral::after {
  top: 17px;
  height: 2px;
  border: 0;
  border-radius: 2px;
  background: #1f2937;
}

.satisfaction-face.sad::after,
.satisfaction-face.very-sad::after {
  top: 17px;
  border: 2px solid #1f2937;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}

.satisfaction-face.very-sad {
  background: #f87171;
}

.conversation-satisfaction-panel textarea {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.conversation-satisfaction-panel p {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.conversation-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 22px;
}

.conversation-message {
  width: fit-content;
  max-width: min(640px, 78%);
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.conversation-message.outgoing {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #e8f1ff;
}

.conversation-message p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
  white-space: pre-line;
}

.conversation-media {
  display: grid;
  gap: 8px;
  margin: 0;
}

.conversation-media img,
.conversation-media video {
  display: block;
  max-width: min(360px, 72vw);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
  background: #0f172a;
}

.conversation-media-image a {
  cursor: zoom-in;
}

.conversation-media audio {
  width: min(320px, 68vw);
}

.conversation-media figcaption p,
.conversation-media p,
.conversation-media-file p {
  margin-top: 4px;
}

.conversation-media-file a {
  color: #155bc7;
  font-weight: 800;
}

.conversation-media-error {
  display: none;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
  line-height: 1.35;
  font-weight: 800;
}

.conversation-media-placeholder {
  min-width: 220px;
  max-width: 260px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px dashed #93c5fd;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
  line-height: 1.35;
  font-weight: 800;
}

.conversation-media.is-media-error a {
  display: none;
}

.conversation-media.is-media-error .conversation-media-error {
  display: block;
}

.conversation-message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

/* Status de envio da mensagem (otimista): enviando / falha-reenviar. */
.conversation-message.is-sending { opacity: 0.7; }
.conversation-message-status {
  display: inline;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
}
.conversation-message-status.is-sending { color: var(--muted); font-style: italic; }
.conversation-message-status.is-error {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  color: #b42318;
  text-decoration: underline;
}
.conversation-message-status.is-error:hover { color: #8a1b12; }

.conversation-composer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.conversation-send-status { grid-column: 1 / -1; }

.conversation-composer input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
}

.conversation-attach-button {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 42px;
  padding: 0;
  cursor: pointer;
}

.conversation-attach-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.conversation-attach-button span {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

/* Menu de anexos do botão "+": Foto / Vídeo / Áudio */
.conversation-attach-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.conversation-attach-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  padding: 8px;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.conversation-attach-menu[hidden] { display: none; }

.conversation-attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.conversation-attach-item:hover { background: #f1f5f9; }

.conversation-attach-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.conversation-attach-ico.is-photo {
  background-color: #ede9fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='m21 17-5-5L5 21'/%3E%3C/svg%3E");
}

.conversation-attach-ico.is-video {
  background-color: #e0f2fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='13' height='12' rx='2'/%3E%3Cpath d='m22 8-6 4 6 4V8Z'/%3E%3C/svg%3E");
}

.conversation-attach-ico.is-audio {
  background-color: #fee2e2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E");
}

/* Barra de progresso do upload de mídia (áudio/vídeo enviando) */
.conversation-media-progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.conversation-media-progress::after {
  content: attr(data-progress-label);
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.conversation-media-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #2563eb;
  transition: width 0.15s ease;
}

/* Player de áudio inline (recebido/enviado) */
.wa-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: min(340px, 72vw);
  padding: 8px 12px;
  border-radius: 12px;
  background: #eef2f7;
}

.wa-audio .wa-audio-el { display: none; }

.wa-audio-toggle {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.wa-audio-toggle .wa-audio-ico {
  width: 0;
  height: 0;
  border-left: 12px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 3px;
}

.wa-audio.is-playing .wa-audio-toggle .wa-audio-ico {
  width: 12px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-left: 4px solid #fff;
  border-right: 4px solid #fff;
}

.wa-audio-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.wa-audio-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  cursor: pointer;
}

.wa-audio-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #2563eb;
}

.wa-audio-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Vídeo: miniatura com duração + botão de play */
.wa-video-frame {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.wa-video-frame .wa-video-el {
  display: block;
  max-width: min(360px, 72vw);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
  background: #0f172a;
}

.wa-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.wa-video-play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 18px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 4px;
}

.wa-video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.wa-video-duration:empty { display: none; }

.wa-video.is-playing .wa-video-play,
.wa-video.is-playing .wa-video-duration { display: none; }

/* Botão de microfone (gravação de voz) */
.conversation-mic-button {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.conversation-mic-button:hover { background: #f1f5f9; }

.conversation-mic-ico {
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2M12 19v3'/%3E%3C/svg%3E");
}

/* Barra de gravação em andamento (overlay do composer) */
.conversation-recording-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  z-index: 5;
}

.conversation-recording-bar[hidden] { display: none; }

.conversation-recording-cancel {
  flex: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E");
}

.conversation-recording-cancel:hover { background-color: #fecaca; }

.conversation-recording-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dc2626;
  animation: recordingPulse 1s ease-in-out infinite;
}

@keyframes recordingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.conversation-recording-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text, #0f172a);
  min-width: 44px;
}

.conversation-recording-hint {
  flex: 1;
  color: var(--muted);
  font-weight: 600;
}

.conversation-recording-send { flex: none; }

/* ---- Janela flutuante: menu de anexos, microfone e barra de gravação ---- */
.floating-whatsapp-attach-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.floating-whatsapp-composer .floating-attach-toggle {
  width: 44px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-composer .floating-attach-toggle:hover { background: #eaf2ff; }

.floating-whatsapp-composer .floating-whatsapp-mic {
  width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.floating-whatsapp-composer .floating-whatsapp-mic:hover { background: #f1f5f9; }

.floating-attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.floating-attach-menu[hidden] { display: none; }

.floating-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.floating-attach-item:hover { background: #f1f5f9; }
.floating-attach-item input { display: none; }

.floating-whatsapp-recording-bar {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
}

.floating-whatsapp-composer .floating-recording-cancel {
  flex: none;
  width: 40px;
  min-height: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E");
}

.floating-whatsapp-composer .floating-recording-cancel:hover { background-color: #fecaca; }

.floating-whatsapp-composer .floating-recording-send {
  flex: none;
  width: auto;
  min-width: 76px;
  padding: 0 16px;
}

.conversation-send-status {
  grid-column: 2 / 4;
  min-height: 16px;
  margin: -4px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.conversation-send-status:empty {
  display: none;
}

.conversation-send-status.is-loading {
  color: #2563eb;
}

.conversation-send-status.is-success {
  color: #15803d;
}

.conversation-send-status.is-error {
  color: #b91c1c;
}

.floating-image-preview {
  position: fixed;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 260px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  resize: both;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .32);
}

.floating-image-preview.is-dragging {
  user-select: none;
}

.floating-image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .3);
  background: #fff;
  color: var(--ink);
  cursor: grab;
}

.floating-image-preview-header:active {
  cursor: grabbing;
}

.floating-image-preview-header strong,
.floating-image-preview-header span {
  display: block;
  max-width: min(520px, 68vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-image-preview-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.close-floating-image-preview {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.close-floating-image-preview:hover {
  background: #eef4ff;
  color: var(--blue);
}

.floating-image-preview-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-image-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #eef2f9;
}

.floating-image-zoom-controls button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.floating-image-zoom-controls button:hover {
  background: #fff;
  color: var(--blue);
}

.floating-image-zoom-value {
  min-width: 52px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  user-select: none;
}

.floating-image-preview-body {
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}

.floating-image-preview-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #0f172a;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
}

.floating-whatsapp-dock {
  position: fixed;
  left: calc(var(--sidebar-collapsed-width, 84px) + 24px);
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
  overflow-x: auto;
  padding-top: 8px;
  transition: left 220ms ease;
  pointer-events: none;
}

.sidebar:hover ~ .floating-whatsapp-dock {
  left: calc(var(--sidebar-expanded-width, 300px) + 24px);
}

.floating-whatsapp-dock[hidden] {
  display: none;
}

.floating-whatsapp-window {
  flex: 0 0 auto;
  width: min(560px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 58px));
  height: min(620px, calc(100vh - var(--topbar-height, 58px) - 108px));
  min-width: min(420px, calc(100vw - 36px));
  min-height: 360px;
  max-width: calc(100vw - var(--sidebar-collapsed-width, 84px) - 58px);
  max-height: calc(100vh - var(--topbar-height, 58px) - 108px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  resize: both;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  pointer-events: auto;
  container-type: inline-size;
}

.floating-whatsapp-window.is-minimized {
  flex-basis: min(360px, calc(100vw - 36px));
  width: min(360px, calc(100vw - 36px));
  height: 76px;
  min-height: 76px;
  resize: none;
}

.floating-whatsapp-window.is-positioned {
  position: fixed;
  right: auto;
  bottom: auto;
  z-index: 120;
}

.floating-whatsapp-window.is-dragging {
  opacity: .96;
  cursor: grabbing;
  user-select: none;
}

.floating-whatsapp-window.is-minimized.has-new-message {
  animation: floating-whatsapp-new-message 0.8s steps(2, end) infinite;
}

.floating-whatsapp-window.is-minimized.has-new-message .floating-whatsapp-header {
  animation: floating-whatsapp-new-message-header 0.8s steps(2, end) infinite;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-body {
  display: none;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-details {
  display: none;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-summary {
  display: none;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-actions {
  display: none;
}

/* Header minimizado: nome ocupa o espaco e os controles (- [] x) ficam alinhados
   e organizados a direita, sem colunas vazias. */
.floating-whatsapp-window.is-minimized .floating-whatsapp-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-control {
  flex: 0 0 auto;
}

@keyframes floating-whatsapp-new-message {
  0%,
  100% {
    border-color: var(--line-soft);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
  }
  50% {
    border-color: #2563eb;
    box-shadow:
      0 0 0 4px rgba(37, 99, 235, .38),
      0 18px 45px rgba(37, 99, 235, .42);
  }
}

@keyframes floating-whatsapp-new-message-header {
  0%,
  100% {
    background: #fff;
  }
  50% {
    background: #dbeafe;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-whatsapp-window.is-minimized.has-new-message {
    animation: none;
    border-color: #2563eb;
    box-shadow:
      0 0 0 3px rgba(37, 99, 235, .22),
      0 18px 45px rgba(37, 99, 235, .28);
  }

  .floating-whatsapp-window.is-minimized.has-new-message .floating-whatsapp-header {
    animation: none;
    background: #dbeafe;
  }
}

.floating-whatsapp-header {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 170px) auto auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  cursor: grab;
}

.floating-whatsapp-header:active {
  cursor: grabbing;
}

.floating-whatsapp-header button {
  cursor: pointer;
}

.floating-whatsapp-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.floating-whatsapp-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
  font-weight: 900;
}

.floating-whatsapp-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.floating-whatsapp-title strong,
.floating-whatsapp-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-title strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.floating-whatsapp-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.floating-whatsapp-heading .floating-whatsapp-title small + small {
  display: none;
}

.floating-whatsapp-header > .floating-whatsapp-status {
  display: none;
}

.floating-whatsapp-summary {
  min-width: 0;
  max-width: 170px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
  color: #475569;
}

.floating-whatsapp-summary div {
  min-width: 0;
  max-width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
}

.floating-whatsapp-summary .conversation-status-badge,
.floating-whatsapp-summary .conversation-department-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  height: 24px;
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  line-height: 1;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-summary small {
  max-width: 260px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.floating-whatsapp-actions .conversation-action-icon {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 8px;
}

.floating-whatsapp-actions .conversation-action-icon .icon {
  width: 21px;
  height: 21px;
}

@container (max-width: 760px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(230px, 1fr) minmax(0, 130px) auto auto auto auto;
    gap: 8px;
  }

  .floating-whatsapp-summary {
    justify-content: flex-end;
  }

  .floating-whatsapp-heading {
    gap: 10px;
  }

  .floating-whatsapp-title strong {
    font-size: 16px;
  }
}

@container (max-width: 680px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(220px, 1fr) minmax(0, 98px) auto auto auto auto;
    gap: 6px;
  }

  .floating-whatsapp-summary .conversation-status-badge {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .floating-whatsapp-actions {
    gap: 4px;
  }

  .floating-whatsapp-actions .conversation-action-icon {
    width: 31px;
    height: 31px;
    min-height: 31px;
  }

  .floating-whatsapp-control {
    width: 26px;
    height: 28px;
  }
}

@container (max-width: 590px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(210px, 1fr) minmax(0, 70px) auto auto auto auto;
  }

  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 58px;
  }

  .floating-whatsapp-summary .conversation-status-badge {
    max-width: 64px;
  }
}

@container (max-width: 520px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(200px, 1fr) minmax(0, 48px) auto auto auto auto;
  }

  .floating-whatsapp-summary .conversation-status-badge,
  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 44px;
  }

  .floating-whatsapp-actions .conversation-action-icon {
    width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .floating-whatsapp-actions .conversation-action-icon .icon {
    width: 18px;
    height: 18px;
  }
}

@container (max-width: 455px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(190px, 1fr) minmax(0, 34px) minmax(0, 90px) auto auto auto;
    gap: 4px;
    padding-inline: 10px;
  }

  .floating-whatsapp-actions {
    gap: 2px;
    overflow: hidden;
  }

  .floating-whatsapp-summary .conversation-status-badge,
  .floating-whatsapp-summary .conversation-department-badge {
    max-width: 36px;
  }

  .floating-whatsapp-actions .conversation-action-icon {
    width: 25px;
    height: 25px;
    min-height: 25px;
  }

  .floating-whatsapp-control {
    width: 24px;
    height: 26px;
  }
}

.floating-whatsapp-details .floating-whatsapp-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-whatsapp-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.4fr .9fr 1fr;
  gap: 8px;
}

.floating-whatsapp-details span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.floating-whatsapp-details small {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.floating-whatsapp-details strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Faixa de etiquetas (tags) na janela flutuante ===== */
.floating-whatsapp-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.floating-whatsapp-window.is-minimized .floating-whatsapp-tags {
  display: none;
}

/* O container de chips usa display:contents para que chips e botao "+ Tag"
   fluam e quebrem juntos na mesma faixa (flex-wrap). */
.floating-tags-chips {
  display: contents;
}

.floating-tags-icon {
  flex: none;
  width: 15px;
  height: 15px;
  background-color: #94a3b8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.floating-tag-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: .65;
}

.floating-tag-chip-remove:hover {
  opacity: 1;
  background: rgba(15, 23, 42, .1);
}

.floating-tag-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px dashed #93c5fd;
  border-radius: 999px;
  background: transparent;
  color: var(--blue, #2563eb);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.floating-tag-add-btn:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

/* ===== Seletor de etiquetas (popover) ===== */
.floating-tag-popover {
  position: fixed;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  max-height: 340px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  overflow: hidden;
}

.floating-tag-search {
  padding: 10px;
  border-bottom: 1px solid #eef2f7;
}

.floating-tag-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}

.floating-tag-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  overflow-y: auto;
}

.floating-tag-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
}

.floating-tag-row:hover {
  background: #f1f5f9;
}

.floating-tag-row.is-applied {
  background: #f0fdf4;
}

.floating-tag-option {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.floating-tag-edit {
  flex: none;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background-color: transparent;
  cursor: pointer;
  opacity: .55;
  -webkit-mask: none;
}

.floating-tag-edit::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: #475569;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

.floating-tag-edit:hover {
  opacity: 1;
  background-color: #e2e8f0;
}

.floating-tag-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.floating-tag-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-tag-check {
  flex: none;
  width: 16px;
  height: 16px;
  background-color: #16a34a;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-tag-empty {
  padding: 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.floating-tag-create {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #eef2f7;
}

.floating-tag-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.floating-tag-color {
  flex: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.floating-tag-color.is-selected {
  border-color: #0f172a;
  box-shadow: inset 0 0 0 2px #fff;
}

.floating-tag-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #eef2f7;
}

.floating-tag-edit-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.floating-tag-edit-label input {
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
}

.floating-tag-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.floating-tag-cancel-btn,
.floating-tag-save-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.floating-tag-cancel-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
}

.floating-tag-cancel-btn:hover {
  background: #f1f5f9;
}

.floating-tag-save-btn {
  border: 0;
  background: var(--blue, #2563eb);
  color: #fff;
}

.floating-tag-save-btn:hover {
  filter: brightness(.95);
}

.floating-tag-save-btn:disabled {
  opacity: .6;
  cursor: default;
}

.floating-tag-create-btn {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--blue, #2563eb);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.floating-tag-create-btn:hover {
  background: #dbeafe;
}

.floating-tag-create-btn:disabled {
  opacity: .6;
  cursor: default;
}

.floating-tag-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4100;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #b91c1c;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.floating-tag-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.floating-whatsapp-control {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-control:hover {
  background: #eef4ff;
  color: var(--blue);
}

.floating-whatsapp-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #f3f7fb;
}

.floating-whatsapp-avatar,
.floating-whatsapp-avatar .conversation-avatar-fallback {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-size: 12px;
  font-weight: 900;
}

.floating-instagram-avatar {
  background: linear-gradient(135deg, #f97316 0%, #db2777 46%, #7c3aed 100%);
  color: #fff;
}

.floating-whatsapp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-whatsapp-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 18px;
}

.floating-whatsapp-message {
  width: fit-content;
  max-width: 82%;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, .05);
}

.floating-whatsapp-message.is-outgoing {
  align-self: flex-end;
  border-color: #bbf7d0;
  background: #dcfce7;
}

.floating-whatsapp-message p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.floating-whatsapp-message small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.floating-whatsapp-message .conversation-media img,
.floating-whatsapp-message .conversation-media video {
  max-width: 240px;
  max-height: 150px;
}

.floating-whatsapp-message .conversation-media audio {
  width: min(230px, 62vw);
}

.floating-whatsapp-empty {
  margin: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.floating-whatsapp-empty.is-error {
  color: #b91c1c;
}

.floating-whatsapp-composer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.floating-whatsapp-readonly {
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

/* Monitor (wallboard): coluna de acoes vazia mostra so um traco discreto. */
.service-request-readonly-dash {
  color: #94a3b8;
  font-weight: 700;
}

/* Aviso quando falta vincular cliente para conversar (WhatsApp). */
.floating-whatsapp-needs-client {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--line-soft);
  background: #fff8ef;
  text-align: center;
}

.floating-whatsapp-needs-client p {
  margin: 0;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.floating-whatsapp-needs-client-icon {
  width: 26px;
  height: 26px;
  background-color: #d97706;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cline x1='19' y1='8' x2='19' y2='14'/%3E%3Cline x1='22' y1='11' x2='16' y2='11'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cline x1='19' y1='8' x2='19' y2='14'/%3E%3Cline x1='22' y1='11' x2='16' y2='11'/%3E%3C/svg%3E") center / contain no-repeat;
}

.floating-whatsapp-link-client-cta {
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--blue, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.floating-whatsapp-link-client-cta:hover {
  filter: brightness(.96);
}

.floating-whatsapp-attach {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-attach:hover {
  background: #eaf2ff;
}

.floating-whatsapp-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.floating-whatsapp-composer input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
}

.floating-whatsapp-composer button {
  width: 48px;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.floating-whatsapp-composer button:disabled {
  opacity: .65;
  cursor: wait;
}

.floating-whatsapp-send-status {
  grid-column: 1 / -1;
  margin: -2px 2px 0;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
}

.floating-whatsapp-send-status:empty {
  display: none;
}

@media (max-width: 900px) {
  .floating-whatsapp-dock {
    left: 10px;
    right: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar:hover ~ .floating-whatsapp-dock {
    left: 10px;
  }

  .floating-whatsapp-window {
    flex: 0 0 auto;
    width: min(520px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 90px));
    min-width: min(360px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 90px);
  }

  .floating-whatsapp-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .floating-whatsapp-header {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    padding: 10px;
  }

  .floating-whatsapp-title strong {
    font-size: 14px;
  }

  .floating-whatsapp-details {
    grid-template-columns: 1fr;
  }

  .floating-whatsapp-window {
    width: calc(100vw - 20px);
    min-width: calc(100vw - 20px);
    resize: vertical;
  }
}

.whatsapp-history-card {
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.whatsapp-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.whatsapp-history-summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.whatsapp-history-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.whatsapp-history-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatsapp-history-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px 20px;
  background: #edf2f8;
}

.whatsapp-history-message {
  width: fit-content;
  max-width: min(620px, 78%);
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.whatsapp-history-message.is-outgoing {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #e8f1ff;
}

.whatsapp-history-message p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.whatsapp-history-message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.service-request-modal-open {
  overflow: hidden;
}

.service-request-form-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1790;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(10px);
}

.service-request-form-panel:not([hidden]) {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1800;
  width: min(980px, calc(100vw - 44px));
  max-height: calc(100vh - 44px);
  margin: 0;
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.service-request-form-panel .card-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.service-request-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.service-request-metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

/* Acento semântico por situação (cor = estado; ícone da marca fica nos canais) */
.service-request-metric-card[data-request-quick-filter="new"] {
  border-left: 3px solid #94a3b8;
}

.service-request-metric-card[data-request-quick-filter="in_service"],
.service-request-metric-card[data-request-quick-filter="instagram_service"] {
  border-left: 3px solid #2563eb;
}

.service-request-metric-card[data-request-quick-filter="waiting_customer"] {
  border-left: 3px solid #d97706;
}

.service-request-metric-card[data-request-quick-filter="support"] {
  border-left: 3px solid #1faf5e;
}

.service-request-metric-card[data-request-quick-filter="whatsapp_queue"],
.service-request-metric-card[data-request-quick-filter="instagram_queue"] {
  border-left: 3px solid #94a3b8;
}

/* Cards de canal consolidados (WhatsApp / Instagram / Web Chat). */
.service-request-metric-card[data-request-quick-filter="whatsapp"] {
  border-left: 3px solid #1faf5e;
}
.service-request-metric-card[data-request-quick-filter="instagram"] {
  border-left: 3px solid #d6249f;
}
.service-request-metric-card[data-request-quick-filter="web_chat"] {
  border-left: 3px solid #2c58e8;
}

.service-request-metric-card:hover,
.service-request-metric-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(13, 99, 212, .13);
  transform: translateY(-1px);
}

.service-request-metric-card.is-active::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: inset 0 0 0 4px #fff;
}

.service-request-metric-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1.2;
}

.service-request-metric-card b {
  display: block;
  font-size: 23px;
  line-height: 1;
}

.service-request-metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.metric-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eaf2ff;
}

.metric-icon::before,
.metric-icon::after {
  content: "";
  position: absolute;
  border-color: currentColor;
}

.support-icon {
  color: #7c3aed;
  background: #f2e9ff;
}

.support-icon::before {
  width: 9px;
  height: 9px;
  left: 13px;
  top: 12px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 11px 3px 0 -1px currentColor;
}

.support-icon::after {
  width: 24px;
  height: 12px;
  left: 10px;
  top: 25px;
  border-radius: 12px 12px 5px 5px;
  background: currentColor;
}

.document-icon {
  color: #64748b;
  background: #eef2f6;
}

.document-icon::before {
  width: 18px;
  height: 23px;
  left: 13px;
  top: 10px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.document-icon::after {
  width: 10px;
  height: 2px;
  left: 17px;
  top: 18px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

.headset-icon {
  color: var(--blue);
  background: #eaf2ff;
}

.headset-icon::before {
  width: 22px;
  height: 18px;
  left: 10px;
  top: 12px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
}

.headset-icon::after {
  width: 7px;
  height: 12px;
  left: 11px;
  top: 23px;
  border-radius: 5px;
  background: currentColor;
  box-shadow: 16px 0 0 currentColor;
}

.search-icon {
  color: #d97706;
  background: #fff7e6;
}

.search-icon::before {
  width: 17px;
  height: 17px;
  left: 11px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  width: 12px;
  height: 3px;
  left: 25px;
  top: 27px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.clock-icon {
  color: #f97316;
  background: #fff0e8;
}

.clock-icon::before {
  width: 22px;
  height: 22px;
  left: 10px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.clock-icon::after {
  width: 10px;
  height: 8px;
  left: 22px;
  top: 17px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
}

.check-icon {
  color: #16a34a;
  background: #e8fbef;
}

.check-icon::before {
  width: 22px;
  height: 22px;
  left: 10px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.check-icon::after {
  width: 14px;
  height: 8px;
  left: 16px;
  top: 18px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
}

.service-request-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.service-request-advanced-filters {
  border-top: 1px solid var(--line-soft);
  background: #fbfdff;
}

.service-request-advanced-filters summary {
  padding: 14px 24px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.service-request-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
  padding: 0 24px 22px;
}

.service-request-filters label,
.service-request-form label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.service-request-filters input,
.service-request-filters select,
.service-request-form input,
.service-request-form select,
.service-request-form textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.service-request-table-wrap {
  overflow-x: auto;
}

.service-request-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line-soft);
}

.service-request-table-footer.pagination-row {
  justify-content: space-between;
}

.pagination-gap {
  color: var(--muted);
  font-weight: 800;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.service-requests-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.service-requests-table th,
.service-requests-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  box-sizing: border-box;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
}

.service-requests-table th {
  background: var(--panel-soft);
  color: #273244;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select: none;
}

.service-requests-table td {
  font-size: 13px;
  line-height: 1.35;
}

.service-requests-table th:nth-child(1),
.service-requests-table td:nth-child(1) {
  width: 11%;
}

.service-requests-table th:nth-child(2),
.service-requests-table td:nth-child(2) {
  width: 18%;
}

.service-requests-table th:nth-child(3),
.service-requests-table td:nth-child(3) {
  width: 24%;
}

.service-requests-table th:nth-child(4),
.service-requests-table td:nth-child(4) {
  width: 11%;
}

.service-requests-table th:nth-child(5),
.service-requests-table td:nth-child(5) {
  width: 17%;
}

.service-requests-table th:nth-child(6),
.service-requests-table td:nth-child(6) {
  width: 9%;
}

.service-requests-table th:nth-child(7),
.service-requests-table td:nth-child(7) {
  width: 10%;
}

.service-requests-table th:nth-child(8),
.service-requests-table td:nth-child(8) {
  width: 10%;
}

.service-requests-table th:nth-child(9),
.service-requests-table td:nth-child(9),
.service-requests-table th:nth-child(10),
.service-requests-table td:nth-child(10) {
  width: 7%;
}

.service-requests-table th:nth-child(11),
.service-requests-table td:nth-child(11) {
  width: 8%;
}

.service-requests-table .compact-date {
  white-space: nowrap;
}

.resizable-th-content {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.column-resizer {
  position: absolute;
  top: -12px;
  right: -10px;
  z-index: 20;
  width: 10px;
  height: calc(100% + 24px);
  cursor: col-resize;
}

.column-resizer:hover {
  background: rgba(0, 91, 215, 0.16);
}

.resizable-table th {
  position: relative;
}

.resizable-table .resizable-th-content {
  padding-right: 10px;
}

.resizable-table .generic-column-resizer {
  right: -6px;
}

.service-requests-table .compact-date small {
  color: var(--muted);
  font-size: 11px;
}

.service-request-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  /* Botoes alinhados a direita da coluna Acoes (da direita para a esquerda). */
  justify-content: flex-end;
  gap: 6px;
}

.service-request-primary {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-request-neutral-button {
  border-color: var(--line);
  background: #fff;
  color: #475569;
}

.service-request-neutral-button:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #1f2937;
}

/* Menu "⋯" das ações */
.sr-action-menu {
  position: relative;
  flex: 0 0 auto;
}

/* Com o menu aberto, a célula de ações vira um stacking context elevado para o
   dropdown (fixed) ficar ACIMA das linhas seguintes (senão fica por baixo, pois
   .main-area cria um stacking context). */
.sr-action-menu.is-open {
  z-index: 1500;
}

.sr-action-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.sr-action-menu-toggle:hover,
.sr-action-menu-toggle[aria-expanded="true"] {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #1f2937;
}

.sr-action-menu-list {
  position: fixed;
  z-index: 1400;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-action-menu-list[hidden] {
  display: none;
}

.sr-action-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.sr-action-menu-item:hover {
  background: #f1f5f9;
}

.sr-action-menu-item-danger {
  color: #dc2626;
}

.sr-action-menu-item-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.service-request-code {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  padding: 0;
  line-height: 1.25;
  text-align: left;
}

/* Codigo com dot de "resposta nova nao lida" alinhado a esquerda. */
.sr-code-cell { display: inline-flex; align-items: center; gap: 6px; }
.sr-unread-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .16);
}

.service-request-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
/* Assunto clicavel: abre a solicitacao como o codigo, mantendo aparencia de titulo. */
.service-request-title-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.service-request-title-link:hover { text-decoration: underline; }
.service-request-title-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 4px; }

.service-request-responsible {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  min-width: 0;
}

.service-request-responsible-name {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.service-request-action-button {
  min-height: 30px;
  padding: 6px 10px;
  min-width: 72px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

.service-request-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.service-request-start-button {
  border-color: var(--green);
  background: #ecfff6;
  color: var(--green);
}

.service-request-start-button:hover {
  background: var(--green);
  color: #fff;
}

.service-request-transfer-button {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.service-request-transfer-button:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.service-request-pause-button {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #b45309;
}

.service-request-pause-button:hover {
  background: #f59e0b;
  color: #fff;
}

.service-request-close-button {
  border-color: var(--blue);
  background: #edf5ff;
  color: var(--blue);
}

.service-request-close-button:hover {
  background: var(--blue);
  color: #fff;
}

.service-request-delete-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.service-request-delete-button:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.request-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: normal;
}

.request-badge.priority-critical,
.request-badge.status-cancelled,
.request-badge.status-not_applicable {
  background: #ffe1df;
  color: #b42318;
}

.request-badge.priority-high,
.request-badge.status-waiting_customer {
  background: #fff2c7;
  color: #945f00;
}

.request-badge.status-automated_service {
  background: #dff6ff;
  color: #075985;
}

.request-badge.status-completed {
  background: #d8f8e8;
  color: #027a48;
}

.request-badge.status-in_service,
.request-badge.status-analysis,
.request-badge.status-development,
.request-badge.status-testing {
  background: #e4efff;
  color: #0759c7;
}

.service-request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px 18px;
  padding: 24px;
}

.service-request-form .full-field,
.module-checkboxes.full-field {
  grid-column: 1 / -1;
}

.service-client-search {
  position: relative;
}

.module-checkboxes {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.module-checkboxes legend {
  padding: 0 6px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.module-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.module-checkboxes input {
  width: 16px;
  min-height: auto;
  accent-color: var(--blue);
}

.service-request-detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  padding: 0 24px 24px;
}

.service-request-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
}

.service-request-sidebar > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.service-request-sidebar small {
  color: var(--muted);
  text-transform: uppercase;
}

.service-request-treatment-form {
  padding: 0;
}

.service-request-history-card {
  margin: 0 24px 24px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.service-request-history-card h3 {
  margin: 0 0 16px;
}

.service-request-history {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.service-request-history li {
  padding-left: 6px;
  line-height: 1.45;
}

.service-request-history small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .service-request-filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .service-request-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .service-request-filters,
  .service-request-form,
  .module-checkboxes {
    grid-template-columns: 1fr;
  }

  .service-request-filters,
  .service-request-form,
  .service-request-detail-grid,
  .service-request-history-card {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ===== Detalhe do chamado — layout estilo GLPI (conversa + propriedades) ===== */
.sr-detail-head { align-items: flex-start; }
.sr-detail-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
}
.sr-detail-code { color: var(--muted); font-weight: 600; font-size: 14px; }

.sr-detail-props-toggle { display: none; }

.sr-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  padding: 0 24px 24px;
  align-items: start;
}

.sr-conversation { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sr-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sr-timeline-empty { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }

.sr-msg {
  border: 1px solid var(--line-soft);
  border-left: 3px solid #93b4d8;
  border-radius: 10px;
  background: #fff;
  padding: 10px 14px;
}
.sr-msg-incoming { border-left-color: #378add; }
.sr-msg-reply { border-left-color: #16a34a; background: #f6fdf9; }
.sr-msg-internal { border-left-color: #ef9f27; background: #fdf8ec; }

.sr-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.sr-msg-author { font-weight: 700; font-size: 12.5px; color: #172033; }
.sr-msg-when { margin-left: auto; font-size: 11px; color: var(--muted); }
.sr-msg-email { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.sr-msg-tag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; }
.sr-msg-tag-internal { background: #fdecc8; color: #8a5a0b; }
.sr-msg-tag-reply { background: #dcfce7; color: #15803d; }

.sr-msg-text { font-size: 13px; color: #2b3444; line-height: 1.5; overflow-wrap: anywhere; }
.sr-msg-html { font-size: 13px; color: #2b3444; line-height: 1.5; overflow-x: auto; }
.sr-msg-html img { max-width: 100%; height: auto; }
.sr-msg-html table { max-width: 100%; }
.sr-inline-img { border-radius: 4px; }
.sr-blocked-img, .sr-missing-inline { display: inline-block; min-width: 32px; min-height: 18px; }

.sr-msg-attachments { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.sr-msg-att-label { font-size: 10.5px; color: var(--muted); }
.sr-att-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; text-decoration: none; max-width: 220px; }
.sr-att-chip:hover { border-color: #94a3b8; background: #f8fafc; }
.sr-att-thumb { width: 34px; height: 26px; flex: 0 0 auto; border-radius: 4px; background: #e2e8f0 center/cover no-repeat; }
.sr-att-icon { width: 34px; height: 26px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; background: #fee2e2; color: #b91c1c; font-size: 9px; font-weight: 800; }
.sr-att-meta { display: flex; flex-direction: column; min-width: 0; }
.sr-att-name { font-size: 11px; font-weight: 600; color: #172033; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-att-size { font-size: 9.5px; color: var(--muted); }

.sr-event { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 10px; font-size: 11.5px; color: var(--muted); }
.sr-event-dot { width: 6px; height: 6px; border-radius: 999px; background: #cbd5e1; flex: 0 0 auto; }
.sr-event-text { color: #475569; }
.sr-event-when { margin-left: auto; font-size: 10.5px; }

.sr-reply-box { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 10px 12px; }
.sr-reply-tabs { display: flex; gap: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.sr-reply-tab { border: 0; background: none; padding: 4px 0 8px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.sr-reply-tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.sr-reply-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; resize: vertical; min-height: 60px; }
.sr-reply-box.is-internal .sr-reply-input { background: #fffdf6; }
.sr-reply-hint { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); }
.sr-reply-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.sr-reply-actions .primary-button[disabled] { opacity: .55; cursor: not-allowed; }

.sr-properties { border: 1px solid var(--line-soft); border-radius: 10px; background: #f8fafc; padding: 14px; align-self: start; display: flex; flex-direction: column; gap: 8px; }
.sr-properties-title { margin: 0 0 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sr-prop { display: flex; flex-direction: column; gap: 1px; }
.sr-prop small { font-size: 10px; color: var(--muted); }
.sr-prop strong, .sr-prop span { font-size: 12px; color: #172033; }
.sr-prop .ghost-link { padding: 0; font-size: 12px; font-weight: 700; text-align: left; }

/* Linha do cliente + botao pequeno "alterar" ao lado (mesmo tamanho da fonte). */
.sr-prop-client-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sr-prop-edit-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue, #2563eb);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
}
.sr-prop-edit-btn:hover { color: #1d4ed8; }

/* Modal de alterar a empresa vinculada. */
.sr-client-change-card { width: min(480px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.sr-client-change-search { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; }
.sr-client-change-search input {
  box-sizing: border-box;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.sr-client-change-card .client-search-results { position: static; max-height: 260px; overflow-y: auto; }
.sr-properties-form { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.sr-properties-form label { display: flex; flex-direction: column; gap: 3px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sr-properties-form select { font-size: 12px; padding: 6px 8px; }
.sr-properties-form .form-actions { margin-top: 2px; }

@media (max-width: 960px) {
  .sr-detail-layout { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .sr-detail-props-toggle { display: inline-flex; margin: 0 16px 8px; }
  .sr-properties { display: none; }
  .sr-properties.is-open { display: flex; }
}

.proposal-builder-form {
  display: grid;
  gap: 18px;
}

.proposal-template-panel {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.contract-template-selector {
  display: grid;
  gap: 22px;
  margin-inline: 0;
  padding: 28px;
  overflow: hidden;
}

.contract-template-selector .proposal-template-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 20px;
}

.contract-template-selector .proposal-template-card {
  min-width: 0;
}

.proposal-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.proposal-customization-panel {
  display: grid;
  gap: 24px;
  width: min(100%, 980px);
  max-width: 980px;
  padding: 28px;
  overflow: hidden;
}

.proposal-customization-copy {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.proposal-customization-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #eaf2ff;
  color: var(--primary);
  font-size: 26px;
  font-weight: 800;
}

.proposal-customization-copy h2,
.proposal-customization-copy p,
.proposal-customization-progress p {
  margin: 0;
}

.proposal-customization-copy h2 {
  margin-bottom: 7px;
  font-size: 26px;
}

.proposal-customization-copy p,
.proposal-customization-progress p {
  color: var(--muted);
  line-height: 1.45;
}

.proposal-customization-request {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.proposal-customization-request label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.proposal-customization-request input,
.proposal-customization-request textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #182238;
  background: #fff;
  font: inherit;
}

.proposal-customization-request textarea {
  min-height: 130px;
  resize: vertical;
}

.proposal-customization-progress {
  padding: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.proposal-customization-progress strong {
  display: block;
  margin-bottom: 6px;
  color: #075ec8;
  font-size: 18px;
}

.proposal-template-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 156px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.proposal-template-card:hover,
.proposal-template-card:focus-visible {
  border-color: var(--blue);
  background: #eef5ff;
  outline: none;
  box-shadow: 0 14px 26px rgba(8, 91, 197, 0.1);
}

.proposal-template-card span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
}

.proposal-template-card strong,
.proposal-template-card small {
  display: block;
}

.proposal-template-card strong {
  font-size: 20px;
}

.proposal-template-card small {
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 980px) {
  .proposal-template-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .contract-template-selector .proposal-template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .proposal-template-grid {
    grid-template-columns: 1fr;
  }
}

.proposal-builder-actions {
  flex-wrap: wrap;
}

.proposal-builder-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.proposal-send-status {
  min-height: 20px;
  margin: -13px 0 16px;
  color: var(--red);
}

#screen-proposal-builder > .proposal-send-status {
  margin: 0 0 18px;
}

#proposalCustomizationPanel .proposal-send-status {
  margin: 0;
}

.proposal-send-status[data-state="success"] {
  color: var(--green);
}

.proposal-builder-section {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.proposal-builder-section h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.proposal-manual-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.proposal-model-selector label {
  display: grid;
  gap: 6px;
  max-width: 460px;
  margin: 0;
  font-weight: 600;
}

.proposal-model-selector select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.proposal-model-selector-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.contract-client-picker-card p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.contract-address-fields {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px;
  gap: 14px 18px;
}

.proposal-builder-grid,
.proposal-modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
}

.proposal-custom-items-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.proposal-custom-items-heading h2,
.proposal-custom-items-heading p {
  margin: 0;
}

.proposal-custom-items-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.proposal-custom-items-list {
  display: grid;
  gap: 12px;
}

.proposal-custom-item-row {
  display: grid;
  grid-template-columns: 110px minmax(220px, .9fr) minmax(360px, 1.45fr) 180px 34px;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.proposal-custom-item-row label {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.proposal-custom-item-row button {
  align-self: end;
  justify-self: center;
  min-width: 34px;
  width: 34px;
  height: 42px;
  padding: 0;
}

.proposal-custom-item-row input,
.proposal-custom-item-row textarea {
  width: 100%;
}

.proposal-custom-item-row textarea {
  min-height: 54px;
  resize: vertical;
}

.proposal-custom-quantity-field input,
.proposal-custom-value-field input {
  text-align: left;
}

.proposal-custom-extra-fields {
  margin-top: 16px;
}

@media (max-width: 980px) {
  .proposal-custom-items-heading {
    grid-template-columns: 1fr;
  }

  .proposal-custom-items-heading {
    display: grid;
  }

  .proposal-custom-item-row {
    grid-template-columns: minmax(92px, .35fr) minmax(160px, .65fr);
  }

  .proposal-custom-description-field,
  .proposal-custom-value-field {
    grid-column: 1 / -1;
  }

  .proposal-custom-item-row button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.proposal-builder-form label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.proposal-builder-form input,
.proposal-builder-form select,
.proposal-builder-form textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.proposal-builder-form textarea {
  min-height: 80px;
  resize: vertical;
}

.proposal-module-option {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px !important;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.proposal-module-option:has(input:checked) {
  border-color: var(--blue);
  background: #eef6ff;
}

.proposal-module-option input {
  min-height: auto;
}

.proposal-module-option span,
.proposal-module-option small {
  display: block;
}

.proposal-module-option small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.proposal-values-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.proposal-values-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-radius: 7px;
  background: #f4f2ea;
}

.proposal-values-summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.proposal-values-summary strong {
  font-size: 20px;
  text-align: right;
}

.proposal-values-summary strong small {
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

.proposal-modal[hidden] {
  display: none;
}

.proposal-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  padding: 28px;
  background: rgba(7, 20, 42, .72);
}

.proposal-modal-card {
  display: grid;
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.proposal-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(7, 20, 42, .18);
}

.proposal-modal-header h2,
.proposal-modal-header p {
  margin: 0;
}

.proposal-modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.proposal-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.proposal-pages.is-generating-pdf .proposal-a4-page {
  width: 794px;
  height: 1123px;
}

.proposal-pdf-capture {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  display: grid;
  width: 794px;
  pointer-events: none;
}

.proposal-a4-page {
  position: relative;
  /* Largura EXPLICITA (nao percentual): a tabela interna usa table-layout:fixed +
     width:100% e so resolve corretamente se o container tiver largura definida.
     Com width:min(100%,...) o Chromium trata como indefinida e a tabela colapsa
     (1 caractere por coluna). max-width mantem responsivo em telas estreitas. */
  width: 794px;
  max-width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}

/* Neutraliza o `table { min-width: 720px }` global dentro do A4 (aplicavel a
   tabelas de dados do app, mas nocivo no documento da proposta). */
.proposal-a4-page table {
  min-width: 0;
}

.contract-a4-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 16mm 20mm 12mm;
  color: #000;
  background: #fff;
  font-family: "Times New Roman", Times, serif;
}

.word-contract-page main {
  flex: 1;
}

.contract-title-block {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  text-align: center;
}

.contract-title-block h2,
.contract-title-block h3 {
  margin: 0;
  color: #000;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.contract-title-block h2 {
  font-size: 17px;
}

.contract-title-block h3 {
  font-size: 15px;
}

.contract-a4-page h2 {
  color: #000;
}

.contract-clause {
  margin-top: 9px;
}

.contract-clause h3 {
  margin: 0 0 4px;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  text-transform: uppercase;
}

.contract-a4-page p {
  margin: 0 0 4px;
  font-size: 13.6px;
  line-height: 1.32;
  text-align: justify;
}

.contract-a4-page footer {
  color: #000;
  font-size: 10px;
  text-align: center;
}

.contract-signatures {
  margin-top: 28px;
}

.contract-signatures > p {
  margin-bottom: 52px;
  text-align: center;
}

.contract-signatures > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
}

.contract-signatures span {
  display: grid;
  gap: 5px;
  text-align: center;
}

.contract-signatures i {
  display: block;
  border-top: 1px solid #000;
}

.contract-signatures small {
  color: #000;
  font-size: 9.5px;
  line-height: 1.35;
}

.proposal-html-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 58px 56px 42px;
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.megaup-proposal-page {
  box-sizing: border-box;
  padding: 52px 38px 48px;
  color: #111827;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}

.megaup-proposal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}

.megaup-proposal-client {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.megaup-proposal-client h2 {
  margin: 0;
  color: #0b0f18;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.megaup-proposal-client strong,
.megaup-proposal-client p {
  margin: 0;
  color: #0b0f18;
  font-size: 14px;
}

.megaup-proposal-brand {
  display: flex;
  justify-content: flex-end;
  min-width: 230px;
}

.megaup-proposal-brand img {
  display: block;
  width: 190px;
  height: auto;
  object-fit: contain;
}

.megaup-proposal-table {
  /* Largura EXPLICITA em px (nao 100%): o table-layout:fixed so engata com uma
     largura especificada (nao-auto). Com 100% o Chromium trata como indefinida
     dentro do A4 e as colunas colapsam. 718px = area util do A4 (794 - 76 pad). */
  width: 718px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #111827;
  font-size: 12px;
}

/* Larguras em PX (nao %): com table-layout:fixed, colunas em pixel independem da
   resolucao de largura do container. O documento e um A4 fixo (~718px de area
   util), entao px e apropriado e elimina o colapso das colunas no preview. */
.megaup-col-quantity {
  width: 57px;
}

.megaup-col-item {
  width: 130px;
}

.megaup-col-description {
  width: 416px;
}

.megaup-col-value {
  width: 115px;
}

.megaup-proposal-table th {
  padding: 6px 4px;
  border: 1px solid #000;
  background: #05b957;
  color: #000;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
}

.megaup-proposal-table td {
  padding: 9px 7px;
  border: 1px solid #000;
  vertical-align: middle;
  line-height: 1.18;
  overflow-wrap: anywhere;
  text-align: center;
}

.megaup-proposal-description {
  text-align: left !important;
}

.megaup-proposal-description ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.megaup-proposal-description li {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.megaup-proposal-value-cell {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  white-space: normal;
}

.megaup-proposal-value-cell.is-tight {
  font-size: 10.5px;
}

.megaup-proposal-value-cell.is-extra-tight {
  font-size: 9px;
}

.megaup-proposal-value-cell span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.megaup-proposal-observation td {
  padding: 5px 8px;
  text-align: left;
}

.megaup-proposal-observation td:last-child {
  text-align: center;
}

.megaup-proposal-total-row td {
  padding: 4px 8px;
}

/* TOTAL como selo verde compacto, alinhado a direita (perto do valor), em vez
   de pintar a celula inteira de verde. Seletor especifico para vencer o
   text-align:center de `.megaup-proposal-table td`. */
.megaup-proposal-total-row td.megaup-proposal-total-label {
  text-align: right;
  background: transparent;
}

.megaup-proposal-total-label span {
  display: inline-block;
  min-width: 92px;
  padding: 3px 16px;
  background: #05b957;
  color: #05261a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-align: center;
}

.megaup-proposal-footer {
  display: grid;
  gap: 14px;
  margin-top: 62px;
  color: #111827;
  font-size: 14px;
}

.megaup-proposal-footer p {
  margin: 0;
}

.megaup-proposal-footer p:nth-child(2) {
  margin-left: 118px;
}

.sisinfra-proposal-page {
  box-sizing: border-box;
  width: 794px;
  max-width: 794px;
  padding: 34px 36px 96px;
  color: #05070d;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.sisinfra-proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 128px;
}

.sisinfra-proposal-header img {
  width: 250px;
  height: auto;
  object-fit: contain;
}

.sisinfra-proposal-recipient {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 56px;
}

.sisinfra-proposal-recipient p,
.sisinfra-proposal-recipient h2,
.sisinfra-proposal-recipient strong,
.sisinfra-proposal-reference {
  margin: 0;
}

.sisinfra-proposal-recipient p {
  font-size: 16px;
  font-weight: 800;
}

.sisinfra-proposal-recipient h2,
.sisinfra-proposal-recipient strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.sisinfra-proposal-reference {
  margin-bottom: 42px;
  font-size: 16px;
}

.sisinfra-services-grid {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  color: #05070d;
  font-size: 14px;
}

.sisinfra-services-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 76px 190px;
  min-width: 0;
}

.sisinfra-services-row > *,
.sisinfra-observation-row > *,
.sisinfra-total-row > * {
  min-width: 0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
}

.sisinfra-services-header > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 6px;
  background: #dce9f4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.sisinfra-services-item > span,
.sisinfra-services-item > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.sisinfra-service-cell {
  display: block !important;
  text-align: left !important;
}

.sisinfra-service-cell > strong {
  display: block;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 400;
}

.sisinfra-service-cell ul {
  display: grid;
  gap: 8px;
  margin: 0 0 0 28px;
  padding: 0 0 0 18px;
}

.sisinfra-service-cell li {
  padding-left: 10px;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.sisinfra-observation-row {
  display: grid;
  grid-template-columns: 1fr;
}

.sisinfra-observation-row > span {
  min-height: 32px;
  padding: 6px 8px;
  text-align: left;
}

.sisinfra-total-row {
  display: grid;
  grid-template-columns: 1fr 132px 190px;
}

.sisinfra-total-row > span,
.sisinfra-total-row > strong {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
}

.sisinfra-total-row > strong {
  justify-content: center;
  background: #dce9f4;
  font-weight: 800;
}

.sisinfra-total-row > span:last-child {
  justify-content: center;
}

.sisinfra-commercial {
  position: relative;
  z-index: 2;
  margin-top: 28px;
}

.sisinfra-commercial h3 {
  margin: 0 0 10px;
  font-size: 9px;
  font-weight: 800;
}

.sisinfra-commercial table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.sisinfra-commercial th,
.sisinfra-commercial td {
  border: 1px solid #000;
  padding: 7px 10px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.sisinfra-commercial th {
  width: 15%;
  font-weight: 800;
  text-align: center;
}

.sisinfra-commercial td {
  font-weight: 700;
  word-break: normal;
}

.sisinfra-billing {
  width: 32%;
  text-align: center;
  font-weight: 800 !important;
}

.sisinfra-acceptance {
  font-weight: 400 !important;
}

.sisinfra-acceptance strong {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.sisinfra-acceptance p {
  margin: 0;
  font-weight: 400;
  line-height: 1.45;
}

.sisinfra-proposal-watermark {
  position: absolute;
  left: 42px;
  bottom: 250px;
  z-index: 1;
  width: 680px;
  max-width: calc(100% - 84px);
  opacity: .14;
  pointer-events: none;
}

.sisinfra-proposal-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  min-height: 78px;
  padding: 16px 88px 14px;
  background: #6ea8ca;
  color: #fff;
  font-size: 9px;
  line-height: 1.35;
}

.sisinfra-proposal-footer p {
  margin: 0 0 5px;
}

/* ===== Modelo NARTE - Produto (reusa a estrutura .sisinfra-*, paleta NARTE) ===== */
.sisinfra-proposal-page.narte-produto .sisinfra-services-header > span {
  background: #1f3864;
  color: #fff;
}
.sisinfra-proposal-page.narte-produto .sisinfra-total-row > strong {
  background: #dce9f4;
  color: #1f3864;
}
.sisinfra-proposal-page.narte-produto .sisinfra-commercial th {
  background: #dce9f4;
  color: #1f3864;
}
.sisinfra-proposal-page.narte-produto .sisinfra-billing {
  background: #fff;
  color: #1f3864 !important;
}
.sisinfra-proposal-page.narte-produto .sisinfra-acceptance strong {
  color: #3f7cb3;
}
.sisinfra-proposal-page.narte-produto .sisinfra-proposal-footer {
  background: #1f3864;
}
/* Sem marca d'agua no modelo Produto (mantem o <img> no DOM apenas como ancora
   do insertBefore da paginacao; oculto visualmente). */
.sisinfra-proposal-page.narte-produto .sisinfra-proposal-watermark {
  display: none;
}

/* ===== Modelo SISINFRA v2 (navy #07111F + ciano #22D3EE) ===== */
.sisinfra-v2-page {
  box-sizing: border-box;
  width: 794px;
  max-width: 794px;
  padding: 0 0 96px;
  color: #0F1B2D;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

.sisinfra-v2-header--full {
  background: #07111F;
  padding: 26px 36px 18px;
}

.sisinfra-v2-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.sisinfra-v2-logo-plate {
  display: inline-block;
  flex: 0 0 auto;
  padding: 12px 22px;
  background: #fff;
  border-radius: 10px;
  line-height: 0;
  overflow: visible;
}

.sisinfra-v2-logo-plate img {
  display: block;
  width: auto;
  max-width: none;
  height: 46px;
}

.sisinfra-v2-header-meta {
  text-align: right;
}

.sisinfra-v2-header-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: .16em;
  color: #7B8CA6;
}

.sisinfra-v2-header-number {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #22D3EE;
}

.sisinfra-v2-header-tagline {
  margin: 12px 0 0;
  font-size: 12px;
  color: #7B8CA6;
}

.sisinfra-v2-accent-bar {
  height: 4px;
  background: #22D3EE;
}

.sisinfra-v2-header--compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #07111F;
  padding: 12px 36px;
}

.sisinfra-v2-header--compact .sisinfra-v2-logo-plate {
  padding: 7px 14px;
  border-radius: 8px;
}

.sisinfra-v2-header--compact .sisinfra-v2-logo-plate img {
  height: 30px;
}

.sisinfra-v2-header-compact-info {
  font-size: 12px;
  color: #7B8CA6;
  text-align: right;
}

.sisinfra-v2-data {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 36px 0;
}

.sisinfra-v2-eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: .12em;
  color: #94A3B8;
}

.sisinfra-v2-client-name {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: #0F1B2D;
}

.sisinfra-v2-client-contact {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748B;
}

.sisinfra-v2-data-dates {
  flex-shrink: 0;
  text-align: right;
}

.sisinfra-v2-date-value {
  margin: 3px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0F1B2D;
}

.sisinfra-v2-data-dates .sisinfra-v2-date-value:last-child {
  margin-bottom: 0;
}

.sisinfra-v2-intro {
  margin: 16px 36px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #334155;
}

.sisinfra-v2-grid {
  position: relative;
  z-index: 2;
  display: grid;
  margin: 16px 36px 0;
  border: 1px solid #E3E9F1;
  border-radius: 8px;
  overflow: hidden;
  color: #0F1B2D;
  font-size: 12px;
}

.sisinfra-v2-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 60px 120px;
  min-width: 0;
}

.sisinfra-v2-head-row > span {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 9px 12px;
  background: #0F1B2D;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.15;
}

.sisinfra-v2-item {
  border-top: 1px solid #F0F3F8;
}

.sisinfra-v2-item:nth-child(even) {
  background: #FAFBFD;
}

.sisinfra-v2-item > span,
.sisinfra-v2-item > div {
  min-width: 0;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

.sisinfra-v2-col-num {
  color: #94A3B8;
  text-align: center;
}

.sisinfra-v2-col-qtd {
  text-align: center;
  color: #334155;
}

.sisinfra-v2-col-val {
  text-align: right;
  font-weight: 700;
  color: #0F1B2D;
}

.sisinfra-v2-cell > strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #0F1B2D;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sisinfra-v2-desc-text {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: #64748B;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sisinfra-v2-cell ul {
  display: grid;
  gap: 3px;
  margin: 4px 0 0;
  padding: 0 0 0 16px;
}

.sisinfra-v2-cell li {
  font-size: 10px;
  line-height: 1.5;
  color: #64748B;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sisinfra-v2-observation-row {
  border-top: 1px solid #F0F3F8;
}

.sisinfra-v2-observation-row > span {
  display: block;
  padding: 9px 12px;
  font-size: 10px;
  line-height: 1.5;
  color: #64748B;
}

.sisinfra-v2-total-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #EAF7FB;
}

.sisinfra-v2-total-label {
  padding: 12px;
  font-size: 11px;
  font-weight: 800;
  color: #0F1B2D;
}

.sisinfra-v2-total-value {
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 800;
  color: #0E7490;
  text-align: right;
}

.sisinfra-v2-conditions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 36px 0;
}

.sisinfra-v2-cond-card {
  padding: 10px 14px;
  background: #F7F9FC;
  border-left: 3px solid #22D3EE;
  border-radius: 0 8px 8px 0;
}

.sisinfra-v2-cond-text {
  margin: 3px 0 0;
  font-size: 12px;
  color: #334155;
}

.sisinfra-v2-watermark {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 1;
  width: 440px;
  max-width: calc(100% - 120px);
  transform: translate(-50%, -50%) rotate(-16deg);
  opacity: .05;
  pointer-events: none;
}

.sisinfra-v2-page-number {
  position: absolute;
  right: 36px;
  bottom: 74px;
  z-index: 2;
  margin: 0;
  font-size: 9px;
  color: #94A3B8;
}

.sisinfra-v2-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: 60px;
  padding: 14px 36px;
  background: #07111F;
  color: #7B8CA6;
  font-size: 9px;
  line-height: 1.6;
}

.sisinfra-v2-footer > div:last-child {
  text-align: right;
}

.sisinfra-v2-footer p {
  margin: 0 0 3px;
}

.proposal-cover-page {
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-company-page {
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-company-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.proposal-company-top h2,
.proposal-company-top p {
  margin: 0;
}

.proposal-company-top h2 {
  font-size: 42px;
  line-height: 1.05;
}

.proposal-company-top p {
  margin-top: 8px;
  color: #80d9ff;
  font-size: 23px;
  font-weight: 700;
}

.proposal-company-top img {
  width: 112px;
  max-height: 96px;
  object-fit: contain;
  object-position: right center;
}

.proposal-company-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 30px;
  margin-top: 42px;
}

.proposal-company-about {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.proposal-company-rule {
  width: 86px;
  height: 3px;
  margin-bottom: 18px;
  background: #69d5ff;
}

.proposal-company-about p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .92);
  font-size: 15px;
  line-height: 1.52;
}

.proposal-company-about strong {
  max-width: 250px;
  color: #80d9ff;
  font-size: 18px;
  line-height: 1.35;
}

.proposal-company-devices {
  width: calc(100% + 32px);
  height: 230px;
  margin: 38px 0 0 -32px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
}

.proposal-company-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.proposal-company-benefits {
  display: grid;
  gap: 12px;
}

.proposal-company-benefit {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(105, 213, 255, .62);
  border-radius: 7px;
  background: rgba(2, 35, 88, .48);
}

.proposal-company-benefit-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid #69d5ff;
  border-radius: 50%;
  color: #fff;
  background: #0878d1;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 700;
}

.proposal-company-benefit h3,
.proposal-company-benefit p {
  margin: 0;
}

.proposal-company-benefit h3 {
  color: #80d9ff;
  font-size: 14px;
  text-transform: uppercase;
}

.proposal-company-benefit p {
  margin-top: 4px;
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  line-height: 1.36;
}

.proposal-company-contact {
  margin-top: 26px;
}

.proposal-company-contact h3 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #69d5ff;
  font-size: 22px;
  text-transform: uppercase;
}

.proposal-company-contact dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.proposal-company-contact dl div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(105, 213, 255, .45);
  font-size: 13px;
  line-height: 1.35;
}

.proposal-company-contact dt {
  color: #80d9ff;
  font-weight: 700;
}

.proposal-company-contact dd {
  margin: 0;
  color: rgba(255, 255, 255, .96);
}

.proposal-html-brand {
  display: grid;
  gap: 2px;
  align-content: start;
}

.proposal-html-brand img {
  width: 158px;
  max-height: 132px;
  object-fit: contain;
  object-position: left center;
}

.proposal-cover-copy {
  display: grid;
  gap: 14px;
  margin-top: 58px;
}

.proposal-cover-copy p,
.proposal-cover-copy h2 {
  margin: 0;
}

.proposal-cover-copy p {
  color: #80d9ff;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.proposal-cover-copy h2 {
  max-width: 620px;
  font-size: 47px;
  line-height: 1.05;
}

.proposal-cover-copy span {
  max-width: 590px;
  font-size: 18px;
  line-height: 1.45;
}

.proposal-cover-devices {
  display: block;
  width: 100%;
  max-height: 340px;
  margin: 22px 0 16px;
  border-radius: 7px;
  object-fit: cover;
  object-position: center;
}

.proposal-cover-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: auto 0 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 8px;
  background: rgba(2, 28, 78, .5);
}

.proposal-cover-data div:last-child {
  grid-column: 1 / -1;
}

.proposal-cover-data dt {
  margin-bottom: 5px;
  color: #80d9ff;
  font-size: 12px;
  text-transform: uppercase;
}

.proposal-cover-data dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.proposal-html-page footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid currentColor;
  font-size: 13px;
  opacity: .8;
}

.proposal-html-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #69d5ff;
  color: #80d9ff;
}

.proposal-html-header img {
  width: 84px;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

.proposal-html-header strong {
  font-size: 16px;
  text-transform: uppercase;
}

.proposal-document-section {
  margin-top: 34px;
}

.proposal-document-section h2 {
  margin: 8px 0 18px;
  color: #fff;
  font-size: 28px;
}

.proposal-document-eyebrow {
  margin: 0;
  color: #80d9ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.proposal-modules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proposal-modules-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 6px;
}

.proposal-module-card.is-included {
  border: 1px solid #75b6ed;
  background: #eef7ff;
  color: #10203c;
}

.proposal-module-card.is-not-included {
  border: 1px solid #dedede;
  background: #fafafa;
  color: #919191;
}

.proposal-module-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: transparent;
}

.proposal-module-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.proposal-module-card.is-not-included .proposal-module-icon {
  filter: grayscale(1);
  opacity: .62;
}

.proposal-module-card strong,
.proposal-module-card small,
.proposal-module-card em {
  display: block;
}

.proposal-module-card small {
  margin-top: 3px;
  color: inherit;
  font-size: 12px;
}

.proposal-module-card em {
  margin-top: 6px;
  color: #008357;
  font-size: 12px;
}

.proposal-module-card.is-not-included em {
  color: #8b8b8b;
}

.proposal-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.proposal-price-grid div {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(105, 213, 255, .62);
  border-radius: 6px;
  background: rgba(2, 35, 88, .48);
}

.proposal-implementation-intro {
  max-width: 680px;
  margin: -5px 0 26px;
  color: rgba(255, 255, 255, .9);
  font-size: 16px;
  line-height: 1.45;
}

.proposal-implementation-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.proposal-implementation-step {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 0 8px;
  text-align: center;
}

.proposal-implementation-step::before {
  position: absolute;
  top: 17px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #75b6ed;
  content: "";
}

.proposal-implementation-step:first-child::before {
  left: 50%;
  width: 50%;
}

.proposal-implementation-step:last-child::before {
  width: 50%;
}

.proposal-implementation-step strong {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #75b6ed;
  border-radius: 50%;
  color: #fff;
  background: #075eb5;
  font-size: 18px;
}

.proposal-implementation-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 15px 0 11px;
  border: 2px solid #75b6ed;
  border-radius: 50%;
  color: #fff;
  background: rgba(2, 35, 88, .48);
  font-family: Arial, sans-serif;
  font-size: 31px;
  line-height: 1;
}

.proposal-implementation-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #8be7ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(91, 209, 255, .35));
}

.proposal-implementation-step h3 {
  min-height: 38px;
  margin: 0 0 7px;
  color: #fff;
  font-size: 14px;
  line-height: 1.28;
}

.proposal-implementation-step p {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  line-height: 1.4;
}

.proposal-price-grid span {
  color: #80d9ff;
  font-size: 13px;
}

.proposal-price-grid strong {
  font-size: 18px;
}

.proposal-document-note {
  margin-top: auto;
  padding: 18px;
  border-left: 4px solid #69d5ff;
  background: rgba(2, 35, 88, .48);
  line-height: 1.55;
}

.proposal-acceptance {
  margin-top: auto;
}

.proposal-acceptance div {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 20px;
}

.proposal-acceptance i {
  display: block;
  min-height: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .72);
}

.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}

.inline-client-form-card {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.inline-client-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 30px;
  padding: 34px;
}

.inline-client-form label {
  gap: 10px;
}

.inline-client-form input,
.inline-client-form select,
.inline-client-form textarea {
  min-height: 56px;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08);
}

.inline-client-form .form-status {
  margin: 0;
}

.inline-client-form .modal-actions {
  margin: 8px -34px -34px;
  padding: 24px 34px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .96);
}

#screen-clients:has(#inlineClientFormCard:not([hidden])) .page-heading {
  width: min(100%, 1240px);
  max-width: 1240px;
  margin-inline: auto;
}

.screen.is-visible#screen-clients:has(#inlineClientFormCard:not([hidden])) {
  display: grid;
  justify-items: center;
}

#screen-clients:has(#inlineClientFormCard:not([hidden])) > .page-heading,
#screen-clients:has(#inlineClientFormCard:not([hidden])) > .inline-client-form-card {
  justify-self: center;
}

#screen-clients:has(#inlineClientFormCard:not([hidden])) > .clients-table-card {
  width: 100%;
  justify-self: stretch;
}

.client-stat {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 132px;
  padding: 28px;
}

.client-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 36px;
}

@media (max-width: 1180px) {
  .inline-client-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.clients-table-card {
  overflow: hidden;
}

.clients-table-card .table-wrap {
  /* Antes era overflow-x:hidden, o que cortava as colunas da direita (incl.
     Acoes) no celular/tablet sem permitir rolagem. Volta a rolar na horizontal
     com a mesma indicacao visual das demais tabelas. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.clients-agenda-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.clients-agenda-view[hidden] {
  display: none;
}

.clients-agenda-sidebar {
  display: grid;
  gap: 14px;
}

.clients-agenda-create {
  justify-content: center;
  width: 100%;
  min-height: 56px;
  box-shadow: var(--shadow-sm);
}

.clients-mini-calendar-card,
.clients-agenda-filters-card {
  padding: 18px;
}

.clients-mini-calendar-header,
.clients-agenda-toolbar,
.clients-agenda-titlebar,
.clients-agenda-tools {
  display: flex;
  align-items: center;
}

.clients-mini-calendar-header {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.clients-mini-calendar-header strong {
  font-size: 16px;
}

.clients-mini-calendar-weekdays,
.clients-mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.clients-mini-calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.clients-mini-calendar-day {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.clients-mini-calendar-day.is-outside {
  color: #a3adba;
}

.clients-mini-calendar-day.is-today {
  background: #dbeafe;
  color: var(--blue);
  font-weight: 800;
}

.clients-mini-calendar-day.is-selected {
  background: var(--blue);
  color: #fff;
}

.clients-agenda-filters-card {
  display: grid;
  gap: 12px;
}

.clients-agenda-filters-card h2 {
  margin: 0;
  font-size: 18px;
}

.clients-agenda-filters-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.clients-agenda-filters-card input,
.clients-agenda-filters-card select,
.clients-agenda-search input,
#clientsAgendaViewMode {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.clients-agenda-main {
  overflow: hidden;
}

.clients-agenda-toolbar {
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.clients-agenda-titlebar {
  min-width: 0;
  gap: 8px;
}

.clients-agenda-titlebar h2 {
  margin: 0 0 0 8px;
  font-size: 26px;
  text-transform: capitalize;
}

.clients-agenda-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.clients-agenda-search {
  display: flex;
  align-items: center;
  min-width: min(280px, 42vw);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.clients-agenda-search input {
  min-height: 40px;
  padding-inline: 8px;
  border: 0;
  background: transparent;
}

.clients-agenda-search input:focus,
.clients-agenda-filters-card input:focus,
.clients-agenda-filters-card select:focus,
#clientsAgendaViewMode:focus {
  outline: 2px solid rgba(0, 88, 190, .18);
}

#clientsAgendaViewMode {
  width: auto;
  min-width: 118px;
}

.clients-agenda-weekdays,
.clients-agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.clients-agenda-weekdays {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.clients-agenda-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.clients-agenda-day {
  min-height: 132px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.clients-agenda-day:nth-child(7n) {
  border-right: 0;
}

.clients-agenda-day.is-outside {
  background: #f8fafc;
}

.clients-agenda-day.is-selected {
  box-shadow: inset 0 0 0 2px rgba(0, 88, 190, .25);
}

.clients-agenda-day-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.clients-agenda-day.is-today .clients-agenda-day-number {
  background: var(--blue);
  color: #fff;
}

.clients-agenda-day ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.clients-agenda-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  width: 100%;
  min-height: 26px;
  padding: 5px 6px;
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 6px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.clients-agenda-event.technical {
  color: #075eb5;
  background: #e8f2ff;
}

.clients-agenda-event.commercial {
  color: #08775a;
  background: #e8f8f1;
}

.clients-agenda-event.overdue {
  color: #b91c1c;
  background: #fee2e2;
}

.clients-agenda-event.cancelled {
  opacity: .6;
  text-decoration: line-through;
}

.clients-agenda-event time {
  font-weight: 800;
}

.clients-agenda-event span {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-agenda-day small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* ===== Agenda responsiva ===== */
/* Elementos que so aparecem em largura reduzida ficam OCULTOS no desktop, para
   que em >=1281px a tela permaneca identica ao layout atual. */
.clients-agenda-backdrop,
.clients-agenda-drawer-close,
.clients-agenda-compact-btn,
.clients-agenda-chips {
  display: none;
}
.clients-agenda-compact-btn {
  align-items: center;
  gap: 6px;
  min-height: 40px;
  white-space: nowrap;
}
.clients-agenda-chips {
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.clients-agenda-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.clients-agenda-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.clients-agenda-chip button:hover {
  color: var(--text);
}

@media (max-width: 1280px) {
  /* uma coluna; a sidebar sai do fluxo e vira drawer deslizante */
  .clients-agenda-view {
    grid-template-columns: 1fr;
  }
  .clients-agenda-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 60;
    width: min(360px, 90vw);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 16px;
    background: var(--bg);
    box-shadow: -12px 0 32px rgba(15, 23, 42, .18);
    overflow-y: auto;
    align-content: start;
    transform: translateX(100%);
    transition: transform .22s ease;
  }
  .clients-agenda-sidebar.is-open {
    transform: translateX(0);
  }
  .clients-agenda-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, .4);
  }
  .clients-agenda-backdrop[hidden] {
    display: none;
  }
  .clients-agenda-drawer-close {
    display: inline-flex;
    align-self: flex-end;
    margin-bottom: 4px;
  }

  /* botoes compactos (Filtros/Criar) aparecem na toolbar */
  .clients-agenda-compact-btn {
    display: inline-flex;
  }

  /* toolbar em linha unica: titulo nunca quebra nem e sobreposto pela busca */
  .clients-agenda-toolbar {
    gap: 10px;
  }
  .clients-agenda-titlebar {
    flex: 1 1 auto;
  }
  .clients-agenda-titlebar h2 {
    font-size: clamp(16px, 2.4vw, 22px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .clients-agenda-tools {
    flex-wrap: nowrap;
    gap: 8px;
  }
  /* busca colapsa em lupa e expande no foco (mesmo campo #clientsAgendaSearch) */
  .clients-agenda-search {
    width: 40px;
    min-width: 0;
    overflow: hidden;
    transition: width .2s ease;
  }
  .clients-agenda-search:focus-within {
    width: min(260px, 56vw);
  }
  #clientsAgendaViewMode {
    min-width: 92px;
  }

  /* faixa de chips de filtros ativos */
  .clients-agenda-chips:not([hidden]) {
    display: flex;
  }

  /* dias da semana abreviados */
  .clients-agenda-weekdays span {
    font-size: 0;
  }
  .clients-agenda-weekdays span::after {
    content: attr(data-short);
    font-size: 12px;
  }

  .clients-agenda-day {
    min-height: 116px;
  }
}

@media (max-width: 768px) {
  .clients-agenda-day {
    min-height: 92px;
    padding: 6px;
  }
  .clients-agenda-day-number {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .clients-agenda-event {
    min-height: 22px;
    padding: 3px 5px;
    font-size: 11px;
  }
  .clients-agenda-compact-create span:last-child {
    display: none;
  }
}

/* Header global em largura reduzida: evita textos cortados (avatar sem nome,
   busca mais estreita, nome da org com reticencias). AFETA todas as telas. */
@media (max-width: 1280px) {
  .topbar-user-copy {
    display: none;
  }
  .topbar .search-box {
    width: min(240px, 26vw);
  }
  .topbar-license-text strong {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.client-management-search {
  display: grid;
  min-width: min(360px, 48vw);
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-management-search input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.client-management-search input:focus {
  outline: 2px solid rgba(0, 88, 190, .18);
  border-color: var(--secondary);
}

.clients-table {
  min-width: 0;
  table-layout: fixed;
}

.clients-table th,
.clients-table td {
  height: auto;
  padding: 18px 14px;
  font-size: 15px;
  line-height: 1.32;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.clients-table th {
  font-size: 11px;
}

.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
  width: 20%;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
  width: 10%;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
  width: 13%;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
  width: 10%;
}

.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
  width: 10%;
}

.clients-table th:nth-child(6),
.clients-table td:nth-child(6) {
  width: 10%;
}

.clients-table th:nth-child(7),
.clients-table td:nth-child(7) {
  width: 17%;
}

.clients-table th:nth-child(8),
.clients-table td:nth-child(8) {
  width: 10%;
}

.clients-table td strong,
.clients-table td small {
  display: block;
}

.clients-table td strong {
  font-size: 16px;
  line-height: 1.25;
}

.clients-table td small {
  max-width: none;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.32;
}

.clients-table td:nth-child(8) {
  padding-right: 10px;
}

.clients-table td:nth-child(8) .ghost-link {
  display: block;
  width: fit-content;
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.2;
}

.clients-table tbody tr,
.commercial-client-card,
.process-table tbody tr {
  cursor: pointer;
}

.client-detail-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.client-profile-panel {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 18px;
  padding: 26px;
}

.client-profile-panel h1 {
  margin: 0;
  font-size: 24px;
  text-align: center;
}

.client-profile-panel > strong {
  color: var(--muted);
  text-align: center;
}

.client-photo-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.client-photo-placeholder .icon,
.client-default-avatar {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #9aa6b7;
}

.client-default-avatar {
  border: 0;
  background: linear-gradient(135deg, #0f5fc7, #23a6f2);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 16px 34px rgba(15, 95, 199, 0.24);
}

.client-data-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.client-data-section h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-data-section dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px 12px;
  margin: 0;
}

.client-data-section dt {
  color: var(--muted);
  font-size: 13px;
}

.client-data-section dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.client-activity-panel {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.client-detail-tabs {
  order: 0;
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.client-detail-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5565;
  white-space: nowrap;
  font-weight: 700;
}

.client-detail-tabs button.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.interaction-card {
  order: 2;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.interaction-card[hidden],
.client-detail-metrics[hidden] {
  display: none;
}

.interaction-tabs,
.interaction-actions,
.interaction-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.interaction-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #4b5564;
}

.interaction-tabs button.is-active {
  color: var(--blue);
  font-weight: 700;
}

.interaction-actions {
  color: #667386;
}

.interaction-card > textarea:not(#clientInteractionNote) {
  display: none;
}

.interaction-card textarea {
  min-height: 86px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.interaction-footer {
  justify-content: space-between;
}

.client-detail-metrics {
  order: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
}

.client-detail-metrics.client-process-context {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-process-context-heading,
.client-process-context-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.client-process-context h2,
.client-process-context p {
  margin: 0;
}

.client-process-context h2 {
  margin-top: 6px;
  font-size: 26px;
}

.client-process-context p {
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.client-process-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(94px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.client-process-progress span {
  min-width: 94px;
  padding: 11px 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #f6f8fb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.client-process-progress span:last-child {
  border-right: 0;
}

.client-process-progress .is-complete {
  color: #08775a;
  background: #e8f8f1;
}

.client-process-progress .is-current {
  color: #fff;
  background: var(--blue);
}

.client-process-context-footer strong,
.client-process-context-footer small {
  display: block;
}

.client-process-context-footer small {
  max-width: 680px;
  margin-top: 6px;
  color: var(--muted);
}

.client-process-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.process-stage-action-button {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.process-stage-primary-action {
  border-color: #b8c7dc;
  background: #fff;
  color: var(--ink);
}

.process-stage-primary-action:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.process-stage-advance-action {
  border-color: #cad5e4;
  background: #fff;
  color: #334155;
}

.process-stage-advance-action:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #f7fbff;
}

@media (max-width: 860px) {
  .client-process-context-heading,
  .client-process-context-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-process-actions {
    justify-content: flex-start;
  }

  .process-stage-action-button {
    width: 100%;
  }
}

.client-timeline-card {
  order: 3;
  padding: 24px;
}

.client-rdv-card,
.client-service-orders-card,
.client-proposals-card,
.client-contracts-card,
.client-contacts-card,
.client-demands-card,
.client-attachments-card {
  order: 3;
  overflow: hidden;
}

.client-rdv-card .card-header,
.client-service-orders-card .card-header,
.client-proposals-card .card-header,
.client-contracts-card .card-header,
.client-contacts-card .card-header,
.client-demands-card .card-header,
.client-attachments-card .card-header {
  padding: 22px 24px;
}

.client-rdv-card h2,
.client-service-orders-card h2,
.client-proposals-card h2,
.client-contracts-card h2,
.client-contacts-card h2,
.client-demands-card h2,
.client-attachments-card h2 {
  margin: 5px 0 0;
}

.client-rdv-table,
.client-service-orders-table,
.client-proposals-table,
.client-contracts-table,
.client-contacts-table,
.client-demands-table,
.client-attachments-table {
  min-width: 760px;
}

.client-rdv-table td,
.client-service-orders-table td,
.client-proposals-table td,
.client-contracts-table td,
.client-contacts-table td,
.client-demands-table td,
.client-attachments-table td {
  height: 72px;
}

.client-rdv-table td strong,
.client-rdv-table td small,
.client-service-orders-table td strong,
.client-service-orders-table td small,
.client-proposals-table td strong,
.client-proposals-table td small,
.client-contracts-table td strong,
.client-contracts-table td small,
.client-contacts-table td strong,
.client-contacts-table td small,
.client-demands-table td strong,
.client-demands-table td small,
.client-attachments-table td strong,
.client-attachments-table td small {
  display: block;
}

.client-rdv-table td small,
.client-service-orders-table td small,
.client-proposals-table td small,
.client-contracts-table td small,
.client-contacts-table td small,
.client-demands-table td small,
.client-attachments-table td small {
  margin-top: 4px;
  color: var(--muted);
}

/* ===== Aba "Negociações" do cliente (visão CRM) ===== */
.client-negotiations-card { padding: 18px; }

.client-neg-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.client-neg-subtabs {
  display: inline-flex; background: #eef2f7; border-radius: 999px; padding: 4px; gap: 2px;
}
.client-neg-subtab {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #64748b;
}
.client-neg-subtab.is-active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.client-neg-new-button { border-radius: 10px; }

.client-neg-view[hidden] { display: none; }

.client-neg-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
.cn-card {
  border-radius: 10px; padding: 13px 14px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid transparent;
}
.cn-card-title { font-size: 12px; font-weight: 600; }
.cn-card-value { font-size: 20px; font-weight: 600; line-height: 1.1; }
.cn-card-value .cn-cur { font-size: 12px; font-weight: 700; }
.cn-card-value .cn-unit { font-size: 12px; font-weight: 600; opacity: 0.8; }
.cn-card-andamento { background: #E4F5FA; }
.cn-card-andamento .cn-card-title { color: #14556B; }
.cn-card-andamento .cn-card-value { color: #0E3E4F; }
.cn-card-vendido { background: #E1F5EE; }
.cn-card-vendido .cn-card-title { color: #0F6E56; }
.cn-card-vendido .cn-card-value { color: #085041; }
.cn-card-perdido { background: #FBEAF0; }
.cn-card-perdido .cn-card-title { color: #993556; }
.cn-card-perdido .cn-card-value { color: #6E2440; }
.cn-card-neutral { background: #f8fafc; border-color: #e6eaf0; }
.cn-card-neutral .cn-card-title { color: #64748b; }
.cn-card-neutral .cn-card-value { color: #0f172a; }

.client-neg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cn-chip {
  border: none; cursor: pointer; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: #eef2f7; color: #475569;
}
.cn-chip.is-active.cn-chip-todas { background: #1B2A3A; color: #fff; }
.cn-chip.is-active.cn-chip-andamento { background: #E4F5FA; color: #14556B; }
.cn-chip.is-active.cn-chip-vendido { background: #E1F5EE; color: #0F6E56; }
.cn-chip.is-active.cn-chip-perdido { background: #FBEAF0; color: #993556; }

.client-neg-table-wrap { border: 1px solid #e6eaf0; border-radius: 12px; overflow: hidden; }
.client-neg-table { width: 100%; border-collapse: collapse; }
.client-neg-table thead th {
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; color: #94a3b8;
  font-weight: 700; text-align: left; padding: 12px 16px; background: #f8fafc;
  border-bottom: 1px solid #e6eaf0;
}
.client-neg-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: 14px;
}
.client-neg-table tbody tr:last-child td { border-bottom: none; }
.client-neg-table .col-neg { width: 42%; }
.client-neg-table .col-resp { width: 12%; }
.client-neg-table .col-status { width: 16%; }
.client-neg-table .col-valor { width: 15%; }
.client-neg-table .col-tarefa { width: 20%; }

.cn-open {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #2563EB; font-weight: 700; font-size: 14px; text-align: left;
}
.cn-open:hover { text-decoration: underline; }
.client-neg-table .col-neg small { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }

.cn-avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: 700;
}
.cn-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.cn-badge.is-andamento { background: #E4F5FA; color: #14556B; }
.cn-badge.is-vendido { background: #E1F5EE; color: #0F6E56; }
.cn-badge.is-perdido { background: #FBEAF0; color: #993556; }
.client-neg-table .col-valor strong { font-weight: 600; color: #0f172a; }

.cn-task { display: inline-flex; align-items: center; gap: 6px; color: #475569; }
.cn-task-ico {
  width: 15px; height: 15px; flex: none;
  background-repeat: no-repeat; background-position: center; background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}
.cn-task-empty { color: #94a3b8; }
.client-neg-hint { margin-top: 12px; font-size: 12px; color: #94a3b8; }

@media (max-width: 760px) {
  .client-neg-cards { grid-template-columns: 1fr; }
  .client-neg-table thead { display: none; }
  .client-neg-table tbody td { display: block; width: auto; padding: 8px 14px; border: none; }
  .client-neg-table tbody tr { display: block; border-bottom: 1px solid #eef2f7; padding: 8px 0; }
}

/* Popup rapido de novo cliente (aberto por cima do modal de criar negociacao). */
.quick-client-modal { z-index: 220; }
.quick-client-card {
  max-width: 480px; width: calc(100% - 32px);
  border-radius: 16px; overflow: hidden; padding: 0;
}
.quick-client-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.quick-client-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #E6F1FB; color: #185FA5;
}
.quick-client-heading { flex: 1 1 auto; min-width: 0; }
.quick-client-heading .eyebrow {
  display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 2px;
}
.quick-client-heading h2 { font-size: 17px; font-weight: 500; margin: 0; line-height: 1.3; }
.quick-client-header .icon-button { flex: 0 0 auto; margin: -4px -4px 0 0; }

.quick-client-body { padding: 20px 24px; display: grid; gap: 12px; }
.quick-client-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #F8FAFC; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.quick-client-note-icon { flex: 0 0 auto; color: #D97706; margin-top: 1px; }
.quick-client-note p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.quick-client-field { display: grid; gap: 4px; }
.quick-client-field > label { font-size: 12px; font-weight: 500; color: var(--muted); }
.quick-client-field .req-mark { color: #DC2626; }
.quick-client-body input {
  min-height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font-size: 14px; color: var(--text); width: 100%;
}
.quick-client-body input:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.quick-client-cnpj-row { display: flex; gap: 8px; align-items: stretch; }
.quick-client-cnpj-row input { flex: 1 1 auto; min-width: 0; }
.quick-client-lookup {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.quick-client-lookup[disabled] { opacity: .6; cursor: progress; }
.quick-client-legend { font-size: 12px; color: var(--muted); }
.quick-client-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-client-required { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.quick-client-required .req-mark { color: #DC2626; }

.quick-client-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; background: #F8FAFC; border-top: 1px solid var(--line);
}
.quick-client-footer .ghost-link { margin-right: auto; }
.quick-client-submit { display: inline-flex; align-items: center; gap: 8px; background: #2563EB; }
.quick-client-submit:hover:not([disabled]) { background: #1D4FD7; }
.quick-client-submit[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 560px) { .quick-client-grid2 { grid-template-columns: 1fr; } }

.proposal-link-card {
  max-width: 480px; width: calc(100% - 32px);
  border-radius: 16px; overflow: hidden; padding: 0;
}
.proposal-link-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.proposal-link-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #E6F1FB; color: #185FA5;
}
.proposal-link-heading { flex: 1 1 auto; min-width: 0; }
.proposal-link-heading .eyebrow {
  display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 2px;
}
.proposal-link-heading h2 { font-size: 17px; font-weight: 500; margin: 0; line-height: 1.3; }
.proposal-link-header .icon-button { flex: 0 0 auto; margin: -4px -4px 0 0; }

.proposal-link-body { padding: 20px 24px; display: grid; gap: 16px; }
.proposal-link-intro { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.proposal-link-intro strong { color: var(--text); font-weight: 600; }

.proposal-link-options { display: grid; gap: 10px; }
.proposal-link-option {
  position: relative; display: flex; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s;
}
.proposal-link-option input { position: absolute; opacity: 0; pointer-events: none; }
.proposal-link-option.is-active { border: 2px solid #2563EB; background: #EFF5FE; padding: 13px; }
.proposal-link-radio {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; transition: border-color .12s;
}
.proposal-link-option.is-active .proposal-link-radio {
  border-color: #2563EB; box-shadow: inset 0 0 0 4px #2563EB;
}
.proposal-link-option-body { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.proposal-link-option-title { font-size: 14px; font-weight: 500; color: var(--text); }
.proposal-link-option-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.proposal-link-existing-fields { display: grid; gap: 6px; margin-top: 8px; }
.proposal-link-existing-fields select {
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 14px; color: var(--text);
}
.proposal-link-existing-fields select:disabled { background: #F3F4F6; color: var(--muted); cursor: not-allowed; }
.proposal-link-count { font-size: 12px; color: var(--muted); }

.proposal-link-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; background: #F8FAFC; border-top: 1px solid var(--line);
}
.proposal-link-footer .ghost-link { margin-right: auto; }
.proposal-link-submit { display: inline-flex; align-items: center; gap: 8px; background: #2563EB; }
.proposal-link-submit:hover { background: #1D4FD7; }

.client-contacts-card .card-header {
  padding: 16px 20px;
}

.client-new-contact-button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

.client-contacts-card .eyebrow {
  font-size: 12px;
}

.client-contacts-card h2 {
  font-size: 22px;
}

.client-contacts-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.client-contacts-table th,
.client-contacts-table td {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.2;
  vertical-align: middle;
}

.client-contacts-table th {
  font-size: 11px;
}

.client-contacts-table td {
  height: 54px;
}

.client-contacts-table td strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.client-contacts-table th:nth-child(1),
.client-contacts-table td:nth-child(1) {
  width: 21%;
}

.client-contacts-table th:nth-child(2),
.client-contacts-table td:nth-child(2) {
  width: 15%;
}

.client-contacts-table th:nth-child(3),
.client-contacts-table td:nth-child(3) {
  width: 24%;
}

.client-contacts-table th:nth-child(4),
.client-contacts-table td:nth-child(4) {
  width: 16%;
}

.client-contacts-table th:nth-child(5),
.client-contacts-table td:nth-child(5) {
  width: 10%;
}

.client-contacts-table th:nth-child(6),
.client-contacts-table td:nth-child(6) {
  width: 14%;
  text-align: right;
}

.client-contacts-table td:nth-child(3),
.client-contacts-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-contacts-table .pill {
  padding: 4px 8px;
  font-size: 9px;
  white-space: nowrap;
}

.client-contacts-table .ghost-link {
  min-height: 28px;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}

.client-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.client-row-actions .ghost-link {
  min-height: 28px;
  padding: 0;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.client-row-actions .danger-action,
.commercial-demand-actions .ghost-link.danger-action {
  color: var(--red);
}

.client-rdv-table th:last-child,
.client-rdv-table td:last-child,
.client-service-orders-table th:last-child,
.client-service-orders-table td:last-child,
.client-demands-table th:last-child,
.client-demands-table td:last-child {
  text-align: right;
}

.client-rdv-table td:last-child .client-row-actions,
.client-service-orders-table td:last-child .client-row-actions {
  justify-content: flex-end;
}

.client-contact-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.client-contact-avatar {
  display: inline-grid;
  flex: 0 0 30px;
  place-items: center;
  overflow: hidden;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0edff;
  color: #155bc7;
  font-size: 11px;
  font-weight: 900;
}

.empty-table-message {
  margin: 0;
  padding: 16px 0;
  color: var(--muted);
  text-align: center;
}

.client-timeline {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 28px;
  border-left: 2px solid var(--line);
}

.client-timeline li {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.client-timeline li::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 18px;
  width: 18px;
  height: 18px;
  border: 4px solid #dce6f4;
  border-radius: 999px;
  background: var(--blue);
}

.client-timeline span {
  color: #303848;
}

.client-timeline small {
  color: var(--muted);
}

.sales-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 32px;
  margin-bottom: 32px;
}

.opportunities-card .card-header {
  padding: 24px 28px;
}

.opportunities-table {
  min-width: 720px;
}

.opportunities-table td {
  height: 84px;
}

.pill.solid {
  background: var(--blue);
  color: #fff;
}

.probability {
  display: inline-block;
  width: 52px;
  height: 6px;
  margin-right: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe3ea;
  vertical-align: middle;
}

.probability i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.goals-card {
  padding: 28px;
}

.goals-card h2 {
  margin: 0 0 32px;
  font-size: 22px;
}

.goal-row {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.goal-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.goal-row small {
  color: #2f3540;
}

.goal-row strong {
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
}

.goal-bar {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe0e7;
}

.goal-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.forecast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.opportunities-table td:last-child {
  white-space: nowrap;
}

.opportunities-table td:last-child .ghost-link + .ghost-link {
  margin-left: 10px;
  color: var(--red);
}

.commercial-demands-card {
  overflow: hidden;
}

.commercial-demands-card .card-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.commercial-demands-table {
  min-width: 980px;
}

.commercial-demands-table td strong,
.commercial-demands-table td small {
  display: block;
}

.commercial-demands-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.demand-report-modal-card {
  width: min(880px, 100%);
}

.demand-report {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.demand-report-document {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.demand-report-document header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 14px;
}

.demand-report-document header span {
  color: var(--primary);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.demand-report-document header strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}

.demand-report-document header small {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}

.demand-report-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demand-report-summary div,
.demand-report-document dl div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.demand-report-summary small,
.demand-report-document dt {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.demand-report-summary strong,
.demand-report-document dd {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.demand-report-document dl {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.demand-report-document dl div:nth-child(7) {
  grid-column: 1 / -1;
}

.implementation-report-document {
  gap: 22px;
}

.implementation-report-section {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.implementation-report-section h3 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

.implementation-report-section p {
  margin: 0;
  color: var(--muted);
}

.implementation-report-section dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.implementation-report-section dl div {
  break-inside: avoid;
}

.commercial-demand-client-search {
  position: relative;
}

.client-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.client-search-results[hidden] {
  display: none;
}

.client-search-results button {
  justify-content: flex-start;
  min-height: auto;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.client-search-results button:last-child {
  border-bottom: 0;
}

.client-search-results button:not(:disabled):hover {
  background: #eef5ff;
}

.client-search-results strong,
.client-search-results small {
  display: block;
}

.client-search-results small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-search-empty-action {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.client-search-empty-action p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.client-search-empty-action .secondary-button {
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.client-hours-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 24px;
}

.client-hours-grid article {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fafc;
}

.client-hours-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-hours-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-hours-grid input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.client-hours-grid strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.client-hours-grid strong.is-negative {
  color: var(--red);
}

.client-hours-grid small {
  color: var(--muted);
  font-size: 13px;
}

.client-hours-breakdown-head {
  padding: 0 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.client-hours-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 24px 4px;
}
.client-hours-breakdown:empty { display: none; }
.client-hours-channel {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}
.client-hours-channel[data-channel="whatsapp"] { border-left-color: #22c55e; }
.client-hours-channel[data-channel="instagram"] { border-left-color: #d6249f; }
.client-hours-channel[data-channel="email"] { border-left-color: #ef4444; }
.client-hours-channel[data-channel="web_chat"] { border-left-color: #2c58e8; }
.client-hours-channel[data-channel="avulso"] { border-left-color: #94a3b8; }
.client-hours-channel .chc-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.client-hours-channel .chc-hours {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.client-hours-channel .chc-count {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 900px) {
  .client-hours-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.client-hours-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 24px 24px;
}

.client-hours-actions .form-status {
  margin: 0;
}

.contract-stage-notice {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid #f2b8b5;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--text);
}

.contract-stage-notice:not([hidden]) {
  display: flex;
}

.contract-stage-notice strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.contract-stage-notice p,
.contract-stage-notice small {
  display: block;
  margin: 0;
}

.contract-stage-notice p {
  color: #7f1d1d;
  line-height: 1.45;
}

.contract-stage-notice small {
  margin-top: 8px;
  color: var(--muted);
}

.contract-stage-notice > span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 8px 12px;
  text-transform: uppercase;
}

.commercial-demand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: flex-end;
  align-items: center;
}

.commercial-demand-actions .ghost-link {
  font-size: 0.78rem;
  line-height: 1.1;
  white-space: nowrap;
}

.commercial-demand-actions .ghost-link.danger-action {
  color: var(--red);
}

.demand-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.demand-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.demand-status.closed {
  background: #d7f8e7;
  color: #047857;
}

.demand-status.in-progress {
  background: #fff4d8;
  color: #a16207;
}

.demand-status.cancelled {
  background: #ffe1df;
  color: #b91c1c;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#clientModal .modal-card {
  width: min(940px, calc(100vw - 28px));
}

.client-contact-modal-card {
  width: min(720px, calc(100vw - 28px));
  overflow: hidden;
}

.client-contact-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  padding: 24px 28px 12px;
}

.client-contact-modal-header {
  align-items: flex-start;
  padding: 26px 30px 22px;
}

.client-contact-modal-header .eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.client-contact-modal-header h2 {
  color: #0f172a;
  font-size: 30px;
  line-height: 1.08;
}

.client-contact-modal-header p {
  max-width: 440px;
  margin-top: 8px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.4;
}

.client-contact-form-grid label {
  gap: 8px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.client-contact-form-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.client-contact-form-grid input {
  height: 52px;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
  font-size: 16px;
}

.client-contact-form-grid input:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, 0.14);
}

#clientContactFormStatus {
  min-height: 0;
  margin: 8px 28px 0;
  padding: 0;
  color: #b45309;
  font-size: 14px;
}

#clientContactFormStatus:empty {
  display: none;
}

#clientContactForm .modal-actions {
  margin-top: 20px;
  padding: 18px 28px 0;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
}

#clientContactForm .modal-actions button {
  min-width: 180px;
  min-height: 54px;
  border-radius: 10px;
  font-size: 16px;
}

.client-contact-form-grid input:disabled {
  color: #64748b;
  background: #f1f5f9;
  cursor: not-allowed;
}

@media (max-width: 680px) {
  .client-contact-form-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .client-contact-form-grid label:nth-child(3) {
    grid-column: auto;
  }

  .client-contact-modal-header {
    padding: 22px 20px 18px;
  }

  #clientContactForm .modal-actions {
    padding-inline: 20px;
  }

  #clientContactForm .modal-actions button {
    width: 100%;
  }
}

.success-modal-backdrop {
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

.service-request-link-client-card {
  max-width: 760px;
  width: min(760px, calc(100vw - 40px));
}

.service-request-link-client-card label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.service-request-link-client-card input {
  min-height: 52px;
}

.service-request-link-client-results {
  position: static;
  margin-top: 10px;
  max-height: 230px;
  overflow: auto;
}

.service-request-link-client-results button {
  text-align: left;
}

.service-request-link-client-card .conversation-link-submit {
  width: 100%;
  margin-top: 14px;
}

.service-request-transfer-backdrop {
  z-index: 320;
}

.service-request-transfer-card {
  width: min(520px, calc(100vw - 32px));
  padding-bottom: 18px;
  overflow: hidden;
}

.service-request-transfer-field {
  display: grid;
  gap: 8px;
  padding: 0 28px 14px;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.service-request-transfer-field select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.service-request-transfer-card .form-status {
  margin: 0 28px 14px;
}

.service-request-transfer-card .modal-actions {
  padding: 0 28px;
}

.success-modal-card {
  width: min(440px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 32px;
  text-align: center;
}

.success-modal-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #dcfce7;
  color: #047857;
  font-size: 28px;
  font-weight: 800;
}

.success-modal-card h2,
.success-modal-card p {
  margin: 0;
}

.success-modal-card p {
  color: var(--muted);
  line-height: 1.5;
}

.delete-confirm-backdrop {
  z-index: 1200;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.delete-confirm-card {
  width: min(430px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 34px 32px 30px;
  text-align: center;
}

.delete-confirm-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 28px;
  font-weight: 900;
}

.delete-confirm-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.delete-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.delete-confirm-actions button {
  min-width: 112px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.delete-confirm-yes {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.22);
}

.delete-confirm-no {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header p {
  margin-top: 6px;
  color: var(--muted);
}

.modal-header .icon-button {
  font-size: 30px;
}

.opportunity-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px;
}

.opportunity-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.opportunity-form input,
.opportunity-form select,
.opportunity-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.opportunity-form textarea {
  resize: vertical;
}

/* Cabecalho do modal de usuario: avatar + titulo + e-mail */
.user-modal-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.user-modal-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
}

.user-modal-heading h2 { margin: 0; }

.user-modal-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  word-break: break-word;
}

/* Titulo de secao dentro do form (Dados do usuario / Seguranca) */
.form-section-title {
  margin: 4px 0 -8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Caixa de MFA: rotulo/descricao a esquerda, botao Redefinir a direita */
.user-mfa-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.user-mfa-box .user-mfa-toggle {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.user-mfa-reset {
  flex: 0 0 auto;
  white-space: nowrap;
}

#userModal #deleteUserButton {
  margin-right: auto;
}

.secondary-button.danger-button {
  color: var(--red);
  border-color: #fecaca;
}

.secondary-button.danger-button:hover {
  background: #fef2f2;
  border-color: var(--red);
}

.user-mfa-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px !important;
}

.user-mfa-toggle input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.user-mfa-toggle span {
  display: grid;
  gap: 4px;
}

.user-mfa-toggle strong {
  color: var(--text);
}

.user-mfa-toggle small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.user-status-stack {
  display: inline-grid;
  gap: 6px;
}

.user-mfa-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.user-mfa-pill.is-disabled {
  background: #f1f5f9;
  color: #64748b;
}

.appointment-online-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.appointment-online-section legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.appointment-online-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 30px;
  font-size: 14px;
  font-weight: 700;
}

.appointment-online-toggle input {
  width: 16px;
  min-height: auto;
  padding: 0;
  accent-color: var(--blue);
}

.appointment-online-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr);
  gap: 12px;
}

.appointment-meeting-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.appointment-meeting-link-row input {
  min-width: 0;
  color: var(--muted);
}

.appointment-meeting-link-row .compact-button {
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
}

.presentation-appointment-card {
  width: min(920px, 100%);
}

.presentation-appointment-card .modal-header {
  padding: 18px 22px;
}

.presentation-appointment-card .modal-header h2 {
  font-size: 26px;
}

.presentation-appointment-card .modal-header p {
  font-size: 16px;
}

.presentation-appointment-form {
  gap: 12px 18px;
  padding: 18px 22px;
}

.presentation-appointment-form label {
  gap: 5px;
  font-size: 15px;
}

.presentation-appointment-form input,
.presentation-appointment-form textarea {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 15px;
}

.presentation-appointment-form textarea {
  min-height: 76px;
}

.presentation-modules-field {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.presentation-modules-field legend {
  padding: 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.presentation-modules-field label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.presentation-modules-field input {
  width: 14px;
  min-height: auto;
  padding: 0;
  accent-color: var(--blue);
}

.presentation-appointment-form .modal-actions {
  align-items: center;
}

.full-field,
.form-status,
.modal-actions {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--red);
}

.form-status[data-state="success"] {
  color: var(--green);
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #6b7280);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.appointment-modal-actions span {
  flex: 1;
}

.danger-button {
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid #ef4444;
  border-radius: 5px;
  color: #b91c1c;
  background: #fff;
}

.process-fields-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.crm-flow-summary {
  display: grid;
  grid-template-columns: 1.35fr .75fr .75fr .9fr 1.15fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.crm-flow-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.crm-flow-summary small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-flow-summary strong {
  overflow: hidden;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-summary-badge,
.crm-field-badge {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-summary-badge.current {
  color: #155bc7;
  background: #dbeafe;
}

.crm-summary-badge.next,
.crm-field-badge.is-filled {
  color: #047857;
  background: #dcfce7;
}

.crm-summary-pending,
.crm-field-badge {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #b45309;
  background: #fef3c7;
  font-size: 11px;
  font-weight: 900;
}

.crm-summary-progress {
  display: grid;
  gap: 5px;
}

.crm-summary-progress span {
  color: #0f172a;
  font-size: 12px;
}

.crm-summary-progress div {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
}

.crm-summary-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .2s ease;
}

.crm-summary-progress em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.process-fields-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.process-fields-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #155bc7;
  background: #dbeafe;
  font-weight: 900;
}

.process-fields-panel h3,
.process-fields-panel h4,
.process-fields-panel p {
  margin: 0;
}

.process-fields-panel p {
  color: var(--muted);
}

.process-fields-panel section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.process-fields-panel h4 {
  grid-column: 1 / -1;
  font-size: 16px;
}

.process-checkbox-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.process-checkbox-group strong {
  color: #172033;
}

.process-checkbox-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.process-checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.process-checkbox-group input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.crm-flow-field {
  position: relative;
  gap: 7px !important;
  min-height: auto;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.crm-flow-field.is-pending,
.crm-flow-field.field-missing {
  border-color: #f97316;
  background: #fff7ed;
}

.crm-flow-field.is-filled {
  border-color: #bbf7d0;
  background: #fff;
}

.crm-flow-field.is-filled input {
  border-color: #cbd5e1;
}

.crm-flow-field input {
  min-height: 42px;
  padding: 9px 11px;
}

.crm-flow-field:has([data-process-field="financial_responsible_cpf"]) {
  align-self: start;
  min-height: 0;
  padding: 10px 12px;
}

.crm-flow-field:has([data-process-field="financial_responsible_cpf"]) input {
  min-height: 42px;
}

.crm-flow-field .crm-field-badge {
  position: absolute;
  top: 10px;
  right: 12px;
}

.crm-flow-field small,
.crm-plan-field small {
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.crm-flow-field small[hidden],
.crm-plan-field small[hidden] {
  display: none;
}

.crm-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-plan-field > div:last-of-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.crm-plan-field label {
  justify-content: flex-start;
  width: 100%;
  min-height: 32px;
  border-radius: 7px;
}

.crm-flow-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #92400e;
  background: #fff7ed;
}

.crm-flow-alert span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: #f59e0b;
  font-size: 13px;
  font-weight: 900;
}

.crm-flow-alert p {
  margin: 0;
  line-height: 1.4;
}

.process-other-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.implementation-checklist-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
}

.implementation-checklist-group h5 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.implementation-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 16px;
}

.implementation-checklist-grid label {
  margin: 0;
}

.field-missing {
  padding: 8px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: #fff5f3;
}

.crm-flow-field.field-missing,
.crm-flow-field.is-pending {
  padding: 12px;
  border-color: #f97316;
  background: #fff7ed;
}

#clientForm.is-focused-requirements .process-fields-panel {
  border-color: var(--blue);
  background: #f2f7ff;
}

#clientForm.is-focused-requirements .process-fields-panel section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-activity-card,
.team-timeline {
  display: none !important;
}

.contract-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 28px;
  margin-bottom: 38px;
}

.contract-stat {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 148px;
  padding: 30px;
}

.contract-stat .eyebrow {
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
}

.contract-stat strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 40px;
  line-height: 1;
}

.contract-stat small {
  color: #07142a;
  font-weight: 600;
}

.danger-text {
  color: var(--red) !important;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.stat-icon.blue {
  color: var(--blue);
  background: #dce5ff;
}

.stat-icon.red {
  color: var(--red);
  background: #ffd7d1;
}

.stat-icon.soft {
  color: #12324d;
  background: #d5e7fb;
}

.contracts-table-card {
  margin-bottom: 38px;
}

.contract-filters {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(260px, 420px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 30px;
  border-bottom: 1px solid var(--line);
}

.contracts-filter-note {
  margin: 0;
  color: var(--muted);
}

.contract-filters label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  font-weight: 600;
}

.contract-filters select,
.contract-filters input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.contract-filters input::placeholder {
  color: var(--muted);
}

.filter-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #222936;
  font-size: 17px;
}

.contracts-table {
  min-width: 1020px;
}

.contracts-table td {
  height: 112px;
  font-size: 18px;
}

.contracts-table td:first-child strong {
  display: block;
  max-width: 230px;
  font-size: 20px;
  line-height: 1.35;
}

.contracts-table td:first-child small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.contracts-table td:nth-child(2) {
  color: #272d37;
  font-size: 20px;
  line-height: 1.35;
}

.contracts-table .pill {
  min-width: 118px;
  justify-content: flex-start;
}

.pill.waiting {
  max-width: 150px;
  background: #dceaff;
  color: var(--blue);
  white-space: normal;
}

.pill.process-pill {
  background: #e7f0ff;
  color: var(--blue);
}

.process-summary-grid {
  display: none;
}

.process-stat {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 138px;
  padding: 24px;
}

.process-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 34px;
  line-height: 1;
}

.process-stat small {
  display: block;
  color: var(--muted);
}

.process-flow-card {
  padding: 28px;
  margin-bottom: 32px;
}

.process-flow-card .card-header {
  margin-bottom: 24px;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
}

.process-flow article {
  position: relative;
  min-height: 132px;
  padding: 22px;
  background: #eef3fb;
  border: 1px solid #d5ddea;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}

.process-flow article:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.process-flow article.is-complete {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.process-flow small {
  display: block;
  color: inherit;
  font-size: 12px;
  text-transform: uppercase;
}

.process-flow strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.process-flow span {
  color: inherit;
  font-size: 14px;
}

.process-content-grid {
  display: block;
}

.process-kanban-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.process-kanban-card .card-header {
  padding: 28px 30px 18px;
}

.process-kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 14px;
  padding: 0 30px 30px;
  overflow-x: auto;
}

.kanban-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.kanban-column.is-drop-target {
  border-color: var(--blue);
  background: #eef5ff;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-column header strong {
  font-size: 13px;
  text-transform: uppercase;
}

.kanban-column header span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--blue);
  font-weight: 800;
}

.kanban-column > div {
  display: grid;
  gap: 10px;
}

.kanban-client-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(29, 41, 57, 0.06);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.kanban-client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(29, 41, 57, 0.1);
}

.kanban-client-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
  cursor: grabbing;
}

.kanban-client-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.kanban-client-card span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.kanban-client-card small,
.kanban-empty {
  color: var(--muted);
  font-size: 13px;
}

.kanban-card-actions {
  display: flex;
  gap: 10px;
  padding-top: 6px;
}

.kanban-card-actions .ghost-link {
  font-size: 13px;
}

.process-table-card {
  display: none;
}

.process-table {
  min-width: 880px;
}

.process-table td {
  height: 92px;
}

.process-table td strong,
.process-table td small {
  display: block;
}

.process-table td small {
  margin-top: 6px;
  color: var(--muted);
}

.process-checklist-card {
  display: none;
  align-content: start;
  gap: 18px;
  padding: 28px;
}

.process-checklist-card h2 {
  margin: 0 0 6px;
}

.process-checklist-card label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.process-checklist-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.process-sla-box {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 18px;
  background: var(--panel);
  border-radius: 6px;
}

.process-sla-box strong {
  font-size: 30px;
}

.process-subflow-card {
  padding: 28px;
}

.process-subflow-card .card-header {
  margin-bottom: 24px;
}

.process-subflow-card .card-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.implementation-clients-list {
  display: grid;
  gap: 22px;
}

.implementation-table-wrap {
  margin-top: 6px;
}

.implementation-clients-table td {
  vertical-align: middle;
}

.implementation-clients-table .primary-button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  white-space: nowrap;
}

.table-progress {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.table-progress strong {
  font-size: 18px;
}

.table-progress .goal-bar {
  height: 7px;
  margin: 0;
}

.table-progress small {
  color: var(--muted);
}

.implementation-editor {
  display: grid;
  gap: 20px;
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.implementation-editor[hidden] {
  display: none;
}

.implementation-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.implementation-editor-header h2,
.implementation-editor-header p {
  margin: 0;
}

.implementation-editor-header h2 {
  margin-top: 12px;
}

.implementation-editor-header p {
  margin-top: 6px;
  color: var(--muted);
}

.implementation-client-heading {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.implementation-client-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.implementation-client-heading strong {
  font-size: 26px;
}

.implementation-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.implementation-editor-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.implementation-editor-summary .implementation-progress {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.implementation-client-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.implementation-client-card > header,
.implementation-client-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.implementation-client-card h3,
.implementation-client-card p {
  margin: 0;
}

.implementation-client-card p {
  color: var(--muted);
}

.implementation-progress {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
}

.implementation-progress strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.implementation-accordion {
  display: grid;
  gap: 12px;
}

.implementation-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.implementation-step[data-blocked="true"] {
  opacity: .58;
}

.implementation-step summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 800;
}

.implementation-step summary small {
  color: var(--blue);
  font-weight: 800;
}

.implementation-step-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 18px 18px;
}

.implementation-step-fields label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.implementation-step-fields input,
.implementation-step-fields select,
.implementation-step-fields textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.implementation-step-fields textarea {
  resize: vertical;
  min-height: 96px;
}

.implementation-field-wide,
.implementation-choice-group {
  grid-column: 1 / -1;
}

.implementation-choice-group {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.implementation-choice-group legend {
  padding: 0 8px;
  font-weight: 800;
}

.implementation-choice-group > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.implementation-choice {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  font-weight: 700;
}

.implementation-choice input {
  width: auto;
  min-height: auto;
  padding: 0;
}

.contracts-bottom-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 0.9fr);
  gap: 36px;
}

.recent-contracts-card {
  padding: 30px;
}

.recent-contracts-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  font-size: 24px;
}

.contract-timeline {
  display: grid;
  gap: 28px;
  margin: 0;
  padding-left: 42px;
  border-left: 3px solid #d0d6df;
}

.contract-timeline li {
  position: relative;
  font-size: 16px;
  line-height: 1.45;
}

.contract-timeline li::before {
  content: "\2022";
  position: absolute;
  left: -52px;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 38px;
  border-radius: 14px;
  background: #8a8f99;
  color: #fff;
}

.contract-timeline li.done::before {
  content: "\2713";
  background: var(--blue);
}

.contract-timeline li.warning::before {
  content: "!";
  background: var(--red);
}

.contract-timeline strong,
.contract-timeline small {
  display: block;
}

.contract-timeline small {
  color: #111827;
}

.efficiency-card {
  min-height: 260px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.45)),
    radial-gradient(circle at 20% 20%, rgba(8, 91, 197, 0.18), transparent 42%);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14);
  color: #fff;
}

.efficiency-card h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 28px;
}

.efficiency-card p {
  max-width: 560px;
  margin: 0 0 96px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.45;
}

.efficiency-card strong {
  color: #dbe8ff;
}

.efficiency-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.efficiency-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c8d8ff;
}

.efficiency-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.settings-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
  margin-bottom: 24px;
}

.settings-workspace {
  margin: -12px -40px 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.settings-tabs {
  display: flex;
  align-items: stretch;
  gap: 18px;
  min-height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.settings-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  min-height: 52px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #647084;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.settings-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.settings-tabs button.is-active {
  color: #7e2fb2;
}

.settings-tabs button.is-active::after {
  background: #7e2fb2;
}

.settings-tab-panel {
  padding: 24px 16px 36px;
}

.settings-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(278px, 100%), 278px));
  justify-content: start;
  gap: 18px;
}

.settings-hub-card {
  width: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.settings-hub-card:hover,
.settings-hub-card.is-selected {
  border-color: #b78bd3;
  box-shadow: 0 16px 38px rgba(67, 37, 86, 0.12);
  transform: translateY(-1px);
}

.settings-hub-card.is-static {
  cursor: default;
}

.settings-hub-card.is-static:hover {
  border-color: #dfe4ec;
  box-shadow: none;
  transform: none;
}

.settings-hub-card strong {
  font-size: 16px;
}

.settings-hub-card small {
  color: #647084;
  line-height: 1.4;
}

.settings-card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #2c58e8;
  background: #dbeafe;
}

.settings-card-icon .icon {
  width: 26px;
  height: 26px;
}

.settings-card-icon.violet {
  color: #5958e9;
  background: #e9e7ff;
}

.settings-card-icon.purple {
  color: #873cec;
  background: #eee0ff;
}

.settings-card-icon.green {
  color: #05a451;
  background: #d7f8e4;
}

.whatsapp-logo-icon {
  width: 31px;
  height: 31px;
  display: block;
  fill: currentColor;
}

.settings-card-icon.yellow {
  color: #d67b00;
  background: #fff0b8;
}

.settings-card-icon.gray {
  color: #657187;
  background: #eef2f7;
}

.settings-card-icon.white {
  color: #111827;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.openai-mark {
  font-weight: 800;
  letter-spacing: 0;
}

.knowledge-base-card {
  display: grid;
  gap: 18px;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 32px clamp(24px, 4vw, 44px);
  box-sizing: border-box;
}

.settings-detail-modal-body:has(#settings-detail-company-knowledge) {
  padding: clamp(20px, 3vw, 34px);
}

.settings-detail-modal-body:has(#settings-detail-company-knowledge) .settings-detail-panel {
  align-items: start;
}

.knowledge-base-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.knowledge-base-form .full-field {
  grid-column: 1 / -1;
}

.knowledge-base-form label {
  display: grid;
  gap: 8px;
  color: #172033;
  font-weight: 800;
}

.knowledge-base-form label span,
.knowledge-base-section-header strong {
  font-size: 13px;
}

.knowledge-base-form input,
.knowledge-base-form select,
.knowledge-base-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.knowledge-base-form textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.5;
}

.knowledge-base-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #edf1f7;
}

.knowledge-base-section-header small,
.knowledge-base-empty small {
  display: block;
  margin-top: 4px;
  color: #647084;
  font-weight: 600;
}

.knowledge-base-articles {
  display: grid;
  gap: 14px;
}

.knowledge-base-article {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fbfdff;
}

.knowledge-base-article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.knowledge-base-active-toggle {
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 8px !important;
  width: fit-content;
}

.knowledge-base-active-toggle input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.knowledge-base-article-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 14px;
}

.knowledge-base-empty {
  padding: 18px;
  border: 1px dashed #c8d5e8;
  border-radius: 8px;
  color: #172033;
  background: #f8fbff;
  text-align: center;
}

.knowledge-base-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .knowledge-base-form,
  .knowledge-base-article-grid {
    grid-template-columns: 1fr;
  }
}

.knowledge-base-page {
  width: min(100%, 1320px);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.settings-detail-modal-card:has(#settings-detail-company-knowledge) {
  width: min(1440px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
}

.settings-detail-modal-body:has(#settings-detail-company-knowledge) {
  padding: 24px;
  background: #f8fbff;
}

.knowledge-base-page-header,
.knowledge-base-searchbar,
.knowledge-base-filter-panel,
.knowledge-base-table-card,
.knowledge-base-quick-card,
.knowledge-base-metrics article {
  border: 1px solid #dfe7f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.knowledge-base-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.knowledge-base-title-group,
.knowledge-base-header-actions,
.knowledge-base-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-base-title-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1d66f0;
  background: #eef5ff;
}

.knowledge-base-page h2,
.knowledge-base-page h3,
.knowledge-base-page p {
  margin: 0;
}

.knowledge-base-page h2 {
  font-size: 18px;
}

.knowledge-base-page-header p,
.knowledge-base-quick-card p,
.knowledge-base-table-footer,
.knowledge-base-table td small {
  color: #647084;
  font-size: 12px;
}

.knowledge-base-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.knowledge-base-metrics article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: center;
  padding: 16px;
}

.knowledge-base-metrics article strong {
  font-size: 24px;
  line-height: 1;
}

.knowledge-base-metrics article small,
.knowledge-base-metrics article em {
  grid-column: 2;
  color: #647084;
  font-style: normal;
  font-size: 12px;
}

.knowledge-base-metric-icon {
  grid-row: span 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.knowledge-base-metric-icon.blue { color: #1d66f0; background: #eef5ff; }
.knowledge-base-metric-icon.green { color: #16a34a; background: #eafaf0; }
.knowledge-base-metric-icon.amber { color: #f59e0b; background: #fff7e6; }
.knowledge-base-metric-icon.purple { color: #9333ea; background: #f4e8ff; }

.knowledge-base-searchbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(150px, .7fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
}

.knowledge-base-searchbar label,
.knowledge-base-filter-panel label,
.knowledge-base-quick-card label {
  display: grid;
  gap: 7px;
  color: #46556f;
  font-size: 12px;
  font-weight: 800;
}

.knowledge-base-searchbar input,
.knowledge-base-searchbar select,
.knowledge-base-filter-panel select,
.knowledge-base-filter-panel textarea,
.knowledge-base-quick-card input,
.knowledge-base-quick-card select,
.knowledge-base-quick-card textarea,
.knowledge-base-table-toolbar select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d5dfed;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.knowledge-base-search-field {
  position: relative;
}

.knowledge-base-search-field .icon {
  position: absolute;
  left: 12px;
  bottom: 11px;
  width: 16px;
  height: 16px;
  color: #8a98ad;
}

.knowledge-base-search-field input {
  padding-left: 38px;
}

.knowledge-base-layout {
  display: grid;
  grid-template-columns: 220px minmax(520px, 1fr);
  gap: 18px;
  align-items: start;
}

.knowledge-base-filter-panel,
.knowledge-base-quick-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.knowledge-base-filter-panel h3,
.knowledge-base-quick-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.knowledge-base-filter-panel textarea,
.knowledge-base-quick-card textarea {
  min-height: 90px;
  resize: vertical;
}

.knowledge-base-apply-button,
.knowledge-base-quick-card .primary-button {
  width: 100%;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 12px;
  color: #fff;
  background: #16b957;
  font-weight: 900;
}

.knowledge-base-table-card {
  overflow: hidden;
}

.knowledge-base-table-toolbar,
.knowledge-base-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.knowledge-base-tabs {
  display: flex;
  gap: 18px;
}

.knowledge-base-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 0;
  background: transparent;
  color: #647084;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.knowledge-base-tabs button.is-active {
  border-color: #1d66f0;
  color: #1d66f0;
}

.knowledge-base-table-wrap {
  overflow-x: auto;
}

.knowledge-base-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.knowledge-base-table th,
.knowledge-base-table td {
  padding: 13px 14px;
  border-top: 1px solid #edf1f7;
  color: #172033;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.knowledge-base-table th {
  color: #647084;
  font-size: 11px;
  font-weight: 900;
}

.knowledge-base-title-cell {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.knowledge-base-title-cell .icon {
  width: 16px;
  height: 16px;
  color: #1d66f0;
  flex: 0 0 auto;
}

.knowledge-base-status-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.knowledge-base-status-pill.published { color: #047857; background: #dcfce7; }
.knowledge-base-status-pill.draft { color: #b45309; background: #fef3c7; }
.knowledge-base-status-pill.archived { color: #475569; background: #f1f5f9; }

.knowledge-base-quick-card {
  border-color: #c9f0d8;
  background: #f5fff9;
}

.knowledge-base-quick-card h3 span {
  color: #16a34a;
}

.knowledge-base-quick-card label small {
  justify-self: end;
  color: #647084;
  font-weight: 700;
}

.knowledge-article-modal {
  position: fixed;
  inset: var(--topbar-height) 0 0 var(--sidebar-collapsed-width, 84px);
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
}

.knowledge-article-modal[hidden] {
  display: none;
}

.knowledge-article-modal-card {
  width: min(780px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 54px));
  max-height: calc(100dvh - var(--topbar-height) - 54px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .28);
}

.knowledge-article-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5ebf5;
}

.knowledge-article-modal-header h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.knowledge-article-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  padding: 22px 24px 24px;
  overflow: auto;
}

.knowledge-article-form .full-field {
  grid-column: 1 / -1;
}

.knowledge-article-form label {
  display: grid;
  gap: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.knowledge-article-form input,
.knowledge-article-form select,
.knowledge-article-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d2dceb;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.knowledge-article-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.knowledge-article-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 1380px) {
  .knowledge-base-layout {
    grid-template-columns: 230px minmax(460px, 1fr);
  }
}

@media (max-width: 1120px) {
  .knowledge-base-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-base-filter-panel,
  .knowledge-base-quick-card {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .knowledge-base-filter-panel h3,
  .knowledge-base-apply-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .knowledge-base-page-header,
  .knowledge-base-header-actions,
  .knowledge-base-table-toolbar,
  .knowledge-base-table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-base-metrics,
  .knowledge-base-searchbar,
  .knowledge-base-filter-panel,
  .knowledge-base-quick-card {
    grid-template-columns: 1fr;
  }

  .knowledge-article-modal {
    inset: var(--topbar-height) 0 0;
    padding: 14px;
  }

  .knowledge-article-modal-card {
    width: calc(100vw - 28px);
  }

  .knowledge-article-form {
    grid-template-columns: 1fr;
  }
}

.settings-detail-panel {
  margin-top: 0;
}

/* ===== Cadastro de Produtos (Configuracoes > Empresa) ===== */
.products-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.products-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.product-form {
  display: grid;
  gap: 14px;
  margin: 4px 20px 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
}
.product-form-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}
.product-form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.product-form-grid .product-field-full {
  grid-column: 1 / -1;
}
.product-form-grid input,
.product-form-grid textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.product-form-grid textarea {
  min-height: 72px;
  resize: vertical;
}
.product-form-grid .req-mark {
  color: #dc2626;
}
.product-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.products-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.products-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.products-table th,
.products-table td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
/* Uma linha por produto: nome e descricao truncam em previa (texto completo no
   title/hover; conteudo integral ao Editar). */
.products-table th:nth-child(1), .products-table td:nth-child(1) { width: 26%; }
.products-table th:nth-child(3), .products-table td:nth-child(3) { width: 120px; }
.products-table th:nth-child(4), .products-table td:nth-child(4) { width: 150px; }
.products-cell-name,
.products-cell-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.products-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.products-table .products-empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 22px;
}
.products-row-actions {
  display: flex;
  gap: 12px;
  white-space: nowrap;
}
.products-row-actions .products-delete {
  color: #dc2626;
}
@media (max-width: 640px) {
  .product-form-grid { grid-template-columns: 1fr; }
}

.settings-detail-modal-open {
  overflow: hidden;
}

.settings-detail-modal {
  top: var(--topbar-height);
  bottom: 0;
  left: var(--sidebar-collapsed-width, 84px);
  right: 0;
  inset: var(--topbar-height) 0 0 var(--sidebar-collapsed-width, 84px);
  width: calc(100vw - var(--sidebar-collapsed-width, 84px));
  z-index: 1200;
  align-items: start;
  justify-items: center;
  place-items: start center;
  padding: 16px 24px 24px;
}

.settings-detail-modal-card {
  width: min(1120px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
  max-height: calc(100dvh - var(--topbar-height) - 46px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.settings-detail-modal-card:has(#settings-detail-api-openai) {
  width: min(720px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 42px));
  border-top: 3px solid #8e3bb8;
}

.settings-detail-modal.is-process-template-modal {
  align-items: center;
  justify-items: center;
  place-items: center;
  left: var(--sidebar-collapsed-width, 84px);
  width: calc(100vw - var(--sidebar-collapsed-width, 84px));
  padding: 22px 26px 22px 18px;
}

.settings-detail-modal.is-process-template-modal .settings-detail-modal-card {
  position: relative;
  width: min(1380px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 44px));
  min-width: min(760px, calc(100vw - var(--sidebar-collapsed-width, 84px) - 44px));
  max-width: calc(100vw - var(--sidebar-collapsed-width, 84px) - 44px);
  max-height: calc(100dvh - var(--topbar-height) - 56px);
  resize: horizontal;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

.settings-detail-modal.is-process-template-modal .settings-detail-modal-card::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 42%, #94a3b8 42% 50%, transparent 50% 100%),
    linear-gradient(135deg, transparent 0 62%, #cbd5e1 62% 70%, transparent 70% 100%);
  opacity: .75;
}

@media (max-width: 920px) {
  .settings-detail-modal {
    inset: var(--topbar-height) 0 0;
    left: 0;
    width: 100vw;
    padding: 14px;
  }

  .settings-detail-modal-card,
  .settings-detail-modal-card:has(#settings-detail-company-knowledge),
  .settings-detail-modal-card:has(#settings-detail-api-openai) {
    width: calc(100vw - 28px);
  }

  .settings-detail-modal.is-process-template-modal {
    left: 0;
    width: 100vw;
    padding: 14px;
  }

  .settings-detail-modal.is-process-template-modal .settings-detail-modal-card {
    width: calc(100vw - 28px);
    min-width: 0;
    resize: none;
  }

  .settings-detail-modal.is-process-template-modal .settings-detail-modal-card::after {
    display: none;
  }
}

.settings-detail-modal-body {
  min-height: 220px;
  overflow: auto;
  padding: 24px;
  background: #f8fafc;
}

.settings-detail-modal-body:has(#settings-detail-api-openai) {
  padding: 0;
  background: #fff;
}

.settings-detail-modal-body .settings-detail-panel {
  display: grid;
  gap: 18px;
}

.settings-detail-modal-body .settings-detail-panel > .card,
.settings-detail-modal-body .settings-detail-panel > .settings-top-grid,
.settings-detail-modal-body .settings-detail-panel > .settings-bottom-grid,
.settings-detail-modal-body .settings-detail-panel > .user-summary-grid,
.settings-detail-modal-body .settings-detail-panel > .users-table-card,
.settings-detail-modal-body .settings-detail-panel > .utility-grid,
.settings-detail-modal-body .settings-detail-panel > .permissions-card,
.settings-detail-modal-body .settings-detail-panel > .channels-automation-grid,
.settings-detail-modal-body .settings-detail-panel > .whatsapp-integration-card,
.settings-detail-modal-body .settings-detail-panel > .whatsapp-flow-card {
  margin-bottom: 0;
}

.openai-assistant-config-card {
  display: grid;
  gap: 10px;
  padding: 22px 20px 0;
  background: #fff;
}

.openai-assistant-config-card p {
  margin: 0 0 28px;
  color: #111827;
  font-size: 14px;
}

.openai-assistant-config-card label {
  display: grid;
  gap: 6px;
}

.openai-assistant-config-card label > span {
  color: #c5cbd6;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.openai-assistant-config-card input[type="text"],
.openai-assistant-config-card input[type="password"] {
  width: 100%;
  height: 32px;
  border: 1px solid #edf0f4;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.openai-assistant-toggle {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 7px !important;
}

.openai-assistant-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #22c55e;
}

.openai-assistant-toggle span {
  color: #53617a !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.openai-assistant-actions {
  display: flex;
  gap: 4px;
  margin: 34px -20px 0;
  padding: 16px 14px 14px;
  border-top: 1px solid #edf0f4;
  background: #fff;
}

.openai-cancel-button,
.openai-test-button,
.openai-save-button {
  min-height: 30px;
  padding: 0 16px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.openai-cancel-button {
  background: #222;
}

.openai-test-button {
  background: #2563eb;
}

.openai-save-button {
  background: #22c55e;
}

.openai-cancel-button:disabled,
.openai-test-button:disabled,
.openai-save-button:disabled {
  opacity: .65;
  cursor: wait;
}

.openai-assistant-status {
  min-height: 20px;
  margin: 4px 0 -16px;
  color: #92400e;
  font-size: 13px;
}

.openai-assistant-status[data-state="success"] {
  color: #15803d;
}

.openai-assistant-status[data-state="error"] {
  color: #b91c1c;
}

.settings-detail-panel > .card,
.settings-detail-panel > .settings-top-grid,
.settings-detail-panel > .settings-bottom-grid,
.settings-detail-panel > .user-summary-grid,
.settings-detail-panel > .users-table-card,
.settings-detail-panel > .utility-grid,
.settings-detail-panel > .permissions-card,
.settings-detail-panel > .channels-automation-grid,
.settings-detail-panel > .whatsapp-integration-card,
.settings-detail-panel > .whatsapp-flow-card {
  margin-bottom: 18px;
}

.company-params-card,
.departments-card {
  padding: 24px;
}

.company-params-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin: 0;
}

.company-params-list div,
.department-grid article {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.company-params-list dt {
  margin-bottom: 6px;
  color: #647084;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.company-params-list dd {
  margin: 0;
  color: #172033;
  font-weight: 800;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.department-grid strong,
.department-grid small {
  display: block;
}

.department-grid small {
  margin-top: 6px;
  color: #647084;
  line-height: 1.45;
}

.process-template-builder {
  display: grid;
  gap: 28px;
}

.process-template-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0 14px;
}

.process-template-toolbar .secondary-button,
.process-template-toolbar .primary-button {
  min-height: 58px;
  padding: 0 28px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.process-template-toolbar .primary-button {
  min-width: 240px;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .22);
}

.process-template-toolbar .secondary-button {
  color: #1d4ed8;
  background: #fff;
}

.process-template-toolbar .process-template-reorder-button {
  color: #172033;
}

.process-template-grip-icon {
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: radial-gradient(circle at 4px 4px, #000 0 2px, transparent 2.5px) 0 0 / 10px 10px;
  mask: radial-gradient(circle at 4px 4px, #000 0 2px, transparent 2.5px) 0 0 / 10px 10px;
}

.process-template-save-icon {
  position: relative;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.process-template-save-icon::before {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 10px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.process-template-save-icon::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  content: "";
}

.process-template-stage-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.process-template-stage {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-height: 90px;
  padding: 16px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.process-template-stage:hover {
  border-color: #bfdbfe;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .07);
}

.process-template-stage-remove {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  cursor: pointer;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.process-template-stage-remove:hover,
.process-template-stage-remove:focus-visible {
  border-color: #fca5a5;
  background: #fecaca;
}

.process-template-stage label {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.process-template-stage label small,
.process-template-stage-description small {
  color: #647084;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.process-template-stage input,
.process-template-stage-description input,
.process-template-column li input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.process-template-stage input {
  min-height: 42px;
  padding: 7px 10px;
  border-color: #dbe3ef;
  background: #fff;
  color: #172033;
  font-size: 16px;
}

.process-template-stage input:hover,
.process-template-stage input:focus,
.process-template-stage-description input:hover,
.process-template-stage-description input:focus,
.process-template-column li input:hover,
.process-template-column li input:focus {
  border-color: #bfdbfe;
  background: #fff;
  color: #172033;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.process-template-stage.is-start span {
  background: #16a34a;
}

.process-template-stage.is-active {
  border-color: #2563eb;
  background: #f8fbff;
  color: #172033;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .14);
}

.process-template-stage span,
.process-template-column header span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #64748b;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
}

.process-template-stage.is-active span {
  background: #2563eb;
}

@media (max-width: 760px) {
  .process-template-toolbar {
    justify-content: stretch;
  }

  .process-template-toolbar .secondary-button,
  .process-template-toolbar .primary-button {
    flex: 1 1 100%;
    width: 100%;
  }

  .process-template-stage-flow {
    grid-template-columns: 1fr;
  }
}

.process-template-requirements-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.process-template-requirements-card > .card-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e6edf5;
}

.process-template-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(360px, 1fr);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.process-template-column {
  min-width: 360px;
  min-height: 420px;
  padding: 18px 16px;
  border-right: 1px solid #e6edf5;
}

.process-template-column header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.process-template-column header b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #0f6bea;
  font-size: 12px;
}

.process-template-stage-description {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.process-template-stage-description input {
  min-height: 38px;
  padding: 0 10px;
  border-color: #dbe3ef;
  background: #f8fafc;
  color: #172033;
  font-weight: 700;
}

.process-template-column p {
  margin: 20px 0 16px;
  color: #647084;
  font-size: 13px;
  line-height: 1.45;
}

.process-template-column ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-template-column li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.process-template-column li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #22c55e;
  border-radius: 50%;
  color: #16a34a;
  font-size: 12px;
  grid-column: 1;
  grid-row: 1;
}

.process-template-column li input {
  padding-left: 28px;
  grid-column: 1;
  grid-row: 1;
  min-height: 34px;
  font-size: 13px;
}

.process-template-column li .process-template-required-toggle {
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: #e7f8ee;
  color: #16934f;
  font-weight: 800;
  cursor: pointer;
}

.process-template-column li.is-optional .process-template-required-toggle {
  background: #eef2f7;
  color: #64748b;
}

.process-template-column li .process-template-required-toggle:hover,
.process-template-column li .process-template-required-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.process-template-column li button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #cfe0f6;
  border-radius: 7px;
  background: #fff;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
}

.process-template-column li .process-template-remove-requirement {
  border-color: #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.process-template-column footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.process-template-column footer button {
  min-height: 30px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  font-weight: 800;
  cursor: pointer;
}

.process-template-column footer .process-template-remove-stage-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.smtp-card,
.pop-card,
.webhook-card,
.integrations-card,
.general-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

.smtp-card h2,
.pop-card h2,
.webhook-card h2,
.integrations-card h2,
.general-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.smtp-test-recipient {
  grid-column: 1 / -1;
}

.smtp-card .toggle-panel,
.pop-card .toggle-panel {
  margin-top: auto;
}

.smtp-card .form-actions,
.pop-card .form-actions {
  margin-top: 20px;
}

.smtp-provider-hint {
  margin: 14px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.smtp-provider-hint strong {
  color: #0f4fb8;
}

.email-channel-settings {
  display: block;
}

.email-settings-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.email-settings-tabs button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.email-settings-tabs button.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.email-settings-panel[data-email-settings-panel="technical"].is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.email-settings-panel[hidden] {
  display: none !important;
}

.email-auto-response-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
}

.email-auto-response-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.email-auto-response-header > div {
  min-width: 0;
}

.email-auto-response-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
}

.email-auto-response-delay {
  display: grid;
  flex: 0 0 280px;
  gap: 10px;
  margin-left: auto;
  color: #101418;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.email-auto-response-delay input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #f0f2f5;
  color: #111;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.email-auto-response-form {
  grid-template-columns: 1fr;
}

.email-auto-response-form textarea {
  min-height: 260px;
  resize: vertical;
}

/* Editor do E-mail de Conclusao (texto/link/imagem) */
.email-closing-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}
.email-closing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.email-closing-tool {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: #334155;
}
.email-closing-tool:hover { background: #e2e8f0; }
.email-closing-editor {
  min-height: 180px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  background: #fff;
  overflow: auto;
}
.email-closing-editor:focus { outline: none; border-color: #2563eb; }
.email-closing-editor:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
}
.email-closing-editor img { max-width: 100%; height: auto; }
.email-closing-editor a { color: #2563eb; }
.email-closing-test {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.email-closing-test input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 14px;
}
.email-closing-test input:focus { outline: none; border-color: #2563eb; }
.email-closing-test button { flex: 0 0 auto; white-space: nowrap; }

/* Botoes de bloco na barra de ferramentas */
.email-closing-tool-stars {
  background: #fdf8ec;
  border-color: #f1b32b;
  color: #8a5a0b;
}
.email-closing-tool-stars:hover { background: #fbeecb; }
.email-closing-tool-google {
  background: #eef4fb;
  border-color: #7fa3cc;
  color: #16437e;
}
.email-closing-tool-google:hover { background: #dfeaf7; }

/* Chips dos blocos dentro do editor */
.cf-block-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 2px 8px;
  margin: 0 2px;
  font-size: 12px;
  font-weight: 700;
  border: 1px dashed;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;
}
.cf-chip-stars { background: #fdf8ec; border-color: #f1b32b; color: #8a5a0b; }
.cf-chip-google { background: #eef4fb; border-color: #7fa3cc; color: #16437e; }
.cf-block-chip .cf-chip-x,
.cf-block-chip .cf-chip-edit {
  cursor: pointer;
  font-weight: 400;
  opacity: 0.65;
  font-size: 12px;
}
.cf-block-chip .cf-chip-x:hover,
.cf-block-chip .cf-chip-edit:hover { opacity: 1; }

/* Toggle e campos de avaliacao */
.email-closing-rating-toggle { margin-top: 14px; }
.email-closing-rating-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.email-closing-rating-fields .full-field { flex: 1 1 260px; }
.email-closing-expiry-field {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}
.email-closing-expiry-field input {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 14px;
}

/* Mini-modais (link do Google e previa) */
.email-block-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1200;
}
.email-block-modal[hidden] { display: none; }
.email-block-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25);
}
.email-block-modal-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: #0f172a; }
.email-block-modal-sub { margin: 0 0 10px; font-size: 12px; color: #64748b; }
.email-block-modal-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 12px;
}
.email-block-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.email-closing-preview-box { max-width: 560px; }
.email-closing-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.email-closing-preview-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
}
.email-closing-preview-render {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  max-height: 60vh;
  overflow: auto;
  background: #fff;
}
.email-closing-preview-render img { max-width: 100%; height: auto; }

/* Avaliacao do cliente no detalhe do chamado */
.sr-prop-rating .sr-rating-stars {
  color: #f1b32b;
  font-size: 15px;
  letter-spacing: 1px;
}
.sr-prop-rating .sr-rating-comment {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* Resumo de CSAT na Central de Atendimento */
.csat-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin: 0 0 12px;
  background: #fdf8ec;
  border: 1px solid #f1e2bf;
  border-radius: 10px;
  font-size: 13px;
  color: #6b4e12;
}
.csat-summary[hidden] { display: none; }
.csat-summary-main { display: flex; align-items: baseline; gap: 8px; }
.csat-summary-score { font-size: 20px; font-weight: 700; color: #8a5a0b; }
.csat-summary-stars { color: #f1b32b; font-size: 15px; letter-spacing: 1px; }
.csat-summary-count { color: #94823f; }
.csat-summary-agents { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.csat-summary-agent { white-space: nowrap; }
.csat-summary-agent b { color: #8a5a0b; }

@media (max-width: 900px) {
  .email-auto-response-header {
    flex-direction: column;
  }

  .email-auto-response-delay {
    flex: 1 1 auto;
    width: 100%;
    margin-left: 0;
  }
}

.whatsapp-channel-settings {
  display: block;
  width: 100%;
}

.whatsapp-settings-tabs {
  margin-bottom: 20px;
}

.whatsapp-settings-panel {
  width: 100%;
}

.whatsapp-settings-panel.is-active {
  display: block;
}

.whatsapp-settings-panel[hidden] {
  display: none !important;
}

.whatsapp-settings-panel > .card,
.whatsapp-settings-panel > .integrations-card {
  width: 100%;
}

.settings-form label,
.general-grid label {
  display: grid;
  gap: 10px;
  color: #101418;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-form input,
.general-grid select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #f0f2f5;
  color: #111;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.toggle-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 40px 0 26px;
  padding: 20px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.toggle-panel strong,
.toggle-panel small {
  display: block;
}

.toggle-panel strong {
  font-size: 18px;
}

.toggle-panel small {
  margin-top: 4px;
  color: #343b47;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7ccd5;
}

.switch span::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.switch input:checked + span {
  background: var(--blue);
}

.settings-aside {
  display: grid;
  gap: 24px;
}

.health-panel {
  min-height: 230px;
  padding: 28px;
  border-radius: 6px;
  background: var(--dark);
  color: #fff;
}

.health-panel h2 {
  margin: 14px 0 12px;
}

.health-panel p {
  color: #aeb9cb;
}

.health-panel div {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.health-panel span:not(.icon) {
  padding: 8px 12px;
  border: 1px solid #254d8d;
  border-radius: 3px;
  background: #17346a;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

.update-card {
  padding: 26px;
}

.update-card div {
  display: flex;
  gap: 18px;
  margin-top: 24px;
  padding: 20px;
  border-left: 4px solid var(--blue);
  background: var(--panel-soft);
}

.update-card p {
  margin: 0;
}

.update-card p strong {
  display: block;
  margin-bottom: 6px;
}

.webhook-card {
  margin-bottom: 24px;
}

.settings-bottom-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.6fr);
  gap: 24px;
}

.integration-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 16px;
}

.whatsapp-integration-card {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
  padding: 24px;
}

.whatsapp-connection-card {
  margin-bottom: 18px;
}

.whatsapp-flow-card {
  margin-bottom: 24px;
  padding: 24px;
}

.integration-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.integration-card-header h2 {
  margin-bottom: 8px;
}

.integration-card-header p,
.integration-helper-text {
  margin: 0;
  color: #64748b;
}

.whatsapp-connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #166534;
  background: #f0fdf4;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.whatsapp-connection-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
}

.whatsapp-connection-status.is-disconnected {
  border-color: #fed7aa;
  color: #b45309;
  background: #fff7ed;
}

.whatsapp-connection-status.is-disconnected i {
  background: #f59e0b;
}

.whatsapp-integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* WhatsApp Oficial (Cloud API) */
.whatsapp-cloud-form {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.whatsapp-cloud-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--text, #334155);
  font-size: 13px;
}

.whatsapp-cloud-field input,
.whatsapp-cloud-field select {
  width: 100%;
}

.whatsapp-cloud-secret,
.whatsapp-cloud-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.whatsapp-cloud-secret input,
.whatsapp-cloud-inline input {
  flex: 1;
  min-width: 0;
}

.whatsapp-cloud-reveal {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-soft, #f8fafc);
  color: var(--text, #334155);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.whatsapp-cloud-reveal:hover { background: #eef2f9; }

.whatsapp-cloud-hint {
  font-weight: 500;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.whatsapp-cloud-help {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: var(--surface-soft, #f8fafc);
  color: var(--text, #475569);
  font-size: 12.5px;
  line-height: 1.55;
}

.whatsapp-cloud-help ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.channels-automation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.channels-automation-grid > .card {
  margin: 0;
  min-width: 0;
  height: 100%;
}

.openai-assistant-channel-card {
  padding: 0;
}

.openai-assistant-channel-card .whatsapp-assistant-card {
  display: grid;
  gap: 18px;
  height: 100%;
  padding: 30px;
  border-radius: inherit;
}

.openai-assistant-channel-card .integration-card-header {
  margin-bottom: 4px;
}

.openai-assistant-channel-card .integration-card-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.openai-assistant-channel-card .integration-card-header p {
  margin: 0;
  color: #64748b;
}

.openai-assistant-channel-card .openai-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #155bc7;
  font-size: 13px;
}

.openai-assistant-channel-card .whatsapp-assistant-actions {
  margin: auto -30px -30px;
  padding: 16px 30px;
}

.openai-assistant-relocated-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.openai-assistant-relocated-card p {
  margin: 0;
  color: #64748b;
}

.danger-outline-button {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #fff;
  font-weight: 800;
}

.danger-outline-button:hover {
  border-color: #ef4444;
  background: #fef2f2;
}

.danger-outline-button:disabled {
  cursor: progress;
  opacity: .65;
}

.whatsapp-qr-placeholder {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

.whatsapp-qr-placeholder[hidden] {
  display: none;
}

.whatsapp-qr-frame {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border-radius: 12px;
  color: #0f4fb8;
  background: #eaf2ff;
  font-weight: 900;
  overflow: hidden;
}

.whatsapp-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.whatsapp-qr-placeholder p {
  margin: 0;
  color: #475569;
}

.channels-automation-grid {
  gap: 18px;
}

.whatsapp-connection-card,
.openai-assistant-channel-card,
.instagram-integration-card {
  overflow: hidden;
  min-height: 390px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    #fff;
  box-shadow: 0 20px 58px rgba(15, 23, 42, 0.08);
}

.whatsapp-integration-card.whatsapp-connection-card {
  gap: 0;
  padding: 20px;
}

.whatsapp-connection-card .integration-card-header,
.openai-assistant-channel-card .integration-card-header {
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.integration-card-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.settings-card-icon.instagram {
  background:
    radial-gradient(circle at 72% 25%, #fef3c7 0 7px, transparent 8px),
    linear-gradient(135deg, #f97316 0%, #db2777 48%, #7c3aed 100%);
}

.instagram-brand-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 9px;
  color: #ffffff;
}

.instagram-brand-icon::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.instagram-brand-icon::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.instagram-brand-icon.large {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #db2777;
  background: #fdf2f8;
}

.instagram-brand-icon.large::before {
  width: 13px;
  height: 13px;
}

.instagram-integration-form {
  display: grid;
  gap: 18px;
}

.instagram-integration-card .integration-card-header {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.instagram-integration-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 8px 14px;
  border: 1px solid #e9d5ff;
  border-radius: 999px;
  color: #7c3aed;
  background: #faf5ff;
  font-size: 13px;
  font-weight: 800;
}

.instagram-integration-status i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a855f7;
}

.instagram-integration-status.is-enabled {
  border-color: #bbf7d0;
  color: #15803d;
  background: #f0fdf4;
}

.instagram-integration-status.is-enabled i {
  background: #22c55e;
}

.instagram-integration-notice {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  background: #faf5ff;
  color: #581c87;
}

.instagram-integration-notice small {
  color: #6b21a8;
  line-height: 1.4;
}

.instagram-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.instagram-settings-grid label {
  display: grid;
  gap: 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
}

.instagram-settings-grid input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
}

.instagram-settings-grid .full-field,
.instagram-integration-actions {
  grid-column: 1 / -1;
}

.instagram-integration-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.instagram-integration-actions .form-status {
  margin: 0;
}

.instagram-integration-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.instagram-integration-action-buttons .secondary-button,
.instagram-integration-action-buttons .primary-button {
  min-height: 52px;
  padding-inline: 22px;
}

.integration-card-title h2 {
  margin: 1px 0 8px;
  color: #0f172a;
  font-size: clamp(22px, 1.7vw, 30px);
  line-height: 1.12;
  letter-spacing: 0;
}

.integration-card-title p {
  max-width: 560px;
  color: #53617a;
  font-size: 15px;
  line-height: 1.45;
}

.whatsapp-brand-icon,
.openai-assistant-channel-card .openai-mark {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.whatsapp-brand-icon {
  position: relative;
  background: linear-gradient(180deg, #5bed65 0%, #11bc49 100%);
  box-shadow: inset 0 -10px 18px rgba(3, 132, 49, 0.16), 0 14px 28px rgba(34, 197, 94, 0.2);
}

.whatsapp-brand-icon::before {
  content: "\260e";
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  transform: rotate(-18deg);
}

.whatsapp-brand-icon::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 11px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, transparent 0 48%, #fff 49% 100%);
  transform: rotate(-17deg);
}

.whatsapp-connection-card .whatsapp-connection-status {
  margin-top: 2px;
  padding: 7px 11px;
  border-color: #b9f0cf;
  background: #f3fbf6;
  color: #11803a;
  font-size: 12px;
}

.whatsapp-current-connection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #b7efcf;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.88));
  color: #0f172a;
}

.whatsapp-current-connection.is-disconnected {
  border-color: #fed7aa;
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.88));
}

.whatsapp-current-check {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #1db954;
  border-radius: 999px;
  color: #1db954;
}

.whatsapp-current-check::before {
  content: "\2713";
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.whatsapp-current-connection.is-disconnected .whatsapp-current-check {
  border-color: #f59e0b;
  color: #b45309;
}

.whatsapp-current-connection strong,
.whatsapp-current-connection small {
  display: block;
}

.whatsapp-current-connection strong {
  font-size: 15px;
  line-height: 1.25;
}

.whatsapp-current-connection small {
  margin-top: 4px;
  color: #53617a;
  font-size: 12px;
}

.whatsapp-current-link {
  width: 18px;
  height: 18px;
  border: 2px solid #22c55e;
  border-radius: 5px;
  opacity: .95;
}

.whatsapp-current-link::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: -5px 0 0 9px;
  border-top: 2px solid #22c55e;
  border-right: 2px solid #22c55e;
}

.whatsapp-current-link::after {
  content: "";
  display: block;
  width: 11px;
  height: 2px;
  margin: -3px 0 0 6px;
  background: #22c55e;
  transform: rotate(-45deg);
  transform-origin: center;
}

.whatsapp-integration-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.whatsapp-integration-actions .primary-button,
.whatsapp-integration-actions .secondary-button,
.whatsapp-integration-actions .danger-outline-button,
.openai-assistant-channel-card .openai-save-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.whatsapp-integration-actions .primary-button {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.16);
}

.whatsapp-integration-actions .secondary-button {
  border-color: #d5dde9;
  background: #fff;
  color: #111827;
}

.whatsapp-integration-actions .danger-outline-button {
  grid-column: 1 / -1;
  margin-top: 2px;
  border-color: #fca5a5;
  background: #fff;
  color: #dc2626;
}

.button-visual-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 15px;
  height: 15px;
}

.shield-button-icon {
  border: 2px solid currentColor;
  border-radius: 8px 8px 10px 10px;
  clip-path: polygon(50% 0, 95% 18%, 87% 74%, 50% 100%, 13% 74%, 5% 18%);
}

.shield-button-icon::before {
  content: "\2713";
  position: absolute;
  left: 4px;
  top: 0;
  font-size: 10px;
  font-weight: 900;
}

.qr-button-icon {
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px,
    linear-gradient(currentColor 0 0) 10px 0 / 5px 5px,
    linear-gradient(currentColor 0 0) 0 10px / 5px 5px,
    linear-gradient(currentColor 0 0) 10px 10px / 5px 5px,
    linear-gradient(currentColor 0 0) 7px 7px / 3px 3px;
  background-repeat: no-repeat;
}

.logout-button-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 2px;
  width: 8px;
  height: 11px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.logout-button-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 5px;
  width: 9px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.whatsapp-connection-card .integration-helper-text {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.78);
  color: #53617a;
  font-size: 12px;
  line-height: 1.45;
}

.whatsapp-connection-card .integration-helper-text::before {
  content: "i";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  border: 2px solid #2563eb;
  border-radius: 999px;
  color: #2563eb;
  font-weight: 800;
}

.openai-assistant-channel-card .whatsapp-assistant-card {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 20px 20px 0;
}

.openai-assistant-channel-card .openai-mark {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  color: #3658e8;
  font-size: 21px;
  font-weight: 900;
}

.openai-assistant-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.04);
}

.openai-feature-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, #edf2ff, #dfe7ff);
}

.openai-feature-icon::before {
  content: "\2726";
  color: #3658e8;
  font-size: 23px;
  font-weight: 900;
}

.openai-feature-icon::after {
  content: "\002b";
  position: absolute;
  right: 9px;
  bottom: 7px;
  color: #3658e8;
  font-size: 14px;
  font-weight: 900;
}

.openai-assistant-feature strong,
.openai-assistant-feature small {
  display: block;
}

.openai-assistant-feature strong {
  color: #172554;
  font-size: 16px;
  line-height: 1.25;
}

.openai-assistant-feature small {
  margin-top: 6px;
  color: #53617a;
  font-size: 13px;
  line-height: 1.45;
}

.openai-assistant-channel-card .openai-assistant-toggle {
  align-items: flex-start;
  gap: 12px !important;
  margin-top: 22px;
}

.openai-assistant-channel-card .openai-assistant-toggle input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 7px;
  accent-color: #22c55e;
}

.openai-assistant-channel-card .openai-assistant-toggle span {
  color: #172554 !important;
  font-size: 14px !important;
  line-height: 1.35;
}

.openai-assistant-channel-card .openai-assistant-toggle strong,
.openai-assistant-channel-card .openai-assistant-toggle small {
  display: block;
}

.openai-assistant-channel-card .openai-assistant-toggle strong {
  color: #172554;
  font-size: 14px;
}

.openai-assistant-channel-card .openai-assistant-toggle small {
  margin-top: 6px;
  color: #53617a;
  font-size: 12px;
  font-weight: 600;
}

.openai-assistant-channel-card .openai-assistant-status {
  min-height: 22px;
  margin: 10px 0 0;
}

.openai-assistant-channel-card .whatsapp-assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
  margin: 18px -20px 0;
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.78);
}

.openai-assistant-channel-card .openai-save-button {
  min-width: 108px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 14px 26px rgba(22, 163, 74, 0.18);
  font-size: 13px;
}

.openai-assistant-channel-card .openai-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #0b5ed7;
  font-size: 13px;
  font-weight: 800;
}

.openai-assistant-channel-card .openai-secondary-button:hover {
  background: #dbeafe;
}

.document-button-icon::before {
  content: "";
  position: absolute;
  inset: 2px 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.document-button-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.whatsapp-assistant-instructions-card {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88dvh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.whatsapp-assistant-instructions-card .modal-header {
  padding: 20px 28px 18px;
}

.whatsapp-assistant-instructions-card .modal-header h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.12;
}

.whatsapp-assistant-instructions-card .modal-header p {
  max-width: 620px;
  line-height: 1.35;
}

.whatsapp-assistant-instructions-body {
  display: grid;
  gap: 14px;
  padding: 20px 28px 10px;
  overflow: auto;
}

.whatsapp-assistant-instructions-body label {
  display: grid;
  gap: 9px;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.whatsapp-assistant-instructions-body textarea {
  width: 100%;
  min-height: 88px;
  max-height: 190px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
}

.whatsapp-assistant-instructions-body textarea:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, .12);
}

#whatsappAssistantInstructionsText {
  min-height: 260px;
  max-height: 360px;
}

.whatsapp-assistant-instructions-actions {
  padding: 14px 28px 18px;
  border-top: 1px solid #e5ebf5;
  background: #fff;
}

@media (max-height: 780px) {
  .whatsapp-assistant-instructions-card {
    max-height: calc(100dvh - 28px);
  }

  .whatsapp-assistant-instructions-card .modal-header {
    padding: 16px 24px 14px;
  }

  .whatsapp-assistant-instructions-body {
    gap: 12px;
    padding: 16px 24px 8px;
  }

  .whatsapp-assistant-instructions-body textarea {
    min-height: 72px;
    max-height: 140px;
  }

  #whatsappAssistantInstructionsText {
    min-height: 200px;
    max-height: 260px;
  }

  .whatsapp-assistant-instructions-actions {
    padding: 12px 24px 14px;
  }
}

.save-button-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.save-button-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 5px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.whatsapp-flow-form {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.integration-card-header.compact {
  margin-bottom: 0;
}

.whatsapp-flow-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-soft, #f1f5f9);
}

.whatsapp-flow-tab {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.whatsapp-flow-tab:hover {
  color: var(--ink, #0f172a);
}

.whatsapp-flow-tab.is-active {
  background: var(--panel, #fff);
  color: var(--blue, #1d4ed8);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.whatsapp-flow-tab-panel {
  display: grid;
  gap: 16px;
}

/* Seletor de canal (WhatsApp | Instagram): nivel acima das abas de secao.
   Cada canal edita um fluxo proprio; visual distinto do segmentado de abas. */
.whatsapp-flow-channels {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  padding: 5px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: var(--panel, #fff);
}

.whatsapp-flow-channel {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.whatsapp-flow-channel:hover {
  color: var(--ink, #0f172a);
  background: var(--surface-soft, #f1f5f9);
}

.whatsapp-flow-channel.is-active {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.whatsapp-flow-channel[data-flow-channel="instagram"].is-active {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  box-shadow: 0 6px 16px rgba(219, 39, 119, .28);
}

.whatsapp-flow-channel-hint {
  margin: 0 0 12px;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
}

/* Caixa de modos de automacao (Assistente IA / Fluxo / Atendimento padrao):
   aparece so quando o flag "Ativar atendimento automatico" esta ligado. */
.whatsapp-flow-modes {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.whatsapp-flow-modes-label {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 700;
}

.whatsapp-flow-mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.whatsapp-flow-mode-card {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 74px;
  padding: 14px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--panel, #fff);
  text-align: left;
  cursor: pointer;
}

.whatsapp-flow-mode-card strong {
  font-size: 14px;
  color: var(--ink, #0f172a);
}

.whatsapp-flow-mode-card small {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.whatsapp-flow-mode-card:hover {
  border-color: var(--blue, #1d4ed8);
}

.whatsapp-flow-mode-card.is-active {
  border-color: var(--blue, #1d4ed8);
  background: rgba(37, 99, 235, .08);
  box-shadow: inset 0 0 0 1px var(--blue, #1d4ed8);
}

.whatsapp-flow-mode-card:disabled,
.whatsapp-flow-mode-card.is-disabled {
  opacity: .5;
  cursor: not-allowed;
}

.whatsapp-flow-mode-panel {
  display: grid;
  gap: 16px;
}

.whatsapp-flow-assistant-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--surface-soft, #f1f5f9);
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .whatsapp-flow-mode-cards {
    grid-template-columns: 1fr;
  }
}

.whatsapp-flow-hint {
  color: var(--muted, #64748b);
  font-size: 12.5px;
  font-weight: 600;
}

.whatsapp-flow-hint code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-soft, #f1f5f9);
  font-size: 12px;
  color: var(--ink, #0f172a);
}

.whatsapp-flow-inactive-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #fcd9a1;
  border-radius: 10px;
  background: #fff7ec;
  color: #9a5b12;
  font-size: 13px;
  font-weight: 600;
}

#attendanceFinishAction {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 10px);
  background: var(--panel, #fff);
  color: var(--text);
  font-size: 15px;
}

.integration-card-header.compact h2,
.integration-card-header.compact h3 {
  margin: 0 0 6px;
}

.whatsapp-flow-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  min-width: 214px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: #f8fbff;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.whatsapp-flow-toggle:hover,
.whatsapp-flow-toggle:focus-within {
  border-color: rgba(37, 99, 235, 0.46);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.whatsapp-flow-toggle span,
.whatsapp-flow-toggle strong,
.whatsapp-flow-toggle small {
  display: block;
}

.whatsapp-flow-toggle strong {
  font-size: 13px;
  line-height: 1.2;
}

.whatsapp-flow-toggle small {
  margin-top: 3px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.whatsapp-flow-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.whatsapp-flow-toggle i {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background-color 150ms ease;
}

.whatsapp-flow-toggle i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  transition: transform 150ms ease;
}

.whatsapp-flow-toggle input:checked + i {
  background: var(--blue);
}

.whatsapp-flow-toggle input:checked + i::after {
  transform: translateX(20px);
}

.whatsapp-flow-toggle:has(input:not(:checked)) {
  border-color: rgba(148, 163, 184, 0.42);
  background: #f8fafc;
}

.whatsapp-flow-toggle:has(input:not(:checked)) small {
  color: #64748b;
}

.whatsapp-flow-form textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
}

.whatsapp-flow-options-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.whatsapp-flow-options-header strong,
.whatsapp-flow-options-header small {
  display: block;
}

.whatsapp-flow-options-header small {
  margin-top: 4px;
  color: #64748b;
}

.whatsapp-flow-options {
  display: grid;
  gap: 14px;
}

@media (max-width: 980px) {
  .channels-automation-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-connection-card,
  .openai-assistant-channel-card {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .whatsapp-integration-card.whatsapp-connection-card {
    padding: 18px 16px;
  }

  .openai-assistant-channel-card .whatsapp-assistant-card {
    padding: 18px 16px 0;
  }

  .whatsapp-connection-card .integration-card-header,
  .openai-assistant-channel-card .integration-card-header {
    display: grid;
    gap: 18px;
  }

  .integration-card-title {
    gap: 12px;
  }

  .integration-card-title h2 {
    font-size: 22px;
  }

  .integration-card-title p,
  .openai-assistant-feature small,
  .whatsapp-current-connection small,
  .whatsapp-connection-card .integration-helper-text {
    font-size: 12px;
  }

  .whatsapp-brand-icon,
  .openai-assistant-channel-card .openai-mark {
    width: 44px;
    height: 44px;
  }

  .whatsapp-current-connection,
  .openai-assistant-feature {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .whatsapp-current-link {
    display: none;
  }

  .whatsapp-integration-actions {
    grid-template-columns: 1fr;
  }

  .whatsapp-integration-actions .danger-outline-button {
    grid-column: auto;
  }

  .openai-assistant-channel-card .whatsapp-assistant-actions {
    margin-right: -18px;
    margin-left: -18px;
    padding: 20px 18px;
  }
}

.whatsapp-flow-option-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.whatsapp-flow-option-grid {
  display: grid;
  grid-template-columns: minmax(120px, .3fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.whatsapp-flow-option-grid label {
  display: grid;
  gap: 8px;
  color: #101418;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.whatsapp-flow-option-grid input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-transform: none;
}

.whatsapp-flow-option-grid textarea {
  background: #fff;
}

.whatsapp-flow-remove-option {
  min-height: 44px;
}

.integration-row strong,
.integration-row small {
  display: block;
}

.integration-row small {
  margin-top: 4px;
  color: #353c48;
}

.integration-logo {
  width: 42px;
  height: 42px;
  border-radius: 2px;
}

.integration-logo.google {
  background: linear-gradient(135deg, #e9eef6, #ffffff);
  box-shadow: inset 16px 16px 0 #e5e7eb, inset 26px 18px 0 #4a90e2;
}

.integration-logo.stripe {
  background: linear-gradient(135deg, #082033, #0a5166);
}

.integration-logo.aws {
  background: radial-gradient(circle at 60% 40%, #315b6d, #0d2632 60%);
}

.checkmark {
  margin-left: auto;
  color: var(--green);
  font-size: 28px;
}

.broken-link {
  margin-left: auto;
  color: #1b2029;
  font-size: 28px;
}

.general-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 44px;
}

.retention-box,
.debug-row {
  padding: 18px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.retention-box strong {
  display: block;
  margin-bottom: 16px;
}

.retention-box input {
  width: 70%;
  accent-color: var(--blue);
}

.retention-box span {
  margin-left: 16px;
  font-family: Consolas, monospace;
}

.debug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.debug-row strong,
.debug-row small {
  display: block;
}

.debug-row small {
  color: var(--muted);
}

.map-panel {
  display: grid;
  place-items: center;
  min-height: 164px;
  margin-top: 32px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(214, 232, 241, 0.5), rgba(214, 232, 241, 0.5)),
    repeating-linear-gradient(165deg, #b9d2dc 0 8px, #d7e7ee 8px 18px);
  color: var(--blue);
  text-transform: uppercase;
}

.map-panel small {
  color: #1f2937;
  letter-spacing: 0;
}

.placeholder-card {
  padding: 32px;
}

.icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  color: currentColor;
}

.grid-icon {
  background:
    linear-gradient(currentColor 0 0) 2px 2px / 7px 7px,
    linear-gradient(currentColor 0 0) 15px 2px / 7px 7px,
    linear-gradient(currentColor 0 0) 2px 15px / 7px 7px,
    linear-gradient(currentColor 0 0) 15px 15px / 7px 7px;
  background-repeat: no-repeat;
}

.users-icon::before,
.users-icon::after,
.add-user-icon::before,
.add-user-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.users-icon::before {
  left: 3px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 10px 2px 0 -2px currentColor;
}

.users-icon::after {
  left: 1px;
  bottom: 4px;
  width: 17px;
  height: 7px;
  border-radius: 9px 9px 0 0;
}

.gear-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 -5px 0 -2px currentColor,
    0 5px 0 -2px currentColor,
    5px 0 0 -2px currentColor,
    -5px 0 0 -2px currentColor;
}

.diamond-icon {
  background:
    linear-gradient(45deg, currentColor 45%, transparent 46%) 2px 8px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 13px 8px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 8px 2px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 8px 14px / 9px 9px;
  background-repeat: no-repeat;
}

.help-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.help-icon::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 17px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor;
}

.exit-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 10px;
  height: 16px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 2px 0 0 2px;
}

.exit-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 10px;
  width: 11px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -4px 0 -1px currentColor, 4px 4px 0 -1px currentColor;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.bell-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 12px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 5px 5px;
}

.bell-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 18px;
  width: 5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.refresh-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.refresh-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 3px;
  border: 5px solid transparent;
  border-left-color: currentColor;
  transform: rotate(-35deg);
}

.download-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  width: 2px;
  height: 12px;
  background: currentColor;
}

.download-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  width: 12px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
}
.upload-icon::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  width: 2px;
  height: 12px;
  background: currentColor;
}
.upload-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}
.plus-icon::before { content: "+"; position: absolute; inset: -1px 0 0; display: grid; place-items: center; font-size: 30px; }
.filter-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.mail-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.mail-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.webhook-icon::before,
.webhook-icon::after,
.puzzle-icon::before,
.puzzle-icon::after,
.map-icon::before,
.map-icon::after {
  content: "";
  position: absolute;
}

.webhook-icon::before {
  left: 4px;
  top: 5px;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
}

.webhook-icon::after {
  right: 3px;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.puzzle-icon::before {
  left: 5px;
  top: 5px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.puzzle-icon::after {
  left: 10px;
  top: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 15px 0 currentColor;
}

.map-icon::before {
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.map-icon::after {
  left: 11px;
  top: 6px;
  width: 2px;
  height: 14px;
  background: currentColor;
  box-shadow: -5px 2px 0 -1px currentColor, 5px -2px 0 -1px currentColor;
}
.sliders-icon::before,
.sliders-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 8px 0 currentColor, 0 16px 0 currentColor;
}
.sliders-icon::before { top: 3px; }
.sliders-icon::after {
  top: 1px;
  left: 8px;
  right: auto;
  width: 4px;
  height: 4px;
  border: 2px solid currentColor;
  background: var(--navy);
  border-radius: 50%;
  box-shadow: 8px 8px 0 -2px var(--navy), 8px 8px 0 0 currentColor, -2px 16px 0 -2px var(--navy), -2px 16px 0 0 currentColor;
}
.alert-icon::before {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--red);
  font-weight: 800;
}

.shield-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 5px 5px;
  clip-path: polygon(50% 0, 100% 18%, 88% 78%, 50% 100%, 12% 78%, 0 18%);
}

.server-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 6px 0 rgba(8, 91, 197, 0.12), inset 0 -6px 0 rgba(8, 91, 197, 0.12);
}
.server-icon.dark { color: #1b2029; }
.add-user-icon::before { content: "+"; right: 0; top: -2px; border: 0; font-size: 18px; font-weight: 700; }
.add-user-icon::after { left: 3px; bottom: 3px; width: 16px; height: 8px; border-radius: 9px 9px 0 0; }
.document-icon::before,
.inbox-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 13px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 -5px 0 rgba(8, 91, 197, 0.12);
}

.document-icon::after,
.inbox-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.calendar-alert-icon::before {
  content: "";
  position: absolute;
  inset: 2px 0 0;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-top-width: 5px;
  border-radius: 2px;
  font-size: 16px;
}

.money-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.money-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.lock-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.lock-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 8px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.building-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
}

.building-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 2px;
  height: 2px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor, 0 5px 0 currentColor, 5px 5px 0 currentColor, 0 10px 0 currentColor, 5px 10px 0 currentColor;
}

.trend-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 5px;
  width: 19px;
  height: 13px;
  border-left: 3px solid currentColor;
  border-top: 3px solid currentColor;
  transform: skewY(-35deg) rotate(135deg);
}

.trend-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.wallet-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.wallet-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 10px;
  width: 8px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: var(--panel);
}

.chart-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.chart-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 7px;
  width: 3px;
  height: 5px;
  background: currentColor;
  box-shadow: 5px -4px 0 currentColor, 10px -1px 0 currentColor;
}

.funnel-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 3px solid currentColor;
  border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 60% 62%, 60% 100%, 40% 100%, 40% 62%);
}

@media (max-width: 1500px) {
  .dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-calendar-compact-card {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .dashboard-calendar-modal {
    padding: 10px;
  }

  .dashboard-overview-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar-compact-card {
    grid-column: auto;
  }

  .dashboard-summary-card,
  .dashboard-calendar-compact-card {
    min-height: auto;
  }

  .dashboard-summary-item {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .dashboard-summary-meta {
    grid-column: 2;
    text-align: left;
  }

  .dashboard-calendar-modal-card {
    width: 100%;
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 420px;
  }

  .login-copy {
    margin-bottom: 60px;
  }

  .sidebar { width: 230px; }
  .main-area { margin-left: 230px; }

  .brand-logo-sidebar {
    height: 50px;
    max-width: 180px;
  }

  .brand {
    padding: 18px 18px 12px;
  }

  .sidebar-nav {
    gap: 8px;
    padding: 12px;
  }

  .nav-item {
    min-height: 50px;
    padding: 9px 16px;
    font-size: 15px;
    gap: 12px;
  }

  .plain-action {
    padding: 10px 16px;
    font-size: 15px;
    gap: 12px;
  }

  .sidebar-footer {
    padding: 12px;
  }

  .metrics-grid,
  .dashboard-layout,
  .settings-top-grid,
  .settings-bottom-grid,
  .sales-metrics-grid,
  .sales-content-grid,
  .client-summary-grid,
  .client-detail-layout,
  .client-detail-metrics,
  .process-summary-grid,
  .process-content-grid,
  .contract-summary-grid,
  .contracts-bottom-grid {
    grid-template-columns: 1fr;
  }

  .email-settings-panel[data-email-settings-panel="technical"].is-active {
    grid-template-columns: 1fr;
  }

  .pipeline-steps {
    grid-template-columns: 1fr;
  }

  .pipeline-step,
  .pipeline-step:first-child,
  .pipeline-step:last-child,
  .process-flow article,
  .process-flow article:first-child {
    clip-path: none;
  }

  .process-flow {
    grid-template-columns: 1fr;
  }

  .process-kanban-board {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .right-stack {
    grid-template-columns: 1fr 1fr;
  }

  .user-summary-grid {
    grid-template-columns: 1fr;
  }
  .user-summary-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .login-visual,
  .login-panel-wrap {
    min-height: auto;
    padding: 28px 20px;
  }

  .login-card {
    padding: 28px 20px;
  }

  .brand-logo-login {
    height: 58px;
    max-width: 260px;
  }

  .login-copy h1 {
    font-size: 25px;
  }

  .login-copy p {
    font-size: 17px;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
  }

  .main-area {
    margin-left: 0;
  }

  .sidebar-nav {
    padding: 12px;
  }

  .sidebar-footer {
    padding: 16px;
  }

  .topbar,
  .connection-panel,
  .page-heading,
  .heading-actions,
  .tabs-row,
  .pagination-row,
  .utility-grid,
  .right-stack,
  .settings-form,
  .general-grid {
    flex-direction: column;
    display: flex;
    align-items: stretch;
  }

  .dashboard-calendar-card {
    overflow-x: auto;
  }

  .dashboard-calendar-header {
    min-width: 760px;
  }

  .dashboard-calendar-filters,
  .dashboard-calendar-weekdays,
  .dashboard-calendar-grid,
  .dashboard-calendar-legend {
    min-width: 760px;
  }

  .screen {
    padding: 28px 16px 80px;
  }

  .search-box {
    width: 100%;
  }

  .topbar-profile-menu {
    right: 8px;
    top: calc(100% + 8px);
  }

  .connection-panel {
    margin: 16px;
  }

  .admin-login-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-login-form input {
    width: 100%;
  }

  .page-heading h1 {
    font-size: 32px;
  }

  .metrics-grid,
  .dashboard-layout,
  .settings-top-grid,
  .settings-bottom-grid,
  .sales-metrics-grid,
  .sales-content-grid,
  .client-summary-grid,
  .client-detail-layout,
  .client-detail-metrics,
  .process-summary-grid,
  .process-content-grid,
  .contract-summary-grid,
  .contracts-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .contract-filters {
    grid-template-columns: 1fr;
  }

  .filter-button {
    justify-self: stretch;
  }

  .process-kanban-board {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }

  .client-profile-panel {
    position: static;
  }

  .permission-grid {
    grid-template-columns: minmax(190px, 1.3fr) repeat(4, 120px);
  }

}

/* UX polish: mobile-first behavior and touch-friendly web app layout */
html {
  scroll-behavior: smooth;
}

input,
select,
textarea {
  border-radius: var(--radius-sm);
}

.topbar,
.sidebar,
.card,
.modal-card,
.login-card {
  transition: box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.primary-button,
.secondary-button,
.logout-button,
.ghost-link,
.nav-item {
  transition: transform .12s ease, background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.primary-button:hover,
.secondary-button:hover,
.logout-button:hover,
.ghost-link:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.table-wrap {
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.table-wrap::after {
  content: "";
  position: sticky;
  right: 0;
  display: block;
  width: 34px;
  height: 1px;
  margin-left: auto;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(243, 246, 250, 0), rgba(243, 246, 250, .9));
}

@media (max-width: 900px) {
  .screen.requests-chat-screen {
    height: calc(100dvh - 70px);
    padding: 10px;
  }

  .conversations-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .conversation-sidebar {
    max-height: 46dvh;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  /* Lista com mais altura no celular (antes ~148px, ~2-3 conversas). */
  .conversation-list {
    max-height: 36dvh;
  }

  /* Alvos de toque confortaveis no chat (>=44px). */
  .conversation-action-icon {
    width: 44px;
    height: 44px;
  }

  /* Botao de arquivar sempre visivel no toque (no desktop aparece so no hover). */
  .conversation-archive-button {
    opacity: 1;
    visibility: visible;
    width: 34px;
    height: 34px;
  }

  .conversation-chat-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .conversation-chat-meta {
    justify-items: start;
  }

  .conversation-message {
    max-width: 92%;
  }

  .crm-flow-summary {
    grid-template-columns: 1fr 1fr;
  }

  .crm-flow-summary > div:first-child,
  .crm-flow-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .crm-plan-field > div:last-of-type {
    grid-template-columns: 1fr;
  }

  .app-shell {
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    max-height: 48dvh;
    border-right: 0;
    border-bottom: 1px solid rgba(199, 204, 213, .86);
    background: rgba(238, 242, 247, .94);
    backdrop-filter: blur(18px);
  }

  .brand {
    min-height: 64px;
    padding: 10px 16px 6px;
  }

  .brand-logo-sidebar {
    height: 42px;
    max-width: 170px;
  }

  .brand small {
    font-size: 10px;
  }

  .sidebar-nav {
    display: flex;
    gap: 8px;
    padding: 8px 12px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .sidebar-nav::-webkit-scrollbar {
    height: 0;
    width: 0;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 46px;
    min-width: max-content;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 15px;
    scroll-snap-align: start;
  }

  .nav-parent-item {
    margin-bottom: 0;
  }

  .nav-parent-item::after {
    width: 6px;
    height: 6px;
  }

  .nav-subitem {
    margin: 0;
    padding: 8px 13px;
    font-size: 14px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .76);
  }

  .nav-subitem::before {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    top: auto;
    min-height: auto;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .topbar-license {
    width: 100%;
  }

  .topbar-license-text strong {
    max-width: calc(100vw - 190px);
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .search-box {
    width: min(100%, 260px);
  }

  .user-menu {
    gap: 10px;
    margin-left: auto;
  }

  .topbar-user-copy {
    display: none;
  }

  .logout-button {
    min-width: 44px;
    padding: 0 12px;
  }

  .logout-button span:not(.icon) {
    display: none;
  }

  .screen {
    padding: 24px 14px 88px;
  }

  .page-heading {
    gap: 16px;
    margin-bottom: 22px;
  }

  .page-heading h1 {
    font-size: clamp(30px, 9vw, 40px);
    line-height: 1.05;
  }

  .page-heading p {
    font-size: 17px;
    line-height: 1.42;
  }

  .heading-actions,
  .form-actions,
  .proposal-builder-actions {
    gap: 10px;
  }

  .heading-actions > *,
  .form-actions > *,
  .proposal-builder-actions > * {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    min-height: 50px;
    padding: 0 18px;
    font-size: 17px;
  }

  .card {
    border-radius: 14px;
  }

  .card-header {
    gap: 12px;
  }

  .proposal-builder-grid,
  .proposal-modules-grid,
  .opportunity-form,
  .settings-form,
  .general-grid,
  .contract-address-fields {
    grid-template-columns: 1fr !important;
  }

  .appointment-online-grid,
  .appointment-meeting-link-row {
    grid-template-columns: 1fr;
  }

  .modal-card {
    width: min(100% - 20px, 720px);
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 18px -24px -24px;
    padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
  }

  .client-detail-tabs {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .client-detail-tabs button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: var(--panel);
  }

  .client-detail-tabs button.is-active {
    border-color: var(--blue);
    background: var(--blue-soft);
  }

  .client-profile-panel {
    top: 0;
  }

  .interaction-footer,
  .client-process-context-footer,
  .calendar-event-actions,
  .commercial-demand-actions {
    gap: 10px;
  }

  .interaction-footer button,
  .client-process-actions button,
  .calendar-event-actions button {
    flex: 1 1 160px;
  }
}

@media (max-width: 520px) {
  .login-screen {
    background: var(--panel);
  }

  .login-visual {
    min-height: auto;
    padding: 22px 18px;
  }

  .login-copy,
  .login-footer,
  .office-visual {
    display: none;
  }

  .login-brand {
    padding: 8px 12px;
    border-radius: 12px;
  }

  .brand-logo-login {
    height: 48px;
    max-width: 220px;
  }

  .login-panel-wrap {
    place-items: start stretch;
    padding: 22px 16px 34px;
    background: var(--panel);
  }

  .login-card {
    gap: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-card h2 {
    font-size: 28px;
  }

  .login-input,
  .login-submit,
  .sso-button {
    min-height: 56px;
    border-radius: 12px;
    font-size: 17px;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar .search-box {
    height: 46px;
    border-radius: 999px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  .screen {
    padding-inline: 10px;
  }

  .page-heading h1 {
    font-size: 32px;
  }

  .page-heading p {
    font-size: 16px;
  }

  .card,
  .modal-card {
    border-radius: 12px;
  }

  .small-stat,
  .contract-stat,
  .sales-metric {
    min-height: auto;
    padding: 20px;
  }

  .table-wrap {
    margin-inline: -1px;
    border-radius: 0 0 12px 12px;
  }

  .client-detail-layout {
    gap: 14px;
  }

  .client-profile-panel,
  .interaction-card,
  .client-process-context,
  .client-timeline-card,
  .client-rdv-card,
  .client-proposals-card,
  .client-contracts-card,
  .client-demands-card,
  .client-attachments-card {
    padding-inline: 18px;
  }
}

/* CoreFlow UI polish: visual-only overrides. Keep business logic in JS untouched. */
body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 32vw),
    var(--bg);
  color: #1e293b;
  font-weight: 500;
}

.app-shell {
  background: transparent;
}

.sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  border-right-color: rgba(148, 163, 184, 0.38);
  box-shadow: 12px 0 28px rgba(15, 23, 42, 0.04);
}

.brand {
  border-bottom-color: rgba(148, 163, 184, 0.24);
}

.brand small,
.page-heading p,
.card-header p,
small,
.eyebrow {
  color: #64748b;
}

.sidebar-nav {
  padding-inline: 10px;
}

.nav-item,
.plain-action {
  min-height: 48px;
  margin: 4px 0;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #334155;
  font-weight: 650;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.nav-item:hover,
.plain-action:hover {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(148, 163, 184, 0.28);
  color: #0f172a;
  transform: translateX(2px);
}

.nav-item.is-active {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  border-color: rgba(37, 99, 235, 0.35);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
}

.nav-subitem {
  min-height: 42px;
  padding-left: 58px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.topbar {
  border-bottom-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-box,
.login-input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-color: #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.search-box:focus-within,
.login-input:focus-within,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.page-heading h1,
.screen > h1,
.card-header h2,
.card h2,
.modal-header h2,
.login-card h2 {
  color: #111827;
  font-weight: 800;
  letter-spacing: 0;
}

.page-heading h1,
.screen > h1 {
  line-height: 1.05;
}

.card,
.status-card,
.latency-card,
.small-stat,
.contract-stat,
.sales-metric,
.smtp-card,
.pop-card,
.webhook-card,
.integrations-card,
.general-card,
.process-flow-card,
.process-kanban-card,
.process-table-card,
.process-subflow-card,
.commercial-demands-card,
.proposal-clients-card,
.clients-table-card,
.users-table-card,
.contracts-table-card,
.modal-card,
.login-card {
  border-color: rgba(148, 163, 184, 0.36);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.card:hover,
.status-card:hover,
.latency-card:hover,
.small-stat:hover,
.contract-stat:hover,
.sales-metric:hover {
  box-shadow: var(--shadow-md);
}

.primary-button,
.secondary-button,
.login-submit,
.sso-button,
.table-actions button,
.ghost-link,
.service-request-start-button,
.service-request-transfer-button {
  border-radius: 12px;
  font-weight: 750;
  letter-spacing: 0;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.primary-button,
.login-submit {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.primary-button:hover,
.login-submit:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.30);
  transform: translateY(-1px);
}

.secondary-button,
.sso-button,
.table-actions button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}

.secondary-button:hover,
.sso-button:hover,
.table-actions button:hover {
  border-color: rgba(37, 99, 235, 0.36);
  background: #f8fafc;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.login-submit:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
  transform: none;
}

table {
  color: #1f2937;
}

thead,
table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

table td,
table th {
  border-color: rgba(226, 232, 240, 0.92);
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

.pill,
.request-badge {
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.pill.success,
.request-badge.status-completed,
.request-badge.priority-low {
  background: #dcfce7;
  color: #15803d;
}

.pill.admin,
.pill.process-pill,
.request-badge.status-new,
.request-badge.status-triage {
  background: #dbeafe;
  color: #1d4ed8;
}

.request-badge.status-in_service,
.request-badge.status-development,
.request-badge.status-testing {
  background: #ede9fe;
  color: #6d28d9;
}

.request-badge.status-analysis,
.request-badge.priority-medium {
  background: #fef3c7;
  color: #b45309;
}

.request-badge.status-waiting_customer,
.request-badge.priority-high {
  background: #ffedd5;
  color: #c2410c;
}

.request-badge.status-automated_service {
  background: #e0f2fe;
  color: #075985;
}

.pill.danger,
.request-badge.status-cancelled,
.request-badge.priority-critical {
  background: #fee2e2;
  color: #b91c1c;
}

.pill.neutral,
.request-badge.status-not_applicable {
  background: #f1f5f9;
  color: #475569;
}

/* Central de Atendimento: dashboard-style queue */
.service-request-metric-grid {
  grid-template-columns: repeat(6, minmax(118px, 1fr));
}

.service-requests-panel {
  overflow: hidden;
}

.service-requests-panel > .card-header {
  padding-bottom: 14px;
}

.service-requests-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.service-requests-table th,
.service-requests-table td {
  padding: 13px 12px;
  box-sizing: border-box;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
}

.service-requests-table td {
  color: #172033;
  font-size: 13.5px;
  vertical-align: middle;
}

.service-requests-table th {
  color: #475569;
  font-size: 10px;
  font-weight: 850;
  user-select: none;
}

.service-requests-table th.is-sortable {
  cursor: pointer;
}

.service-requests-table th.is-sortable .th-label {
  transition: color .14s ease;
}

.service-requests-table th.is-sortable:hover .th-label,
.service-requests-table th.is-sorted .th-label {
  color: #0f5fc7;
}

.service-requests-table .th-sort-arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 8px;
  line-height: 1;
  vertical-align: middle;
}

.service-requests-table tr:hover td {
  background: #f8fbff;
}

.service-requests-table .mini-avatar {
  flex: 0 0 auto;
  margin-right: 0;
  background: linear-gradient(135deg, #0f5fc7, #23c7d6);
  color: #fff;
  font-size: 10px;
}

.service-requests-table .request-badge {
  gap: 5px;
  min-height: 22px;
  padding: 4px 9px;
  border: 0;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.service-requests-table .request-badge.status-new::before,
.service-requests-table .request-badge.status-in_service::before,
.service-requests-table .request-badge.status-analysis::before,
.service-requests-table .request-badge.status-waiting_customer::before,
.service-requests-table .request-badge.status-completed::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.request-badge.priority-critical {
  background: #fee2e2;
  color: #b91c1c;
}

.request-badge.priority-high {
  background: #ffedd5;
  color: #c2410c;
}

.request-badge.priority-medium {
  background: #fef3c7;
  color: #b45309;
}

.request-badge.priority-low {
  background: #dcfce7;
  color: #15803d;
}

.request-badge.status-new,
.request-badge.status-triage,
.request-badge.status-channel_queue {
  background: #f1f5f9;
  color: #475569;
}

.request-badge.status-in_service {
  background: #dbeafe;
  color: #1d4ed8;
}

.request-badge.status-analysis,
.request-badge.status-development,
.request-badge.status-testing {
  background: #ede9fe;
  color: #6d28d9;
}

.request-badge.status-waiting_customer,
.request-badge.status-paused {
  background: #fef3c7;
  color: #b45309;
}

.request-badge.status-automated_service {
  background: #e0f2fe;
  color: #075985;
}

.request-badge.status-completed {
  background: #dcfce7;
  color: #15803d;
}

.request-badge.status-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.request-badge.status-not_applicable {
  background: #e2e8f0;
  color: #475569;
}

/* Badges de canal: ícone da marca colorido, sem o "dot" de status */
.service-requests-table .request-badge.request-badge--channel::before {
  display: none;
}

.request-badge .sr-badge-icon {
  flex: 0 0 auto;
}

.request-badge--channel .sr-badge-icon-whatsapp {
  color: #1faf5e;
}

.request-badge--channel .sr-badge-icon-instagram {
  color: #d6367f;
}

.service-request-metric-card .instagram-metric-icon {
  position: relative;
  background:
    radial-gradient(circle at 72% 28%, #fef3c7 0 5px, transparent 6px),
    linear-gradient(135deg, #f97316 0%, #db2777 48%, #7c3aed 100%);
}

.service-request-metric-card .instagram-metric-icon::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid #ffffff;
  border-radius: 10px;
}

.service-request-metric-card .instagram-metric-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 1320px) {
  .service-request-metric-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .service-request-metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .service-requests-table th,
  .service-requests-table td {
    padding: 11px 8px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .service-request-metric-grid {
    grid-template-columns: 1fr;
  }

  .service-requests-table {
    min-width: 720px;
  }

  .service-request-table-wrap {
    overflow-x: auto;
  }
}

.form-status:not(:empty) {
  border-radius: 12px;
  padding: 12px 14px;
  background: #fffbeb;
  color: #92400e;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px) saturate(1.06);
  -webkit-backdrop-filter: blur(10px) saturate(1.06);
}

#appointmentModal {
  z-index: 260;
}

#appointmentSuccessModal {
  z-index: 320;
}

.appointment-modal-backdrop {
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.appointment-modal-card {
  width: min(1240px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 26px 78px rgba(15, 23, 42, 0.28);
}

.appointment-modal-header {
  padding: 22px 32px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.appointment-modal-header h2 {
  margin: 0;
  color: #101827;
  font-size: clamp(23px, 2vw, 28px);
  line-height: 1.1;
}

.appointment-modal-header p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 15px;
  line-height: 1.25;
}

.appointment-modal-header .icon-button {
  width: 38px;
  min-height: 38px;
  color: #0f172a;
  font-size: 34px;
  line-height: 1;
  background: transparent;
}

.appointment-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 16px 28px;
  max-height: calc(100dvh - 126px);
  overflow: auto;
  padding: 28px 32px 26px;
}

.appointment-form label {
  gap: 8px;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.appointment-title-field span,
.appointment-description-field span {
  color: #ef4444;
}

.appointment-description-field > span {
  color: #526176;
  font-weight: 700;
}

.appointment-form input,
.appointment-form select,
.appointment-form textarea {
  min-height: 48px;
  border-color: #cbd5e1;
  border-radius: 9px;
  color: #172033;
  background: #ffffff;
  font-size: 16px;
}

.appointment-form textarea {
  min-height: 84px;
  resize: vertical;
}

.appointment-field-shell {
  position: relative;
  display: block;
}

.appointment-field-shell select,
.appointment-client-field .appointment-field-shell input[type="search"] {
  padding-left: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-client-field .client-search-results {
  z-index: 420;
}

.appointment-field-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 1;
  display: inline-block;
  width: 18px;
  height: 18px;
  color: #64748b;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.appointment-field-icon::before,
.appointment-field-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.appointment-icon-user::before {
  left: 6px;
  top: 2px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.appointment-icon-user::after {
  left: 3px;
  bottom: 1px;
  width: 12px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 3px 3px;
}

.appointment-icon-briefcase::before {
  inset: 5px 1px 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.appointment-icon-briefcase::after {
  left: 6px;
  top: 2px;
  width: 6px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.appointment-icon-flag::before {
  left: 3px;
  top: 2px;
  width: 2px;
  height: 15px;
  background: currentColor;
}

.appointment-icon-flag::after {
  left: 5px;
  top: 2px;
  width: 11px;
  height: 8px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 3px 3px 0;
}

.appointment-icon-calendar::before {
  inset: 2px 1px 1px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.appointment-icon-calendar::after {
  left: 4px;
  right: 4px;
  top: 7px;
  height: 2px;
  background: currentColor;
  box-shadow:
    0 4px 0 -0.5px currentColor,
    4px 4px 0 -0.5px currentColor;
}

.appointment-icon-clock::before {
  inset: 1px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.appointment-icon-clock::after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.appointment-date-section {
  display: grid;
  gap: 12px;
}

.appointment-date-section > strong {
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.appointment-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 20px;
}

.appointment-date-card {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 8px !important;
  min-height: 64px;
  padding: 10px 14px 9px 42px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
}

.appointment-date-card .appointment-field-icon {
  left: 18px;
}

.appointment-date-card > span:not(.appointment-field-icon) {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.appointment-date-card input {
  grid-column: 1 / -1;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}

.appointment-refresh-meeting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.appointment-refresh-meeting-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.appointment-online-section {
  gap: 16px;
  padding: 18px 22px 20px;
  border-color: #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
}

.appointment-online-section legend {
  padding: 0 3px;
  color: #172033;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.appointment-online-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: #172033;
  font-size: 15px;
}

.appointment-online-toggle input {
  width: 18px;
  height: 18px;
}

.appointment-online-grid {
  grid-template-columns: minmax(230px, .95fr) minmax(360px, 1.45fr);
  gap: 20px 28px;
  align-items: start;
}

.appointment-online-grid > label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.appointment-online-grid > label > input,
.appointment-meeting-link-row input {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
}

.appointment-meeting-link-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 10px;
}

.appointment-meeting-link-row input {
  min-width: 0;
  overflow: hidden;
  padding-left: 14px;
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-meeting-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.appointment-meeting-actions .compact-button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  color: #0b66d8;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.appointment-guests-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.appointment-guests-field textarea {
  width: 100%;
  min-height: 58px;
  box-sizing: border-box;
  resize: vertical;
}

.appointment-guests-hint {
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.4;
}

.appointment-modal-actions {
  align-items: center;
  grid-column: 1 / -1;
  gap: 14px;
  padding-top: 6px;
}

.appointment-modal-actions span {
  flex: 1 1 auto;
}

.appointment-modal-actions .primary-button,
.appointment-modal-actions .secondary-button,
.appointment-modal-actions .danger-button {
  min-height: 52px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 900;
}

.appointment-modal-actions .primary-button {
  min-width: 230px;
}

.appointment-modal-actions .secondary-button {
  min-width: 140px;
}

.appointment-modal-actions .danger-button {
  min-width: 130px;
  border: 1px solid #ef4444;
  color: #ef4444;
  background: #ffffff;
}

#appointmentFormStatus {
  grid-column: 1 / -1;
  margin: 0;
}

@media (max-width: 1180px) {
  .appointment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-date-grid,
  .appointment-online-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .appointment-modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .appointment-modal-card {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .appointment-modal-header {
    padding: 18px 18px 14px;
  }

  .appointment-form {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .appointment-date-grid,
  .appointment-online-grid {
    grid-template-columns: 1fr;
  }

  .appointment-meeting-actions,
  .appointment-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .appointment-modal-actions span {
    display: none;
  }

  .appointment-modal-actions .primary-button,
  .appointment-modal-actions .secondary-button,
  .appointment-modal-actions .danger-button {
    width: 100%;
  }
}

.modal-card {
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.modal-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.service-request-sidebar > div {
  border-radius: 14px;
  background: #f8fafc;
}

.module-checkboxes {
  border-color: #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
}

.module-checkboxes label {
  color: #334155;
  font-weight: 650;
}

.module-checkboxes input[type="checkbox"],
input[type="checkbox"] {
  accent-color: var(--primary);
}

.service-request-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.columns-config-modal-card {
  width: min(620px, calc(100vw - 32px));
}

.columns-config-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px 24px;
}

.column-config-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.column-config-option strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.column-config-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.column-config-option.is-locked {
  background: #f8fafc;
}

.a4-print-frame {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 210mm;
  height: 297mm;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .columns-config-list {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body * {
    visibility: hidden !important;
  }

  .app-shell,
  .main-area,
  .screen,
  .modal-backdrop,
  .proposal-modal {
    display: block !important;
    position: static !important;
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #proposalPages,
  #proposalPages * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #proposalPages {
    position: static !important;
    display: block;
    width: 210mm !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  .proposal-modal-header {
    display: none;
  }

  .proposal-a4-page {
    display: flex !important;
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    break-after: page;
    page-break-after: always;
    transform: none !important;
  }

  .contract-a4-page {
    display: flex !important;
    flex-direction: column !important;
    padding: 16mm 20mm 12mm !important;
  }

  .proposal-html-page {
    display: flex !important;
    flex-direction: column !important;
    padding: 58px 56px 42px !important;
    background-color: #05204f !important;
    background-image: linear-gradient(150deg, #05204f, #0063b7) !important;
  }

  .proposal-a4-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}

@media (max-width: 1180px) {
  .dashboard-calendar-compact-card {
    overflow-x: hidden;
  }

  .dashboard-calendar-compact-card .dashboard-calendar-header,
  .dashboard-calendar-compact-card .dashboard-calendar-weekdays,
  .dashboard-calendar-compact-card .dashboard-calendar-grid,
  .dashboard-calendar-compact-card .dashboard-calendar-legend {
    min-width: 0;
  }

  .dashboard-calendar-modal-card .dashboard-calendar-header,
  .dashboard-calendar-modal-card .dashboard-calendar-filters,
  .dashboard-calendar-modal-card .dashboard-calendar-weekdays,
  .dashboard-calendar-modal-card .dashboard-calendar-grid,
.dashboard-calendar-modal-card .dashboard-calendar-legend {
    min-width: 760px;
  }
}

/* Dashboard principal redesenhado */
.sidebar {
  background: linear-gradient(180deg, #061827 0%, #0b2035 100%);
  border-right-color: rgba(148, 163, 184, 0.18);
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.16);
}

.sidebar .brand small,
.sidebar-footer .plain-action,
.sidebar .plain-action,
.sidebar .nav-item {
  color: #c7d3e4;
}

.sidebar .brand strong,
.sidebar .brand-text,
.sidebar .plain-action:hover,
.sidebar .nav-item:hover {
  color: #ffffff;
}

.sidebar .nav-item:hover,
.sidebar .plain-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.24);
}

.sidebar .nav-item.is-active {
  background: linear-gradient(135deg, #1672f3, #155fd0);
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.42);
  box-shadow: 0 12px 26px rgba(22, 114, 243, 0.34);
}

.sidebar .nav-submenu {
  color: #9fb2c8;
}

.sidebar .nav-subitem {
  color: #b7c5d8;
}

.sidebar .nav-subitem.is-active,
.sidebar .nav-subitem:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-screen {
  max-width: 100%;
}

.dashboard-heading {
  margin-bottom: 16px;
}

.dashboard-heading h1 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
}

.dashboard-heading p {
  margin-top: 8px;
  color: #526176;
}

.dashboard-metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-metric-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 90px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

.dashboard-metric-card.is-dragging,
.dashboard-chart-card.is-dragging,
.dashboard-summary-card.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
}

.dashboard-metric-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 900;
}

.dashboard-metric-card.blue .dashboard-metric-icon { color: #155fd0; background: #e8f1ff; }
.dashboard-metric-card.green .dashboard-metric-icon { color: #058346; background: #e8faef; }
.dashboard-metric-card.purple .dashboard-metric-icon { color: #6d3be8; background: #f0eaff; }
.dashboard-metric-card.orange .dashboard-metric-icon { color: #db6b07; background: #fff2df; }
.dashboard-metric-card.cyan .dashboard-metric-icon { color: #0891b2; background: #e5f8fb; }
.dashboard-metric-card.red .dashboard-metric-icon { color: #dc2626; background: #ffeaea; }

.dashboard-metric-card span:not(.dashboard-metric-icon),
.dashboard-metric-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric-card span:not(.dashboard-metric-icon) {
  color: #526176;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-metric-card strong {
  display: block;
  margin: 5px 0 3px;
  color: #101826;
  font-size: 24px;
  line-height: 1;
}

.dashboard-metric-card small {
  font-size: 11px;
  font-weight: 700;
}

.dashboard-metric-card small.positive { color: #0b9f5b; }
.dashboard-metric-card small.negative { color: #dc2626; }
.dashboard-metric-card small.neutral { color: #64748b; }

.dashboard-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.dashboard-chart-card,
.dashboard-charts-grid .dashboard-calendar-compact-card {
  min-height: 280px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

.dashboard-widget-period {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f7fc;
  color: #526176;
  font-size: 11px;
  font-weight: 800;
}

.dashboard-funnel-list {
  display: grid;
  gap: 11px;
  padding: 8px 20px 22px;
}

.dashboard-funnel-row {
  display: grid;
  grid-template-columns: 110px minmax(80px, 1fr) 92px;
  gap: 12px;
  align-items: center;
  color: #12213a;
  font-size: 12px;
}

.dashboard-funnel-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-funnel-row strong {
  color: #526176;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.dashboard-funnel-track {
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f9;
}

.dashboard-funnel-track i {
  display: block;
  height: 100%;
  min-width: 18px;
  border-radius: inherit;
}

.dashboard-funnel-track .funnel-1 { background: #1769e8; }
.dashboard-funnel-track .funnel-2 { background: #1e82f0; }
.dashboard-funnel-track .funnel-3 { background: #20a8df; }
.dashboard-funnel-track .funnel-4 { background: #2ec4b6; }
.dashboard-funnel-track .funnel-5 { background: #65c878; }
.dashboard-funnel-track .funnel-6 { background: #f8bf3a; }
.dashboard-funnel-track .funnel-7 { background: #f97316; }

.dashboard-donut-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 8px 22px 24px;
}

.dashboard-donut-chart {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  background: conic-gradient(#e8eef7 0% 100%);
}

.dashboard-donut-chart::after {
  content: '';
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #eef2f7;
}

.dashboard-donut-chart strong,
.dashboard-donut-chart span {
  position: relative;
  z-index: 1;
}

.dashboard-donut-chart strong {
  color: #111827;
  font-size: 26px;
  line-height: 1;
}

.dashboard-donut-chart span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-donut-legend {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.dashboard-donut-legend-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #526176;
  font-size: 12px;
}

.dashboard-donut-legend-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dashboard-donut-legend-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-donut-legend-item strong {
  color: #12213a;
  font-size: 11px;
  white-space: nowrap;
}

#dashboardBottomWidgets.dashboard-overview-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  margin-bottom: 16px;
}

#dashboardBottomWidgets .dashboard-summary-card {
  min-height: 250px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

.dashboard-calendar-shell {
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  justify-content: end;
  margin-bottom: 24px;
}

.dashboard-calendar-shell .dashboard-calendar-compact-card {
  min-height: auto;
}

@media (max-width: 1500px) {
  .dashboard-metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-metric-strip,
  .dashboard-charts-grid,
  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-donut-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar-shell {
    grid-template-columns: 1fr;
  }
}

/* Dashboard: cards inferiores compactos */
#dashboardBottomWidgets.dashboard-overview-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

#dashboardBottomWidgets .dashboard-summary-card {
  min-height: 216px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  cursor: grab;
}

#dashboardBottomWidgets .dashboard-summary-header {
  min-width: 0;
  padding: 13px 16px 8px;
}

#dashboardBottomWidgets .dashboard-summary-header h2 {
  overflow: hidden;
  color: #12213a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-header .ghost-link {
  flex: 0 0 auto;
  min-height: auto;
  padding: 0;
  border: 0;
  color: #0b66d8;
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-list {
  gap: 0;
  padding: 0 16px 6px;
}

#dashboardBottomWidgets .dashboard-summary-item {
  grid-template-columns: 18px minmax(0, 1fr) minmax(44px, auto);
  gap: 8px;
  min-height: 37px;
  padding: 7px 0;
  align-items: center;
  border-bottom-color: #edf1f7;
}

#dashboardBottomWidgets .dashboard-summary-dot {
  width: 15px;
  height: 15px;
  margin-top: 0;
  font-size: 8px;
  line-height: 1;
}

#dashboardBottomWidgets .dashboard-summary-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

#dashboardBottomWidgets .dashboard-summary-copy strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-copy span,
#dashboardBottomWidgets .dashboard-summary-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #66758a;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#dashboardBottomWidgets .dashboard-summary-meta {
  max-width: 82px;
  overflow: hidden;
  color: #526176;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-meta.danger,
#dashboardBottomWidgets .dashboard-summary-meta.warning,
#dashboardBottomWidgets .dashboard-summary-meta.success {
  justify-self: end;
  padding: 3px 7px;
  border-radius: 999px;
}

#dashboardBottomWidgets .dashboard-summary-meta.danger {
  color: #d52020;
  background: #ffe8e8;
}

#dashboardBottomWidgets .dashboard-summary-meta.warning {
  color: #d97706;
  background: #fff2d8;
}

#dashboardBottomWidgets .dashboard-summary-meta.success {
  color: #08775a;
  background: #dcf7e7;
}

#dashboardBottomWidgets .dashboard-summary-progress {
  gap: 7px;
}

#dashboardBottomWidgets .dashboard-summary-progress span {
  width: 74px;
  height: 5px;
}

#dashboardBottomWidgets .dashboard-summary-progress strong {
  min-width: 28px;
  color: #12213a;
  font-size: 10px;
  line-height: 1;
}

#dashboardBottomWidgets .dashboard-summary-footer {
  min-height: 36px;
  padding: 0 12px;
  color: #0b66d8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

#dashboardBottomWidgets .dashboard-summary-footer::after {
  content: '?';
  margin-left: 6px;
  font-size: 13px;
}

#dashboardBottomWidgets .dashboard-summary-list .empty-state {
  margin: 14px 0;
  font-size: 11px;
}

/* Sidebar: marca legível sobre o menu escuro */
.sidebar .brand {
  padding: 18px 18px 14px;
}

.sidebar .brand > div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 228px);
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(2, 8, 23, 0.16);
}

.sidebar .brand-logo-sidebar {
  height: 48px;
  max-width: 188px;
  filter: none;
}

.sidebar .brand small {
  margin-top: 4px;
  color: #1f2937;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

@media (max-width: 1500px) {
  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  #dashboardBottomWidgets.dashboard-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar recolhida por padrao no desktop */
@media (min-width: 901px) {
  .sidebar:not(:hover) .nav-item {
    font-size: 0;
    text-indent: 0;
  }

  .sidebar:not(:hover) .nav-item > span:not(.icon),
  .sidebar:not(:hover) .plain-action > span:not(.icon),
  .sidebar:not(:hover) .nav-parent-item::after {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    max-width: 0 !important;
  }

  .sidebar:not(:hover) .nav-subitem {
    display: none !important;
  }

  .sidebar:not(:hover) .nav-item .icon {
    display: inline-flex;
    font-size: 0;
    line-height: 1;
    margin: 0 auto;
  }

  .sidebar:not(:hover) .nav-item .icon::before,
  .sidebar:not(:hover) .nav-item .icon::after {
    text-indent: 0;
  }

  :root {
    --sidebar-collapsed-width: 84px;
    --sidebar-expanded-width: 300px;
  }

  .sidebar {
    width: var(--sidebar-collapsed-width);
    top: var(--topbar-height);
    z-index: 80;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    transition:
      width 220ms ease,
      box-shadow 220ms ease,
      border-color 220ms ease;
  }

  .sidebar:hover {
    width: var(--sidebar-expanded-width);
    box-shadow: 24px 0 46px rgba(2, 8, 23, 0.28);
  }

  .main-area {
    margin-left: var(--sidebar-collapsed-width);
    transition: margin-left 220ms ease;
  }

  .sidebar .brand {
    display: none;
  }

  .sidebar-nav {
    padding: 8px 10px 18px;
    overflow-x: hidden;
  }

  .nav-item,
  .plain-action {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
    white-space: nowrap;
  }

  .sidebar:hover .nav-item,
  .sidebar:hover .plain-action {
    justify-content: flex-start;
    gap: 18px;
    padding-inline: 22px;
  }

  .nav-item > span:not(.icon),
  .plain-action > span:not(.icon),
  .nav-parent-item::after {
    width: 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 140ms ease,
      max-width 180ms ease;
  }

  .sidebar:hover .nav-item > span:not(.icon),
  .sidebar:hover .plain-action > span:not(.icon),
  .sidebar:hover .nav-parent-item::after {
    width: auto;
    max-width: 210px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-parent-item::after {
    display: block;
  }

  .nav-subitem {
    justify-content: center;
    margin-left: 0;
    padding-inline: 0;
  }

  .sidebar:not(:hover) .nav-subitem {
    display: none;
  }

  .sidebar:hover .nav-subitem {
    justify-content: flex-start;
    margin-left: 42px;
    padding-inline: 14px;
  }

  .sidebar .icon {
    flex: 0 0 auto;
  }

  .sidebar:not(:hover) .brand {
    align-items: center;
    padding-inline: 0;
  }

  .sidebar:not(:hover) .brand > div {
    margin-inline: auto;
  }

  .sidebar:not(:hover) .sidebar-nav {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding-inline: 0;
    width: 100%;
  }

  .sidebar:not(:hover) .nav-item,
  .sidebar:not(:hover) .plain-action {
    align-items: center;
    border-radius: 14px;
    display: flex;
    height: 56px;
    justify-content: center;
    margin-inline: auto;
    min-height: 56px;
    padding: 0;
    width: 56px;
  }

  .sidebar:not(:hover) .nav-subitem,
  .sidebar:not(:hover) .nav-subitem.is-expanded,
  .sidebar:not(:hover) .nav-subitem.is-active {
    display: none !important;
  }

  .sidebar:not(:hover) .nav-parent-item::after,
  .sidebar:not(:hover) .nav-subitem::before {
    display: none !important;
  }

  .sidebar:not(:hover) .nav-parent,
  .sidebar:not(:hover) .nav-group {
    align-items: center;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .sidebar:not(:hover) .nav-item .icon,
  .sidebar:not(:hover) .plain-action .icon {
    flex: 0 0 24px;
    height: 24px;
    margin: 0;
    width: 24px;
  }

  .sidebar:not(:hover) .nav-item > span:not(.icon),
  .sidebar:not(:hover) .plain-action > span:not(.icon) {
    display: none !important;
  }
}

/* ===================== Pipeline de Vendas ===================== */
.pipeline-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pipeline-metric {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
}

.pipeline-metric .eyebrow {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.pipeline-metric strong {
  color: var(--ink, #0f172a);
  font-size: 24px;
  font-weight: 800;
}

.pipeline-metric small {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.pipeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pipeline-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pipeline-filters input[type="search"],
.pipeline-filters select,
.pipeline-custom-range input[type="date"] {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: var(--panel, #fff);
  color: var(--text, #1f2937);
  font-size: 14px;
}

.pipeline-filters input[type="search"] {
  min-width: 260px;
}

.pipeline-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted, #64748b);
  font-size: 13px;
}

.pipeline-board {
  display: grid;
  /* 5 colunas sempre na mesma linha: preenchem a largura (1fr) e, quando nao
     couberem, param num minimo legivel (260px) e o board rola na horizontal —
     sem reorganizar/quebrar as etapas em varias linhas. */
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.pipeline-column {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  background: var(--surface-soft, #f8fafc);
  overflow: hidden;
}

.pipeline-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 11px;
  font-weight: 800;
  font-size: 12.5px;
  color: #fff;
  border-bottom: 3px solid rgba(15, 23, 42, .08);
}

.pipeline-column-head b {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  text-align: center;
  font-size: 11.5px;
}

.pipeline-column-head.is-nao-enviada { background: #64748b; }
.pipeline-column-head.is-enviada { background: #2563eb; }
.pipeline-column-head.is-negociacao { background: #d97706; }
.pipeline-column-head.is-fechada { background: #16a34a; }
.pipeline-column-head.is-perdida { background: #dc2626; }

.pipeline-column-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  min-height: 120px;
  transition: background .12s ease;
}

.pipeline-column-body.is-dropping {
  background: rgba(37, 99, 235, .08);
  outline: 2px dashed rgba(37, 99, 235, .4);
  outline-offset: -6px;
}

.pipeline-empty {
  margin: 8px 0;
  color: var(--muted, #94a3b8);
  font-size: 13px;
  text-align: center;
}

.pipeline-card {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line, #e2e8f0);
  border-left: 4px solid #cbd5e1;
  border-radius: 12px;
  background: var(--panel, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  cursor: grab;
}

.pipeline-card:active { cursor: grabbing; }
.pipeline-card.is-dragging { opacity: .5; }
.pipeline-card.is-expired { border-left-color: #dc2626; }
.pipeline-card.is-followup { border-left-color: #d97706; }

.pipeline-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card-top strong {
  color: var(--ink, #0f172a);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.pipeline-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.pipeline-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}

.pipeline-badge.is-expired { background: #fee2e2; color: #b91c1c; }
.pipeline-badge.is-followup { background: #ffedd5; color: #9a3412; }

.pipeline-card-number {
  color: var(--muted, #64748b);
  font-size: 11.5px;
  font-weight: 700;
}

.pipeline-card-value {
  color: var(--ink, #0f172a);
  font-size: 14px;
  font-weight: 800;
}

.pipeline-card-time {
  color: var(--muted, #64748b);
  font-size: 11.5px;
}

.pipeline-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.pipeline-card-action {
  padding: 3px 8px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  background: var(--surface-soft, #f8fafc);
  color: var(--text, #334155);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pipeline-card-action:hover { background: #eef2f9; }
.pipeline-card-action.is-win { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.pipeline-card-action.is-lose { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

/* Botao excluir negociacao (lixeira), alinhado a direita da barra de acoes. */
.pipeline-card-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #94a3b8;
  cursor: pointer;
}
.pipeline-card-delete:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

/* Detalhe da proposta */
.pipeline-detail-card { max-width: 640px; width: min(640px, 92vw); }

.pipeline-detail-body {
  display: grid;
  gap: 16px;
  padding: 4px 4px 8px;
}

.pipeline-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-detail-grid > div {
  display: grid;
  gap: 2px;
}

.pipeline-detail-grid small {
  color: var(--muted, #64748b);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.pipeline-detail-grid strong {
  color: var(--ink, #0f172a);
  font-size: 14px;
}

.pipeline-detail-history h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ink, #0f172a);
}

.pipeline-detail-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pipeline-detail-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
}

.pipeline-detail-history li em { color: var(--muted, #64748b); font-style: normal; }
.pipeline-detail-history li span { margin-left: auto; color: var(--muted, #64748b); font-size: 12px; }
.pipeline-detail-history li small { flex-basis: 100%; color: var(--muted, #64748b); }

.pipeline-loss-card { max-width: 460px; width: min(460px, 92vw); }
.pipeline-loss-body { display: grid; gap: 16px; padding: 22px 28px 6px; }
.pipeline-loss-body .full-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #475569; }
.pipeline-loss-body select, .pipeline-loss-body textarea { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 400; background: #fff; width: 100%; box-sizing: border-box; }
.pipeline-loss-body textarea { resize: vertical; min-height: 84px; }
.pipeline-loss-card .modal-actions { margin: 0; padding: 16px 28px 22px; border-top: 1px solid var(--line-soft); }

/* (Removidos os breakpoints que reduziam o Kanban para 3/2 colunas — agora as 5
   etapas ficam sempre em linha e o board rola na horizontal quando aperta.) */

/* Celular/tablet: botoes de acao do card com alvo de toque confortavel (>=40px). */
@media (max-width: 900px) {
  .pipeline-card-action {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* Celular: Kanban por rolagem horizontal com "snap" por coluna — mantem o modelo
   de Kanban (deslize para o lado para trocar de etapa) em vez de empilhar tudo. */
@media (max-width: 640px) {
  .pipeline-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 6px;
  }
  .pipeline-column {
    flex: 0 0 86vw;
    max-width: 86vw;
    scroll-snap-align: start;
  }
  .pipeline-detail-grid { grid-template-columns: 1fr; }
}

/* ===================== Detalhe da Negociacao (Pipeline) ===================== */
.negotiation-card {
  width: min(920px, 100%);
  /* Altura definida garante que o card sempre caiba na viewport e role por dentro
     (evita cortar o topo/base ao centralizar). */
  height: min(760px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.negotiation-head { padding: 16px 20px 12px; border-bottom: 1px solid #eef2f7; flex: 0 0 auto; }
.negotiation-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.negotiation-client { margin: 0; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; }
.negotiation-title-input {
  border: 1px solid transparent;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  padding: 3px 6px;
  margin: 2px 0 0 -6px;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
}
.negotiation-title-input:hover { border-color: #e2e8f0; }
.negotiation-title-input:focus { border-color: #2563eb; background: #fff; outline: none; }
.negotiation-head-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.negotiation-proposal-num { font-size: 11px; color: #94a3b8; }
.negotiation-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

.pipeline-badge.is-nao-enviada { background: #eef2f7; color: #475569; }
.pipeline-badge.is-enviada { background: #dbeafe; color: #1d4ed8; }
.pipeline-badge.is-negociacao { background: #ffedd5; color: #9a3412; }
.pipeline-badge.is-fechada { background: #dcfce7; color: #15803d; }
.pipeline-badge.is-perdida { background: #fee2e2; color: #b91c1c; }

.negotiation-stagebar { display: flex; gap: 3px; margin-top: 12px; }
.negotiation-stage {
  flex: 1; text-align: center; padding: 6px 2px; border-radius: 6px;
  background: #f1f5f9; color: #94a3b8; font-size: 10.5px; line-height: 1.25;
  border: none; cursor: pointer; font-family: inherit;
}
.negotiation-stage:hover { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .35); }
.negotiation-stage b { font-weight: 600; }
.negotiation-stage small { display: block; opacity: .85; }
.negotiation-stage.is-done { background: #eef6ee; color: #4d7c3f; }
.negotiation-stage.is-current { color: #fff; }
.negotiation-stage.is-current.is-nao-enviada { background: #64748b; }
.negotiation-stage.is-current.is-enviada { background: #2563eb; }
.negotiation-stage.is-current.is-negociacao { background: #d97706; }
.negotiation-stage.is-current.is-fechada { background: #16a34a; }
.negotiation-stage.is-current.is-perdida { background: #dc2626; }

.negotiation-columns { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: minmax(0, 1fr); flex: 1 1 auto; overflow: hidden; min-height: 0; }
.negotiation-side { border-right: 1px solid #eef2f7; background: #fafbfc; padding: 14px 16px; overflow-y: auto; min-height: 0; }
.negotiation-main { padding: 14px 18px; overflow-y: auto; min-height: 0; }

.negotiation-section { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #eef2f7; }
.negotiation-section:last-child { border-bottom: none; margin-bottom: 0; }
.negotiation-section h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.negotiation-section h4 small { text-transform: none; letter-spacing: 0; color: #94a3b8; font-weight: 400; }
.negotiation-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #64748b; margin-bottom: 8px; }
.negotiation-field input, .negotiation-field select {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 9px; font-size: 13px; color: #0f172a; background: #fff;
}
.negotiation-field input:focus, .negotiation-field select:focus { border-color: #2563eb; outline: none; }
.negotiation-field input:disabled { background: #f1f5f9; color: #94a3b8; }
.negotiation-readonly { display: flex; flex-direction: column; margin-bottom: 6px; }
.negotiation-readonly small { font-size: 11px; color: #94a3b8; }
.negotiation-readonly span { font-size: 13px; color: #0f172a; }
.negotiation-hint { margin: -2px 0 8px; font-size: 11px; color: #b45309; }
.negotiation-link { display: inline-block; margin: -2px 0 8px; font-size: 12px; color: #1d4ed8; text-decoration: none; }
.negotiation-link:hover { text-decoration: underline; }
.negotiation-company { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #0f172a; }
.negotiation-stars { display: flex; gap: 2px; }
.negotiation-star { border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: #dbe1e8; padding: 0 1px; }
.negotiation-star.is-on { color: #f59e0b; }

.negotiation-nexttask {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 12.5px; color: #475569;
}
.negotiation-tabs { display: flex; gap: 16px; border-bottom: 1px solid #eef2f7; margin-bottom: 12px; }
.negotiation-tab { border: none; background: none; cursor: pointer; padding: 0 0 8px; font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; }
.negotiation-tab.is-active { color: #1d4ed8; font-weight: 600; border-bottom-color: #1d4ed8; }

.negotiation-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #eef2f7; }
.negotiation-timeline-item { position: relative; margin-bottom: 14px; }
.negotiation-timeline-item::before {
  content: ''; position: absolute; left: -19px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1;
}
.negotiation-timeline-item p { margin: 0; font-size: 13px; color: #0f172a; }
.negotiation-timeline-note { margin-top: 3px !important; background: #f8fafc; border-radius: 6px; padding: 6px 8px; color: #475569 !important; font-size: 12.5px; }
.negotiation-timeline-item time { font-size: 11px; color: #94a3b8; }
.negotiation-empty { font-size: 13px; color: #94a3b8; padding: 8px 0; }

/* Aba Anexos da negociacao */
.negotiation-attach-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.negotiation-attach-btn { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.negotiation-attach-btn.is-disabled { opacity: 0.6; pointer-events: none; }
.negotiation-attach-status { min-height: 0; margin: 0 0 8px; font-size: 12.5px; }
.negotiation-attach-status:empty { display: none; }
.negotiation-attachments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.negotiation-attachment { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 8px; background: #fff; }
.negotiation-attachment-icon { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.negotiation-attachment-info { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.negotiation-attachment-name { font-weight: 600; color: #1f2937; overflow-wrap: anywhere; }
.negotiation-attachment-info small { color: #94a3b8; font-size: 12px; }
.negotiation-attachment-actions { display: flex; gap: 10px; flex: 0 0 auto; }

.negotiation-history-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.negotiation-filter { display: inline-flex; gap: 2px; background: #f1f5f9; border-radius: 999px; padding: 3px; }
.negotiation-filter button { border: none; background: none; cursor: pointer; font-size: 12px; color: #64748b; padding: 4px 12px; border-radius: 999px; }
.negotiation-filter button.is-active { background: #fff; color: #1d4ed8; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.negotiation-note-editor { margin-bottom: 14px; }
.negotiation-note-editor textarea, .negotiation-note-edit-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 13px; resize: vertical; color: #0f172a; font-family: inherit; }
.negotiation-note-editor textarea:focus, .negotiation-note-edit-input:focus { border-color: #2563eb; outline: none; }
.negotiation-note-edit-input { border-color: #2563eb; margin: 4px 0; }
.negotiation-note-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.negotiation-timeline-foot { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.negotiation-note-tools { display: inline-flex; gap: 10px; }
.negotiation-timeline-item.is-note::before { background: #2563eb; }

.negotiation-tasks-count { font-size: 12px; color: #64748b; }
.negotiation-task-editor { margin-bottom: 14px; padding: 12px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; }
.negotiation-task-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.negotiation-task-list { display: flex; flex-direction: column; gap: 8px; }
.negotiation-task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 10px; }
.negotiation-task.is-done { opacity: .6; }
.negotiation-task.is-done .negotiation-task-title { text-decoration: line-through; }
.negotiation-task-check { display: flex; align-items: center; }
.negotiation-task-check input { width: 16px; height: 16px; margin-top: 2px; cursor: pointer; accent-color: #16a34a; }
.negotiation-task-body { flex: 1; min-width: 0; }
.negotiation-task-title { margin: 0; font-size: 13.5px; color: #0f172a; }
.negotiation-task-meta { margin: 2px 0 0; font-size: 12px; color: #94a3b8; }
.negotiation-task-meta .is-overdue { color: #dc2626; font-weight: 600; }
.negotiation-task-tools { display: inline-flex; gap: 10px; flex: 0 0 auto; }
.negotiation-task-tools button { font-size: 11.5px; }
@media (max-width: 720px) { .negotiation-task-form-row { grid-template-columns: 1fr; } }

.negotiation-proposal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-bottom: 12px; }
.negotiation-proposal-modules { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.negotiation-proposal-modules span { background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; }

/* Outras propostas vinculadas a mesma negociacao (alem da principal). */
.negotiation-linked-proposals { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.negotiation-linked-proposals h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.negotiation-linked-proposal {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 6px;
}
.negotiation-linked-num { font-weight: 600; font-size: 13px; color: var(--text); }
.negotiation-linked-value { font-size: 13px; color: var(--muted); }
.negotiation-linked-proposal .ghost-link { margin-left: auto; }

/* Botoes de acao no topo (pequenos e delicados). */
.negotiation-headbtn { border: none; border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; color: #fff; line-height: 1; white-space: nowrap; }
.negotiation-headbtn.is-lose { background: #dc2626; }
.negotiation-headbtn.is-lose:hover { background: #b91c1c; }
.negotiation-headbtn.is-win { background: #16a34a; }
.negotiation-headbtn.is-win:hover { background: #15803d; }
.negotiation-headbtn.is-reopen { background: #2563eb; }
.negotiation-headbtn.is-reopen:hover { background: #1d4ed8; }

/* Status vira uma faixa fina abaixo do cabecalho; some quando vazio. */
.negotiation-status { flex: 0 0 auto; }
.negotiation-status:empty { display: none; }
.negotiation-card .negotiation-status { margin: 0; font-size: 12px; padding: 5px 20px; background: #f8fafc; color: #475569; border-radius: 0; }
.negotiation-card .negotiation-status[data-state="success"] { color: #15803d; background: #f0fdf4; }
.negotiation-card .negotiation-status[data-state="error"] { color: #b91c1c; background: #fef2f2; }

@media (max-width: 720px) {
  .negotiation-card { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
  .negotiation-columns { grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; }
  .negotiation-side, .negotiation-main { overflow-y: visible; }
  .negotiation-side { border-right: none; border-bottom: 1px solid #eef2f7; }
  .negotiation-proposal-grid { grid-template-columns: 1fr; }
  .negotiation-stage b { font-size: 10px; }
}

/* ===================== Tarefas (Gestão Comercial) ===================== */
.sales-tasks-panel { padding: 18px 20px; }
.sales-tasks-counters { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sales-tasks-counter { border: none; background: none; cursor: pointer; font-size: 13px; color: #64748b; padding: 2px 4px; }
.sales-tasks-counter b { color: #0f172a; }
.sales-tasks-counter.is-overdue b { color: #dc2626; }
.sales-tasks-counter:hover { text-decoration: underline; }
.sales-tasks-counter-sep { color: #cbd5e1; }
.sales-tasks-toolbar { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.sales-tasks-situacao { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; }
.sales-tasks-situacao select { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff; }
.sales-tasks-filter { position: relative; }
.sales-tasks-filter-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; color: #475569; white-space: nowrap; }
.sales-tasks-dropdown { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 6px; min-width: 220px; max-height: 280px; overflow-y: auto; }
.sales-tasks-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: #0f172a; cursor: pointer; }
.sales-tasks-dropdown-item:hover { background: #f1f5f9; }
.sales-tasks-dropdown-empty { padding: 8px; font-size: 12px; color: #94a3b8; margin: 0; }
.sales-tasks-filter-count { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: #64748b; white-space: nowrap; }
.sales-tasks-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sales-tasks-chips:empty { display: none; }
.sales-tasks-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2f7; color: #334155; border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 12px; }
.sales-tasks-chip button { border: none; background: none; cursor: pointer; color: #64748b; font-size: 14px; line-height: 1; padding: 0 2px; }
.sales-tasks-chip button:hover { color: #dc2626; }
.sales-tasks-custom-range input { min-width: 130px; }
.sales-tasks-table-wrap { overflow-x: auto; }
.sales-tasks-table { width: 100%; border-collapse: collapse; }
.sales-tasks-table th, .sales-tasks-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #eef2f7; font-size: 13px; vertical-align: middle; }
.sales-tasks-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 600; }
.sales-tasks-check-col { width: 34px; }
.sales-tasks-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sales-tasks-sortable:hover { color: #1d4ed8; }
.sales-tasks-table tr.is-done { opacity: .6; }
.sales-task-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.sales-task-badge.is-atrasada { background: #fee2e2; color: #b91c1c; }
.sales-task-badge.is-pendente { background: #eef2f7; color: #475569; }
.sales-task-badge.is-concluida { background: #dcfce7; color: #15803d; }
.sales-task-title-btn, .sales-task-neg-btn { border: none; background: none; cursor: pointer; text-align: left; padding: 0; color: #1d4ed8; font-size: 13px; }
.sales-task-title-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sales-task-type-icon { font-size: 15px; }
.sales-task-neg-btn { display: flex; flex-direction: column; gap: 1px; }
.sales-task-neg-btn strong { color: #1d4ed8; }
.sales-task-neg-btn small { color: #64748b; font-weight: 400; }
.sales-task-due { white-space: nowrap; }
.sales-task-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #e6f1fb; color: #185fa5; font-size: 11px; font-weight: 600; }
.sales-task-row-actions { display: inline-flex; gap: 10px; white-space: nowrap; }
.sales-task-row-actions button { font-size: 12px; }
.sales-tasks-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12px; color: #64748b; }
.sales-tasks-page-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 5px 10px; margin-left: 4px; cursor: pointer; font-size: 12px; }
.sales-tasks-page-btn.is-active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.sales-task-modal-card { width: min(660px, 100%); }
.sales-task-modal-body { display: flex; flex-direction: column; gap: 18px; padding: 22px 28px 6px; }
.sales-task-modal-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #64748b; }
.sales-task-modal-body input, .sales-task-modal-body select { border: 1px solid #e2e8f0; border-radius: 9px; padding: 11px 12px; font-size: 14px; background: #fff; width: 100%; box-sizing: border-box; }
.sales-task-modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.1fr); gap: 14px; }

/* ----- Modal Criar Negociacao (negociacao sem proposta) ----- */
.create-negotiation-card { width: min(520px, 100%); }
.create-negotiation-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 28px 6px; }
.create-negotiation-body > label, .create-negotiation-grid2 label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #475569; }
.create-negotiation-body input, .create-negotiation-body select { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #fff; width: 100%; box-sizing: border-box; font-weight: 400; }
.create-negotiation-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.create-neg-amount input { max-width: 200px; }
.req-mark { color: #dc2626; }
.create-negotiation-section { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; border-top: 1px solid #eef2f7; padding-top: 14px; margin: 4px 0 -2px; }
.create-negotiation-body .ghost-link { align-self: flex-start; font-size: 12.5px; margin-top: -6px; }
.create-negotiation-actions { justify-content: flex-end; gap: 8px; }
/* Rodape com respiro nas bordas (o .modal-card nao tem padding interno; cada
   secao se pada. Neutraliza os margins negativos do sticky footer <=900px). */
.sales-task-modal-card .modal-actions,
.create-negotiation-card .modal-actions {
  margin: 0;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line-soft);
}
.create-neg-client-results { border: 1px solid #e2e8f0; border-radius: 9px; overflow: hidden; margin-top: -6px; max-height: 220px; overflow-y: auto; box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.create-neg-client-item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; background: #fff; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.create-neg-client-item:last-child { border-bottom: none; }
.create-neg-client-item:hover { background: #f8fafc; }
.create-neg-client-item strong { font-size: 13px; color: #0f172a; }
.create-neg-client-item small { font-size: 11px; color: #64748b; }
.create-neg-client-empty { padding: 10px 12px; font-size: 12px; color: #94a3b8; }
.pipeline-card-number.is-no-proposal { color: #94a3b8; font-style: italic; }
.negotiation-proposal-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; }
.negotiation-proposal-empty p { margin: 0; color: #475569; font-size: 13px; }
.negotiation-proposal-empty small { color: #94a3b8; font-size: 11.5px; }

.sales-tasks-bulkbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; color: #1e40af; }
.sales-tasks-bulk-reschedule { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #1e40af; }
.sales-tasks-bulk-reschedule input { border: 1px solid #bfdbfe; border-radius: 8px; padding: 5px 8px; font-size: 12px; }

@media (max-width: 720px) {
  .sales-task-modal-grid { grid-template-columns: 1fr; }
  .create-negotiation-grid2 { grid-template-columns: 1fr; }
  .sales-tasks-toolbar { gap: 8px; }
  .sales-tasks-filter-count { margin-left: 0; }
  .sales-tasks-table thead { display: none; }
  .sales-tasks-table, .sales-tasks-table tbody, .sales-tasks-table tr, .sales-tasks-table td { display: block; width: 100%; }
  .sales-tasks-table tr { border: 1px solid #eef2f7; border-radius: 12px; margin-bottom: 10px; padding: 10px 12px 8px; position: relative; }
  .sales-tasks-table td { border: none; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .sales-tasks-table td[data-label]::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 600; flex: 0 0 auto; }
  .sales-tasks-table .sales-tasks-check-col { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  .sales-task-neg-btn { align-items: flex-end; text-align: right; }
  .sales-task-row-actions { justify-content: flex-end; width: 100%; }
  .sales-tasks-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ===================== Central de Atendimento: modo tela cheia ===================== */
.service-requests-fullscreen-interval {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
}
.service-requests-fullscreen-interval select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.9rem;
}
.service-requests-fullscreen-updated {
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
  align-self: center;
}

/* Cobre 100% da viewport. Aplicado por JS (funciona com ou sem Fullscreen API
   nativo): quando o nativo esta ativo, o elemento ja preenche a tela; quando
   falha, este overlay fixo garante a visao cheia mesmo assim. */
.service-requests-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 4000;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  overflow: auto;
  background: #fff;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.service-requests-panel.is-fullscreen .table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  max-height: none;
}
.service-requests-panel.is-fullscreen .service-requests-table {
  font-size: 1.02rem;
}
.service-requests-panel.is-fullscreen .service-requests-table th,
.service-requests-panel.is-fullscreen .service-requests-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}
/* Em tela cheia, esconde filtros avancados e paginacao para foco no monitoramento. */
.service-requests-panel.is-fullscreen .service-request-advanced-filters,
.service-requests-panel.is-fullscreen .service-request-table-footer {
  display: none;
}
/* Cards de indicadores dentro da tela cheia: mantem a altura e nao encolhem. */
.service-request-metric-grid.is-fullscreen-metrics {
  flex: 0 0 auto;
  margin: 0;
}

/* ===================== Novo Dashboard (pipeline + tarefas) ===================== */
.dashboard-kpi {
  display: flex; flex-direction: column; gap: 4px;
  min-height: 96px; padding: 16px;
  border: 1px solid rgba(148, 163, 184, .2); border-radius: 14px; background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07); cursor: default;
}
.dashboard-kpi.accent-green { border-top: 3px solid #16a34a; }
/* Tarefas atrasadas > 0: destaque forte em vermelho com pulsar leve. */
.dashboard-kpi.is-danger {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 10px 28px rgba(239, 68, 68, .16);
  animation: dashboardOverduePulse 1.8s ease-in-out infinite;
}
.dashboard-kpi.is-danger .dashboard-kpi-label { color: #b91c1c; }
@keyframes dashboardOverduePulse {
  0%, 100% {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 10px 28px rgba(239, 68, 68, .16);
  }
  50% {
    border-color: #dc2626;
    background: #fee2e2;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .28), 0 12px 30px rgba(239, 68, 68, .30);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-kpi.is-danger { animation: none; }
}
.dashboard-kpi.is-clickable { cursor: pointer; }
.dashboard-kpi.is-clickable:hover { box-shadow: 0 12px 30px rgba(15, 23, 42, .13); }
.dashboard-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashboard-kpi-label { color: #526176; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.dashboard-kpi-value { color: #101826; font-size: 22px; line-height: 1.1; font-weight: 800; margin: 2px 0; }
.dashboard-kpi-value.danger-text { color: #b91c1c; }
.dashboard-kpi-caption { color: #64748b; font-size: 11px; }
.dashboard-kpi-gear { border: none; background: none; cursor: pointer; color: #94a3b8; font-size: 15px; line-height: 1; padding: 0; }
.dashboard-kpi-gear:hover { color: #185fa5; }
.dashboard-goal-define { align-self: flex-start; font-size: 12px; padding: 0; }
.dashboard-goal-bar { height: 8px; border-radius: 6px; background: #e8edf3; overflow: hidden; margin-top: 4px; }
.dashboard-goal-bar i { display: block; height: 100%; background: #16a34a; border-radius: 6px; }

.dashboard-row-2 { display: grid; gap: 16px; margin-bottom: 16px; align-items: start; }
.dashboard-row-funnel, .dashboard-row-tasks { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
/* align-self:start garante altura natural dos cards de conteudo variavel
   (Ranking, Tarefas) — nao esticam para igualar o vizinho mais alto. */
.dashboard-row-2 > .card { align-self: start; }
/* A Agenda (calendario) ESTICA para preencher a altura da linha (igualando o
   Funil) e distribui a grade internamente para ocupar o espaco. */
.dashboard-row-2 > .dashboard-calendar-compact-card {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}
.dashboard-row-2 > .dashboard-calendar-compact-card .dashboard-calendar-grid { grid-auto-rows: 1fr; }
.dashboard-funnel-card, .dashboard-ranking-card, .dashboard-mytasks-card, .dashboard-recent-requests-card { padding: 16px 18px; }
/* Estados vazios das listas do dashboard: compactos, sem reservar area grande. */
.dashboard-mytasks-list .empty-state, .dashboard-ranking-list .empty-state { margin: 8px 0 2px; color: #94a3b8; font-size: 13px; }

.dashboard-pipeline-funnel { display: grid; gap: 10px; margin-top: 8px; }
.dashboard-pipeline-funnel .dashboard-funnel-row {
  display: grid; grid-template-columns: 120px minmax(60px, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; border: none; background: none; cursor: pointer; padding: 4px 2px; text-align: left; border-radius: 8px;
}
.dashboard-pipeline-funnel .dashboard-funnel-row:hover { background: #f8fafc; }
.dashboard-funnel-label { font-size: 12px; color: #12213a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-funnel-track { height: 8px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.dashboard-funnel-track i { display: block; height: 100%; border-radius: 6px; }
.dashboard-funnel-value { font-size: 11.5px; font-weight: 700; color: #526176; white-space: nowrap; text-align: right; }
.dashboard-funnel-note { margin: 12px 0 0; color: #94a3b8; font-size: 11.5px; }

.dashboard-ranking-list { display: grid; gap: 12px; margin-top: 8px; }
.dashboard-ranking-row { display: grid; grid-template-columns: 26px 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.dashboard-ranking-pos { font-size: 12px; font-weight: 800; color: #94a3b8; }
.dashboard-ranking-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #e6f1fb; color: #185fa5; font-size: 12px; font-weight: 700; }
.dashboard-ranking-main { min-width: 0; }
.dashboard-ranking-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.dashboard-ranking-top strong { color: #12213a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-ranking-top span { color: #526176; white-space: nowrap; font-weight: 600; }
.dashboard-ranking-track { display: block; height: 6px; border-radius: 6px; background: #eef2f7; overflow: hidden; margin-top: 5px; }
.dashboard-ranking-track i { display: block; height: 100%; background: #185fa5; border-radius: 6px; }

.dashboard-mytasks-list { display: grid; gap: 6px; margin-top: 8px; }
.dashboard-task-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 6px; border-radius: 10px; }
.dashboard-task-row:hover { background: #f8fafc; }
.dashboard-task-check { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #cbd5e1; background: #fff; color: #16a34a; cursor: pointer; font-size: 13px; line-height: 1; }
.dashboard-task-check:hover { border-color: #16a34a; background: #f0fdf4; }
.dashboard-task-main { min-width: 0; cursor: pointer; }
.dashboard-task-line { display: flex; align-items: center; gap: 8px; }
.dashboard-task-line strong { font-size: 13px; color: #12213a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-task-main small { color: #64748b; font-size: 11.5px; }
.dashboard-task-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex: 0 0 auto; }
.dashboard-task-badge.is-overdue { color: #b91c1c; background: #fdecec; }
.dashboard-task-badge.is-today { color: #475569; background: #eef2f7; }
.dashboard-task-badge.is-upcoming { color: #185fa5; background: #e8f1fb; }

/* Calendario realocado para a 2a linha: mantem o card sem padding proprio. */
.dashboard-row-2 .dashboard-calendar-compact-card { padding: 0; overflow: hidden; cursor: pointer; }

/* Modal "Definir meta do mes" */
.dashboard-goal-card { width: min(420px, 100%); }
.dashboard-goal-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 28px 6px; }
.dashboard-goal-body .full-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #475569; }
.dashboard-goal-body input { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 400; background: #fff; width: 100%; box-sizing: border-box; }
.dashboard-goal-card .modal-actions { margin: 0; padding: 16px 28px 22px; border-top: 1px solid var(--line-soft); }

@media (max-width: 1100px) {
  .dashboard-row-funnel, .dashboard-row-tasks { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .dashboard-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-row-funnel, .dashboard-row-tasks { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dashboard-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===================== Aba Domínios do cliente ===================== */
.client-domains-hint { margin: 0 0 14px; color: #64748b; font-size: 13px; }
.client-domains-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.client-domains-add input { flex: 1 1 260px; min-width: 220px; border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #fff; box-sizing: border-box; }
.client-domains-items { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.client-domain-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #eef2f7; border-radius: 12px; background: #fff; }
.client-domain-info { min-width: 0; }
.client-domain-info strong { display: block; font-size: 14px; color: #12213a; }
.client-domain-info small { color: #64748b; font-size: 12px; }
.client-domains-empty { margin-top: 16px; padding: 22px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; text-align: center; }
.client-domains-empty strong { display: block; color: #334155; font-size: 14px; margin-bottom: 4px; }
.client-domains-empty p { margin: 0 0 12px; color: #94a3b8; font-size: 12.5px; }

/* ==== Chat Web (canais embeddaveis) ==== */
.web-chat-card .integration-card-header { align-items: flex-start; }
.web-chat-brand-icon { font-size: 22px; line-height: 1; }
.web-chat-org-label { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--primary, #2563eb); display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft, #dbeafe); padding: 5px 11px; border-radius: 999px; }
.web-chat-channel-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.web-chat-channel-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--border, #e2e8f0); border-radius: 12px;
  background: var(--surface, #fff); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.web-chat-channel-item:hover { border-color: var(--primary, #2563eb); box-shadow: 0 1px 6px rgba(37, 99, 235, .12); }
.web-chat-channel-dot { width: 12px; height: 12px; border-radius: 999px; flex: 0 0 auto; }
.web-chat-channel-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.web-chat-channel-info strong { font-size: 14px; color: #1e293b; }
.web-chat-channel-info small { font-size: 12px; color: #94a3b8; }
.web-chat-channel-status { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.web-chat-channel-status.is-active { background: #dcfce7; color: #15803d; }
.web-chat-channel-status.is-inactive { background: #f1f5f9; color: #64748b; }

.web-chat-form { margin-top: 14px; padding: 16px; border: 1px solid var(--border, #e2e8f0); border-radius: 14px; background: var(--surface-muted, #f8fafc); display: flex; flex-direction: column; gap: 12px; }
.web-chat-form-head { display: flex; align-items: center; justify-content: space-between; }
.web-chat-form-head strong { font-size: 15px; color: #1e293b; }
.web-chat-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #475569; }
.web-chat-field input, .web-chat-field textarea, .web-chat-field select {
  font-weight: 400; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--border, #cbd5e1);
  border-radius: 9px; background: #fff; color: #1e293b; width: 100%;
}
.web-chat-field textarea { resize: vertical; font-family: inherit; }
.web-chat-hint { font-weight: 400; font-size: 11.5px; color: #94a3b8; }
.web-chat-field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.web-chat-field-row .web-chat-field { flex: 1 1 140px; }
.web-chat-field-color input[type="color"] { padding: 3px; height: 38px; cursor: pointer; }
.web-chat-fields-required { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px; display: flex; gap: 18px; flex-wrap: wrap; }
.web-chat-fields-required legend { font-size: 12px; font-weight: 600; color: #64748b; padding: 0 6px; }
.web-chat-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #334155; }
.web-chat-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.web-chat-snippet { margin-top: 4px; border-top: 1px dashed var(--border, #cbd5e1); padding-top: 12px; }
.web-chat-snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.web-chat-snippet-head strong { font-size: 13px; color: #1e293b; }
.web-chat-snippet-code {
  margin: 8px 0 0; padding: 12px; border-radius: 10px; background: #0f172a; color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-all; overflow-x: auto;
}
@media (max-width: 640px) {
  .web-chat-field-row { flex-direction: column; }
}



/* ===================== Central Administrativa / Financeira ===================== */
.ac-heading-actions { display: flex; gap: 8px; align-items: center; }

.ac-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 18px; }
.ac-card { text-align: left; background: #fff; border: 1px solid #e5e7eb; border-left: 3px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: box-shadow .15s, transform .12s; }
.ac-card:hover { box-shadow: 0 6px 18px rgba(15,27,45,.10); transform: translateY(-1px); }
.ac-card-label { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.ac-card-value { font-size: 20px; font-weight: 800; color: #0f1b2d; }
.ac-card-hint { font-size: 10.5px; color: #94a3b8; }
.ac-card-afaturar { border-left-color: #EF9F27; } .ac-card-afaturar .ac-card-value { color: #8A5A0B; }
.ac-card-faturado { border-left-color: #639922; } .ac-card-faturado .ac-card-value { color: #3B6D11; }
.ac-card-rdv { border-left-color: #378ADD; } .ac-card-rdv .ac-card-value { color: #185FA5; }
.ac-card-contratos { border-left-color: #E24B4A; } .ac-card-contratos .ac-card-value { color: #A32D2D; }

.ac-tabs { display: flex; gap: 18px; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.ac-tab { background: none; border: none; padding: 0 0 8px; font-size: 13.5px; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.ac-tab.is-active { color: #185FA5; font-weight: 700; border-bottom-color: #185FA5; }
.ac-badge { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: #FCEBEB; color: #791F1F; }

.ac-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.ac-toolbar input, .ac-toolbar select { border: 1px solid #d7dde6; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: #0f1b2d; background: #fff; }
.ac-toolbar input[type="search"] { min-width: 220px; }
.ac-toolbar-spacer { flex: 1 1 auto; }

.ac-table-wrap { min-height: 120px; }
.ac-table-scroll { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px; }
.ac-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12.5px; }
.ac-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: #94a3b8; padding: 9px 12px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
/* Corpo padrao de toda celula da tabela (evita herdar tamanhos maiores de
   regras genericas de td de outras telas). */
.ac-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #1e293b; font-size: 12.5px; }
/* Nome do cliente/colaborador: mesmo corpo da tabela, so em negrito. */
.ac-table td strong { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
/* Nome do tecnico: texto padrao (nunca em destaque maior). */
.ac-table td.ac-tech { font-size: 12.5px; font-weight: 400; }
.ac-table tr:last-child td { border-bottom: none; }
.ac-table-wrap .muted, .ac-modal .muted { color: #94a3b8; font-size: .92em; }
.ac-row-aging { background: #FCF7F0; }
.ac-aging { color: #B0530F; font-weight: 700; font-size: 10.5px; }
.ac-warn { color: #B0530F; font-weight: 600; font-size: 11px; }

.ac-origin { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 7px; background: #eef2f7; color: #475569; }
.ac-origin-service_order { background: #E6F1FB; color: #0C447C; }
.ac-origin-attendance { background: #EEF2F7; color: #475569; }
.ac-origin-manual { background: #F3EAFB; color: #6B21A8; }

.ac-badge2 { font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 8px; white-space: nowrap; display: inline-block; }
.b-afaturar { color: #8A5A0B; background: #FAEEDA; }
.b-faturado { color: #0C447C; background: #E6F1FB; }
.b-pago { color: #27500A; background: #EAF3DE; }
.b-alerta { color: #791F1F; background: #FCEBEB; }
.b-neutro { color: #475569; background: #eef2f7; }

.ac-actions { white-space: nowrap; }
.ac-mini { border: 1px solid #d7dde6; background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 11px; cursor: pointer; color: #334155; margin-right: 4px; }
.ac-mini:hover { background: #f8fafc; }
.ac-mini-primary { color: #27500A; border-color: #C0DD97; background: #F4FAEC; }
.ac-mini-primary:hover { background: #EAF3DE; }

.ac-empty { padding: 40px 16px; text-align: center; color: #94a3b8; font-size: 13px; border: 1px dashed #e2e8f0; border-radius: 10px; }
.ac-footnote { margin-top: 10px; color: #94a3b8; font-size: 11px; line-height: 1.5; }

/* Modal do modulo financeiro */
.ac-modal-overlay { position: fixed; inset: 0; background: rgba(15,27,45,.45); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 16px; }
.ac-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 380px; padding: 20px; box-shadow: 0 20px 50px rgba(15,27,45,.30); max-height: 90vh; overflow-y: auto; }
.ac-modal-wide { max-width: 520px; }
.ac-modal h3 { margin: 0 0 14px; font-size: 16px; color: #0f1b2d; }
.ac-modal-form { display: flex; flex-direction: column; gap: 12px; }
.ac-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #475569; }
.ac-field input, .ac-field textarea { border: 1px solid #d7dde6; border-radius: 9px; padding: 9px 11px; font-size: 13px; color: #0f1b2d; font-family: inherit; }
.ac-field input:focus, .ac-field textarea:focus { outline: none; border-color: #185FA5; }
.ac-client-search { position: relative; display: flex; flex-direction: column; }
.ac-client-search input { border: 1px solid #d7dde6; border-radius: 9px; padding: 9px 11px; font-size: 13px; color: #0f1b2d; font-family: inherit; }
.ac-client-search input:focus { outline: none; border-color: #185FA5; }
.ac-client-search-results { margin-top: 6px; border: 1px solid #e3e9f0; border-radius: 9px; overflow: hidden; max-height: 220px; overflow-y: auto; }
.ac-client-search-results[hidden] { display: none; }
.ac-client-search-results button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: #fff; border: none; border-bottom: 1px solid #eef2f7; padding: 8px 11px; cursor: pointer; font-family: inherit; }
.ac-client-search-results button:last-child { border-bottom: none; }
.ac-client-search-results button:hover { background: #f1f6fc; }
.ac-client-search-results strong { font-size: 13px; font-weight: 600; color: #0f1b2d; }
.ac-client-search-results small { font-size: 11px; font-weight: 500; color: #64748b; }
.ac-client-search-empty { margin: 0; padding: 9px 11px; font-size: 12px; font-weight: 500; color: #64748b; }
.ac-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ac-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; margin-bottom: 14px; }
.ac-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #eef2f7; border-radius: 9px; padding: 9px 11px; font-size: 12px; }

.ac-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 3200; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .25s, transform .25s; }
.ac-toast-success { background: #16803c; }
.ac-toast-error { background: #b42318; }
.ac-toast.is-out { opacity: 0; transform: translateX(-50%) translateY(8px); }

@media (max-width: 900px) { .ac-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .ac-cards { grid-template-columns: 1fr; }
  .ac-toolbar input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .ac-tabs { gap: 12px; }
}

.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #E24B4A; color: #fff; font-size: 10px; font-weight: 700; }

/* Modal do PDF do RDV (conferencia do financeiro) */
.ac-modal-pdf { max-width: 840px; width: 100%; height: 88vh; display: flex; flex-direction: column; }
.ac-pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ac-pdf-head h3 { margin: 0; font-size: 15px; }
.ac-close-x { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #64748b; }
.ac-close-x:hover { color: #0f1b2d; }
.ac-code-link { background: none; border: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: #185FA5; cursor: pointer; }
.ac-code-link:hover { text-decoration: underline; }
.ac-os-info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ac-os-info-head > div { display: flex; align-items: center; gap: 8px; }
.ac-os-info-head h3 { margin: 0; font-size: 16px; color: #0f1b2d; }
.ac-os-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 14px; }
.ac-os-info-cell { display: flex; flex-direction: column; gap: 2px; }
.ac-os-info-cell span { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .02em; }
.ac-os-info-cell strong { font-size: 13px; font-weight: 600; color: #0f1b2d; }
.ac-os-info-block { margin-bottom: 14px; }
.ac-os-info-block > span { display: block; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 5px; }
.ac-os-info-block > p { margin: 0; font-size: 13px; color: #0f1b2d; white-space: pre-wrap; }
.ac-os-info .service-order-detail-list { display: flex; flex-direction: column; gap: 6px; }
.ac-os-info select { border: 1px solid #d7dde6; border-radius: 9px; padding: 9px 11px; font-size: 13px; color: #0f1b2d; font-family: inherit; background: #fff; }
.ac-os-info select:focus { outline: none; border-color: #185FA5; }
.ac-os-info .ac-field > span { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .02em; }
.ac-os-info .ac-modal-actions button { white-space: nowrap; }
.ac-pdf-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ac-pdf-frame { flex: 1 1 auto; width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.ac-pdf-loading { padding: 48px 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.ac-pdf-open { margin-top: 8px; font-size: 12px; }
.ac-pdf-open a { color: #185FA5; }
@media (max-width: 560px) { .ac-modal-pdf { height: 92vh; } }

.b-info { color: #1d4ed8; background: #dbeafe; }

/* ============================================================
   Dashboard customizavel por widgets (gridstack)
   ============================================================ */
.dashboard-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.dashboard-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dashboard-edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashboard-edit-actions[hidden] { display: none; }
.dashboard-customize-btn { white-space: nowrap; }
.dashboard-edit-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #475569;
  background: #eef4fb;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  padding: 8px 12px;
}
.dashboard-edit-hint[hidden] { display: none; }

.dashboard-screen { overflow-x: hidden; }
.dashboard-grid.grid-stack { min-height: 120px; }

/* O card do widget preenche o item do grid; cabecalho fixo, corpo rola. */
.grid-stack-item-content { display: flex; }
.dashboard-widget-card {
  height: 100%;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.dashboard-widget-card > .dashboard-summary-header,
.dashboard-widget-card > .dashboard-calendar-header,
.dashboard-widget-card > .dashboard-calendar-weekdays,
.dashboard-widget-card > .dashboard-calendar-legend,
.dashboard-widget-card > .dashboard-funnel-note { flex: 0 0 auto; }
.dashboard-widget-card .dashboard-pipeline-funnel,
.dashboard-widget-card .dashboard-ranking-list,
.dashboard-widget-card .dashboard-mytasks-list,
.dashboard-widget-card .dashboard-summary-list,
.dashboard-widget-card .dashboard-calendar-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Widget de metrica */
.dashboard-metric-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.dashboard-kpi.dashboard-widget-card { justify-content: center; }

/* Modo edicao */
.grid-stack.is-editing .grid-stack-item-content {
  outline: 2px dashed #b9c6da;
  outline-offset: -2px;
  border-radius: 12px;
}
.grid-stack.is-editing .dashboard-widget-card { cursor: move; }
.grid-stack.is-editing .dashboard-widget-card * { cursor: inherit; }
.grid-stack.is-editing .dashboard-widget-card button,
.grid-stack.is-editing .dashboard-widget-card a { cursor: pointer; }
.dashboard-widget-remove { display: none; }
.grid-stack.is-editing .dashboard-widget-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.grid-stack.is-editing .dashboard-widget-remove:hover { background: #dc2626; }
/* Alca de redimensionar mais visivel em edicao */
.grid-stack.is-editing .grid-stack-item > .ui-resizable-se {
  opacity: 1;
  width: 20px;
  height: 20px;
}

/* Galeria "+ Adicionar widget" */
.dashboard-gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}
.dashboard-gallery-modal[hidden] { display: none; }
.dashboard-gallery-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
}
.dashboard-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 16px;
}
.dashboard-gallery-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #64748b; }
.dashboard-gallery-list { padding: 12px 14px; display: grid; gap: 8px; overflow: auto; }
.dashboard-gallery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
}
.dashboard-gallery-item:hover { border-color: #2563eb; background: #f8fafc; }
.dashboard-gallery-icon { font-size: 22px; flex: 0 0 auto; }
.dashboard-gallery-meta { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.dashboard-gallery-meta small { color: #64748b; font-size: 12px; }
.dashboard-gallery-plus { font-size: 20px; color: #2563eb; font-weight: 700; flex: 0 0 auto; }

/* Adaptacao de conteudo por tamanho (nunca cortar/distorcer) */
.dashboard-kpi.is-tall .dashboard-kpi-value { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.dashboard-kpi.is-short .dashboard-kpi-value { font-size: 1.15rem; }
.dashboard-kpi.is-narrow .dashboard-kpi-caption,
.dashboard-kpi.is-short .dashboard-kpi-caption { font-size: 10.5px; }
.dashboard-widget-card.is-narrow .dashboard-funnel-label,
.dashboard-widget-card.is-narrow .dashboard-funnel-value { font-size: 11px; }
.dashboard-widget-card.is-narrow .dashboard-ranking-top span { font-size: 11px; }

/* Personalizacao apenas em telas largas */
@media (max-width: 1100px) {
  .dashboard-customize-btn { display: none; }
  .dashboard-edit-actions { display: none; }
}

/* Widget "Chamados por status" (donut) dentro da grade */
.dashboard-status-chart-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; align-items: center; }
.dashboard-widget-card .dashboard-donut-layout { width: 100%; padding: 8px 12px 12px; }
.dashboard-widget-card.is-narrow .dashboard-donut-layout { grid-template-columns: 1fr; justify-items: center; gap: 12px; }

/* ============================================================
   Central de Atendimento: em monitores estreitos a tabela rola na
   horizontal (comportamento correto de tabela larga). Fixamos CODIGO
   (esquerda) e ACOES (direita) para o chamado e os botoes Iniciar/
   Pausar ficarem SEMPRE visiveis. Em telas largas nao ha rolagem ->
   efeito nulo (layout identico). So CSS, nao altera larguras/resize.
   ============================================================ */
.service-requests-table th[data-request-column="code"],
.service-requests-table td[data-request-column="code"] {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}
.service-requests-table th[data-request-column="code"] {
  background: var(--panel-soft);
  z-index: 4;
}
.service-requests-table td[data-request-column="code"] {
  box-shadow: 6px 0 8px -8px rgba(15, 23, 42, .18);
}
.service-requests-table th[data-request-column="actions"],
.service-requests-table td[data-request-column="actions"] {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
}
.service-requests-table th[data-request-column="actions"] {
  background: var(--panel-soft);
  z-index: 4;
}
.service-requests-table td[data-request-column="actions"] {
  box-shadow: -6px 0 8px -8px rgba(15, 23, 42, .18);
}
/* Mantem o destaque de hover da linha tambem nas colunas fixas. */
.service-requests-table tbody tr:hover td[data-request-column="code"],
.service-requests-table tbody tr:hover td[data-request-column="actions"] {
  background: #f8fbff;
}
/* A coluna Ações é sticky (z-index:2), entao o menu "⋯" (fixed) ficava preso
   nesse stacking context e era coberto pelas células sticky das linhas de baixo.
   Com o menu aberto, elevamos a célula da linha ativa acima das demais. */
.service-requests-table td[data-request-column="actions"]:has(.sr-action-menu.is-open) {
  z-index: 1500;
}

/* ===== Iniciar chat ativo (modal do botao "Iniciar chat" na Central) ===== */
.start-chat-card {
  width: 520px;
  max-width: 94vw;
}
.start-chat-step-label {
  margin: 4px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.start-chat-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
/* Com apenas um canal ativo (WhatsApp), o card ocupa a largura toda. */
.start-chat-channels:has(.start-chat-channel:only-child) {
  grid-template-columns: 1fr;
}
.start-chat-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.start-chat-channel.is-selected {
  border: 2px solid #1d9e75;
  background: #e1f5ee;
}
.start-chat-channel-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #0f6e56;
}
.start-chat-channel-text strong {
  display: block;
  font-size: 14px;
  color: #085041;
}
.start-chat-channel-text small {
  display: block;
  font-size: 12px;
  color: #0f6e56;
}
.start-chat-search-field {
  position: relative;
  display: block;
  margin-bottom: 8px;
}
.start-chat-search-field input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 38px;
}
.start-chat-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
}
.start-chat-client-results {
  position: static;
  margin-bottom: 12px;
  box-shadow: none;
}
.start-chat-selected-client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--primary-soft);
  background: var(--primary-soft);
  border-radius: 10px;
  cursor: pointer;
}
.start-chat-selected-client[hidden] {
  display: none;
}
.start-chat-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  color: var(--primary-dark);
}
.start-chat-selected-client-info strong {
  display: block;
  font-size: 14px;
  color: var(--primary-dark);
}
.start-chat-selected-client-info small {
  display: block;
  font-size: 12px;
  color: var(--primary-dark);
}
.start-chat-selected-client button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.start-chat-contacts {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.start-chat-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.start-chat-contact:first-child {
  border-top: 0;
}
.start-chat-contact.is-selected {
  background: var(--panel-soft);
  border-left: 3px solid #1d9e75;
}
.start-chat-contact-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-soft);
  color: var(--muted);
}
.start-chat-contact.is-selected .start-chat-contact-avatar {
  background: #e1f5ee;
  color: #0f6e56;
}
.start-chat-contact-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}
.start-chat-contact-info small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.start-chat-contact-check {
  margin-left: auto;
  color: #0f6e56;
  font-weight: 800;
}
.start-chat-hint {
  margin: 0;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Iniciar chat — ajustes de layout (header com badge, ícones) ===== */
.start-chat-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.start-chat-brand-badge {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e1f5ee;
  color: #0f6e56;
}
.start-chat-header-text {
  flex: 1 1 auto;
  min-width: 0;
}
.start-chat-header-text h2 {
  margin: 0;
}
.start-chat-brand-sub {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f6e56;
}
/* Corpo com o mesmo respiro lateral do cabeçalho (padrão dos modais: 28px). */
.start-chat-body {
  padding: 22px 28px 26px;
}
.start-chat-lead {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}
.start-chat-selected-check {
  margin-left: auto;
  color: var(--primary-dark);
  font-weight: 800;
}
.start-chat-contact-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.start-chat-contact-line svg {
  flex: 0 0 auto;
  color: #1d9e75;
}
.start-chat-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Aba global "Pesquisa de Satisfação" (CSAT) no Fluxo de atendimento. */
.satisfaction-survey-panel {
  display: grid;
  gap: 16px;
}
.satisfaction-survey-panel[hidden] { display: none; }
.satisfaction-survey-panel .settings-form {
  transition: opacity .15s ease;
}

/* ===== Relatórios (screen-reports) ===== */
.reports-hub[hidden],
.reports-detail[hidden] { display: none; }

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 18px;
}

.report-card {
  width: 100%;
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px 18px;
  border: 1px solid #dfe4ec;
  border-radius: 12px;
  background: #fff;
  color: #172033;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.report-card:hover,
.report-card:focus-visible {
  border-color: #b7c2d6;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  outline: none;
}

.report-card strong { font-size: 15px; }

.report-card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #2c58e8;
  background: #dbeafe;
}
.report-card-icon .icon { width: 26px; height: 26px; }
.report-card-icon.amber  { color: #d67b00; background: #fff0cf; }
.report-card-icon.blue   { color: #2c58e8; background: #dbeafe; }
.report-card-icon.green  { color: #05a451; background: #d7f8e4; }
.report-card-icon.indigo { color: #5958e9; background: #e9e7ff; }
.report-card-icon.purple { color: #873cec; background: #eee0ff; }
.report-card-icon.teal   { color: #0e8f9c; background: #cff3f6; }

/* ---- Detalhe do relatório ---- */
.report-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
/* Ações + intervalo de datas padronizados no topo à direita do cabeçalho.
   Os botões ficam à esquerda das datas, na mesma linha, alinhados pela base. */
.report-head-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.report-head-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.report-head-buttons:empty { display: none; }
/* Botões do cabeçalho na mesma altura dos campos de data (38px) = "sincronizado". */
.report-head-buttons .secondary-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
}
.report-head-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.report-head-dates:empty { display: none; }
/* Telas estreitas: ações ocupam a linha inteira, alinhadas à esquerda, sem
   ficarem espremidas contra a borda direita; datas e botões esticam. */
@media (max-width: 720px) {
  .report-head-actions {
    margin-left: 0;
    width: 100%;
  }
  .report-head-buttons,
  .report-head-dates { flex: 1 1 auto; }
  .report-head-dates .report-field { flex: 1 1 140px; }
  .report-head-dates .report-field input { width: 100%; }
}
.report-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe4ec;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #37445c;
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.report-back:hover { border-color: #b7c2d6; color: #172033; }
.report-detail-head h2 { font-size: 18px; margin: 0; }

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border, #e3e8f0);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-field label {
  font-size: 12px;
  font-weight: 600;
  color: #647084;
}
.report-field input,
.report-field select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d7deea;
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: #172033;
}
.report-toolbar-spacer { flex: 1 1 auto; }

.report-summary {
  color: #647084;
  font-size: 13px;
  margin: 0 2px 10px;
}

.report-table-wrap {
  border: 1px solid var(--border, #e3e8f0);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th,
.report-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  white-space: nowrap;
}
.report-table th {
  position: sticky;
  top: 0;
  background: #f6f8fb;
  color: #4a5670;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover td { background: #f9fbfd; }

.report-empty,
.report-soon {
  padding: 34px 20px;
  text-align: center;
  color: #647084;
}
.report-soon strong { display: block; color: #172033; margin-bottom: 4px; }

.report-badge-soon {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff0cf;
  color: #a35a00;
  font-size: 12px;
  font-weight: 600;
}

/* ---- Configurar colunas ---- */
.report-cols { position: relative; }
.report-cols-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}
.report-cols-panel[hidden] { display: none; }
.report-cols-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #172033;
}
.report-cols-item:hover { background: #f2f6fb; }
.report-cols-item input { width: 15px; height: 15px; flex: none; }

/* ---- Menu de exportação (PDF/Excel/CSV) ---- */
.report-export { position: relative; }
.report-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 170px;
  padding: 6px;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}
.report-export-menu[hidden] { display: none; }
.report-export-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #172033;
  cursor: pointer;
}
.report-export-menu button:hover { background: #f2f6fb; }
