/* Panel: misma lámina técnica, en versión de herramienta de trabajo. */
.adm { background: color-mix(in oklab, var(--c-paper) 70%, #fff); font-size: .98rem; overflow-x: hidden; }
.adm .field-row input, .adm .field-row textarea, .adm .field-row select { width: 100%; padding: .7rem .8rem; background: #fff; border: 1.5px solid var(--line); border-radius: 3px; }
.adm .field-row input:focus, .adm .field-row textarea:focus, .adm .field-row select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary) 20%, transparent); }
.adm .field-row label { font-weight: 650; font-size: .9rem; }
.adm .hint { margin: 0; color: var(--muted); font-size: .82rem; }

/* Acceso */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 28px 28px; }
.gate-card { width: min(420px, 100%); background: var(--c-paper); border: 1.5px solid var(--c-ink); border-radius: 4px; padding: 2rem; display: grid; gap: 1rem; box-shadow: 10px 10px 0 var(--c-primary); }
.gate-card img { height: 64px; width: auto; }
.gate-k { color: var(--muted); margin: 0; }
.gate-card h1 { margin: 0; font-family: var(--f-display); font-stretch: 112%; font-weight: 850; text-transform: uppercase; font-size: 1.8rem; line-height: 1; }
.gate-text { margin: 0; color: var(--muted); }
.gate-back { font-size: .9rem; color: var(--muted); }
.demo-note { margin: 0; font-size: .82rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: .8rem; }

