:root {
  --bg: #16181d;
  --bg-soft: #1b1e25;
  --panel: #1f222b;
  --panel-2: #20232b;
  --ink: #eceff4;
  --muted: #9aa1b2;
  --line: #303644;
  --line-soft: #272c37;
  --primary: #3b82f6;
  --primary-soft: #1d2a3d;
  --danger: #f0677b;
  --warn: #ffb454;
  --success: #2bd576;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #15181f;
}

.layout {
  display: grid;
  grid-template-columns: 286px 1fr;
  gap: 12px;
  height: 100vh;
  min-height: 100vh;
  padding: 12px;
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(180deg, #0f1014 0%, #0b0c10 100%);
  color: var(--ink);
  padding: 12px;
  border: 1px solid #21252f;
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: sticky;
  top: 12px;
  align-self: start;
  height: calc(100vh - 24px);
  min-height: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 8px 8px 12px;
  border-bottom: 1px solid #222631;
  display: grid;
  gap: 10px;
}

.brand-logo {
  width: 128px;
  height: auto;
  opacity: 0.94;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.03rem;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.side-nav {
  display: grid;
  gap: 14px;
  padding: 12px 4px;
  align-content: start;
  overflow: hidden;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section + .nav-section {
  padding-top: 10px;
  border-top: 1px solid #222631;
}

.nav-section-title {
  margin: 0 8px 6px;
  color: #7f8699;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 500;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: #aab0bf;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  font-weight: 500;
  letter-spacing: 0.01em;
  font-size: 0.9rem;
}

.nav-btn.active,
.nav-btn:hover {
  background: #181c25;
  color: #e8edf7;
}

.nav-btn.active {
  box-shadow: none;
}

.nav-btn.active .nav-icon {
  color: #8fbdff;
}

.sidebar-footer {
  margin-top: 8px;
  padding: 10px 6px 4px;
  border-top: 1px solid #222631;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #22293a;
  border: 1px solid #2f3850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #dce6ff;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.user-role {
  font-size: 0.73rem;
  color: var(--muted);
}

.content {
  padding: 6px 10px 22px;
  height: calc(100vh - 24px);
  min-width: 0;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  background: rgba(14, 16, 22, 0.8);
  border: 1px solid #252a35;
  border-radius: 14px;
  padding: 14px 16px;
}

.topbar h2 {
  margin: 0;
  font-size: 1.35rem;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.panel {
  background: linear-gradient(180deg, #1d2230 0%, #1a1f2a 100%);
  border-radius: 14px;
  border: 1px solid #2f3747;
  padding: 14px 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 12px 28px rgba(5, 7, 11, 0.22);
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.filters > input,
.filters > select {
  min-width: 180px;
  flex: 1 1 220px;
}

.filters > button {
  white-space: nowrap;
  min-height: 42px;
  flex: 0 0 auto;
}

#processos-page .filters {
  display: grid;
  grid-template-columns: minmax(230px, 1.45fr) minmax(185px, 1fr) auto minmax(185px, 1fr) max-content 40px;
  align-items: stretch;
  gap: 8px;
}

#processos-page .filters button {
  min-width: 0;
}

#processos-page .filters .view-toggle {
  align-self: stretch;
}

#apply-bulk-process-status {
  min-width: 96px;
  white-space: nowrap;
}

.clients-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(190px, 1fr) auto;
  gap: 10px;
}

.clients-filters > button {
  min-width: 120px;
  white-space: nowrap;
}

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

input[type='checkbox'],
input[type='radio'] {
  width: auto;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

input,
select,
textarea {
  border: 1px solid #343a4a;
  border-radius: 10px;
  padding: 9px 10px;
  width: 100%;
  background: #171a22;
  color: var(--ink);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8d96aa 50%),
    linear-gradient(135deg, #8d96aa 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.clients-filters select {
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  padding-right: 42px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6f7ba0;
  box-shadow: 0 0 0 3px rgba(129, 145, 182, 0.18);
}

button {
  border: 1px solid #343a4a;
  background: #1a1d25;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

button:hover {
  border-color: #4b5368;
  background: #202531;
}

button:focus-visible {
  outline: 2px solid rgba(123, 155, 220, 0.55);
  outline-offset: 2px;
}

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

button.secondary-action {
  border-color: #445066;
  background: #232a38;
  color: #d8e1f5;
}

button.secondary-action:hover {
  border-color: #5b6983;
  background: #2b3446;
}

button.icon-only {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.icon-only svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.icon-only.is-loading svg {
  animation: spin 0.72s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-rascunho {
  background: #2a2f39;
  color: #cad1dd;
}

.status-a_pedir_docs {
  background: #3a301f;
  color: #ffc874;
}

.status-pronto_a_submeter {
  background: #233047;
  color: #8eb9ff;
}

.status-submetido {
  background: #24354a;
  color: #8ec5ff;
}

.status-propostas_recebidas {
  background: #1f3429;
  color: #64e09a;
}

.status-enviado_ao_cliente {
  background: #213742;
  color: #7adcf7;
}

.status-fechado {
  background: #2f333d;
  color: #c4c8d0;
}

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

.process-select-cell {
  width: 42px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  font-size: 0.93rem;
  vertical-align: middle;
}

.table th {
  color: #c4cad7;
  font-weight: 700;
  background: #1a1e27;
}

.table td {
  color: #e7eaf2;
}

.table tr:hover {
  background: #222733;
}

.selected-row td {
  background: #232b3a;
}

.hidden {
  display: none;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

#tab-content {
  display: grid;
  gap: 18px;
}

.tab-btn.active {
  background: var(--primary-soft);
  border-color: #34588e;
  color: #d9e8ff;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

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

.checklist {
  display: grid;
  gap: 8px;
}

.choice-list {
  gap: 10px;
}

.choice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #313748;
  border-radius: 10px;
  background: #181c24;
  color: var(--ink);
}

.view-toggle {
  border: 1px solid #343a4a;
  background: #141a25;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  gap: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.view-btn {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 7px;
  color: #95a1bb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.view-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view-btn.active {
  color: #e7efff;
  background: linear-gradient(180deg, #33486f 0%, #2d3d5d 100%);
  box-shadow: inset 0 0 0 1px rgba(140, 168, 224, 0.35);
}

.view-btn:hover {
  background: #233047;
}

.view-btn:active {
  transform: scale(0.97);
}

.card {
  border: 1px solid #364156;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #1a2130 0%, #171d28 100%);
  box-shadow: 0 8px 18px rgba(3, 7, 14, 0.18);
}

.card .card {
  background: linear-gradient(180deg, #182131 0%, #151d2a 100%);
  border-color: #43516b;
  box-shadow: inset 0 1px 0 rgba(170, 190, 232, 0.06);
}

.card .card .card {
  background: #131c2a;
  border-color: #4d5f7f;
}

.card .analytics-card,
.card .catalog-tier,
.card .doc-upload-card,
.card .inbox-item,
.card .funnel-item,
.card .kanban-card {
  background: #141d2a;
  border-color: #40506b;
}

.card > .grid,
.card > .stack,
.card > .card,
.card > .bulk-actions,
.card > .table-wrap,
.card > .simulator-grid,
.card > .comm-form {
  margin-top: 12px;
}

.card + .card {
  margin-top: 12px;
}

.mapping-code {
  display: block;
  margin: 0;
  border: 1px solid #313748;
  border-radius: 10px;
  background: #141820;
  color: #ced9f7;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.35;
}

.stack {
  display: grid;
  gap: 14px;
}

.catalog-shell > .catalog-item {
  background: linear-gradient(180deg, #1a202d 0%, #1a1f2b 100%);
  border-color: #384158;
  box-shadow: 0 14px 24px rgba(4, 8, 14, 0.28);
}

.catalog-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid #2f384c;
}

.catalog-tier {
  border: 1px solid #3f4d69;
  border-radius: 10px;
  background: linear-gradient(180deg, #151f2e 0%, #131c2a 100%);
  box-shadow: inset 0 0 0 1px rgba(85, 103, 140, 0.22);
  padding: 10px;
}

.catalog-edit-surface {
  margin-top: 14px;
  border: 1px solid #4a5c7f;
  border-radius: 12px;
  background: linear-gradient(180deg, #121c2a 0%, #101926 100%);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(149, 172, 220, 0.1);
}

.catalog-edit-surface > .grid,
.catalog-edit-surface > .action-row {
  margin-top: 12px;
}

.stack + .card {
  margin-top: 14px;
}

.action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.checklist-inline {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #c6cede;
  font-size: 0.84rem;
}

.tag-ok {
  color: var(--success);
}

.tag-miss {
  color: var(--danger);
}

.dropzone {
  border: 2px dashed #3c4151;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background: #171a22;
}

.dropzone.dragover {
  border-color: var(--primary);
  background: #1f2130;
}

.doc-upload-grid {
  display: grid;
  gap: 10px;
}

.doc-upload-card {
  border: 1px solid #2f3544;
  border-radius: 10px;
  padding: 10px;
  background: #171b23;
}

.doc-upload-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.doc-upload-dropzone {
  margin-top: 8px;
  border: 2px dashed #3d4353;
  border-radius: 10px;
  padding: 14px;
  background: #141820;
  color: #a6adbd;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doc-upload-dropzone:hover {
  border-color: #5a6280;
  background: #1a1f2b;
}

.doc-upload-dropzone.dragover {
  border-color: var(--primary);
  background: #1e2130;
}

.doc-upload-input {
  display: none;
}

.bulk-actions {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: end;
}

.bulk-actions > button {
  height: 42px;
  padding: 0 16px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
}

.proposal-status-select {
  min-width: 180px;
}

dialog {
  width: min(960px, 95vw);
  border: 1px solid #333a4c;
  border-radius: 14px;
  padding: 0;
  background: #181b23;
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(6, 8, 12, 0.78);
  backdrop-filter: blur(2px);
}

#wizard-form {
  padding: 16px;
  max-height: 90vh;
  overflow: auto;
}

.wizard-step {
  font-weight: 600;
  margin: 14px 0 8px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.consents {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.consents label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-start;
}

#toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #121622;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2e3650;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  max-width: 360px;
}

#toast.show {
  opacity: 1;
}

.small {
  color: var(--muted);
  font-size: 0.85rem;
}

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 6px;
  margin: 6px 0;
}

.best {
  background: #1c2a22;
}

textarea.email {
  min-height: 190px;
}

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

.home-kpi {
  border: 1px solid #313748;
  border-radius: 12px;
  background: #181c24;
  padding: 12px;
}

.home-kpi .label {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
}

.home-kpi .value {
  margin-top: 6px;
  font-size: 1.35rem;
  font-weight: 700;
}

.home-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.home-status-item {
  border: 1px solid #313748;
  border-radius: 10px;
  padding: 10px;
  background: #181c24;
}

.home-alerts {
  margin-top: 14px;
}

.alert-list {
  display: grid;
  gap: 8px;
}

.alert-item {
  border: 1px solid #313748;
  border-radius: 10px;
  padding: 10px;
  background: #181c24;
}

.alert-item.critico {
  border-left: 4px solid #bf2d2d;
}

.alert-item.aviso {
  border-left: 4px solid #a15f00;
}

.priority-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
}

.priority-alta {
  background: #41252d;
  color: #ff9db0;
}

.priority-media {
  background: #3f3221;
  color: #ffc37a;
}

.priority-baixa {
  background: #243248;
  color: #96beff;
}

.score-pill {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.76rem;
  background: #2a3040;
  color: #dee8ff;
  font-weight: 700;
  white-space: nowrap;
  min-width: 82px;
  text-align: center;
  border: 1px solid #3b455e;
}

.score-cell {
  white-space: nowrap;
  min-width: 112px;
}

.icon-btn {
  min-width: 40px;
  padding: 8px 10px;
}

.log-details {
  display: grid;
  gap: 4px;
}

.log-diff {
  font-size: 0.82rem;
  color: #505050;
}

.preview-dialog {
  width: min(1100px, 96vw);
  max-width: 1100px;
}

.preview-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 72vh;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #2f3543;
}

.preview-body {
  padding: 10px;
  min-height: 60vh;
}

.preview-frame {
  width: 100%;
  min-height: 58vh;
  border: 1px solid #2f3543;
  border-radius: 10px;
  background: #101318;
}

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

.analytics-card {
  border: 1px solid #44526b;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #182234 0%, #151e2d 100%);
}

.analytics-card .label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.analytics-card .value {
  margin-top: 6px;
  font-size: 1.25rem;
  font-weight: 700;
}

.financial-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #2a3040;
  border: 1px solid #3b455e;
  font-weight: 700;
  white-space: nowrap;
  color: #ecf2ff;
}

.model-grid label {
  min-width: 0;
}

.settings-number-input {
  min-height: 36px;
  padding: 7px 10px;
}

.compact-rate-input {
  min-height: 34px;
  padding: 6px 9px;
}

.settings-financial-card {
  display: grid;
  gap: 12px;
}

.analytics-filter-panel {
  padding-bottom: 12px;
}

.analytics-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.analytics-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 1fr) minmax(170px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.settings-main-grid {
  align-items: end;
}

.rappel-editor {
  border: 1px solid #4c5f82;
  border-radius: 10px;
  background: linear-gradient(180deg, #152335 0%, #121f2f 100%);
  padding: 10px;
}

.rappel-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rappel-tier-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.rappel-tier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid #526487;
  border-radius: 10px;
  padding: 8px;
  background: linear-gradient(180deg, #17263a 0%, #142132 100%);
}

.rappel-tier-row label {
  color: #c5d2eb;
}

.rappel-remove-btn {
  height: 36px;
  white-space: nowrap;
}

.settings-advanced {
  border: 1px solid #313f58;
  border-radius: 10px;
  background: #121a29;
  padding: 8px 10px 10px;
}

.settings-advanced > summary {
  cursor: pointer;
  color: #bac7e0;
  font-size: 0.88rem;
}

.settings-advanced-grid {
  margin-top: 10px;
}

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

.funnel-item {
  border: 1px solid #313748;
  border-radius: 10px;
  padding: 10px;
  background: #181c24;
}

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

.inbox-item {
  border: 1px solid #313748;
  border-radius: 10px;
  padding: 10px;
  background: #181c24;
  display: grid;
  gap: 6px;
}

.inbox-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
}

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

.kanban-column {
  border: 1px solid #313748;
  border-radius: 12px;
  background: #181c24;
  min-height: 220px;
}

.kanban-header {
  padding: 10px;
  border-bottom: 1px solid #2d3341;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-list {
  padding: 8px;
  display: grid;
  gap: 8px;
}

.kanban-card {
  border: 1px solid #313748;
  border-radius: 10px;
  background: #161a22;
  padding: 10px;
  display: grid;
  gap: 6px;
}

a {
  color: #a7bbff;
}

a:hover {
  color: #ccd8ff;
}

::placeholder {
  color: #7f879a;
}

.kanban-title {
  font-weight: 700;
}

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

.financial-catalog-grid > div {
  min-height: 84px;
}

.financial-checklist-editor .card {
  padding: 10px;
}

.financial-checklist-editor .catalog-tier {
  min-height: 148px;
}

.compact-model-grid label {
  min-width: 0;
}

.client-kpis .analytics-card .value {
  font-size: 1.15rem;
}

.clients-pagination {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2b3242;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.clients-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.client-profile-dialog {
  width: min(1200px, 96vw);
  max-width: 1200px;
}

.client-profile-dialog .preview-body {
  max-height: 76vh;
  overflow: auto;
}

.process-detail-dialog {
  width: min(1360px, 97vw);
  max-width: 1360px;
}

.process-detail-dialog .preview-body {
  max-height: 82vh;
  overflow: auto;
}

.processes-pagination {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #2b3242;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.processes-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.financial-picker {
  display: grid;
  gap: 10px;
}

.financial-tag-input {
  border: 1px solid #39445a;
  border-radius: 10px;
  background: #121824;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 20px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #445a8d;
  border-radius: 999px;
  background: #213457;
  color: #dce8ff;
  padding: 4px 9px;
  font-size: 0.83rem;
}

.tag-chip-remove {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 999px;
  border: 1px solid #5d74a8;
  background: #2b3f66;
  color: #dce8ff;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.financial-options {
  border: 1px solid #313d54;
  border-radius: 10px;
  background: #131a26;
  padding: 8px;
  display: grid;
  gap: 6px;
  max-height: 170px;
  overflow: auto;
}

.financial-option {
  text-align: left;
  border: 1px solid #33445f;
  background: #182132;
  color: #d4def3;
  border-radius: 8px;
  padding: 8px 10px;
}

.financial-option.selected,
.financial-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.score-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.score-help-trigger {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #46506b;
  color: #cfdbf8;
  background: #1a1f2a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
}

.score-help-trigger:focus-visible {
  outline: 2px solid rgba(123, 155, 220, 0.65);
  outline-offset: 1px;
}

.score-help-text {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 320px;
  white-space: normal;
  background: #0f1420;
  border: 1px solid #36415d;
  border-radius: 8px;
  padding: 8px 10px;
  color: #e5ecff;
  font-size: 0.76rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.score-help:hover .score-help-text,
.score-help:focus-within .score-help-text {
  opacity: 1;
  transform: translateY(0);
}

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

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

@media (max-width: 1320px) {
  #processos-page .filters {
    grid-template-columns: minmax(210px, 1.4fr) minmax(170px, 1fr) auto minmax(170px, 1fr) max-content 40px;
  }
}

@media (max-width: 1200px) {
  #processos-page .filters {
    grid-template-columns: minmax(210px, 1.4fr) minmax(170px, 1fr) auto minmax(170px, 1fr);
  }

  #processos-page .filters #apply-bulk-process-status,
  #processos-page .filters #reload-processes {
    justify-self: end;
  }
}

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

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

  .home-cards,
  .home-status-grid,
  .analytics-grid,
  .funnel-grid,
  .simulator-grid,
  .comm-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-filters {
    grid-template-columns: 1fr 1fr auto;
  }

  .financial-checklist-editor {
    grid-template-columns: 1fr;
  }

  .analytics-filter-row {
    grid-template-columns: 1fr 1fr 1fr auto auto;
  }

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

  .rappel-tier-row .rappel-remove-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .processes-pagination {
    align-items: flex-start;
  }

  .processes-pagination-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px;
    gap: 10px;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    height: auto;
    min-height: auto;
    grid-template-rows: auto;
    overflow: visible;
  }

  .side-nav {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-section {
    min-width: 220px;
  }

  .sidebar-footer {
    display: none;
  }

  .content {
    height: auto;
    overflow: visible;
  }

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

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

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

  .filters {
    flex-wrap: wrap;
  }

  #processos-page .filters {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    grid-template-columns: 1fr;
  }

  .home-cards,
  .home-status-grid,
  .analytics-grid,
  .funnel-grid,
  .simulator-grid,
  .comm-form-row {
    grid-template-columns: 1fr;
  }

  .clients-filters {
    grid-template-columns: 1fr;
  }

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

  .clients-pagination {
    align-items: flex-start;
  }

  .clients-pagination-controls {
    width: 100%;
    justify-content: space-between;
  }

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

  .kanban-board {
    grid-template-columns: 1fr;
  }
}
