/* WeddingCore — panel de administración */
:root {
  --paper: #f6f7f5;
  --surface: #ffffff;
  --ink: #1f2a24;
  --muted: #66716b;
  --line: #dde2de;
  --sage: #4e6b5a;
  --sage-dark: #3b5546;
  --alert: #a33a2e;
  --alert-bg: #f8ebe9;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1.5rem; font-weight: 650; }
h2 { font-size: 1.15rem; margin: 2.5rem 0 1rem; font-weight: 650; }
a { color: var(--sage-dark); }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* Barra superior */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 2rem; padding: .9rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 1.25rem; flex: 1; }
.nav a { text-decoration: none; color: var(--ink); padding-bottom: 2px; }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--sage); }
.nav-soon { color: var(--muted); cursor: default; }
.logout { display: flex; align-items: center; gap: .75rem; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }

.page { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* Cifras del resumen: una línea de datos, sin tarjetas */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figures > div { padding: 1.25rem 1rem 1.25rem 0; color: var(--muted); }
.figures strong { display: block; font-size: 2rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 650; }

/* Tablas */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Formularios */
.form { display: grid; gap: .4rem; }
.form label { font-weight: 600; margin-top: .6rem; }
.form input { font: inherit; padding: .65rem .75rem; border: 1px solid #b9c2bc; border-radius: 6px; background: var(--surface); color: var(--ink); }
.button { margin-top: 1.25rem; font: inherit; font-weight: 600; padding: .75rem 1rem; border: 0; border-radius: 6px; background: var(--sage); color: #fff; cursor: pointer; }
.button:hover { background: var(--sage-dark); }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--sage-dark); text-decoration: underline; cursor: pointer; }

.alert { background: var(--alert-bg); color: var(--alert); padding: .75rem 1rem; border-radius: 6px; }
.muted { color: var(--muted); }

/* Páginas sueltas (login, errores) */
body.plain { display: grid; min-height: 100vh; place-items: center; padding: 1.5rem; }
.plain-box { width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2rem; }
.plain-box h1 { font-size: 1.35rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Panel de la pareja y formularios largos */
.notice-ok { background: #e7f1eb; color: #2f6b45; padding: .75rem 1rem; border-radius: 6px; }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sage); border-radius: 6px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.callout form, .callout p { margin: 0; }
.callout .button { margin-top: 0; }
.form-wide { max-width: 44rem; }
.form fieldset { border: 0; border-top: 1px solid var(--line); padding: 1.25rem 0 .5rem; margin: 0; display: grid; gap: .4rem; min-width: 0; }
.form legend { font-weight: 650; padding: 0 0 .5rem; }
.form textarea, .form select { font: inherit; padding: .65rem .75rem; border: 1px solid #b9c2bc; border-radius: 6px; background: var(--surface); color: var(--ink); }
.form small { margin-bottom: .4rem; }
.two { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.two > div { display: grid; gap: .4rem; align-content: start; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400 !important; }
label.field-error, .field-error { color: var(--alert); }
.field-error + input, .field-error + textarea, input.field-error { border-color: var(--alert) !important; }
.thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; }
.sticky-save { position: sticky; bottom: 0; background: var(--paper); padding: .75rem 0; margin: 0; border-top: 1px solid var(--line); }
.copy-row input { width: 100%; max-width: 36rem; font: inherit; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.upload-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1rem 0; }
.upload-row .button { margin-top: 0; }
.photo-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.photo-actions { display: flex; gap: .75rem; justify-content: space-between; margin-top: .35rem; }
.photo-actions form { margin: 0; }
.danger { color: var(--alert) !important; }
.button-danger { background: var(--alert); }
.button-danger:hover { background: #82291f; }
td.wrap { white-space: normal; min-width: 12rem; }
.bar a { color: var(--ink); }

/* Panel de administración: listas y acciones */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1rem; }
.filters input, .filters select, td input, td select, .inline input { font: inherit; padding: .5rem .6rem; border: 1px solid #b9c2bc; border-radius: 6px; background: var(--surface); }
.filters .button, .inline .button { margin-top: 0; }
.wide { width: 100%; min-width: 16rem; }
.short { width: 6rem; }
.inline { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.actions-grid { display: grid; gap: .75rem; justify-items: start; }
.button-light { background: var(--surface); color: var(--ink); border: 1px solid #b9c2bc; }
.button-light:hover { background: var(--paper); }
.tag { font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; background: #e7f1eb; color: var(--sage-dark); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 1.5rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.log { color: var(--muted); font-size: .9rem; padding-left: 1.1rem; }
.pager { display: flex; gap: .6rem; margin: 1rem 0; }
.pager a[aria-current="page"] { font-weight: 700; }
.text-edit { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; margin: 0 0 1rem; }
.text-edit .key { margin: 0 0 .5rem; }
.three { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.three label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
.three textarea { font: inherit; color: var(--ink); padding: .5rem; border: 1px solid #b9c2bc; border-radius: 6px; resize: vertical; }

/* Ficha de boda: acciones agrupadas y zona peligrosa */
.action-groups { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.action-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; display: grid; gap: .6rem; align-content: start; }
.action-box h3 { margin: 0 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.action-box .inline { flex-wrap: nowrap; }
.action-box .button { margin-top: 0; }
.danger-zone { margin-top: 3rem; border: 1px solid #e3b8b1; background: #fdf6f5; border-radius: 8px; padding: 1.25rem 1.25rem .5rem; }
.danger-zone h2 { margin: 0 0 1rem; color: var(--alert); }
.danger-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; padding: .9rem 0; border-top: 1px solid #efd3ce; }
.danger-row p { margin: 0; flex: 1 1 20rem; }
.danger-row .button { margin-top: 0; }
.button-danger-light { background: var(--surface); color: var(--alert); border: 1px solid #e3b8b1; }
.button-danger-light:hover { background: var(--alert-bg); }

/* Acciones: que nada se salga de su caja */
.action-box form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.action-box input.short { width: 4.5rem; flex: 0 0 4.5rem; }
.action-box .slug-prefix { color: var(--muted); margin-right: -.3rem; }
.action-box .slug-input { flex: 1 1 8rem; min-width: 0; }
.action-box .button { white-space: nowrap; }
.action-box .small { font-size: .85rem; margin: 0; }

/* Textos: categorías bajo el buscador */
.text-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.5rem; }
.text-cats a { text-decoration: none; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink, inherit); font-size: .9rem; }
.text-cats a span { color: var(--muted); font-size: .8rem; margin-left: .2rem; }
.text-cats a[aria-current="page"] { background: #1f2a24; border-color: #1f2a24; color: #fff; }
.text-cats a[aria-current="page"] span { color: rgba(255,255,255,.7); }
.text-edit { scroll-margin-top: 1rem; }

/* Dominios: guía por dominio */
.dom-server { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.25rem; margin: 0 0 2rem; }
.dom-server p { margin: 0; }
.dom-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: .35rem !important; }
.dom-value { font-size: 1.1rem; margin-bottom: .25rem !important; }
.small { font-size: .85rem; }
h2 .count { font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; vertical-align: middle; margin-left: .3rem; }
.dom-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1.5rem; overflow: hidden; }
.dom-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.dom-head h3 { margin: 0 0 .2rem; font-size: 1.3rem; }
.dom-head p { margin: 0; }
.dom-steps { list-style: none; margin: 0; padding: .5rem 1.25rem 0; counter-reset: step; }
.dom-steps > li { counter-increment: step; position: relative; padding: .9rem 0 1rem 2.6rem; border-top: 1px solid var(--line); }
.dom-steps > li:first-child { border-top: 0; }
.dom-steps > li::before { content: counter(step); position: absolute; left: 0; top: .85rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 1.5px solid var(--line); color: var(--muted); background: #fff; }
.dom-steps > li.is-current::before { border-color: #1f2a24; color: #fff; background: #1f2a24; }
.dom-steps > li.is-done::before { content: "✓"; border-color: #4e6b5a; background: #4e6b5a; color: #fff; }
.dom-steps > li.is-done h4 { color: var(--muted); }
.dom-steps h4 { margin: .15rem 0 .4rem; font-size: 1rem; }
.dom-steps p { margin: .3rem 0; }
.dom-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 0; }
.dom-row input[type="text"] { flex: 1 1 14rem; min-width: 0; margin: 0; }
.dom-row select, .dom-row .button { margin: 0; }
.dom-inline { margin-top: .5rem; }
.dom-records { margin: .5rem 0; }
.dom-records td { vertical-align: middle; }
.copy-field { display: inline-flex; align-items: center; gap: .35rem; }
.copy-field code { background: #f3f1ec; padding: .15rem .45rem; border-radius: 6px; font-size: .9em; word-break: break-all; }
.copy-btn { font: inherit; font-size: .75rem; padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; color: var(--muted); }
.copy-btn:hover { color: inherit; border-color: rgba(0,0,0,.3); }
.chip { display: inline-block; font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.chip-ok { background: #e7f1ea; color: #2f6b45; }
.chip-bad, .chip-failed { background: #fbeceb; color: #a33a2e; }
.chip-wait { background: #f3f1ec; color: #6b6458; }
.chip-paid { background: #fff4dd; color: #8a5a00; }
.chip-registered { background: #e8eef9; color: #2c4f8a; }
.dom-more { padding: .75rem 1.25rem 1rem; border-top: 1px solid var(--line); background: #fbfaf7; }
.dom-more summary, .dom-help summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.dom-help { margin-top: 2rem; }
.dom-help p { max-width: 46rem; }
button[disabled] { opacity: .45; cursor: not-allowed; }
.dom-row input[type="text"] { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.dom-row input[type="text"]:focus { outline: none; border-color: rgba(0,0,0,.35); }
.dom-row select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.dom-sub { margin-top: .6rem !important; }

/* Comercial */
.sub-tabs { margin-top: -.5rem; }
.head-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; }
.head-row p { margin: 0; flex: 1 1 24rem; }
.head-row .button { margin-top: 0; text-decoration: none; }
a.button { display: inline-block; text-decoration: none; color: #fff; }
.upper { text-transform: uppercase; }
.promo-form .two input { width: 100%; }
.promo-form [data-show-when] { margin-top: .25rem; display: grid; gap: .4rem; }
.promo-form [hidden] { display: none !important; }
.text-lang { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: .6rem .9rem; margin: .4rem 0; display: grid; gap: .35rem; }
.text-lang[open] { padding-bottom: 1rem; }
.text-lang summary { cursor: pointer; font-weight: 600; }
.text-lang label { margin-top: .6rem; }
.promo-actions { margin-top: 2.5rem; }
.campaign-new input[name="name"] { flex: 2 1 16rem; min-width: 0; }
.campaign-new input[name="ref"] { flex: 1 1 10rem; min-width: 0; }
.results-table { margin-top: 1rem; }
h1 .chip { vertical-align: middle; font-size: .8rem; }
tr.muted td { color: var(--muted); }
.text-lang { display: block; }
.text-lang label, .text-lang input, .text-lang small { display: block; width: 100%; }
.text-lang input { margin-top: .3rem; }
.text-lang small { margin-top: .25rem; }

/* Comercial: oportunidades y correos */
.lead-text { max-width: 46rem; margin: 0 0 .5rem; }
.opp-group { margin: 2rem 0 0; }
.opp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .5rem 1.5rem; margin: 0 0 .75rem; }
.opp-head h2 { margin: 0 0 .2rem; }
.opp-head p { margin: 0; }
.opp-model { text-align: right; }
.opp-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; padding: .9rem 1rem; margin: 0; }
.opp-submit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .75rem 0 0; }
.opp-submit .button { margin-top: 0; }
.check-col { width: 2.5rem; text-align: center; }
.check-col input { width: 1.05rem; height: 1.05rem; }
.row-actions { text-align: right; }
.row-actions .link + .link { margin-left: .75rem; }
.muted-link { color: var(--muted); }
.new-mail select, .inline select { font: inherit; padding: .5rem .6rem; border: 1px solid #b9c2bc; border-radius: 6px; background: var(--surface); }
.new-mail select { max-width: 16rem; }
.mail-form .table-wrap { margin: .25rem 0 .5rem; }
.mail-form td select { width: auto; }
.add-couples { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: .6rem .9rem; margin: .4rem 0; }
.add-couples[open] { padding-bottom: .9rem; }
.add-couples summary { font-weight: 600; cursor: pointer; }
.add-couples small { display: block; margin-top: .4rem; }
.add-filters { margin: .75rem 0 .5rem; }
.add-filters input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.add-list { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.add-list li { padding: .45rem .75rem; border-top: 1px solid var(--line); }
.add-list li:first-child { border-top: 0; }
.add-list .check { margin: 0; align-items: flex-start; gap: .6rem; cursor: pointer; }
.add-list .check input { margin-top: .3rem; flex: 0 0 auto; width: 1.05rem; height: 1.05rem; }
.mail-form textarea { width: 100%; min-height: 12rem; line-height: 1.5; resize: vertical; }
.mail-form .text-lang input, .mail-form .text-lang textarea { width: 100%; }
.load-template { margin: 0 0 .25rem; }
.load-template .button { margin-top: 0; }
.mail-preview { display: block; width: 100%; height: 40rem; border: 1px solid var(--line); border-radius: 8px; background: #f6f7f5; margin: .5rem 0 .25rem; }
.mail-actions { position: static; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1rem; padding-top: 1.25rem; }
.mail-actions .button { margin-top: 0; }
.mail-actions input[type="datetime-local"] { font: inherit; padding: .55rem .6rem; border: 1px solid #b9c2bc; border-radius: 6px; background: var(--surface); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
legend .count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; margin-left: .3rem; }

/* Panel de la pareja: descuento personal de un correo */
.notice-offer { background: #f3f7f4; border: 1px dashed #9db3a5; color: var(--ink); padding: .75rem 1rem; border-radius: 6px; }
.notice-offer a { text-decoration: none; font-weight: 600; margin-left: .25rem; }
