:root {
  color-scheme: light;
  --ink: #f7f1e3;
  --muted: #a99f8e;
  --line: #2d2d2d;
  --panel: #101010;
  --canvas: #050505;
  --blue: #d6a94f;
  --blue-soft: #261f12;
  --green: #0f7a55;
  --green-soft: #f0faf5;
  --amber: #d6a94f;
  --red: #d6a94f;
  --red-dark: #9d7429;
  --red-soft: #211a10;
  --black: #050505;
  --black-soft: #101010;
  --gold: #d6a94f;
  --gold-light: #f2d28b;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  font-family: Arial, Helvetica, sans-serif;
}

/* Atualizacao bancaria: menu, inicio, feed e edicao segura */
.app-menu {
  overflow-x: hidden;
  box-sizing: border-box;
}

.menu-section-title {
  color: rgba(245, 211, 114, 0.72);
  letter-spacing: 0.08em;
}

.menu-list,
.menu-item,
.menu-copy {
  min-width: 0;
  box-sizing: border-box;
}

.menu-item {
  width: 100%;
  align-items: center;
}

.menu-copy strong,
.menu-copy small {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.home-actions {
  align-items: stretch;
}

.section-heading.full-row {
  grid-column: 1 / -1;
  margin: 0 0 2px;
}

.section-heading.full-row h2 {
  margin: 4px 0 2px;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
}

.capital-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.capital-overview-main.balance-card {
  min-height: 150px;
  background:
    radial-gradient(circle at top right, rgba(245, 211, 114, 0.15), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    #0b0b0b !important;
}

.capital-overview-grid,
.capital-overview-progress {
  grid-column: 1 / -1;
}

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

.activity-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(214, 169, 79, 0.22);
  border-radius: 22px;
  background: linear-gradient(145deg, #141414, #070707);
}

.activity-group-heading,
.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-group-heading strong {
  color: #fff7de;
  font-size: 1rem;
}

.activity-group-heading button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: #080808;
  background: linear-gradient(135deg, #f7d77a, #d8aa4f);
  font-weight: 800;
  cursor: pointer;
}

.activity-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.activity-item div {
  display: grid;
  min-width: 0;
}

.activity-item span,
.activity-item small,
.activity-empty {
  color: rgba(255, 247, 222, 0.68);
}

.activity-item strong {
  color: #fff7de;
}

.activity-item > strong {
  color: #f5d372;
  white-space: nowrap;
}

.sale-list-panel {
  margin-top: 18px;
}

.compact-sale-card {
  margin-bottom: 12px;
}

.compact-sale-card .sale-modern-head h3 {
  font-size: clamp(1.55rem, 2.4vw, 2.4rem);
}

.loan-group-part {
  align-items: center;
}

.loan-group-part .edit-sale {
  min-height: 44px;
  padding: 10px 14px;
}

.sale-edit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
}

.sale-edit-dialog form {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.edit-change-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(214, 169, 79, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.edit-change-list > strong {
  color: #f5d372;
}

.edit-change-list p {
  margin: 0;
  color: rgba(255, 247, 222, 0.68);
}

.edit-change-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.edit-change-row span {
  color: #fff7de;
  font-weight: 800;
}

.edit-change-row small {
  color: rgba(255, 247, 222, 0.58);
}

.edit-change-row strong {
  color: #f5d372;
}

.admin-top-action[hidden],
[data-admin-only][hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .capital-overview,
  .dashboard-activity-feed {
    grid-template-columns: 1fr;
  }

  .app-menu {
    width: min(88vw, 360px);
  }

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

/* Etapa 5 - tempo real, semanas financeiras e calendario */
.sync-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.sync-status small {
  color: #d8c89e;
  font-size: 11px;
  white-space: nowrap;
}

.sync-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(242, 205, 115, 0.28);
  border-radius: 14px;
  background: rgba(242, 205, 115, 0.10);
  color: #fff7df;
  font-weight: 900;
  cursor: pointer;
}

.sync-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #f5d372;
  border-right-color: transparent;
  border-radius: 999px;
}

.sync-button.loading .sync-icon {
  animation: syncSpin 0.8s linear infinite;
}

@keyframes syncSpin {
  to {
    transform: rotate(360deg);
  }
}

.finance-week-shell,
.calendar-panel,
.day-detail-panel,
.closings-panel,
.weekly-admin-danger {
  margin-bottom: 14px;
  border: 1px solid rgba(242, 205, 115, 0.18);
  border-radius: 22px;
  background: linear-gradient(145deg, #141414, #090909);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.finance-week-shell {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.finance-month-control,
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.finance-month-control strong,
.calendar-toolbar strong {
  color: #fff7df;
  text-transform: capitalize;
}

.finance-month-control button,
.calendar-toolbar button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(242, 205, 115, 0.24);
  border-radius: 14px;
  background: #090909;
  color: #f5d372;
  font-weight: 900;
}

.finance-week-tabs {
  min-width: 0;
}

.finance-week-menu {
  display: grid;
  gap: 7px;
  width: 100%;
}

.finance-week-menu span {
  color: #cdbb88;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finance-week-menu select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(242, 205, 115, 0.28);
  border-radius: 16px;
  background: linear-gradient(145deg, #101010, #050505);
  color: #fff7df;
  font-size: 15px;
  font-weight: 900;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.finance-week-summary {
  display: grid;
  justify-items: end;
  gap: 10px;
  color: #d8c89e;
  text-align: right;
}

.general-history-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.general-history-actions .ghost-button {
  min-height: 46px;
  color: #fff4d0;
  border-color: rgba(242, 205, 115, 0.35);
  background: rgba(242, 205, 115, 0.06);
}

.late-closing-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(242, 205, 115, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(242, 205, 115, 0.14), rgba(8, 8, 8, 0.88)),
    #0b0b0b;
}

.late-closing-panel span,
.late-closing-panel small {
  display: block;
  color: #dbc58f;
  font-weight: 800;
}

.late-closing-panel strong {
  display: block;
  margin: 4px 0;
  color: #fff8df;
  font-size: clamp(18px, 2vw, 24px);
}

.late-closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.late-closing-actions .primary-button,
.late-closing-actions .ghost-button {
  min-height: 44px;
  min-width: 180px;
  padding-inline: 18px;
  white-space: nowrap;
}

.late-closing-actions .primary-button.active {
  box-shadow: 0 0 0 3px rgba(40, 199, 111, 0.24);
}

.week-status-badge,
.finance-week-summary strong,
.closing-card > div:first-child span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(242, 205, 115, 0.13);
  color: #f5d372;
  font-size: 12px;
  font-weight: 900;
}

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

.weekly-close-summary-grid article,
.day-detail-totals article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(242, 205, 115, 0.18);
  border-radius: 20px;
  background: #101010;
}

.weekly-close-summary-grid span,
.day-detail-totals span,
.closing-card span,
.calendar-legend {
  color: #d8c89e;
  font-size: 12px;
}

.weekly-close-summary-grid strong,
.day-detail-totals strong,
.closing-card strong {
  display: block;
  margin-top: 6px;
  color: #fff7df;
  font-size: 22px;
}

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

.closing-card {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, minmax(120px, 0.8fr)) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(242, 205, 115, 0.16);
  border-radius: 18px;
  background: #0b0b0b;
}

.weekly-admin-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-color: rgba(255, 100, 100, 0.35);
}

.weekly-admin-danger h2,
.danger-copy {
  color: #ffb1b1;
}

.weekly-admin-danger button,
.danger-action {
  background: #c91414 !important;
  color: #fff !important;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.calendar-weekday {
  color: #d8c89e;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  min-height: 92px;
  padding: 10px;
  border: 1px solid rgba(242, 205, 115, 0.14);
  border-radius: 16px;
  background: #0a0a0a;
  color: #fff7df;
  text-align: left;
}

.calendar-day.muted {
  opacity: 0.36;
}

.calendar-day.today {
  border-color: #f5d372;
}

.calendar-day.selected {
  background: linear-gradient(145deg, rgba(245, 211, 114, 0.30), rgba(245, 211, 114, 0.08));
}

.calendar-day.friday span:first-child::after {
  content: " fechamento";
  display: block;
  margin-top: 2px;
  color: #f5d372;
  font-size: 10px;
}

.calendar-day small {
  display: block;
  margin-top: 4px;
  color: #d8c89e;
  font-size: 10px;
}

