/* ==========================================================================
   Ricardo Simões · Sys (painel de conteúdo)
   Mesma paleta e as mesmas fontes da landing. Sem dependências.
   ========================================================================== */
@font-face { font-family: "Gloock"; src: url("../fonts/Gloock-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "ATC Overlook"; src: url("../fonts/ATCOverlook-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "ATC Overlook"; src: url("../fonts/ATCOverlook-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "ATC Overlook"; src: url("../fonts/ATCOverlook-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --obsidian: #293d3f;
  --obsidian-deep: #1f3032;
  --taupe: #a6927a;
  --taupe-light: #ccb69f;
  --taupe-ink: #6b5c49;
  --walnut: #5a5046;
  --warm-gray: #bfb7ad;
  --cloud: #f2eadb;
  --cloud-soft: #f7f2e8;
  --paper: #fffdf9;
  --verde: #2e6b4f;
  --danger: #8f3a2b;
  --line: rgba(166, 146, 122, 0.4);
  --line-soft: rgba(166, 146, 122, 0.22);
  --shadow: 0 1px 2px rgba(41, 61, 63, 0.06), 0 8px 24px -12px rgba(41, 61, 63, 0.18);
  --radius: 10px;
  --side-w: 15.5rem;
  --font-display: "Gloock", Georgia, "Times New Roman", serif;
  --font-body: "ATC Overlook", "Helvetica Neue", Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cloud-soft);
  color: var(--obsidian);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.5;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--obsidian); outline-offset: 2px; border-radius: 4px; }
