:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-muted: #eef3f4;
  --ink: #17211f;
  --muted: #66716e;
  --line: #d8dedb;
  --accent: #6d548d;
  --accent-2: #e87431;
  --paid: #226b4a;
  --open: #9a4b0f;
}

* {
  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;
}

.shell {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

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

.brand {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 74px;
  object-fit: contain;
  padding: 6px;
  width: 74px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.title-with-environment {
  align-items: center;
  display: flex;
  gap: 12px;
}

.environment-badge {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 6px 8px;
}

.environment-badge.development {
  background: #eef3f4;
  color: #405b62;
}

.environment-badge.production {
  background: #fff0df;
  border-color: #e87431;
  color: #9a4b0f;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.toolbar,
.nav {
  align-items: center;
  display: flex;
  gap: 8px;
}

.nav a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  min-height: 42px;
  padding: 11px 14px;
  text-decoration: none;
}

.icon-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.auth-controls {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: 4px;
}

.auth-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 42px;
  padding: 8px 12px;
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  max-width: 420px;
  padding: 32px;
  width: 100%;
}

.login-panel > img {
  height: 78px;
  margin-bottom: 20px;
  object-fit: contain;
  width: 78px;
}

.login-panel h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.login-copy,
.login-domain {
  color: var(--muted);
}

.login-copy {
  margin-bottom: 24px;
}

.login-domain {
  border-top: 1px solid var(--line);
  font-size: 12px;
  margin-top: 24px;
  padding-top: 16px;
}

.login-error {
  background: #fff0ed;
  border: 1px solid #efb4aa;
  border-radius: 6px;
  color: #a52a1f;
  font-size: 13px;
  margin-bottom: 18px;
  padding: 10px 12px;
}

.contract-band,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  overflow: hidden;
}

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

.home-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 12px;
  min-height: 184px;
  padding: 22px;
  text-decoration: none;
}

.home-tile.primary {
  border-top: 4px solid var(--accent);
}

.home-tile:not(.primary) {
  border-top: 4px solid var(--accent-2);
}

.home-tile span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.home-tile strong {
  font-size: 24px;
  line-height: 1.1;
}

.home-tile p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.parameter-tile ul {
  color: var(--ink);
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.parameter-tile li {
  border-top: 1px solid var(--line);
  font-size: 14px;
  padding-top: 8px;
}

.contract-band {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  padding: 22px;
}

.contract-title {
  display: grid;
  gap: 10px;
}

.contract-title strong {
  font-size: 24px;
  line-height: 1.15;
}

.contract-title span,
.field span,
.section-head p {
  color: var(--muted);
  font-size: 14px;
}

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

.field {
  border-left: 3px solid var(--line);
  display: grid;
  gap: 4px;
  padding-left: 10px;
}

.field strong {
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 94px;
  padding: 16px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
}

.metric strong {
  font-size: 22px;
  line-height: 1.1;
}

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

.filter-form {
  align-items: end;
  display: flex;
  gap: 10px;
}

.contract-list-actions {
  align-items: end;
  display: flex;
  gap: 12px;
}

.import-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.import-file-field {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  max-width: 620px;
  text-transform: uppercase;
}

.import-file-field input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 10px;
}

