/* ==========================================================
   Painel do autor — Lhamass
   ========================================================== */
body.admin { font-size: 16px; }
body.admin::before { display: none; }
[hidden] { display: none !important; }

.btn--sm { padding: 10px 16px; font-size: 14px; box-shadow: 3px 3px 0 var(--accent); }

/* topo */
.adm-top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.adm-top__inner { display: flex; align-items: center; gap: 20px; height: 70px; }
.adm-top .brand img { width: 40px; height: 40px; }
.adm-top .brand__name { font-size: 19px; }
.adm-nav { display: flex; gap: 4px; margin-left: auto; }
.adm-nav a { padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; }
.adm-nav a:hover, .adm-nav a.is-active { background: var(--ink); color: var(--bg); }
.adm-logout button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px; }
.adm-logout button:hover { color: var(--accent); }

.adm-flash {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: 999px; font-weight: 500;
  animation: flash 4.5s forwards; box-shadow: 4px 4px 0 var(--lime); max-width: calc(100% - 32px);
}
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, -10px); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }

.adm-main { padding: 40px 0 80px; }
.adm-muted { color: var(--muted); }
.adm-error { background: #ffe0d6; color: #8a1f05; border: 1.5px solid #f2a28c; padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: 15px; }

/* login */
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--lilac) 45%, transparent), transparent 40%),
  radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--lime) 45%, transparent), transparent 40%); }
.adm-login__box { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 36px; box-shadow: var(--shadow); text-align: center; }
.adm-login__logo { width: 84px; margin: 0 auto 12px; border-radius: 50%; box-shadow: var(--logo-ring); }
.adm-login h1 { font-family: var(--f-display); font-weight: 400; font-size: 34px; letter-spacing: -.02em; margin: 0 0 6px; line-height: 1.1; }
.adm-login h1 em { color: var(--accent); }
.adm-login .fld { text-align: left; }
.adm-login .back { display: inline-flex; }

/* campos */
.fld { display: grid; gap: 6px; margin-bottom: 16px; }
.fld > span { font-weight: 600; font-size: 14px; }
.fld small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.fld input, .fld textarea, .adm-search input {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .2s;
  font-family: var(--f-body); font-size: 15px; resize: vertical;
}
.fld input:focus, .fld textarea:focus, .adm-search input:focus { border-color: var(--ink); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0 12px; cursor: pointer; flex-wrap: wrap; }
.check small { color: var(--muted); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* dashboard */
.adm-hello { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.adm-hello h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.025em; line-height: 1.08; margin: 6px 0 0; }
.adm-hello h1 em { color: var(--accent); }
.adm-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 28px; }
.adm-stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.adm-stats strong { display: block; font-family: var(--f-display); font-size: 32px; font-weight: 500; line-height: 1.1; }
.adm-stats span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.adm-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.adm-toolbar .chip small { opacity: .6; margin-left: 4px; font-family: var(--f-mono); }
.adm-search input { width: 260px; border-radius: 999px; background: var(--card); }

