:root {
  color-scheme: light;
  --pink: #BF0882;
  --pink-l: rgba(191, 8, 130, 0.06);
  --pink-b: rgba(191, 8, 130, 0.3);
  --ink: #121212;
  --body: #3D3D3D;
  --dim: #8C8C8C;
  --line: #EAEAEA;
  --line-strong: #D8D8D8;
  --bg: #ffffff;
  --surface: #FAFAFA;
  --r: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

body {
  display: flex;
  align-items: stretch;
}

.app-shell {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.workspace {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

/* ============ Intranet sidebar ============ */
.app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex-shrink: 0;
  width: 224px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 16px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 4px 8px 20px;
}

.sidebar-brand img {
  height: 24px;
  width: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r);
  color: var(--body);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--dim);
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  background: var(--pink-l);
  color: var(--ink);
}

.sidebar-link:hover svg {
  color: var(--body);
}

.sidebar-link.is-active {
  background: var(--pink-l);
  color: var(--pink);
}

.sidebar-link.is-active svg {
  color: var(--pink);
}

.sidebar-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
}

.sidebar-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sidebar-user-meta strong {
  font-size: 0.82rem;
  color: var(--ink);
}

.sidebar-user-meta small {
  font-size: 0.72rem;
  color: var(--dim);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

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

.topbar-logo {
  height: 26px;
  width: auto;
  display: block;
}

.topbar-brand .eyebrow,
.topbar-brand h1 {
  display: none;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

h1 span {
  color: var(--pink);
}

h2 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.project-meta label,
.parameter-grid label,
.slider-grid label {
  display: grid;
  gap: 7px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--pink);
}

input[readonly] {
  background: var(--surface);
  color: var(--body);
  font-weight: 500;
}

input[type="range"] {
  min-height: 22px;
  padding: 0;
  accent-color: var(--pink);
}

.range-field {
  grid-template-columns: minmax(0, 1fr) auto;
}

.range-field output {
  color: var(--pink);
  font-size: 0.95rem;
  font-weight: 600;
}

.range-field input {
  grid-column: 1 / -1;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: none;
}

.controls-panel {
  box-shadow: none;
}

.panel-heading,
.summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  color: var(--ink);
}

.panel-heading span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
}

.setup-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 20px;
  margin-bottom: 20px;
}

.project-meta,
.parameter-grid,
.slider-grid {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}

.project-meta {
  grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr;
}

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

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

.slider-grid label {
  grid-template-columns: minmax(0, 1fr) auto;
}

.slider-grid input {
  grid-column: 1 / -1;
  padding: 0;
  accent-color: var(--pink);
}

.slider-grid output {
  color: var(--pink);
  font-size: 0.95rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  align-items: start;
  gap: 20px;
}

.input-stack {
  display: grid;
  gap: 20px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 20px;
}

.service-toggle {
  position: relative;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  padding: 12px;
  text-align: left;
  transition: border-color 0.15s ease;
}

.service-toggle:hover {
  border-color: var(--line-strong);
}

.service-toggle.active {
  border-color: var(--pink);
  background: var(--pink-l);
}

.service-toggle strong {
  display: block;
  margin-bottom: 8px;
  padding-right: 22px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.service-toggle span {
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 400;
}

.service-toggle.active span {
  color: var(--pink);
}

.service-toggle::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
}

.service-toggle.active::after {
  border-color: var(--pink);
  background: var(--pink);
}

.quantity-list {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
}

.quantity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 126px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 12px;
  background: var(--bg);
}

.quantity-row strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.quantity-row span {
  color: var(--dim);
  font-size: 0.78rem;
}

.quantity-row input {
  min-height: 34px;
}

.quantity-row.checkbox-row {
  grid-template-columns: minmax(0, 1fr) 126px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-control input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--pink);
}

.check-control small {
  display: block;
  color: var(--dim);
  font-size: 0.78rem;
}

.slider-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  background: var(--bg);
}

.slider-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.slider-card strong,
.slider-card span {
  display: block;
}

.slider-card strong {
  color: var(--ink);
  font-weight: 500;
}

.slider-card span {
  color: var(--pink);
  font-size: 0.82rem;
  font-weight: 500;
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 11px;
}

.line-total {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}

.summary {
  position: relative;
}

.sticky-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--pink);
  font-size: 1.05rem;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--body);
  padding: 0;
  font-weight: 500;
  font-size: 0.86rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-button:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.ghost-button:hover,