.import-actions,
.import-confirm-row,
.import-preview-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.import-validation {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.import-validation.valid { border-left: 4px solid var(--paid); }
.import-validation.invalid { border-left: 4px solid #b42318; }
.import-validation h3 { margin: 0; }

.import-preview-head > div {
  display: grid;
  gap: 4px;
}

.import-preview-head > div span,
.import-confirm-row > span {
  color: var(--muted);
  font-size: 13px;
}

.import-preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.import-preview-grid div {
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.import-preview-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.import-preview-grid dd {
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.import-contracts-table {
  margin-top: 18px;
  max-height: 360px;
  border: 1px solid var(--line);
}

.import-contracts-table table {
  min-width: 840px;
}

.import-contracts-table th,
.import-contracts-table td {
  padding: 10px 12px;
}

.import-messages {
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  padding: 12px 12px 12px 32px;
}

.import-messages.warnings { background: #fff0df; color: var(--open); }
.import-messages.errors { background: rgba(179, 58, 47, 0.12); color: #b42318; }

.import-confirm-row {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.parameter-edit-link {
  justify-self: start;
  margin-top: 14px;
}

.parameter-tile li small {
  color: var(--muted);
  margin-left: auto;
}

.enterprise-parameters-panel .section-head {
  align-items: center;
}

.enterprise-parameters-table {
  min-width: 640px;
}

.enterprise-parameters-table th,
.enterprise-parameters-table td {
  padding: 12px 16px;
}

.enterprise-parameters-table th:last-child,
.enterprise-parameters-table td:last-child {
  width: 320px;
}

.users-table {
  min-width: 920px;
}

.users-table th,
.users-table td {
  padding: 12px 16px;
}

.users-table th:last-child,
.users-table td:last-child {
  text-align: right;
  width: 110px;
}

.users-table tr.inactive-user td {
  color: var(--muted);
  background: #f7f8f6;
}

.profile-badge,
.user-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 8px;
}

.profile-admin {
  background: #eee8f5;
  color: var(--accent);
}

.profile-operador {
  background: #e7f1f5;
  color: #315f72;
}

.profile-consulta {
  background: var(--surface-muted);
  color: var(--muted);
}

.user-status.active {
  background: #e3f2eb;
  color: var(--paid);
}

.user-status.inactive {
  background: #ecefed;
  color: var(--muted);
}

.user-editor-dialog {
  max-width: 520px;
}

.user-editor-fields {
  display: grid;
  gap: 14px;
}

.user-editor-fields > label:not(.user-active-field) {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

.user-editor-fields input[type="text"],
.user-editor-fields input[type="email"],
.user-editor-fields select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  padding: 0 10px;
  width: 100%;
}

.user-active-field {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 14px;
  font-weight: 650;
  gap: 8px;
}

.user-active-field input {
  height: 18px;
  width: 18px;
}

.user-editor-error {
  color: #b42318;
  font-size: 13px;
  min-height: 18px;
}

.filter-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

.filter-form input,
.filter-form select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  min-height: 38px;
  min-width: 220px;
  padding: 0 10px;
}

#openInstallmentsFilters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#openInstallmentsFilters input,
#openInstallmentsFilters select {
  min-width: 170px;
}

#openInstallmentsFilters .filter-calendar-date-field {
  min-width: 170px;
}

#openInstallmentsFilters .filter-calendar-date-field input {
  min-width: 0;
}

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

.edit-section {
  overflow: visible;
}

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

.edit-grid label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  text-transform: uppercase;
}

.edit-grid input,
.edit-grid select,
.edit-installments-table input,
.edit-installments-table select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  min-height: 34px;
  padding: 0 8px;
  width: 100%;
}

.edit-installments-table {
  min-width: 2500px;
  table-layout: fixed;
}

.edit-installments-table th {
  white-space: normal;
}

.edit-installments-table .currency-input {
  text-align: right;
}

.save-button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
}

.save-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
}

.table-action-bar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  min-height: 58px;
  padding: 9px 14px;
}

.table-action-bar-between {
  justify-content: space-between;
}

.table-action-bar > span {
  color: var(--muted);
  font-size: 13px;
}

.table-action-context {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.table-action-context > span {
  color: var(--muted);
  font-size: 13px;
}

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

.compact-section-head {
  padding-bottom: 13px;
  padding-top: 13px;
}

.editable-operations-table .date-input,
.editable-operations-table .percent-input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  min-height: 30px;
  padding: 3px 4px;
  text-align: center;
  width: 100%;
}

.editable-operations-table .percent-input {
  min-width: 74px;
}

.editable-operations-table .edit-calendar-date-field {
  grid-template-columns: minmax(0, 1fr) 32px;
  width: 100%;
}

.editable-operations-table .edit-calendar-date-field .calendar-date-picker {
  min-height: 30px;
  padding: 4px;
  width: 32px;
}

