:root {
  --cream: #fbf6f2; --paper: #f6ebe6; --blush: #f0d9d1; --rose: #e4bdb2; --rosegold: #b7797a;
  --mauve: #8c4f61; --plum: #4b2234; --plum-deep: #2f1420; --ink: #3a2029; --ink-soft: #6e5059;
  --gold: #c39a5f; --gold-soft: #e6cf9f; --line: rgba(75, 34, 52, .14); --danger: #a3354b;
  --f-display: "Cormorant Garamond", Georgia, serif; --f-body: "Jost", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--f-body); font-weight: 300; color: var(--ink); background: var(--cream); font-size: 16px; line-height: 1.5; }
h1, h2 { font-family: var(--f-display); color: var(--plum); font-weight: 600; margin: 0; }
h1 { font-size: 40px; line-height: 1.05; }
h2 { font-size: 26px; }
small { color: var(--ink-soft); font-weight: 300; }
code { background: var(--blush); padding: 1px 6px; border-radius: 4px; font-size: 14px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; margin: 6px 0; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--plum); margin-bottom: 16px; }
input, textarea, select {
  font: inherit; font-weight: 300; color: var(--ink); width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rosegold); box-shadow: 0 0 0 3px rgba(183,121,122,.18); }
textarea { resize: vertical; line-height: 1.6; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.check input { width: 18px; height: 18px; accent-color: var(--plum); }
.btn {
  font: inherit; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
  border: 1px solid var(--plum); background: var(--plum); color: var(--cream);
  padding: 13px 22px; border-radius: 999px; cursor: pointer; transition: .25s; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: var(--mauve); border-color: var(--mauve); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn--line { background: transparent; color: var(--plum); }
.btn--line:hover { background: var(--plum); color: var(--cream); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.link { background: none; border: 0; color: var(--mauve); cursor: pointer; font: inherit; text-decoration: underline; padding: 6px 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.alert { padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.alert--error { background: #f9e1e5; color: var(--danger); }

/* Gate (login / setup) */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(90% 70% at 80% 0%, #f8e4dc, var(--cream) 60%); }
.gate__card { width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 40px 32px; box-shadow: 0 30px 60px -30px rgba(75,34,52,.35); border: 1px solid var(--line); }
.gate__logo { width: 180px; display: block; margin: 0 auto 24px; }
.gate h1 { font-size: 32px; text-align: center; margin-bottom: 8px; }
.gate__hint { text-align: center; color: var(--ink-soft); margin: 0 0 24px; font-size: 15px; }
.gate .btn { width: 100%; margin-top: 4px; }
.gate__back { display: block; text-align: center; margin-top: 20px; color: var(--mauve); font-size: 14px; }

/* App layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100svh; }
.side { background: var(--plum); color: var(--blush); padding: 28px 18px; position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; }
.side__logo { width: 150px; margin: 0 auto 30px; filter: brightness(0) invert(.92) sepia(.4) saturate(1.6) hue-rotate(-20deg); }
.side__nav { display: grid; gap: 4px; }
.side__nav button { text-align: left; background: transparent; border: 0; color: var(--blush); font: inherit; font-size: 15px; padding: 12px 16px; border-radius: 12px; cursor: pointer; transition: .2s; }
.side__nav button:hover { background: rgba(255,255,255,.06); }
.side__nav button.is-on { background: var(--blush); color: var(--plum); font-weight: 500; }
.side__foot { margin-top: auto; display: grid; gap: 6px; }
.side__foot form { margin: 0; }
.side__link { color: var(--gold-soft); background: none; border: 0; font: inherit; font-size: 14px; padding: 8px 16px; cursor: pointer; text-decoration: none; text-align: left; width: 100%; }
.main { padding: 40px clamp(16px, 4vw, 56px) 100px; max-width: 1040px; width: 100%; }
.panel { display: none; }
.panel.is-on { display: block; }
.panel__head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.panel__head p { margin: 6px 0 0; color: var(--ink-soft); }
.card { background: #fff; border-radius: 22px; border: 1px solid var(--line); padding: 26px; margin-bottom: 22px; }
.card h2 { margin-bottom: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h2 { margin: 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.actions.sticky { position: sticky; bottom: 16px; justify-content: flex-end; }
.actions.sticky .btn { box-shadow: 0 14px 30px -10px rgba(47,20,32,.6); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Posts */
.post-list { display: grid; gap: 10px; }
.pitem { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: inherit; transition: .2s; }
.pitem:hover { border-color: var(--rosegold); transform: translateX(3px); }
.pitem img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--blush); }
.pitem__body { flex: 1; display: grid; min-width: 0; }
.pitem__body b { font-family: var(--f-display); font-size: 21px; color: var(--plum); font-weight: 600; line-height: 1.15; }
.pill { font-size: 12px; padding: 5px 12px; border-radius: 99px; background: #e5f2e6; color: #2f6b3a; flex: none; }
.pill--off { background: var(--paper); color: var(--ink-soft); }
.editor { margin-top: 30px; background: #fff; border-radius: 22px; border: 1px solid var(--rosegold); padding: 28px; }
.editor__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.img-field { display: grid; grid-template-columns: 200px 1fr; gap: 20px; margin-bottom: 18px; }
.img-field__preview { aspect-ratio: 4/5; border-radius: 100px 100px 14px 14px; overflow: hidden; background: var(--blush); }
.img-field__preview img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { display: inline-flex; width: auto; margin: 0; cursor: pointer; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: .8; transition: .2s; }
.thumbs img:hover { opacity: 1; }
.thumbs img.is-on { border-color: var(--plum); opacity: 1; }
.help { background: var(--paper); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.help summary { cursor: pointer; color: var(--mauve); font-weight: 500; }
.help ul { margin: 10px 0 0; padding-left: 18px; }

/* Promos */
.promo-row { display: grid; grid-template-columns: auto 140px 1fr auto; gap: 12px; align-items: end; padding: 16px 0; border-top: 1px solid var(--line); }
.promo-row label { margin: 0; }
.promo-row .wide { grid-column: 1 / 4; }
.promo-row .check { align-self: center; }
.promo-row .icon-btn { grid-column: 4; grid-row: 1; align-self: center; }

/* Tables */
.trow { display: grid; grid-template-columns: 1fr 140px 130px 36px; gap: 10px; align-items: center; padding: 6px 0; }
.trow--head { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--rosegold); padding-bottom: 2px; }
.trow--nd { grid-template-columns: 1fr 130px 1fr 36px; }
.trow input, .trow select { padding: 9px 12px; }
.money { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; color: var(--ink-soft); }
.ndcat { padding: 18px 0; border-top: 1px solid var(--line); }
.ndcat__head { display: grid; grid-template-columns: 1fr 220px 36px; gap: 12px; align-items: end; margin-bottom: 8px; }
.ndcat__head label { margin: 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--plum); color: var(--cream); padding: 14px 22px; border-radius: 99px; box-shadow: 0 16px 30px -10px rgba(0,0,0,.4); transition: .35s; z-index: 10; max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: var(--danger); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 5; padding: 12px 16px; flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
  .side__logo { width: 90px; margin: 0; }
  .side__nav { display: flex; overflow-x: auto; gap: 4px; order: 3; width: 100%; }
  .side__nav button { white-space: nowrap; padding: 8px 14px; font-size: 14px; }
  .side__foot { margin: 0 0 0 auto; display: flex; }
  .side__link { padding: 6px 8px; font-size: 13px; }
  .main { padding-top: 26px; }
  h1 { font-size: 32px; }
  .row, .img-field { grid-template-columns: 1fr; }
  .img-field__preview { max-width: 200px; }
  .promo-row { grid-template-columns: 1fr auto; }
  .promo-row .wide, .promo-row label { grid-column: 1 / -1; }
  .promo-row .icon-btn { grid-column: 2; grid-row: 1; }
  .trow { grid-template-columns: 1fr 110px 36px; }
  .trow select { grid-column: 1 / 2; grid-row: 2; }
  .trow--head { display: none; }
  .trow { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .trow--nd { grid-template-columns: 1fr 110px 36px; }
  .trow--nd input[data-ik="paquete"] { grid-column: 1 / 3; grid-row: 2; }
  .ndcat__head { grid-template-columns: 1fr 36px; }
  .ndcat__head label:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ndcat__head .icon-btn { grid-column: 2; grid-row: 1; }
}