.summary-actions button:hover {
  color: var(--pink);
  border-color: var(--pink);
}

.summary-actions button + button {
  border: none;
  background: transparent;
  border-bottom: 1px solid transparent;
}

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

.summary-list .final-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 20px;
  background: var(--ink);
  color: #fff;
}

.summary-list .final-row dt {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

.final-caption {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

.summary-list .final-row dd {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 600;
  line-height: 1;
  color: var(--pink);
}

.summary-kgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  align-items: stretch;
}

.summary-kgrid .kcard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--bg);
  padding: 14px 20px;
}

.summary-kgrid .lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--dim);
}

.summary-kgrid .val {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.kcard-note {
  font-size: 10px;
  font-weight: 500;
  color: var(--pink);
  line-height: 1.35;
}

.kcard-note:empty {
  display: none;
}

.summary-list .project-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 18px 20px 0;
}

.summary-list .project-row dt,
.summary-list .project-row dd {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
}

.summary-list .project-total-row {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 18px;
}

.summary-list .project-total-row dt {
  color: var(--ink);
  font-size: 12px;
}

.summary-list .project-total-row dd {
  color: var(--pink);
  font-size: 1.05rem;
  font-weight: 600;
}

.receipt-timestamp {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.summary-items {
  border-top: 1px solid var(--line);
  padding: 20px 20px;
}

.summary-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.summary-items h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.summary-items-header span {
  color: var(--dim);
  font-size: 11px;
}

.summary-items-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.summary-item-row {
  border-left: 2px solid var(--pink-b);
  padding: 6px 0 6px 10px;
}

.summary-item-row strong,
.summary-item-row span {
  display: block;
}

.summary-item-row strong {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
}

.summary-item-row span {
  color: var(--dim);
  font-size: 0.74rem;
}

.summary-item-empty {
  color: var(--dim);
  font-size: 0.84rem;
}

.summary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 20px;
}

.summary-actions button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  transition: all 0.15s ease;
}

.summary-actions button:hover {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

.summary-actions button + button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.summary-actions button + button:hover {
  background: transparent;
  color: var(--pink);
  border-color: var(--pink);
}

@media (min-width: 1280px) {
  .summary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .summary-actions button:first-child {
    grid-column: 1 / -1;
  }
}

.kgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.kgrid .kcard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  padding: 18px 20px;
}

.kgrid .kcard .lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--dim);
}

.kgrid .kcard .val {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
}

.kgrid .kcard .sub {
  font-size: 11px;
  color: var(--dim);
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.hf-field {
  display: grid;
  gap: 5px;
  min-width: 130px;
}

.hf-field span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 500;
}

.hf-field input,
.hf-field select {
  min-height: 38px;
  font-size: 0.84rem;
}

.hf-grow {
  flex: 1 1 220px;
  min-width: 200px;
}

.hf-clear {
  align-self: end;
  border-bottom: 1px solid transparent;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.history-toolbar-actions {
  display: flex;
  gap: 20px;
}

.history-count {
  color: var(--dim);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 18px 20px;
}

.empty-history {
  color: var(--dim);
  padding: 24px 0;
  text-align: center;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 130px;
  align-items: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  padding: 16px;
}

.history-row span,
.history-row em {
  display: block;
  color: var(--dim);
  font-size: 0.76rem;
  font-style: normal;
}

.history-row strong {
  display: block;
  margin: 3px 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}

.history-status {
  min-height: 34px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 20px;
  text-align: center;
  text-align-last: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--body);
}

.history-status[data-status="Rascunho"] {
  background: var(--surface);
  color: var(--dim);
  border-color: var(--line-strong);
}

.history-status[data-status="Enviada"] {
  background: #F0F6FF;
  color: #1877F2;
  border-color: #CFE3FF;
}

.history-status[data-status="Aprovada"] {
  background: #F0FAF5;
  color: #0F9D6C;
  border-color: #CDEEDD;
}

.history-status[data-status="Perdida"] {
  background: #FDF1F1;
  color: #D63B3B;
  border-color: #F6D3D3;
}

.history-empty-filtered {
  color: var(--dim);
  padding: 24px 0;
  text-align: center;
}

.history-price {
  align-self: start;
  color: var(--pink);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: right;
}

.history-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.history-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--body);
  font-weight: 500;
  font-size: 0.82rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.history-actions button:hover {
  border-color: var(--pink-b);
  background: var(--pink-l);
  color: var(--pink);
}

