:root {
  --navy: #13294b; --navy-2: #1d3a6b; --gold: #e3b341; --gold-soft: #fbf1d8;
  --ink: #1c2433; --muted: #6b7486; --line: #e3e6ec; --bg: #f4f5f8; --card: #fff;
  --green: #1f8a4c; --red: #c23b33; --r: 12px;
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: #2c5291; }
h1, h2 { margin: 0; color: var(--navy); }
.muted { color: var(--muted); } .pad { padding: 24px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
code { background: #eef0f4; padding: 1px 5px; border-radius: 4px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 10px; padding: 9px 16px; font: 600 15px inherit; font-family: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.danger { color: var(--red); }
.btn.danger:not(.ghost) { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 6px 11px; font-size: 14px; }
.btn.full { width: 100%; margin-top: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; margin-top: 12px; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill.green { background: #e2f4e9; color: var(--green); }
.pill.gray { background: #eceef2; color: #596275; }
.pill.gold { background: var(--gold-soft); color: #8d6512; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 50% -10%, #2c5291, var(--navy)); }
.login-card { background: #fff; border-radius: 18px; padding: 36px 30px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.login-card img { margin: 0 auto 10px; display: block; }
.login-card h1 { font-size: 24px; margin-bottom: 8px; }
.login-card p { color: var(--muted); }
#gbtn { display: flex; justify-content: center; min-height: 44px; margin: 18px 0; }
.alert { background: #fdecea; color: var(--red) !important; border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.back { display: inline-block; margin-top: 8px; font-size: 15px; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d4e6; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; font-weight: 700; padding: 4px 8px 18px; }
.brand small { display: block; font-weight: 400; color: #9fb0cc; font-size: 13px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; gap: 10px; align-items: center; color: #d7dfec; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.side nav a:hover { background: rgba(255, 255, 255, .07); }
.side nav a.on { background: var(--gold); color: var(--navy); }
.ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.view-site { color: var(--gold); font-weight: 600; text-decoration: none; }
.who b { display: block; color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.who small { color: #9fb0cc; }
.main { padding: 28px 32px 60px; min-width: 0; max-width: 1240px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { font-size: 27px; }
.head p { margin: 4px 0 0; color: var(--muted); }
.head-act { display: flex; gap: 8px; }
.group { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 10px; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
a.row:hover { background: #f8f9fb; }
.row.off { opacity: .6; }
.thumb { width: 64px; height: 46px; border-radius: 8px; overflow: hidden; background: #e8ebf0; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); }
.row-side { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.empty { background: #fff; border: 1px dashed #c8cdd8; border-radius: var(--r); padding: 30px; text-align: center; color: var(--muted); }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.ed-side { display: grid; gap: 14px; position: sticky; top: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card-t { display: block; margin-bottom: 10px; }
.f { display: grid; gap: 5px; font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.f small { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]), textarea, select { font: 16px inherit; font-family: inherit; padding: 10px 12px; border: 1px solid #cfd4de; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; font-weight: 400; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea { resize: vertical; line-height: 1.55; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.md-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: #fff; border: 1px solid #cfd4de; border-bottom: 0; border-radius: 10px 10px 0 0; padding: 6px; }
.md-bar button { background: none; border: 1px solid transparent; border-radius: 7px; padding: 5px 10px; font: 14px inherit; font-family: inherit; cursor: pointer; color: var(--navy); }
.md-bar button:hover { background: #f0f2f6; }
.md-bar .tabs { margin-left: auto; display: flex; background: #eef0f4; border-radius: 8px; padding: 2px; }
.md-bar .tabs button.on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); font-weight: 700; }
.md-wrap textarea { border-radius: 0 0 10px 10px; min-height: 420px; font-size: 16px; }
.md-preview { border: 1px solid #cfd4de; border-radius: 0 0 10px 10px; background: #fff; padding: 18px 22px; min-height: 420px; }
.help { font-weight: 400; font-size: 14px; color: var(--muted); }
.help ul { margin: 6px 0; padding-left: 20px; }
.cover { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #eef0f4; display: grid; place-items: center; color: var(--muted); margin-bottom: 10px; }
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* vista previa con el mismo estilo básico del sitio */
.prose { font-size: 17px; line-height: 1.6; }
.prose h2 { font-size: 24px; margin: 1.2em 0 .4em; } .prose h3 { font-size: 20px; margin: 1em 0 .4em; }
.prose img { max-width: 100%; border-radius: 10px; display: block; }
.prose .md-figure { margin: 1em 0; }
.prose .md-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.prose .md-gallery figure { margin: 0; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; }
.prose .md-gallery img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.prose blockquote { margin: 1em 0; padding: 12px 18px; background: var(--gold-soft); border-left: 4px solid var(--gold); }
.prose table { border-collapse: collapse; width: 100%; } .prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--navy); color: #fff; }

.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.slide-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: grid; gap: 10px; padding-bottom: 14px; }
.slide-card.off { opacity: .6; }
.slide-card img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.slide-card > div { padding: 0 14px; }
.slide-card b { display: block; } .slide-card small { color: var(--muted); display: block; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.settings fieldset { margin: 0; }
.settings legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
.settings .btn-row { grid-column: 1 / -1; }

.modal { border: 0; border-radius: 16px; padding: 0; width: min(540px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(10, 20, 40, .5); }
.modal-in { padding: 22px; max-height: 88vh; overflow-y: auto; }
.modal-in h2 { font-size: 21px; margin-bottom: 16px; }
.modal-in .f .btn { justify-self: start; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 1000; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; gap: 6px; }
  .brand { padding: 4px 6px; } .brand small { display: none; }
  .side nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: none; }
  .side nav a { padding: 8px 12px; white-space: nowrap; font-size: 15px; }
  .side nav a .ic { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 10px; }
  .who { display: none; }
  .main { padding: 18px 14px 50px; }
  .editor { grid-template-columns: 1fr; }
  .ed-side { position: static; }
  .head h1 { font-size: 23px; }
  .row { flex-wrap: wrap; }
  .row-side { width: 100%; justify-content: flex-start; }
  a.row .row-side { width: auto; }
  .md-wrap textarea, .md-preview { min-height: 320px; }
}
