.deal-profit-accounting {
  display: grid;
  gap: 12px;
}

.deal-profit-accounting-filters {
  display: grid;
  gap: 0;
}

.deal-profit-accounting-filter-grid {
  display: grid;
  gap: 10px;
  align-items: end;
}

.deal-profit-accounting-filter-grid.is-primary {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.deal-profit-accounting-filter-grid.is-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #d1fae5;
}

.deal-profit-accounting-filter-grid .modal-block,
.deal-profit-accounting-stage-filter {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.deal-profit-accounting-filter-grid .modal-label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-profit-accounting-filter-grid .auth-input,
.deal-profit-accounting-filter-grid .custom-select-button,
.deal-profit-accounting-stage-trigger,
.deal-profit-accounting-reset {
  min-width: 0;
  min-height: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.deal-profit-accounting-filter-grid .auth-input,
.deal-profit-accounting-filter-grid .custom-select,
.deal-profit-accounting-filter-grid .custom-select-button,
.deal-profit-accounting-stage-trigger {
  width: 100%;
}

.deal-profit-accounting-filter-grid .custom-select {
  min-width: 0;
}

.deal-profit-accounting-filter-grid input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.deal-profit-accounting-reset {
  width: auto;
  align-self: end;
  white-space: nowrap;
}

.deal-profit-accounting-stage-filter {
  position: relative;
}

.deal-profit-accounting-stage-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.deal-profit-accounting-stage-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-profit-accounting-stage-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 6px;
  width: max-content;
  min-width: 100%;
  max-width: min(320px, 80vw);
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.deal-profit-accounting-stage-menu .checkbox-option {
  width: 100%;
  box-sizing: border-box;
}

.deal-profit-accounting-sort-bar {
  margin: 0;
}

.deal-profit-accounting-collapse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid #dbe4ef;
}

.deal-profit-accounting-list-tools-card {
  gap: 0;
}

.deal-profit-accounting-list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}

.deal-profit-accounting-month {
  display: grid;
  gap: 0;
}

.deal-profit-accounting-month-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0 12px;
  border-bottom: 1px solid #e2e8f0;
}

.deal-profit-accounting-month-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 150px;
}

.deal-profit-accounting-month-head > .deal-profit-accounting-summary {
  align-self: start;
  padding: 0;
}

.deal-profit-accounting-month-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
}

.deal-profit-accounting-month-actions > .secondary-button {
  align-self: start;
  white-space: nowrap;
}

