/* Publimatrix Admin — estilos. Misma familia que el panel de Hosanna, otra paleta. */
:root {
  --brand: #0f766e;
  --brand-deep: #134e4a;
  --brand-soft: #ccfbf1;
  --ink: #1c1c2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f8f8;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2f2; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
pre.json { background: #0b1b1a; color: #d1fae5; padding: 12px 14px; border-radius: 9px; font-size: 12px; overflow: auto; max-height: 420px; }

/* ── Top nav ── */
.nav { background: #fff; border-bottom: 1px solid var(--line); padding: 0 24px; display: flex; align-items: center; gap: 18px; height: 58px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.nav .brand { font-weight: 800; letter-spacing: .5px; color: var(--brand-deep); }
.nav .brand span { color: var(--brand); }
.nav a.link { color: var(--ink); font-weight: 500; padding: 6px 2px; font-size: 14px; }
.nav a.link.active { color: var(--brand); border-bottom: 2px solid var(--brand); }
.nav .spacer { flex: 1; }
.nav .who { color: var(--muted); font-size: 14px; }

select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%;
}
textarea { resize: vertical; }
label { display: block; font-weight: 600; margin: 0 0 6px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--brand); color: #fff; border: none; cursor: pointer; padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.btn:hover { filter: brightness(0.96); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
details.card summary { cursor: pointer; font-weight: 600; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f3f7f6; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
table.kv { border: none; }
table.kv th { width: 130px; background: none; text-transform: none; letter-spacing: 0; font-size: 12px; vertical-align: top; }
table.kv td, table.kv th { padding: 7px 6px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.published { background: #dcfce7; color: var(--ok); }
.badge.draft { background: #fef3c7; color: var(--warn); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.cat { background: #f1f5f9; color: #475569; }
.badge.lang { background: #ecfeff; color: #0e7490; text-transform: uppercase; letter-spacing: .5px; }
.badge.fmt { background: rgba(255,255,255,.9); color: var(--ink); }
.badge.pend { background: #fef3c7; color: var(--warn); }
.badge.status-borrador { background: #f3f4f6; color: var(--muted); }
.badge.status-lista { background: #e0e7ff; color: #4f46e5; }
.badge.status-en_meta { background: #dcfce7; color: var(--ok); }
.badge.status-pausado { background: #fef3c7; color: var(--warn); }
.badge.status-descartado { background: #fee2e2; color: var(--danger); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
@media (max-width: 880px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-weight: 500; }
.flash.success { background: #dcfce7; color: var(--ok); }
.flash.error { background: #fee2e2; color: var(--danger); }
.flash.info { background: var(--brand-soft); color: var(--brand-deep); }

.login-wrap { max-width: 380px; margin: 9vh auto; }
.login-wrap .brand { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 4px; color: var(--brand-deep); }
.login-wrap .brand span { color: var(--brand); }
.login-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.o-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.o-sep::before, .o-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--brand); }
.stat .n { font-size: 30px; font-weight: 800; color: var(--brand-deep); }
.stat .n.warn { color: var(--warn); }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ícono del producto, sacado de su sitio (lib/product-icon.js) */
.pico { width: 22px; height: 22px; border-radius: 6px; vertical-align: -5px; object-fit: cover; background: #fff; border: 1px solid var(--line); }
.pico.sm { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; }
.pico.lg { width: 32px; height: 32px; border-radius: 8px; vertical-align: -7px; }
a.badge { text-decoration: none; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Filtros ── */
.filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.filtros select, .filtros input { width: auto; flex: 1 1 140px; }
.filtros input[type="search"] { flex: 3 1 240px; }
.tabs { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.tabs a { padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tabs a + a { border-left: 1px solid var(--line); }
.tabs a.active { background: var(--brand); color: #fff; }

/* ── Grillas de tarjetas ── */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card.creative { padding: 0; overflow: hidden; color: inherit; display: flex; flex-direction: column; margin: 0; }
.card.creative:hover { border-color: var(--brand); text-decoration: none; }
.card.creative .thumb { position: relative; aspect-ratio: 1 / 1; background: #eef2f2; }
.card.creative .thumb img, .card.creative .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.creative .thumb .noimg { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.card.creative .thumb .badge { position: absolute; left: 8px; top: 8px; }
.card.creative .thumb .badge.pend, .card.creative .thumb .badge.fmt { left: auto; right: 8px; }
.card.creative .body { padding: 12px 14px; display: grid; gap: 3px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.perf { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.perf span { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.perf span.ok { background: #dcfce7; color: var(--ok); }

.formatos { display: flex; gap: 14px; flex-wrap: wrap; }
.formatos figure { margin: 0; flex: 1 1 180px; max-width: 320px; }
.formatos img, .formatos video { width: 100%; border-radius: 9px; border: 1px solid var(--line); display: block; }
.formatos figcaption { margin-top: 6px; }
.piezas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.piezas a { display: grid; gap: 4px; width: 92px; text-align: center; }
.piezas img, .piezas video { width: 92px; height: 92px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
audio { width: 100%; margin-top: 10px; }
