:root {
  --navy: #0c1a2e;
  --navy-2: #12233c;
  --ink: #1b2735;
  --muted: #5a6b7e;
  --bg: #f6f4ef;
  --bg-alt: #ffffff;
  --accent: #e8b64c;
  --accent-dark: #c99634;
  --line: #e3e0d8;
  --danger: #b23b3b;
  --ok: #1e7d4f;
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", var(--font-body);
  --shadow: 0 18px 40px -20px rgba(12, 26, 46, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: clip;
}

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.loading { color: var(--muted); padding: 48px 0; text-align: center; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.82em;
  white-space: nowrap;
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 0.2px;
}

.brand-name em { font-style: normal; color: var(--accent); font-weight: 600; }

.brand-dark .brand-name { color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-google {
  background: var(--bg-alt);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-google:hover:not(:disabled) { background: #faf9f6; transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-block { width: 100%; }

.btn-ghost-sm {
  color: #cfd8e3;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  padding: 7px 14px;
}
.btn-ghost-sm:hover { color: #fff; border-color: #fff; }

.btn-sm { padding: 9px 18px; font-size: 0.88rem; }

.link-btn {
  background: none;
  border: 0;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-user {
  color: #9fb0c1;
  font-size: 0.88rem;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Auth (página de login) ---------- */
.auth-page {
  display: grid;
  place-items: center;
  background:
    radial-gradient(50% 40% at 80% 0%, rgba(232, 182, 76, 0.08), transparent 60%),
    var(--bg);
  padding: 24px;
}

.auth-wrap { width: min(400px, 100%); }

.pending-check .auth-card {
  opacity: 0;
  pointer-events: none;
}

.pending-check::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid var(--line);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-card { transition: opacity 0.25s ease; }

.auth-card .brand { margin-bottom: 26px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dashboard: 2 columnas ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.auth-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 0.92rem;
  margin-bottom: 26px;
}

.form-status { font-size: 0.88rem; min-height: 1.4em; margin-top: 14px; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

.setup-notice { padding: 32px; text-align: center; }
.setup-notice h2 { font-family: var(--font-display); color: var(--navy); margin-bottom: 10px; }

/* ---------- Portal ---------- */
.portal { padding: 56px 0 80px; }

.portal-head { margin-bottom: 40px; max-width: 720px; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.portal-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--navy);
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.lead { font-size: 1.08rem; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.card p { color: var(--muted); font-size: 0.94rem; }

.empty-state {
  max-width: 560px;
  padding: 56px 0;
}

.empty-state h1 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.empty-state p { margin-bottom: 10px; }

/* ---------- Admin ---------- */
.admin { padding: 48px 0 80px; }

.actions-cell { white-space: nowrap; }
.actions-cell .link-btn { margin-left: 8px; }

.badge-cadm { background: var(--accent-dark); color: #fff; }

/* ---------- Accesos de la organización (portal) ---------- */
.access-manager { margin-top: 48px; }

.org-invites {
  list-style: none;
}

.org-invites li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}

.org-invites li > * { flex-shrink: 0; }
.org-invites li span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.org-invites li:last-child { border-bottom: 0; }
.org-invites li.muted { color: var(--muted); }
.org-invites .last-login { color: var(--muted); font-size: 0.82rem; }

.admin-section {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  margin-bottom: 28px;
}

.admin-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.section-hint { font-size: 0.88rem; margin-bottom: 20px; }

.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table tr:last-child td { border-bottom: 0; }

.assign-select {
  font: inherit;
  font-size: 0.88rem;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  min-width: 160px;
}

.badge {
  display: inline-block;
  background: var(--navy);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px;
}

.invite-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.invite-form input,
.invite-form select {
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}

.invite-form input { flex: 1 1 240px; }
.invite-form select { flex: 0 1 220px; }

.invite-form input:focus,
.invite-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 182, 76, 0.25);
}

/* ---------- Skeleton loading ---------- */
.sk {
  background: linear-gradient(90deg, var(--line) 25%, #efece5 50%, var(--line) 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.4s ease infinite;
}

.sk-eyebrow { width: 140px; height: 14px; margin-bottom: 18px; }
.sk-title { width: min(420px, 80%); height: 34px; margin-bottom: 40px; }
.sk-line { height: 14px; margin-bottom: 14px; }
.sk-line.short { width: 60%; }
.sk-card { min-height: 120px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .pending-check::after { animation: none; }
}

/* ---------- Portal cliente: shell con sidebar ---------- */
.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--navy);
  color: #cfd8e3;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand { margin-bottom: 38px; }

.side-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.side-hi {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
}

.side-role {
  font-size: 0.8rem;
  color: #8fa1b5;
  margin-bottom: 28px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-link {
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #aebdcd;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.side-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.side-link.active { color: var(--accent); background: rgba(232, 182, 76, 0.12); }

.side-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.side-email {
  font-size: 0.8rem;
  color: #8fa1b5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 36px 38px 72px;
}

.content-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.content .eyebrow { margin-bottom: 10px; }
.content .empty-state { padding: 40px 0; }
.content .cards { margin-top: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 60;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px;
    padding: 12px 16px 10px; box-shadow: 0 4px 16px rgba(12, 26, 46, 0.16);
  }
  .sidebar .brand { margin-bottom: 0; }
  .side-eyebrow, .side-hi, .side-role, .side-email { display: none; }
  .side-foot {
    grid-column: 2; grid-row: 1; margin-top: 0; border-top: 0; padding-top: 0;
    flex-direction: row; align-items: center;
  }
  .side-nav {
    grid-column: 1 / -1; flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    gap: 6px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-link { padding: 7px 12px; font-size: 0.86rem; white-space: nowrap; flex-shrink: 0; }
  .content { padding: 24px 18px 56px; }
}

@media (max-width: 640px) {
  .topbar-user { display: none; }
  .auth-card { padding: 32px 24px; }
  .content { padding: 20px 14px 48px; }
  .admin-section { padding: 18px 14px; border-radius: 12px; margin-bottom: 20px; }
  .cards { grid-template-columns: 1fr; }
  .invite-form { flex-direction: column; gap: 10px; }
  .invite-form input, .invite-form select, .invite-form .btn { width: 100%; flex: none; font-size: 16px; }
  .org-invites li { flex-wrap: wrap; gap: 6px 10px; }
}

/* ---------- Campañas: composer + previews lado a lado ---------- */
.camp-layout {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) 496px;
  gap: 26px;
  align-items: start;
}
.camp-compose { display: grid; gap: 24px; min-width: 0; }

.field { margin-bottom: 18px; }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.field-head label { font-weight: 600; font-size: 0.87rem; color: var(--ink); }
.field-tools { display: inline-flex; align-items: center; gap: 8px; }
.char-count { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.field input[type="text"],
.field input[type="url"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 0.94rem; background: #fff; color: var(--ink);
  resize: vertical; box-sizing: border-box; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input[type="text"]:focus,
.field input[type="url"]:focus,
.field input[type="datetime-local"]:focus,
.field select:focus,
.field textarea:focus,
.seg-picker select:focus,
.icon-cfg-row input:focus {
  outline: none; border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(232, 182, 76, 0.18);
}
.seg-picker { margin-top: 10px; }
.seg-picker select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 0.9rem; background: #fff; color: var(--ink);
}
.sched-row { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.sched-row label { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.sched-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 0.9rem; }

.seg { display: inline-flex; background: #eceadf; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font: inherit;
  font-size: 0.84rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.seg-btn.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(12, 26, 46, 0.12); }
.seg-xs { padding: 2px; border-radius: 8px; }
.seg-xs .seg-btn { padding: 4px 10px; font-size: 0.76rem; border-radius: 6px; }

.btn-sm { padding: 8px 14px; font-size: 0.84rem; border-radius: 8px; }
.btn-xs { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }

/* ---------- Dropzone de imagen (Composer) ---------- */
.img-drop {
  display: flex; align-items: center; gap: 14px; padding: 18px 16px;
  border: 1.5px dashed #d3cfc4; border-radius: 12px; background: #faf9f5;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.img-drop:hover, .img-drop.is-drag { border-color: var(--accent-dark); background: rgba(232, 182, 76, 0.08); }
.img-drop-ico { color: var(--muted); flex-shrink: 0; }
.img-drop-text { display: flex; flex-direction: column; gap: 2px; }
.img-drop-text strong { font-size: 0.88rem; color: var(--navy); font-weight: 600; }
.img-drop-text span { font-size: 0.78rem; color: var(--muted); }

.img-preview-box {
  display: flex; align-items: center; gap: 14px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #faf9f5;
}
.img-preview-box img {
  width: 84px; height: 62px; object-fit: cover; border-radius: 8px;
  background: #e9e6de; flex-shrink: 0; display: block;
}
.img-preview-info { flex: 1; min-width: 0; }
.img-preview-info strong {
  display: block; font-size: 0.84rem; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px;
}
.img-preview-actions { display: flex; align-items: center; gap: 12px; }
.img-url-row { margin-top: 8px; }

/* ---------- Panel de vista previa sticky (iPhone + Android lado a lado) ---------- */
.camp-preview-panel {
  position: sticky; top: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 14px 18px; box-shadow: 0 12px 32px -20px rgba(12, 26, 46, 0.22);
}
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 4px 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.preview-controls { display: inline-flex; align-items: center; gap: 6px; }
.dev-switch { display: none; }
.preview-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 700; color: var(--navy); letter-spacing: 0.01em;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(30, 125, 79, 0.18);
}
.camp-previews {
  display: flex; justify-content: center; align-items: flex-end; gap: 14px;
}
.dev-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dev-slot { position: relative; flex-shrink: 0; }
.dev-slot .marvel-device { position: absolute; top: 0; left: 50%; transform-origin: top center; }
.dev-slot-ios { width: 222px; height: 450px; }
.dev-slot-ios .marvel-device.iphone-x { transform: translateX(-50%) scale(0.52); }
.dev-slot-and { width: 217px; height: 414px; }
.dev-slot-and .marvel-device.nexus5 { transform: translateX(-50%) scale(0.62); }
.phone-label {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- Pantallas iOS y Android (fieles al look real) ---------- */
.lockscreen {
  position: relative; height: 100%; padding: 14px 16px 20px; box-sizing: border-box;
  display: flex; flex-direction: column; text-align: left;
  background: radial-gradient(circle at 22% 18%, #523626 0%, #1d1a24 46%, #0c1018 100%);
  color: #fff;
}
.camp-previews.is-light .lockscreen {
  background: linear-gradient(160deg, #c9ddf2 0%, #dde6f2 48%, #f2e6d5 100%);
  color: #141c28;
}
.ios-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 10px 0; font-size: 0.88rem; font-weight: 600; letter-spacing: 0.01em;
}
.status-icons { display: inline-flex; align-items: center; gap: 6px; opacity: 0.92; }
.lock-date {
  font-size: 1.02rem; font-weight: 500; opacity: 0.82; text-align: center;
  margin-top: 38px; text-transform: capitalize;
}
.lock-time {
  font-family: var(--font-display); font-size: 4.5rem; font-weight: 700;
  text-align: center; line-height: 1.02; letter-spacing: -0.03em; margin: 2px 0 34px;
}

.notif-card { border-radius: 18px; padding: 14px 15px; text-align: left; }
.notif-card.ios {
  background: rgba(34, 36, 44, 0.78);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  color: #fff;
}
.camp-previews.is-light .notif-card.ios {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 28px rgba(15, 27, 46, 0.14);
  color: #141c28;
}
.ios-notif-row { display: flex; align-items: flex-start; gap: 12px; }
.ios-notif-txt { flex: 1; min-width: 0; }
.ios-notif-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.notif-card.ios .notif-title { font-size: 0.98rem; font-weight: 700; line-height: 1.28; color: inherit; word-break: break-word; }
.notif-card.ios .notif-time { font-size: 0.82rem; opacity: 0.62; flex-shrink: 0; }
.notif-card.ios .notif-sub { font-size: 0.9rem; font-weight: 600; opacity: 0.9; margin-top: 2px; line-height: 1.28; word-break: break-word; }
.notif-card.ios .notif-body { font-size: 0.92rem; opacity: 0.86; margin-top: 3px; line-height: 1.35; word-break: break-word; }
.notif-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-top: 12px; display: block; }

.ios-lock-foot {
  margin-top: auto; display: flex; justify-content: space-between; padding: 0 22px 18px;
}
.ios-lock-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px);
}
.camp-previews.is-light .ios-lock-btn { background: rgba(20, 28, 40, 0.12); }
.ios-home-bar {
  width: 128px; height: 5px; border-radius: 99px; margin: 0 auto;
  background: rgba(255, 255, 255, 0.55);
}
.camp-previews.is-light .ios-home-bar { background: rgba(20, 28, 40, 0.35); }

/* Android shade */
.and-shade {
  height: 100%; padding: 10px 12px 18px; box-sizing: border-box; text-align: left;
  background: linear-gradient(180deg, #10141c 0%, #171c26 100%); color: #eef2f7;
}
.camp-previews.is-light .and-shade {
  background: linear-gradient(180deg, #e7ebf2 0%, #f2f4f8 100%); color: #1b2735;
}
.and-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 6px 14px; font-size: 0.84rem; font-weight: 600; opacity: 0.88;
}
.notif-card.and {
  background: #222834; color: #f1f4f9; border-radius: 18px; padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.camp-previews.is-light .notif-card.and {
  background: #fff; color: #1b2735; border-color: rgba(12, 26, 46, 0.06);
  box-shadow: 0 4px 16px rgba(12, 26, 46, 0.1);
}
.notif-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.app-name { font-size: 0.78rem; font-weight: 600; opacity: 0.75; }
.notif-dot { opacity: 0.45; font-size: 0.78rem; }
.notif-card.and .notif-time { font-size: 0.76rem; opacity: 0.6; }
.and-chev { margin-left: auto; opacity: 0.5; font-size: 0.9rem; line-height: 1; }
.notif-card.and .notif-title { font-size: 0.96rem; font-weight: 700; line-height: 1.3; word-break: break-word; }
.notif-card.and .notif-body { font-size: 0.88rem; opacity: 0.82; margin-top: 3px; line-height: 1.35; word-break: break-word; }
.notif-card.and .notif-img { max-height: 150px; border-radius: 10px; margin-top: 10px; }

/* App icons */
.app-icon {
  width: 20px; height: 20px; border-radius: 6px; background: var(--navy); color: #fff;
  font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.app-icon.ios-lg {
  width: 42px; height: 42px; border-radius: 10px; font-size: 1.05rem;
  background: linear-gradient(135deg, #e8b64c, #c99634); color: var(--navy);
  margin-top: 2px;
}
.app-icon.round { border-radius: 50%; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.app-icon.cfg { width: 64px; height: 64px; border-radius: 15px; font-size: 1.4rem; }

/* ---------- Ícono de app (Ajustes) ---------- */
.icon-cfg { display: flex; gap: 18px; align-items: flex-start; margin: 12px 0 22px; }
.icon-upload-box {
  position: relative; cursor: pointer; border-radius: 16px; padding: 4px;
  border: 1.5px dashed transparent; transition: border-color 0.15s, background 0.15s;
}
.icon-upload-box:hover, .icon-upload-box.is-drag {
  border-color: var(--accent-dark); background: rgba(232, 182, 76, 0.08);
}
.icon-upload-badge {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-size: 0.66rem; font-weight: 600;
  padding: 2px 7px; border-radius: 99px; white-space: nowrap;
}
.icon-cfg-fields { flex: 1; min-width: 0; }
.icon-cfg-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.icon-cfg-row { display: flex; gap: 8px; margin-top: 10px; }
.icon-cfg-row input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 0.9rem;
}

/* ---------- Emoji picker ---------- */
.emoji-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f5f3ec; border: 1px solid var(--line); border-radius: 99px;
  cursor: pointer; font: inherit; font-size: 0.76rem; font-weight: 600; color: var(--muted);
  padding: 3px 9px; line-height: 1.2; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.emoji-btn:hover { border-color: var(--accent-dark); color: var(--navy); background: #fff; }
.emoji-pop {
  position: fixed; z-index: 400; width: 292px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px;
  box-shadow: 0 18px 42px rgba(12, 26, 46, 0.22);
}
.emoji-cats {
  display: flex; align-items: center; gap: 4px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.emoji-cat {
  border: 0; background: transparent; padding: 4px 9px; border-radius: 7px;
  font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.emoji-cat.active { background: var(--navy); color: #fff; }
.emoji-close {
  margin-left: auto; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 0.85rem; padding: 2px 6px; border-radius: 6px;
}
.emoji-close:hover { background: #f2efe7; color: var(--navy); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
}
.emoji-cell {
  background: none; border: none; font-size: 1.35rem; cursor: pointer;
  padding: 5px 0; border-radius: 8px; line-height: 1.15; transition: background 0.1s, transform 0.1s;
}
.emoji-cell:hover { background: #f5f1e8; transform: scale(1.15); }

.opt { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.adv { margin-bottom: 18px; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; }
.adv summary { font-size: 0.85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.adv[open] summary { margin-bottom: 14px; }
.sched-hint { font-size: 0.78rem; color: var(--muted); margin: 6px 0 0 2px; }

/* Lista de campañas */
.camp-list { list-style: none; margin: 0; padding: 0; }
.camp-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.camp-item:last-child { border-bottom: 0; }
.camp-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.camp-dot.is-pending { background: var(--accent-dark); }
.camp-dot.is-sending { background: var(--accent); animation: pulse 1s infinite alternate; }
.camp-dot.is-sent { background: var(--ok); }
.camp-dot.is-error { background: var(--danger); }
@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }
.camp-info { flex: 1; min-width: 0; }
.camp-info strong { display: block; font-size: 0.93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-info small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-meta { text-align: right; flex-shrink: 0; }
.camp-status { font-size: 0.78rem; font-weight: 700; }
.camp-status.is-pending { color: var(--accent-dark); }
.camp-status.is-sending { color: var(--accent-dark); }
.camp-status.is-sent { color: var(--ok); }
.camp-status.is-error { color: var(--danger); }
.camp-meta small { display: block; color: var(--muted); font-size: 0.74rem; margin-top: 2px; }
.camp-empty { padding: 26px 0; color: var(--muted); font-size: 0.9rem; text-align: center; line-height: 1.6; }

/* Secciones numeradas del composer */
.camp-sec { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.camp-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sec-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 0.78rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.camp-sec h3 { font-family: var(--font-display); font-size: 1rem; color: var(--navy); margin: 0; }

/* Audiencia / prueba */
.test-row { margin-top: 10px; }
.test-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dev-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px;
  font: inherit; font-size: 0.8rem; color: var(--ink); cursor: pointer;
}
.dev-chip:hover { border-color: var(--accent-dark); }
.test-sel { margin-top: 8px; font-size: 0.85rem; color: var(--ink); }

/* Idiomas y A/B */
.lang-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.lang-head { display: flex; justify-content: space-between; align-items: center; }
.lang-sel { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.85rem; background: #fff; }
.lang-block input[type="text"], .lang-block textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.9rem; resize: vertical; box-sizing: border-box;
}
.check-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink); margin: 14px 0; cursor: pointer; }
.check-row input { accent-color: var(--accent-dark); width: 16px; height: 16px; }
.ab-card { border: 1px dashed var(--accent-dark); border-radius: 10px; padding: 14px; margin-bottom: 16px; background: rgba(232, 182, 76, 0.06); }
input[type="range"] { width: 100%; accent-color: var(--accent-dark); }

/* Acciones */
.camp-actions { display: flex; gap: 10px; margin-top: 20px; }
.camp-send { flex: 1; padding: 13px; font-size: 0.98rem; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 13px 18px; border-radius: 10px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.btn-ghost:hover { border-color: var(--accent-dark); color: var(--ink); }

/* Flags y draft en historial */
.camp-flags { font-size: 0.7rem; font-weight: 600; color: var(--accent-dark); margin-left: 4px; }
.camp-dot.is-draft, .camp-status.is-draft { background: var(--muted); }
.camp-status.is-draft { background: none; color: var(--muted); }

/* Aplicaciones: tabs + cabeceras */
.apps-tabs { display: inline-flex; gap: 4px; background: #eceadf; border-radius: 10px; padding: 3px; margin-bottom: 24px; }
.apps-tab {
  border: 0; background: transparent; padding: 8px 20px; border-radius: 8px; font: inherit;
  font-size: 0.9rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.apps-tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(12, 26, 46, 0.12); }
.camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.camp-head h2 { margin: 0; }
.camp-group { font-family: var(--font-display); font-size: 0.95rem; color: var(--navy); margin: 22px 0 4px; }
.camp-back { margin-bottom: 14px; display: inline-block; }

/* Tabla de datos (ajustes → dispositivos) */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .muted { color: var(--muted); }

@media (max-width: 1280px) {
  .camp-layout { grid-template-columns: 1fr; }
  .camp-preview-panel { position: static; order: -1; }
}
@media (max-width: 640px) {
  .apps-tabs { display: flex; width: 100%; margin-bottom: 18px; }
  .apps-tab { flex: 1; text-align: center; padding: 8px 10px; font-size: 0.86rem; }
  .camp-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .camp-head .btn { width: 100%; }
  .camp-item { flex-wrap: wrap; gap: 6px 10px; }
  .camp-meta {
    text-align: left; width: 100%; padding-left: 19px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .camp-meta small { margin-top: 0; }
  .field-head { flex-wrap: wrap; gap: 6px; }
  .field input[type="text"],
  .field input[type="url"],
  .field input[type="datetime-local"],
  .field select,
  .field textarea,
  .seg-picker select,
  .icon-cfg-row input,
  .lang-block input[type="text"],
  .lang-block textarea { font-size: 16px; }
  .seg { display: flex; width: 100%; }
  .seg .seg-btn { flex: 1 1 0; text-align: center; padding: 8px 6px; font-size: 0.82rem; }
  .seg.seg-aud { display: grid; grid-template-columns: repeat(2, 1fr); }
  .seg.seg-xs { display: inline-flex; width: auto; }
  .seg.seg-xs .seg-btn { flex: none; padding: 5px 10px; font-size: 0.76rem; }
  .sched-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .check-row { align-items: flex-start; line-height: 1.4; }
  .check-row input { margin-top: 3px; flex-shrink: 0; }
  .img-drop { padding: 16px 12px; }
  .img-preview-box { flex-direction: column; align-items: stretch; }
  .img-preview-box img { width: 100%; height: 150px; }
  .camp-actions { flex-direction: column; }
  .camp-actions .btn { width: 100%; }
  .icon-cfg { flex-direction: column; gap: 14px; }
  .icon-cfg-fields { width: 100%; }
  .icon-cfg-row { flex-direction: column; }
  .icon-cfg-row .btn { width: 100%; }
  .emoji-pop { width: min(300px, calc(100vw - 24px)); }
}
@media (max-width: 600px) {
  .camp-preview-panel { padding: 14px 12px 16px; overflow: hidden; }
  .preview-bar { flex-wrap: wrap; gap: 8px; }
  .preview-controls { width: 100%; justify-content: space-between; }
  .dev-switch { display: inline-flex; }
  .camp-previews[data-dev-show="ios"] .dev-col[data-device="and"],
  .camp-previews[data-dev-show="and"] .dev-col[data-device="ios"] { display: none; }
  .phone-label { display: none; }
}
