/* Dash-base · layout v2
   Fundo claro, superfícies brancas, acento cobalto (troque em APP_ACCENT no .env).
   Títulos: Bricolage Grotesque · Texto: Instrument Sans */

:root {
  --accent: #3046C5;
  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --surface-2: #FCFCFA;
  --border: #E3E3DD;
  --border-soft: #EFEFEA;
  --border-strong: #CFCFC7;
  --text: #1B1C1A;
  --text-2: #3C3D39;
  --muted: #62645E;
  --disabled: #9A9B94;
  --hover: #ECECE6;
  --hover-soft: #FAFAF8;
  --off: #D6D6CF;
  --ok: #1F6B4F;      --ok-bg: #E4F1EB;
  --warn: #7A4F00;    --warn-bg: #FBF1DC;
  --danger: #A3401F;  --danger-bg: #FBEBE3; --danger-border: #E2A58C;
  --info: #23338F;    --info-bg: #E8EBF5;
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); 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;
}
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.nums { font-variant-numeric: tabular-nums; }

/* ---------- Estrutura ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar {
  flex: 0 0 256px; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.page {
  padding: 8px 40px 96px; width: 100%; max-width: 1180px;
  display: flex; flex-direction: column; gap: 32px;
}
.page.wide-gap { gap: 56px; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--text); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }

/* ---------- Menu lateral ---------- */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 12px 6px; font-size: 13px; color: var(--muted); }
.nav {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px;
  border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 500;
  border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(27,28,26,.06), 0 0 0 1px var(--border); }
.nav.on svg { color: var(--accent); }
.nav .grow { flex: 1; }
.nav-badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.me {
  display: flex; align-items: center; gap: 10px; padding: 12px; margin-top: 8px;
  border-top: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.me-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-type { font-size: 13px; color: var(--muted); }

/* ---------- Topo fixo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 40px; }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin-right: 8px; opacity: 0; }
.topbar .spacer { flex: 1; }
.progress { height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.topbar .menu-btn { display: none; }

/* ---------- Busca ---------- */
.search {
  flex: 1 1 260px; max-width: 460px; display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 12px 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text); }
.search input:focus-visible { outline: none; }
.kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }

/* ---------- Botões ---------- */
.btn {
  height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s, transform .15s;
}
.btn:hover { background: #F1F1EC; color: var(--text); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); color: #fff; filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); font-weight: 600; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn-link { border: 0; background: none; padding: 0; height: auto; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn-link:hover { color: var(--text); background: none; }
.btn[disabled], .btn:disabled { color: var(--disabled); cursor: not-allowed; filter: none; transform: none; }
.icon-btn { width: 44px; padding: 0; }

/* ---------- Títulos e cabeçalho da página ---------- */
.hero { padding-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.display {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 5vw, 60px); line-height: 1; letter-spacing: -0.03em;
}
.display.xl { font-size: clamp(44px, 6vw, 76px); line-height: .98; letter-spacing: -0.035em; }
.lead { margin: 0; font-size: 17px; color: var(--text-2); max-width: 40em; }
.hero .eyebrow { margin: 0; color: var(--muted); }
.h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.015em; }
.section { display: flex; flex-direction: column; gap: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Cartões e linhas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-pad { padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.card-clip { overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; border-bottom: 1px solid var(--border-soft); transition: background .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover-soft); }
.row-text { flex: 1 1 260px; display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 14px; }
.tile {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.tile.lg { width: 44px; height: 44px; }
.card-head { display: flex; flex-direction: column; gap: 2px; }
.card-head p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Avatar, selos ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; }
.avatar.xl {
  width: 112px; height: 112px; border-radius: 34px;
  font-family: var(--font-display); font-weight: 700; font-size: 40px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 13px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pill.lg { height: 28px; padding: 0 12px; }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.tag.outline { height: 28px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 14px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.tag.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; font-weight: 600; }

/* ---------- Seletor segmentado e chips ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--hover); }
.seg a, .seg label > span {
  height: 36px; padding: 0 14px; border-radius: 9px; display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; transition: background .2s, color .2s;
}
.seg a[aria-current="true"], .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(27,28,26,.10); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
  border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 14px; font-weight: 500; text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: #C9C9C1; color: var(--text); }
.chip[aria-current="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.chip .count { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }

/* ---------- Números do painel ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 168px; border-radius: 18px; }
.stat-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat-value-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 36px; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.delta { font-size: 13px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.spark { width: 100%; height: 40px; margin-top: auto; overflow: visible; }
.meter { height: 10px; border-radius: 5px; background: var(--hover); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 5px; background: var(--accent); transform-origin: left; }
.meter.thin { height: 8px; border-radius: 4px; background: #F1F1EC; }

/* ---------- Cartões de módulo ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.mod {
  padding: 18px; display: flex; flex-direction: column; gap: 14px; border-radius: 18px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.mod:hover { border-color: #D3D3CB; box-shadow: 0 14px 30px -20px rgba(27,28,26,.35); transform: translateY(-2px); }
.mod.off { opacity: .62; }
.mod-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mod-name { font-weight: 600; font-size: 16px; }
.mod-desc { font-size: 14px; color: var(--muted); }
.mod-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--border-soft); margin-top: auto;
}
.add-card {
  border: 1.5px dashed var(--border-strong); border-radius: 18px; min-height: 180px; padding: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  color: var(--text-2); text-decoration: none; font-weight: 600; transition: border-color .2s, background .2s, color .2s;
  position: relative; cursor: pointer;
}
.add-card:hover, .add-card.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, #fff); color: var(--accent); }
.add-card small { font-weight: 400; font-size: 13px; color: var(--muted); }

/* ---------- Switch (checkbox de verdade, funciona sem JavaScript) ---------- */
.switch {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: var(--off); cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .22s cubic-bezier(.3,.7,.2,1.2);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 21px; }
.switch:disabled { cursor: not-allowed; }
.switch:disabled:checked { background: color-mix(in srgb, var(--accent) 45%, #fff); }
.switch.lg { width: 48px; height: 28px; border-radius: 14px; }
.switch.lg::after { width: 22px; height: 22px; }
.switch.lg:checked::after { left: 23px; }

.check { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.check-label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; min-height: 44px; }
.check-label.off { color: var(--disabled); cursor: not-allowed; }

/* ---------- Atividade (linha do tempo) ---------- */
.timeline { position: relative; padding: 10px 22px; }
.timeline::before, .timeline .rail {
  content: ""; position: absolute; left: 41px; top: 34px; bottom: 34px; width: 2px; background: var(--hover); display: block;
}
.timeline .rail { background: var(--accent); transform-origin: top; }
.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; }
.timeline .avatar { position: relative; z-index: 1; box-shadow: 0 0 0 4px #fff; }
.timeline .when { font-size: 13px; color: var(--muted); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 14px 12px; }
.table td { padding: 12px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; text-align: right; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--hover-soft); }
.table tbody tr.selected { background: color-mix(in srgb, var(--accent) 6%, #fff); }
.person { display: flex; align-items: center; gap: 12px; }
.person-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.person-name { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; }
.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 14px;
}
.empty { margin: 0; padding: 32px 22px; text-align: center; color: var(--muted); }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 18px; }
.form-grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 18px; }
.span-all { grid-column: 1 / -1; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 500; font-size: 14px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.inp {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.inp.tall { height: 48px; }
textarea.inp { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
select.inp { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.inp[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: 13px; color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); }
.pass-wrap { position: relative; }
.pass-wrap .inp { padding-right: 52px; }
.pass-eye {
  position: absolute; right: 2px; top: 2px; width: 44px; height: calc(100% - 4px);
  border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 0 4px; }
.setting-text { display: flex; flex-direction: column; line-height: 1.3; }

/* ---------- Seções de edição ---------- */
.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.subnav { flex: 0 0 200px; position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.split-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.anchor { scroll-margin-top: 96px; }
.danger-zone {
  border: 1px solid #F0CDBE; border-radius: var(--radius-lg); padding: 24px 26px; background: #FFFBF9;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
}
.provider-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--border-soft); }
.provider-icon { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex: none; }
.profile-head { padding-top: 24px; display: flex; flex-direction: row; flex-wrap: wrap; gap: 28px; align-items: center; }
.photo-box { position: relative; width: 112px; height: 112px; flex: none; }
.photo-btn {
  position: absolute; right: -6px; bottom: -6px; width: 44px; height: 44px; border-radius: 22px;
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px -8px rgba(27,28,26,.4);
}
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  height: 48px; padding: 0 2px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none; box-shadow: inset 0 -2px 0 transparent;
  transition: color .15s, box-shadow .2s;
}
.tab:hover { color: var(--text); }
.tab[aria-current="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.tab .count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--hover); color: var(--text-2);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.tab .count.hot { background: var(--accent); color: #fff; }
.code-tree { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--text-2); white-space: pre; overflow-x: auto; }
.code-tree span { color: var(--muted); }

/* ---------- Permissões ---------- */
.type-list { flex: 0 0 230px; position: sticky; top: 96px; display: flex; flex-direction: column; gap: 4px; }
.type-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid transparent; color: var(--text); text-decoration: none; font-weight: 500;
  transition: background .2s, box-shadow .2s;
}
.type-item:hover { background: var(--hover); color: var(--text); }
.type-item[aria-current="true"] { background: var(--surface); border-color: var(--border); box-shadow: 0 1px 2px rgba(27,28,26,.06); font-weight: 600; }
.type-item .count { font-size: 13px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.group-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); }
.group-head .ini { width: 36px; height: 36px; border-radius: 10px; font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.perm-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid #F2F2EE; transition: background .15s; }
.perm-row:first-of-type { border-top: 0; }
.perm-row:hover { background: var(--hover-soft); }
.perm-name { flex: 1 1 220px; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; font-weight: 500; }
.perm-group.off { opacity: .6; }
.notice { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 14px; font-size: 14px; }
.notice.info { background: var(--info-bg); color: var(--info); }
.notice.warn { background: var(--warn-bg); color: #5C3D00; align-items: flex-start; }

/* ---------- Barra flutuante e avisos ---------- */
.floatbar {
  position: sticky; bottom: 20px; align-self: center; z-index: 15;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 8px 8px 20px; border-radius: 16px; background: var(--text); color: #fff;
  box-shadow: 0 18px 40px -16px rgba(27,28,26,.55); animation: pop .35s cubic-bezier(.2,.8,.2,1.1) both;
}
.floatbar .msg { margin-right: 12px; font-weight: 600; }
.floatbar .fb-btn {
  height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12);
  color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
}
.floatbar .fb-btn.quiet { background: transparent; color: var(--off); }
.floatbar .fb-btn.go { background: var(--accent); font-weight: 600; }
.floatbar select { height: 40px; border-radius: 10px; border: 0; padding: 0 10px; background: rgba(255,255,255,.12); color: #fff; }
.floatbar select option { color: var(--text); }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--border); box-shadow: 0 18px 40px -20px rgba(27,28,26,.45);
  font-weight: 500; animation: pop .35s cubic-bezier(.2,.8,.2,1.1) both;
}
.toast svg { flex: none; margin-top: 2px; }
.toast.success { color: var(--ok); }
.toast.error { color: var(--danger); }
.toast.warning { color: var(--warn); }
.toast .toast-close { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; }
.alert-box { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; }
.alert-box.error { background: var(--danger-bg); color: var(--danger); }
.alert-box.success { background: var(--ok-bg); color: var(--ok); }
.alert-box.warning { background: var(--warn-bg); color: var(--warn); }

/* ---------- Tela de login ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-main { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; padding: 32px 40px; }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 0; }
.auth-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 28px; }
.auth-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1.05; letter-spacing: -0.025em; }
.auth-box form { display: flex; flex-direction: column; gap: 16px; }
.social { display: flex; flex-direction: column; gap: 10px; }
.social-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.social .btn { height: 48px; font-weight: 500; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.auth-foot a { color: var(--muted); }
.auth-aside {
  flex: 1.15 1 520px; min-width: 0; min-height: 560px; margin: 14px; border-radius: 28px;
  background: color-mix(in srgb, var(--accent) 12%, #F1F2F6); position: relative; overflow: hidden;
}
.drift-grid { position: absolute; inset: -20% -10%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; transform: rotate(-9deg); }
.drift { display: flex; flex-direction: column; gap: 18px; animation: drift var(--dur, 48s) linear infinite; }
.drift.rev { animation-direction: reverse; }
.drift-card {
  background: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 0 rgba(27,28,26,.04), 0 12px 32px -18px rgba(30,40,90,.35);
}
.drift-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.mini-switch { width: 34px; height: 20px; border-radius: 10px; background: var(--off); position: relative; }
.mini-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.mini-switch.on { background: var(--accent); }
.mini-switch.on::after { left: 16px; }
.aside-note {
  position: absolute; left: 24px; right: 24px; bottom: 24px; max-width: 460px; padding: 24px 26px; border-radius: 20px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.aside-note strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.15; letter-spacing: -0.015em; }
.aside-note p { margin: 8px 0 0; color: var(--text-2); }
.rise { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.rise.d2 { animation-delay: .08s; } .rise.d3 { animation-delay: .16s; } .rise.d4 { animation-delay: .24s; }

/* ---------- Animações ---------- */
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes topbar { from { background-color: rgba(246,246,243,0); box-shadow: 0 1px 0 rgba(227,227,221,0); } to { background-color: rgba(255,255,255,.84); box-shadow: 0 1px 0 var(--border); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mini { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes heroout { to { opacity: 0; transform: translateY(-36px) scale(.97); filter: blur(5px); } }
@keyframes inview { from { opacity: 0; transform: translateY(32px) scale(.975); } to { opacity: 1; transform: none; } }
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Efeitos ligados à rolagem (navegadores que suportam) */
@supports (animation-timeline: scroll()) {
  .topbar { animation: topbar linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  .topbar-title { animation: mini linear both; animation-timeline: scroll(root); animation-range: 140px 240px; }
  .hero { animation: heroout linear both; animation-timeline: view(); animation-range: exit 0% exit 90%; }
  .in-view { animation: inview linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  .draw { animation: draw linear both; animation-timeline: view(); animation-range: entry 10% entry 100%; }
  .bar-in { animation: grow linear both; animation-timeline: view(); animation-range: entry 10% entry 100%; }
  .timeline { view-timeline: --act block; }
  .timeline .rail { animation: growy linear both; animation-timeline: --act; animation-range: cover 15% cover 75%; }
}
@supports not (animation-timeline: scroll()) {
  .topbar { background: rgba(255,255,255,.84); box-shadow: 0 1px 0 var(--border); }
  .topbar-title { opacity: 1; }
  .progress { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .topbar-title { opacity: 1; }
  .progress { display: none; }
}

/* ---------- Telas menores ---------- */
@media (max-width: 1240px) {
  /* Menu de seções e lista de tipos viram uma linha acima do conteúdo */
  .subnav, .type-list { position: static; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; }
  .subnav .nav, .type-item { width: auto; }
  .type-item { gap: 8px; }
}
@media (max-width: 960px) {
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; height: 100vh;
    background: var(--bg); transform: translateX(-105%); transition: transform .25s;
  }
  .shell.menu-open .sidebar { transform: none; box-shadow: 20px 0 40px -20px rgba(27,28,26,.35); }
  .topbar .menu-btn { display: inline-flex; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(27,28,26,.35); }
  .topbar-inner, .page { padding-left: 16px; padding-right: 16px; }
  .form-grid-6 > * { grid-column: 1 / -1; }
  .auth-main { padding: 24px 16px; }
  .auth-aside { display: none; }
  .toasts { right: 16px; left: 16px; bottom: 16px; }
}
