/* Gestor de Cobranças v123 — polimento visual da seção mensal, sem alterar cálculos.
 * O gráfico comparativo .aam53-chart, a lógica financeira e o estado de pagamentos
 * permanecem exatamente como na versão anterior. Não há eixo numérico lateral.
 */
#home .aam-monthly-panel {
  padding: clamp(15px,2.2vw,24px);
  margin: 18px 0 22px;
  border: 1px solid #594567;
  border-radius: 18px;
  background: linear-gradient(145deg,#211927 0%,#1b1721 42%,#19161f 100%);
  box-shadow: none;
}
#home .aam-monthly-header { display: block; }
#home .aam-monthly-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
#home .aam-monthly-emblem {
  display: grid; place-items: center; flex: 0 0 40px;
  width: 40px; height: 40px; color: #dcbc78;
}
#home .aam-monthly-emblem svg { width: 35px; height: 35px; }
#home .aam-monthly-eyebrow {
  margin: 0 0 4px; font-size: .84rem; line-height: 1.2;
  color: #dfbe83; letter-spacing: .105em; font-weight: 750;
}
#home .aam-monthly-subtitle { margin: 0; font-size: .8rem; line-height: 1.45; color: #c5bbcd; }
#home .aam-monthly-header h2.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
#home .aam-monthly-controls {
  display: grid; grid-template-columns: 44px minmax(0, 250px) 44px;
  justify-content: center; align-items: stretch; gap: 10px;
  width: min(100%, 370px); margin: 18px auto 0;
}
#home .aam-monthly-controls button {
  display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 1px solid #685674; background: #231d2b;
  color: #f1ebf4; border-radius: 11px; font-size: 1.5rem;
}
#home .aam-monthly-controls button:hover { border-color: #dcbc78; }
#home .aam-monthly-controls button:focus-visible, #home .aam-monthly-chart-month:focus-visible {
  outline: 2px solid #dfbe83; outline-offset: 3px;
}
#home .aam-monthly-date-field {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 0 10px; background: #231d2b; border: 1px solid #786184;
  border-radius: 11px; position: relative;
}
#home .aam-monthly-date-field::after {
  content: ''; pointer-events: none; width: 7px; height: 7px;
  flex: 0 0 7px; border-right: 1.5px solid #d1c2d7;
  border-bottom: 1.5px solid #d1c2d7; transform: rotate(45deg) translate(-2px,-2px);
}
#home .aam-monthly-date-field input::-webkit-calendar-picker-indicator {
  opacity: 0; position: absolute; right: 0; width: 36px; height: 100%;
  cursor: pointer;
}
#home .aam-monthly-date-field:focus-within { border-color: #dcbc78; }
#home .aam-monthly-date-field>svg { flex: 0 0 18px; width: 18px; height: 18px; color: #dcbc78; }
#home .aam-monthly-controls .aam-monthly-date-field input {
  display: block; min-width: 0; width: 100%; height: 42px; min-height: 42px;
  border: 0; padding: 0; margin: 0; outline: none;
  background: transparent; color: #f5eff7; font-size: .89rem;
  font-weight: 600; color-scheme: dark;
}
#home .aam-monthly-stats { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 20px; }
#home .aam-monthly-stat {
  min-width: 0; padding: 14px 12px 13px;
  border: 1px solid #665068; border-radius: 14px;
  background: #241e2a; border-top: 2px solid #cba663;
}
#home .aam-monthly-stat.expected { border-color: #a9874b; border-top-color: #d7b36d; background: #282127; }
#home .aam-monthly-stat.received { border-color: #40765f; border-top-color: #36a778; background: #202729; }
#home .aam-monthly-stat.total { border-color: #745788; border-top-color: #9472bf; background: #261e30; }
#home .aam-monthly-stat-heading { display: flex; align-items: center; gap: 9px; min-height: 39px; }
#home .aam-monthly-stat .aam-monthly-stat-heading>span:last-child {
  min-width: 0; font-size: .76rem; line-height: 1.3;
  font-weight: 600; color: #ddd4e1;
}
#home .aam-monthly-stat .aam-monthly-stat-icon {
  display: grid; place-items: center; flex: 0 0 26px;
  height: 26px; width: 26px; color: #d7b36d;
}
#home .aam-monthly-stat-icon svg { width: 23px; height: 23px; }
#home .aam-monthly-stat.received .aam-monthly-stat-icon { color: #41bc88; }
#home .aam-monthly-stat.total .aam-monthly-stat-icon { color: #b18bdc; }
#home .aam-monthly-stat>strong {
  display: block; font-size: clamp(1.2rem,2.5vw,1.65rem);
  margin: 11px 0 4px; line-height: 1.24; font-weight: 750;
  white-space: nowrap; overflow-wrap: normal; word-break: normal;
  max-width: 100%; overflow: visible;
}