.calendar-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.dot-sale,
.dot-expense,
.dot-pending,
.dot-closing {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dot-sale { background: #4ade80; }
.dot-expense { background: #fb7185; }
.dot-pending { background: #facc15; }
.dot-closing { background: #60a5fa; }

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

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

.day-detail-list h3 {
  margin: 8px 0 0;
  color: #f5d372;
}

.day-detail-list p {
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff7df;
}

.week-delete-dialog textarea {
  resize: vertical;
}

@media (max-width: 767.98px) {
  .sync-status {
    justify-items: stretch;
    width: 100%;
  }

  .sync-button {
    justify-content: center;
    width: 100%;
  }

  .finance-week-shell {
    grid-template-columns: 1fr;
    margin-inline: 0;
    border-radius: 20px;
  }

  .finance-month-control {
    margin-bottom: 0;
  }

  .finance-week-summary {
    justify-items: start;
    text-align: left;
  }

  .weekly-admin-danger {
    display: grid;
  }

  .weekly-close-summary-grid,
  .day-detail-totals {
    grid-template-columns: 1fr 1fr;
  }

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

  .financial-calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 74px;
    padding: 7px;
    border-radius: 12px;
  }

  .calendar-day.friday span:first-child::after {
    content: "sex";
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(214, 169, 79, 0.18), transparent 34%),
    linear-gradient(180deg, #000 0, #090909 260px, var(--canvas) 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 30% 18%, rgba(214, 169, 79, 0.24), transparent 28%),
    linear-gradient(160deg, #000 0%, #131313 48%, #0a0a0a 48%, #050505 100%);
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 18px;
  background: #101010;
  box-shadow: 0 24px 60px rgba(31, 31, 31, 0.22);
}

.login-logo {
  min-height: 118px;
  border-radius: 16px;
  margin-bottom: 4px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(214, 169, 79, 0.36);
  border-radius: 50%;
  background: #090909;
  color: var(--gold-light);
  transform: translateY(-50%);
}

.password-toggle::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 8px;
  width: 20px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50% / 65%;
}

.password-toggle::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.password-toggle[aria-pressed="true"]::before {
  opacity: 0.75;
}

.password-toggle[aria-pressed="true"]::after {
  top: 18px;
  left: 9px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-35deg);
}

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

.bank-app.locked {
  display: none;
}

.bank-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-menu {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  padding: 22px;
  background:
    radial-gradient(circle at 26% 0%, rgba(214, 169, 79, 0.22), transparent 34%),
    linear-gradient(180deg, #101010 0%, #070707 56%, #000 100%);
  color: #fff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
  font-size: 25px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: #090909;
}

.brand-block strong,
.brand-block span,
.menu-card span,
.menu-card strong,
.quick-card strong,
.quick-card span {
  display: block;
}

.brand-block span,
.menu-card span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.brand-block strong {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.menu-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 1px solid rgba(214, 169, 79, 0.2);
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.menu-item.active,
.menu-item:hover {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.28);
}

.menu-icon {
  position: relative;
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(214, 169, 79, 0.16);
  color: #fff;
  font-size: 0;
  font-weight: 900;
  overflow: hidden;
}

.menu-item.active .menu-icon,
.menu-item:hover .menu-icon {
  background: #080808;
  color: var(--gold-light);
}

.icon-home-logo {
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
  font-size: 15px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 2px rgba(224, 0, 0, 0.12);
}

.menu-item.active .icon-home-logo,
.menu-item:hover .icon-home-logo {
  background: #080808;
  color: var(--gold-light);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.menu-icon::before,
.menu-icon::after,
.action-icon::before,
.action-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.icon-home-logo::before,
.icon-home-logo::after {
  display: none;
}

.icon-simulate::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-2px, -2px);
}

.icon-simulate::after {
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(7px, 7px) rotate(45deg);
}

.icon-sale::before {
  content: "$";
  position: static;
  font-size: 18px;
  line-height: 1;
}

.icon-sale::after {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.28;
}

.icon-expense::before {
  width: 17px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.icon-expense::after {
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
  transform: translateY(-5px);
}

.icon-vendors::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -7px 4px 0 -1px currentColor, 7px 4px 0 -1px currentColor;
  transform: translateY(-4px);
}

.icon-vendors::after {
  width: 22px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  transform: translateY(7px);
}

.icon-firm::before {
  width: 18px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-firm::after {
  width: 3px;
  height: 3px;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor, -6px 0 0 currentColor, 0 6px 0 currentColor, 6px 6px 0 currentColor, -6px 6px 0 currentColor;
  transform: translateY(-4px);
}

.icon-agents::before {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translateY(-5px);
}

.icon-agents::after {
  width: 19px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transform: translateY(8px);
}

.icon-history::before {
  width: 19px;
  height: 19px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-history::after {
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(2px, -2px);
}

.icon-settings::before {
  width: 18px;
  height: 18px;
  border: 2px dashed currentColor;
  border-radius: 50%;
}

.icon-settings::after {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.menu-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
}

.menu-card strong {
  margin-top: 6px;
  font-size: 19px;
}

.app-main {
  min-width: 0;
  padding: 24px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.mobile-menu {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border-bottom: 3px solid var(--red);
  padding-bottom: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mini-logo {
  display: none;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(224, 0, 0, 0.22);
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 17px;
}

.topbar-actions,
.panel-heading,
.inline-form,
.agent-row {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  background: linear-gradient(180deg, #f01414, #d30000);
  color: #fff;
  box-shadow: 0 12px 22px rgba(224, 0, 0, 0.22);
}

.secondary-button {
  background: var(--red);
  color: #fff;
}

.ghost-button {
  background: transparent;
  color: var(--red);
  border: 1px solid #ffc4c4;
}

.hidden,
[hidden] {
  display: none !important;
}

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

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
}

.home-logo,
.home-total,
.feed-panel,
.app-action-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.home-logo {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 150px;
  padding: 22px;
  background:
    radial-gradient(circle at 90% 50%, rgba(242, 210, 139, 0.16), transparent 28%),
    linear-gradient(135deg, #171717 0%, #050505 100%);
  color: #fff;
}

.home-logo > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #090909;
  font-size: 38px;
  font-weight: 900;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
}

.home-logo > div {
  position: relative;
  z-index: 1;
}

.home-logo::before {
  content: "";
  position: absolute;
  right: -18px;
  top: 50%;
  width: 260px;
  height: 180px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 169, 79, 0.22), transparent 68%);
  filter: blur(2px);
  transform: translateY(-50%);
}

.home-logo::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  width: 285px;
  height: 190px;
  border-radius: 0 16px 16px 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.46) 34%, rgba(5, 5, 5, 0.08) 100%),
    url("./lion-real.png") center / cover no-repeat;
  opacity: 0.76;
  transform: translateY(-50%);
}

.home-logo strong,
.home-logo small,
.home-total span,
.home-total strong,
.app-action-card strong,
.app-action-card small,
.feed-item span,
.feed-item strong {
  display: block;
}

.home-logo strong {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.home-logo small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.home-total {
  display: grid;
  align-content: center;
  min-height: 150px;
  padding: 22px;
  background: linear-gradient(145deg, #111, #070707);
  border-top: 5px solid var(--red);
}

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

.home-total strong {
  margin-top: 10px;
  color: var(--red);
  font-size: 32px;
}

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

.app-action-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  min-height: 112px;
  padding: 18px;
  background: linear-gradient(145deg, #121212, #080808);
  color: var(--ink);
  text-align: left;
}

.app-action-card.primary-action {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
  border-color: transparent;
}

.action-icon {
  position: relative;
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #080808;
  color: var(--gold-light);
  font-size: 0;
  font-weight: 900;
  overflow: hidden;
}

.primary-action .action-icon {
  background: #080808;
  color: var(--gold-light);
}

.app-action-card strong {
  font-size: 21px;
}

.app-action-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.primary-action small {
  color: rgba(8, 8, 8, 0.72);
}

.feed-panel {
  margin-bottom: 14px;
  padding: 16px;
  background: #fff;
}

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

.feed-heading span {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

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

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.feed-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.feed-item strong {
  color: var(--ink);
  font-size: 18px;
  text-align: right;
}

.feed-item.expense strong {
  color: var(--red);
}

.feed-item.capital {
  border-color: #ffd1d1;
  background: var(--red-soft);
}

.feed-item.capital strong {
  color: var(--red);
}

.feed-item.subtotal {
  background: #1f1f1f;
  color: #fff;
  border-color: #1f1f1f;
}

.feed-item.subtotal span,
.feed-item.subtotal strong {
  color: #fff;
}

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

.weekly-report {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(224, 179, 79, 0.38);
  border-radius: 8px;
  background: #0d0d0d;
  color: #fff7df;
}

.weekly-report-heading,
.weekly-report-totals,
.weekly-day {
  display: grid;
  gap: 12px;
}

.weekly-report-heading {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 14px;
}

.weekly-report-heading span,
.weekly-report-totals span,
.weekly-day span {
  color: #cdbf9c;
  font-size: 12px;
  font-weight: 700;
}

.weekly-report-heading h2 {
  margin-top: 3px;
  color: #fff7df;
  font-size: 20px;
}

.weekly-report-heading > strong {
  color: #e0b34f;
  font-size: 13px;
}

.weekly-report-totals {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.weekly-report-totals article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(224, 179, 79, 0.28);
  border-radius: 8px;
  background: #151515;
}

.weekly-report-totals strong {
  display: block;
  margin-top: 6px;
  color: #f4d98f;
  font-size: 20px;
}

.weekly-report-totals .weekly-balance {
  background: #e0b34f;
}

.weekly-report-totals .weekly-balance span,
.weekly-report-totals .weekly-balance strong {
  color: #090909;
}

.weekly-report-totals .weekly-balance strong.negative {
  color: #7e0000;
}

.weekly-daily-feed {
  display: grid;
  gap: 8px;
}

.weekly-day {
  grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(115px, 0.7fr));
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(224, 179, 79, 0.2);
  border-radius: 8px;
  background: #111;
}

.weekly-day.today {
  border-color: #e0b34f;
  background: #1b170e;
}

.weekly-day-name strong,
.weekly-day > div > strong {
  display: block;
  color: #fff7df;
}

.weekly-day-name span {
  display: block;
  margin-top: 3px;
}

.weekly-day .weekly-sale-value {
  color: #f4d98f;
}

.weekly-day .weekly-expense-value {
  color: #ff9b9b;
}

.weekly-day .weekly-pending-value {
  color: #f5d982;
}

@media (max-width: 700px) {
  .weekly-report {
    padding: 13px;
  }

  .weekly-report-heading {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .weekly-report-totals {
    grid-template-columns: 1fr 1fr;
  }

  .weekly-report-totals .weekly-balance {
    grid-column: 1 / -1;
  }

  .weekly-day {
    grid-template-columns: 1fr 1fr;
  }

  .weekly-day-name {
    grid-column: 1 / -1;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(224, 179, 79, 0.18);
  }
}

.primary-metric {
  grid-column: span 2;
}

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

.metric,
.panel,
.quick-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
  border-top: 4px solid var(--red);
}

.metric span,
.panel-heading span,
label,
.agent-row span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.primary-metric {
  background: linear-gradient(135deg, #e00000 0%, #b00000 100%);
  color: #fff;
  border-color: transparent;
}

.primary-metric span {
  color: rgba(255, 255, 255, 0.78);
}

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

.quick-card {
  min-height: 100px;
  padding: 16px;
  text-align: left;
  border-left: 4px solid var(--red);
}

.quick-card strong {
  color: var(--ink);
  font-size: 17px;
}

.quick-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.expense-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(214, 169, 79, 0.26);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(214, 169, 79, 0.18), transparent 32%),
    linear-gradient(145deg, #151515, #080808);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.expense-hero span,
.expense-hero small {
  display: block;
  color: #d8c89e;
  font-weight: 800;
}

.expense-hero span {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.expense-hero strong {
  color: #fff7df;
  font-size: 30px;
  line-height: 1;
}

.expense-hero small {
  margin-top: 8px;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.35;
}

.expense-hero-action {
  min-width: 132px;
  min-height: 46px;
  border: 1px solid rgba(214, 169, 79, 0.32);
  border-radius: 999px;
  background: rgba(214, 169, 79, 0.12);
  color: #f4d98f;
  font-weight: 900;
}

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

.firm-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.firm-receipt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(214, 169, 79, 0.45);
  border-radius: 8px;
  background: linear-gradient(145deg, #19150c, #090909);
}

.firm-receipt-actions > div:first-child span {
  display: block;
  margin-bottom: 4px;
  color: #d8c89e;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.firm-receipt-actions > div:first-child strong {
  color: #fff7df;
  font-size: 18px;
}

.firm-receipt-actions > div:last-child {
  display: flex;
  gap: 10px;
}

.firm-receipt-actions button {
  min-width: 180px;
}

.receipt-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid rgba(214, 169, 79, 0.38);
  border-radius: 24px;
  background: #080808;
  color: #fff7df;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
}

.receipt-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.receipt-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 28px);
}

.receipt-dialog-heading,
.receipt-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(214, 169, 79, 0.2);
  background: linear-gradient(145deg, #15120a, #080808);
}

.receipt-dialog-actions {
  border-top: 1px solid rgba(214, 169, 79, 0.2);
  border-bottom: 0;
}

.receipt-dialog-heading span {
  display: block;
  color: #d8c89e;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-dialog-heading strong {
  display: block;
  margin-top: 4px;
  color: #fff7df;
  font-size: 19px;
}

.receipt-preview-frame {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #111;
}

.receipt-preview-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fffaf0;
}

.receipt-dialog-actions button {
  min-width: 180px;
}

.barbudo-closing-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  border-color: rgba(224, 179, 79, 0.42) !important;
  background: linear-gradient(145deg, #151515, #080808) !important;
}

.partner-commission-metric {
  border-color: rgba(224, 179, 79, 0.55) !important;
  background: linear-gradient(145deg, #2a210d, #111) !important;
}

.partner-commission-metric strong {
  color: #f3ce72 !important;
}

.partner-commission-metric small {
  color: #cdbf9c !important;
}

.barbudo-closing-heading,
.barbudo-closing-footer,
.barbudo-receipt-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.barbudo-closing-heading h2 {
  margin: 3px 0;
  color: #fff4d6;
}

.barbudo-closing-heading small,
.barbudo-closing-summary small,
.barbudo-week-days small {
  color: #cdbf9c;
}

.barbudo-closing-heading label {
  display: grid;
  gap: 6px;
  min-width: 190px;
  color: #dbc994;
  font-size: 12px;
  font-weight: 800;
}

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

.barbudo-closing-summary article {
  display: grid;
  gap: 6px;
  min-height: 112px;
  align-content: center;
  border: 1px solid rgba(224, 179, 79, 0.38);
  border-radius: 8px;
  padding: 16px;
  background: #0b0b0b;
}

.barbudo-closing-summary span {
  color: #d7c79e;
  font-weight: 700;
}

.barbudo-closing-summary strong {
  color: #f3ce72;
  font-size: 26px;
}

.barbudo-week-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.barbudo-week-days article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(224, 179, 79, 0.25);
  border-radius: 6px;
  padding: 12px;
  background: #111;
}

.barbudo-week-days article.selected {
  border-color: #e0b34f;
  background: #2a210d;
}

.barbudo-week-days span {
  color: #d5c79f;
  font-size: 12px;
  font-weight: 800;
}

.barbudo-week-days strong {
  color: #fff4d6;
  overflow-wrap: anywhere;
}

.barbudo-closing-footer {
  align-items: flex-end;
}

.barbudo-daily-sales {
  display: grid;
  flex: 1;
  gap: 8px;
}

.barbudo-daily-sales article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(224, 179, 79, 0.2);
  padding: 10px 2px;
}

.barbudo-daily-sales span,
.barbudo-daily-sales strong {
  display: block;
}

.barbudo-daily-sales span {
  color: #cdbf9c;
  font-size: 12px;
}

.barbudo-daily-sales > article > strong {
  color: #f3ce72;
  font-size: 18px;
}

.barbudo-receipt-buttons {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .barbudo-closing-heading,
  .barbudo-closing-footer,
  .barbudo-receipt-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .barbudo-closing-heading label,
  .barbudo-receipt-buttons,
  .barbudo-receipt-buttons button {
    width: 100%;
  }

  .barbudo-closing-summary {
    grid-template-columns: 1fr;
  }

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

.treasury-panel {
  margin-bottom: 14px;
  padding: 16px;
}

.treasury-panel .panel-heading > strong {
  color: #f5d982;
  font-size: 16px;
}

.capital-goal {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(214, 169, 79, 0.35);
  border-radius: 8px;
  background: #101010;
}

.capital-goal > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.capital-goal span,
.capital-goal small {
  color: #d8c89e;
}

.capital-goal strong {
  color: #f5d982;
}

.capital-progress-track {
  overflow: hidden;
  height: 14px;
  margin: 12px 0 8px;
  border-radius: 4px;
  background: #050505;
}

.capital-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b88620, #f5d982);
  transition: width 0.25s ease;
}

.capital-progress-track span.complete {
  background: linear-gradient(90deg, #198754, #63d49a);
}

.firm-allocation-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.allocation-history {
  display: grid;
  gap: 8px;
}

.allocation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(214, 169, 79, 0.28);
  border-radius: 8px;
  background: linear-gradient(145deg, #171717, #090909);
}

.allocation-item span,
.allocation-item small {
  display: block;
  color: #d8c89e;
}

.allocation-item strong {
  color: #fff7df;
}

.allocation-item > div:last-child {
  text-align: right;
}

.delete-allocation {
  display: block;
  margin-top: 6px;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #ff9b9b;
  font-weight: 800;
}

.admin-page-heading {
  margin-bottom: 18px;
}

.admin-page-heading h2 {
  margin: 4px 0 6px;
  color: #fff8df;
  font-size: clamp(24px, 3vw, 38px);
}

.admin-page-heading p {
  max-width: 720px;
  margin: 0;
  color: #c9b987;
  font-weight: 750;
}

.capital-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

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

.capital-edit-card .panel-heading h2 {
  margin: 5px 0 0;
  color: #fff6dc;
  font-size: clamp(28px, 4vw, 46px);
}

.capital-edit-card .panel-heading > strong {
  color: #e9cf81;
  text-align: right;
}

.capital-update-meta {
  color: #a8996e;
  font-weight: 800;
}

.capital-admin-form {
  display: grid;
  gap: 12px;
}

.capital-admin-form label {
  display: grid;
  gap: 7px;
  color: #d8c999;
  font-size: 13px;
  font-weight: 900;
}

.capital-admin-form input,
.capital-admin-form textarea {
  width: 100%;
  border: 1px solid rgba(242, 205, 115, 0.22);
  border-radius: 14px;
  padding: 13px 14px;
  background: #050505;
  color: #fff8df;
  font: inherit;
  box-sizing: border-box;
}

.capital-admin-form textarea {
  resize: vertical;
  min-height: 92px;
}

.capital-history-panel {
  margin-top: 18px;
}

.capital-change-history {
  display: grid;
  gap: 10px;
}

.capital-history-item {
  display: grid;
  grid-template-columns: minmax(170px, 1.05fr) minmax(130px, 0.75fr) minmax(130px, 0.75fr) minmax(180px, 1.2fr) minmax(120px, 0.7fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(242, 205, 115, 0.16);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(242, 205, 115, 0.035));
}

.capital-history-item span {
  display: block;
  color: #b8aa82;
  font-size: 12px;
  font-weight: 850;
}

.capital-history-item strong {
  display: block;
  margin-top: 4px;
  color: #fff8df;
  font-size: 15px;
}

.capital-history-date strong {
  color: #e9cf81;
}

.capital-history-reason strong {
  font-size: 14px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .firm-receipt-actions,
  .firm-receipt-actions > div:last-child {
    align-items: stretch;
    flex-direction: column;
  }

  .firm-receipt-actions button {
    width: 100%;
    min-width: 0;
  }

  .capital-goal > div:first-child,
  .allocation-item {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .allocation-item > div:last-child {
    width: 100%;
    text-align: left;
  }

  .delete-allocation {
    margin-left: 0;
  }

  .capital-settings-grid {
    grid-template-columns: 1fr;
  }

  .capital-edit-card .panel-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .capital-edit-card .panel-heading > strong {
    text-align: left;
  }

  .capital-admin-form input,
  .capital-admin-form textarea,
  .capital-admin-form button {
    width: 100%;
  }

  .capital-history-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Configuracoes e gerenciamento da equipe */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.agent-settings-panel,
.settings-panel {
  margin: 0;
}

.settings-heading > div {
  display: grid;
  gap: 3px;
}

.section-kicker {
  color: #d9ad50;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.55fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid rgba(218, 173, 75, 0.3);
  border-radius: 8px;
  background: #0a0a0a;
}

.agent-form label {
  display: grid;
  gap: 7px;
  color: #e6d8b1;
  font-size: 13px;
  font-weight: 800;
}

.agent-form input,
.agent-form select {
  min-height: 48px;
}

.agent-add-button {
  min-height: 48px;
  white-space: nowrap;
}

.settings-agent-list {
  gap: 10px;
}

.settings-agent-list .agent-row {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(218, 173, 75, 0.3) !important;
  background: linear-gradient(145deg, #171717, #0a0a0a) !important;
}

.agent-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agent-avatar {
  display: grid !important;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(242, 205, 115, 0.65);
  border-radius: 50%;
  background: #d9aa48;
  color: #080808 !important;
  font-size: 17px;
  font-weight: 900;
}

.settings-agent-list .agent-row strong {
  color: #fff4d6 !important;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.settings-agent-list .agent-row .agent-identity span:last-child {
  margin-top: 3px;
  color: #cdbd94 !important;
  font-size: 13px;
}

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

.agent-actions .agent-edit-button,
.agent-actions .agent-delete-button {
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 6px;
}

.agent-actions .agent-edit-button {
  border-color: rgba(226, 183, 81, 0.55) !important;
  background: #201a0e !important;
  color: #f0c969 !important;
}

.agent-actions .agent-delete-button {
  border-color: rgba(217, 68, 68, 0.55) !important;
  background: #2a0d0d !important;
  color: #ff9c9c !important;
}

.agent-edit-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid rgba(235, 194, 95, 0.55);
  border-radius: 8px;
  padding: 0;
  background: #111;
  color: #fff4d6;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.agent-edit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.metric-action {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 1px solid rgba(15, 15, 15, 0.28);
  border-radius: 6px;
  background: #0a0a0a;
  color: #f1c968;
  font-weight: 900;
  cursor: pointer;
}

.metric-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.agent-edit-dialog form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.agent-edit-dialog label {
  display: grid;
  gap: 7px;
  color: #e6d8b1;
  font-size: 13px;
  font-weight: 800;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-heading h2 {
  margin: 3px 0 0;
}

.dialog-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(218, 173, 75, 0.35);
  border-radius: 50%;
  background: #090909;
  color: #f2cd73;
  font-weight: 900;
  cursor: pointer;
}

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

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .mobile-menu {
    display: flex;
    overflow-x: auto;
  }

  .mobile-menu .menu-item {
    flex: 0 0 78px;
  }

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

  .agent-add-button {
    width: 100%;
  }

  .settings-agent-list .agent-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-actions {
    width: 100%;
  }

  .agent-actions button {
    flex: 1;
  }

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

  .dialog-actions button {
    width: 100%;
  }
}

/* Historico moderno de vendas */
.format-sale-card .sale-modern-head,
.format-sale-card .sale-modern-people,
.format-sale-card .sale-modern-flow,
.format-sale-card .sale-modern-details {
  color: #fff7df !important;
}

.format-sale-card .sale-modern-head {
  background: transparent !important;
}

.format-sale-card .sale-modern-people > div,
.format-sale-card .sale-modern-flow > div,
.format-sale-card .sale-modern-details > div {
  border-color: rgba(214, 169, 79, 0.22) !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

.format-sale-card .sale-modern-firm {
  border-color: rgba(242, 205, 115, 0.46) !important;
  background: linear-gradient(145deg, rgba(214, 169, 79, 0.2), rgba(214, 169, 79, 0.07)) !important;
}

.format-sale-card .sale-modern-head h3,
.format-sale-card .sale-modern-flow strong,
.format-sale-card .sale-modern-details strong {
  color: #fff7df !important;
}

.format-sale-card .sale-modern-head > div > strong,
.format-sale-card .sale-modern-firm strong {
  color: #f2cd73 !important;
}

.format-sale-card .sale-modern-head span,
.format-sale-card .sale-modern-people span,
.format-sale-card .sale-modern-flow span,
.format-sale-card .sale-modern-flow small,
.format-sale-card .sale-modern-details span,
.format-sale-card .sale-modern-details small {
  color: #e8d7ad !important;
}

@media (max-width: 720px) {
  .sale-modern-head,
  .firm-cash-history-heading {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .sale-modern-people,
  .sale-modern-flow,
  .firm-cash-history-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .firm-cash-history-heading > strong,
  .firm-cash-history-item > div:last-child {
    text-align: left;
  }
}

.firm-work-panel {
  grid-column: 1 / -1;
}

.firm-work-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(214, 169, 79, 0.32);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
}

.firm-work-total span,
.firm-work-total strong {
  color: #080808;
}

.firm-work-total strong {
  font-size: 24px;
}

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

.firm-work-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(214, 169, 79, 0.32);
  border-radius: 14px;
  padding: 13px 14px;
  background: linear-gradient(145deg, #171717, #080808);
}

.firm-work-card span,
.firm-work-card small {
  display: block;
  color: #d8c89e;
}

.firm-work-card strong {
  display: block;
  color: #fff7df;
}

.firm-work-card > strong {
  flex: 0 0 auto;
  color: var(--gold-light);
  font-size: 18px;
}

.panel {
  padding: 16px;
}

.firm-panel {
  padding: 18px;
}

.sale-panel {
  max-width: 1180px;
}

.settings-panel {
  max-width: 540px;
}

.panel-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.history-filters select {
  min-height: 42px;
  border-color: rgba(214, 169, 79, 0.44);
  background: #f0c75f;
  color: #0b0b0b;
  font-weight: 900;
}

.panel-heading > span {
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 8px;
  padding: 5px 8px;
  font-weight: 700;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(224, 0, 0, 0.15);
  border-color: var(--blue);
}

#saleAmount,
#expenseAmount {
  text-align: right;
  font-weight: 700;
}

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

.restricted-field {
  display: none;
}

.breakdown div {
  background: #fff8f8;
  border: 1px solid #ffd3d3;
  border-radius: 8px;
  padding: 10px;
}

.breakdown span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.breakdown strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

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

.rates-grid label {
  grid-template-columns: 1fr 100px;
  align-items: center;
}

.inline-form {
  gap: 8px;
  margin-bottom: 12px;
}

.expense-form {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
}

.expense-form label:nth-child(2) {
  grid-column: 1 / -1;
}

.expense-form button {
  grid-column: 1 / -1;
}

.simulation-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
}

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

.simulation-button {
  margin-top: 14px;
}

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

.simulation-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.simulation-result-item span,
.simulation-result-item strong {
  display: block;
}

.simulation-result-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.simulation-result-item strong {
  text-align: right;
  font-size: 18px;
}

.simulation-result-item.total {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.simulation-result-item.total span,
.simulation-result-item.total strong {
  color: #fff;
}

.bank-statement {
  display: grid;
  gap: 10px;
}

.statement-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(130px, auto) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}

.statement-date {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.statement-main,
.statement-amount {
  min-width: 0;
}

.statement-main span,
.statement-amount span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.statement-main strong,
.statement-amount strong {
  display: block;
  margin-top: 4px;
}

.statement-main strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.statement-amount {
  text-align: right;
}

.statement-amount strong {
  color: var(--red);
  font-size: 18px;
}

.statement-delete {
  white-space: nowrap;
}

.statement-item.expense-pending {
  border-color: rgba(214, 169, 79, 0.55) !important;
}

.statement-item.expense-paid {
  border-color: rgba(58, 170, 103, 0.48) !important;
}

.pay-expense {
  min-height: 42px;
  white-space: nowrap;
}

.expense-paid-badge {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(58, 170, 103, 0.55);
  border-radius: 6px;
  background: rgba(58, 170, 103, 0.13);
  color: #8fe0ae !important;
  font-size: 12px;
  font-weight: 800;
}

.firm-expense-card small {
  display: block;
  margin-top: 5px;
  color: #d7bd84;
}

@media (max-width: 760px) {
  .statement-item {
    grid-template-columns: 1fr auto;
  }

  .statement-date,
  .statement-main {
    grid-column: 1;
  }

  .statement-amount,
  .pay-expense,
  .expense-paid-badge,
  .statement-delete {
    grid-column: 2;
  }
}

.payment-card-list {
  display: grid;
  gap: 12px;
}

.history-format-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.history-format-totals article {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(214, 169, 79, 0.38);
  border-radius: 8px;
  background: linear-gradient(145deg, #181818, #090909);
}

.history-format-totals span {
  display: block;
  color: #d7bd84;
  font-size: 12px;
}

.history-format-totals strong {
  display: block;
  margin-top: 7px;
  color: #f2cd73;
  font-size: clamp(18px, 3vw, 25px);
  overflow-wrap: anywhere;
}

.firm-cash-history-card {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(214, 169, 79, 0.48);
  border-radius: 8px;
  background: linear-gradient(145deg, #171717, #050505);
}

.firm-cash-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid rgba(214, 169, 79, 0.28);
  background: linear-gradient(135deg, rgba(214, 169, 79, 0.2), rgba(214, 169, 79, 0.06));
}

.firm-cash-history-heading span,
.firm-cash-history-item span,
.firm-cash-history-item small {
  display: block;
  color: #d8c89e !important;
}

.firm-cash-history-heading h3 {
  margin: 4px 0 0;
  color: #fff7df !important;
  font-size: 22px;
}

.firm-cash-history-heading > strong {
  color: #f2cd73 !important;
  font-size: clamp(24px, 5vw, 34px);
  white-space: nowrap;
}

.firm-cash-history-list {
  display: grid;
  gap: 1px;
  background: rgba(214, 169, 79, 0.18);
}

.firm-cash-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  background: #0b0b0b;
}

.firm-cash-history-item strong {
  display: block;
  color: #fff7df !important;
  font-size: 18px;
}

.firm-cash-history-item > div:last-child {
  text-align: right;
}

.firm-cash-history-item > div:last-child strong {
  color: #f2cd73 !important;
  font-size: 22px;
}

.firm-cash-history-item small {
  margin-top: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.firm-cash-history-empty {
  padding: 16px;
  color: #d8c89e !important;
  background: #0b0b0b;
}

.loan-group-card {
  overflow: hidden;
  border: 1px solid rgba(214, 169, 79, 0.58);
  border-radius: 8px;
  background: linear-gradient(145deg, #171717, #080808);
}

.loan-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid rgba(214, 169, 79, 0.32);
  background: rgba(214, 169, 79, 0.1);
}

.loan-group-heading span,
.loan-group-part span,
.loan-agent-commissions span,
.loan-group-summary span {
  display: block;
  color: #d8c89e !important;
  font-size: 12px;
}

.loan-group-heading strong {
  display: block;
  margin-top: 4px;
  color: #fff7df !important;
  font-size: 19px;
}

.loan-group-heading > strong {
  color: #f2cd73 !important;
  font-size: 28px;
}

.loan-group-parts {
  display: grid;
  gap: 1px;
  background: rgba(214, 169, 79, 0.2);
}

.loan-group-part {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  background: #0d0d0d;
}

.loan-group-part strong,
.loan-agent-commissions strong,
.loan-group-summary strong {
  display: block;
  margin-top: 5px;
  color: #fff7df !important;
  overflow-wrap: anywhere;
}

.loan-agent-commissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(214, 169, 79, 0.25);
}

.loan-agent-commissions > div {
  padding: 12px;
  border: 1px solid rgba(214, 169, 79, 0.35);
  border-radius: 6px;
  background: rgba(214, 169, 79, 0.08);
}

.loan-agent-commissions strong {
  color: #f2cd73 !important;
  font-size: 21px;
}

.loan-group-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(214, 169, 79, 0.25);
}

.loan-group-summary > div {
  padding: 14px 16px;
  background: #12100b;
}

.loan-group-summary .loan-total-commission {
  background: linear-gradient(145deg, #efca70, #d7a63f);
}

.loan-group-summary .loan-total-commission span,
.loan-group-summary .loan-total-commission strong {
  color: #090909 !important;
}

.loan-group-summary strong {
  font-size: 20px;
}

.proof-card {
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(214, 169, 79, 0.52);
  border-radius: 8px;
  background: linear-gradient(145deg, #171717, #080808);
}

.proof-card-heading,
.proof-card-total,
.proof-difference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.proof-card-heading {
  border-bottom: 1px solid rgba(214, 169, 79, 0.28);
}

.proof-card-heading span,
.proof-card-list span,
.proof-card-total span,
.proof-difference span {
  color: #d8c89e;
  font-size: 12px;
}

.proof-card-heading h3 {
  margin: 3px 0 0;
  color: #fff7df;
  font-size: 20px;
}

.proof-card-heading > strong {
  padding: 7px 10px;
  border: 1px solid rgba(80, 190, 115, 0.5);
  border-radius: 6px;
  background: rgba(80, 190, 115, 0.12);
  color: #92e3aa !important;
  font-size: 12px;
}

.proof-card-heading > strong.divergent {
  border-color: rgba(235, 77, 77, 0.55);
  background: rgba(235, 77, 77, 0.12);
  color: #ff9d9d !important;
}

.proof-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(214, 169, 79, 0.18);
}

.proof-card-list > div {
  min-width: 0;
  padding: 14px 16px;
  background: #0d0d0d;
}

.proof-card-list strong {
  display: block;
  margin-top: 6px;
  color: #f2d28b !important;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.proof-card-list .proof-entry strong {
  color: #fff7df !important;
}

.proof-card-total {
  border-top: 1px solid rgba(214, 169, 79, 0.28);
  background: rgba(214, 169, 79, 0.12);
}

.proof-card-total strong {
  color: #f2cd73 !important;
  font-size: 22px;
}

.proof-difference {
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 1px solid rgba(214, 169, 79, 0.18);
}

.proof-difference strong {
  color: #fff7df !important;
}

.weekly-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 15px;
  border: 1px solid rgba(225, 69, 69, 0.55);
  border-radius: 8px;
  background: rgba(118, 12, 12, 0.2);
}

.weekly-close div {
  min-width: 0;
}

.weekly-close strong,
.weekly-close span {
  display: block;
}

.weekly-close strong {
  color: #ffb1b1;
}

.weekly-close span {
  margin-top: 4px;
  color: #d8baba;
  font-size: 12px;
}

.weekly-close button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #f04c4c;
  border-radius: 6px;
  background: #b51515;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.recover-sales-button {
  width: 100%;
  margin-bottom: 16px;
}

.payment-history-item {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 8px !important;
}

.payment-history-item > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(214, 169, 79, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.payment-history-item > div span {
  display: block;
  color: #c9b98f !important;
  font-size: 11px;
}

.payment-history-item > div strong {
  display: block;
  margin-top: 6px;
  color: #f4e5bd !important;
  font-size: 16px !important;
  overflow-wrap: anywhere;
}

.payment-history-item .seller-payment-commission {
  border-color: rgba(214, 169, 79, 0.55);
  background: rgba(214, 169, 79, 0.12);
}

.payment-history-item .seller-payment-commission strong {
  color: #f2cd73 !important;
  font-size: 19px !important;
}

.payment-agent-top > div:first-child > span {
  color: #d8c89e !important;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-agent-top > div:first-child > strong {
  display: block;
  margin-top: 5px;
  color: #fff7df !important;
  font-size: clamp(25px, 4vw, 34px) !important;
  font-weight: 900 !important;
  line-height: 1.05;
  text-transform: uppercase;
}

.download-receipt-button {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid #f2d28b;
  border-radius: 6px;
  background: linear-gradient(145deg, #efca70, #d7a63f);
  color: #090909;
  font-weight: 900;
  cursor: pointer;
}

.download-receipt-button:hover {
  filter: brightness(1.07);
}

@media (max-width: 640px) {
  .history-format-totals {
    grid-template-columns: 1fr;
  }

  .weekly-close {
    align-items: stretch;
    flex-direction: column;
  }

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

  .loan-group-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .loan-group-part,
  .loan-group-summary {
    grid-template-columns: 1fr;
  }

  .payment-history-item {
    grid-template-columns: 1fr !important;
  }
}

.payment-agent-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}

.payment-agent-top,
.payment-flow {
  display: grid;
  gap: 10px;
}

.payment-agent-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 12px;
}

.payment-agent-top span,
.payment-flow span,
.payment-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.payment-agent-top strong,
.payment-flow strong,
.payment-total strong {
  display: block;
  margin-top: 4px;
}

.payment-agent-top > div:first-child strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.payment-total {
  min-width: 150px;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--red);
  color: #fff;
  text-align: right;
}

.payment-total span,
.payment-total strong {
  color: #fff;
}

.payment-total strong {
  font-size: 20px;
}

.seller-role-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.seller-role-total {
  border: 1px solid rgba(224, 179, 79, 0.45);
  border-radius: 12px;
  padding: 10px;
  background: rgba(224, 179, 79, 0.12);
}

.seller-role-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.seller-role-total strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 16px;
}

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

