/* Panel de administración. Hoja independiente: no depende del tema del blog. */
:root {
  --bg: #F4F6F8; --surface: #FFFFFF; --line: #D5DCE3; --ink: #17212B; --muted: #55657A;
  --brand: #12384F; --brand-ink: #E8F3FA; --link: #1B5E8A; --primary: #7CC4F2; --primary-hover: #66B5E8;
  --ok: #1F6B3A; --ok-bg: #E4F3E3; --warn: #7A4A00; --warn-bg: #FFF1D6; --err: #A3200F; --err-bg: #FBE7E1;
  --radius: 10px; --f-display: 'Bricolage Grotesque', system-ui, sans-serif; --f-ui: 'Instrument Sans', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.adm { margin: 0; font: 400 1rem/1.55 var(--f-ui); color: var(--ink); background: var(--bg); min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { body.adm { grid-template-columns: 252px minmax(0, 1fr); } }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #1B6AA0; outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.small, small { font-size: .85rem; color: var(--muted); }
small { display: block; margin-top: 4px; }
code { font: 500 .85em ui-monospace, Consolas, monospace; background: #EAEFF3; padding: 1px 6px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }

/* ---- Menú lateral ---- */
.side { background: var(--brand); color: var(--brand-ink); display: flex; flex-direction: column; gap: 8px; padding: 16px; }
@media (min-width: 900px) { .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 16px; } }
.side__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 1.2rem/1.1 var(--f-display); padding: 4px 8px 12px; }
.side__brand img { border-radius: 50%; background: #fff2; object-fit: contain; }
.side__brand small { color: #9CC3DA; font: 500 .75rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; margin: 2px 0 0; }
.side__nav { display: flex; flex-wrap: wrap; gap: 4px; }
@media (min-width: 900px) { .side__nav { display: block; } }
.side__group { width: 100%; margin: 14px 8px 4px; font: 700 .7rem var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: #8EB6CE; }
.side__nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--brand-ink); text-decoration: none; font-weight: 500; }
.side__nav a:hover { background: #ffffff1a; }
.side__nav a[aria-current="page"] { background: #fff; color: var(--brand); font-weight: 700; }
.side__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid #ffffff33; }
.side__foot a, .side__foot button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--brand-ink); font: 500 .95rem var(--f-ui); text-decoration: underline; cursor: pointer; }
.side__foot a:hover, .side__foot button:hover { background: #ffffff1a; }
.side__foot form { margin: 0; }

/* ---- Contenido ---- */
.main { padding: 24px 16px 96px; max-width: 1240px; width: 100%; }
@media (min-width: 900px) { .main { padding: 32px 40px 96px; } }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.head__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head__actions form { margin: 0; }
.crumbs { font-size: .85rem; margin: 0 0 6px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.flash { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius); font-weight: 600; border: 1px solid; }
.flash--ok { color: var(--ok); background: var(--ok-bg); border-color: #9DCFA9; }
.flash--err { color: var(--err); background: var(--err-bg); border-color: #E3A99E; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.card__desc { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }
.card > h2 + :not(.card__desc) { margin-top: 12px; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.cols { display: grid; gap: 16px; }
@media (min-width: 1100px) { .cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } .cols--theme { grid-template-columns: minmax(0, 1fr) 360px; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: grid; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--link); }
.stat__n { font: 800 1.9rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.stat__l { color: var(--muted); font-size: .85rem; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.plain { list-style: none; margin: 0 0 8px; padding: 0; } .plain li { padding: 10px 0; border-bottom: 1px solid var(--line); } .plain li:last-child { border: 0; }
.empty { padding: 32px 8px; text-align: center; color: var(--muted); } .empty__t { font: 800 1.3rem var(--f-display); color: var(--ink); margin: 0 0 4px; }
.card .empty { padding: 8px 0; text-align: left; }

/* ---- Lista de comprobación ---- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist .check { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checklist .check:last-child { border: 0; }
.check__i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.check--ok .check__i { background: var(--ok-bg); color: var(--ok); } .check--todo .check__i { background: var(--warn-bg); color: var(--warn); }
.check strong { display: block; font-weight: 600; }

/* ---- Botones, insignias ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; font: 600 .95rem var(--f-ui); cursor: pointer; text-decoration: none; background: var(--surface); color: var(--ink); }
.btn--primary { background: var(--primary); color: #0E1C26; border-color: #4FA6DC; } .btn--primary:hover { background: var(--primary-hover); color: #0E1C26; }
.btn--ghost { background: var(--surface); border-color: #B3BFCB; color: var(--ink); } .btn--ghost:hover { background: #EDF1F5; color: var(--ink); }
.btn--danger { background: var(--surface); border-color: #D9A097; color: var(--err); } .btn--danger:hover { background: var(--err-bg); color: var(--err); }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: .88rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btnrow form { margin: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 600 .78rem var(--f-ui); white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok); } .badge--warn { background: var(--warn-bg); color: var(--warn); } .badge--draft { background: #E6EBF0; color: #3F4D5E; }

/* ---- Formularios ---- */
.field { display: grid; gap: 4px; min-width: 0; align-content: start; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label, .tick { font-weight: 600; font-size: .92rem; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: 400 1rem var(--f-ui); color: var(--ink); background: #fff; border: 1px solid #9AA9B8; border-radius: 8px; }
textarea { resize: vertical; line-height: 1.5; }
input[type="color"] { padding: 2px; width: 64px; cursor: pointer; }
input[type="range"] { padding: 0; min-height: 32px; accent-color: #1B6AA0; }
input[type="file"].sr { width: 1px; }
.input--lg { font: 700 1.25rem var(--f-display); min-height: 52px; }
.mono { font: 400 .92rem/1.55 ui-monospace, Consolas, monospace; }
.tick { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.tick input { width: 22px; height: 22px; min-height: 22px; accent-color: #1B6AA0; flex: none; }
.grid2, .grid3 { display: grid; gap: 0 16px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }
.field--num { max-width: 110px; } .wide { grid-column: 1 / -1; }
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; margin: 0 -16px; background: #F4F6F8ee; border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
@media (min-width: 900px) { .savebar { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); } }

/* ---- Tablas ---- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filters a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #B3BFCB; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; }
.filters a span { color: var(--muted); font-size: .85rem; }
.filters a[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); } .filters a[aria-current="true"] span { color: #C9D3DD; }
.tblwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; padding: 12px 16px; font: 700 .75rem var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #F8FAFB; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border: 0; }
.tbl__title { font-weight: 700; color: var(--ink); text-decoration: none; } .tbl__title:hover { color: var(--link); text-decoration: underline; }
.tbl__cell { width: 1%; white-space: nowrap; } .tbl__act { display: flex; gap: 6px; justify-content: flex-end; } .tbl__act form { margin: 0; } .nowrap { white-space: nowrap; }
@media (max-width: 799px) {
  .tbl thead { display: none; } .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 12px 16px; border-bottom: 1px solid var(--line); } .tbl tr:last-child { border: 0; }
  .tbl td { padding: 4px 0; border: 0; } .tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  .tbl__cell { width: auto; white-space: normal; } .tbl__act { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
}

/* ---- Editor de entradas y productos ---- */
.editor { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr) 340px; } .editor--narrow { grid-template-columns: minmax(0, 1fr) 420px; } }
.editor__main, .editor__side { display: grid; gap: 16px; min-width: 0; align-content: start; }
@media (min-width: 1100px) { .sticky { position: sticky; top: 16px; z-index: 5; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #EEF2F6; border: 1px solid #9AA9B8; border-bottom: 0; border-radius: 8px 8px 0 0; }
.toolbar button { min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: 600 .88rem var(--f-ui); color: var(--ink); cursor: pointer; }
.toolbar button:hover { background: #fff; border-color: #B3BFCB; }
.toolbar__sp { flex: 1; }
.toolbar + textarea { border-radius: 0 0 8px 8px; }
.preview { width: 100%; height: 520px; border: 1px solid #9AA9B8; border-radius: 8px; background: #fff; margin-top: 8px; }
.preview[hidden] { display: none; }

/* ---- Selector de imágenes ---- */
.picker { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.picker legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: 8px; }
.picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 280px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFB; }
.thumb { position: relative; display: block; border-radius: 8px; overflow: hidden; cursor: pointer; border: 3px solid transparent; background: #fff; aspect-ratio: 4/3; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb input { position: absolute; opacity: 0; inset: 0; }
.thumb__ok { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: #1B6AA0; color: #fff; display: none; place-items: center; font-weight: 800; font-size: .85rem; }
.thumb:has(input:checked) { border-color: #1B6AA0; } .thumb:has(input:checked) .thumb__ok { display: grid; }
.thumb:has(input:focus-visible) { outline: 3px solid #1B6AA0; outline-offset: 2px; }
.picker__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }

/* ---- Productos e imágenes ---- */
.pgrid, .mgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pcard, .mcard { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pcard img, .mcard img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #E6EBF0; }
.pcard__b, .mcard figcaption { padding: 14px; display: grid; gap: 6px; }
.pcard h2 { font-size: 1.05rem; } .pcard__p { font: 800 1.2rem var(--f-display); margin: 0; }
.mcard__n { font: 500 .8rem ui-monospace, Consolas, monospace; word-break: break-all; }
.mcard figcaption form { margin: 0; }
.mcard .badge { justify-self: start; }
.mgrid { margin-top: 16px; }

/* ---- Comentarios ---- */
.clist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ccard { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ccard p { margin: 0 0 6px; } .ccard time { color: var(--muted); font-size: .85rem; margin-left: 6px; } .ccard form { margin: 0; }

/* ---- Aspecto ---- */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.preset { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 12px; border: 1px solid #9AA9B8; border-radius: 8px; background: #fff; color: var(--ink); font: 600 .9rem var(--f-ui); cursor: pointer; }
.preset:hover { background: #EDF1F5; }
.dots { display: inline-flex; } .dots i { width: 18px; height: 18px; border: 1.5px solid #17212B; border-radius: 50%; display: block; } .dots i + i { margin-left: -6px; }
.swatches { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.swatch { display: grid; gap: 4px; } .swatch label { font-weight: 600; font-size: .88rem; }
.swatch span { display: flex; align-items: center; gap: 10px; }
#contrast, #brand-status { margin: 12px 0 0; font-weight: 600; min-height: 1.4em; }
.brandgrid { display: grid; gap: 12px; } @media (min-width: 700px) { .brandgrid { grid-template-columns: 1fr 1fr; } }
.brandbox { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFB; justify-items: start; }
.brandbox__t { font-weight: 700; font-size: .9rem; } .brandbox img { object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.pvwrap { position: sticky; top: 16px; display: grid; gap: 8px; align-self: start; }
.pvwrap__t { font: 700 .75rem var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.pv { --pv-ink: #0E1C26; --pv-soft: #465B69; --pv-paper: #F4F7F9; --pv-paper2: #E2EBF1; --pv-pitch: #12384F; --pv-head: #12384F; --pv-flare: #7CC4F2; --pv-ftext: #1B6AA0; --pv-lime: #CDE9FA; --pv-fd: 'Bricolage Grotesque'; --pv-fb: Georgia; --pv-fu: system-ui; --pv-r: 0px; --pv-sh: 4px 4px 0 var(--pv-ink);
  background: var(--pv-paper); color: var(--pv-ink); border: 2px solid #17212B; border-radius: 12px; overflow: hidden; font-family: var(--pv-fu); }
.pv__ticker { background: var(--pv-pitch); color: var(--pv-lime); font: 700 .65rem var(--pv-fu); letter-spacing: .1em; padding: 6px 12px; white-space: nowrap; overflow: hidden; }
.pv__ticker.is-off { display: none; }
.pv__nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 2px solid var(--pv-ink); font-size: .8rem; } .pv__nav b { font: 800 1rem var(--pv-fd); text-transform: uppercase; }
.pv__body { padding: 18px 14px; display: grid; gap: 10px; }
.pv__eyebrow { margin: 0; font: 700 .65rem var(--pv-fu); letter-spacing: .12em; text-transform: uppercase; color: var(--pv-ftext); }
.pv__h1 { margin: 0; font: 800 clamp(2.4rem, 6vw, 3.4rem)/.9 var(--pv-fd); text-transform: uppercase; letter-spacing: -.03em; color: var(--pv-head); } .pv__h1 i { color: var(--pv-flare); font-style: normal; }
.pv__p { margin: 0; font: 400 .95rem/1.5 var(--pv-fb); } .pv__p a { color: var(--pv-ftext); }
.pv__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.pv__btn { background: var(--pv-flare); color: var(--pv-ink); border: 2px solid var(--pv-ink); border-radius: var(--pv-r); box-shadow: var(--pv-sh); padding: 8px 14px; font: 700 .8rem var(--pv-fu); }
.pv__tag { border: 1.5px solid var(--pv-ink); border-radius: 999px; padding: 2px 10px; font: 600 .72rem var(--pv-fu); }
.pv__card { display: grid; gap: 2px; padding: 12px; background: var(--pv-paper2); border: 2px solid var(--pv-ink); border-radius: var(--pv-r); box-shadow: var(--pv-sh); } .pv__card b { font: 700 .95rem var(--pv-fd); } .pv__card span { font: 400 .8rem var(--pv-fu); color: var(--pv-soft); }
.pv__foot { background: var(--pv-ink); color: color-mix(in srgb, var(--pv-pitch), #fff 14%); font: 800 2.4rem/1 var(--pv-fd); text-transform: uppercase; padding: 14px; letter-spacing: -.04em; }

/* ---- Gadgets ---- */
.wlist { display: grid; gap: 10px; }
.wrow { display: grid; grid-template-columns: auto minmax(0, 1fr) 100px; gap: 6px 16px; align-items: end; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFB; }
.wrow .field { margin: 0; }
.wrow__head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wrow__name { font: 700 .98rem var(--f-display); }
.wrow__btns { display: inline-flex; gap: 6px; }
.wrow__btns button { width: 44px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #9AA9B8; border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; } .wrow__btns button:hover { background: var(--ink); color: #fff; }
@media (max-width: 600px) { .wrow { grid-template-columns: 1fr 100px; } .wrow .tick { grid-column: 1 / -1; } }

/* ---- Entrada ---- */
body.adm--login { grid-template-columns: 1fr; place-items: center; padding: 24px 16px; }
.login { width: min(400px, 100%); display: grid; gap: 12px; text-align: center; justify-items: center; }
.login .card { width: 100%; text-align: left; display: grid; gap: 12px; } .login h1 { font-size: 1.6rem; }
.login .flash { width: 100%; text-align: left; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