.side :focus-visible, .login :focus-visible { outline-color: var(--cloud); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--obsidian); color: var(--cloud); padding: 0.6rem 1rem; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* ---------- Estrutura ----------------------------------------------------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.5rem 1rem 1rem;
  background: var(--obsidian); color: var(--cloud);
  overflow-y: auto;
}
.side__brand { display: block; padding: 0 0.5rem; }
.side__brand img { width: 8.5rem; height: auto; }
.side__tag { margin-top: 0.6rem; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--taupe-light); }
.side__nav { display: grid; gap: 2px; }
.side__nav a, .side__link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem; border-radius: 8px;
  color: var(--cloud); text-decoration: none; opacity: 0.82;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
  transition: background-color 160ms, opacity 160ms;
}
.side__nav a:hover, .side__link:hover { background: rgba(242, 234, 219, 0.08); opacity: 1; }
.side__nav a[aria-current="page"] { background: rgba(242, 234, 219, 0.14); opacity: 1; font-weight: 500; }
.side__nav svg, .side__link svg { width: 1.1rem; height: 1.1rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.side__foot { margin-top: auto; display: grid; gap: 2px; padding-top: 1rem; border-top: 1px solid rgba(204, 182, 159, 0.25); }
.side__user { padding: 0.5rem 0.7rem 0.2rem; font-size: 0.8rem; color: var(--taupe-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar { display: none; }
.main { margin-left: var(--side-w); padding: 2rem clamp(1rem, 3vw, 2.5rem) 6rem; max-width: calc(var(--side-w) + 74rem); }

@media (max-width: 56rem) {
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem; background: var(--obsidian); color: var(--cloud);
  }
  .topbar img { height: 1.9rem; width: auto; }
  .topbar__menu { background: none; border: 0; padding: 0.45rem; margin-left: -0.45rem; cursor: pointer; color: inherit; }
  .topbar__menu svg { width: 1.4rem; height: 1.4rem; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }
  .side { transform: translateX(-100%); transition: transform 280ms var(--ease); box-shadow: none; }
  .side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(31, 48, 50, 0.5); }
  .main { margin-left: 0; padding-top: 1.25rem; }
}

/* ---------- Cabeçalho da página ------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.75rem; }
.page-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); line-height: 1.1; }
.page-head p { margin-top: 0.4rem; color: var(--walnut); max-width: 46rem; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.crumb { display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; font-size: 0.82rem; color: var(--taupe-ink); text-decoration: none; }
.crumb:hover { color: var(--obsidian); }

/* ---------- Botões --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.6rem; padding: 0.55rem 1.1rem;
  border: 1px solid var(--obsidian); border-radius: 8px;
  background: var(--obsidian); color: var(--cloud);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 160ms, color 160ms, border-color 160ms, transform 160ms;
}
.btn:hover { background: var(--obsidian-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn--ghost { background: transparent; color: var(--obsidian); border-color: var(--line); }
.btn--ghost:hover { background: rgba(41, 61, 63, 0.06); border-color: var(--obsidian); }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(143, 58, 43, 0.35); }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--small { min-height: 2.1rem; padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.btn svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.linkish { background: none; border: 0; padding: 0; color: var(--verde); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 500; }

/* ---------- Cartões e grades ----------------------------------------------- */
.card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__body { padding: 1.4rem; }
.card__title { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; line-height: 1.2; }
.card__hint { margin-top: 0.3rem; color: var(--walnut); font-size: 0.875rem; }
.card + .card { margin-top: 1.25rem; }
.stack > * + * { margin-top: 1.25rem; }

.cols { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 70rem) { .cols { grid-template-columns: minmax(0, 1fr) 21rem; } .cols > aside { position: sticky; top: 1.5rem; } }
.cols > * > .card + .card { margin-top: 1.25rem; }

.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin-bottom: 1.5rem; }
.stat { padding: 1.1rem 1.25rem; text-decoration: none; display: block; transition: border-color 160ms, transform 160ms; }
a.stat:hover { border-color: var(--taupe); transform: translateY(-2px); }
.stat__n { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.stat__l { margin-top: 0.4rem; color: var(--walnut); font-size: 0.85rem; }

/* ---------- Formulários ---------------------------------------------------- */
.field { display: grid; gap: 0.35rem; }
.field + .field, .field + .row, .row + .field, .row + .row { margin-top: 1.1rem; }
.field > label, .field > .label { font-weight: 500; font-size: 0.875rem; }
.field .hint { color: var(--taupe-ink); font-size: 0.8rem; }
.field .error, .validation { color: var(--danger); font-size: 0.82rem; }
.validation ul { display: grid; gap: 0.2rem; }
.validation:empty, .validation ul:empty { display: none; }
.row { display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .row { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); } .row > .field + .field { margin-top: 0; } }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="url"], .field input[type="tel"], .field textarea, .field select {
  width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--warm-gray); border-radius: 8px; background: #fff;
  transition: border-color 160ms, box-shadow 160ms;
}
.field textarea { resize: vertical; min-height: 2.75rem; line-height: 1.5; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--taupe); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--obsidian); box-shadow: 0 0 0 3px rgba(41, 61, 63, 0.14); }
.field .input-validation-error { border-color: var(--danger); }
.field__meta { display: flex; justify-content: space-between; gap: 1rem; }
.count { color: var(--taupe-ink); font-size: 0.78rem; font-variant-numeric: tabular-nums; margin-left: auto; }
.count.is-over { color: var(--danger); font-weight: 500; }
details.more { margin-top: 1.1rem; border-top: 1px solid var(--line-soft); padding-top: 0.9rem; }
details.more > summary { cursor: pointer; color: var(--taupe-ink); font-size: 0.85rem; font-weight: 500; }
details.more[open] > summary { margin-bottom: 1rem; }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; flex: none; width: 2.5rem; height: 1.45rem; border-radius: 99px; background: var(--warm-gray); transition: background-color 200ms; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.45rem - 6px); height: calc(1.45rem - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 200ms var(--ease); }
.switch input:checked + .switch__track { background: var(--verde); }
.switch input:checked + .switch__track::after { transform: translateX(1.05rem); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--obsidian); outline-offset: 2px; }
.switch__text small { display: block; color: var(--taupe-ink); font-size: 0.78rem; font-weight: 400; }
.switches { display: grid; gap: 0.9rem; }

