/* ============================================================
   MOEDARIO — 04 · COMPONENTES
   Peças reutilizadas em todas as telas.
   ============================================================ */

/* ---------------------------------------------- cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card { padding: 18px 20px; transition: border-color .2s, transform .1s; }
a.card:hover { border-color: var(--border-strong); }
a.card:active { transform: scale(.98); }
.panel { padding: 22px; }
.panel h2 { font-size: var(--fs-lg); font-weight: 800; margin-bottom: 16px; letter-spacing: -0.005em; }

.card-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600; }
.card-value { font-family: var(--font-num); font-size: var(--fs-valor); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.card-value.green { color: var(--success); }
.card-value.red { color: var(--danger); }
.card-value.orange { color: var(--warning); }
.card-sub { margin-top: 6px; color: var(--text-dim); font-size: 12px; }
.card-sub a { color: var(--primary-text); text-decoration: none; font-weight: 600; }

/* Card de destaque: preenchido com o gradiente da marca */
.card-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--gradient-hero);
  color: var(--hero-text);
  box-shadow: var(--shadow-primary);
}
.card-hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.card-hero-inner { position: relative; z-index: 1; height: 100%; padding: 20px 22px; }
.card-hero .card-label, .card-hero .card-sub { color: var(--hero-dim); }
.card-hero .card-value { color: var(--hero-text) !important; font-size: 30px; }
.card-hero .card-value.red { color: var(--hero-negativo) !important; }
.card-hero .card-sub a, .card-hero a { color: #fff; }
.card-hero .kpi-delta.up { color: var(--hero-positivo); }
.card-hero .kpi-delta.down { color: var(--hero-negativo); }
.card-hero .progress-bar { background: rgba(255, 255, 255, 0.2); }
.card-hero .progress-fill { background: #fff !important; }

.kpi-delta { margin-top: 6px; font-size: 12px; font-weight: 700; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }

details.panel > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "⌄"; margin-left: auto; color: var(--text-faint); transition: transform .2s; }
details.panel[open] > summary::after { transform: rotate(180deg); }
details.panel[open] > summary { margin-bottom: 16px; }

details.opcional > summary { list-style: none; cursor: pointer; color: var(--text-dim); font-size: 13px; font-weight: 700; }
details.opcional > summary::-webkit-details-marker { display: none; }
details.opcional > summary::before { content: "＋ "; color: var(--primary); }
details.opcional[open] > summary::before { content: "－ "; }

/* ---------------------------------------------- botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(101, 86, 245, 0.28);
  -webkit-tap-highlight-color: transparent;
  transition: filter .15s, box-shadow .15s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { cursor: progress; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-icon { min-width: 34px; padding: 6px 9px; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { filter: none; background: var(--surface-3); }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-pagar { background: var(--success); color: #04261a; box-shadow: none; }
[data-theme="light"] .btn-pagar { color: #fff; }
.btn-bloco { width: 100%; min-height: 50px; font-size: 15px; }

.btn.carregando { position: relative; color: transparent !important; pointer-events: none; }
.btn.carregando::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: girar .7s linear infinite;
}
.btn-ghost.carregando::after { border-color: var(--border-strong); border-top-color: var(--text); }

/* ---------------------------------------------- formulários */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { color: var(--text-dim); font-size: 12.5px; font-weight: 700; }
.form-group input, .form-group select, .form-group textarea, .toolbar select {
  width: 100%;
  min-height: var(--altura-controle);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;            /* 16px evita o zoom automático do iPhone */
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-group textarea { resize: vertical; line-height: 1.5; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-faint); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
.toolbar select { width: auto; min-height: 36px; padding: 6px 10px; font-size: 13px; }
/* O menu nativo do <select> ignora o tema em vários sistemas — força legibilidade. */
.form-group select option, .toolbar select option { color: #111; background: #fff; }

input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.checkbox-line { display: flex; align-items: center; gap: 9px; color: var(--text-dim); font-size: 13.5px; cursor: pointer; }
.checkbox-line input { width: 20px; }

.input-inline {
  width: 100px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 14px;
}
.input-inline:focus { outline: none; border-color: var(--primary); }
.input-valor-grande { font-size: 28px !important; font-weight: 800; letter-spacing: -0.005em; min-height: 62px !important; }

/* Escolhas em forma de chips (categoria, ícone, dias) */
.chips-escolha, .icone-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.chips-escolha label, .icone-picker label { cursor: pointer; }
.chips-escolha input, .icone-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips-escolha span {
  display: inline-block;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .15s;
}
.icone-picker span {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 20px;
  transition: all .15s;
}
.chips-escolha input:checked + span, .icone-picker input:checked + span {
  border-color: var(--primary);
  background: var(--primary-tint);
  box-shadow: 0 0 0 2px var(--primary-tint);
}
.chips-escolha input:checked + span { color: var(--primary-text); }
.chips-escolha input:focus-visible + span, .icone-picker input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------------------------------------------- tabelas */
table { width: 100%; border-collapse: collapse; }
th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .06em;
}
td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ---------------------------------------------- etiquetas */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .01em; }
.badge-paid { background: var(--green-tint); color: var(--green-text); }
.badge-unpaid { background: var(--red-tint); color: var(--red-text); }
.badge-amber { background: var(--amber-tint); color: var(--amber-text); }
.badge-violet { background: var(--primary-tint); color: var(--primary-text); }
.badge-cyan { background: var(--cyan-tint); color: var(--cyan-text); }
.badge-neutral { background: var(--surface-3); color: var(--text-dim); }
.color-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Tipos de evento do log de segurança (admin) */
.ev { padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.ev-login_ok { background: var(--green-tint); color: var(--green-text); }
.ev-login_falhou, .ev-erro { background: var(--red-tint); color: var(--red-text); }
.ev-admin { background: var(--primary-tint); color: var(--primary-text); }
.ev-senha { background: var(--amber-tint); color: var(--amber-text); }
.ev-conta { background: var(--cyan-tint); color: var(--cyan-text); }
.ev-logout, .ev-outro { background: var(--surface-3); color: var(--text-dim); }

/* Chips de filtro */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-n { font-size: 11px; opacity: .7; }

/* ---------------------------------------------- progresso, vazio, gráficos */
.progress-bar { width: 100%; height: 8px; margin-top: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.meter { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > div { height: 100%; background: var(--gradient-brand); }
.chart-wrap { position: relative; height: 260px; }

.empty-state { padding: 40px 20px; color: var(--text-dim); font-size: 14px; text-align: center; }
.empty-icone { font-size: 40px; margin-bottom: 10px; }

/* ---------------------------------------------- listas estilo extrato */
.lista-app { display: flex; flex-direction: column; }
.item-app { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.item-app:last-child { border-bottom: none; }
.item-icone {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  font-size: 19px;
  flex-shrink: 0;
}
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-info strong { overflow: hidden; font-size: 14.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.item-info small { overflow: hidden; color: var(--text-dim); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.item-valor { font-family: var(--font-num); font-size: 14.5px; font-weight: 800; white-space: nowrap; letter-spacing: -0.01em; }
.item-acoes { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.item-pago .item-info strong { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--success); }
.valor-editavel { display: flex; align-items: center; gap: 6px; margin-top: 6px; }

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  text-decoration: none;
}
.alert-item.red { background: var(--red-tint); }
.alert-item.amber { background: var(--amber-tint); }
.alert-item.violet { background: var(--primary-tint); }
.alert-acoes { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.info-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 13px; }
.info-list dt { color: var(--text-dim); }
.info-list dd { word-break: break-word; }

.paginacao { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.paginacao span { color: var(--text-dim); font-size: 12.5px; }

.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.danger-zone .form-group input { max-width: 340px; }

/* ---------------------------------------------- folhas (bottom sheets) e botão flutuante */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.sheet-backdrop.visivel { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  z-index: 75;
  left: 50%; top: 50%;
  width: min(540px, 92vw);
  max-height: 88vh;
  margin: 0;
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(.98);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .28s;
}
.sheet.aberta { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%); transition-delay: 0s; }
.sheet-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-cabecalho h2 { margin: 0 !important; font-size: 18px; }
.sheet-fechar {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
}
.sheet-fechar .icone { width: 18px; height: 18px; }
.sheet-atalhos { display: flex; gap: 8px; overflow-x: auto; margin: -4px 0 16px; scrollbar-width: none; }
.sheet-atalhos::-webkit-scrollbar { display: none; }
.sheet-atalhos a { flex-shrink: 0; }

@media (min-width: 861px) {
  /* No computador, formulários "sheet-desktop-inline" ficam na própria página. */
  .sheet.sheet-desktop-inline {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin-bottom: 24px;
    padding: 22px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    z-index: auto;
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
  }
  .sheet-desktop-inline .sheet-fechar { display: none; }
  /* Botões que só abrem a folha: no computador o formulário já está na página. */
  .so-celular { display: none !important; }
}

/* ---------------------------------------------- toasts */
.toasts {
  position: fixed;
  z-index: 90;
  top: 18px; right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 10px 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  font-weight: 600;
  pointer-events: auto;
  animation: surgir .28s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.saindo { opacity: 0; transform: translateY(-8px); transition: all .25s ease; }
.toast-icone {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--success);
  color: #04261a;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}
.toast-error .toast-icone { background: var(--danger); color: #fff; }
.toast-texto { flex: 1; }
.toast-fechar { padding: 4px 6px; border: none; background: none; color: var(--text-faint); font-size: 13px; cursor: pointer; }

/* Mensagens das telas de login/cadastro */
.flash-container { margin-bottom: 16px; }
.flash { padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--green-tint); color: var(--green-text); font-weight: 600; font-size: 13.5px; }
.flash-error { background: var(--red-tint); color: var(--red-text); }

/* ---------------------------------------------- confirmação */
.confirmar-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: aparecer .15s ease;
}
.confirmar-overlay[hidden] { display: none; }
.confirmar-caixa {
  width: 100%;
  max-width: 380px;
  padding: 26px 22px 20px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: surgir .2s ease;
}
.confirmar-icone { margin-bottom: 10px; font-size: 32px; }
.confirmar-caixa p { margin-bottom: 20px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.confirmar-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------------------------------------- avisos do admin (pop-up) */
.aviso-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: aparecer .2s ease;
}
.aviso-modal {
  --aviso-cor: var(--info);
  --aviso-tint: var(--cyan-tint);
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px 24px 20px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--aviso-cor);
  box-shadow: var(--shadow-lg);
  animation: surgir .25s ease;
}
.aviso-modal[hidden] { display: none; }
.aviso-novidade { --aviso-cor: var(--primary); --aviso-tint: var(--primary-tint); }
.aviso-alerta { --aviso-cor: var(--warning); --aviso-tint: var(--amber-tint); }
.aviso-urgente { --aviso-cor: var(--danger); --aviso-tint: var(--red-tint); }
.aviso-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.aviso-icone { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--aviso-tint); font-size: 18px; }
.aviso-tipo { color: var(--text-dim); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.aviso-contador { margin-left: auto; color: var(--text-faint); font-size: 11.5px; font-weight: 700; }
.aviso-titulo { margin-bottom: 8px; font-size: 19px; font-weight: 800; line-height: 1.3; }
.aviso-texto { color: var(--text-dim); font-size: 14px; line-height: 1.6; white-space: pre-line; word-break: break-word; }
.aviso-rodape { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.aviso-preview-area { padding: 22px; border-radius: var(--radius-sm); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, transparent 10px, transparent 20px); }
.aviso-preview-area .aviso-modal { animation: none; box-shadow: var(--shadow-md); }

/* ---------------------------------------------- celular */
@media (max-width: 860px) {
  .cards-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .card { padding: 16px; }
  .panel { padding: 18px 16px; border-radius: var(--radius-md); }
  .card-value { font-size: 24px; }
  .card-hero .card-value { font-size: 28px; }
  .card-hero-inner { padding: 18px; }

  /* Cards de resumo compactos: dois por linha, o primeiro ocupa a largura toda */
  .cards-grid.cards-compactos { grid-template-columns: 1fr 1fr; }
  /* O primeiro ocupa a linha toda; os demais vão em pares — se sobrar um no fim (posição par), ele também. */
  .cards-compactos > :first-child, .cards-compactos > :nth-child(even):last-child { grid-column: 1 / -1; }
  .cards-compactos .card { padding: 14px; }
  .cards-compactos .card .card-value { font-size: 18px; }
  .cards-compactos .card .card-label { margin-bottom: 6px; font-size: 11.5px; }
  .cards-compactos .card .card-sub { font-size: 11px; }

  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; padding: 8px 13px; }
  .btn-icon { min-width: 40px; }
  .btn-bloco-mobile { width: 100%; min-height: 50px; font-size: 15px; }
  .form-group input, .form-group select, .form-group textarea { min-height: 48px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .toolbar { align-items: flex-start; }
  .item-acoes { flex-direction: column; align-items: flex-end; }
  td form.inline, td .btn { margin: 3px 4px 3px 0; }

  /* Folhas sobem do rodapé */
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0;
    width: 100%;
    max-height: 92vh;
    padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    opacity: 1;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2, .9, .3, 1), visibility 0s linear .3s;
  }
  .sheet.aberta { transform: translateY(0); transition-delay: 0s; }
  .sheet::before { content: ""; display: block; width: 40px; height: 5px; margin: 4px auto 14px; border-radius: 5px; background: var(--border-strong); }
  .sheet .form-grid { grid-template-columns: 1fr 1fr; }

  .toasts { top: auto; bottom: calc(var(--bottom-nav) + 14px + env(safe-area-inset-bottom)); left: 14px; right: 14px; width: auto; }
  .confirmar-overlay { align-items: flex-end; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .confirmar-botoes .btn { min-height: 50px; }
  .aviso-overlay { align-items: flex-end; padding: 0; }
  .aviso-modal { max-width: none; max-height: 85vh; border-radius: 24px 24px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .aviso-rodape .btn { flex: 1; }

  /* Tabelas com 4+ colunas viram uma pilha de cards (ver base.html) */
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  table.tabela-cards { display: block; overflow: visible; white-space: normal; }
  table.tabela-cards thead { display: none; }
  table.tabela-cards tbody { display: flex; flex-direction: column; gap: 10px; }
  table.tabela-cards tr { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
  table.tabela-cards tbody tr:hover td { background: none; }
  table.tabela-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; padding: 0; border: none; font-size: 13.5px; text-align: right; word-break: break-word; }
  table.tabela-cards td::before { content: attr(data-label); flex-shrink: 0; color: var(--text-faint); font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
  table.tabela-cards td:first-child { justify-content: flex-start; font-size: 15px; font-weight: 700; text-align: left; }
  table.tabela-cards td:first-child::before, table.tabela-cards td[data-label=""]::before { display: none; }
  table.tabela-cards td[data-label=""]:last-child { justify-content: flex-end; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--border); }
  table.tabela-cards td:empty { display: none; }
  table.tabela-cards td > br { display: none; }
  table.tabela-cards td > small, table.tabela-cards td > span > small { display: block; }
}

/* ---------------------------------------------- campo de senha com botão de olho (_mostrar_senha.html) */
.campo-senha { position: relative; display: block; }
.campo-senha input { width: 100%; padding-right: 48px; }
.campo-senha-olho {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.campo-senha-olho:hover, .campo-senha-olho[aria-pressed="true"] { color: var(--primary-text); }
.campo-senha-olho .icone { width: 20px; height: 20px; }
