:root {
  /* Identidade visual NEXOR — baseada na logo oficial (public/assets/brand/logo-nexor.png) */
  --brand-navy: #071827;
  --brand-navy-2: #0b1f33;
  --brand-gold: #d8a640;
  --brand-blue: #0e5a8a;
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #ffffff;
  --border-soft: #e2e8f0;

  --bg: var(--surface-soft);
  --surface-2: #eef2f5;
  --text: var(--text-main);
  --muted: var(--text-muted);
  --line: var(--border-soft);
  --line-strong: #c9d2da;
  --primary: var(--brand-navy-2);
  --primary-dark: var(--brand-navy);
  --primary-soft: #dce8f2;
  --accent: var(--brand-gold);
  --accent-soft: #f4eddf;
  --warning: #c58b2a;
  --warning-soft: #fbefd9;
  --danger: #b64a4a;
  --danger-soft: #f7e5e5;
  --success: #2e7d5b;
  --success-soft: #e2f1ea;
  --info: var(--brand-blue);
  --info-soft: #e1edf6;
  --shadow: 0 14px 34px rgba(11, 31, 51, 0.08);
  --radius: 8px;
  --sidebar-width: 272px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(11, 31, 51, 0.97), rgba(1, 17, 45, 0.98)),
    radial-gradient(circle at 80% 20%, rgba(216, 166, 87, 0.16), transparent 38%),
    var(--brand-navy);
  color: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.login-brand .brand-logo {
  height: 128px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 42px;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.login-copy {
  max-width: 720px;
}

.login-copy h1 {
  max-width: 780px;
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

.login-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  color: #f9fbf8;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-weight: 700;
}

.login-card {
  display: grid;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  gap: 12px;
  padding: 22px 24px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
}

.login-card label,
.contact-form label {
  display: grid;
  gap: 7px;
}

.login-card label {
  gap: 6px;
}

.login-card label span,
.contact-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-card input,
.login-card select,
.login-card textarea,
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.login-card input:focus,
.login-card select:focus,
.login-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 31, 51, 0.14);
}

.forgot-password-link {
  display: block;
  width: fit-content;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  color: #667085;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.forgot-password-link:hover,
.forgot-password-link:focus-visible {
  color: #071b38;
  text-decoration: underline;
}

.forgot-password-link:focus-visible {
  outline: 2px solid #c9a45c;
  outline-offset: 3px;
  border-radius: 2px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.check-line input {
  width: 16px;
  min-height: 16px;
}

.check-line span {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 700 !important;
}

.link-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-weight: 800;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.login-note {
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-width);
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  padding: 22px 16px;
  color: #f9fbf8;
  background: var(--brand-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 8px 0 20px;
}

.brand .brand-logo {
  width: 100%;
  height: auto;
  max-height: 92px;
  object-fit: contain;
  display: block;
}

/* Estado de fallback: só aparece se a logo oficial não carregar (o atributo
   hidden precisa vencer o display abaixo, por isso o seletor :not([hidden])). */
.brand-fallback[hidden] {
  display: none;
}

.brand-fallback:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.brand-fallback .brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--brand-navy);
  font-weight: 800;
  background: var(--brand-gold);
  border-radius: 8px;
}

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

.brand-fallback strong {
  font-size: 16px;
  color: #fff;
}

.brand-fallback span {
  color: #dce8f2;
  font-size: 11px;
}

