/* Creador de Etiquetas y Códigos · interfaz (identidad Suite Potenciadora de Digital Carmelo).
   Las etiquetas impresas NO llevan nada de esta marca: solo la del cliente. */
:root {
  --gp-bg: #f5f6fb; --gp-surface: #ffffff; --gp-border: #e4e6f0; --gp-text: #171923; --gp-text-soft: #666b80;
  --gp-primary: #0d0e32; --gp-primary-dark: #06071f; --gp-gold: #d3ac49; --gp-gold-light: #fcca55;
  --gp-gold-grad: linear-gradient(135deg, #f7dc8a 0%, #d3ac49 45%, #a8812a 100%);
  --gp-danger: #e0455f; --gp-ok: #178a4c; --gp-warn: #b7791f; --gp-radius: 14px; --gp-radius-sm: 9px;
  --gp-shadow: 0 10px 30px -12px rgba(13,14,50,.18);
  font-family: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--gp-bg); color: var(--gp-text); min-height: 100vh; display: flex; flex-direction: column; }
body > .no-print:first-child { flex: 1; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; color: inherit; }
.soft { color: var(--gp-text-soft); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .7rem 1.2rem; border-radius: var(--gp-radius-sm); border: none; cursor: pointer; font-weight: 700; transition: transform .12s ease, background .12s ease, filter .12s; background: var(--gp-border); color: var(--gp-text); text-decoration: none; touch-action: manipulation; font-size: .95rem; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--gp-primary); color: #fff; }
.btn--primary:hover { background: var(--gp-primary-dark); }
.btn--outline { background: #fff; border: 1.5px solid var(--gp-primary); color: var(--gp-primary); }
.btn--ghost { background: transparent; color: var(--gp-text-soft); }
.btn--ghost:hover { background: rgba(13,14,50,.06); }
.btn--danger { background: transparent; color: var(--gp-danger); }
.btn--gold { background: var(--gp-gold-grad); color: var(--gp-primary); box-shadow: 0 12px 28px -12px rgba(211,172,73,.8); }
.btn--gold:hover { filter: brightness(1.05); }
.btn--small { min-height: 36px; padding: .4rem .8rem; font-size: .84rem; }
.btn--lg { padding: .95rem 1.5rem; font-size: 1.02rem; }
.btn--icon { min-height: 36px; width: 36px; padding: 0; }

/* Portada (igual a las demás apps de la suite) */
.home-hero { position: relative; overflow: hidden; background: var(--gp-primary); color: #fff; isolation: isolate; }
.home-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 18% 50%, rgba(211,172,73,.18), transparent 55%), radial-gradient(ellipse at 100% 0%, rgba(252,202,85,.10), transparent 45%); }
.home-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gp-gold-grad); }
.home-hero__inner { max-width: 1100px; margin: 0 auto; padding: 2.6rem 1.5rem 2.8rem; display: grid; grid-template-columns: auto 1fr; gap: 2.4rem; align-items: center; }
.home-hero__logo { width: 170px; height: 170px; object-fit: contain; mix-blend-mode: lighten; }
.home-hero__eyebrow { margin: 0 0 .7rem; font-size: .72rem; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--gp-gold); }
.home-hero h1 { margin: 0; font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: .02em; background: linear-gradient(180deg, #fff3cf 0%, #fcca55 45%, #c99a2e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero__lead { margin: .9rem 0 1.5rem; max-width: 38em; color: rgba(255,255,255,.8); font-size: 1.02rem; line-height: 1.55; }
.home-hero__lead b { color: var(--gp-gold-light); }
.home-hero__actions { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.home-hero__note { font-size: .8rem; color: rgba(255,255,255,.55); }

/* Pestañas */
.tabs { position: sticky; top: 0; z-index: 30; display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; padding: .6rem 1rem; background: rgba(245,246,251,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--gp-border); }
.tab { display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; padding: .5rem 1rem; border: 0; border-radius: 999px; background: transparent; color: var(--gp-text-soft); font-weight: 700; font-size: .9rem; cursor: pointer; }
.tab span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gp-border); color: var(--gp-text-soft); font-size: .72rem; }
.tab:hover { background: rgba(13,14,50,.05); }
.tab.is-active { background: var(--gp-primary); color: #fff; }
.tab.is-active span { background: var(--gp-gold); color: var(--gp-primary); }

.app-main { max-width: 1100px; margin: 0 auto; padding: 1.8rem 1.5rem 4rem; }
.panel-head { margin-bottom: 1.2rem; }
.panel-head h2 { margin: 0 0 .3rem; color: var(--gp-primary); font-size: 1.45rem; }
.panel-head p { margin: 0; color: var(--gp-text-soft); max-width: 60em; line-height: 1.5; }

.card { background: #fff; border: 1px solid var(--gp-border); border-radius: 18px; padding: 1.3rem; box-shadow: var(--gp-shadow); }
.card + .card { margin-top: 1rem; }
.card h3 { margin: 0 0 .8rem; color: var(--gp-primary); font-size: 1.05rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; align-items: start; }
.sticky { position: sticky; top: 76px; }

/* Formularios */
.field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.field label, .field > span { font-weight: 700; font-size: .86rem; color: var(--gp-primary); }
.field small { color: var(--gp-text-soft); font-size: .78rem; line-height: 1.4; }
.inp, select.inp, textarea.inp { width: 100%; min-height: 44px; padding: .6rem .8rem; border: 1.5px solid var(--gp-border); border-radius: var(--gp-radius-sm); background: #fff; font-size: 16px; }
textarea.inp { min-height: 110px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.inp:focus { outline: none; border-color: var(--gp-gold); box-shadow: 0 0 0 3px rgba(211,172,73,.2); }
.inp.is-error { border-color: var(--gp-danger); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.colors { display: flex; gap: 1rem; flex-wrap: wrap; }
.color { display: flex; align-items: center; gap: .5rem; font-size: .86rem; font-weight: 600; }
.color input[type=color] { width: 46px; height: 40px; padding: 2px; border: 1.5px solid var(--gp-border); border-radius: 10px; background: #fff; cursor: pointer; }
.check { display: flex; align-items: center; gap: .55rem; min-height: 38px; font-size: .92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gp-primary); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .1rem .8rem; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.seg button { min-height: 40px; padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--gp-border); background: #fff; font-weight: 700; font-size: .86rem; cursor: pointer; color: var(--gp-text-soft); }
.seg button.is-on { border-color: var(--gp-primary); background: var(--gp-primary); color: #fff; }

.logo-drop { display: flex; align-items: center; gap: 1rem; }
.logo-drop__img { width: 84px; height: 84px; border-radius: 16px; border: 1.5px dashed #c9cbe0; display: grid; place-items: center; background: #fafbff; overflow: hidden; color: var(--gp-text-soft); font-size: .75rem; text-align: center; }
.logo-drop__img img { max-width: 100%; max-height: 100%; object-fit: contain; }

.note { display: flex; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; background: #fff8e6; border: 1px solid #f1dfaa; color: #6b5413; font-size: .86rem; line-height: 1.45; }
.note--info { background: #eef1ff; border-color: #d6dcfb; color: #2b3170; }
.msg { font-size: .82rem; margin-top: .3rem; }
.msg--ok { color: var(--gp-ok); }
.msg--err { color: var(--gp-danger); }
.msg--warn { color: var(--gp-warn); }

/* Productos */
.plist { display: grid; gap: .7rem; }
.pitem { display: grid; grid-template-columns: minmax(0, 1.4fr) 110px 90px minmax(0, 1.1fr) 100px 240px auto; gap: .5rem; align-items: center; padding: .7rem; border: 1px solid var(--gp-border); border-radius: 14px; background: #fff; }
.pitem .inp { min-height: 40px; padding: .45rem .6rem; font-size: 15px; }
.pitem__code { display: grid; gap: .2rem; }
.pitem__bar { height: 62px; display: grid; place-items: center; background: #fff; border-radius: 8px; border: 1px solid var(--gp-border); overflow: hidden; }
.pitem__bar svg { max-width: 100%; max-height: 58px; }
.pitem__bar .err { color: var(--gp-danger); font-size: .75rem; padding: 0 .4rem; text-align: center; }
.pitem__actions { display: flex; gap: .2rem; }
.phead { display: grid; grid-template-columns: minmax(0, 1.4fr) 110px 90px minmax(0, 1.1fr) 100px 240px auto; gap: .5rem; padding: 0 .7rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-text-soft); }
.empty { display: grid; gap: .3rem; padding: 1.5rem; border: 1.5px dashed #c9cbe0; border-radius: 16px; background: #fff; color: var(--gp-text-soft); text-align: center; }
.empty b { color: var(--gp-primary); }
.menu { position: relative; }

/* QR */
.qr-preview { display: grid; place-items: center; padding: 1.2rem; border-radius: 16px; background: repeating-conic-gradient(#f3f4f8 0 25%, #fff 0 50%) 0 0 / 18px 18px; }
.qr-preview svg { width: min(280px, 100%); height: auto; border-radius: 10px; box-shadow: 0 10px 30px -14px rgba(0,0,0,.35); }
.qr-payload { margin-top: .7rem; font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--gp-text-soft); word-break: break-all; }

/* Etiquetas: vista previa */
.sheet-wrap { overflow: auto; padding: 1rem; border-radius: 16px; background: #e9ebf3; }
.sheet-scale { transform-origin: top left; }
.sheet { width: 210mm; height: 297mm; background: #fff; box-shadow: 0 10px 30px -10px rgba(0,0,0,.3); position: relative; overflow: hidden; }
.sheet + .sheet { margin-top: 8mm; }
.summary { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center; font-size: .9rem; }
.summary b { color: var(--gp-primary); }
.sel-list { display: grid; gap: .3rem; max-height: 320px; overflow: auto; padding-right: .3rem; }
.sel-item { display: grid; grid-template-columns: auto 1fr 76px; gap: .6rem; align-items: center; padding: .35rem .5rem; border-radius: 10px; }
.sel-item:hover { background: #f7f8fc; }
.sel-item .inp { min-height: 36px; padding: .3rem .5rem; text-align: center; }

/* Etiqueta (se usa en la vista previa y en la impresión) */
.lbl { position: absolute; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6mm; padding: 1.6mm; text-align: center; color: #1a1a1a; font-family: 'Inter', Arial, sans-serif; background: #fff; }
.lbl.cut { outline: .2mm dashed #b9bccb; outline-offset: -.1mm; }
.lbl__band { position: absolute; left: 0; right: 0; top: 0; height: 1.2mm; }
.lbl__top { display: flex; align-items: center; justify-content: center; gap: 1.2mm; max-width: 100%; }
.lbl__logo { object-fit: contain; }
.lbl__brand { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl__name { font-weight: 700; line-height: 1.12; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lbl__var { opacity: .75; line-height: 1.1; }
.lbl__price { font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .6mm 1.2mm; }
.lbl__old { color: #6b6f80; font-weight: 600; text-decoration-thickness: .25mm; }
.lbl__tag { font-style: normal; color: #fff; font-weight: 800; padding: .3mm 1mm; border-radius: .8mm; letter-spacing: .02em; }
.lbl__name--xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lbl--used { outline: .2mm dashed #d0d3df; outline-offset: -.1mm; background: repeating-linear-gradient(45deg, #f4f5f9 0 2mm, #fff 2mm 4mm); color: #9aa0b4; font-size: 2.4mm; }
.lbl--empty { outline: .2mm dashed #e2e4ec; outline-offset: -.1mm; background: transparent; }
.lbl--sticker { outline: .2mm solid #d7dae5; outline-offset: -.1mm; border-radius: 1mm; }
#print-area .lbl--used, #print-area .lbl--empty { display: none; }
.grid-cu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .8rem; }
.grid-cu .field label { font-size: .78rem; }
@media (max-width: 720px) { .grid-cu { grid-template-columns: 1fr 1fr; } }
.lbl__codes { display: flex; align-items: center; justify-content: center; gap: 1.2mm; max-width: 100%; min-height: 0; }
.lbl__bar { display: block; max-width: 100%; }
.lbl__qr { display: block; flex: 0 0 auto; }
.lbl--hang { justify-content: flex-start; padding-top: 9mm; }
.lbl--hang .lbl__codes { flex-direction: column; gap: 2mm; margin-top: 1mm; }
.lbl--hang::before { content: ''; position: absolute; top: 3mm; left: 50%; width: 3.2mm; height: 3.2mm; margin-left: -1.6mm; border-radius: 50%; border: .25mm solid #b9bccb; }

/* Cartel QR */
.poster { width: 148mm; height: 210mm; background: #fff; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7mm; padding: 14mm; text-align: center; font-family: 'Inter', Arial, sans-serif; box-shadow: 0 10px 30px -10px rgba(0,0,0,.3); }
.poster__band { position: absolute; left: 0; right: 0; top: 0; height: 5mm; }
.poster__logo { max-width: 60mm; max-height: 26mm; object-fit: contain; }
.poster__title { font-size: 11mm; font-weight: 800; line-height: 1.05; margin: 0; }
.poster__sub { font-size: 5mm; margin: 0; opacity: .8; }
.poster__qr { width: 92mm; height: 92mm; }

/* Pie común de la suite */
.brand-footer { display: flex; align-items: center; justify-content: center; gap: .15rem .6rem; flex-wrap: wrap; padding: .55rem .9rem; background: var(--gp-primary); border-top: 1px solid rgba(211,172,73,.35); text-align: center; }
.brand-footer__label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(211,172,73,.8); font-weight: 600; }
.brand-footer__name { font-weight: 700; font-size: .82rem; color: var(--gp-gold-light); }
.brand-footer__name a { color: inherit; text-decoration: none; }
.brand-footer__name a:hover { text-decoration: underline; }
.suite-by { font-weight: 600; font-style: italic; color: rgba(252,202,85,.8); margin-left: .35em; white-space: nowrap; }
.suite-legal { flex-basis: 100%; display: block; width: 100%; text-align: center; font-size: .64rem; line-height: 1.45; letter-spacing: .02em; font-weight: 500; color: rgba(255,255,255,.45); margin-top: .15rem; }

/* Promo suite */
.suite-promo{position:fixed;right:22px;bottom:22px;z-index:9999;width:min(330px,calc(100vw - 32px));padding:15px 17px 16px;border:1px solid rgba(211,172,73,.55);border-radius:18px;background:linear-gradient(145deg,#0d0e32,#1a1f38);color:#fff;box-shadow:0 18px 45px rgba(13,14,50,.28);font-family:Inter,ui-sans-serif,system-ui,sans-serif;animation:suitePromoIn .45s ease both}
.suite-promo.is-hiding{animation:suitePromoOut .35s ease both}
.suite-promo__close{position:absolute;right:9px;top:7px;width:24px;height:24px;border:0;border-radius:50%;background:transparent;color:#d9d9e5;font-size:18px;line-height:1;cursor:pointer}
.suite-promo__eyebrow{margin:0 28px 5px 0;color:#fcca55;font-size:10px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}
.suite-promo__text{margin:0 0 11px;color:#fff;font-size:14px;line-height:1.35;font-weight:650}
.suite-promo__cta{display:inline-flex;align-items:center;justify-content:center;padding:9px 13px;border-radius:10px;background:linear-gradient(135deg,#f7dc8a,#d3ac49);color:#0d0e32;text-decoration:none;font-size:12px;font-weight:800}
@keyframes suitePromoIn{from{opacity:0;transform:translateY(14px) scale(.97)}to{opacity:1;transform:none}}
@keyframes suitePromoOut{to{opacity:0;transform:translateY(14px) scale(.97)}}

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 10000; background: var(--gp-primary); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; font-size: .9rem; opacity: 0; transition: all .3s; pointer-events: none; border: 1px solid rgba(211,172,73,.5); }
.toast.is-on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .phead { display: none; }
  .pitem { grid-template-columns: 1fr 1fr; }
  .pitem > :nth-child(1), .pitem > :nth-child(4), .pitem > :nth-child(6) { grid-column: 1 / -1; }
  .pitem__actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 720px) {
  .home-hero__inner { grid-template-columns: 1fr; text-align: center; gap: 1rem; padding: 1.8rem 1.1rem 2rem; }
  .home-hero__logo { width: 110px; height: 110px; margin: 0 auto; }
  .home-hero__eyebrow { letter-spacing: .16em; font-size: .66rem; }
  .home-hero__actions { justify-content: center; }
  .tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: .5rem .7rem; }
  .tab { flex: 0 0 auto; padding: .45rem .8rem; font-size: .84rem; }
  .app-main { padding: 1.3rem 1rem 6rem; }
  .grid2 { grid-template-columns: 1fr; }
  .brand-footer__label { flex-basis: 100%; }
  .brand-footer__name { font-size: .72rem; }
  .suite-by { white-space: normal; }
  .suite-promo { right: 12px; bottom: 12px; width: min(310px, calc(100vw - 24px)); }
}
@media (prefers-reduced-motion: reduce) { .suite-promo { animation: none; } html { scroll-behavior: auto; } }

/* Impresión: solo sale la hoja, sin nada de la app */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  body { display: block; min-height: 0; }
  .no-print, .suite-promo, .toast { display: none !important; }
  #print-area { display: block; }
  #print-area .sheet { box-shadow: none; margin: 0 !important; page-break-after: always; break-after: page; }
  #print-area .sheet:last-child { page-break-after: auto; break-after: auto; }
  #print-area.is-poster .poster { box-shadow: none; margin: 0 auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Lista de precios para WhatsApp */
.wl-ov { position: fixed; inset: 0; z-index: 9000; background: rgba(13,14,50,.5); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .wl-ov { align-items: center; padding: 24px; } }
.wl-box { background: #fff; width: 100%; max-width: 580px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px; display: flex; flex-direction: column; gap: .8rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
@media (min-width: 640px) { .wl-box { border-radius: 20px; padding: 24px; } }
.wl-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.wl-head h3 { margin: 0; }
.wl-box .checks { display: flex; flex-direction: column; gap: .3rem; }
.wl-box .wl-txt { height: 260px; min-height: 260px; max-height: none; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; resize: vertical; }
.tag-warn { color: #a4473a; font-weight: 600; }
.tag-new { display: inline-block; background: #fcf3dc; color: #7a5a12; border-radius: 999px; padding: 0 .45rem; font-weight: 700; }