.editable-operations-table .edit-calendar-date-field .calendar-date-picker::-webkit-calendar-picker-indicator {
  height: 16px;
  width: 16px;
}

.editable-operations-table .calculated-value {
  background: #f7f8f6;
  font-weight: 650;
}

.editable-operations-table tr.modified-row td,
.editable-operations-table tr.modified-row .calculated-value {
  background: #fff4dc;
}

.editable-operations-table tr.modified-row td:first-child {
  box-shadow: inset 4px 0 0 var(--accent-2);
}

.editable-operations-table td.modified-field,
.editable-operations-table td.modified-field input {
  color: #b42318;
  font-weight: 700;
}

.date-input.invalid-input {
  border-color: #b33a2f !important;
  box-shadow: 0 0 0 2px rgba(179, 58, 47, 0.12);
}

.system-dialog-overlay {
  align-items: center;
  background: rgba(23, 33, 31, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1000;
}

.system-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(23, 33, 31, 0.22);
  display: grid;
  gap: 14px;
  max-width: 460px;
  padding: 22px;
  width: 100%;
}

.system-dialog h2 {
  color: var(--ink);
  font-size: 20px;
}

.system-dialog p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
}

.calculation-description-dialog {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 40px);
  max-width: 640px;
}

.calculation-description-content {
  color: var(--muted);
  min-height: 0;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-gutter: stable;
}

.calculation-description-content .calculation-intro {
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 14px;
}

.calculation-definitions {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 12px 0;
}

.calculation-definitions div {
  display: grid;
  gap: 10px;
  grid-template-columns: 64px 1fr;
}

.calculation-definitions dt,
.calculation-steps strong {
  color: var(--ink);
  font-weight: 700;
}

.calculation-definitions dd {
  margin: 0;
}

.calculation-steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 24px;
}

.calculation-steps li {
  padding-left: 4px;
}

.calculation-steps li::marker {
  color: var(--accent);
  font-weight: 800;
}

.calculation-steps p {
  margin-top: 5px;
}

.calculation-formula {
  background: var(--surface-muted);
  border-left: 3px solid var(--accent-2);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
  padding: 9px 11px;
}

.calculation-example {
  background: var(--surface-muted);
  border-left: 3px solid var(--accent-2);
  margin-top: 20px;
  padding: 14px 16px;
}

.calculation-example > strong {
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.calculation-example p {
  margin: 6px 0;
}

.calculation-example small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 10px;
}

.index-with-memory {
  align-items: center;
  box-sizing: border-box;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  max-width: 100%;
  padding-inline: 27px;
  position: relative;
  width: 100%;
}

.index-with-memory input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.calculation-memory-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 22px;
  font-size: 15px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
}

.calculation-memory-button:hover,
.calculation-memory-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.calculation-memory-dialog {
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 40px);
  max-width: 980px;
}

.calculation-memory-heading {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.calculation-memory-heading p {
  margin-top: 4px;
}

.calculation-memory-content {
  min-height: 0;
  overflow: auto;
}

.calculation-memory-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 14px;
}

.calculation-memory-summary span {
  color: var(--muted);
  font-size: 13px;
}

.calculation-memory-table-wrap {
  border: 1px solid var(--line);
  overflow: auto;
}

.calculation-memory-table {
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

.calculation-memory-table th,
.calculation-memory-table td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
}

.calculation-memory-table th {
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.calculation-memory-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 680px) {
  .calculation-memory-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

.criteria-parameter-tile li {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.icon-text-button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  white-space: nowrap;
}

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

.system-dialog-field span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.system-dialog-field .date-input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

.correction-index-dialog input[type="month"],
.correction-index-dialog .percent-field input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

.percent-field {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.percent-field > span {
  color: var(--muted);
  font-weight: 700;
}

.index-table .actions-column {
  text-align: center;
  width: 84px;
}

.calendar-date-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  position: relative;
}

.calendar-date-field .date-input {
  border-bottom-right-radius: 0;
  border-right: 0;
  border-top-right-radius: 0;
}

.calendar-date-field .calendar-date-picker {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-right-radius: 6px;
  border-top-right-radius: 6px;
  color-scheme: light;
  cursor: pointer;
  font-size: 0;
  min-width: 0;
  padding: 8px;
  width: 44px;
}

.calendar-date-field .calendar-date-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  height: 20px;
  margin: 0;
  width: 20px;
}