.nav-list {
  display: grid;
  flex: 1;
  gap: 6px;
  min-height: 0;
  margin-top: 6px;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: #dce8f2;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.nav-button:hover,
.nav-button:focus-visible {
  color: #fff;
  background: var(--brand-navy-2);
  outline: none;
}

.nav-button.active {
  color: #fff;
  background: var(--brand-navy-2);
  border-color: rgba(216, 166, 87, 0.32);
  box-shadow: inset 3px 0 0 var(--brand-gold);
}

.nav-button small {
  color: inherit;
  opacity: 0.72;
}

.sidebar-footer {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 12px;
  color: #dce8f2;
  background: var(--brand-navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-gold);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(216, 166, 87, 0.16);
}

.main {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 82px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar .button.primary {
  border-color: var(--brand-gold);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-screen .eyebrow {
  color: rgba(255, 255, 255, 0.72);
}

.login-card .eyebrow {
  color: var(--primary);
}

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

.export-menu-wrap {
  position: relative;
  display: inline-flex;
}

.button.is-loading {
  opacity: 0.78;
  pointer-events: none;
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 95;
  width: 224px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(11, 31, 51, 0.16);
  transform-origin: top right;
  animation: exportMenuIn 160ms ease;
}

.export-dropdown[hidden] {
  display: none;
}

.export-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.export-option:hover,
.export-option:focus-visible {
  color: var(--primary);
  background: #edf4fa;
  outline: none;
}

.export-option:active {
  transform: translateY(1px);
}

.export-option strong,
.export-option small {
  display: block;
}

.export-option strong {
  font-size: 13px;
}

.export-option small {
  color: var(--muted);
  font-size: 12px;
}

.export-option-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
}

@keyframes exportMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-box {
  display: grid;
  grid-template-columns: 18px minmax(180px, 280px);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

/* .button/.icon-button têm a mesma especificidade da regra padrão do
   navegador para [hidden] — sem isso, button.hidden = true não escondia
   o elemento (mesma causa já corrigida para .brand-fallback/.field). */
.button[hidden],
.icon-button[hidden] {
  display: none;
}

.button {
  padding: 0 14px;
}

.button.wide {
  width: 100%;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.button.secondary {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: #b9cfe0;
}

.button.ghost,
.icon-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.button.ghost:hover,
.icon-button:hover,
.button.ghost:focus-visible,
.icon-button:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #edbcbc;
}

.button.warning {
  color: #6e4305;
  background: var(--warning-soft);
  border-color: #e8c987;
}

.button.gold {
  color: var(--brand-navy);
  background: var(--accent);
  border-color: var(--accent);
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
}

.icon-button.mini {
  width: 32px;
  min-height: 32px;
}

.mobile-menu {
  display: none;
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.platform-context-banner {
  margin-bottom: 16px;
  padding: 11px 14px;
  color: var(--brand-navy);
  background: #eef4f8;
  border: 1px solid #c8d7e2;
  border-left: 4px solid var(--brand-navy);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.select,
.input,
.textarea {
  width: 100%;
  min-height: 40px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.select,
.input {
  padding: 0 12px;
}

.textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.select:focus,
.input:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 31, 51, 0.14);
}

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

.metric-card {
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.tone-green {
  color: var(--success);
  background: var(--success-soft);
}

.tone-purple {
  color: var(--accent);
  background: var(--accent-soft);
}

.tone-amber {
  color: var(--warning);
  background: var(--warning-soft);
}

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

.tone-red {
  color: var(--danger);
  background: var(--danger-soft);
}

.tone-gold {
  color: #6f5520;
  background: var(--accent-soft);
}

.metric-link {
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.metric-link:hover,
.metric-link:focus-visible {
  border-color: rgba(216, 166, 64, 0.58);
  outline: none;
  transform: translateY(-1px);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

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

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.section-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-header p,
.muted {
  margin: 0;
  color: var(--muted);
}

.panel-body {
  padding: 16px;
}

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

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-item h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.list-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b9dec3;
}

.pill.warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #e9ca8f;
}

.pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #ecc1c1;
}

.pill.info {
  color: var(--info);
  background: var(--info-soft);
  border-color: #bfd9eb;
}

.pill.accent {
  color: #8a6215;
  background: var(--accent-soft);
  border-color: #e8d3a3;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: #e7ece8;
  border-radius: 999px;
}

.progress-bar {
  width: var(--value);
  height: 100%;
  background: linear-gradient(90deg, var(--brand-navy), var(--brand-gold));
}

.funnel {
  display: grid;
  gap: 10px;
}

.funnel-row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) minmax(160px, 180px);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.funnel-label {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
}

.funnel-track {
  width: 100%;
  min-width: 0;
  height: 32px;
  overflow: hidden;
  background: #eef2f5;
  border-radius: 8px;
}

.funnel-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: max(44px, var(--funnel-value, 0%));
  min-width: 44px;
  max-width: 100%;
  padding: 0 12px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: var(--primary);
  border-radius: 8px;
}

.funnel-row > strong {
  justify-self: stretch;
  min-width: 0;
  overflow: visible;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  background: #f8fafb;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  color: var(--text);
}

tr:hover td {
  background: #f8fafb;
}

.cell-title {
  display: grid;
  gap: 2px;
}

.cell-title strong {
  font-size: 14px;
}

.cell-title span {
  color: var(--muted);
  font-size: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  row-gap: 6px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(250px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-column {
  box-sizing: border-box;
  min-width: 250px;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #eef2f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.kanban-header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kanban-body {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 260px;
  min-width: 0;
  padding: 10px;
}

.kanban-body.drag-over {
  background: rgba(216, 166, 64, 0.16);
  outline: 1px dashed var(--accent);
  outline-offset: -6px;
}

.lead-card {
  box-sizing: border-box;
  display: grid;
  gap: 9px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(11, 31, 51, 0.05);
  cursor: grab;
}

.lead-card.dragging {
  opacity: 0.55;
}

.lead-card.is-saving {
  opacity: 0.72;
  cursor: wait;
}

.lead-card.is-overdue {
  border-color: rgba(182, 74, 74, 0.48);
  box-shadow: inset 3px 0 0 var(--danger), 0 8px 20px rgba(11, 31, 51, 0.05);
}

.lead-card h3 {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 14px;
}

.lead-card p {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.lead-card .pill-row {
  min-width: 0;
}

.lead-card .pill {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card footer {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lead-card footer .button {
  min-width: 0;
  width: 100%;
  padding-inline: 8px;
}

.lead-card footer .button {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.project-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.project-card header > div {
  min-width: 0;
}

.project-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card .table-actions .button {
  white-space: normal;
  text-align: center;
  flex: 1 1 auto;
  min-width: 0;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-box {
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

.stat-box strong,
.stat-box span {
  display: block;
}

.stat-box strong {
  font-size: 16px;
}

.stat-box span {
  color: var(--muted);
  font-size: 12px;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.finance-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.finance-box span {
  color: var(--muted);
  font-weight: 800;
}

.finance-box strong {
  display: block;
  margin-top: 7px;
  font-size: 21px;
}

.goal-card {
  display: grid;
  gap: 14px;
}

.goal-card-donut {
  gap: 16px;
}

.goal-card span {
  color: var(--muted);
  font-weight: 800;
}

.goal-card strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.period-select {
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

/* Empilhada verticalmente (seletor de mês em cima, botões abaixo) em vez de
   lado a lado — largura fixa faz o select e os botões ficarem com a mesma
   largura via align-items: stretch, sem precisar declarar width em cada um. */
.period-control {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 11px;
  width: 190px;
  flex-shrink: 0;
}

.period-current-button {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.goal-donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.goal-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(11, 31, 51, 0.08);
}

.goal-donut::after {
  position: absolute;
  inset: 26px;
  content: "";
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(11, 31, 51, 0.06);
}

.goal-donut-center {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.goal-donut-center strong {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}

.goal-donut-center span,
.goal-donut-center small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.goal-donut-copy {
  min-width: 0;
}

.goal-donut-copy strong {
  font-size: 30px;
}

.goal-legend {
  display: grid;
  gap: 8px;
}

.goal-legend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.goal-legend-item span:not(.goal-dot) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-legend-item strong {
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.goal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.goal-dot.sold {
  background: var(--primary);
}

.goal-dot.proposal {
  background: var(--accent);
}

.goal-dot.remaining {
  background: #dbe2e7;
}

.goal-dot.excess,
.goal-dot.potential {
  background: var(--success);
}

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

.goal-percent-grid > div {
  min-width: 0;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

.goal-percent-grid strong {
  margin: 3px 0 0;
  font-size: 18px;
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.bar-line {
  display: grid;
  grid-template-columns: 92px minmax(140px, 1fr) 94px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 12px;
  background: #ecf0ed;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  width: var(--value);
  height: 100%;
  background: var(--primary);
}

.bar-fill.out {
  background: var(--warning);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.day-card {
  min-height: 148px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.day-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.task-chip {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
}

.priority-item {
  align-items: center;
}

.quick-form {
  display: grid;
  gap: 14px;
}

.lead-drawer {
  width: min(920px, 100%);
}

.lead-summary {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-grid {
  display: grid;
  gap: 10px;
}

.lead-secondary-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.detail-grid div {
  min-width: 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong {
  margin-top: 5px;
  word-break: break-word;
}

.timeline {
  margin-top: 18px;
}

.timeline h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.timeline-item {
  display: grid;
  gap: 3px;
  padding: 12px 0 12px 16px;
  border-left: 2px solid var(--line);
}

.timeline-item span {
  color: var(--info);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline-item small {
  color: var(--muted);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(1, 17, 45, 0.56);
}

.modal-root.open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 820px);
  overflow: hidden;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.modal.small {
  width: min(500px, 100%);
}

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

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  max-height: calc(88vh - 132px);
  overflow: auto;
  padding: 16px;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  color: #fff;
  background: var(--brand-navy);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

[data-icon] {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

[data-icon] svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@media (min-width: 901px) {
  .login-screen {
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .login-brand,
  .login-grid {
    grid-area: 1 / 1;
  }

  .login-brand {
    align-self: start;
  }

  .login-grid {
    min-height: 0;
    align-self: stretch;
  }
}

@media (max-width: 1180px) {
  .metric-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 900px) {
  .login-card {
    max-height: none;
  }

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

  .login-copy h1 {
    font-size: 44px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .main {
    grid-column: 1;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    padding: 14px 16px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-box {
    flex: 1;
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .content {
    padding: 18px 16px 32px;
  }

  .metric-grid,
  .project-grid,
  .grid-3,
  .finance-summary {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .login-screen {
    padding: 18px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-copy p {
    font-size: 16px;
  }

  .login-card {
    padding: 18px;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions .button,
  .topbar-actions .export-menu-wrap,
  .topbar-actions .search-box {
    width: 100%;
  }

  .export-menu-wrap .button {
    width: 100%;
  }

  .export-dropdown {
    left: 0;
    right: auto;
    width: 100%;
  }

  .toolbar,
  .toolbar-left,
  .toolbar-right {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .button,
  .toolbar .select,
  .toolbar .input {
    width: 100%;
  }

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

  .list-item,
  .funnel-row,
  .bar-line {
    grid-template-columns: 1fr;
  }

  .project-stats {
    grid-template-columns: 1fr;
  }

  .button {
    white-space: normal;
  }
}

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

  .sidebar,
  .topbar,
  .toolbar,
  .table-actions,
  .modal-footer,
  .toast-root {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .panel,
  .metric-card,
  .project-card {
    box-shadow: none;
  }
}
