/* Controles administrativos de bônus principal e rendimento do bônus. */
.adminHistoryCollapse {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(17, 17, 17, .05);
}

.adminHistoryCollapse > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 16px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.adminHistoryCollapse > summary::-webkit-details-marker {
  display: none;
}

.adminHistoryCollapse > summary > div {
  display: grid;
  gap: 4px;
}

.adminHistoryCollapse > summary strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
}

.adminHistoryCollapse > summary small {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.adminHistoryCollapse .historyToggle {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  text-align: center;
  font-size: .76rem;
  font-weight: 900;
}

.adminHistoryCollapse .historyToggle::before {
  content: "Expandir";
}

.adminHistoryCollapse[open] .historyToggle::before {
  content: "Recolher";
}

.adminHistoryCollapse[open] > summary {
  border-bottom: 1px solid var(--line);
}

.adminHistoryCollapse .depositHistoryTable {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.bonusControlPanel {
  align-content: start;
}

.bonusHelp {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.5;
}

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

.bonusBalances .metric {
  min-height: 82px;
  border-color: var(--line);
  background: var(--soft);
}

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

.bonusControlPanel .bonusActions button {
  min-width: 0;
  padding: 10px 12px;
  white-space: normal;
  line-height: 1.25;
}

.yieldDangerButton {
  border: 1px solid var(--red-dark);
  color: #fff;
  background: var(--red-dark);
}

.bonusModalBalance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #ffd6da;
  border-radius: 8px;
  color: var(--red-dark);
  background: #fff4f5;
}

.bonusModalBalance span {
  font-size: .78rem;
  font-weight: 800;
}

.bonusModalBalance strong {
  font-size: 1rem;
}

@media (max-width: 760px) {
  .bonusControlPanel .bonusActions,
  .bonusBalances {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .adminHistoryCollapse > summary {
    align-items: flex-start;
  }

  .adminHistoryCollapse .historyToggle {
    min-width: 78px;
    padding-inline: 9px;
  }
}

/* O aplicativo mantém largura compacta mesmo em telas grandes; os formulários
   administrativos ficam em uma coluna para não comprimir os controles. */
.adminPage .adminFinanceForms {
  grid-template-columns: 1fr !important;
}

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

.bonusControlPanel .yieldDangerButton {
  grid-column: 1 / -1;
}


/* Layout compacto de celular, inclusive no computador. */
html,
body,
#root {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  background: #fff !important;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
}

.appShell {
  width: min(100%, 460px) !important;
  max-width: 460px !important;
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto !important;
  background: #fff !important;
  overflow-x: hidden;
}

.page,
.adminPage,
.adminHome,
.adminHistoryCollapse,
.adminFinanceForms,
.adminInvestorDetails,
.panel,
.list,
.listCard,
.responsiveTable,
.depositHistoryTable {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.page,
.adminPage {
  overflow-x: hidden;
}

.adminPage .adminFinanceForms,
.adminPage .twoCols,
.adminPage .miniGrid,
.bonusBalances,
.bonusControlPanel .bonusActions {
  grid-template-columns: 1fr !important;
}

.bonusControlPanel .yieldDangerButton {
  grid-column: auto !important;
}

.responsiveTable,
.depositHistoryTable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.responsiveTable > *,
.depositHistoryTable > * {
  min-width: 0;
}

input,
select,
textarea,
button {
  max-width: 100%;
  box-sizing: border-box;
}

.adminHistoryCollapse > summary {
  min-width: 0;
}

.adminHistoryCollapse > summary > div {
  min-width: 0;
}

.adminHistoryCollapse > summary strong,
.adminHistoryCollapse > summary small,
.historyItem,
.listCard,
.metric {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 480px) {
  .appShell {
    width: 100% !important;
    max-width: 100% !important;
  }

  .adminHistoryCollapse > summary {
    gap: 8px;
    padding: 12px;
  }
}
