/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #17211e;
  --ink-2: #44504c;
  --muted: #7a8581;
  --line: #e6e3da;
  --line-strong: #d3cfc3;
  --brand: #0e7c66;
  --brand-ink: #0a5c4c;
  --brand-soft: #e2f3ee;
  --side: #0f1c19;
  --side-2: #182925;
  --side-ink: #a9b9b4;
  --ok: #16794f;
  --ok-soft: #e1f4ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1d8;
  --err: #b3261e;
  --err-soft: #fde8e6;
  --info: #1f5fa8;
  --info-soft: #e5effb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 33, 30, 0.05), 0 8px 24px -12px rgba(23, 33, 30, 0.12);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 700; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-ink);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, #19b592, #0e7c66); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: #61736d; padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: var(--side-ink); font-weight: 500;
}
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-2); color: #fff; box-shadow: inset 2px 0 0 #19b592; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; font-size: 12.5px; }
.side-foot button { background: none; border: 0; padding: 0; color: var(--side-ink); font: inherit; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.side-foot button:hover { color: #fff; }
.side-note { background: var(--side-2); border-radius: 9px; padding: 9px 10px; line-height: 1.4; }
.side-note b { color: #f1c56b; }

.main { padding: 34px 40px 60px; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.worker-down { max-width: 1180px; margin: 0 auto 22px; }
.live-stopped { color: var(--err); font-weight: 600; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 7px; align-items: center; }
.crumbs a { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 20px; align-items: start; }
.sticky { position: sticky; top: 20px; }

/* ------------------------------------------------------------------ botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 600 14px var(--font); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #bdb8aa; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 14px -8px rgba(14, 124, 102, 0.8); }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: #eab5b0; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(23, 33, 30, 0.06); border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
form.inline { display: inline; }

/* ------------------------------------------------------------------ tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot-pending { background: #b08a2e; } .dot-scheduled { background: var(--info); } .dot-sent { background: var(--ok); } .dot-failed { background: var(--err); }
.dot-live { background: #19b592; box-shadow: 0 0 0 0 rgba(25, 181, 146, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 9px rgba(25, 181, 146, 0); } }

/* ------------------------------------------------------------------ badges y chips */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eeece5; color: var(--ink-2); white-space: nowrap; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-scheduled, .badge-sending, .badge-running { background: var(--info-soft); color: var(--info); }
.badge-sent, .badge-completed, .badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-failed, .badge-error { background: var(--err-soft); color: var(--err); }
.badge-cancelled { background: #eeece5; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px var(--mono); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.chip-ok { background: var(--ok-soft); border-color: #b9e2cc; color: var(--ok); }
.chip-err { background: var(--err-soft); border-color: #f1c1bd; color: var(--err); }
.chip-key { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------------------------------------------ formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13.5px; }
.hint { color: var(--muted); font-size: 12.5px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--err); font-size: 13px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 14.5px var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.16); }
textarea { font: 13.5px/1.6 var(--mono); resize: vertical; min-height: 220px; tab-size: 2; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.input-wrap .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 7px; border-radius: 7px; color: var(--muted); cursor: pointer; display: grid; }
.input-wrap .reveal:hover { background: var(--surface-2); color: var(--ink); }
.secret-saved { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.04em; }
.secret-saved span:last-child { font-family: var(--font); letter-spacing: 0; color: var(--muted); font-size: 12.5px; margin-left: auto; }

.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 11px; cursor: pointer; font-weight: 600; background: var(--surface); }
.choice label small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.choice input { margin-top: 3px; accent-color: var(--brand); }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.panel { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 16px; }
[hidden] { display: none !important; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 40px; height: 23px; border-radius: 999px; background: #cfcabb; position: relative; transition: background 0.18s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform 0.18s; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; accent-color: var(--brand); }

/* ------------------------------------------------------------------ tablas */
/* relative: los elementos ocultos posicionados (.sr-only) quedan dentro del scroll y no ensanchan la página */
.table-wrap { overflow-x: auto; position: relative; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf8; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table th.key { color: var(--brand-ink); }
.cell-title { font-weight: 600; color: var(--ink); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ avisos */
.issues { display: flex; flex-direction: column; gap: 8px; }
.issue { display: flex; gap: 11px; padding: 11px 14px; border-radius: 11px; font-size: 13.5px; line-height: 1.45; border: 1px solid transparent; }
.issue .i { margin-top: 1px; }
.issue-error { background: var(--err-soft); color: #7d1a14; border-color: #f3c9c5; }
.issue-warning { background: var(--warn-soft); color: #6d4100; border-color: #f2dba7; }
.issue-info { background: var(--info-soft); color: #164678; border-color: #c5dbf5; }
.issue-ok { background: var(--ok-soft); color: #0f5a3a; border-color: #b9e2cc; }

.toasts { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: min(430px, calc(100vw - 36px)); }
.toast { display: flex; gap: 11px; padding: 13px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 14px 34px -12px rgba(0,0,0,0.45); font-size: 13.5px; line-height: 1.45; animation: toast-in 0.25s ease-out; }
.toast.success .i { color: #5fe0b8; } .toast.error .i { color: #ff9c94; } .toast.warning .i { color: #f1c56b; } .toast.info .i { color: #9cc7f7; }
.toast button { margin-left: auto; background: none; border: 0; color: #9fb0ab; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; align-self: flex-start; }
.toast.leaving { opacity: 0; transform: translateX(12px); transition: all 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.empty { text-align: center; padding: 44px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty-icon .i { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); font-size: 16px; }
.empty p { max-width: 46ch; }

/* ------------------------------------------------------------------ campaña */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 11px 15px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs .count { font-size: 11.5px; background: #e9e6dd; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.tabs a.active .count { background: var(--brand-soft); color: var(--brand-ink); }
.meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 8px; }
.meta span { display: inline-flex; gap: 6px; align-items: center; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; padding: 15px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.step:hover { text-decoration: none; border-color: var(--brand); }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.step.done .step-n { background: var(--brand); border-color: var(--brand); color: #fff; }
.step p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.preview-frame { width: 100%; height: 420px; border: 0; background: #fff; border-radius: 0 0 var(--radius) var(--radius); display: block; }
.preview-subject { padding: 12px 20px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.preview-subject small { font-weight: 500; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.07em; flex: none; }
mark.var-miss { background: var(--err-soft); color: var(--err); border-radius: 4px; padding: 0 3px; }

.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 34px 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
/* Oculto a la vista pero enfocable: se puede subir el Excel solo con teclado. */
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.dropzone { position: relative; }
.dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft); outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone strong { font-size: 15px; }

/* ------------------------------------------------------------------ progreso */
.progress { height: 9px; border-radius: 999px; background: #e9e6dd; overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; transition: width 0.6s ease; }
.progress .p-sent { background: linear-gradient(90deg, #19b592, #0e7c66); }
.progress .p-failed { background: var(--err); }
.launch { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.launch:last-child { border-bottom: 0; }
.launch-nums { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.launch-nums b { color: var(--ink); }

/* ------------------------------------------------------------------ calendario */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-weight: 700; }
/* Solo la primera letra en mayúscula: "capitalize" convertiría "15 de diciembre" en "15 De Diciembre". */
.cal-title::first-letter, .when-box .date::first-letter { text-transform: uppercase; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 16px; color: var(--ink-2); }
.cal-nav button:hover { border-color: var(--brand); color: var(--brand-ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 3px; }
.cal-dow { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 6px 0; font-weight: 600; }
.cal-day { height: 40px; border: 0; background: none; font: 500 13.5px var(--font); color: var(--ink); cursor: pointer; position: relative; font-variant-numeric: tabular-nums; }
.cal-day span { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; }
.cal-day:hover:not(:disabled) span { background: #ebe8df; }
.cal-day:disabled { color: #c3beb1; cursor: default; }
.cal-day.other { color: #b5b0a3; }
.cal-day.today span { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal-day.in-range::before { content: ""; position: absolute; inset: 3px 0; background: var(--brand-soft); }
.cal-day.range-start::before { left: 50%; } .cal-day.range-end::before { right: 50%; }
.cal-day.range-start.range-end::before { display: none; }
.cal-day.range-start span, .cal-day.range-end span { background: var(--brand) !important; color: #fff; font-weight: 700; }
.when { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.when-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.when-box .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.when-box .date { font-weight: 700; font-size: 15px; margin: 2px 0 8px; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .track { height: 10px; background: #ece9e0; border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: linear-gradient(90deg, #19b592, #0e7c66); border-radius: 999px; min-width: 4px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.big-number { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(1200px 600px at 10% 10%, #1b3a33, var(--side)); padding: 56px; display: grid; place-items: center; }
/* ------------------------------------------------------------------ actividad: filtros y estado en vivo */
.live-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: #ebe8df; border-radius: 10px; flex-wrap: wrap; }
.segmented a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.segmented a:hover { color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, 0.55); }
.segmented a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 33, 30, 0.12); }
.segmented .count { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted); background: rgba(23, 33, 30, 0.06); border-radius: 999px; padding: 0 7px; }
.segmented a.active .count { background: var(--brand-soft); color: var(--brand-ink); }
.toolbar .switch { font-size: 13.5px; }
.hidden-note { display: flex; align-items: center; gap: 9px; padding: 10px 20px; font-size: 13px; color: var(--ok); background: var(--ok-soft); border-bottom: 1px solid #b9e2cc; }
.hidden-note a { font-weight: 600; margin-left: auto; }
.table tr.row-next td { background: var(--info-soft); }
.table tr.row-next td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.table tr.row-done td { color: var(--muted); }
.table tr.row-done .cell-title { color: var(--ink-2); font-weight: 500; }
.badge-next { background: var(--info); color: #fff; margin-left: 4px; }

.template-download { justify-content: space-between; }
.template-download-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 260px; }
.login-logo { width: min(340px, 70%); height: auto; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 16px; }

/* ------------------------------------------------------------------ lanzamientos en acordeón */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
details.launch { padding: 0; gap: 0; }
.launch-summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(120px, 220px) auto; align-items: center; gap: 14px; padding: 14px 20px; cursor: pointer; }
.launch-summary::-webkit-details-marker, .history-summary::-webkit-details-marker { display: none; }
.launch-summary:hover, .history-summary:hover { background: #fcfbf8; }
.launch-summary .cell-title { gap: 8px; }
.chevron { color: var(--muted); transition: transform 0.18s; }
details[open] > summary > .chevron { transform: rotate(90deg); }
.launch-mini { display: flex; flex-direction: column; gap: 5px; }
.mini-bar { height: 5px; border-radius: 999px; background: #e9e6dd; overflow: hidden; display: flex; }
.mini-bar span { display: block; height: 100%; transition: width 0.6s ease; }
.mini-bar .m-sent { background: linear-gradient(90deg, #19b592, #0e7c66); }
.mini-bar .m-failed { background: var(--err); }
.launch-badges { justify-content: flex-end; }
.launch-body { padding: 0 20px 18px 52px; display: flex; flex-direction: column; gap: 12px; }
.launch-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.timeline li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding-left: 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.timeline .tl-launched::before, .timeline .tl-resumed::before { background: var(--info); }
.timeline .tl-paused::before { background: #b08a2e; }
.timeline .tl-cancelled::before { background: var(--err); }
.timeline .tl-completed::before { background: var(--ok); }
.tl-when { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 112px; }
details.history { border-top: 1px solid var(--line); }
.history-summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 20px; cursor: pointer; flex-wrap: wrap; }
.history-summary .count { font-size: 11.5px; background: #e9e6dd; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.history-list { border-top: 1px solid var(--line); background: var(--surface-2); }
.history-list details.launch { background: var(--surface); }
.badge-paused { background: var(--warn-soft); color: var(--warn); }
.badge-skipped, .badge-blocked { background: #2a2f2d; color: #fff; }
.badge-blocked .i { width: 13px; height: 13px; }
.badge-discarded { background: #eeece5; color: var(--muted); }

/* ------------------------------------------------------------------ diálogos */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45); color: var(--ink); }
.dialog::backdrop { background: rgba(15, 28, 25, 0.45); backdrop-filter: blur(2px); }
.dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog h3 { font-size: 18px; }
.dialog-options { display: flex; flex-direction: column; gap: 10px; }
.option { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; transition: all 0.15s; }
.option span { color: var(--muted); font-size: 13px; }
.option:hover, .option:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.option-danger:hover, .option-danger:focus-visible { border-color: #eab5b0; background: var(--err-soft); }
.option-danger b { color: var(--err); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------------------ revisión: quitar duplicados */
.dedupe { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border: 1px solid #f2dba7; background: var(--warn-soft); border-radius: 12px; }
.dedupe-text { display: flex; flex-direction: column; gap: 6px; flex: 1 1 320px; }
.dedupe ul { margin: 0; padding: 0; list-style: none; display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; }
.dedupe .count { font-weight: 700; font-variant-numeric: tabular-nums; }
.note-warn { color: var(--warn); background: var(--warn-soft); border-bottom-color: #f2dba7; }

/* ------------------------------------------------------------------ destinatarios: filtros */
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { flex: 0 1 170px; min-width: 140px; }
.filters .field.grow { flex: 1 1 240px; }
.filters .field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.filters-actions { display: flex; gap: 8px; }
input[type="date"] { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 14px var(--font); }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.input-icon input { padding-left: 34px; }
.toolbar-search { flex: 1 1 260px; max-width: 420px; }
.stat-link { color: var(--ink); }
.stat-link:hover { text-decoration: none; border-color: var(--brand); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .split, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sticky { position: static; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .side-note { order: 5; flex-basis: 100%; }
  .tabs a { padding: 11px 12px; }
  .side-foot { margin: 0; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
  .card-head { flex-wrap: wrap; }
  .main { padding: 22px 16px 48px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .choice, .when { grid-template-columns: minmax(0, 1fr); }
  .launch-summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 12px 16px; }
  .launch-mini { grid-column: 2 / -1; }
  .launch-body { padding: 0 16px 16px; }
  .filters .field, .filters .field.grow { flex: 1 1 100%; }
}
