:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --panel: #ffffff;
  --line: #e5e8ec;
  --line-2: #eef0f3;
  --text: #1a1f26;
  --ink: #0e1216;
  --muted: #616b78;
  --red: #e10613;
  --red-d: #b8040f;
  --ok: #17915a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(15,23,34,.09);
  --shadow-sm: 0 2px 10px rgba(15,23,34,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3, .display { font-family: "Archivo", "Inter", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- Barra superior ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-tag { letter-spacing: .24em; font-size: 10px; color: var(--muted); font-weight: 700; padding-left: 13px; border-left: 1px solid var(--line); }
.nav-link { color: var(--ink); font-weight: 600; font-size: 14.5px; padding: 9px 14px; border-radius: 9px; transition: .15s; }
.nav-link:hover { background: var(--bg-soft); }

/* ---- Hero ---- */
.hero { padding: 66px 0 26px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; margin-bottom: 22px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(225,6,19,.15); }
.hero h1 { font-size: clamp(34px, 6vw, 66px); line-height: 1.02; margin: 0 0 20px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
.hero h1 .red { color: var(--red); }
.hero .lead { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); max-width: 620px; margin: 0 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 40px 0 8px; }
.stat { background: var(--panel); padding: 20px 22px; position: relative; }
.stat::before { content: ""; position: absolute; top: 0; left: 0; width: 34px; height: 3px; background: var(--red); }
.stat .n { font-family: "Archivo", sans-serif; font-size: clamp(20px, 2.6vw, 28px); font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.stat .l { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---- Grilla ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 52px 0 20px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; margin: 0; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.section-head span { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; padding-bottom: 64px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d7dbe1; }
.card .cover { aspect-ratio: 16/10; background: var(--bg-soft); position: relative; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .cover.ph { display: grid; place-items: center; background:
  linear-gradient(135deg, #f0f2f5, #e7eaef); }
.card .cover .kind { position: absolute; top: 11px; left: 11px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 7px; background: var(--red); color: #fff; }
.card .body { padding: 16px 17px 19px; }
.card .body h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--ink); }
.card .body p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .body .go { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 700; font-size: 14px; }

.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 52px; text-align: center; color: var(--muted); background: var(--bg-soft); }
.ph-icon { width: 46px; height: 46px; opacity: .45; margin-bottom: 10px; }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; padding: 30px 0; margin-top: 8px; background: var(--bg-soft); }
footer .inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; }
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--muted); font-weight: 600; }
.foot-links a:hover { color: var(--red); }

/* ---- Botones / forms ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 700; font-size: 14.5px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); transition: .15s; }
.btn:hover { border-color: #cfd4da; background: var(--bg-soft); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-d); border-color: var(--red-d); }
.btn.danger { background: #fff; border-color: #f0c2c5; color: var(--red); }
.btn.danger:hover { background: #fdeef0; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn:disabled { opacity: .55; cursor: default; }

input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,6,19,.12); }
label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
textarea { resize: vertical; min-height: 88px; }
.field { margin-bottom: 16px; }
.muted { color: var(--muted); }

/* ---- Modelo (visor) ---- */
.viewer-shell { position: fixed; inset: 0; display: flex; flex-direction: column; background: #0a1420; }
.viewer-bar { display: flex; align-items: center; gap: 15px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: #fff; z-index: 5; }
.viewer-bar h1 { font-size: 16px; margin: 0; font-weight: 700; color: var(--ink); }
.viewer-bar .btn.ghost { color: var(--ink); }
.viewer-bar .sp { flex: 1; }
.viewer-frame { flex: 1; position: relative; background: #0a1420; }
.viewer-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.desc-panel { position: absolute; bottom: 16px; left: 16px; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 16px; box-shadow: var(--shadow); z-index: 6; }
.desc-panel h2 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.desc-panel p { margin: 0; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; }
.desc-panel .toggle { position: absolute; top: 8px; right: 12px; cursor: pointer; color: var(--muted); font-size: 18px; }

/* ---- Admin ---- */
.admin-wrap { padding: 36px 0 74px; }
.login-card { max-width: 390px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 21px; margin: 0 0 6px; color: var(--ink); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.panel h2 { margin: 0 0 18px; font-size: 18px; color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.mlist { display: flex; flex-direction: column; gap: 12px; }
.mrow { display: grid; grid-template-columns: 88px 1fr auto; gap: 15px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mrow .thumb { width: 88px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.mrow .meta h3 { margin: 0 0 3px; font-size: 15.5px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mrow .meta small { color: var(--muted); }
.mrow .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .03em; }
.pill.pub { background: #e7f6ee; color: var(--ok); border: 1px solid #bce7d1; }
.pill.draft { background: #fdeef0; color: var(--red); border: 1px solid #f6c9cd; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; border: 1px solid var(--ink);
  padding: 12px 22px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; font-weight: 700; font-size: 14px; }
.toast.err { background: var(--red); border-color: var(--red); }
.toast.ok { background: var(--ok); border-color: var(--ok); }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row2 { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: 64px 1fr; }
  .mrow .thumb { width: 64px; height: 42px; }
  .mrow .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .brand-tag { display: none; }
}