/* Escolhas visuais (layout, fundo, ícone, cor) */
.choices { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.choices--small { grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice__box { display: grid; gap: 0.5rem; justify-items: center; padding: 0.75rem 0.5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 0.8rem; text-align: center; line-height: 1.25; transition: border-color 160ms, box-shadow 160ms; }
.choice:hover .choice__box { border-color: var(--taupe); }
.choice input:checked + .choice__box { border-color: var(--obsidian); box-shadow: 0 0 0 2px var(--obsidian); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--obsidian); outline-offset: 3px; }
.choice__box svg { width: 2rem; height: 2rem; }
.swatch { width: 100%; height: 2rem; border-radius: 5px; border: 1px solid rgba(41, 61, 63, 0.15); }
/* Miniatura de layout: blocos de foto e de texto */
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; height: 3.4rem; padding: 5px; background: var(--cloud); border-radius: 5px; }
.mini i { display: block; border-radius: 2px; }
.mini .ph { background: var(--taupe); }
.mini .tx { background: repeating-linear-gradient(to bottom, var(--obsidian) 0 2px, transparent 2px 7px); opacity: 0.55; margin: 3px 0; }
.mini .hd { grid-column: 1 / -1; height: 5px; width: 60%; background: var(--obsidian); }
.mini--head { grid-template-rows: auto 1fr; }

/* ---------- Barra de salvar ------------------------------------------------ */
.savebar {
  position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem;
  padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(255, 253, 249, 0.92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.savebar__state { margin-right: auto; color: var(--taupe-ink); font-size: 0.85rem; }
.savebar__state.is-dirty { color: var(--obsidian); font-weight: 500; }
.savebar__state.is-dirty::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.5rem; border-radius: 50%; background: var(--taupe); }
@media (max-width: 56rem) { .savebar { left: 0; } }

/* ---------- Listas ordenáveis --------------------------------------------- */
.rows { display: grid; gap: 0.5rem; }
.rowitem {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.9rem;
  padding: 0.7rem 0.9rem; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: box-shadow 200ms, border-color 200ms, opacity 200ms;
}
.rowitem:hover { border-color: var(--line); }
.rowitem.is-off { opacity: 0.6; }
.rowitem__main { min-width: 0; display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.rowitem__thumb { flex: none; width: 3rem; height: 3rem; border-radius: 6px; background: var(--cloud); object-fit: cover; display: grid; place-items: center; color: var(--taupe-ink); }
.rowitem__thumb svg { width: 1.3rem; height: 1.3rem; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.rowitem__text { min-width: 0; }
.rowitem__title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowitem__sub { color: var(--walnut); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowitem__side { display: flex; align-items: center; gap: 0.9rem; }
@media (max-width: 40rem) { .rowitem__side .chip { display: none; } }

.handle { flex: none; display: grid; place-items: center; width: 1.9rem; height: 2.4rem; border: 0; background: none; border-radius: 6px; color: var(--warm-gray); cursor: grab; touch-action: none; }
.handle:hover { color: var(--obsidian); background: rgba(41, 61, 63, 0.06); }
.handle svg { width: 1rem; height: 1rem; fill: currentColor; }
.handle--none { visibility: hidden; }
.is-dragging { opacity: 0.55; box-shadow: 0 0 0 2px var(--obsidian) !important; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; }

.chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem; border-radius: 99px; background: var(--cloud); color: var(--taupe-ink); font-size: 0.75rem; white-space: nowrap; }
.chip--dark { background: var(--obsidian); color: var(--cloud); }
.chip--warn { background: #f4e3c8; color: #7a5312; }

/* Grade das peças */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; transition: border-color 200ms, box-shadow 200ms, opacity 200ms; }
.tile:hover { border-color: var(--line); box-shadow: var(--shadow); }
.tile.is-off .tile__img, .tile.is-off .tile__text { opacity: 0.45; }
.tile__img { display: block; aspect-ratio: 1; background: var(--cloud-soft); }
.tile__img img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.tile__text { padding: 0.7rem 0.85rem 0.3rem; text-decoration: none; display: block; }
.tile__name { font-weight: 500; line-height: 1.3; }
.tile__detail { margin-top: 0.15rem; color: var(--walnut); font-size: 0.8rem; line-height: 1.35; }
.tile__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0.5rem 0.5rem 0.85rem; }
.tile .handle { position: absolute; top: 0.35rem; left: 0.35rem; background: rgba(255, 253, 249, 0.85); color: var(--taupe-ink); }
.tile__count { position: absolute; top: 0.5rem; right: 0.5rem; }

.empty { padding: 3rem 1.5rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--walnut); }
.empty h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; color: var(--obsidian); margin-bottom: 0.4rem; }
.empty .btn { margin-top: 1.1rem; }