.history-actions button[data-action="load"] {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  font-weight: 600;
}

.history-actions button[data-action="load"]:hover {
  filter: brightness(1.05);
  color: #fff;
}

.base-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  border: 0;
  border-radius: var(--r);
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.base-dialog::backdrop {
  background: rgba(18, 18, 18, 0.4);
}

.dialog-shell {
  display: grid;
  max-height: min(760px, calc(100vh - 28px));
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.base-table {
  display: grid;
  overflow: auto;
  padding: 8px 20px 20px;
}

.base-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.base-row span {
  color: var(--dim);
  font-size: 11px;
}

.base-row strong {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.base-row em {
  color: var(--pink);
  font-style: normal;
  font-weight: 600;
  text-align: right;
}

/* ============ Intranet nav ============ */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-nav .ghost-button.is-active {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

.workspace-wide {
  width: min(1560px, calc(100% - 48px));
}

/* ============ CRM / Kanban ============ */
.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.crm-toolbar .history-count {
  align-self: center;
  margin-left: auto;
}

.crm-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}

.deal-column {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 160px;
}

.deal-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.deal-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.deal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

.deal-dot[data-stage="Enviada"] { background: #1877F2; }
.deal-dot[data-stage="Aprovada"] { background: #0F9D6C; }
.deal-dot[data-stage="Perdida"] { background: #D63B3B; }

.deal-column-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
}

.deal-column-value {
  color: var(--pink);
  font-size: 0.82rem;
  font-weight: 600;
}

.deal-column-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  flex: 1;
  border-radius: 0 0 var(--r) var(--r);
  transition: background 0.15s ease;
}

.deal-column-body.is-over {
  background: var(--pink-l);
  outline: 1px dashed var(--pink-b);
  outline-offset: -4px;
}

.deal-column-empty {
  color: var(--dim);
  font-size: 12px;
  text-align: center;
  padding: 16px 0;
  margin: 0;
}

.deal-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 12px 14px;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.deal-card:hover {
  border-color: var(--pink-b);
  box-shadow: 0 4px 14px rgba(18, 18, 18, 0.06);
}

.deal-card:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}

.deal-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.deal-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.deal-card-client {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.deal-card-value {
  color: var(--pink);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
}

.deal-card-meta {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.deal-card-next {
  margin: 0;
  color: var(--body);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.leads-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leads-empty {
  color: var(--dim);
  font-size: 13px;
  padding: 8px 2px;
}

.lead-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 10px 14px;
}

.lead-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lead-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.lead-card-meta {
  color: var(--dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lead-card-actions button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.lead-card-actions button.lead-convert {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ---- Deal dialog ---- */
.deal-dialog {
  width: min(560px, calc(100% - 28px));
}

.deal-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px;
  overflow: auto;
}

.deal-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.deal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg);
  padding: 12px 14px;
}

.deal-meta-item .lbl {
  font-size: 10px;
  color: var(--dim);
  font-weight: 500;
}

.deal-meta-item strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.deal-field {
  display: grid;
  gap: 6px;
}

.deal-field span {
  font-size: 11px;
  font-weight: 500;
  color: var(--dim);
}

.deal-field input,
.deal-field select,
.deal-field textarea {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.86rem;
}

.deal-field textarea {
  resize: vertical;
  line-height: 1.5;
}

.deal-field input:focus,
.deal-field select:focus,
.deal-field textarea:focus {
  outline: none;
  border-color: var(--pink);
}

.deal-items-summary {
  margin: 0;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
}

.deal-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.deal-footer-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.deal-delete {
  color: #D63B3B;
  border-bottom-color: transparent;
}

.deal-delete:hover {
  border-bottom-color: #D63B3B;
  color: #D63B3B;
}

.deal-save {
  min-height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: var(--r);
  background: var(--pink);
  color: #fff;
  font-weight: 600;
  font-size: 0.86rem;
}

.deal-save:hover {
  filter: brightness(1.05);
}

/* ============ Dashboard ============ */
.topbar-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--dim);
  margin-bottom: 3px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border-radius: var(--r);
  background: var(--pink);
  color: #fff;
  font-weight: 600;
  font-size: 0.86rem;
  text-decoration: none;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.kgrid-trend .kcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kcard-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.kcard-trend.trend-up {
  color: #0F9D6C;
  background: #F0FAF5;
}

.kcard-trend.trend-down {
  color: #D63B3B;
  background: #FDF1F1;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--pink);
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

.dash-funnel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
}

.dash-funnel-row {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.dash-funnel-label {
  font-size: 0.82rem;
  color: var(--body);
}

.dash-funnel-track {
  height: 10px;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
}

.dash-funnel-bar {
  height: 100%;
  border-radius: 20px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.dash-funnel-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 20px;
  text-align: right;
}

.dash-funnel-value {
  font-size: 0.78rem;
  color: var(--dim);
  min-width: 72px;
  text-align: right;
}

.dash-recent {
  display: flex;
  flex-direction: column;
  padding: 6px 0 8px;
}

.dash-recent-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.dash-recent-row:last-child {
  border-bottom: 0;
}

.dash-recent-row:hover {
  background: var(--pink-l);
}

.dash-recent-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dash-recent-main strong {
  font-size: 0.88rem;
  color: var(--ink);
}

.dash-recent-main span {
  font-size: 0.76rem;
  color: var(--dim);
}

.dash-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--dim);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}

.dash-badge[data-status="Enviada"] {
  background: #F0F6FF;
  color: #1877F2;
  border-color: #CFE3FF;
}

.dash-badge[data-status="Aprovada"] {
  background: #F0FAF5;
  color: #0F9D6C;
  border-color: #CDEEDD;
}

.dash-badge[data-status="Perdida"] {
  background: #FDF1F1;
  color: #D63B3B;
  border-color: #F6D3D3;
}

.dash-recent-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pink);
  text-align: right;
  white-space: nowrap;
}