.payment-flow div {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8f9fb;
}

.payment-flow strong {
  font-size: 16px;
}

.payment-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.payment-history-title,
.payment-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.payment-history-title {
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--red-soft);
}

.payment-history-title strong,
.payment-history-title span {
  display: block;
}

.payment-history-title strong {
  color: var(--red);
  font-size: 14px;
}

.payment-history-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-history-item {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.payment-history-item span,
.payment-history-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.payment-history-item strong {
  display: block;
}

.payment-history-item > div strong {
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.payment-history-item > strong {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 17px;
  text-align: right;
}

.inline-form input:first-child {
  flex: 1;
}

.inline-form input:nth-child(2) {
  width: 110px;
}

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

.agent-row {
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.agent-row strong,
.agent-row span {
  display: block;
}

.agent-row button,
.delete-sale {
  background: #fff1f0;
  color: var(--red);
  border: 1px solid #ffd1cc;
  border-radius: 8px;
  padding: 7px 9px;
  font-weight: 700;
}

.table-panel {
  min-width: 0;
}

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

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  background: #fff;
}

.compact-table table {
  min-width: 620px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: var(--red);
  color: #fff;
  z-index: 1;
}

td.money {
  text-align: right;
}

.status {
  border-radius: 8px;
  padding: 5px 8px;
  font-weight: 700;
}

.status.pago {
  background: var(--green-soft);
  color: var(--green);
}

.status.pendente {
  background: #fff7e8;
  color: var(--amber);
}

.status.cancelado {
  background: #fff1f0;
  color: var(--red);
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.firm-card-list,
.expense-card-list {
  display: grid;
  gap: 12px;
}

.firm-sale-card,
.firm-expense-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.firm-sale-card {
  padding: 14px;
}

.firm-card-top,
.firm-card-total,
.firm-expense-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.firm-card-top span,
.firm-flow span,
.firm-card-total span,
.firm-expense-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.firm-card-top strong,
.firm-card-total strong,
.firm-expense-card strong {
  display: block;
}

.firm-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.firm-flow div {
  min-height: 72px;
  border-radius: 8px;
  padding: 10px;
  background: var(--canvas);
}

.firm-flow strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.firm-card-total {
  border-radius: 8px;
  padding: 12px;
  background: var(--red-soft);
  color: var(--red);
}

.firm-card-total span {
  color: var(--red);
}

.firm-card-total strong {
  font-size: 20px;
}

.firm-expense-card {
  padding: 12px;
}

.firm-expense-card > strong {
  color: var(--red);
}

.firm-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--canvas);
}

.history-panel {
  max-width: 980px;
}

.history-card-list {
  display: grid;
  gap: 16px;
}

.format-sale-card {
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(214, 169, 79, 0.34);
  border-radius: 8px;
  background: linear-gradient(145deg, #151515, #070707);
  box-shadow: var(--shadow);
}

.sale-modern-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(214, 169, 79, 0.18);
}

.sale-modern-head span,
.sale-modern-people span,
.sale-modern-flow span,
.sale-modern-details span,
.sale-modern-flow small,
.sale-modern-details small {
  display: block;
  color: #d8c89e !important;
}

.sale-modern-head h3 {
  margin: 4px 0;
  color: #fff7df !important;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1;
}

.sale-modern-head strong {
  color: #f2cd73 !important;
  font-size: 16px;
}

.sale-modern-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.sale-modern-people div,
.sale-modern-flow div,
.sale-modern-details div {
  min-width: 0;
  border: 1px solid rgba(214, 169, 79, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.sale-modern-people div {
  padding: 12px;
}

.sale-modern-people strong {
  display: block;
  margin-top: 5px;
  color: #fff7df !important;
  font-size: 18px;
  overflow-wrap: anywhere;
}

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

.sale-modern-flow div {
  min-height: 102px;
  padding: 12px;
}

.sale-modern-flow strong {
  display: block;
  margin: 8px 0 4px;
  color: #fff7df !important;
  font-size: clamp(20px, 3vw, 27px);
  overflow-wrap: anywhere;
}

.sale-modern-flow .sale-modern-firm {
  border-color: rgba(242, 205, 115, 0.45);
  background: linear-gradient(145deg, rgba(214, 169, 79, 0.18), rgba(214, 169, 79, 0.06));
}

.sale-modern-flow .sale-modern-firm strong {
  color: #f2cd73 !important;
}

.sale-modern-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.sale-modern-details div {
  padding: 10px;
}

.sale-modern-details strong {
  display: block;
  margin: 5px 0 2px;
  color: #fff7df !important;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.format-title {
  padding: 10px;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.format-total {
  margin: 8px 10px 0;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
  border: 2px solid var(--red);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
}

.format-total strong {
  color: var(--red);
}

.format-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 12px;
}

.format-meta div {
  min-width: 0;
  border-radius: 8px;
  padding: 8px;
  background: var(--canvas);
}

.format-meta span,
.format-table-row span,
.format-summary span {
  color: var(--muted);
  font-size: 12px;
}

.format-meta strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.format-meta .status {
  align-self: center;
  justify-self: end;
}

.format-table {
  overflow: hidden;
  margin: 0 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.format-table-head,
.format-table-row {
  display: grid;
  grid-template-columns: 1.15fr 1.2fr 0.9fr 1fr;
  align-items: center;
}

.format-table-head {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.format-table-head span,
.format-table-row > * {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--line);
}

.format-table-head span:last-child,
.format-table-row > *:last-child {
  border-right: 0;
}

.format-table-row {
  border-top: 1px solid var(--line);
}

.format-percent,
.format-line-total {
  color: var(--blue);
}

.firm-row {
  background: #f8fafc;
}

.format-summary {
  overflow: hidden;
  margin: 0 24px 16px;
  border: 1px solid #ffd1d1;
  border-radius: 8px;
  background: #fff8f8;
}

.format-summary-title {
  padding: 8px;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.format-summary > div:not(.format-summary-title) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
}

.format-grand-total {
  border-top: 2px solid var(--red);
  font-size: 16px;
}

.history-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 14px;
}

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

  .app-menu {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

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

  .menu-card {
    display: none;
  }

  .summary-grid,
  .expenses-grid,
  .firm-detail-grid,
  .quick-actions,
  .home-hero,
  .home-actions,
  .dashboard-extra,
  .simulation-grid {
    grid-template-columns: 1fr 1fr;
  }

  .primary-metric {
    grid-column: span 1;
  }

  .expenses-grid .table-panel,
  .firm-detail-grid .firm-panel,
  .table-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .app-main {
    padding: 14px 10px 102px;
  }

  .app-menu {
    display: none;
  }

  .mobile-menu {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(31, 31, 31, 0.18);
  }

  .mobile-menu .menu-item {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-height: 58px;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    padding: 7px 3px 6px;
    background: #fff;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
    line-height: 1.05;
    box-shadow: none;
  }

  .mobile-menu .menu-item.active,
  .mobile-menu .menu-item:hover {
    background: var(--red);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(224, 0, 0, 0.24);
  }

  .mobile-menu .menu-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 0;
  }

  .mobile-menu .icon-home-logo {
    border-radius: 50%;
    font-size: 14px;
  }

  .mobile-menu .menu-item.active .menu-icon,
  .mobile-menu .menu-item:hover .menu-icon {
    background: #fff;
    color: var(--red);
  }

  .topbar,
  .topbar-actions,
  .summary-grid,
  .expenses-grid,
  .firm-detail-grid,
  .quick-actions,
  .home-hero,
  .home-actions,
  .dashboard-extra,
  .simulation-grid,
  .form-grid,
  .expense-form,
  .breakdown {
    grid-template-columns: 1fr;
  }

  .home-logo {
    min-height: 132px;
    padding: 18px;
  }

  .home-logo > span {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 30px;
  }

  .home-logo strong {
    font-size: 26px;
  }

  .home-total {
    min-height: 104px;
  }

  .home-total strong {
    font-size: 26px;
  }

  .app-action-card {
    min-height: 96px;
  }

  .feed-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-item strong {
    text-align: left;
  }

  .simulation-result-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .simulation-result-item strong {
    text-align: left;
  }

  .payment-agent-top,
  .payment-flow {
    grid-template-columns: 1fr;
  }

  .payment-total {
    min-width: 0;
    text-align: left;
  }

  .payment-history-title,
  .payment-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-history-item > strong {
    text-align: left;
  }

  .firm-flow {
    grid-template-columns: 1fr;
  }

  .format-meta {
    grid-template-columns: 1fr;
  }

  .sale-modern-head,
  .firm-cash-history-heading,
  .firm-cash-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .sale-modern-people,
  .sale-modern-flow {
    grid-template-columns: 1fr;
  }

  .firm-cash-history-heading > strong,
  .firm-cash-history-item > div:last-child {
    text-align: left;
  }

  .format-meta .status {
    justify-self: start;
  }

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

  .format-table-head,
  .format-table-row {
    min-width: 680px;
  }

  .format-summary {
    margin: 0 12px 14px;
  }

  .format-summary > div:not(.format-summary-title) {
    padding: 9px 12px;
  }

  .format-title {
    font-size: 18px;
  }

  .firm-card-top,
  .firm-card-total,
  .firm-expense-card {
    align-items: flex-start;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
  }

  .topbar {
    display: grid;
  }

  .mini-logo {
    display: grid;
  }

  .topbar-actions {
    display: grid;
  }

  .inline-form {
    display: grid;
  }

  .statement-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .statement-date {
    place-items: start;
    min-height: auto;
    padding: 8px;
  }

  .statement-amount {
    text-align: left;
  }

  .statement-delete {
    width: 100%;
  }

  .inline-form input:nth-child(2) {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }
}

/* Tema preto luxo */
.app-main {
  background:
    radial-gradient(circle at 88% 0%, rgba(214, 169, 79, 0.11), transparent 30%),
    linear-gradient(180deg, #080808 0%, #050505 100%);
}

.topbar,
.panel,
.feed-panel,
.metric,
.primary-metric,
.home-total,
.app-action-card,
.history-card,
.format-sale-card,
.payment-card,
.firm-sale-card,
.firm-expense-card,
.expense-card,
.agent-row,
.login-card {
  border-color: rgba(214, 169, 79, 0.18);
  background: linear-gradient(145deg, #141414, #090909);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.topbar {
  border-bottom-color: rgba(214, 169, 79, 0.42);
}

input,
select,
textarea {
  border-color: rgba(214, 169, 79, 0.18);
  background: #070707;
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(247, 241, 227, 0.42);
}

.feed-item,
.simulation-result-item,
.preview-stack > div,
.format-meta > div,
.format-table-row,
.format-summary,
.line-history-item,
.firm-flow div {
  border-color: rgba(214, 169, 79, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.feed-item.capital,
.metric.capital {
  border-color: rgba(214, 169, 79, 0.34);
  background: rgba(214, 169, 79, 0.13);
}

.feed-item.subtotal,
.format-title,
.format-summary-title,
.format-table-head {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
  border-color: transparent;
}

.format-total,
.format-grand-total,
.firm-card-total {
  border-color: rgba(214, 169, 79, 0.34);
  background: rgba(214, 169, 79, 0.12);
}

.primary-button,
.secondary-button {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
}

.ghost-button {
  border-color: rgba(214, 169, 79, 0.35);
  color: var(--gold-light);
}

.delete-sale,
.agent-row button {
  background: rgba(214, 169, 79, 0.12);
  color: var(--gold-light);
}

.mini-logo {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
}

.breakdown div {
  border-color: rgba(214, 169, 79, 0.3);
  background: linear-gradient(145deg, #171717, #0b0b0b);
  color: var(--ink);
}

.breakdown span {
  color: #cfc3a8;
}

.breakdown strong {
  color: var(--gold-light);
  font-weight: 900;
}

/* Correcoes globais de contraste no tema preto */
.panel-heading span,
label,
.metric span,
.primary-metric span,
.feed-item span,
.home-total span,
.app-action-card small,
.simulation-result-item span,
.statement-main span,
.statement-amount span,
.payment-agent-top span,
.payment-flow span,
.payment-total span,
.payment-history-title span,
.payment-history-item span,
.firm-card-top span,
.firm-flow span,
.firm-card-total span,
.firm-expense-card span,
.format-meta span,
.format-summary span,
.format-table-row span,
.agent-row span,
.empty-state,
.eyebrow {
  color: #cfc3a8;
}

.metric strong,
.primary-metric strong,
.feed-item strong,
.home-total strong,
.simulation-result-item strong,
.statement-main strong,
.statement-amount strong,
.payment-agent-top strong,
.payment-flow strong,
.payment-total strong,
.payment-history-title strong,
.payment-history-item strong,
.firm-card-top strong,
.firm-flow strong,
.firm-card-total strong,
.firm-expense-card strong,
.format-meta strong,
.format-summary strong,
.format-table-row strong,
.agent-row strong {
  color: #fff7df;
}

.feed-item.capital strong,
.metric.capital strong,
.home-total strong,
.statement-amount strong,
.payment-history-item > strong,
.firm-expense-card > strong,
.format-line-total,
.format-percent {
  color: var(--gold-light);
}

.feed-item.subtotal span,
.feed-item.subtotal strong,
.format-title,
.format-summary-title,
.format-table-head,
.format-table-head span,
.primary-button,
.secondary-button,
.app-action-card.primary-action,
.app-action-card.primary-action strong,
.app-action-card.primary-action small {
  color: #080808;
}

.statement-item,
.payment-history-item,
.payment-flow div,
.firm-flow div,
.format-meta > div,
.format-table-row,
.format-summary,
.simulation-result-item,
.feed-item,
.preview-stack > div {
  border-color: rgba(214, 169, 79, 0.2);
  background: rgba(255, 255, 255, 0.055);
}

.statement-item:hover,
.payment-history-item:hover,
.format-table-row:hover,
.feed-item:hover,
.simulation-result-item:hover {
  background: rgba(214, 169, 79, 0.09);
}

input,
select,
textarea {
  color: #fff7df;
}

option {
  background: #080808;
  color: #fff7df;
}

table,
td,
.firm-row,
.format-meta div {
  background: #0b0b0b;
  color: #fff7df;
}

th,
.format-table-head,
.format-title,
.format-summary-title {
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  color: #080808;
}

td,
th,
.format-table-head span,
.format-table-row > * {
  border-color: rgba(214, 169, 79, 0.18);
}

.status.pago {
  background: rgba(15, 122, 85, 0.18);
  color: #7df0be;
}

.status.pendente {
  background: rgba(214, 169, 79, 0.16);
  color: var(--gold-light);
}

.status.cancelado {
  background: rgba(255, 91, 91, 0.16);
  color: #ff9c9c;
}

.format-total {
  background: rgba(214, 169, 79, 0.12);
  color: #fff7df;
}

.format-total strong,
.format-grand-total strong,
.firm-card-total strong {
  color: var(--gold-light);
}

.feed-heading span,
.panel-heading span {
  background: rgba(214, 169, 79, 0.14);
  color: var(--gold-light);
}

.agent-row button,
.delete-sale,
.statement-delete {
  border-color: rgba(214, 169, 79, 0.28);
  background: rgba(214, 169, 79, 0.12);
  color: var(--gold-light);
}

.table-wrap {
  border-color: rgba(214, 169, 79, 0.2);
}

/* Ajuste forte de legibilidade para todas as telas */
.summary-grid .metric,
.compact-summary .metric,
[data-view="linePayments"] .metric,
[data-view="firmCommission"] .metric,
.payment-card,
.payment-agent-card,
.payment-flow div,
.payment-history,
.payment-history-title,
.payment-history-item,
.statement-item,
.firm-sale-card,
.firm-expense-card,
.format-sale-card,
.simulation-result-item,
.feed-item {
  border-color: rgba(214, 169, 79, 0.32) !important;
  background: linear-gradient(145deg, #171717, #090909) !important;
  color: #fff7df !important;
}

.summary-grid .metric span,
.compact-summary .metric span,
[data-view="linePayments"] .metric span,
[data-view="firmCommission"] .metric span,
.payment-card span,
.payment-card small,
.payment-history span,
.payment-history small,
.payment-history-item span,
.payment-history-item small,
.statement-item span,
.firm-sale-card span,
.firm-expense-card span,
.format-sale-card span,
.simulation-result-item span,
.feed-item span {
  color: #e8d7ad !important;
}

.summary-grid .metric strong,
.compact-summary .metric strong,
[data-view="linePayments"] .metric strong,
[data-view="firmCommission"] .metric strong,
.payment-card strong,
.payment-history strong,
.payment-history-item strong,
.statement-item strong,
.firm-sale-card strong,
.firm-expense-card strong,
.format-sale-card strong,
.simulation-result-item strong,
.feed-item strong {
  color: #fff7df !important;
}

[data-view="linePayments"] .metric strong,
.payment-history-item > strong,
.payment-total strong,
.payment-flow strong,
.firm-card-total strong,
.format-total strong,
.format-summary strong,
.feed-item.capital strong {
  color: #f2d28b !important;
}

.payment-history-title {
  border-bottom: 1px solid rgba(214, 169, 79, 0.28) !important;
}

/* Remove partes brancas do app inteiro */
body,
.bank-app,
.app-main,
.app-view,
.panel,
.topbar,
.login-card,
.home-total,
.feed-panel,
.app-action-card,
.metric,
.primary-metric,
.breakdown div,
.simulation-result-item,
.statement-item,
.payment-card,
.payment-history,
.payment-history-title,
.payment-history-item,
.agent-row,
.table-wrap,
table,
thead,
tbody,
tr,
td,
.firm-sale-card,
.firm-expense-card,
.firm-flow div,
.firm-card-total,
.format-sale-card,
.format-total,
.format-meta div,
.format-table,
.format-table-row,
.format-summary,
.format-grand-total,
.history-card,
.expense-card,
.line-history-item,
.preview-stack > div,
.feed-item {
  background-color: #090909 !important;
  background-image: linear-gradient(145deg, #171717, #080808) !important;
  color: #fff7df !important;
}

input,
select,
textarea {
  background-color: #050505 !important;
  background-image: none !important;
  color: #fff7df !important;
  border-color: rgba(214, 169, 79, 0.35) !important;
}

.format-table-head,
.format-title,
.format-summary-title,
th,
.primary-button,
.secondary-button,
.feed-item.subtotal {
  background-color: var(--gold) !important;
  background-image: linear-gradient(145deg, var(--gold-light), var(--gold)) !important;
  color: #080808 !important;
}

.format-table-head *,
.format-title *,
.format-summary-title *,
th *,
.primary-button *,
.secondary-button *,
.feed-item.subtotal * {
  color: #080808 !important;
}

span,
small,
label,
p {
  color: #d8c89e;
}

strong,
h1,
h2 {
  color: #fff7df;
}

.metric strong,
.breakdown strong,
.simulation-result-item strong,
.statement-amount strong,
.payment-agent-card strong,
.payment-flow strong,
.payment-history-item > strong,
.payment-total strong,
.firm-card-total strong,
.format-total strong,
.format-summary strong,
.feed-item strong {
  color: var(--gold-light) !important;
}

.payment-agent-card,
.payment-agent-card *,
.payment-flow div,
.payment-history,
.payment-history-title,
.payment-history-item {
  border-color: rgba(214, 169, 79, 0.32) !important;
}

.payment-agent-card,
.payment-flow div,
.payment-history-item,
.seller-role-total {
  background: linear-gradient(145deg, #171717, #080808) !important;
}

.payment-agent-card span,
.payment-agent-card small,
.payment-flow span,
.payment-history span,
.payment-history small,
.seller-role-total span {
  color: #d8c89e !important;
}

.seller-role-total strong {
  color: var(--gold-light) !important;
}

/* Contraste do total do vendedor sobre o card dourado */
[data-view="linePayments"] .payment-total {
  background: linear-gradient(145deg, #efca70, #d7a63f) !important;
  border-color: #f2d28b !important;
}

[data-view="linePayments"] .payment-total span {
  color: #3b2a0a !important;
  font-weight: 800;
}

[data-view="linePayments"] .payment-total strong {
  color: #090909 !important;
  font-weight: 900;
  opacity: 1 !important;
  text-shadow: none !important;
}

.install-app-button {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(214, 169, 79, 0.65);
  border-radius: 6px;
  background: #111;
  color: #f2cd73;
  font-weight: 900;
  cursor: pointer;
}

/* Acao principal do inicio */
.home-actions .app-action-card.primary-action {
  background-color: #d8aa48 !important;
  background-image: linear-gradient(145deg, #f2d27f, #d7a63f) !important;
  border-color: #f2d28b !important;
  color: #090909 !important;
  opacity: 1 !important;
}

.home-actions .app-action-card.primary-action strong {
  color: #090909 !important;
  font-weight: 900;
}

.home-actions .app-action-card.primary-action small {
  color: #493409 !important;
  font-weight: 700;
}

.home-actions .app-action-card.primary-action:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Menu mobile dourado com contraste alto */
@media (max-width: 720px) {
  .mobile-menu {
    border-color: rgba(226, 183, 81, 0.55) !important;
    background: #090909 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48) !important;
  }

  .mobile-menu .menu-item {
    border-color: #f3d584 !important;
    background-color: #ddb04e !important;
    background-image: linear-gradient(145deg, #f5d982, #d7a43d) !important;
    color: #241a08 !important;
    font-weight: 800;
  }

  .mobile-menu .menu-item > span:last-child,
  .mobile-menu .menu-item.active > span:last-child,
  .mobile-menu .menu-item:hover > span:last-child {
    color: #050505 !important;
    font-weight: 900 !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }

  .mobile-menu .menu-icon {
    background: #111 !important;
    color: #efc75f !important;
    box-shadow: inset 0 0 0 1px rgba(255, 223, 135, 0.16);
  }

  .mobile-menu .menu-item.active,
  .mobile-menu .menu-item:hover {
    border-color: #fff0b3 !important;
    background-color: #f0c65e !important;
    background-image: linear-gradient(145deg, #ffe596, #e1ad3f) !important;
    color: #090909 !important;
    box-shadow: 0 10px 22px rgba(215, 164, 61, 0.38) !important;
  }

  .mobile-menu .menu-item.active .menu-icon,
  .mobile-menu .menu-item:hover .menu-icon {
    background: #090909 !important;
    color: #ffe087 !important;
  }

  .mobile-menu {
    display: flex !important;
    overflow-x: auto;
  }

  .mobile-menu .menu-item {
    flex: 0 0 78px;
  }
}

/* Versao celular com experiencia de aplicativo */
@media (max-width: 720px) {
  html {
    min-height: 100%;
    background: #050505;
  }

  body {
    min-height: 100%;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 50% -10%, rgba(242, 205, 115, 0.23), transparent 30%),
      linear-gradient(180deg, #050505 0%, #0d0d0d 44%, #030303 100%) !important;
  }

  .bank-app {
    display: block !important;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
  }

  .app-menu {
    display: none !important;
  }

  .app-main {
    min-height: 100dvh;
    padding: 0 10px calc(98px + env(safe-area-inset-bottom)) !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    margin: 0 -10px 12px;
    padding: 10px 14px;
    border: 0 !important;
    border-bottom: 1px solid rgba(242, 205, 115, 0.22) !important;
    border-radius: 0 0 24px 24px;
    background:
      linear-gradient(135deg, rgba(242, 205, 115, 0.15), transparent 42%),
      rgba(5, 5, 5, 0.96) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
  }

  .topbar-brand {
    min-width: 0;
  }

  .mini-logo {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(145deg, #f7da82, #d6a94f) !important;
    color: #050505 !important;
    font-size: 21px;
    box-shadow: 0 10px 24px rgba(214, 169, 79, 0.25);
  }

  .topbar h1 {
    margin: 0;
    color: #fff8df !important;
    font-size: 22px;
    line-height: 1;
  }

  .eyebrow {
    margin: 0 0 2px;
    color: #cbb989 !important;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .topbar-actions .secondary-button,
  .topbar-actions #resetDemoBtn,
  .topbar-actions #undoResetBtn {
    display: none !important;
  }

  .topbar-actions .ghost-button {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.07) !important;
    color: #f3d37b !important;
    font-size: 12px;
  }

  .home-hero {
    margin: 10px 0 12px !important;
    padding: 16px !important;
    border: 1px solid rgba(242, 205, 115, 0.34) !important;
    border-radius: 24px !important;
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.24)),
      url("./lion-real.png") center / cover !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  }

  .home-logo {
    min-height: 86px;
    border-radius: 22px !important;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.2)) !important;
  }

  .home-logo span {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    font-size: 23px;
  }

  .home-logo strong {
    font-size: 27px;
    line-height: 1;
  }

  .home-total {
    margin-top: 12px;
    border-radius: 20px !important;
    padding: 15px !important;
    background: rgba(0, 0, 0, 0.72) !important;
  }

  .home-total strong {
    font-size: 27px;
  }

  .home-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 0 0 12px !important;
  }

  .app-action-card {
    min-height: 112px !important;
    align-items: flex-start !important;
    border-radius: 22px !important;
    padding: 14px !important;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
      #101010 !important;
    box-shadow: inset 0 0 0 1px rgba(242, 205, 115, 0.16) !important;
  }

  .app-action-card.primary-action {
    grid-column: 1 / -1;
    min-height: 116px !important;
    background: linear-gradient(145deg, #f5d372, #d7a94d) !important;
    color: #070707 !important;
  }

  .app-action-card .action-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }

  .app-action-card strong {
    margin-top: 10px;
    color: inherit !important;
    font-size: 17px !important;
    line-height: 1.08;
  }

  .app-action-card small {
    margin-top: 5px;
    color: #d8c79d !important;
    font-size: 12px !important;
    line-height: 1.25;
  }

  .app-action-card.primary-action small {
    color: rgba(0, 0, 0, 0.72) !important;
  }

  .feed-panel,
  .weekly-report,
  .summary-grid,
  .panel,
  .firm-panel,
  .payment-agent-card,
  .format-sale-card {
    border-radius: 22px !important;
    background: linear-gradient(145deg, #121212, #080808) !important;
    box-shadow: inset 0 0 0 1px rgba(242, 205, 115, 0.18) !important;
  }

  .feed-panel {
    padding: 14px !important;
  }

  .feed-list {
    gap: 9px !important;
  }

  .feed-item {
    min-height: 72px;
    border-radius: 16px !important;
    padding: 12px !important;
    background: rgba(255, 255, 255, 0.035) !important;
  }

  .feed-item strong {
    margin-top: 6px;
    font-size: 20px;
  }

  .feed-item.subtotal {
    background: linear-gradient(145deg, #f5d372, #d7a94d) !important;
  }

  .dashboard-extra {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .quick-card,
  .metric,
  .weekly-report-totals article {
    border-radius: 18px !important;
  }

  .quick-card {
    min-height: 86px !important;
    justify-content: center;
    padding: 14px !important;
    background: linear-gradient(145deg, #171717, #090909) !important;
  }

  .mobile-menu {
    position: fixed !important;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 30;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    overflow: visible !important;
    padding: 10px !important;
    border: 1px solid rgba(242, 205, 115, 0.32) !important;
    border-radius: 24px !important;
    background: rgba(5, 5, 5, 0.92) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(18px);
  }

  .mobile-menu .menu-item {
    display: grid !important;
    grid-template-rows: 34px auto;
    gap: 4px;
    min-width: 0;
    min-height: 60px;
    justify-items: center;
    border: 0 !important;
    border-radius: 17px !important;
    padding: 7px 4px 6px !important;
    background: transparent !important;
    color: #f6d779 !important;
    box-shadow: none !important;
    text-align: center;
    flex: initial !important;
  }

  .mobile-menu .menu-item:nth-child(n + 6) {
    display: none !important;
  }

  .mobile-menu .menu-item.active,
  .mobile-menu .menu-item:hover {
    background: linear-gradient(145deg, #f5d372, #d7a94d) !important;
    color: #050505 !important;
    transform: none !important;
  }

  .mobile-menu .menu-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 13px !important;
    background: #070707 !important;
    color: #f5d372 !important;
  }

  .mobile-menu .menu-item.active .menu-icon,
  .mobile-menu .menu-item:hover .menu-icon {
    background: #050505 !important;
    color: #f5d372 !important;
  }

  .mobile-menu .menu-item > span:last-child {
    display: block;
    width: 100%;
    color: inherit !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    line-height: 1.05;
    white-space: normal;
  }

  .mobile-menu .menu-item[data-view-target="sale"] {
    transform: translateY(-18px) !important;
    background: linear-gradient(145deg, #f8dd82, #d7a94d) !important;
    color: #050505 !important;
    box-shadow: 0 14px 24px rgba(214, 169, 79, 0.24) !important;
  }

  .mobile-menu .menu-item[data-view-target="sale"] .menu-icon {
    background: #050505 !important;
    color: #f8dd82 !important;
  }
}

/* Etapa 1 - arquitetura visual premium tipo app bancario */
.menu-overlay,
.menu-close-button,
.hamburger-button {
  display: none;
}

.bank-app {
  grid-template-columns: 288px minmax(0, 1fr);
}

.app-menu {
  border-right: 1px solid rgba(242, 205, 115, 0.16);
  background:
    linear-gradient(150deg, rgba(242, 205, 115, 0.13), transparent 28%),
    linear-gradient(180deg, #111 0%, #070707 52%, #000 100%) !important;
  box-shadow: 22px 0 60px rgba(0, 0, 0, 0.32);
}

.brand-block {
  align-items: center;
  min-height: 74px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(242, 205, 115, 0.12);
}

.brand-mark {
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 20%, #fff0b8, transparent 28%),
    linear-gradient(145deg, #f5d372, #d6a94f) !important;
}

.brand-block strong {
  color: #fff8df;
  font-size: 20px;
}

.brand-block span {
  color: #c9b987;
  font-size: 12px;
  font-weight: 800;
}

.menu-section-title {
  margin: 10px 4px 2px;
  color: #8f805b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.menu-list {
  gap: 7px;
  overflow-y: auto;
  padding-right: 2px;
}

.menu-item {
  min-height: 46px;
  border-color: transparent !important;
  border-radius: 14px !important;
  background: transparent !important;
  color: #d9ceb0 !important;
  box-shadow: none !important;
}

.menu-item span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-copy {
  display: block;
  min-width: 0;
}

.menu-copy strong {
  display: block;
  font: inherit;
  color: inherit;
}

.menu-copy small {
  display: none;
}

.menu-item.active,
.menu-item:hover {
  background: linear-gradient(145deg, rgba(242, 205, 115, 0.18), rgba(242, 205, 115, 0.06)) !important;
  color: #fff7df !important;
  transform: none !important;
  box-shadow: inset 0 0 0 1px rgba(242, 205, 115, 0.22) !important;
}

.menu-item.active::before,
.menu-item:hover::before {
  content: "";
  position: absolute;
  left: -3px;
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe596, #d6a94f);
}

.menu-icon {
  border-radius: 13px !important;
  background: rgba(242, 205, 115, 0.1) !important;
  color: #e7c56b !important;
}

.menu-item.active .menu-icon,
.menu-item:hover .menu-icon {
  background: linear-gradient(145deg, #f5d372, #d6a94f) !important;
  color: #050505 !important;
}

.menu-logout {
  margin-top: 8px;
  color: #ffb7b7 !important;
}

.menu-card {
  border: 1px solid rgba(242, 205, 115, 0.2);
  border-radius: 20px;
  padding: 15px;
  background:
    linear-gradient(145deg, rgba(242, 205, 115, 0.12), rgba(255, 255, 255, 0.035)),
    #090909;
}

.menu-card span {
  color: #cbbb8c;
  font-weight: 800;
}

.menu-card strong {
  margin-top: 6px;
  color: #fff3cd;
  font-size: 22px;
}

.hamburger-button {
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(242, 205, 115, 0.24);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
}

.hamburger-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px 0;
  border-radius: 999px;
  background: #f5d372;
}

@media (max-width: 720px) {
  .bank-app {
    display: block !important;
    min-height: 100dvh;
  }

  .hamburger-button,
  .menu-close-button {
    display: inline-flex;
  }

  .app-menu {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(86vw, 342px);
    height: 100dvh;
    grid-template-rows: auto 1fr auto;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-104%);
    transition: transform 0.24s ease;
  }

  .bank-app.menu-open .app-menu {
    transform: translateX(0);
  }

  .menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background 0.22s ease;
  }

  .bank-app.menu-open .menu-overlay {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.64);
    backdrop-filter: blur(7px);
  }

  .menu-close-button {
    margin-left: auto;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(242, 205, 115, 0.26);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #f5d372;
    font-weight: 900;
  }

  .app-main {
    padding: 0 10px calc(24px + env(safe-area-inset-bottom)) !important;
  }

  .topbar {
    border-radius: 0 0 22px 22px !important;
  }

  .topbar-brand {
    gap: 8px;
  }

  .mobile-menu {
    display: none !important;
  }

  .home-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .app-action-card.primary-action {
    grid-column: 1 / -1;
  }

  .dashboard-extra {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Correcao mobile: menu visivel em iPhone/Android vertical */
@media (max-width: 767.98px) {
  body.menu-lock {
    overflow: hidden;
    touch-action: none;
  }

  .bank-app {
    display: block !important;
    min-height: 100dvh !important;
    padding-top: env(safe-area-inset-top);
  }

  .hamburger-button {
    display: inline-flex !important;
    flex: 0 0 42px;
  }

  .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 35 !important;
  }

  .app-menu {
    position: fixed !important;
    inset: 0 !important;
    z-index: 80 !important;
    display: grid !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    gap: 14px !important;
    overflow: hidden !important;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)) !important;
    border-right: 0 !important;
    background:
      radial-gradient(circle at 20% 0%, rgba(242, 205, 115, 0.18), transparent 32%),
      linear-gradient(180deg, #101010 0%, #060606 100%) !important;
    transform: translateX(-104%) !important;
    transition: transform 0.24s ease !important;
  }

  .bank-app.menu-open .app-menu {
    transform: translateX(0) !important;
  }

  .menu-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 70 !important;
    display: block !important;
    pointer-events: none;
    background: transparent;
  }

  .bank-app.menu-open .menu-overlay {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.58);
  }

  .brand-block {
    min-height: auto !important;
    padding: 0 0 14px !important;
  }

  .menu-close-button {
    display: inline-flex !important;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(242, 205, 115, 0.32);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #f5d372;
    font-size: 15px;
    font-weight: 900;
  }

  .mobile-user-card {
    display: grid !important;
    gap: 3px;
    border: 1px solid rgba(242, 205, 115, 0.18);
    border-radius: 18px;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.045);
  }

  .mobile-user-card span,
  .mobile-user-card small {
    color: #cbbb8c;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-user-card strong {
    color: #fff7df;
    font-size: 18px;
  }

  .menu-list {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
    gap: 9px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 2px 2px calc(24px + env(safe-area-inset-bottom)) !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .menu-item {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 56px !important;
    padding: 12px 42px 12px 14px !important;
    gap: 12px !important;
    border: 1px solid rgba(242, 205, 115, 0.12) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    font-size: 15px;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  .menu-item::after {
    content: ">";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(245, 211, 114, 0.66);
    font-size: 16px;
    font-weight: 900;
  }

  .menu-item.active,
  .menu-item:hover,
  .menu-item:focus-visible {
    border-color: rgba(242, 205, 115, 0.32) !important;
    background: linear-gradient(145deg, rgba(242, 205, 115, 0.20), rgba(242, 205, 115, 0.07)) !important;
    color: #fff8df !important;
  }

  .menu-item.active::before,
  .menu-item:hover::before,
  .menu-item:focus-visible::before {
    left: 0 !important;
    height: 30px !important;
  }

  .menu-item:focus-visible,
  .menu-close-button:focus-visible,
  .hamburger-button:focus-visible {
    outline: 2px solid rgba(245, 211, 114, 0.8) !important;
    outline-offset: 3px !important;
  }

  .menu-icon {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
  }

  .menu-copy {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: grid !important;
    gap: 3px !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  .menu-copy strong {
    display: block !important;
    color: inherit !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1.18 !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
  }

  .menu-copy small {
    display: block !important;
    color: #b8ac88 !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    line-height: 1.22 !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
  }

  .menu-item span:last-child,
  .menu-item strong,
  .menu-item small {
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
  }

  .menu-section-title {
    display: block !important;
    margin: 13px 4px 2px !important;
    color: #d6bd72 !important;
    font-size: 11px !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
  }

  .mobile-menu {
    display: none !important;
  }
}

@media (min-width: 600px) and (max-width: 767.98px) {
  .menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .menu-section-title {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) {
  .mobile-user-card {
    display: none !important;
  }
}

/* Etapa 4 - dashboard bancario: capital em destaque */
.capital-overview {
  display: grid;
  gap: 16px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(242, 205, 115, 0.2);
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(242, 205, 115, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    #0d0d0d;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.capital-overview-main {
  display: grid;
  gap: 6px;
}

.capital-overview-main span,
.capital-overview-grid span {
  color: #d7c89a;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.capital-overview-main strong {
  color: #fff8df;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.capital-overview-main small {
  color: #a99f8e;
  font-size: 13px;
  font-weight: 750;
}

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

.capital-overview-grid article {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(242, 205, 115, 0.16);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
}

.capital-overview-grid strong {
  color: #f7d87f;
  font-size: 20px;
  line-height: 1.1;
}

.capital-overview-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.capital-overview-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6a94f, #fff0a8);
  transition: width 0.35s ease;
}

@media (max-width: 767.98px) {
  .app-main {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 180px),
      #050505 !important;
  }

  .topbar {
    min-height: 64px !important;
  }

  .topbar h1 {
    font-size: 20px !important;
  }

  .home-hero {
    min-height: 178px;
    display: grid;
    align-content: end;
  }

  .home-logo {
    min-height: 74px !important;
  }

  .home-logo strong {
    font-size: 24px !important;
  }

  .home-total {
    display: grid;
    gap: 6px;
  }

  .capital-overview {
    gap: 14px;
    margin: 0 0 12px;
    padding: 16px;
    border-radius: 24px;
    background:
      radial-gradient(circle at 18% 0%, rgba(242, 205, 115, 0.2), transparent 34%),
      linear-gradient(145deg, #141414, #090909) !important;
  }

  .capital-overview-main strong {
    font-size: 36px;
  }

  .capital-overview-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .capital-overview-grid article {
    min-height: 68px;
    grid-template-columns: 1fr auto;
    align-items: center;
    align-content: center;
    padding: 12px 14px;
  }

  .capital-overview-grid span {
    font-size: 11px;
  }

  .capital-overview-grid strong {
    font-size: 18px;
    text-align: right;
  }

  .home-actions {
    grid-template-columns: 1fr !important;
  }

  .app-action-card,
  .app-action-card.primary-action {
    min-height: 88px !important;
    display: grid !important;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center !important;
  }

  .app-action-card .action-icon {
    grid-row: 1 / 3;
  }

  .app-action-card strong,
  .app-action-card small {
    margin-top: 0 !important;
  }

  .feed-panel,
  .weekly-report,
  .summary-grid {
    margin-bottom: 12px;
  }
}

/* Etapa 5 - registro de venda em formato app bancario */
.sale-operation-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(242, 205, 115, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(242, 205, 115, 0.16), transparent 42%),
    linear-gradient(145deg, #141414, #080808);
}

.sale-operation-hero span,
.sale-operation-hero small {
  display: block;
  color: #cdbd8e;
  font-weight: 800;
}

.sale-operation-hero span {
  margin-bottom: 7px;
  font-size: 12px;
  text-transform: uppercase;
}

.sale-operation-hero strong {
  display: block;
  color: #fff8df;
  font-size: 28px;
  line-height: 1;
}

.sale-operation-hero small {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.3;
}

.sale-operation-total {
  min-width: 220px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(145deg, #f5d372, #d7a94d);
  color: #050505;
  text-align: right;
}

.sale-operation-total span,
.sale-operation-total strong {
  color: #050505 !important;
}

.sale-operation-total strong {
  font-size: 27px;
}

@media (max-width: 767.98px) {
  [data-view="sale"] .sale-panel {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .sale-operation-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 4px 0 12px;
    padding: 16px;
    border-radius: 24px;
  }

  .sale-operation-hero strong {
    font-size: 25px;
  }

  .sale-operation-total {
    min-width: 0;
    text-align: left;
  }

  .sale-operation-total strong {
    font-size: 31px;
  }

  [data-view="sale"] .panel-heading {
    align-items: start;
    margin: 0 0 10px;
    padding: 0 2px;
  }

  [data-view="sale"] .panel-heading h2 {
    font-size: 18px;
  }

  [data-view="sale"] .panel-heading > span {
    display: none;
  }

  [data-view="sale"] .form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  [data-view="sale"] label {
    gap: 8px;
    padding: 13px;
    border: 1px solid rgba(242, 205, 115, 0.16);
    border-radius: 18px;
    background: linear-gradient(145deg, #131313, #080808);
    color: #f5d372 !important;
  }

  [data-view="sale"] label small {
    color: #b8a978 !important;
    font-size: 12px;
    line-height: 1.25;
  }

  [data-view="sale"] input,
  [data-view="sale"] select {
    min-height: 52px;
    border-radius: 15px !important;
    padding: 12px 13px !important;
    font-size: 16px;
    font-weight: 850;
  }

  #saleAmount {
    font-size: 22px;
  }

  [data-view="sale"] .breakdown {
    grid-template-columns: 1fr !important;
    gap: 9px;
    margin: 12px 0;
  }

  [data-view="sale"] .breakdown div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    border-radius: 18px !important;
    padding: 12px 14px !important;
  }

  [data-view="sale"] .breakdown span {
    font-size: 12px;
    font-weight: 850;
  }

  [data-view="sale"] .breakdown strong {
    margin-top: 0;
    font-size: 18px;
    text-align: right;
  }

  [data-view="sale"] .primary-button[type="submit"] {
    width: 100%;
    min-height: 58px;
    margin-top: 10px;
    border-radius: 18px !important;
    font-size: 17px;
    font-weight: 950;
  }

  .firm-receipt-actions {
    display: grid;
    gap: 14px;
    border-radius: 22px;
    padding: 15px;
  }

  .firm-receipt-actions > div:last-child {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .firm-receipt-actions button {
    width: 100%;
    min-height: 52px;
    border-radius: 16px !important;
  }

  .receipt-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .receipt-dialog-card {
    max-height: calc(100dvh - 16px);
  }

  .receipt-dialog-heading,
  .receipt-dialog-actions {
    padding: 13px;
  }

  .receipt-dialog-heading strong {
    font-size: 16px;
  }

  .receipt-preview-frame {
    padding: 10px;
  }

  .receipt-preview-frame img {
    width: 980px;
    max-width: none;
  }

  .receipt-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .receipt-dialog-actions button {
    width: 100%;
    min-height: 52px;
  }

  .expense-hero {
    display: grid;
    gap: 14px;
    margin: 4px 0 12px;
    padding: 16px;
    border-radius: 24px;
  }

  .expense-hero strong {
    font-size: 25px;
  }

  .expense-hero-action {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
  }

  .expense-overview {
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }

  .expense-overview .metric {
    min-height: 82px;
    border-radius: 18px !important;
  }

  .expenses-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

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

  .expense-form label {
    gap: 8px;
    padding: 13px;
    border: 1px solid rgba(242, 205, 115, 0.16);
    border-radius: 18px;
    background: linear-gradient(145deg, #131313, #080808);
  }

  .expense-form input {
    min-height: 52px;
    border-radius: 15px !important;
    padding: 12px 13px !important;
    font-size: 16px;
    font-weight: 850;
  }

  #expenseAmount {
    font-size: 20px;
  }

  .expense-form button {
    min-height: 54px;
    border-radius: 17px !important;
  }

  .bank-statement {
    gap: 10px;
  }

  .statement-item {
    grid-template-columns: 1fr !important;
    gap: 10px;
    min-height: 0;
    border-radius: 20px !important;
    padding: 14px !important;
    background: linear-gradient(145deg, #141414, #080808) !important;
  }

  .statement-date,
  .statement-main,
  .statement-amount,
  .pay-expense,
  .expense-paid-badge,
  .statement-delete {
    grid-column: auto !important;
  }

  .statement-date {
    min-height: auto;
    justify-items: start;
    place-items: initial;
    padding: 0;
    background: transparent !important;
    color: #d8c89e !important;
    text-align: left;
  }

  .statement-date small {
    margin-top: 4px;
    color: #9bd9ae !important;
  }

  .statement-main strong {
    font-size: 18px;
  }

  .statement-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }

  .statement-amount strong {
    font-size: 22px;
  }

  .pay-expense,
  .revert-expense,
  .statement-delete,
  .expense-paid-badge {
    width: 100%;
    min-height: 46px;
    border-radius: 14px !important;
  }
}

/* Bloco 1 - acabamento visual completo das telas operacionais */
.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(214, 169, 79, 0.26);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(214, 169, 79, 0.18), transparent 32%),
    linear-gradient(145deg, #151515, #080808);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.page-hero span,
.page-hero small {
  display: block;
  color: #d8c89e;
  font-weight: 800;
}

.page-hero span {
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.page-hero strong {
  color: #fff7df;
  font-size: 30px;
  line-height: 1;
}

.page-hero small {
  margin-top: 8px;
  max-width: 620px;
  font-size: 13px;
  line-height: 1.35;
}

.page-hero-action {
  min-width: 132px;
  min-height: 46px;
  border: 1px solid rgba(214, 169, 79, 0.32);
  border-radius: 999px;
  background: rgba(214, 169, 79, 0.12);
  color: #f4d98f;
  font-weight: 900;
}

.payment-card-list,
.history-card-list,
.firm-sale-card-list,
.expense-card-list,
.firm-work-list,
.settings-agent-list {
  gap: 12px;
}

.payment-agent-card,
.format-sale-card,
.firm-sale-card,
.firm-expense-card,
.firm-work-card,
.agent-row,
.capital-history-item {
  border-radius: 20px !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #101010 !important;
  box-shadow: inset 0 0 0 1px rgba(214, 169, 79, 0.18), 0 16px 34px rgba(0, 0, 0, 0.22) !important;
}

.payment-agent-card {
  padding: 18px !important;
}

.payment-agent-card > div:first-child,
.format-sale-card .sale-modern-head,
.firm-sale-card,
.agent-row {
  align-items: center;
}

.payment-total {
  border-radius: 20px !important;
  background: linear-gradient(145deg, #f5d372, #d7a94d) !important;
}

.payment-total span,
.payment-total strong {
  color: #050505 !important;
}

.payment-history {
  border-radius: 18px !important;
  background: rgba(0, 0, 0, 0.22) !important;
}

.payment-history-item {
  border-radius: 16px !important;
}

.download-receipt-button {
  border-radius: 16px !important;
}

.history-format-totals {
  gap: 10px;
}

.history-format-totals article,
.firm-cash-history-card,
.proof-card,
.weekly-close,
.treasury-panel,
.capital-edit-card,
.capital-history-panel,
.agent-settings-panel,
.settings-panel {
  border-radius: 22px !important;
  background: linear-gradient(145deg, #141414, #080808) !important;
  box-shadow: inset 0 0 0 1px rgba(214, 169, 79, 0.18) !important;
}

.proof-card-total,
.proof-difference,
.firm-cash-history-heading {
  border-radius: 18px !important;
}

.firm-detail-grid,
.settings-layout,
.capital-settings-grid {
  gap: 14px;
}

.firm-allocation-form,
.capital-admin-form,
.agent-form {
  gap: 10px;
}

.firm-allocation-form input,
.firm-allocation-form select,
.capital-admin-form input,
.capital-admin-form textarea,
.agent-form input,
.agent-form select,
.rates-grid input {
  min-height: 48px;
  border-radius: 14px !important;
}

@media (max-width: 767.98px) {
  .page-hero {
    display: grid;
    gap: 14px;
    margin: 4px 0 12px;
    padding: 16px;
    border-radius: 24px;
  }

  .page-hero strong {
    font-size: 25px;
  }

  .page-hero-action {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
  }

  [data-view="linePayments"] .compact-summary,
  [data-view="firmCommission"] .compact-summary,
  .history-format-totals,
  .capital-settings-grid,
  .settings-layout,
  .firm-detail-grid {
    grid-template-columns: 1fr !important;
  }

  [data-view="linePayments"] .metric,
  [data-view="firmCommission"] .metric,
  .history-format-totals article {
    min-height: 78px;
    border-radius: 18px !important;
  }

  .payment-agent-card {
    padding: 14px !important;
  }

  .payment-agent-card > div:first-child {
    display: grid !important;
    gap: 10px;
  }

  .payment-total {
    display: grid;
    gap: 4px;
    min-height: 88px;
    padding: 15px !important;
  }

  .payment-total strong {
    font-size: 28px !important;
  }

  .payment-history {
    padding: 10px !important;
  }

  .payment-history-item {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 12px !important;
  }

  .payment-history-item > strong {
    text-align: left !important;
    font-size: 22px !important;
  }

  .download-receipt-button,
  .payment-agent-card .secondary-button,
  .payment-agent-card button {
    width: 100%;
    min-height: 50px;
    border-radius: 16px !important;
  }

  .history-panel {
    padding: 14px !important;
  }

  .history-panel .panel-heading {
    display: grid !important;
    gap: 12px;
  }

  .history-filters {
    justify-content: stretch !important;
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .history-filters select {
    width: 100%;
    min-height: 50px;
    border-radius: 15px !important;
  }

  .format-sale-card {
    padding: 14px !important;
  }

  .format-sale-card .sale-modern-head,
  .format-sale-card .sale-modern-people,
  .format-sale-card .sale-modern-flow,
  .format-sale-card .sale-modern-details {
    grid-template-columns: 1fr !important;
  }

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

  .format-table-head,
  .format-table-row {
    min-width: 720px;
  }

  .proof-card-list {
    grid-template-columns: 1fr !important;
  }

  .proof-card,
  .firm-cash-history-card,
  .weekly-close,
  .treasury-panel,
  .capital-edit-card,
  .capital-history-panel,
  .agent-settings-panel,
  .settings-panel {
    padding: 14px !important;
  }

  .firm-allocation-form,
  .capital-admin-form,
  .agent-form,
  .rates-grid {
    grid-template-columns: 1fr !important;
  }

  .firm-allocation-form button,
  .capital-admin-form button,
  .agent-form button {
    width: 100%;
    min-height: 52px;
    border-radius: 16px !important;
  }

  .agent-row {
    display: grid !important;
    gap: 12px;
    padding: 13px !important;
  }

  .agent-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .agent-actions button {
    width: 100%;
    min-height: 44px;
    border-radius: 14px !important;
  }
}

/* Prioridade final: refinamento bancario para menu, inicio e edicao */
.app-menu {
  overflow-x: hidden !important;
  box-sizing: border-box;
}

.menu-list,
.menu-item,
.menu-copy {
  min-width: 0;
  box-sizing: border-box;
}

.menu-item {
  width: 100%;
  align-items: center;
}

.menu-copy strong,
.menu-copy small {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.section-heading.full-row {
  grid-column: 1 / -1;
}

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

.capital-overview-grid,
.capital-overview-progress {
  grid-column: 1 / -1;
}

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

.activity-group,
.sale-list-panel,
.edit-change-list {
  border: 1px solid rgba(214, 169, 79, 0.22);
  border-radius: 22px;
  background: linear-gradient(145deg, #141414, #070707);
}

.activity-group {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.activity-group-heading,
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.activity-item {
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.activity-item div {
  display: grid;
  min-width: 0;
}

.activity-item > strong,
.edit-change-row strong {
  color: #f5d372;
}

.activity-group-heading button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: #080808;
  background: linear-gradient(135deg, #f7d77a, #d8aa4f);
  font-weight: 800;
  cursor: pointer;
}

.sale-list-panel {
  margin-top: 18px;
  padding: 16px;
}

.compact-sale-card {
  margin-bottom: 12px;
}

.edit-change-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.edit-change-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.edit-change-row span {
  color: #fff7de;
  font-weight: 800;
}

.edit-change-row small {
  color: rgba(255, 247, 222, 0.58);
}

@media (max-width: 980px) {
  .capital-overview,
  .dashboard-activity-feed {
    grid-template-columns: 1fr !important;
  }

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

.general-history-hero {
  margin-bottom: 18px;
}

.general-history-week-shell {
  margin: 0 0 18px !important;
}

[data-view="generalHistory"] .finance-week-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.4fr);
  align-items: stretch;
  gap: 16px;
}

[data-view="generalHistory"] .finance-week-summary {
  grid-column: 1 / -1;
  justify-items: stretch;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(242, 205, 115, 0.18);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.24);
}

[data-view="generalHistory"] .general-history-actions,
[data-view="generalHistory"] .late-closing-panel {
  grid-column: 1 / -1;
}

[data-view="generalHistory"] .weekly-report {
  margin-top: 18px;
}

@media (max-width: 767.98px) {
  [data-view="generalHistory"] .finance-week-shell {
    grid-template-columns: 1fr;
    padding: 16px !important;
  }

  [data-view="generalHistory"] .finance-week-summary {
    display: grid;
    justify-items: start;
  }

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

  .late-closing-panel {
    grid-template-columns: 1fr;
  }

  .late-closing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