/* ---------- Galeria (fotos de uma peça, de uma seção) --------------------- */
.gallery__list { display: grid; gap: 0.75rem; }
.gallery__list:empty { display: none; }
.gallery__item {
  position: relative; display: grid; grid-template-columns: auto 5.5rem 1fr auto; gap: 0.75rem; align-items: start;
  padding: 0.6rem; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff;
}
.gallery__item img { width: 5.5rem; height: 5.5rem; object-fit: contain; background: var(--cloud-soft); border-radius: 6px; }
.gallery__item .field { margin: 0; }
.gallery__item .handle { align-self: center; }
.gallery__badge { display: none; position: absolute; left: 2.9rem; top: 0.25rem; }
.gallery--multiple .gallery__item:first-child .gallery__badge { display: inline-flex; }
.gallery--single .handle { display: none; }
.gallery--single .gallery__item { grid-template-columns: 5.5rem 1fr auto; }
.gallery--single .gallery__list:not(:empty) + .drop { display: none; }
.iconbtn { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 0; border-radius: 6px; background: none; color: var(--taupe-ink); cursor: pointer; }
.iconbtn:hover { background: rgba(143, 58, 43, 0.1); color: var(--danger); }
.iconbtn svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }

.drop {
  margin-top: 0.75rem; padding: 1.4rem 1rem; text-align: center;
  border: 1.5px dashed var(--warm-gray); border-radius: 8px; background: rgba(242, 234, 219, 0.35);
  color: var(--walnut); transition: border-color 160ms, background-color 160ms;
}
.gallery__list:empty + .drop { margin-top: 0; }
.drop.is-over { border-color: var(--verde); background: rgba(46, 107, 79, 0.08); }
.drop small { display: block; margin-top: 0.3rem; color: var(--taupe-ink); font-size: 0.78rem; }
.drop__busy { display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
.spinner { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--warm-gray); border-top-color: var(--obsidian); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ponto focal */
.focus { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; align-items: center; }
.focus__view { width: 6rem; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--cloud); }
.focus__view img { width: 100%; height: 100%; object-fit: cover; }
input[type="range"] { width: 100%; accent-color: var(--obsidian); }

