/* Cabide — estilos. Celular primeiro; telas maiores apenas ampliam. */
:root {
  --ink: #121212;
  --ground: #F2F2EF;
  --surface: #FFFFFF;
  --muted: #5E5E5A;
  --muted-2: #6B6B66;
  --line: #E2E2DD;
  --line-2: #D6D6D0;
  --tile: #EDECE7;
  --lime: #D4F36B;
  --violet: #4B2FE0;
  --violet-soft: #E7E3FF;
  --pink: #F3A6D6;
  --sky: #9FD8FF;
  --orange: #FFB86B;
  --orange-soft: #FFE1C2;
  --danger: #A12E14;
  --danger-soft: #FFE1D6;
  --ok: #2F6B00;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --tabbar-h: 84px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--violet); }
a:hover { color: #2E1BA0; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.5px; line-height: 1.05; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex-shrink: 0; }

/* ───────── Telas do app ───────── */
.screen { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--ground); position: relative; display: flex; flex-direction: column; }
.screen-body { flex: 1; padding: 28px 20px 28px; display: flex; flex-direction: column; gap: 20px; }
.screen.has-tabbar .screen-body { padding-bottom: calc(var(--tabbar-h) + 24px); }
.screen.has-footer .screen-body { padding-bottom: 120px; }
.screen.dark { background: var(--ink); color: var(--ground); }
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 26px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; }
.title-xl { font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 0.98; }
.title-lg { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; }
.title-md { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.icon-btn { width: 44px; height: 44px; border-radius: 16px; border: none; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; text-decoration: none; }
.icon-btn.dark { background: #2A2A28; color: var(--ground); }
.icon-btn.outline { background: transparent; border: 1px solid #3A3A38; color: var(--ground); }

.card { background: var(--surface); border-radius: 24px; padding: 16px; }
.card.pad-lg { padding: 20px; }
.card.dark { background: var(--ink); color: var(--ground); }
.card.lime { background: var(--lime); }
.card.violet { background: var(--violet); color: #fff; }
.card.soft { background: var(--ground); }
.card.warn { background: var(--orange-soft); }
.card.danger { background: var(--danger-soft); }
.list-card { background: var(--surface); border-radius: 24px; padding: 6px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 52px; text-decoration: none; color: var(--ink); }
.list-item + .list-item { border-top: 1px solid #EDECE7; }

.btn { min-height: 52px; border-radius: 18px; border: none; padding: 0 20px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; background: var(--ink); color: var(--ground); width: 100%; }
.btn:hover { color: var(--ground); filter: brightness(1.1); }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.violet { background: var(--violet); color: #fff; }
.btn.outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); }
.btn.outline-dark { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); min-height: 44px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { background: var(--surface); color: var(--danger); border: 1.5px solid #E7B9A8; }
.btn.dashed { background: transparent; color: var(--ink); border: 1.5px dashed #B9B9B2; }
.btn.sm { min-height: 44px; font-size: 13px; border-radius: 14px; padding: 0 14px; width: auto; }
.btn[disabled], .btn.disabled { background: var(--line-2); color: var(--muted); cursor: not-allowed; filter: none; }
.btn .spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on, .chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip.lime-on[aria-pressed="true"] { background: var(--lime); color: var(--ink); border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; background: var(--tile); }
.pill.lime { background: var(--lime); }
.pill.orange { background: var(--orange-soft); }
.pill.violet { background: var(--violet-soft); }
.pill.white { background: var(--surface); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #E5E4DF; border-radius: 16px; padding: 4px; }
.segmented button { min-height: 44px; border-radius: 12px; border: none; background: transparent; font-weight: 700; font-size: 13px; cursor: pointer; }
.segmented button[aria-selected="true"], .segmented button[aria-checked="true"], .segmented button[aria-pressed="true"] { background: var(--surface); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #3A3A37; }
.input { min-height: 52px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 16px; font-size: 16px; font-weight: 400; color: var(--ink); width: 100%; }
textarea.input { padding: 12px 16px; min-height: 96px; resize: vertical; }
select.input { padding: 0 12px; }
.input:focus { border-color: var(--ink); outline: none; }
.label { font-size: 13px; font-weight: 700; color: #3A3A37; }
.check { display: flex; gap: 6px; align-items: flex-start; background: var(--surface); border-radius: 18px; padding: 8px 14px 8px 6px; }
.check input { width: 22px; height: 22px; margin: 11px; accent-color: var(--ink); flex-shrink: 0; }
.check span { padding-top: 10px; font-size: 14px; line-height: 1.4; font-weight: 400; color: var(--ink); }
.switch { width: 52px; height: 32px; border-radius: 999px; border: none; background: #C9C9C3; padding: 3px; display: flex; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ''; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--violet); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.swatch { width: 44px; height: 44px; border-radius: 15px; border: 3px solid var(--ground); box-shadow: inset 0 0 0 1px rgba(18,18,18,.12); cursor: pointer; flex-shrink: 0; }
.swatch[aria-checked="true"], .swatch[aria-pressed="true"] { border-color: var(--violet); }
.err { color: var(--danger); font-size: 13px; font-weight: 600; }

/* Peças */
.tile { border-radius: 18px; background: var(--tile); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.piece-card { background: var(--surface); border-radius: 24px; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.piece-card .tile { height: 136px; }
.piece-mini { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.piece-mini .tile { height: 88px; border-radius: 16px; }
.piece-mini span { font-size: 11px; font-weight: 600; color: #3A3A37; line-height: 1.2; }

/* Barra inferior */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; height: var(--tabbar-h); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 0 8px 16px; z-index: 20; }
.tabbar.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 48px; text-decoration: none; color: var(--muted-2); font-size: 11px; font-weight: 600; position: relative; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabbar .fab { justify-self: center; width: 56px; height: 56px; border-radius: 20px; background: var(--ink); color: var(--lime); margin-top: -20px; box-shadow: 0 10px 24px rgba(18,18,18,.25); }
.tabbar .badge { position: absolute; top: 2px; left: 50%; margin-left: 6px; background: var(--orange); color: var(--ink); border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 800; }
.footer-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; padding: 12px 20px 24px; background: var(--ground); border-top: 1px solid var(--line); z-index: 20; display: flex; flex-direction: column; gap: 8px; }

/* Folha inferior (modal) e aviso */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(18,18,18,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--surface); border-radius: 32px 32px 0 0; padding: 14px 20px 28px; display: flex; flex-direction: column; gap: 16px; max-height: 92dvh; overflow-y: auto; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); align-self: center; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 12px 18px; border-radius: 16px; font-weight: 600; font-size: 14px; z-index: 60; max-width: calc(100% - 40px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.loading { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.loading::after { content: ''; width: 32px; height: 32px; border: 3px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.empty { background: var(--surface); border-radius: 24px; padding: 28px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.progress { height: 8px; border-radius: 4px; background: #E2E2DD; overflow: hidden; }
.progress > div { height: 100%; background: var(--violet); border-radius: 4px; }

/* Avatar / provador */
.stage { border-radius: 32px; position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.stage .halo { position: absolute; left: 50%; top: 36px; width: 260px; height: 260px; margin-left: -130px; border-radius: 50%; background: rgba(255,255,255,.35); }
.stage svg { position: relative; }
.initial { display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; color: var(--ink); flex-shrink: 0; }

/* ───────── Site público ───────── */
.site { min-height: 100dvh; display: flex; flex-direction: column; }
.site-header { position: sticky; top: 0; z-index: 30; background: var(--ink); color: var(--ground); }
.site-header .in { max-width: 1200px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ground); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.logo:hover { color: var(--ground); }
.logo .mark { width: 36px; height: 36px; border-radius: 12px; background: var(--lime); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.site-nav-desktop { display: none; gap: 4px; }
.site-nav-desktop a { color: #D6D6D0; text-decoration: none; font-weight: 600; padding: 12px 14px; }
.site-menu { background: var(--ink); padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 4px; border-radius: 0 0 28px 28px; }
.site-menu a.item { min-height: 52px; border-radius: 16px; background: #1F1F1E; color: var(--ground); text-decoration: none; font-weight: 700; font-size: 17px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.site-section { width: 100%; max-width: 1200px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 18px; }
.hero { background: var(--ink); color: var(--ground); overflow: hidden; }
.hero .in { max-width: 1200px; margin: 0 auto; padding: 20px 20px 0; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: 42px; font-weight: 800; letter-spacing: -1.4px; line-height: 0.98; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--violet); }
.section-title { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.site-footer { background: var(--ink); color: #C9C9C3; margin-top: auto; }
.site-footer .in { max-width: 1200px; margin: 0 auto; padding: 36px 20px 40px; display: flex; flex-direction: column; gap: 24px; }
.site-footer a { color: #C9C9C3; }
.cookie-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; }
.cookie-sheet .box { width: 100%; max-width: 560px; background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px rgba(18,18,18,.25); padding: 20px 18px 26px; display: flex; flex-direction: column; gap: 12px; }
.doc-body h2 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.doc-row { background: var(--ground); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }

/* ───────── Admin ───────── */
.admin-head { background: var(--ink); color: var(--ground); padding: 28px 20px 22px; border-radius: 0 0 32px 32px; display: flex; flex-direction: column; gap: 16px; }
.kpi { border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); color: var(--ink); text-decoration: none; min-height: 104px; }
.kpi b { font-family: var(--display); font-size: 28px; letter-spacing: -0.8px; line-height: 1; }

@media (min-width: 900px) {
  .site-nav-desktop { display: flex; }
  .menu-toggle { display: none !important; }
  .hero .in { flex-direction: row; align-items: flex-end; gap: 48px; padding-top: 56px; }
  .hero .in > * { flex: 1; }
  .hero h1 { font-size: 76px; letter-spacing: -2px; }
  .section-title { font-size: 48px; }
  .site-section { padding: 72px 24px; }
  .cols-desktop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .site-footer .in { flex-direction: row; justify-content: space-between; }
  .admin-wide .screen { max-width: 1100px; }
  .admin-wide .tabbar { max-width: 1100px; }
  .admin-wide .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