.system-dialog .system-dialog-error {
  color: #b42318;
  min-height: 21px;
}

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

.filters {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  padding: 3px;
}

.filter {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  min-height: 34px;
  padding: 0 12px;
}

.filter.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 4px rgba(23, 33, 31, 0.08);
}

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

.table-wrap.narrow {
  max-width: 620px;
}

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

.index-table {
  min-width: 360px;
  width: 100%;
}

.operations-table {
  min-width: 1120px;
  table-layout: fixed;
}

.operations-table th,
.operations-table td {
  padding: 7px 5px;
}

.operations-table td {
  font-size: 10.5px;
}

.operations-table th,
.operations-table .sort-button {
  font-size: 9px;
}

.operations-table .sort-button {
  gap: 3px;
  padding-right: 4px;
}

.operations-table .sort-button span:first-child {
  line-height: 1.15;
}

.operations-table .sort-indicator {
  flex-basis: 14px;
  min-width: 14px;
  width: 14px;
}

.operations-table .center {
  text-align: center;
}

.operations-table .wrap-cell {
  hyphens: manual;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.operations-table td.wrap-cell {
  line-height: 1.15;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #fafbf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  position: relative;
  text-transform: uppercase;
}

.sort-button {
  align-items: flex-start;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0;
  padding: 0 12px 0 0;
  text-align: inherit;
  text-transform: uppercase;
  width: 100%;
}

.sort-button span:first-child {
  flex: 1;
  hyphens: manual;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.sort-indicator {
  align-items: center;
  display: inline-flex;
  flex: 0 0 18px;
  flex-direction: column;
  gap: 3px;
  height: 28px;
  justify-content: center;
  min-width: 18px;
  width: 18px;
}

.sort-indicator::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 8px solid var(--line);
  content: "";
  display: block;
  height: 0;
  width: 0;
}

.sort-indicator::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 8px solid var(--line);
  content: "";
  display: block;
  height: 0;
  width: 0;
}

.sort-indicator.active:not(.descending)::before {
  border-bottom-color: var(--accent);
}

.sort-indicator.active.descending::after {
  border-top-color: var(--accent);
}

.resize-handle {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: 0;
  top: 0;
  width: 8px;
}

.resize-handle::after {
  background: var(--line);
  bottom: 10px;
  content: "";
  position: absolute;
  right: 3px;
  top: 10px;
  width: 1px;
}

.select-column {
  text-align: center;
  width: 54px;
}

.select-column input {
  height: 16px;
  width: 16px;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.criteria {
  max-width: 240px;
}

.muted {
  color: var(--muted);
}

.row-action,
.backline a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.row-action {
  display: inline-flex;
  justify-content: center;
  min-width: 54px;
}

.backline {
  margin: 0 0 12px;
}

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

.button-link {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 9px;
}

.status.pago {
  background: #e3f2eb;
  color: var(--paid);
}

.status.aberto {
  background: #fff0df;
  color: var(--open);
}

.loading,
.empty {
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 24px, 1440px);
    padding-top: 18px;
  }

  .contract-band,
  .home-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

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

  .filter-form,
  .section-head,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .contract-list-actions,
  .import-confirm-row,
  .import-preview-head {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .import-preview-grid {
    grid-template-columns: 1fr;
  }

  .brand img {
    height: 60px;
    width: 60px;
  }

  .nav,
  .filter-form,
  .filter-form input,
  .filter-form select {
    width: 100%;
  }

  .nav a {
    flex: 1;
    text-align: center;
  }

  .auth-controls {
    justify-content: space-between;
    margin-left: 0;
    width: 100%;
  }

  .filters {
    width: 100%;
  }

  .filter {
    flex: 1;
  }
}