#home .aam-monthly-stat>small { color: #bdb2c5; font-size: .71rem; line-height: 1.36; margin: 0; }
#home .aam-monthly-chart-shell {
  margin-top: 20px; border-top: 1px solid #3e3347;
  padding: 20px 3px 8px;
}
#home .aam-monthly-visual-head {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 9px; margin: 0 0 15px;
}
#home .aam-monthly-visual-head>strong {
  font-size: .96rem; font-weight: 700; line-height: 1.4; color: #eee7f0;
}
#home .aam-monthly-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .76rem; color: #bdb3c6; }
#home .aam-monthly-legend span { display: inline-flex; align-items: center; gap: 7px; }
#home .aam-monthly-legend span::before { width: 11px; height: 11px; margin: 0; border-radius: 3px; background: #cfad6a; }
#home .aam-monthly-legend span:last-child::before { background: #37af7d; }
#home .aam-monthly-chart {
  position: relative; z-index: 0; padding-top: 4px;
  gap: 2px; isolation: isolate;
}
/* Linhas horizontais discretas, SEM números nem eixo lateral. */
#home .aam-monthly-chart::before {
  content: ''; position: absolute; pointer-events: none;
  inset: 11px 0 28px; z-index: -1;
  background: repeating-linear-gradient(to top,
    transparent 0, transparent 31px, rgba(191,171,205,.11) 32px, transparent 33px);
}
#home .aam-monthly-chart-month {
  grid-template-rows: 146px auto; gap: 6px; padding: 6px 1px 8px;
  border-radius: 10px; position: relative; z-index: 1;
  color: #bdb3c6;
}
#home .aam-monthly-chart-month.selected {
  border-color: #6f538c; background: rgba(130,98,168,.19);
  color: #f6eafc;
}
#home .aam-monthly-chart-bars { height: 146px; gap: 2px; border-bottom: 1px solid #87738c; }
#home .aam-monthly-chart-bars i { width: min(14px,41%); border-radius: 4px 4px 0 0; }
#home .aam-monthly-chart-bars .aam-monthly-expected { background: linear-gradient(to bottom,#e4c079,#bb9250); }
#home .aam-monthly-chart-bars .aam-monthly-received { background: linear-gradient(to bottom,#51c798,#319970); }
#home .aam-monthly-chart-label { font-size: .69rem; line-height: 1.4; }
#home .aam-monthly-info { margin-top: 14px; }
@media (max-width: 700px) {
  #home .aam-monthly-panel { padding: 15px 12px; }
  #home .aam-monthly-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  #home .aam-monthly-stat.total { grid-column: 1/-1; }
  #home .aam-monthly-stat { padding: 12px 11px; }
  #home .aam-monthly-stat>strong { font-size: clamp(1.03rem,4.5vw,1.33rem); }
  #home .aam-monthly-visual-head>strong { font-size: .9rem; }
  #home .aam-monthly-chart-month { grid-template-rows: 118px auto; padding: 6px 0 8px; }
  #home .aam-monthly-chart-bars { height: 118px; gap: 1px; }
  #home .aam-monthly-chart::before { inset: 10px 0 27px; }
  #home .aam-monthly-chart-bars i { width: 42%; border-radius: 3px 3px 0 0; }
  #home .aam-monthly-chart-label { font-size: .64rem; }
}
@media (max-width: 370px) {
  #home .aam-monthly-emblem { flex-basis: 31px; width: 31px; }
  #home .aam-monthly-emblem svg { width: 29px; height: 29px; }
  #home .aam-monthly-eyebrow { font-size: .77rem; }
  #home .aam-monthly-subtitle { font-size: .74rem; }
  #home .aam-monthly-controls { grid-template-columns: 39px minmax(0,1fr) 39px; gap: 6px; }
  #home .aam-monthly-controls button { width: 39px; min-width: 39px; }
  #home .aam-monthly-stat-heading { gap: 4px; }
  #home .aam-monthly-stat .aam-monthly-stat-icon { flex-basis: 21px; width: 21px; }
  #home .aam-monthly-stat-icon svg { width: 19px; height: 19px; }
  #home .aam-monthly-stat .aam-monthly-stat-heading>span:last-child { font-size: .7rem; }
  #home .aam-monthly-stat>strong { font-size: 1rem; }
  #home .aam-monthly-chart-label { font-size: .56rem; }
}
@media (prefers-reduced-motion: reduce) {
  #home .aam-monthly-chart-bars i { transition: none; }
}
