/* =========================================
   Variables de tema (light / dark)
   ========================================= */

:root {
  --primary: #0ea5e9;
  --primary-soft: rgba(14, 165, 233, 0.08);
  --primary-hover: #0284c7;

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.08);

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.08);

  --bg: #f3f4f6;
  --bg-soft: #ffffff;
  --ink: #0f172a;
  --ink-soft: #6b7280;
  --muted: #e5f0ff;
  --border: #d1d5db;

  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius-md: 12px;
  --radius-lg: 18px;

  --transition-fast: 0.15s ease;
  --transition-slow: 0.25s ease;
}

:root[data-theme="dark"] {
  --bg: #020617;
  --bg-soft: #020617;
  --ink: #e5e7eb;
  --ink-soft: #9ca3af;
  --muted: #020617;
  --border: #1f2933;

  --primary: #38bdf8;
  --primary-soft: rgba(56, 189, 248, 0.12);
  --primary-hover: #0ea5e9;

  --shadow-soft: 0 16px 45px rgba(0, 0, 0, 0.65);
}

/* =========================================
   Reset básico
   ========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top, rgba(14, 165, 233, 0.12), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  line-height: 1.5;
  transition:
    background-color var(--transition-slow),
    color var(--transition-slow),
    background var(--transition-slow);
}

/* Enlaces generales */

a {
  color: var(--primary);
  text-decoration: none;
  transition:
    color var(--transition-fast),
    opacity var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* =========================================
   Layout general: topbar / content / footer
   ========================================= */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.96));
  color: #e5e7eb;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar .brand strong {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar .brand .logo {
  display: block;
  border-radius: 999px;
}

/* Navegación principal */

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.main-nav a {
  color: #e5e7eb;
  opacity: 0.85;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  transition:
    background-color var(--transition-fast),
    opacity var(--transition-fast),
    color var(--transition-fast);
}

.main-nav a:hover {
  opacity: 1;
  background-color: rgba(148, 163, 184, 0.25);
}

/* Botón de tema */

#themeToggle {
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.45);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

#themeToggle:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
}

#themeToggle:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.6);
}

.content {
  padding: 1.25rem 1rem 2.5rem;
  max-width: 1120px;
  margin: 0 auto;
}

/* Footer */

.foot {
  padding: 0.75rem 1rem 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: linear-gradient(to top, rgba(15, 23, 42, 0.03), transparent);
}

/* =========================================
   Componentes base: tarjetas, botones, inputs
   ========================================= */

.card {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.05), transparent 60%),
    var(--bg-soft);
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
}

/* Botón genérico */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #f9fafb;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.2);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background-position var(--transition-fast);
  background-size: 200% 100%;
  background-position: 0% 50%;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  background-position: 100% 50%;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

/* Variante secundaria */

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(148, 163, 184, 0.12);
}

/* Inputs y selects */

.input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background-color: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow:
    0 0 0 1px var(--primary-soft),
    0 8px 18px rgba(15, 23, 42, 0.08);
  background-color: #ffffff;
  transform: translateY(-1px);
}

label {
  font-weight: 600;
  display: block;
  margin: 0.25rem 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* =========================================
   Auth (login / registro)
   ========================================= */

.auth-wrap {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(520px, 92vw);
  padding: 1.75rem 1.5rem 1.8rem;
  background: radial-gradient(circle at top, rgba(14, 165, 233, 0.08), transparent 60%),
    var(--bg-soft);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 22px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

/* =========================================
   Tablas
   ========================================= */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.6rem;
  text-align: left;
}

.table th {
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.03), transparent);
  font-weight: 600;
  color: var(--ink-soft);
}

.table tr:nth-child(even) td {
  background-color: rgba(148, 163, 184, 0.05);
}

/* =========================================
   Layouts auxiliares
   ========================================= */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* =========================================
   Badges
   ========================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.02);
}

/* =========================================
   Página de configuración Brevo (ses-*)
   ========================================= */

.ses-page {
  width: 100%;
  margin: 24px auto 32px;
  padding: 0 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* En pantallas grandes, ocupa casi todo el ancho */
@media (min-width: 1024px) {
  .ses-page {
    max-width: 1320px;
    padding-inline: 24px;
  }
}

/* Tarjetas de Brevo */
.ses-card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 65%),
              radial-gradient(circle at top right, rgba(34, 197, 94, 0.06), transparent 60%),
              var(--bg-soft);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 22px;
  padding: 18px 18px 20px;
  margin-bottom: 10px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

/* pequeña banda decorativa arriba de cada tarjeta */
.ses-card::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 4px;
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  opacity: 0.8;
}

/* El contenido real baja 8px para no tapar la banda */
.ses-card > *:first-child {
  margin-top: 12px;
}

.ses-card > h1,
.ses-card > h2,
.ses-card > h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: 650;
  color: var(--ink);
}

/* Títulos de secciones con barra de color a la izquierda */
.ses-card h2 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ses-card h2::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), #22c55e);
}

/* Campos */
.ses-field {
  margin-bottom: 10px;
}

.ses-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.ses-input,
.ses-textarea,
.ses-select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  background-color: rgba(248, 250, 252, 0.96);
  color: var(--ink);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.ses-input:focus,
.ses-textarea:focus,
.ses-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow:
    0 0 0 1px var(--primary-soft),
    0 10px 24px rgba(15, 23, 42, 0.12);
  background-color: #ffffff;
  transform: translateY(-1px);
}

.ses-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 13px;
}

/* Botones Brevo */

.ses-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #22c55e);
  color: #f9fafb;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background-position var(--transition-fast);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.35);
  background-size: 200% 100%;
  background-position: 0% 50%;
}

.ses-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  background-position: 100% 50%;
  box-shadow: 0 16px 36px rgba(15, 118, 110, 0.4);
}

.ses-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.3);
}

.ses-btn.secondary {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: none;
}

/* Mensajes flash */

.ses-flash {
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ses-flash.ok {
  background: var(--success-soft);
  border: 1px solid #bbf7d0;
  color: #166534;
}

.ses-flash.err {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* Texto auxiliar */

.ses-small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

/* Layout inline */

.ses-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.ses-inline > .ses-field {
  flex: 1 1 160px;
}

/* Separadores suaves */

.ses-card hr {
  margin: 16px 0;
  border: none;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

/* =========================================
   Responsivo
   ========================================= */

@media (max-width: 768px) {
  .content {
    padding-inline: 0.6rem;
  }

  .main-nav {
    justify-content: flex-end;
  }

  .ses-page {
    margin-top: 14px;
    padding-inline: 10px;
  }

  .ses-card {
    padding: 14px 12px 16px;
    border-radius: 18px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
/* Tabs / submenús de la página Brevo */
.ses-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.ses-tab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.ses-tab:hover {
  background-color: rgba(148, 163, 184, 0.12);
  color: var(--ink);
}

.ses-tab.active {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}