.dash-empty {
  color: var(--dim);
  font-size: 0.86rem;
  padding: 16px 20px;
  margin: 0;
}

.dash-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px;
}

.dash-tool {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dash-tool:hover {
  border-color: var(--pink-b);
  background: var(--pink-l);
}

.dash-tool strong {
  font-size: 0.92rem;
  color: var(--ink);
}

.dash-tool span {
  font-size: 0.8rem;
  color: var(--dim);
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .setup-grid,
  .content-grid,
  .project-meta,
  .parameter-grid {
    grid-template-columns: 1fr;
  }

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

  .crm-board {
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-tools {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    flex-direction: column;
  }

  .dash-funnel-row {
    grid-template-columns: 60px 1fr auto;
  }

  .dash-funnel-value {
    display: none;
  }

  .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .sidebar-brand {
    padding: 0 12px 0 0;
  }

  .sidebar-brand img {
    height: 20px;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 2px;
  }

  .sidebar-link span {
    display: none;
  }

  .sidebar-link {
    padding: 9px 12px;
  }

  .sidebar-user {
    margin-left: auto;
    margin-top: 0;
    padding: 0 0 0 12px;
    border-top: 0;
  }

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

  .workspace {
    width: min(100% - 32px, 1320px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .topbar-actions,
  .topbar-nav {
    justify-content: space-between;
    width: 100%;
  }

  .crm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .crm-toolbar .hf-field,
  .crm-toolbar .history-count {
    width: 100%;
    margin-left: 0;
  }

  .deal-meta-grid {
    grid-template-columns: 1fr;
  }

  .deal-dialog-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .service-grid,
  .slider-grid,
  .summary-kgrid,
  .kgrid {
    grid-template-columns: 1fr;
  }

  .quantity-row {
    grid-template-columns: 1fr;
  }

  .line-total {
    text-align: left;
  }

  .summary-actions,
  .history-actions {
    grid-template-columns: 1fr;
  }

  .history-toolbar,
  .history-row {
    grid-template-columns: 1fr;
  }

  .history-toolbar {
    display: grid;
  }

  .history-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .hf-field,
  .hf-grow,
  .hf-clear {
    width: 100%;
  }

  .history-status {
    width: 100%;
  }

  .history-price {
    text-align: left;
  }

  .base-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }

  .base-row em {
    text-align: left;
  }
}

@media print {
  body {
    background: #fff;
  }

  .input-stack,
  .setup-grid,
  .summary-actions,
  .topbar-actions {
    display: none;
  }

  .workspace,
  .content-grid {
    width: 100%;
    display: block;
    padding: 0;
  }

  .panel {
    box-shadow: none;
  }

  .summary-items-list {
    max-height: none;
    overflow: visible;
  }

  .summary-item-row {
    break-inside: avoid;
  }
}
