:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background: #f9fafb;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body.trf2-body {
  margin: 0;
  background: #f9fafb;
  color: #111827;
}

body.trf2-login-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(16, 185, 129, 0.09), transparent 26%),
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: #111827;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.trf2-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr);
}

.trf2-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

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

.trf2-brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.15;
}

.trf2-brand p {
  margin: 10px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #f2fff8 0%, #effef5 100%);
  border-radius: 999px;
  padding: 8px 12px;
}

.trf2-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(180deg, #6a5cff 0%, #4f46e5 100%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 8px;
  box-shadow: 0 14px 24px rgba(79, 70, 229, 0.24);
}

.trf2-brand__mark span {
  border: 1.75px solid rgba(255, 255, 255, 0.95);
  border-radius: 4px;
}

.trf2-nav {
  display: grid;
  gap: 6px;
  align-content: start;
  padding-bottom: 168px;
}

.trf2-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #4b5563;
  font-weight: 500;
}

.trf2-nav a.is-active {
  background: linear-gradient(180deg, #eff2ff 0%, #edf0ff 100%);
  color: #4f46e5;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.trf2-nav__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.trf2-nav__icon svg,
.trf2-card__icon svg,
.trf2-primary-button__icon svg,
.trf2-modal__close svg,
.trf2-row-actions a svg,
.trf2-row-actions button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trf2-sidebar__footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
}

.trf2-sidebar__account {
  padding: 18px 14px 16px;
  border: 1px solid #eceef6;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.08);
}

.trf2-user {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0;
  border-top: 0;
}

.trf2-user__avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f3f4ff;
  color: #4338ca;
  font-size: 0.82rem;
  font-weight: 700;
}

.trf2-user__meta {
  display: grid;
  gap: 2px;
}