.deal-profit-accounting-month-collapse-toggle {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.deal-profit-accounting-month > .deal-profit-accounting-stats {
  padding: 10px 0 12px;
}

.deal-profit-accounting-month.is-collapsed > .deal-profit-accounting-stats {
  padding-bottom: 4px;
}

.deal-profit-accounting-month-details {
  min-width: 0;
}

.deal-profit-accounting-stats {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.deal-profit-accounting-stats-primary,
.deal-profit-accounting-stats-carryover {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.deal-profit-accounting-stats-carryover {
  padding: 0;
  border: 0;
  background: transparent;
}

.deal-profit-accounting-stats .deal-profit-accounting-stat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.deal-profit-accounting-stat-chip.is-info {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #075985;
}

.deal-profit-accounting-stat-chip.is-clear {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.deal-profit-accounting-stat-chip.is-problem {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.deal-profit-accounting-stat-chip.is-shifted {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.deal-profit-accounting-stat-chip.is-neutral {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #475569;
}

.deal-profit-accounting-table-wrap {
  margin: 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
}

.deal-profit-accounting-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.deal-profit-accounting-table th {
  font-size: 12px;
  text-align: left;
  line-height: 1.25;
  padding: 9px 8px;
}

.deal-profit-accounting-table th:nth-child(1),
.deal-profit-accounting-table td:nth-child(1) {
  width: auto;
  min-width: 0;
  padding-right: 6px;
}

.deal-profit-accounting-table td {
  min-width: 0;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.25;
  padding: 7px 6px;
}

.deal-profit-accounting-table .deal-profit-col-accounting {
  width: 18%;
}

.deal-profit-accounting-table .deal-profit-col-deal-client {
  width: 21%;
}

.deal-profit-accounting-table .deal-profit-col-responsible {
  width: 10%;
}

.deal-profit-accounting-table .deal-profit-col-status-stage {
  width: 15%;
}

.deal-profit-accounting-table .deal-profit-col-incoming {
  width: 16%;
}

.deal-profit-accounting-table .deal-profit-col-margin {
  width: 12%;
}

.deal-profit-accounting-table .deal-profit-col-contribution {
  width: 8%;
}

.deal-profit-accounting-table th:nth-child(6),
.deal-profit-accounting-table td:nth-child(6) {
  border-left: 2px solid #dbe4ef;
  padding-left: 8px;
}

.deal-profit-accounting-row {
  cursor: default;
}

.deal-profit-accounting-row:hover > td {
  background: #f8fafc;
}

.deal-profit-accounting-row.is-actual-counted > td {
  background: #effcf4;
}

.deal-profit-accounting-row.is-actual-counted:hover > td {
  background: #e5f8ed;
}

.deal-profit-accounting-row.is-adjustment > td {
  background: #f1f5f9;
}

.deal-profit-accounting-row.is-adjustment:hover > td {
  background: #e8eef5;
}

.deal-profit-accounting-adjustment-title td {
  padding: 8px 10px;
  border-top: 2px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.deal-profit-accounting-row .is-negative,
.deal-profit-accounting-mobile-card .is-negative,
.deal-profit-accounting-summary .is-negative {
  color: #b91c1c;
}

.deal-profit-accounting-row .is-positive {
  color: #047857;
}

.deal-profit-accounting .deal-status-badge.neutral {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.deal-profit-accounting-deal {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

a.deal-profit-accounting-deal:hover strong,
a.deal-profit-accounting-deal:focus-visible strong {
  color: #1d4ed8;
  text-decoration: underline;
}

.deal-profit-accounting-deal strong,
.deal-profit-accounting-deal small,
.deal-profit-accounting-client strong,
.deal-profit-accounting-client small,
.deal-profit-accounting-incoming strong {
  overflow-wrap: anywhere;
}

.deal-profit-accounting-deal-client,
.deal-profit-accounting-status-stage {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.deal-profit-accounting-problem-state {
  font-size: 11px;
  font-weight: 800;
}

.deal-profit-accounting-problem-state.is-error {
  color: #b91c1c;
}

.deal-profit-accounting-problem-state.is-success {
  color: #15803d;
}

.deal-profit-accounting-responsible {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.deal-profit-accounting-client {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.deal-profit-accounting-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.deal-profit-accounting-pills span {
  padding: 2px 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.deal-profit-accounting-incoming,
.deal-profit-accounting-statuses,
.deal-profit-accounting-actual-later {
  display: grid;
  gap: 4px;
  margin: 0;
}

.deal-profit-accounting-incoming > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  padding-bottom: 3px;
  border-bottom: 1px solid #e5edf6;
}

.deal-profit-accounting-incoming > span strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-profit-accounting-incoming > span small {
  flex: 0 0 auto;
  white-space: nowrap;
}

.deal-profit-accounting-incoming > span:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.deal-profit-accounting-incoming small.is-received {
  color: #047857;
}

.deal-profit-accounting-incoming small.is-waiting {
  color: #b45309;
}

.deal-profit-accounting-editor {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.deal-profit-accounting-editor > small,
.deal-profit-accounting-preview small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.deal-profit-accounting-editor .auth-input,
.deal-profit-accounting-editor .custom-select-button {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  height: 28px;
  box-sizing: border-box;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 11px;
}

.deal-profit-accounting-editor .custom-select {
  width: 100%;
  min-width: 0;
}

.deal-profit-accounting-editor-controls {
  display: grid;
  grid-template-columns: auto 70px 22px;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.deal-profit-accounting-editor-controls .custom-select {
  min-width: 0;
}

.deal-profit-accounting-month-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  width: 100%;
  height: 28px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
}

.deal-profit-accounting-month-control:focus-within,
.deal-profit-accounting-month-picker.open .deal-profit-accounting-month-control {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.deal-profit-accounting-month-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 3px 1px 3px 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  box-sizing: border-box;
  font: inherit;
  font-size: 11px;
}

.deal-profit-accounting-month-input.is-invalid {
  color: #b91c1c;
  background: #fef2f2;
}

.deal-profit-accounting-month-input:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.deal-profit-accounting-month-toggle {
  display: inline-flex;
  width: 18px;
  height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.deal-profit-accounting-month-toggle:disabled {
  cursor: not-allowed;
}

.deal-profit-accounting-month-toggle .custom-select-arrow {
  font-size: 12px;
}

.deal-profit-accounting-month-picker.open .custom-select-arrow {
  transform: rotate(180deg);
}

.deal-profit-accounting-month-picker .custom-select-menu {
  right: auto;
  width: max-content;
  min-width: 100%;
  max-width: min(150px, 70vw);
}

.deal-profit-accounting-month-picker .custom-select-option {
  padding: 6px 7px;
  font-size: 11px;
  white-space: nowrap;
}

.deal-profit-accounting-editor-controls .deal-status-badge,
.deal-profit-accounting-preview .deal-status-badge {
  min-width: 0;
  padding: 2px 4px;
  font-size: 9px;
  white-space: nowrap;
}

.deal-profit-accounting-counted-icon {
  display: flex;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  border-radius: 6px;
}

.deal-profit-accounting-counted-icon input[type="checkbox"] {
  margin: 0;
}

.deal-profit-accounting-preview {
  display: grid;
  grid-template-columns: 48px auto auto;
  align-items: center;
  justify-content: start;
  gap: 3px;
  min-width: 0;
}

.deal-profit-accounting-preview .deal-status-badge {
  width: fit-content;
}

.deal-profit-accounting-preview.is-compact {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.deal-profit-accounting-margin-values {
  display: grid;
  gap: 3px;
}

.deal-profit-accounting-margin-values > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.deal-profit-accounting-margin-values span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.deal-profit-accounting-margin-values strong {
  text-align: right;
  white-space: nowrap;
}

.deal-profit-accounting-contribution-cell {
  min-width: 0;
}

.deal-profit-accounting-contribution {
  font-size: 14px;
  white-space: nowrap;
}

.deal-profit-accounting-combined-accounting {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.deal-profit-accounting-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 11px 0 15px;
}

.deal-profit-accounting-summary > div {
  display: grid;
  gap: 4px;
  padding: 0 14px;
  border-left: 1px solid #dbe4ef;
}

.deal-profit-accounting-summary > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.deal-profit-accounting-summary span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.deal-profit-accounting-summary strong {
  font-size: 16px;
}

.deal-profit-accounting-summary .is-total {
  color: #075985;
}

.deal-profit-accounting-year-summary {
  display: grid;
  gap: 12px;
}

.deal-profit-accounting-year-summary .deal-profit-accounting-stats {
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.deal-profit-accounting-year-summary .deal-profit-accounting-summary {
  padding: 0;
}

.deal-profit-accounting-mobile-list {
  display: none;
}

.deal-profit-accounting-mobile-card {
  gap: 10px;
}

.deal-profit-accounting-mobile-card.is-actual-counted {
  border-color: #86efac;
  background: #effcf4;
}

.deal-profit-accounting-mobile-card.is-adjustment {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.deal-profit-accounting-mobile-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.deal-profit-accounting-mobile-head > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.deal-profit-accounting-mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deal-profit-accounting-mobile-grid > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px solid #e5edf6;
}

.deal-profit-accounting-mobile-finance {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid #dbe4ef;
  border-bottom: 1px solid #dbe4ef;
}

.deal-profit-accounting-mobile-finance > div {
  display: grid;
  gap: 3px;
}

.deal-profit-accounting-mobile-finance span,
.deal-profit-accounting-mobile-accounting > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.deal-profit-accounting-mobile-accounting {
  display: grid;
  gap: 6px;
}

.deal-profit-accounting-mobile-adjustment-title {
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.deal-profit-accounting-more {
  justify-self: center;
}

@media (max-width: 900px) {
  .deal-profit-accounting-list-tools {
    align-items: flex-start;
  }

  .deal-profit-accounting-month-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .deal-profit-accounting-month-identity {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .deal-profit-accounting-month-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .deal-profit-accounting-month-head > .deal-profit-accounting-summary {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .deal-profit-accounting-filter-grid.is-primary,
  .deal-profit-accounting-filter-grid.is-secondary {
    grid-template-columns: minmax(0, 1fr);
  }

  .deal-profit-accounting-reset {
    width: 100%;
  }

  .deal-profit-accounting-list-tools {
    display: grid;
  }

  .deal-profit-accounting-collapse-actions {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .deal-profit-accounting-list-tools .clients-list-summary {
    justify-self: start;
  }

  .deal-profit-accounting-table-wrap {
    display: none;
  }

  .deal-profit-accounting-mobile-list {
    display: grid;
    gap: 10px;
    padding: 12px 0 0;
  }

  .deal-profit-accounting-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px 0 15px;
  }

  .deal-profit-accounting-summary > div,
  .deal-profit-accounting-summary > div:first-child {
    padding: 0;
    border-left: 0;
  }

  .deal-profit-accounting-year-summary .deal-profit-accounting-summary {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .deal-profit-accounting-mobile-head,
  .deal-profit-accounting-mobile-grid,
  .deal-profit-accounting-mobile-finance {
    grid-template-columns: minmax(0, 1fr);
  }

  .deal-profit-accounting-mobile-head {
    display: grid;
  }

  .deal-profit-accounting-inline {
    grid-template-columns: minmax(0, 1fr);
  }

  .deal-profit-accounting-inline > * {
    grid-column: 1;
  }
}