/* ---------- Itens repetíveis (valores) ------------------------------------- */
.items { display: grid; gap: 0.9rem; }
.item { border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; }
.item__head { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line-soft); }
.item__title { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__body { padding: 1rem; }

/* ---------- Biblioteca de imagens ----------------------------------------- */
.lib { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.lib__item { position: relative; display: block; padding: 0; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; text-align: left; transition: border-color 160ms, box-shadow 160ms; }
.lib__item:hover { border-color: var(--taupe); }
.lib__item[aria-pressed="true"] { border-color: var(--obsidian); box-shadow: 0 0 0 2px var(--obsidian); }
.lib__item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--cloud-soft); }
.lib__cap { display: block; padding: 0.35rem 0.5rem; font-size: 0.72rem; color: var(--walnut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib__flag { position: absolute; top: 0.35rem; left: 0.35rem; }

dialog.modal { width: min(56rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 12px; background: var(--paper); color: inherit; box-shadow: 0 30px 80px -20px rgba(31, 48, 50, 0.6); }
dialog.modal--small { width: min(28rem, calc(100vw - 2rem)); }
dialog.modal::backdrop { background: rgba(31, 48, 50, 0.55); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.modal__head h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; }
.modal__body { padding: 1.25rem; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.9rem 1.25rem; border-top: 1px solid var(--line-soft); position: sticky; bottom: 0; background: var(--paper); }
.asset { display: grid; gap: 1.25rem; }
@media (min-width: 44rem) { .asset { grid-template-columns: 18rem 1fr; } }
.asset img { width: 100%; max-height: 22rem; object-fit: contain; background: var(--cloud-soft); border-radius: 8px; }
.asset dl { margin: 1rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; font-size: 0.85rem; }
.asset dt { color: var(--taupe-ink); }
.asset dd { margin: 0; }

/* ---------- Avisos --------------------------------------------------------- */
.toasts { position: fixed; right: 1rem; bottom: 4.75rem; z-index: 90; display: grid; gap: 0.5rem; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 24rem; padding: 0.7rem 1rem; border-radius: 8px; background: var(--obsidian); color: var(--cloud); box-shadow: var(--shadow); animation: toast-in 320ms var(--ease) both; }
.toast--error { background: var(--danger); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 300ms, transform 300ms; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.note { padding: 0.8rem 1rem; border-radius: 8px; background: var(--cloud); color: var(--walnut); font-size: 0.875rem; }
.note--warn { background: #f4e3c8; color: #7a5312; }

/* ---------- Mapa da página (painel) ---------------------------------------- */
.outline { display: grid; gap: 0; }
.outline a { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 0.75rem; align-items: baseline; padding: 0.7rem 0.25rem; border-top: 1px solid var(--line-soft); text-decoration: none; }
.outline li:first-child a { border-top: 0; }
.outline a:hover .outline__name { text-decoration: underline; text-underline-offset: 3px; }
.outline__n { font-family: var(--font-display); color: var(--taupe); }
.outline__name { font-weight: 500; }
.outline__title { display: block; color: var(--walnut); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline .is-off { opacity: 0.5; }

/* ---------- Prévia de compartilhamento ------------------------------------- */
.share { max-width: 22rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.share img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--cloud); }
.share__text { padding: 0.7rem 0.85rem; }
.share__title { font-weight: 500; line-height: 1.3; }
.share__desc { margin-top: 0.2rem; color: var(--walnut); font-size: 0.82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share__url { margin-top: 0.3rem; color: var(--taupe-ink); font-size: 0.75rem; }

/* ---------- Pré-visualização ------------------------------------------------ */
.preview { display: grid; grid-template-rows: auto 1fr; height: calc(100vh - 4rem); min-height: 30rem; }
.preview__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--cloud); border: 1px solid var(--line-soft); }
.seg button { padding: 0.4rem 0.9rem; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--obsidian); color: var(--cloud); }
.preview__stage { display: grid; justify-items: center; overflow: auto; border-radius: var(--radius); background: repeating-conic-gradient(rgba(166,146,122,.12) 0 25%, transparent 0 50%) 0 0 / 20px 20px; border: 1px solid var(--line-soft); }
.preview__stage iframe { width: 100%; height: 100%; border: 0; background: #fff; transition: width 400ms var(--ease); box-shadow: var(--shadow); }
.main:has(.preview) { padding-bottom: 1rem; max-width: none; }

/* ---------- Login ----------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--obsidian); color: var(--cloud); }
.login__box { width: min(24rem, 100%); }
.login__brand { width: 11rem; margin-bottom: 2.5rem; }
.login h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.15; }
.login p.sub { margin: 0.5rem 0 1.75rem; color: var(--taupe-light); }
.login .field > label { color: var(--cloud); }
.login .field input { background: rgba(242, 234, 219, 0.06); border-color: rgba(204, 182, 159, 0.45); color: var(--cloud); }
.login .field input:focus { border-color: var(--cloud); box-shadow: 0 0 0 3px rgba(242, 234, 219, 0.18); }
.login .btn { width: 100%; margin-top: 1.5rem; background: var(--cloud); color: var(--obsidian); border-color: var(--cloud); }
.login .btn:hover { background: #fff; }
.login .validation { color: #f3c1b6; margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- Acertos finos --------------------------------------------------- */
.stats .card { margin-top: 0; }
.side__brand { text-decoration: none; color: inherit; }
.rowitem__title, .rowitem__sub { display: block; }
.gallery__badge { left: 3.2rem; top: 0.9rem; }
