/**
 * Story 163 — Contas mobile (lista cards + sheet pagar).
 * Tokens DS 047/161; reutiliza .m-account-card / .m-chips / .m-sheet.
 */

.m-contas {
  font-family: var(--font, "Inter", system-ui, sans-serif);
  color: var(--color-text, #172033);
  margin-top: 0.35rem;
}

.m-contas__chips {
  margin-bottom: 0.65rem;
}

.m-contas__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.m-account-card__meta {
  flex: 1;
  min-width: 0;
}

.m-account-card__meta strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.m-account-card__meta span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--color-muted, #64748b);
  font-weight: 500;
}

.m-account-card__amt {
  flex-shrink: 0;
  text-align: right;
}

.m-account-card__amt strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.m-amt--out {
  color: var(--color-danger, #b91c1c);
}

.m-amt--in {
  color: var(--color-success, #15803d);
}

.m-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text, #172033);
}

.m-field input,
.m-field select {
  font: inherit;
  font-weight: 500;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border-strong, #d1d5db);
  border-radius: var(--radius-sm, 8px);
  background: var(--color-surface, #fff);
  color: var(--color-text, #172033);
}

.m-contas-pay__lead {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--color-muted, #64748b);
  line-height: 1.4;
  font-weight: 400;
}

.m-contas-pay__lead strong {
  color: var(--color-text, #172033);
  font-weight: 650;
}

.m-contas-detail__desc {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.m-contas-detail__dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.m-contas-detail__dl > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.m-contas-detail__dl dt {
  margin: 0;
  color: var(--color-muted, #64748b);
  font-weight: 500;
}

.m-contas-detail__dl dd {
  margin: 0;
  font-weight: 600;
}

/* Mobile: esconde tabela/toolbar densos; desktop ≥769 inalterado */
@media (max-width: 768px) {
  body.is-mobile-shell .contas-hub .contas-toolbar .select,
  body.is-mobile-shell .contas-hub #filter-situacao,
  body.is-mobile-shell .contas-hub #filter-banco {
    display: none !important;
  }

  body.is-mobile-shell .contas-hub #contas-table {
    display: none !important;
  }

  body.is-mobile-shell .contas-hub__hint {
    display: none;
  }

  body.is-mobile-shell .contas-hub__header .btn--primary {
    /* FAB (164) assumirá criar; mantém botão acessível no header por enquanto */
    min-height: 40px;
    font-size: 0.85rem;
  }

  /* Resumo por Banco — layout mobile nativo (grade fixa, sem overflow) */
  body.is-mobile-shell .table-resumo-bancos {
    display: none !important;
  }

  body.is-mobile-shell #resumo-bancos-panel,
  body.is-mobile-shell .panel--resumo-bancos {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  body.is-mobile-shell .m-banco-resumo {
    width: 100%;
    max-width: 100%;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
  }

  body.is-mobile-shell .m-banco-resumo__head,
  body.is-mobile-shell .m-banco-resumo__row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 4.6rem) minmax(0, 3.6rem) minmax(0, 3.9rem) 1.75rem;
    column-gap: 0.3rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.55rem;
  }

  body.is-mobile-shell .m-banco-resumo__head {
    background: #f8fafc;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
  }

  body.is-mobile-shell .m-banco-resumo__h-banco,
  body.is-mobile-shell .m-banco-resumo__h-num {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.is-mobile-shell .m-banco-resumo__h-num,
  body.is-mobile-shell .m-banco-resumo__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  body.is-mobile-shell .m-banco-resumo__row {
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    min-height: 2.5rem;
  }

  body.is-mobile-shell .m-banco-resumo__row:last-child {
    border-bottom: 0;
  }

  body.is-mobile-shell .m-banco-resumo__nome {
    display: block;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.is-mobile-shell .m-banco-resumo__num {
    display: block;
    min-width: 0;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.is-mobile-shell .m-banco-resumo__num.banco-resumo__disponivel {
    font-weight: 700;
    font-size: 0.7rem;
  }

  body.is-mobile-shell .m-banco-resumo__xfer {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    justify-self: end;
  }

  /*
   * Contas · Resumo / Rateio — mobile: superfície clara (padrão Início/Análise).
   * Desktop (.panel--*-hero azul) permanece intacto ≥769 / sem .is-mobile-shell.
   */
  body.is-mobile-shell #resumo-panel.panel--resumo-hero,
  body.is-mobile-shell .panel--resumo-hero,
  body.is-mobile-shell #rateio-panel.panel--rateio-hero,
  body.is-mobile-shell .panel--rateio-hero {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    color: var(--color-text, #172033);
    box-shadow: var(--shadow, 0 1px 2px rgba(23, 32, 51, 0.04));
  }

  body.is-mobile-shell .resumo-hero__title,
  body.is-mobile-shell .rateio-hero__title {
    color: var(--color-text, #172033);
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  body.is-mobile-shell .resumo-hero__title em {
    color: var(--color-primary, #2563eb);
  }

  body.is-mobile-shell .panel--resumo-hero .resumo-hero__cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  body.is-mobile-shell .panel--resumo-hero .card {
    background: var(--color-bg, #f7f8fa);
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: none;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm, 8px);
  }

  body.is-mobile-shell .panel--resumo-hero .card__label {
    color: var(--color-muted, #64748b);
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  body.is-mobile-shell .panel--resumo-hero .card__value {
    color: var(--color-text, #172033);
    font-size: 1.05rem;
    font-weight: 700;
  }

  body.is-mobile-shell .panel--resumo-hero .card--success .card__value {
    color: var(--color-success, #15803d);
  }

  body.is-mobile-shell .panel--resumo-hero .card--warning .card__value {
    color: var(--color-warning, #c2410c);
  }

  body.is-mobile-shell .panel--resumo-hero .card--danger .card__value {
    color: var(--color-danger, #b91c1c);
  }

  body.is-mobile-shell .panel--resumo-hero .resumo-hero__meta,
  body.is-mobile-shell .panel--resumo-hero .resumo-meta {
    margin-top: 0.75rem;
    color: var(--color-muted, #64748b);
    font-size: 0.78rem;
  }

  body.is-mobile-shell .panel--resumo-hero .resumo-meta strong {
    color: var(--color-text, #172033);
  }

  body.is-mobile-shell .panel--rateio-hero .rateio-item {
    border-bottom-color: var(--color-border, #e5e7eb);
  }

  body.is-mobile-shell .panel--rateio-hero .rateio-item__nome {
    color: var(--color-text, #172033);
  }

  body.is-mobile-shell .panel--rateio-hero .rateio-item__detail {
    color: var(--color-muted, #64748b);
  }

  body.is-mobile-shell .panel--rateio-hero .rateio-item__cota {
    color: var(--color-text, #172033);
    font-weight: 700;
  }

  body.is-mobile-shell .panel--rateio-hero .rateio-hero__empty,
  body.is-mobile-shell .panel--rateio-hero .empty-state {
    color: var(--color-muted, #64748b);
  }

  body.is-mobile-shell .panel--rateio-hero .btn--ghost-light {
    background: transparent;
    color: var(--color-primary, #2563eb);
    border: 1px solid var(--color-border, #e5e7eb);
  }

  body.is-mobile-shell .panel--rateio-hero .btn--ghost-light:hover {
    background: var(--color-bg, #f7f8fa);
    color: var(--color-primary, #2563eb);
    border-color: var(--color-border-strong, #d1d5db);
  }
}

@media (min-width: 769px) {
  #contas-mobile-root,
  .m-contas {
    display: none !important;
  }
}
