/* Pompom Toys - estilos (fiel ao prototipo azul) */
:root {
  --ink: #1B2B4B;
  --muted: #55688A;
  --blue: #1D62C9;
  --blue-dk: #1449A0;
  --blue-bg: #DCEBFF;
  --cream: #F4F8FF;
  --line: #DDE8F7;
  --line-in: #CBDDF3;
  --dash: #A9C8F5;
  --danger: #B3261E;
  --display: 'Fredoka', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.4;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7FB2FF; outline-offset: 2px; }
.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; }
.grow { flex-grow: 1; }
.muted { color: var(--muted); }
.muted-sm { font-size: 14px; font-weight: 700; color: var(--muted); }
.link-sm { font-size: 14px; font-weight: 800; color: var(--blue-dk); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }
.h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.15; }
.h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; }
.h3 { margin: 0 0 14px; font-family: var(--display); font-weight: 600; font-size: 19px; }
.sub { margin: 4px 0 0; font-size: 16px; font-weight: 600; color: var(--muted); }
.kicker { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); }
.empty-sm { margin: 12px 0 0; font-size: 15px; font-weight: 600; color: var(--muted); }

/* ---------- Estrutura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; padding: 28px 20px; background: #fff; border-right: 2px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 23px; color: var(--blue); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; font-weight: 800; font-size: 16px; text-decoration: none; color: var(--muted); }
.nav-link:hover { background: var(--cream); }
.nav-link.is-active { background: var(--blue-bg); color: var(--blue-dk); }
.usercard { background: var(--cream); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #E6E8FF; color: #3A3F9E; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-lg { width: 46px; height: 46px; font-size: 18px; }
.av-0 { background: #DCEBFF; color: #1449A0; } .av-1 { background: #E8F4FF; color: #1E4F82; }
.av-2 { background: #D8F3FB; color: #0B5566; } .av-3 { background: #D9F5F0; color: #0F5A50; }
.user-meta { min-width: 0; flex: 1; }
.user-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 800; font-size: 14px; color: var(--muted); }
.logout-btn:hover { color: var(--ink); }
.main { flex: 1; min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.tabbar { display: none; }

.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 800; font-size: 15px; box-shadow: 0 8px 24px rgba(27, 43, 75, .25); animation: toast-life 5s ease forwards; }
.toast-err { background: var(--danger); }
@keyframes toast-life { 0% { opacity: 0; transform: translateY(-8px); } 6% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 12px; align-items: center; }
.searchbox {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line-in); border-radius: 999px;
  padding: 0 16px; height: 48px; width: 250px; color: var(--muted); margin: 0;
}
.searchbox:focus-within { border-color: var(--blue); }
.searchbox input { border: 0; outline: 0; background: transparent; font-size: 15px; flex: 1; min-width: 0; color: var(--ink); }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- Botoes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; height: 48px; border-radius: 999px;
  background: var(--blue); color: #fff; border: 0; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--dash); transition: transform .08s, box-shadow .08s, background .15s; white-space: nowrap;
}
.btn:hover { background: #1857b3; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--dash); }
.btn-lg { height: 56px; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; box-shadow: none; }
.btn-block { width: 100%; }
.btn-grow { flex: 1; }
form.btn-grow { display: flex; }
.btn-ghost { background: #fff; color: var(--blue-dk); border: 2px solid var(--line-in); box-shadow: none; }
.btn-ghost:hover { background: var(--cream); }
.btn-danger { background: #fff; color: var(--danger); border: 2px solid #E9B7B4; box-shadow: none; }
.btn-danger:hover { background: #FDF3F2; }
.btn-dash {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 2px dashed var(--dash);
  background: #fff; color: var(--blue-dk); font-weight: 800; font-size: 15px; cursor: pointer;
}
.btn-dash:hover { background: var(--cream); }
.iconbtn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: #fff; border: 2px solid var(--line-in); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.iconbtn:hover { background: var(--cream); }
.iconbtn-danger { border-color: #E9B7B4; color: var(--danger); }
.iconbtn:disabled { border-color: #E3ECF8; color: var(--muted); opacity: .5; cursor: not-allowed; background: #fff; }
.circ {
  width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line); border: 0;
  display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0;
}
.circ-ghost { background: transparent; box-shadow: none; }

.card { background: #fff; border: 2px solid #E7EFFA; border-radius: 28px; padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.alert { padding: 12px 16px; border-radius: 18px; font-weight: 700; font-size: 15px; }
.alert-err { background: #FDECEA; color: var(--danger); border: 2px solid #F5C6C2; }

/* ---------- Pecas visuais ---------- */
.tile { width: 64px; height: 64px; border-radius: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; background: var(--blue-bg); }
.tile-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile-art { width: 78%; height: 78%; }
.tile-sm { width: 56px; height: 56px; border-radius: 18px; }
.tile-thumb { width: 84px; height: 84px; border-radius: 22px; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(27, 43, 75, .18); flex-shrink: 0; }
.dot-md { width: 18px; height: 18px; } .dot-lg { width: 20px; height: 20px; } .dot-xl { width: 28px; height: 28px; }
.chip { display: inline-block; font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.chip-md { font-size: 14px; }
.chip-0 { background: #D9F5F0; color: #0F5A50; } .chip-1 { background: #E6E8FF; color: #3A3F9E; }
.chip-2 { background: #D8F3FB; color: #0B5566; } .chip-3 { background: #E8F4FF; color: #1E4F82; } .chip-4 { background: #DCEBFF; color: #1449A0; }
.pill-blue { background: var(--blue-bg); color: var(--blue-dk); font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.pill-w { align-self: flex-start; background: #fff; color: var(--blue-dk); font-weight: 800; font-size: 13px; letter-spacing: .06em; padding: 6px 14px; border-radius: 999px; }
.cname { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- Dashboard ---------- */
.top-row { display: flex; gap: 24px; }
.hero { flex: 1.7; position: relative; overflow: hidden; background: #C9DEFF; border-radius: 32px; padding: 28px; display: flex; align-items: center; gap: 28px; min-width: 0; }
.hero .hero-tile { width: 176px; height: 176px; border-radius: 40px; background: #fff !important; position: relative; }
.hero-logo { display: flex; align-items: center; justify-content: center; }
.hero-body { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; align-items: flex-start; }
.hero-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: 42px; line-height: 1.05; }
.hero-sub { margin: 0; font-size: 16px; font-weight: 600; }
.hero-count { display: flex; align-items: flex-end; gap: 8px; }
.hero-count .num { font-family: var(--display); font-weight: 600; font-size: 56px; line-height: .9; color: var(--blue-dk); }
.hero-count .lbl { font-weight: 800; font-size: 18px; padding-bottom: 4px; }
.cf { position: absolute; border-radius: 50%; }
.cf1 { left: 81%; top: 24px; width: 14px; height: 14px; background: #fff; }
.cf2 { left: 90%; top: 70px; width: 10px; height: 10px; background: #5CC8E8; }
.cf3 { left: 73%; bottom: 40px; width: 12px; height: 12px; background: #9DA8FF; }
.cf4 { left: 94%; bottom: 44px; width: 16px; height: 16px; background: #fff; }
.cf5 { left: 6%; top: 20px; width: 10px; height: 10px; background: #5CC8E8; }
.cf6 { left: 47%; bottom: 20px; width: 12px; height: 12px; background: #8EC5FF; }
.is-today .cf { animation: float 2.4s ease-in-out infinite; }
.is-today .cf2, .is-today .cf4 { animation-delay: .6s; } .is-today .cf3, .is-today .cf6 { animation-delay: 1.2s; }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.25); } }

.kpis { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.kpi { border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); transition: transform .12s; }
.kpi:hover { transform: translateY(-2px); }
.kpi-0 { background: #DCEBFF; } .kpi-1 { background: #D8F3FB; } .kpi-2 { background: #D9F5F0; } .kpi-3 { background: #E6E8FF; }
.kpi-ico { width: 44px; height: 44px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; }
.kpi-num { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1; margin-top: 8px; }
.kpi-lbl { font-size: 15px; font-weight: 700; color: var(--muted); }

.mid-row { display: flex; gap: 24px; align-items: flex-start; }
.bday-card { flex: 1; min-width: 0; }
.latest-card { flex: 1.25; min-width: 0; }
.latest-card .card-head { margin-bottom: 16px; }
.bday-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: var(--ink); text-decoration: none; }
.bday-row + .bday-row { border-top: 2px dashed var(--line); }
.bday-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bday-info b { font-weight: 800; font-size: 17px; }
.bday-info small { font-size: 14px; color: var(--muted); }
.latest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.latest-item { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; min-width: 0; }
.tile-latest { width: 100%; height: 132px; border-radius: 22px; margin-bottom: 6px; }
.li-name { font-weight: 800; font-size: 17px; }
.li-type { font-size: 14px; color: var(--muted); }
.li-date { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-top { display: flex; justify-content: space-between; font-weight: 800; font-size: 15px; margin-bottom: 5px; }
.bar-top b { color: var(--muted); }
.bar-track { height: 12px; border-radius: 999px; background: #EAF1FB; }
.bar-fill { height: 12px; border-radius: 999px; min-width: 12px; }
.bf-0 { background: #7FB2FF; } .bf-1 { background: #5CC8E8; } .bf-2 { background: #A8D4FF; } .bf-3 { background: #6DD3C4; } .bf-4 { background: #9DA8FF; }
.plain-list { display: flex; flex-direction: column; gap: 11px; }
.plain-list.gap-14 { gap: 14px; }
.pl-row { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.pl-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row b { color: var(--muted); }
.medal { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 14px; }
.medal-0 { background: #BFD9FF; } .medal-1 { background: #D9E2F0; } .medal-2 { background: #A7C7F2; } .medal-3 { background: #EAF1FB; }
.occ-wrap { display: flex; flex-wrap: wrap; gap: 12px 10px; }
.occ { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.occ b { font-size: 13px; color: var(--muted); }

/* ---------- Lista de brinquedos ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.filters .searchbox { height: 42px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 999px; background: #fff;
  border: 2px solid var(--line-in); color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; position: relative;
}
.fchip.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.fselect select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: 0; padding: 0; font-weight: 800; font-size: 15px; cursor: pointer; max-width: 150px; }
.fselect select option { color: var(--ink); background: #fff; }
.fselect:focus-within { outline: 3px solid #7FB2FF; outline-offset: 2px; }
.ftoggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.toy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.toy-card { display: flex; flex-direction: column; gap: 14px; background: #fff; border: 2px solid #E7EFFA; border-radius: 28px; padding: 14px 14px 18px; color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.toy-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(29, 98, 201, .10); }
.toy-photo { position: relative; }
.tile-card { width: 100%; height: 196px; border-radius: 22px; }
.photo-badge { position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 5px; background: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 13px; }
.toy-body { padding: 0 6px; display: flex; flex-direction: column; gap: 8px; }
.toy-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.toy-name { font-family: var(--display); font-weight: 600; font-size: 24px; }
.toy-bday { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800; color: var(--blue-dk); }
.toy-sub { font-size: 15px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { font-size: 12px; }
.colorline { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; }
.empty-card { background: #fff; border: 2px solid #E7EFFA; border-radius: 28px; padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-card a:not(.btn) { color: var(--blue-dk); font-weight: 800; }

/* ---------- Detalhe ---------- */
.main-detail, .main-form { align-items: center; }
.detail, .formpage { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-family: var(--display); font-weight: 600; font-size: 19px; }
.carousel { position: relative; width: 100%; aspect-ratio: 342 / 300; border-radius: 32px; overflow: hidden; background: var(--blue-bg); touch-action: pan-y; }
.track { display: flex; height: 100%; transition: transform .35s ease; }
.slide { flex: 0 0 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.tile-full { width: 100%; height: 100%; border-radius: 0; }
.tile-full .tile-art { width: 78%; height: 78%; }
.counter { position: absolute; top: 14px; right: 14px; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 999px; }
.cbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(27, 43, 75, .18); }
.cprev { left: 10px; } .cnext { right: 10px; }
.cdel-form { position: absolute; top: 10px; left: 10px; margin: 0; }
.cdel { position: static; transform: none; width: 38px; height: 38px; color: var(--danger); }
.dots { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: -6px; }
.dotb { width: 10px; height: 10px; border-radius: 999px; border: 0; padding: 0; background: #C5D6EE; cursor: pointer; transition: width .2s, background .2s; }
.dotb.is-on { width: 24px; background: var(--blue); }
.add-photo { align-self: center; margin: 0; }
.detail-title h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 38px; line-height: 1.1; color: var(--blue-dk); }
.detail-title p { margin: 2px 0 0; font-size: 17px; font-weight: 600; color: var(--muted); }
.bday-card2 { background: #D8F3FB; border-radius: 28px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.bday-ico { width: 52px; height: 52px; border-radius: 18px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bday-cap { font-size: 14px; font-weight: 800; color: #0B5566; }
.bday-big { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; }
.info-card { padding: 8px 20px; }
.info-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; }
.info-row + .info-row { border-top: 2px dashed var(--line); }
.info-l { font-size: 14px; font-weight: 800; color: var(--muted); }
.info-v { font-weight: 800; font-size: 16px; text-align: right; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.info-v .cname { font-size: 16px; font-weight: 800; color: var(--ink); gap: 6px; }
.info-v .chip { font-size: 13px; }
.actions-row { display: flex; gap: 12px; }

/* ---------- Formulario ---------- */
.form-head { display: flex; align-items: center; gap: 14px; }
.form-head .h1 { font-size: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 15px; margin: 0; }
.field .lbl { font-weight: 800; font-size: 15px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.field > input, .field > .selectwrap select, .colorpick {
  height: 52px; border-radius: 18px; border: 2px solid var(--line-in); background: #fff; padding: 0 16px; font-size: 16px; font-weight: 600; color: var(--ink); outline: 0; width: 100%;
}
.field > textarea {
  min-height: 110px; border-radius: 18px; border: 2px solid var(--line-in); background: #fff; padding: 12px 16px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); outline: 0; width: 100%; resize: vertical; line-height: 1.4;
}
.field > textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.field > input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; }
.chip-add { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 999px; border: 2px dashed #A9C4EE; background: transparent; color: var(--blue-dk); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.chip-add:hover { background: var(--blue-bg); }
.quick-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 12px; border-radius: 20px; background: var(--blue-bg); }
.quick-form[hidden] { display: none; }
.quick-form input[type=text] { flex: 1 1 140px; min-width: 0; height: 44px; border-radius: 14px; border: 2px solid var(--line-in); background: #fff; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); outline: 0; }
.quick-form .colorpick-sm { width: 44px; height: 44px; padding: 3px; border-radius: 14px; border: 2px solid var(--line-in); background: #fff; cursor: pointer; }
.curio-card { padding: 18px 20px; margin-top: 14px; }
.curio-card .h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.curio-card p { margin: 0; white-space: pre-line; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.field > input:focus, .field > .selectwrap select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.colorpick { padding: 6px; cursor: pointer; }
.selectwrap { position: relative; display: block; color: var(--muted); }
.selectwrap select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.selectwrap svg { position: absolute; right: 14px; top: 17px; pointer-events: none; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 132px; padding: 16px; border-radius: 28px;
  border: 2px dashed var(--dash); background: #fff; color: var(--blue-dk); cursor: pointer; text-align: center;
}
.dropzone:hover, .dropzone.is-drag { background: var(--blue-bg); }
.dropzone b { font-weight: 800; font-size: 16px; }
.dropzone small { font-size: 13px; color: var(--muted); font-weight: 600; }
.dropzone:focus-within { outline: 3px solid #7FB2FF; outline-offset: 2px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; cursor: pointer; display: block; }
.thumb-x { position: absolute; right: -6px; top: -6px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.thumb-flag { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 800; color: var(--danger); line-height: 1.1; padding: 4px; }
.thumb:has(input:checked) .tile { opacity: .3; }
.thumb:has(input:checked) .thumb-flag { display: flex; }
.thumb:has(input:checked) .thumb-x { background: var(--danger); }
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { cursor: pointer; }
.chipbtn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipbtn span { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line-in); background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; }
.chipbtn span:has(.dot) { padding: 0 16px 0 12px; }
.chipbtn:hover span { background: var(--cream); }
.chipbtn input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chipbtn input:focus-visible + span { outline: 3px solid #7FB2FF; outline-offset: 2px; }
.savebar { margin-top: 4px; }

/* ---------- Cadastros / Acessos ---------- */
.tabs { display: inline-flex; background: #fff; border: 2px solid var(--line-in); border-radius: 999px; padding: 4px; gap: 4px; align-self: flex-start; }
.tabs-btn { height: 44px; padding: 0 24px; border-radius: 999px; display: flex; align-items: center; font-weight: 800; font-size: 16px; text-decoration: none; color: var(--ink); }
.tabs-btn.is-on { background: var(--blue); color: #fff; }
.two-col { display: flex; gap: 24px; align-items: flex-start; }
.grow-16 { flex: 1.6; min-width: 0; } .grow-15 { flex: 1.5; min-width: 0; } .grow-10 { flex: 1; min-width: 0; }
.side-stack { display: flex; flex-direction: column; gap: 24px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.list-row { padding: 12px 0; border-top: 2px dashed var(--line); }
.row-view, .user-row { display: flex; align-items: center; gap: 14px; }
.user-row { padding: 14px 0; }
.user-row .avatar { width: 44px; height: 44px; font-size: 18px; }
.user-row .user-name { font-size: 16px; }
.row-name { flex: 1; min-width: 0; font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.row-view form, .user-row form { margin: 0; }
.row-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.row-edit input[type=text] { flex: 1; min-width: 160px; height: 44px; border-radius: 16px; border: 2px solid var(--line-in); padding: 0 14px; font-weight: 700; outline: 0; background: #fff; }
.row-edit input[type=text]:focus { border-color: var(--blue); }
.colorpick-sm { width: 44px; height: 44px; border: 2px solid var(--line-in); border-radius: 50%; padding: 3px; background: #fff; cursor: pointer; }
.note { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); }
.note svg { flex-shrink: 0; margin-top: 1px; }
.rolepill { font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.role-admin { background: #E6E8FF; color: #3A3F9E; } .role-editor { background: #D9F5F0; color: #0F5A50; } .role-viewer { background: #D8F3FB; color: #0B5566; }
.you { width: 44px; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); flex-shrink: 0; }
.note-txt { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--muted); font-weight: 600; }
.perm-list { display: flex; flex-direction: column; gap: 12px; }
.perm { display: flex; gap: 12px; align-items: flex-start; }
.perm .chip { flex-shrink: 0; }
.perm span:last-child { font-size: 14px; line-height: 1.45; color: var(--muted); font-weight: 600; }

/* ---------- Login ---------- */
.login { position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--cream); }
.blob { position: absolute; border-radius: 50%; }
.blob-a { left: -70px; top: -60px; width: 240px; height: 240px; background: #DCEBFF; }
.blob-b { right: -60px; top: 110px; width: 150px; height: 150px; background: #E6E8FF; }
.blob-c { left: -40px; bottom: 120px; width: 130px; height: 130px; background: #D8F3FB; }
.blob-d { right: -90px; bottom: -70px; width: 260px; height: 260px; background: #D9F5F0; }
.login-inner { position: relative; width: 100%; max-width: 390px; padding: 32px 28px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.login-title { text-align: center; }
.login-title h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 40px; color: var(--blue); line-height: 1.1; }
.login-title p { margin: 10px 0 0; font-size: 18px; font-weight: 600; color: var(--muted); }
.login-card { width: 100%; background: #fff; border: 2px solid var(--line); border-radius: 32px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 56px; border-radius: 999px; background: #fff; border: 2px solid #C5D6EE; color: var(--ink); font-weight: 800; font-size: 17px; text-decoration: none; transition: background .15s; }
.google-btn:hover { background: var(--cream); }
.login-note { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--muted); }
.login-note svg { flex-shrink: 0; margin-top: 1px; }
.login-domain { font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (min-width: 900px) {
  .only-mobile { display: none !important; }
}
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-row, .mid-row { flex-direction: column; align-items: stretch; }
}
@media (max-width: 899px) {
  .only-desktop, .hide-mobile { display: none !important; }
  .sidebar { display: none; }
  .app { display: block; }
  .main { padding: 24px 20px calc(110px + var(--safe-b)); gap: 18px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; padding: 8px 12px calc(12px + var(--safe-b));
    background: #fff; border-top: 2px solid var(--line);
  }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: 12px; font-weight: 800; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tab.is-active { color: var(--blue); }
  .tab-form { flex: 1; display: flex; margin: 0; }
  .tab-form .tab { width: 100%; }
  .fab { width: 58px; height: 58px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -30px; box-shadow: 0 5px 0 var(--dash); flex-shrink: 0; }
  .main-form ~ .tabbar { display: none; }
  .main-form { padding-bottom: calc(130px + var(--safe-b)); }

  .h1 { font-size: 28px; }
  .head-actions { width: 100%; }
  .head-actions .btn { display: none; }
  .searchbox { width: 100%; height: 50px; }
  .dash-head { flex-wrap: wrap; }
  .dash-head .head-title { flex: 1; }
  .dash-head .head-actions { order: 3; }
  .filters .searchbox { width: 100%; height: 46px; }

  .hero { padding: 18px; gap: 16px; border-radius: 28px; }
  .hero .hero-tile { width: 104px; height: 104px; border-radius: 28px; }
  .hero-body { gap: 6px; }
  .pill-w { font-size: 11px; padding: 4px 10px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 14px; font-weight: 700; }
  .hero-empty .hero-sub { display: block; }
  .kpis { gap: 12px; }
  .kpi { border-radius: 24px; padding: 14px; }
  .kpi-ico { width: auto; height: auto; background: none; border-radius: 0; justify-content: flex-start; }
  .kpi-num { font-size: 32px; margin-top: 0; }
  .kpi-lbl { font-size: 13px; }
  .card { padding: 18px; }
  .tile-sm { width: 48px; height: 48px; }
  .latest-card { background: none; border: 0; padding: 0; }
  .latest { display: flex; overflow-x: auto; gap: 14px; padding-bottom: 4px; scrollbar-width: none; }
  .latest-item { flex: 0 0 132px; }
  .tile-latest { width: 132px; height: 112px; }
  .stats-grid { grid-template-columns: 1fr; }
  .toy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .toy-card { padding: 10px 10px 14px; border-radius: 24px; }
  .tile-card { height: 148px; }
  .toy-name { font-size: 20px; }
  .two-col { flex-direction: column; align-items: stretch; }
  .side-card { align-self: stretch; }
  .savebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; padding: 16px 20px calc(16px + var(--safe-b));
    background: #fff; border-top: 2px solid var(--line);
  }
  .hero-logo svg { width: 64px; height: 64px; }
  .detail-title h1 { font-size: 34px; }
  .list-row.user-row { display: grid; grid-template-columns: 44px 1fr auto; column-gap: 12px; row-gap: 6px; align-items: center; }
  .list-row.user-row .user-meta { grid-column: 2; }
  .list-row.user-row .user-name { white-space: normal; overflow-wrap: anywhere; font-size: 15px; }
  .list-row.user-row .rolepill { grid-column: 2; grid-row: 2; justify-self: start; }
  .list-row.user-row form, .list-row.user-row .you { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 480px) {
  .toy-grid { grid-template-columns: 1fr; }
  .tile-card { height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* estados de JS */
body.is-busy { cursor: progress; }
body.is-busy .add-photo, body.is-busy .dropzone { opacity: .6; pointer-events: none; }
.thumb-new .thumb-x { background: var(--ink); }

/* botao enviando */
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; opacity: .9; cursor: progress; }
.btn.is-loading svg { display: none; }
.btn.is-loading::before { content: ''; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
