/* ============================================================
   SMS Masivos — Front auto-contenido (isla blanca)
   Todos los selectores van bajo .smt-app para no afectar al tema.
   ============================================================ */

/* Reset local del wrapper para neutralizar herencia del tema */
.smt-app {
  all: initial;
  display: block;
  max-width: 1100px;
  margin: 32px auto;
  padding: 28px 32px;
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.smt-app, .smt-app *, .smt-app *::before, .smt-app *::after { box-sizing: border-box; }
.smt-app *:not(input):not(textarea):not(button):not(select) {
  font-family: inherit;
  color: inherit;
  line-height: inherit;
}
.smt-app a { color: #2563eb; text-decoration: none; }
.smt-app a:hover { text-decoration: underline; }

/* Tipografía */
.smt-app h1 { font-size: 22px; font-weight: 600; margin: 0 0 16px; color: #111827; }
.smt-app h2 { font-size: 18px; font-weight: 600; margin: 20px 0 12px; color: #111827; }
.smt-app h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: #111827; }
.smt-app p, .smt-app label, .smt-app span, .smt-app td, .smt-app th, .smt-app div { color: inherit; }
.smt-app code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #111827; }
.smt-app .smt-muted { color: #6b7280; }

/* Tabs */
.smt-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
}
.smt-tab {
  padding: 10px 16px;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 14px;
  transition: color .15s ease, border-color .15s ease;
}
.smt-tab:hover { color: #111827; text-decoration: none; }
.smt-tab.is-active { color: #2563eb; border-bottom-color: #2563eb; }

/* Cards */
.smt-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.smt-card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;
  margin: 0 0 12px;
  font-weight: 600;
}

/* Pills */
.smt-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.smt-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #111827;
  user-select: none;
}
.smt-pill:hover { background: #f9fafb; }
.smt-pill.is-selected { background: #eff6ff; border-color: #2563eb; color: #1e40af; }
.smt-pill .smt-count { color: #9ca3af; font-size: 11px; }
.smt-pill.is-selected .smt-count { color: #2563eb; }
.smt-pill input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

/* Forms */
.smt-field { margin-bottom: 14px; }
.smt-label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; font-weight: 500; }
.smt-textarea, .smt-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  background: #fff;
}
.smt-textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.smt-input { height: 36px; }
.smt-textarea:focus, .smt-input:focus { outline: 2px solid #2563eb; outline-offset: -1px; border-color: #2563eb; }

/* Botones */
.smt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: #111827;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}
.smt-btn:disabled, .smt-btn[disabled] { opacity: .55; cursor: not-allowed; }
.smt-btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.smt-btn-primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; color: #fff; text-decoration: none; }
.smt-btn-secondary { background: #fff; color: #111827; border-color: #d1d5db; }
.smt-btn-secondary:hover { background: #f9fafb; }
.smt-btn-danger-soft { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.smt-btn-warn { background: #d97706; color: #fff; border-color: #d97706; padding: 6px 12px; font-size: 12px; }
.smt-btn-warn:hover { background: #b45309; }
.smt-btn-sm { padding: 5px 10px; font-size: 12px; }

/* Metrics */
.smt-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.smt-metrics.cols-3 { grid-template-columns: repeat(3, 1fr); }
.smt-metric {
  background: #f9fafb;
  border-radius: 8px;
  padding: 14px 16px;
}
.smt-metric-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.smt-metric-value { font-size: 24px; font-weight: 600; color: #111827; }
.smt-metric-value.is-success { color: #16a34a; }
.smt-metric-value.is-error { color: #dc2626; }
.smt-metric-value.is-warning { color: #d97706; }
.smt-metric-value.is-muted { color: #4b5563; }
@media (max-width: 700px) {
  .smt-metrics, .smt-metrics.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Tablas */
.smt-table-wrap { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.smt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.smt-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  padding: 10px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  letter-spacing: .03em;
}
.smt-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; color: #111827; vertical-align: middle; }
.smt-table tr:last-child td { border-bottom: 0; }
.smt-table tr:hover td { background: #fafafa; }
.smt-table .smt-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* Status pills */
.smt-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.smt-status.ok { background: #dcfce7; color: #166534; }
.smt-status.fail { background: #fee2e2; color: #991b1b; }
.smt-status.warn { background: #fef3c7; color: #92400e; }
.smt-status.pending { background: #e0e7ff; color: #3730a3; }

/* Summary bar */
.smt-summary-bar {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 8px;
  color: #111827;
}

/* Notices */
.smt-warn { color: #d97706; font-size: 12.5px; margin-top: 8px; }
.smt-notice { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; }
.smt-notice.is-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.smt-notice.is-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.smt-notice.is-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* Paginación */
.smt-pagination { display: flex; gap: 4px; justify-content: flex-end; margin-top: 16px; }
.smt-pagination a, .smt-pagination span {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  color: #111827;
  text-decoration: none;
  background: #fff;
}
.smt-pagination a:hover { background: #f9fafb; text-decoration: none; }
.smt-pagination .is-active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Modal */
.smt-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17,24,39,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100000;
  padding: 16px;
}
.smt-modal {
  background: #fff; color: #111827;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  max-width: 460px; width: 100%;
  padding: 22px 24px;
}
.smt-modal h3 { margin: 0 0 8px; font-size: 16px; }
.smt-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Utilidades */
.smt-app .smt-hidden { display: none !important; }
.smt-app .smt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.smt-app .smt-stack > * + * { margin-top: 12px; }
.smt-app .smt-back { display: inline-block; margin-bottom: 12px; font-size: 13px; }
