:root {
  --brand: #439545;
  --brand-dark: #2e6b30;
  --brand-light: #6fa83c;
  --accent: #d4ad32;
  --text: #303030;
  --muted: #6b6b6b;
  --bg: #d9f0e4;
  --card: #fff;
  --border: #c2e2d3;
  --danger: #c53f32;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }

.admin-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

.admin-sidebar { background: #2b2b2b; color: #eaeaea; padding: 20px 0; }
.admin-sidebar .brand { padding: 0 20px 18px; font-size: 18px; font-weight: 800; letter-spacing: 2px; color: #fff; border-bottom: 1px solid #444; margin-bottom: 12px; }
.admin-sidebar a { display: block; color: #d5d5d5; padding: 10px 20px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #3a3a3a; color: #fff; }

.admin-main { padding: 24px 28px; }
.admin-main h1 { margin: 0 0 20px; font-size: 24px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--brand); }
.stat .label { color: var(--muted); font-size: 14px; }

.hero-manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.hero-manage__item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fff; }
.hero-manage__item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.hero-manage__info { flex: 1; min-width: 0; }
.hero-manage__name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-manage__info a { font-size: 12px; color: var(--brand); }

.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: #d6ece0; font-size: 14px; }
table.data img.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
table.data tr.filters th { background: #eef7f2; vertical-align: top; font-weight: 400; }
table.data tr.filters .form-control { min-width: 0; max-width: 180px; padding: 6px 8px; font-size: 13px; font-weight: 400; }
.filters-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.filters-actions .btn { white-space: nowrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge--ok { background: #e8f5e9; color: #1e7a2a; }
.badge--off { background: #fdecea; color: #c53f32; }
.badge--vip { background: #bce5d2; color: #439545; }
.badge--warn { background: #fff3cd; color: #8a6d00; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-size: 14px; font-weight: 600; text-align: center; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 13px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.form-control { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; }
textarea.form-control { min-height: 110px; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash--success { background: #e8f5e9; color: #1e7a2a; border: 1px solid #b7dfb9; }
.flash--error { background: #fdecea; color: #c53f32; border: 1px solid #f5c6c0; }

.login-box { max-width: 380px; margin: 80px auto; }
.login-box h1 { text-align: center; }

.image-list { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.image-item { position: relative; }
.image-item img { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; }
.image-item img.primary { border-color: var(--brand); }
.image-item .label { font-size: 11px; color: var(--muted); text-align: center; }

.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.table-meta { color: var(--muted); font-size: 14px; }
.perpage { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.perpage .form-control { width: auto; min-width: 70px; padding: 6px 8px; }
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination-ellipsis { color: var(--muted); padding: 0 2px; }

@media (max-width: 768px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; overflow-x: auto; padding: 8px; }
  .admin-sidebar .brand { border: 0; margin: 0; padding: 8px 12px; }
  .admin-sidebar a { padding: 8px 12px; white-space: nowrap; }
}

/* ==========================================================================
   Módulo de Contenido (Radar, Generador, Borradores, Publicados, Ajustes)
   ========================================================================== */

.content-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}
.content-tabs__link {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  border-radius: 6px 6px 0 0;
}
.content-tabs__link:hover { background: #eef7f2; color: var(--brand-dark); }
.content-tabs__link.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); background: #eef7f2; }

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.content-head h1 { margin: 0 0 4px; }
.content-head__sub { margin: 0; color: var(--muted); font-size: 14px; }
.content-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field--full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.field input[type=text],
.field input[type=url],
.field input[type=password],
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.field textarea { resize: vertical; }
.field__hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field--grow { flex: 1; }
.form--inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #eef7f2;
  color: var(--brand-dark);
  margin-right: 4px;
}
.tag--ok { background: #e8f5e9; color: #1e7a2a; }
.tag--warn { background: #fff3cd; color: #8a6d00; }

.flash--warn { background: #fff8e1; color: #8a6d00; border: 1px solid #ffe082; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }

.status-pills { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.pill--ok { background: #e8f5e9; color: #1e7a2a; border: 1px solid #b7dfb9; }
.pill--off { background: #fdecea; color: #c53f32; border: 1px solid #f5c6c0; }

.radar-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.radar-status.is-loading { background: #e3f2fd; color: #1565c0; }
.radar-status.is-ok { background: #e8f5e9; color: #1e7a2a; }
.radar-status.is-error { background: #fdecea; color: #c53f32; }

.radar-result {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #f8fdfa;
}
.radar-result h3 { margin: 0 0 10px; font-size: 16px; }
.seed-list { margin: 0; padding-left: 20px; }
.seed-list li { margin-bottom: 6px; }

.test-result { margin-top: 12px; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.test-result.is-loading { background: #e3f2fd; color: #1565c0; }
.test-result.is-ok { background: #e8f5e9; color: #1e7a2a; }
.test-result.is-error { background: #fdecea; color: #c53f32; }

.preview-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: #fcfefd;
  max-height: 620px;
  overflow-y: auto;
  line-height: 1.6;
}
.preview-box h1 { font-size: 24px; margin-top: 0; }
.preview-box h2 { font-size: 19px; margin-top: 22px; }
.preview-box h3 { font-size: 16px; margin-top: 18px; }
.preview-box .lead { font-size: 17px; color: var(--muted); font-style: italic; }
.preview-box a { color: var(--brand-dark); }

textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.muted { color: var(--muted); }

/* Ajustes de compatibilidad del módulo de contenido */
.card__title { margin: 0 0 14px; font-size: 17px; color: var(--brand-dark); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.form-group.field--grow { flex: 1; min-width: 260px; margin-bottom: 0; }
.form.group--inline, .form--inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