.adm-list { display: grid; gap: 10px; }
.adm-row { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 12px 12px; transition: border-color .2s; }
.adm-row:hover { border-color: var(--ink); }
.adm-row--simple { grid-template-columns: 1fr auto auto; padding: 14px 18px; }
.adm-row__thumb { width: 72px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; }
.adm-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.adm-row__thumb span { font-family: var(--f-display); font-size: 40px; line-height: 1; padding-top: 14px; }
.adm-row__thumb.fmt-frase.card--lime { background: var(--lime); color: #151515; }
.adm-row__thumb.fmt-frase.card--lilac { background: var(--lilac); color: #151515; }
.adm-row__thumb.fmt-frase.card--ink { background: #151515; color: var(--lime); }
.adm-row__title { font-family: var(--f-display); font-size: 19px; font-weight: 500; line-height: 1.25; display: block; margin-bottom: 6px; }
.adm-row__title:hover { color: var(--accent); }
.adm-row__state { text-align: right; display: grid; gap: 4px; justify-items: end; }
.adm-row__state small { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.adm-row__actions { display: flex; gap: 6px; }
.adm-row__actions .icon-btn, .adm-row--simple .icon-btn { width: 38px; height: 38px; font-size: 15px; }
.adm-empty { text-align: center; padding: 64px 16px; background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); font-family: var(--f-mono); color: var(--muted); }

.pill { font-family: var(--f-mono); font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1.5px solid #151515; color: #151515; white-space: nowrap; }
.pill--publicado { background: var(--lime); }
.pill--rascunho { background: #ececec; }
.pill--agendado { background: var(--sky); }
.pill--novo { background: var(--sun); }

/* editor */
.editor__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.editor__main, .editor__side { display: grid; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel--sticky { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }

/* passos numerados automaticamente (painéis escondidos não contam) */
.editor__main { counter-reset: step; }
.panel[data-step] > .panel__title::before { counter-increment: step; content: counter(step) ". "; }
.panel.is-missing { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.adm-tip { font-size: 13px; margin: 0 0 10px; line-height: 1.45; }
.panel__title { font-family: var(--f-pixel); font-weight: 400; font-size: 13px; letter-spacing: .05em; margin: 0 0 16px; text-transform: uppercase; }
.panel__title small { font-family: var(--f-body); text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 13px; margin-left: 6px; }

.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.format input, .cat input, .color input { position: absolute; opacity: 0; pointer-events: none; }
.format__box { display: grid; gap: 4px; height: 100%; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: all .2s; }
.format__box:hover { border-color: var(--ink); }
.format__ico { font-size: 24px; }
.format__box b { font-size: 15px; }
.format__box small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.format input:checked + .format__box { border-color: #151515; background: var(--lime); color: #151515; box-shadow: 4px 4px 0 #151515; }
.format input:checked + .format__box small { color: #3a3833; }
.format input:focus-visible + .format__box, .cat input:focus-visible + span, .color input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.editor__title {
  width: 100%; border: 0; background: transparent; outline: none; resize: none; overflow: hidden;
  font-family: var(--f-display); font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -.025em;
  padding: 0 0 12px; margin-bottom: 16px; border-bottom: 1.5px dashed var(--line);
}

/* Quill */
.ql-toolbar.ql-snow { border: 1.5px solid var(--line); border-radius: 12px 12px 0 0; background: var(--bg); font-family: var(--f-body); }
.ql-container.ql-snow { border: 1.5px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; font-family: var(--f-body); font-size: 17px; }
.ql-editor { min-height: 340px; line-height: 1.7; color: var(--ink); }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.ql-editor h2 { font-family: var(--f-display); font-weight: 500; font-size: 28px; }
.ql-editor h3 { font-family: var(--f-display); font-weight: 500; font-size: 22px; }
.ql-editor blockquote { border-left: 4px solid var(--lime) !important; font-family: var(--f-display); font-style: italic; font-size: 22px; }
.ql-editor img { border-radius: 10px; margin: 8px 0; }
.ql-snow .ql-stroke { stroke: var(--ink); }
.ql-snow .ql-fill { fill: var(--ink); }
.ql-snow .ql-picker { color: var(--ink); }
.ql-snow .ql-picker-options { background: var(--card); }

/* fotos */
.photos-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo-edit { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; background: var(--bg); }
.photo-edit img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.photo-edit input[type=text], .photo-edit input:not([type]) { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: var(--card); width: 100%; }
.photo-edit__row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-family: var(--f-mono); color: var(--muted); }
.photo-edit__row input[type=number] { width: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; background: var(--card); margin-left: 2px; }
.photo-edit .del { display: flex; gap: 4px; align-items: center; cursor: pointer; }
.photo-edit .del:has(input:checked) { color: var(--accent); font-weight: 600; }
.photo-edit:has(.del input:checked) img { opacity: .3; }

.dropzone, .cover-drop {
  display: grid; place-items: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line);
  border-radius: var(--radius-sm); cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
}
.dropzone:hover, .dropzone.is-over, .cover-drop:hover, .cover-drop.is-over { border-color: var(--ink); background: var(--bg); }
.dropzone input, .cover-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone small { color: var(--muted); font-size: 12px; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.cover-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cover-drop { padding: 0; min-height: 200px; }
.cover-drop img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.cover-drop > span:not(.cover-drop__swap) { padding: 48px 16px; color: var(--muted); display: grid; gap: 4px; }
.cover-drop > span b { color: var(--ink); }
.cover-drop > span small { font-size: 12px; }
.cover-drop__swap { position: absolute; right: 10px; bottom: 10px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; pointer-events: none; }
.star { display: flex; gap: 4px; align-items: center; cursor: pointer; }
.star:has(input:checked) { color: var(--accent); font-weight: 600; }

.body-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.body-head__label { font-weight: 600; font-size: 14px; }
.body-head__label small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* lateral */
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat span, .color span { display: inline-block; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; transition: all .2s; }
.cat span { font-size: 15px; padding: 10px 16px; }
.cat span:hover, .color span:hover { border-color: var(--ink); }
.cat input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.colors { display: grid; gap: 8px; }
.colors--row { grid-template-columns: repeat(3, 1fr); }
.color span { display: block; border-radius: 12px; font-family: var(--f-display); font-style: italic; padding: 12px 14px; }
.color input:checked + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.color .card--lime, .color .card--lilac { color: #151515; }
.color .card--ink { color: #f3efe7; }

.where-box summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: 4px 0; }
.where-box[open] summary { margin-bottom: 10px; }
.where { background: var(--bg); border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 14px; }
.where__head { margin: 0 0 10px; font-weight: 600; font-size: 14px; }
.where ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.where li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.35; }
.where li > span { font-size: 16px; }
.where li small { display: block; color: var(--muted); font-size: 12px; }
.editor__actions { display: grid; gap: 10px; margin-bottom: 20px; }
.editor__actions .btn { justify-content: center; }
.editor__actions .link-arrow { justify-self: center; font-size: 14px; margin-top: 4px; }

@media (max-width: 1020px) {
  .editor__grid { grid-template-columns: 1fr; }
  .panel--sticky { position: static; max-height: none; }
  .adm-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .adm-top__inner { gap: 10px; }
  .adm-top .brand__name { display: none; }
  .adm-nav a { padding: 8px 10px; font-size: 14px; }
  .adm-nav a[target] { display: none; }
  .formats { grid-template-columns: 1fr; }
  .cover-wrap, .colors--row { grid-template-columns: 1fr; }
  .adm-stats { grid-template-columns: repeat(2, 1fr); }
  .adm-row { grid-template-columns: 56px 1fr; }
  .adm-row__thumb { width: 56px; height: 48px; }
  .adm-row__state { justify-items: start; text-align: left; grid-column: 2; display: flex; gap: 8px; align-items: center; }
  .adm-row__actions { grid-column: 2; }
  .adm-search input { width: 100%; }
  .adm-search { flex: 1; }
  .panel { padding: 18px; }
}
