/* Painel Yumme Kids — mesma identidade do app (Nunito, roxo, fundo claro). */
:root {
  --ink: #3A0B5E;
  --text: #2B2640;
  --muted: #5B6072;
  --primary: #8418B7;
  --primary-soft: #F3E8FA;
  --bg: #F7FDFE;
  --card: #FFFFFF;
  --border: #E3E9EF;
  --teal: #13827D;
  --teal-soft: #E2F7F4;
  --green: #08C14B;
  --danger: #D92D20;
  --shadow: 0 6px 16px rgba(27, 110, 122, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.brand { font-weight: 900; font-size: 30px; letter-spacing: .04em; text-align: center; }
.brand .y { background: linear-gradient(90deg, #1DBF2A, #FF3682 30%, #1FA8F0 50%, #FF8A00 70%, #E5232E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .k { display: inline-block; margin-left: 8px; background: #E5232E; color: #fff; padding: 0 8px; border-radius: 8px; transform: rotate(-3deg); }
.brand.small { font-size: 20px; text-align: left; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #E3FBFC, var(--bg)); }
.login-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.login-card h1 { color: var(--ink); font-weight: 900; font-size: 26px; margin: 18px 0 4px; }
.login-card p { margin: 0 0 8px; }
label { font-weight: 800; font-size: 13.5px; margin: 12px 0 6px; display: block; }
input, select { width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 14px; background: #fff; min-width: 0; }
input:focus, select:focus { outline: 3px solid #E7D3F3; border-color: var(--primary); }
.link { background: none; border: 0; color: var(--primary); font-weight: 800; cursor: pointer; margin-top: 14px; padding: 4px; align-self: center; }
.link:hover { text-decoration: underline; }
.error { color: var(--danger); font-weight: 700; margin: 12px 0 0; }
.msg { font-weight: 700; margin: 12px 0 0; color: var(--teal); }
.msg.bad { color: var(--danger); }

/* Botões */
.btn { border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn.primary { background: linear-gradient(135deg, #9325C8, #7614AA); color: #fff; }
.login-card .btn.primary { margin-top: 20px; padding: 14px; font-size: 16px; }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn.whatsapp { background: var(--green); color: #fff; width: 100%; margin-top: 16px; padding: 13px; }
.btn.sm { padding: 7px 12px; font-size: 13.5px; }
.btn:focus-visible, .tab:focus-visible { outline: 3px solid #C99AE6; outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Topo */
.top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 24px; padding: 12px max(16px, calc((100vw - 1200px) / 2)); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tab { background: none; border: 0; padding: 9px 14px; border-radius: 999px; font-weight: 800; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--primary-soft); color: var(--primary); }
.me { display: flex; align-items: center; gap: 8px; font-weight: 700; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }

/* Números */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat .n { font-size: 30px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-weight: 600; font-size: 13.5px; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.card .filters { border: 0; box-shadow: none; padding: 0; }
.f { display: flex; flex-direction: column; min-width: 140px; }
.f.grow { flex: 1 1 220px; }
.f label { margin: 0 0 6px; }
.f.actions { flex-direction: row; gap: 8px; }
.count { color: var(--muted); font-weight: 700; margin: 16px 2px 8px; }

/* Tabelas */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #FAFCFD; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #FBF7FE; }
td.name { font-weight: 800; color: var(--ink); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 12.5px; }
.pill.yes { background: var(--teal-soft); color: var(--teal); }
.pill.no { background: #F1F2F4; color: var(--muted); }
.pill.owner { background: var(--primary-soft); color: var(--primary); }
.wa { color: #0A8F3C; font-weight: 800; text-decoration: none; }
.empty { text-align: center; color: var(--muted); padding: 32px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2, .drawer h2 { color: var(--ink); font-weight: 900; margin: 0 0 4px; font-size: 21px; }

/* Detalhe */
.drawer { position: fixed; inset: 0; z-index: 10; background: rgba(30, 20, 50, .35); display: flex; justify-content: flex-end; }
.drawer-card { width: min(420px, 100%); height: 100%; overflow-y: auto; background: #fff; padding: 28px 24px; position: relative; display: flex; flex-direction: column; }
#pass-modal { align-items: center; justify-content: center; padding: 16px; }
#pass-modal .drawer-card { height: auto; border-radius: 22px; }
#pass-modal .btn.primary { margin-top: 18px; }
.close { position: absolute; top: 14px; right: 14px; border: 0; background: #F1F2F4; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-weight: 900; }
dl { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; }
dt { color: var(--muted); font-weight: 700; }
dd { margin: 0; font-weight: 700; word-break: break-word; }

@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { gap: 10px; }
  .me { margin-left: auto; }
  .me span { display: none; }
  /* abas numa linha só, embaixo da logo, rolando para o lado se precisar */
  .tabs { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .tab { white-space: nowrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tab { transition: filter .15s, background .15s; }
  .btn:hover { filter: brightness(1.05); }
}
