/* Panel de administración */
@font-face { font-family: "Jakarta"; src: url("../fonts/jakarta-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root { --primary: #178045; --teal: #0f6b3a; --cyan: #b8e05a; --navy: #0e2418; --ink: #13241a; --text: #46564b; --muted: #6b7b70; --soft: #f3f6ef; --line: #e1e8dc; --bg: #f6f8f3; --grad: linear-gradient(135deg, #178045, #0f6b3a); --shadow: 0 10px 30px -12px rgba(14,36,24,.18); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 1.6rem; color: var(--ink); margin: 0 0 .2rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; color: var(--ink); margin: 0 0 1rem; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.strong { font-weight: 700; color: var(--ink); }
.clip { display: inline-block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.inline { display: inline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.ico { flex-shrink: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; border-radius: 10px; padding: .65rem 1.1rem; font: inherit; font-weight: 650; cursor: pointer; transition: all .2s; background: var(--soft); color: var(--ink); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(23,128,69,.7); }
.btn--primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn--soft { background: rgba(23,128,69,.1); color: var(--primary); }
.btn--soft:hover { background: var(--primary); color: #fff; }
.btn--danger { background: #fdecee; color: #c23a49; }
.btn--danger:hover { background: #c23a49; color: #fff; }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--sm { padding: .4rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn--block { width: 100%; }

/* Layout */
.adm { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #a9bad3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side__brand { padding: 1.4rem 1.4rem 1rem; display: block; }
.side__brand img { height: 46px; }
.side nav { padding: 0 .8rem; flex: 1; }
.side__group { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: #6e86a8; padding: 1.2rem .8rem .5rem; font-weight: 700; }
.side nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: #c2d0e4; font-weight: 550; margin-bottom: 2px; transition: background .2s, color .2s; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.is-active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -10px rgba(37,158,189,.8); }
.side nav a span { flex: 1; }
.pill { font-style: normal; background: #e5484d; color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; }
.side__foot { padding: 1rem 1.4rem; font-size: .75rem; color: #6e86a8; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 1rem; padding: .8rem 2rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top__burger { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; }
.top__link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; margin-right: auto; }
.top__user { display: flex; align-items: center; gap: .7rem; position: relative; cursor: pointer; padding: .3rem .5rem; border-radius: 12px; }
.top__user:hover { background: var(--soft); }
.top__user strong { display: block; color: var(--ink); font-size: .9rem; line-height: 1.2; }
.top__user small { color: var(--muted); font-size: .78rem; }
.top__menu { position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 180px; padding: .4rem; display: none; }
.top__user:hover .top__menu, .top__user:focus-within .top__menu { display: block; }
.top__menu a { display: block; padding: .55rem .8rem; border-radius: 8px; color: var(--ink); }
.top__menu a:hover { background: var(--soft); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.avatar--sm { width: 32px; height: 32px; font-size: .85rem; }
.content { padding: 2rem; max-width: 1400px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.back { font-size: .85rem; font-weight: 600; display: inline-block; margin-bottom: .3rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(15,49,96,.04); }
.card--flush { padding: 0; overflow-x: auto; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; }
.narrow { max-width: 520px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card { margin-top: 1.5rem; }
.grid2--wide { grid-template-columns: 1.6fr 1fr; align-items: start; }

.note { padding: .85rem 1.1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; display: flex; gap: .6rem; align-items: center; transition: opacity .4s; }
.note--ok { background: #e8f8f0; color: #17794a; }
.note--err { background: #fdecee; color: #b22c3b; }
.note--warn { background: #fff6e0; color: #8a5a00; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; display: flex; gap: 1rem; align-items: center; color: var(--text); transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi > span { width: 48px; height: 48px; border-radius: 14px; background: rgba(23,128,69,.1); color: var(--primary); display: grid; place-items: center; }
.kpi--accent > span { background: var(--grad); color: #fff; }
.kpi strong { font-size: 1.7rem; color: var(--ink); display: block; line-height: 1.1; }
.kpi small { color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 10px; }
.bars__col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bars__col span { width: 100%; background: var(--grad); border-radius: 4px 4px 2px 2px; transition: opacity .2s; }
.bars__col span.is-zero { background: var(--line); }
.bars__col:hover span { opacity: .75; }
.bars__axis { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.msg-mini { list-style: none; margin: 0; padding: 0; }
.msg-mini a { display: flex; align-items: center; gap: .8rem; padding: .7rem .4rem; border-bottom: 1px solid var(--line); color: var(--text); }
.msg-mini a:hover { background: var(--soft); }
.msg-mini a > span:nth-child(2) { flex: 1; min-width: 0; }
.msg-mini strong { display: block; color: var(--ink); }
.msg-mini small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.1rem .5rem; border-radius: 14px; background: var(--soft); color: var(--ink); font-weight: 600; font-size: .86rem; text-align: center; transition: all .2s; }
.quick a:hover { background: var(--grad); color: #fff; transform: translateY(-3px); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: #fafcfe; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfe; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.table tr.is-new .strong { color: var(--primary); }
.table--compact td { padding: .55rem 1rem; font-size: .88rem; }
.table .empty { text-align: center; color: var(--muted); padding: 2.5rem; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--soft); display: block; }
.w-drag { width: 36px; }
.drag { cursor: grab; color: var(--muted); letter-spacing: -3px; user-select: none; }
tr.is-dragging { opacity: .4; }
.status { display: inline-block; font-size: .74rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; text-transform: capitalize; background: var(--soft); color: var(--muted); }
.status--nuevo { background: #fdecee; color: #c23a49; }
.status--leido { background: #e8f0fb; color: var(--primary); }
.status--respondido { background: #e8f8f0; color: #17794a; }
.status--archivado { background: #eef1f5; color: #6b7a90; }
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .88rem; }
.tabs a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs em { font-style: normal; background: #e5484d; color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.searchbox { display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 .7rem; color: var(--muted); }
.searchbox input { border: 0; outline: none; padding: .6rem 0; font: inherit; }

/* Switch */
.switch { width: 40px; height: 22px; border-radius: 999px; background: #cfd8e5; border: 0; position: relative; cursor: pointer; padding: 0; display: inline-block; transition: background .2s; vertical-align: middle; flex-shrink: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.is-on { background: #23b26d; }
.switch.is-on span { transform: translateX(18px); }
.toggle { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 600; color: var(--ink); }
.toggle input { position: absolute; opacity: 0; }
.toggle input:checked + .switch { background: #23b26d; }
.toggle input:checked + .switch span { transform: translateX(18px); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1.5rem; }
.fld { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-grid .fld { margin-bottom: 0; }
.fld--wide { grid-column: 1 / -1; }
.fld__label, .fld > span { font-weight: 650; color: var(--ink); font-size: .88rem; }
.fld input[type=text], .fld input[type=email], .fld input[type=password], .fld input[type=number], .fld input[type=date], .fld select, .fld textarea, .row-form select { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .65rem .8rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23,128,69,.12); }
.fld textarea { resize: vertical; }
.form-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .5rem; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 1.5rem 0 1rem; }
.row-form { display: flex; gap: .6rem; margin-top: 1rem; }
.check-inline { display: flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .88rem; }
.upload { display: flex; gap: 1.2rem; align-items: center; background: var(--soft); border: 1.5px dashed #c9d6e6; border-radius: 14px; padding: 1rem; }
.upload.is-over { border-color: var(--primary); background: #e8f0fb; }
.upload__preview { width: 160px; height: 110px; border-radius: 10px; overflow: hidden; background: #fff; flex-shrink: 0; }
.upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-pick { display: flex; flex-wrap: wrap; gap: .4rem; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--line); color: var(--text); cursor: pointer; transition: all .2s; }
.icon-pick input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }
.icon-pick input:focus-visible + span { outline: 3px solid var(--cyan); }
.editor { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.editor:focus-within { border-color: var(--primary); }
.editor__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: .4rem; background: var(--soft); border-bottom: 1px solid var(--line); }
.editor__bar button { border: 0; background: transparent; border-radius: 6px; padding: .35rem .6rem; cursor: pointer; font: inherit; font-size: .85rem; color: var(--ink); }
.editor__bar button:hover, .editor__bar button.is-on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.editor__area { min-height: 220px; padding: 1rem 1.2rem; outline: none; color: var(--ink); }
.editor__area h2 { font-size: 1.3rem; }
.editor__area blockquote { border-left: 4px solid var(--primary); margin: 1rem 0; padding: .3rem 1rem; background: var(--soft); }
.editor__src { width: 100%; border: 0; padding: 1rem; outline: none; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: .5rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; color: var(--ink); font-weight: 600; word-break: break-word; }
.msg-body { white-space: normal; font-size: 1rem; color: var(--ink); line-height: 1.7; background: var(--soft); padding: 1.2rem; border-radius: 12px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login__art { background: radial-gradient(700px 400px at 80% 10%, #1d6b3f, transparent 60%), radial-gradient(600px 400px at 0% 100%, #3f6b1d, transparent 55%), var(--navy); display: grid; place-items: center; padding: 3rem; }
.login__art img { max-width: 520px; width: 100%; border-radius: 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.login__box { align-self: center; justify-self: center; width: min(400px, 100% - 40px); padding: 2rem 0; }
.login__logo { height: 64px; margin-bottom: 1.8rem; }
.login .btn { margin: .6rem 0 1rem; padding: .85rem; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: repeat(3, 1fr); }
  .grid2, .grid2--wide { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .3s; }
  .side.is-open { transform: none; box-shadow: 20px 0 40px rgba(0,0,0,.3); }
  .top__burger { display: block; }
  .top { padding: .8rem 1rem; }
  .content { padding: 1.2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login__art { display: none; }
  .upload { flex-direction: column; align-items: flex-start; }
}

/* ---------- v2.0 ---------- */
.side nav a .ico { flex-shrink: 0; }
.mt { margin-top: 1.5rem; }
.pad { padding: 1.2rem 1.5rem 0; }
.pad-x { padding: 0 1.5rem; }
.narrow-lg { max-width: 820px; }
.code-input { font-size: 1.5rem !important; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; }
.steps { padding-left: 1.2rem; display: grid; gap: .7rem; }
.qr { width: 210px; height: 210px; margin: .8rem 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.qr svg { width: 100%; height: 100%; }
.codes-card { border: 2px solid #f5c04a; background: #fffaf0; }
.codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.codes code { background: #fff; border: 1px dashed #d9b04a; border-radius: 8px; padding: .55rem; text-align: center; font-size: 1rem; font-weight: 700; letter-spacing: .05em; }
.counter { font-size: .78rem; color: var(--muted); }
.counter.is-ok { color: #17794a; } .counter.is-warn { color: #a36a00; } .counter.is-bad { color: #c23a49; font-weight: 700; }
.seo-box { border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: .5rem; }
.seo-box h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.serp { font-family: Arial, sans-serif; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; max-width: 640px; display: grid; gap: .2rem; margin-bottom: .5rem; }
.serp__url { color: #202124; font-size: 13px; }
.serp__title { color: #1a0dab; font-size: 19px; line-height: 1.3; }
.serp__desc { color: #4d5156; font-size: 14px; line-height: 1.5; }
.log { list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .88rem; max-height: 420px; overflow: auto; background: var(--soft); border-radius: 12px; }
.log li { padding: .45rem .9rem; border-bottom: 1px solid var(--line); }
.log li.is-kept { color: #8a5a00; } .log li.is-err { color: #b22c3b; font-weight: 700; }
.score { width: 110px; height: 110px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(#23b26d calc(var(--s) * 1%), #e2e9f2 0); }
.score strong { font-size: 1.6rem; color: var(--ink); line-height: 1; }
.score small { color: var(--muted); font-size: .75rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.checks li { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem .8rem; border-radius: 12px; background: var(--soft); }
.checks li.is-bad { background: #fff5f6; }
.checks__icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; background: #23b26d; }
.is-bad .checks__icon { background: #e05261; }
.checks strong { display: block; color: var(--ink); font-size: .92rem; font-weight: 650; }
.checks small { display: block; color: var(--text); margin-top: .2rem; }
.quick a span { line-height: 1.3; }
@media (max-width: 860px) { .codes { grid-template-columns: repeat(2, 1fr); } }
.top__menu .linklike { display: block; width: 100%; text-align: left; padding: .55rem .8rem; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.top__menu .linklike:hover { background: var(--soft); }
.color-fld { display: flex; align-items: center; gap: .8rem; }
.color-fld input[type=color] { width: 56px; height: 42px; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }
.upload__preview--contain img { object-fit: contain; padding: 8px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.media-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--soft); }
.media-item div { padding: .6rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .78rem; }
.kw-table td { vertical-align: top; }
.kw-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: var(--soft); margin: 0 .3rem .3rem 0; color: var(--ink); }
.kw-pill.is-focus { background: #e8f8f0; color: #17794a; font-weight: 700; }
.kw-pill.is-title { background: #e8f0fb; color: var(--primary); }
.seo-analysis { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.seo-analysis li { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; }
.seo-analysis .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .35rem; flex-shrink: 0; background: #e05261; }
.seo-analysis .ok .dot { background: #23b26d; } .seo-analysis .warn .dot { background: #f0a020; }
.seo-score { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; background: #fdecee; color: #b22c3b; }
.seo-score.ok { background: #e8f8f0; color: #17794a; } .seo-score.warn { background: #fff6e0; color: #8a5a00; }