/* Estructura */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--c-ink); color: var(--c-paper); display: flex; flex-direction: column; gap: 1rem; padding: max(18px, env(safe-area-inset-top, 0px)) 14px 18px max(14px, env(safe-area-inset-left, 0px)); position: sticky; top: 0; height: 100vh; overflow-y: auto; --line: color-mix(in oklab, var(--c-paper) 14%, transparent); }
.side-brand { display: flex; gap: .7rem; align-items: center; padding: .3rem .4rem 1rem; border-bottom: 1px solid var(--line); }
.side-brand img { height: 42px; width: auto; filter: brightness(0) invert(1); }
.side-brand div { display: grid; line-height: 1.1; }
.side-brand .mono { font-size: .6rem; opacity: .6; }
.side-brand strong { font-family: var(--f-display); font-stretch: 112%; font-weight: 800; text-transform: uppercase; font-size: .95rem; }
.side-nav { display: grid; gap: 2px; }
.side-nav button { text-align: left; border: 0; background: transparent; color: color-mix(in oklab, var(--c-paper) 75%, transparent); padding: .7rem .8rem; border-radius: 3px; font-weight: 550; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.side-nav button:hover { background: color-mix(in oklab, var(--c-paper) 7%, transparent); color: var(--c-paper); }
.side-nav button[aria-current="page"] { background: var(--c-paper); color: var(--c-ink); }
.pill { background: var(--c-accent); color: var(--c-ink); font-family: var(--f-mono); font-size: .68rem; padding: .1rem .45rem; border-radius: 99px; font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: .5rem; }
.side-foot .btn-line { --b-bd: var(--line); color: var(--c-paper); }
.side-foot .btn-line:hover { --b-bg: var(--c-paper); --b-fg: var(--c-ink); }
.side-foot .btn-ghost { color: color-mix(in oklab, var(--c-paper) 70%, transparent); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--c-paper); border-bottom: 1px solid var(--line); padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(24px, env(safe-area-inset-left, 0px)); display: flex; gap: 1rem; align-items: center; min-height: 64px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-family: var(--f-display); font-stretch: 110%; font-weight: 850; text-transform: uppercase; font-size: 1.35rem; }
.side-toggle { display: none; width: 42px; height: 42px; border: 1.5px solid var(--c-ink); border-radius: 3px; background: transparent; place-items: center; }
.savebar { margin-left: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.save-state { color: var(--muted); font-size: .66rem; }
.save-state.dirty { color: var(--c-danger); }
.btn:disabled { opacity: .45; pointer-events: none; }
.demo-banner { background: var(--c-accent); color: var(--c-ink); padding: .6rem max(24px, env(safe-area-inset-left, 0px)); font-size: .88rem; font-weight: 550; }
.panel { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 80px max(24px, env(safe-area-inset-left, 0px)); max-width: 1180px; width: 100%; display: grid; gap: 20px; align-content: start; }

/* Bloques */
.card { background: var(--c-paper); border: 1px solid var(--line); border-radius: 4px; padding: 1.3rem; display: grid; gap: 1rem; min-width: 0; align-content: start; }
.card > h2 { margin: 0; font-size: 1.1rem; font-weight: 750; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card > h2 .mono { color: var(--muted); font-weight: 500; }
.card > p.desc { margin: -.5rem 0 0; color: var(--muted); font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--c-paper); border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.1rem; display: grid; gap: .2rem; }
.tile .mono { color: var(--muted); font-size: .62rem; }
.tile strong { font-family: var(--f-display); font-stretch: 70%; font-weight: 850; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: .8rem; }
.tile.hl { background: var(--c-ink); color: var(--c-paper); border-color: var(--c-ink); }
.tile.hl .mono, .tile.hl small { color: color-mix(in oklab, var(--c-paper) 65%, transparent); }
.chart { width: 100%; height: auto; }
.chart text { font-family: var(--f-mono); font-size: 10px; fill: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; gap: .4rem; align-items: center; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.todo li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.todo .st { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; }
.todo .done .st { background: var(--c-secondary); border-color: var(--c-secondary); color: #fff; }
.todo li button { font-size: .8rem; border: 1px solid var(--line); background: transparent; padding: .3rem .6rem; border-radius: 3px; }
.todo .done span:nth-child(2) { color: var(--muted); text-decoration: line-through; }

/* Consultas */
.lead-tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.lead-tools input, .lead-tools select { padding: .6rem .7rem; border: 1.5px solid var(--line); border-radius: 3px; background: #fff; min-width: 0; }
.lead-tools input { flex: 1 1 220px; }
.ltable-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--c-paper); }
.ltable { width: 100%; border-collapse: collapse; min-width: 900px; font-size: .9rem; }
.ltable th { text-align: left; font-family: var(--f-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; padding: .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ltable td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ltable td.nowrap { white-space: nowrap; }
.ltable .msg { max-width: 260px; color: var(--muted); font-size: .85rem; }
.ltable select, .ltable input { padding: .35rem .45rem; border: 1px solid var(--line); border-radius: 3px; background: #fff; font-size: .85rem; width: 100%; min-width: 120px; }
.st-nuevo { box-shadow: inset 3px 0 0 var(--c-accent); }
.st-contactado { box-shadow: inset 3px 0 0 var(--c-primary); }
.st-inscrito { box-shadow: inset 3px 0 0 var(--c-secondary); }
.st-descartado { box-shadow: inset 3px 0 0 color-mix(in oklab, var(--c-ink) 25%, transparent); opacity: .7; }
.wa-mini { display: inline-flex; align-items: center; gap: .3rem; color: #1a8f48; font-weight: 600; text-decoration: none; }
.icon-btn { border: 1px solid var(--line); background: transparent; width: 34px; height: 34px; border-radius: 3px; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--c-ink); border-color: var(--c-ink); }
.icon-btn.danger:hover { color: var(--c-danger); border-color: var(--c-danger); }
.confirm { display: inline-flex; gap: .3rem; align-items: center; font-size: .82rem; white-space: nowrap; }
.confirm button { border: 1px solid var(--line); background: #fff; border-radius: 3px; padding: .25rem .5rem; font-size: .8rem; }
.confirm .yes { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); display: grid; gap: .6rem; justify-items: center; }
.empty strong { color: var(--c-ink); font-size: 1.05rem; }

/* Editor */
.color-field { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .6rem; align-items: center; }
.color-field input[type="color"] { width: 48px; height: 44px; padding: 2px; border: 1.5px solid var(--line); border-radius: 3px; background: #fff; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { border: 1.5px solid var(--line); background: #fff; border-radius: 4px; padding: .5rem .6rem; display: grid; gap: .4rem; font-size: .82rem; font-weight: 600; text-align: left; min-width: 120px; }
.preset:hover { border-color: var(--c-ink); }
.preset .sw-row { display: flex; gap: 3px; }
.preset .sw-row i { width: 18px; height: 18px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, .1); }
.preview { border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.pv-hero { background: var(--pv-paper); color: var(--pv-ink); padding: 1.2rem 1.3rem; display: grid; gap: .6rem; background-image: linear-gradient(color-mix(in oklab, var(--pv-primary) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in oklab, var(--pv-primary) 9%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.pv-hero b { font-family: var(--f-display); font-stretch: 118%; font-weight: 850; text-transform: uppercase; font-size: 1.9rem; line-height: .9; }
.pv-hero b span { color: transparent; -webkit-text-stroke: 1.5px var(--pv-primary); }
.pv-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.pv-btns span { padding: .5rem .8rem; border-radius: 3px; font-size: .82rem; font-weight: 650; }
.pv-dark { background: var(--pv-ink); color: var(--pv-paper); padding: 1rem 1.3rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.pv-dark i { width: 14px; height: 14px; border-radius: 2px; display: inline-block; }
.img-field { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .8rem; align-items: start; }
.img-thumb { width: 96px; height: 72px; border: 1px dashed var(--line); border-radius: 3px; background: #fff center / contain no-repeat; display: grid; place-items: center; color: var(--muted); font-size: .7rem; text-align: center; }
.img-actions { display: grid; gap: .4rem; min-width: 0; }
.img-actions .row { display: flex; gap: .4rem; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toggle { display: flex; align-items: center; gap: .7rem; font-weight: 550; }
.toggle input { width: 42px; height: 24px; appearance: none; background: color-mix(in oklab, var(--c-ink) 20%, transparent); border-radius: 99px; position: relative; transition: background .2s; flex: none; margin: 0; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked { background: var(--c-secondary); }
.toggle input:checked::after { transform: translateX(18px); }
.list-ed { display: grid; gap: 10px; }
.li-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: start; }
.li-btns { display: flex; gap: 4px; }
.obj-item { border: 1px solid var(--line); border-radius: 4px; padding: 1rem; background: color-mix(in oklab, var(--c-paper) 50%, #fff); display: grid; gap: .8rem; }
.obj-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.obj-head .mono { color: var(--muted); }
.add-btn { justify-self: start; }

@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-100%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .side-toggle { display: grid; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .savebar { width: 100%; margin-left: 0; }
  .save-state { margin-right: auto; }
}