.trf2-user__meta span {
  color: #6b7280;
  font-size: 0.72rem;
  max-width: 164px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trf2-logout button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 12px;
  padding: 0;
  color: #ef4444;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

.trf2-main {
  padding: 32px 32px 40px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.trf2-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.trf2-login-card {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(232, 234, 238, 0.95);
  border-radius: 28px;
  box-shadow: 0 24px 54px rgba(79, 70, 229, 0.12), 0 10px 24px rgba(15, 23, 42, 0.08);
  padding: 30px 30px 28px;
  backdrop-filter: blur(12px);
}

.trf2-login-card__brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.trf2-login-card__brand strong {
  display: block;
  font-size: 1rem;
}

.trf2-login-card__brand p {
  margin: 10px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #10b981;
  background: linear-gradient(180deg, #f2fff8 0%, #effef5 100%);
  border-radius: 999px;
  padding: 8px 12px;
}

.trf2-login-copy h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.trf2-login-copy p {
  margin: 10px 0 0;
  color: #6b7280;
  line-height: 1.6;
}

.trf2-login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.trf2-login-error {
  margin: 0;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.trf2-page-header,
.trf2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.trf2-page-header h1,
.trf2-panel h2 {
  margin: 0;
}

.trf2-page-header h1 {
  font-size: 2rem;
  letter-spacing: -0.035em;
}

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

.trf2-card-grid--dashboard {
  gap: 20px;
}

.trf2-card,
.trf2-panel {
  background: #ffffff;
  border: 1px solid #e8eaee;
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 24px rgba(16, 24, 40, 0.04);
}

.trf2-card {
  padding: 24px 26px;
  display: flex;
  gap: 18px;
  align-items: center;
}

.trf2-card--dashboard {
  min-height: 116px;
  padding: 24px 24px 24px 22px;
  border-radius: 20px;
}

.trf2-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.trf2-card__icon--indigo {
  background: #eef2ff;
  color: #4f46e5;
}

.trf2-card__icon--mint {
  background: #ecfdf5;
  color: #10b981;
}

.trf2-card__icon--amber {
  background: #fff7e6;
  color: #d97706;
}

.trf2-card__copy p {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 1rem;
}

.trf2-card__copy strong {
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.trf2-card--dashboard .trf2-card__copy p {
  margin-bottom: 8px;
  font-size: 0.98rem;
}

.trf2-card--dashboard .trf2-card__copy strong {
  font-size: 1.3rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.trf2-panel {
  padding: 28px 26px;
}

.trf2-panel--chart {
  padding-bottom: 20px;
}

.trf2-panel--dashboard-chart {
  padding: 24px 24px 20px;
  border-radius: 24px;
}

.trf2-panel--dashboard-chart h2 {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.trf2-panel__copy {
  margin: 10px 0 0;
  max-width: 60ch;
  color: #4b5563;
  line-height: 1.6;
}

.trf2-panel--error {
  border-color: #fecaca;
  background: #fff7f7;
}

.trf2-panel--notice {
  border-color: #d1d5db;
  background: #ffffff;
}

.trf2-panel__actions {
  display: flex;
  margin-top: 20px;
}

.trf2-chart {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.trf2-chart--dashboard {
  margin-top: 18px;
}

.trf2-chart__y {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  align-items: end;
  color: #9ca3af;
  font-size: 0.92rem;
  padding-bottom: 36px;
}

.trf2-chart__plot {
  position: relative;
  min-height: 300px;
  display: grid;
}

.trf2-chart--dashboard .trf2-chart__plot {
  min-height: 286px;
}

.trf2-chart__plot > i {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed #edf0f4;
}

.trf2-chart__plot > i:nth-of-type(1) { top: 12%; }
.trf2-chart__plot > i:nth-of-type(2) { top: 31%; }
.trf2-chart__plot > i:nth-of-type(3) { top: 50%; }
.trf2-chart__plot > i:nth-of-type(4) { top: 69%; }
.trf2-chart__plot > i:nth-of-type(5) { top: 88%; }

.trf2-chart__bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  height: 100%;
  padding: 0 6px 0 0;
}

.trf2-chart__bar-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  justify-items: center;
  gap: 12px;
  height: 100%;
}

.trf2-chart__bar-shell {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 214px;
  flex: 0 0 214px;
}

.trf2-chart__bar {
  width: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7c6bff 0%, #4f46e5 100%);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

.trf2-chart__bar-group small {
  color: #9ca3af;
  font-size: 0.92rem;
  line-height: 1;
  width: 100%;
  text-align: center;
}

.trf2-primary-button,
.trf2-secondary-button {
  border-radius: 14px;
  padding: 11px 18px;
  border: 1px solid #dfe3ea;
  background: #fff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  cursor: pointer;
}

.trf2-primary-button {
  background: linear-gradient(180deg, #6557ff 0%, #4f46e5 100%);
  color: #fff;
  border-color: transparent;
}

.trf2-primary-button--wide {
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
}

.trf2-primary-button:disabled,
.trf2-secondary-button:disabled {
  opacity: 1;
}

.trf2-filter select {
  min-width: 256px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #d8dee8;
  background: #fff;
  padding: 0 16px;
  color: #374151;
}

.trf2-toolbar__actions {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.trf2-toolbar--sales {
  align-items: flex-end;
}

.trf2-toolbar--invoice {
  gap: 14px;
}

.trf2-filter-field {
  display: grid;
  gap: 8px;
}

.trf2-filter-field span {
  color: #6b7280;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.trf2-filter-field--compact {
  gap: 0;
}

.trf2-filter-field--compact span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trf2-filter-field input,
.trf2-filter-field select {
  height: 42px;
  min-width: 210px;
  border-radius: 12px;
  border: 1px solid #d8dee8;
  background: #fff;
  padding: 0 14px;
  color: #111827;
}

.trf2-filter-separator {
  align-self: flex-end;
  margin-bottom: 12px;
  color: #6b7280;
  font-size: 1rem;
}

.trf2-panel--table {
  padding: 0;
  overflow: hidden;
}

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

.trf2-table--invoice {
  table-layout: fixed;
}

.trf2-table--sales,
.trf2-table--cobranza,
.trf2-table--inventory,
.trf2-table--clients {
  table-layout: fixed;
}

.trf2-table th,
.trf2-table td {
  padding: 18px 26px;
  border-bottom: 1px solid #eef1f4;
  text-align: left;
  vertical-align: top;
}

.trf2-table__row--attention td {
  background: #fff8f8;
}

.trf2-table th {
  color: #6b7280;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
}

.trf2-table--invoice th,
.trf2-table--invoice td {
  padding: 16px 18px;
}

.trf2-table--sales th,
.trf2-table--sales td,
.trf2-table--cobranza th,
.trf2-table--cobranza td,
.trf2-table--inventory th,
.trf2-table--inventory td,
.trf2-table--clients th,
.trf2-table--clients td {
  padding: 18px 22px;
}

.trf2-table--sales th,
.trf2-table--sales td {
  padding: 14px 18px;
}

.trf2-table--sales th {
  font-size: 0.77rem;
  letter-spacing: 0.07em;
}

.trf2-table--sales td {
  font-size: 0.84rem;
  line-height: 1.24;
}

.trf2-table--clients th:nth-child(1),
.trf2-table--clients td:nth-child(1) {
  width: 39%;
}

.trf2-table--clients th:nth-child(2),
.trf2-table--clients td:nth-child(2) {
  width: 23%;
}

.trf2-table--clients th:nth-child(3),
.trf2-table--clients td:nth-child(3) {
  width: 16%;
}

.trf2-table--clients th:nth-child(4),
.trf2-table--clients td:nth-child(4) {
  width: 22%;
}

.trf2-table--clients td:nth-child(1) .trf2-cell-primary {
  max-width: 320px;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.trf2-table--clients td:nth-child(3),
.trf2-table--clients td:nth-child(4) {
  white-space: nowrap;
}

.trf2-table--clients .trf2-balance-chip {
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fafafa;
}

.trf2-table--clients .trf2-row-actions {
  justify-content: flex-start;
}

.trf2-table--inventory th:nth-child(1),
.trf2-table--inventory td:nth-child(1) {
  width: 37%;
}

.trf2-table--inventory th:nth-child(2),
.trf2-table--inventory td:nth-child(2) {
  width: 15%;
}

.trf2-table--inventory th:nth-child(3),
.trf2-table--inventory td:nth-child(3) {
  width: 13%;
}

.trf2-table--inventory th:nth-child(4),
.trf2-table--inventory td:nth-child(4) {
  width: 19%;
}

.trf2-table--inventory th:nth-child(5),
.trf2-table--inventory td:nth-child(5) {
  width: 16%;
}

.trf2-table--inventory td:nth-child(1) .trf2-cell-primary {
  max-width: 280px;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.trf2-table--inventory td:nth-child(4),
.trf2-table--inventory td:nth-child(5) {
  white-space: nowrap;
}

.trf2-table--sales th:nth-child(1),
.trf2-table--sales td:nth-child(1) {
  width: 11%;
}

.trf2-table--sales th:nth-child(2),
.trf2-table--sales td:nth-child(2) {
  width: 20%;
}

.trf2-table--sales th:nth-child(3),
.trf2-table--sales td:nth-child(3) {
  width: 10%;
}

.trf2-table--sales th:nth-child(4),
.trf2-table--sales td:nth-child(4) {
  width: 22%;
}

.trf2-table--sales th:nth-child(5),
.trf2-table--sales td:nth-child(5) {
  width: 8%;
}

.trf2-table--sales th:nth-child(6),
.trf2-table--sales td:nth-child(6) {
  width: 11%;
}

.trf2-table--sales th:nth-child(7),
.trf2-table--sales td:nth-child(7) {
  width: 10%;
}

.trf2-table--sales th:nth-child(8),
.trf2-table--sales td:nth-child(8) {
  width: 8%;
}

.trf2-table--sales td:nth-child(2) .trf2-cell-primary,
.trf2-table--sales td:nth-child(4) .trf2-cell-primary {
  max-width: 180px;
  overflow-wrap: anywhere;
  line-height: 1.24;
  font-size: 0.8rem;
}

.trf2-table--sales td:nth-child(7) .trf2-link-chip {
  display: inline-flex;
  max-width: 54px;
  overflow-wrap: anywhere;
  justify-content: center;
  line-height: 1.08;
  padding: 4px 8px;
  font-size: 0.74rem;
}

.trf2-table--sales td:nth-child(8) {
  text-align: right;
}

.trf2-table--sales td:nth-child(1),
.trf2-table--sales td:nth-child(3),
.trf2-table--sales td:nth-child(5),
.trf2-table--sales td:nth-child(6) {
  white-space: nowrap;
}

.trf2-table--sales td:nth-child(6) .trf2-money {
  font-size: 0.84rem;
}

.trf2-table--cobranza th:nth-child(1),
.trf2-table--cobranza td:nth-child(1) {
  width: 10%;
}

.trf2-table--cobranza th,
.trf2-table--cobranza td {
  padding: 13px 14px;
}

.trf2-table--cobranza th {
  font-size: 0.75rem;
  letter-spacing: 0.07em;
}

.trf2-table--cobranza td {
  font-size: 0.8rem;
  line-height: 1.2;
}

.trf2-table--cobranza th:nth-child(2),
.trf2-table--cobranza td:nth-child(2) {
  width: 14%;
}

.trf2-table--cobranza th:nth-child(3),
.trf2-table--cobranza td:nth-child(3) {
  width: 12.5%;
}

.trf2-table--cobranza th:nth-child(4),
.trf2-table--cobranza td:nth-child(4) {
  width: 11.5%;
}

.trf2-table--cobranza th:nth-child(5),
.trf2-table--cobranza td:nth-child(5) {
  width: 30.5%;
}

.trf2-table--cobranza th:nth-child(6),
.trf2-table--cobranza td:nth-child(6) {
  width: 10%;
}

.trf2-table--cobranza th:nth-child(7),
.trf2-table--cobranza td:nth-child(7) {
  width: 11.5%;
}

.trf2-table--cobranza td:nth-child(2) .trf2-cell-primary,
.trf2-table--cobranza td:nth-child(5) .trf2-cell-primary {
  max-width: 184px;
  overflow-wrap: anywhere;
  line-height: 1.18;
  font-size: 0.77rem;
}

.trf2-table--cobranza .trf2-reference-stack {
  align-items: flex-start;
  gap: 4px;
}

.trf2-table--cobranza td:nth-child(6),
.trf2-table--cobranza td:nth-child(7) {
  white-space: nowrap;
}

.trf2-table--cobranza th:nth-child(6),
.trf2-table--cobranza td:nth-child(6),
.trf2-table--cobranza th:nth-child(7),
.trf2-table--cobranza td:nth-child(7) {
  text-align: right;
}

.trf2-table--cobranza td:nth-child(6) .trf2-money {
  font-size: 0.81rem;
}

.trf2-table--cobranza .trf2-link-chip {
  padding: 4px 7px;
  font-size: 0.71rem;
  line-height: 1.08;
}

.trf2-table--cobranza .trf2-method-chip {
  padding: 4px 7px;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.trf2-table--invoice th:nth-child(1),
.trf2-table--invoice td:nth-child(1) {
  width: 8%;
}

.trf2-table--invoice th,
.trf2-table--invoice td {
  padding: 13px 15px;
}

.trf2-table--invoice th {
  font-size: 0.76rem;
  letter-spacing: 0.07em;
}

.trf2-table--invoice td {
  font-size: 0.81rem;
  line-height: 1.2;
}

.trf2-table--invoice th:nth-child(2),
.trf2-table--invoice td:nth-child(2) {
  width: 9%;
}

.trf2-table--invoice th:nth-child(3),
.trf2-table--invoice td:nth-child(3) {
  width: 20%;
}

.trf2-table--invoice th:nth-child(4),
.trf2-table--invoice td:nth-child(4) {
  width: 10%;
}

.trf2-table--invoice th:nth-child(5),
.trf2-table--invoice td:nth-child(5) {
  width: 11%;
}

.trf2-table--invoice th:nth-child(6),
.trf2-table--invoice td:nth-child(6) {
  width: 9%;
}

.trf2-table--invoice th:nth-child(7),
.trf2-table--invoice td:nth-child(7) {
  width: 9%;
}

.trf2-table--invoice th:nth-child(8),
.trf2-table--invoice td:nth-child(8) {
  width: 9%;
}

.trf2-table--invoice th:nth-child(9),
.trf2-table--invoice td:nth-child(9) {
  width: 13%;
}

.trf2-table--invoice td:nth-child(1) .trf2-invoice-link {
  display: inline-block;
  max-width: 48px;
  overflow-wrap: anywhere;
  line-height: 1.04;
  font-size: 0.77rem;
}

.trf2-table--invoice td:nth-child(3) .trf2-cell-primary {
  max-width: 160px;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-size: 0.78rem;
}

.trf2-table--invoice td:nth-child(5) .trf2-days-chip {
  justify-content: center;
  text-align: center;
  line-height: 1.12;
}

.trf2-table--invoice .trf2-row-actions {
  gap: 7px;
  justify-content: flex-end;
}

.trf2-table--invoice .trf2-row-actions a,
.trf2-table--invoice .trf2-row-actions button {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border-color: #e8edf4;
  box-shadow: none;
}

.trf2-table--invoice .trf2-action-button.is-payment {
  color: #11a47f;
  border-color: #d8f8ee;
  background: #f4fffb;
}

.trf2-table--invoice .trf2-action-button.is-credit {
  color: #d9871f;
  border-color: #fbe6c8;
  background: #fffaf1;
}

.trf2-table--invoice .trf2-action-button.is-download {
  color: #6b7280;
  border-color: #e8edf4;
  background: #ffffff;
}

.trf2-table--invoice .trf2-action-button.is-edit {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7568f8;
  padding: 0;
}

.trf2-table--invoice .trf2-action-button.is-edit svg {
  width: 15px;
  height: 15px;
}

.trf2-empty-state {
  color: #6b7280;
  line-height: 1.6;
  padding: 12px 0;
}

.trf2-audit-details {
  min-width: 260px;
}

.trf2-audit-details pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.trf2-flash {
  padding: 14px 18px;
  border-radius: 16px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.trf2-flash--error {
  background: #fff7f7;
  color: #b91c1c;
  border-color: #fecaca;
}

.trf2-cell-primary {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.trf2-cell-primary--medium {
  font-weight: 600;
}

.trf2-cell-secondary {
  margin-top: 4px;
  color: #6b7280;
}

.trf2-code {
  letter-spacing: 0.02em;
}

.trf2-money {
  font-size: 0.96rem;
}

.trf2-money--positive {
  color: #059669;
}

.trf2-money--danger {
  color: #dc2626;
}

.trf2-cell-stack {
  display: grid;
  gap: 6px;
}

.trf2-cell-stack span:last-child,
.trf2-cell-stack span:only-child {
  color: #6b7280;
}

.trf2-balance-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  background: #f9fafb;
}

.trf2-balance-chip.is-positive {
  color: #10b981;
}

.trf2-balance-chip.is-negative {
  color: #ef4444;
}

.trf2-stock-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 500;
  color: #4f46e5;
  background: #f1f3ff;
}

.trf2-stock-chip.is-muted {
  color: #6b7280;
  background: #f3f4f6;
}

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

.trf2-row-actions__empty {
  width: 30px;
  height: 30px;
  display: inline-block;
}

.trf2-row-actions a,
.trf2-row-actions button {
  width: 36px;
  height: 36px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.trf2-row-actions form {
  margin: 0;
}

.trf2-action-button.is-payment {
  color: #0f766e;
  border-color: #c7f0ea;
  background: #f0fdfa;
}

.trf2-action-button.is-credit {
  color: #ea580c;
  border-color: #fed7aa;
  background: #fff7ed;
}

.trf2-action-button.is-download {
  color: #6b7280;
}

.trf2-row-actions--payment .trf2-action-button.is-download {
  color: #0f9f8c;
  border-color: transparent;
  background: transparent;
}

.trf2-action-button.is-edit {
  color: #5b4df8;
}

.trf2-action-button.is-delete {
  color: #e11d48;
}

.trf2-row-actions--payment {
  gap: 8px;
  justify-content: flex-end;
}

.trf2-row-actions--payment a,
.trf2-row-actions--payment button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.trf2-row-actions--payment svg {
  width: 15px;
  height: 15px;
}

.trf2-row-actions--payment .trf2-action-button.is-edit {
  color: #5b4df8;
}

.trf2-row-actions--payment .trf2-action-button.is-delete {
  color: #e11d48;
}

.trf2-row-actions--clients {
  gap: 18px;
}

.trf2-row-actions--clients .trf2-client-action {
  width: 22px;
  height: 22px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #9aa4b2 !important;
  appearance: none;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.trf2-row-actions--clients .trf2-client-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.trf2-row-actions--inventory {
  gap: 18px;
}

.trf2-row-actions--inventory .trf2-inventory-action {
  width: 22px;
  height: 22px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #9aa4b2 !important;
  appearance: none;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.trf2-row-actions--inventory .trf2-inventory-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.trf2-link-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  color: #5b4df8;
  background: #eef2ff;
}

.trf2-invoice-link {
  color: #5b4df8;
  font-weight: 700;
}

.trf2-days-chip,
.trf2-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.trf2-days-chip {
  color: #4b5563;
  background: #f3f4f6;
  text-transform: none;
  line-height: 1.35;
}

.trf2-days-chip.is-warning {
  color: #b45309;
  background: #fff7ed;
}

.trf2-days-chip.is-overdue {
  color: #dc2626;
  background: #fef2f2;
}

.trf2-status-chip--sent {
  color: #4338ca;
  background: #eef2ff;
}

.trf2-status-chip--paid {
  color: #047857;
  background: #ecfdf5;
}

.trf2-status-chip--partial {
  color: #2563eb;
  background: #dbeafe;
}

.trf2-status-chip--credit {
  color: #b91c1c;
  background: #fef2f2;
}

.trf2-reference-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trf2-method-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4b5563;
  background: #f3f4f6;
}

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

.trf2-pagination__pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trf2-page-link {
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #dfe3ea;
  background: #fff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trf2-page-link.is-active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.trf2-page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.trf2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

.trf2-modal {
  width: min(100%, 672px);
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto 0;
}

.trf2-modal--product {
  width: min(100%, 672px);
}

.trf2-modal--compact {
  width: min(100%, 672px);
}

.trf2-modal--sales {
  width: min(100%, 560px);
}

.trf2-modal--payment-create,
.trf2-modal--payment-edit {
  width: min(100%, 680px);
}

.trf2-modal--invoice {
  width: min(100%, 680px);
}

.trf2-modal--credit {
  width: min(100%, 640px);
}

.trf2-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid #eef1f4;
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.trf2-modal__header h2 {
  margin: 0;
  font-size: 1rem;
}

.trf2-modal__close {
  width: 24px;
  height: 24px;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trf2-modal__copy {
  padding: 24px 24px 0;
  color: #6b7280;
}

.trf2-modal__copy--inline {
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.trf2-form-grid {
  display: grid;
  gap: 18px;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.trf2-form-grid--payment-edit {
  gap: 20px;
}

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

.trf2-form-grid__split--triple {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 132px;
}

.trf2-field {
  display: grid;
  gap: 8px;
}

.trf2-field span {
  font-size: 0.92rem;
  color: #374151;
}

.trf2-field input,
.trf2-field select,
.trf2-field textarea {
  height: 42px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #d8dee8;
  background: #fff;
  padding: 0 14px;
  color: #111827;
}

.trf2-field textarea {
  height: auto;
  min-height: 104px;
  padding: 12px 14px;
  resize: vertical;
}

.trf2-field small {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 0.78rem;
}

.trf2-modal__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.trf2-modal__actions--statement {
  align-items: stretch;
}

.trf2-modal__actions-group {
  display: flex;
  flex: 1 1 auto;
  gap: 10px;
}

.trf2-secondary-button--wide {
  flex: 1 1 0;
  justify-content: center;
}

.trf2-payment-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
}

.trf2-invoice-card {
  border-top: 1px solid #eef1f4;
  padding-top: 14px;
}

.trf2-invoice-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 14px;
}

.trf2-invoice-card__header strong {
  display: block;
  color: #111827;
}

.trf2-invoice-card__header span {
  display: block;
  margin-top: 5px;
  color: #6b7280;
  font-size: 0.88rem;
}

.trf2-invoice-items {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.trf2-invoice-item {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 84px 112px 32px;
  gap: 10px;
  align-items: start;
  padding: 14px 14px 12px;
  border: 1px solid #eef1f4;
  border-radius: 16px;
  background: #fbfcff;
}

.trf2-invoice-item .trf2-field {
  gap: 6px;
}

.trf2-invoice-item .trf2-field > span {
  color: #374151;
  font-size: 0.95rem;
  font-weight: 500;
}

.trf2-invoice-item .trf2-field small {
  margin-top: 0;
}

.trf2-invoice-item__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 30px;
}

.trf2-invoice-item__actions button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e11d48;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.trf2-invoice-item__actions button svg {
  width: 18px;
  height: 18px;
}

.trf2-invoice-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 0;
  border-top: 1px solid #eef1f4;
}

.trf2-invoice-total span {
  color: #6b7280;
  font-weight: 600;
}

.trf2-invoice-total strong {
  font-size: 1.9rem;
  color: #4f46e5;
}

.trf2-credit-alert {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 16px;
  padding: 16px 18px;
  line-height: 1.55;
  display: grid;
  gap: 6px;
}

.trf2-credit-alert strong {
  font-size: 0.98rem;
}

.trf2-primary-button--credit {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
}

.trf2-payment-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fafafa;
  color: #4b5563;
}

.trf2-payment-card__header strong {
  color: #111827;
}

.trf2-payment-table {
  display: grid;
}

.trf2-payment-table__head,
.trf2-payment-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 110px 140px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
}

.trf2-payment-table__head {
  color: #6b7280;
  font-size: 0.86rem;
  border-top: 1px solid #eef1f4;
  border-bottom: 1px solid #eef1f4;
}

.trf2-payment-table__row {
  border-bottom: 1px solid #eef1f4;
}

.trf2-payment-table__row:last-child {
  border-bottom: 0;
}

.trf2-payment-table__row.is-selected {
  background: #fafaff;
}

.trf2-payment-table__invoice {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trf2-payment-table__row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.trf2-payment-table__row input[type="number"] {
  height: 32px;
  border-radius: 10px;
  border: 1px solid #cfd7e3;
  padding: 0 10px;
  width: 100%;
}

.trf2-payment-table__row small {
  display: block;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 0.78rem;
}

.trf2-payment-table__error {
  margin: 0;
  padding: 0 16px 14px;
  color: #b91c1c;
  font-size: 0.82rem;
}

.trf2-error {
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: #111827;
  color: #f9fafb;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

  .trf2-sidebar {
    padding-bottom: 12px;
    position: static;
    height: auto;
    overflow: visible;
  }

  .trf2-nav {
    padding-bottom: 0;
  }

  .trf2-sidebar__footer {
    position: static;
  }

  .trf2-card-grid {
    grid-template-columns: 1fr;
  }

  .trf2-main,
  .trf2-chart {
    grid-template-columns: 1fr;
  }

  .trf2-page-header,
  .trf2-toolbar,
  .trf2-toolbar__actions,
  .trf2-modal__actions {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .trf2-filter select {
    min-width: 0;
    width: 100%;
  }

  .trf2-filter-field input,
  .trf2-filter-field select {
    min-width: 0;
    width: 100%;
  }

  .trf2-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .trf2-pagination__pages {
    flex-wrap: wrap;
  }

  .trf2-invoice-card__header {
    flex-direction: column;
    align-items: stretch;
  }
}
