/* PoliBrief v5 - Editorial paper style */
:root {
  --bg: #F4F1EB;
  --bg-card: #FFFEF9;
  --ink: #1A1A18;
  --ink-soft: #4A4A45;
  --ink-muted: #888;
  --line: #D8D3C4;
  --accent: #C0392B;
  --accent-soft: #E8C4BE;
  --success: #2D7A3E;
  --warning: #C8A23B;
  --danger: #C0392B;
  --shadow: 0 1px 0 rgba(0,0,0,0.04);
}

[data-theme="dark"] {
  --bg: #1A1A18;
  --bg-card: #232320;
  --ink: #F4F1EB;
  --ink-soft: #C4C0B5;
  --ink-muted: #888;
  --line: #3A3A35;
  --accent: #E55A4A;
  --accent-soft: #4A2823;
  --success: #5BB371;
  --warning: #E8C969;
  --danger: #E55A4A;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 16px 0;
  color: var(--ink);
}
h1 { font-size: 56px; font-weight: 900; letter-spacing: -1.5px; }
h2 { font-size: 32px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

p { margin: 0 0 14px 0; }

/* ============ HEADER ============ */
.pb-header {
  background: #1A1A18;
  color: #F4F1EB;
  border-bottom: 3px double #C0392B;
}
.pb-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.pb-logo {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #F4F1EB;
  text-decoration: none;
}
.pb-logo:hover { text-decoration: none; }
.pb-logo-accent { color: #C0392B; }
.pb-nav {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.pb-nav a {
  color: #F4F1EB;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-family: Georgia, serif;
  text-decoration: none;
}
.pb-nav a:hover { color: #C0392B; }
.pb-nav-logout { color: #C0392B !important; }
.pb-theme-btn {
  background: transparent;
  color: #F4F1EB;
  border: 1px solid #6A6A65;
  padding: 6px 14px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 12px;
}
.pb-theme-btn:hover { border-color: #C0392B; color: #F4F1EB; background: rgba(192, 57, 43, 0.15); }

/* ============ MAIN / SECTIONS ============ */
.pb-main,
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}
.pb-section { margin: 48px 0; }
.pb-section-highlight {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 12px;
  padding: 48px 32px;
  margin: 32px auto;
  max-width: 900px;
  text-align: center;
}
.pb-section-cta {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.pb-footer {
  text-align: center;
  padding: 32px;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
  margin-top: 64px;
  font-size: 14px;
}
.pb-tagline-footer { color: var(--ink-soft); font-style: italic; }

/* ============ HERO ============ */
.pb-hero {
  padding: 60px 0 40px 0;
  max-width: 900px;
  margin: 0 auto;
}
.pb-hero-small { padding: 40px 0 20px 0; }
.pb-hero h1 {
  font-size: 64px;
  font-weight: 900;
  line-height: 1.05;
  margin: 16px 0;
  letter-spacing: -2px;
}
.pb-tagline {
  font-style: italic;
  font-size: 22px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.pb-quote { color: #C0392B; font-weight: bold; font-size: 28px; }
.pb-lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 720px;
}
.pb-hero-cta {
  margin: 32px 0 12px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pb-trial-note { font-size: 14px; color: var(--ink-muted); margin-top: 8px; }

/* ============ CARDS ============ */
.pb-cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.pb-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.pb-card h3 { margin-top: 0; font-size: 20px; }
.pb-card-pricing { padding: 32px 24px; }
.pb-card-featured { border: 2px solid #C0392B; }
.pb-price {
  font-size: 42px;
  font-weight: 900;
  color: var(--ink);
  font-family: "Playfair Display", serif;
}
.pb-price span { font-size: 16px; font-weight: normal; color: var(--ink-muted); }
.pb-price-note { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.pb-features { list-style: none; padding: 0; margin: 16px 0; }
.pb-features li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pb-features li:last-child { border-bottom: none; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 32px auto;
}

/* ============ BOTONES ============ */
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  border: 2px solid var(--ink);
  padding: 12px 28px;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn:disabled, .btn[disabled], .btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #A02E22; border-color: #A02E22; color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }

/* ============ BANNERS ============ */
.pb-banner {
  padding: 14px 18px;
  margin: 16px 0;
  border-left: 4px solid;
  font-size: 14px;
}
.pb-banner-error { background: #FBE9E7; border-color: #C0392B; color: #8B2820; }
.pb-banner-success { background: #E8F5E9; border-color: #2D7A3E; color: #1B5E20; }
.pb-banner-warning { background: #FFF8E1; border-color: #C8A23B; color: #7C5A00; }
.pb-banner-info { background: #E3F2FD; border-color: #1976D2; color: #0D47A1; }
[data-theme="dark"] .pb-banner-error { background: #4A2823; color: #FFB4A8; }
[data-theme="dark"] .pb-banner-success { background: #1F3D26; color: #A5D6A7; }
[data-theme="dark"] .pb-banner-warning { background: #3D2F12; color: #FFE082; }

.pb-banner-qa {
  background: #FFF3CD;
  color: #856404;
  border-bottom: 2px solid #C8A23B;
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
}
[data-theme="dark"] .pb-banner-qa {
  background: #3D2F12;
  color: #FFE082;
  border-color: #C8A23B;
}

/* ============ FORMS ============ */
.pb-form-wrap {
  max-width: 480px;
  margin: 40px auto;
  padding: 24px;
}
.pb-form-wrap-wide { max-width: 760px; }
.pb-form { display: flex; flex-direction: column; gap: 16px; }
.pb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pb-field span {
  font-size: 14px;
  font-weight: bold;
  color: var(--ink-soft);
}
.pb-field input,
.pb-field select,
.pb-field textarea,
.pb-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 15px;
  width: 100%;
}
.pb-field input:focus,
.pb-field select:focus,
.pb-field textarea:focus,
.pb-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* Wrapper para input de password con botón ojito a la derecha */
.pb-pass-wrap {
  position: relative;
  width: 100%;
}
.pb-pass-wrap input {
  padding-right: 44px !important;
  width: 100%;
}
.pb-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  color: var(--ink-soft);
  opacity: 0.7;
  transition: opacity 0.15s;
}
.pb-pass-toggle:hover {
  opacity: 1;
}
.pb-pass-toggle:focus {
  outline: none;
  opacity: 1;
}
.pb-form-footer {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
}
.pb-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pb-help-text { font-size: 13px; color: var(--ink-muted); margin: 4px 0; }
.pb-opt { font-weight: normal; color: var(--ink-muted); }
.pb-pass-wrap { position: relative; display: flex; align-items: center; }
.pb-pass-wrap input { flex: 1; padding-right: 40px; }
.pb-pass-toggle {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
}
.pb-codigo-input {
  font-size: 28px;
  letter-spacing: 8px;
  text-align: center;
  font-family: Georgia, serif;
}
.pb-radio { display: block; margin: 8px 0; }
.pb-info-box {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
}

/* ============ PASSWORD RULES ============ */
.password-rules { font-size: 13px; margin: 8px 0; padding: 0; list-style: none; }
.password-rules li {
  padding: 2px 0 2px 20px;
  position: relative;
  color: var(--ink-muted);
}
.password-rules li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: var(--ink-muted);
}
.password-rules li.ok { color: var(--success); font-weight: 600; transition: color .15s ease; }
.password-rules li.ok::before { content: "✓"; color: var(--success); font-weight: bold; }
.password-rules li { transition: color .15s ease; }

/* ============ CHIPS ============ */
.chip-input-container {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chips-list { display: contents; }
.chip {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip .chip-x {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 16px;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
}
.chip .chip-x:hover { opacity: 1; }
.chip-input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 180px;
  padding: 4px;
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--ink);
}
.pb-chip-help {
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: 8px;
}
.suggest-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pb-suggest-label { font-size: 12px; color: var(--ink-muted); }
.suggest-chip {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: Georgia, serif;
}
.suggest-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============ ONBOARDING ============ */
.onboarding-progress {
  background: var(--bg-card);
  border: 1px solid var(--line);
  height: 32px;
  position: relative;
  margin: 24px auto;
  max-width: 760px;
}
.onboarding-progress-bar {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s;
}
.onboarding-progress-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.contexto-banner {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.5;
}
.universo-cat { margin: 32px 0; }
.universo-cat h3 { margin-bottom: 4px; }
.medios-cat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 12px 16px;
  margin: 8px 0;
  font-size: 13px;
}
.medios-cat strong { display: block; margin-bottom: 4px; color: var(--ink); }
.medios-cat span { color: var(--ink-soft); }

.pb-figura-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
}
.pb-figura-foto-wrap { text-align: center; }
.pb-figura-fields { display: flex; flex-direction: column; gap: 16px; }
.figura-foto {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-card);
}
.figura-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}
.red-bloque {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 16px 20px;
  margin: 16px 0;
}
.red-bloque h3 { margin: 0 0 8px 0; font-size: 18px; }

/* ============ REPORTE ============ */
.reporte-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 24px;
  margin: 24px 0;
}
.reporte-fecha {
  font-size: 13px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.reporte-botonera {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.reporte-boton {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
}
.reporte-boton:hover { border-color: var(--accent); text-decoration: none; }
.reporte-boton-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  font-family: "Playfair Display", serif;
}
.reporte-boton-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.reporte-bullets { margin: 20px 0; }
.reporte-bullets h4 { margin-bottom: 8px; }
.reporte-bullets ul { padding-left: 20px; }
.reporte-bullets li { margin: 8px 0; }
.reporte-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ============ INICIO / PROFILE SWITCHER ============ */
.profile-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.profile-switcher label {
  font-size: 13px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.profile-dropdown { position: relative; }
.profile-current {
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--ink);
}
.profile-arrow { margin-left: 8px; font-size: 11px; }
.profile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  min-width: 280px;
  list-style: none;
  padding: 4px 0;
  margin: 4px 0 0 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.profile-menu li a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
}
.profile-menu li a:hover { background: var(--bg); text-decoration: none; }
.profile-menu li a.active { color: var(--accent); }
.profile-cargo { color: var(--ink-muted); font-size: 12px; }
.profile-actual { color: var(--accent); font-size: 11px; margin-left: 8px; }
.profile-add a { color: var(--accent) !important; font-weight: bold; border-top: 1px solid var(--line); }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-box h3 { margin-top: 0; }

/* ============ TABLAS ============ */
.pb-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  margin: 16px 0;
  font-size: 14px;
}
.pb-table thead th {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pb-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.pb-table tbody tr:hover { background: var(--bg); }

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 2px;
  font-weight: bold;
}
.badge-full { background: #C0392B; color: #fff; }
.badge-base { background: var(--ink-muted); color: #fff; }
.badge-trial { background: #C8A23B; color: #fff; }
.badge-pago, .badge-aprobada { background: #2D7A3E; color: #fff; }
.badge-pendiente { background: #C8A23B; color: #fff; }
.badge-rechazada { background: #C0392B; color: #fff; }
.badge-ok { color: #2D7A3E; font-weight: bold; }
.badge-err { color: #C0392B; font-weight: bold; }

/* ============ ADMIN ============ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  min-height: calc(100vh - 200px);
}
.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px;
  height: fit-content;
}
.admin-sidebar h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-sidebar nav a {
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover {
  background: var(--bg);
  text-decoration: none;
}
.admin-sidebar nav a.active {
  border-left-color: var(--accent);
  color: var(--accent);
  background: var(--bg);
}
.admin-content { padding: 0 16px; }
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.admin-stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px;
  text-align: center;
}
.admin-stat-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  font-family: "Playfair Display", serif;
}
.admin-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ============ SPINNER ============ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 700px) {
  h1 { font-size: 36px; }
  .pb-hero h1 { font-size: 40px; }
  .pb-header-inner { padding: 12px 16px; gap: 12px; }
  .pb-main, main { padding: 16px; }
  .pb-figura-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .reporte-botonera { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RONDA 1 — Fixes V6
   ============================================================ */

/* Botones falsos (no clickeables) */
.reporte-boton-static {
    cursor: default;
    pointer-events: none;
}
.reporte-boton-static:hover {
    transform: none;
    box-shadow: none;
}

/* Pricing grid alineado */
.pricing-grid-aligned {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
    max-width: 1080px;
    margin: 32px auto;
}
@media (max-width: 720px) {
    .pricing-grid-aligned { grid-template-columns: 1fr; }
}
.pricing-grid-aligned .pb-card-pricing {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.pb-features-aligned {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 16px 0;
    flex: 1 1 auto;
}
.pb-features-aligned li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}
.pb-check { color: #16a34a; font-weight: 700; }
.pb-dash  { color: #9ca3af; font-weight: 700; }
.pb-plan-cta {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pb-plan-cta .btn { width: 100%; }
.pb-price-note {
    font-size: 13px;
    color: var(--muted, #6b7280);
    margin: -8px 0 8px;
}

/* Footer (unificado con paleta del proyecto) */
.pb-footer {
    background: var(--bg-card);
    color: var(--ink-muted);
    border-top: 1px solid var(--line);
    margin-top: 64px;
    padding: 24px 0;
}
.pb-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.pb-footer-brand { font-size: 14px; color: var(--ink-muted); }
.pb-tagline-footer { font-style: italic; color: var(--ink-soft); }
.pb-footer-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pb-footer-links a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 14px;
}
.pb-footer-links a:hover { text-decoration: underline; color: var(--accent); }
.pb-footer-sep { color: var(--ink-soft); margin: 0 4px; }

/* Profile actions */
.profile-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 14px;
}
.profile-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.profile-add { border-top: 1px solid var(--border, #e5e7eb); margin-top: 4px; }
.profile-add a { font-weight: 600; color: var(--brand, #b91c1c); }

/* Perfiles grid */
.perfiles-header { margin-bottom: 32px; }
.perfiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.perfil-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
}
.perfil-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.perfil-card-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border, #e5e7eb);
}
.perfil-card-foto-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand, #b91c1c);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
}
.perfil-card-body { flex: 1; }
.perfil-card-body h3 { margin: 0 0 4px; font-size: 18px; }
.perfil-card-cargo { margin: 0; color: var(--muted, #6b7280); font-size: 14px; }
.perfil-card-prov { margin: 4px 0 0; color: var(--muted, #6b7280); font-size: 12px; font-weight: 600; }
.perfil-card-plan { margin: 8px 0 0; font-size: 12px; color: var(--muted, #6b7280); }
.perfil-card-actions { display: flex; gap: 8px; }
.perfil-card-actions .btn { flex: 1; }

.perfil-card-add {
    border-style: dashed;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
}
.perfil-card-add-icon {
    font-size: 48px;
    font-weight: 300;
    color: var(--brand, #b91c1c);
    line-height: 1;
}
.perfil-card-add-text { font-weight: 600; }
.perfil-card-add-hint { font-size: 12px; color: var(--muted, #6b7280); }

[data-theme="dark"] .perfil-card { background: #1f2937; border-color: #374151; }

/* Páginas legales */
.pb-legal { line-height: 1.7; }
.pb-legal h2 { margin-top: 28px; font-size: 20px; }
.pb-legal-updated { color: var(--muted, #6b7280); font-size: 14px; margin-top: -8px; }

/* Modal placeholder */
.pb-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.pb-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}
.pb-modal-content {
    position: relative;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 32px;
    max-width: 480px;
    width: calc(100% - 32px);
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.pb-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted, #6b7280);
}
[data-theme="dark"] .pb-modal-content { background: #1f2937; color: #e5e7eb; }

/* Red social row */
.red-social-row {
    display: grid;
    grid-template-columns: 110px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
@media (max-width: 720px) {
    .red-social-row {
        grid-template-columns: 1fr;
    }
}
.red-social-label { font-weight: 600; }
.red-social-input {
    display: flex;
    align-items: center;
    gap: 4px;
}
.red-social-prefix { color: var(--muted, #6b7280); }
.red-social-input input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
}
.red-social-rol {
    padding: 8px 10px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
}

/* Perfil header */
.perfil-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.perfil-foto {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border, #e5e7eb);
}
.perfil-cargo-display {
    color: var(--muted, #6b7280);
    margin: 4px 0 12px;
}

/* Suggest chips */
.suggest-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}
.pb-suggest-label {
    font-size: 13px;
    color: var(--muted, #6b7280);
    margin-right: 4px;
}
.suggest-chip {
    background: var(--bg-soft, #f3f4f6);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s;
}
.suggest-chip:hover {
    background: var(--brand-soft, #fee2e2);
    border-color: var(--brand, #b91c1c);
}
[data-theme="dark"] .suggest-chip { background: #374151; border-color: #4b5563; color: #e5e7eb; }

/* Info box */
.pb-info-box {
    background: var(--bg-soft, #f9fafb);
    border-left: 4px solid var(--brand, #b91c1c);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
}
[data-theme="dark"] .pb-info-box { background: #374151; }

/* Admin tablas */
.admin-section { margin: 32px 0; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    vertical-align: top;
    font-size: 14px;
}
.admin-table th { background: var(--bg-soft, #f9fafb); font-weight: 600; }
.badge-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-pendiente { background: #fef3c7; color: #b45309; }
.badge-aprobado { background: #d1fae5; color: #065f46; }
.badge-rechazado { background: #fee2e2; color: #991b1b; }
.pb-empty { color: var(--muted, #6b7280); font-style: italic; padding: 16px 0; }

/* Chip help text */
.pb-chip-help {
    display: block;
    font-size: 12px;
    color: var(--muted, #6b7280);
    margin-top: 4px;
}

/* ============ AVATAR DROPDOWN (Ronda 5) ============ */
.pb-avatar-wrap {
    position: relative;
    display: inline-block;
}
.pb-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #d0cec7;
    border-radius: 24px;
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    color: inherit;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    transition: background 0.15s;
}
.pb-avatar-btn:hover {
    background: rgba(0,0,0,0.04);
}
[data-theme="dark"] .pb-avatar-btn {
    border-color: #444;
}
[data-theme="dark"] .pb-avatar-btn:hover {
    background: rgba(255,255,255,0.05);
}
.pb-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #C0392B;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}
.pb-avatar-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pb-avatar-arrow {
    font-size: 10px;
    opacity: 0.6;
}

.pb-avatar-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    color: #1a1a18;
    border: 1px solid #d0cec7;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 240px;
    list-style: none;
    padding: 6px 0;
    z-index: 1000;
}
[data-theme="dark"] .pb-avatar-menu {
    background: #1f1f1d;
    color: #f4f1eb;
    border-color: #444;
}
.pb-avatar-menu li {
    margin: 0;
}
.pb-avatar-menu li a,
.pb-avatar-menu li .pb-avatar-theme {
    display: block;
    padding: 8px 16px;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.pb-avatar-menu li a:hover,
.pb-avatar-menu li .pb-avatar-theme:hover {
    background: rgba(0,0,0,0.04);
}
[data-theme="dark"] .pb-avatar-menu li a:hover,
[data-theme="dark"] .pb-avatar-menu li .pb-avatar-theme:hover {
    background: rgba(255,255,255,0.06);
}
.pb-avatar-sep {
    height: 1px;
    background: #e0ddd5;
    margin: 4px 0;
}
[data-theme="dark"] .pb-avatar-sep {
    background: #444;
}
.pb-avatar-logout {
    color: #C0392B !important;
}
.pb-avatar-theme-icon {
    margin-right: 4px;
}

/* ============ FOOTER PÚBLICO COMPLETO ============ */
.pb-footer-full {
    background: #1a1a18;
    color: #f4f1eb;
    padding: 48px 0 0 0;
    margin-top: 64px;
}
.pb-footer-inner-full {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 32px;
}
@media (max-width: 800px) {
    .pb-footer-inner-full {
        grid-template-columns: 1fr 1fr;
    }
    .pb-footer-brand-col {
        grid-column: 1 / -1;
    }
}
.pb-footer-col h4 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 12px 0;
    font-weight: 600;
}
.pb-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pb-footer-col li {
    margin-bottom: 6px;
}
.pb-footer-col a {
    color: #d4d0c8;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}
.pb-footer-col a:hover {
    color: #fff;
}
.pb-footer-brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}
.pb-footer-tagline {
    color: #999;
    font-size: 13px;
    margin: 0;
}
.pb-footer-bottom {
    border-top: 1px solid #333;
    margin-top: 40px;
    padding: 20px 24px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* ============ FOOTER MÍNIMO (LOGUEADO) ============ */
.pb-footer-min {
    background: transparent;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #e0ddd5;
}
[data-theme="dark"] .pb-footer-min {
    border-top-color: #333;
}
.pb-footer-inner-min {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    font-size: 12px;
    color: #888;
}
.pb-footer-inner-min a {
    color: #888;
    text-decoration: none;
}
.pb-footer-inner-min a:hover {
    color: #C0392B;
}
.pb-footer-sep {
    margin: 0 8px;
    color: #ccc;
}

/* ============ CALENDARIO HISTÓRICO LATERAL ============ */
.pb-inicio-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .pb-inicio-layout {
        grid-template-columns: 1fr;
    }
}
.pb-calendar-side {
    background: #FAF8F2;
    border: 1px solid #e0ddd5;
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: 80px;
}
[data-theme="dark"] .pb-calendar-side {
    background: #232320;
    border-color: #3a3a36;
}
.pb-calendar-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #C0392B;
    margin: 0 0 12px 0;
    border-bottom: 1px solid #C0392B;
    padding-bottom: 6px;
}
.pb-calendar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 360px;
    overflow-y: auto;
}
.pb-calendar-list li {
    margin: 0;
}
.pb-calendar-list a {
    display: block;
    padding: 6px 8px;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.1s;
}
.pb-calendar-list a:hover {
    background: rgba(192,57,43,0.08);
}
.pb-calendar-list a.active {
    background: #C0392B;
    color: #fff;
    font-weight: bold;
}
.pb-calendar-locked {
    padding: 6px 8px;
    font-size: 13px;
    color: #aaa;
    font-style: italic;
}
.pb-calendar-upgrade {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    background: rgba(192,57,43,0.06);
    border: 1px dashed #C0392B;
    border-radius: 6px;
    font-size: 12px;
}
.pb-calendar-upgrade a {
    color: #C0392B;
    font-weight: bold;
    text-decoration: none;
}

/* ============ CUENTA (4 TABS) ============ */
.pb-cuenta-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0ddd5;
    margin-bottom: 24px;
    overflow-x: auto;
}
[data-theme="dark"] .pb-cuenta-tabs {
    border-bottom-color: #3a3a36;
}
.pb-cuenta-tab {
    padding: 12px 20px;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.pb-cuenta-tab:hover {
    color: #C0392B;
}
.pb-cuenta-tab.active {
    color: #C0392B;
    border-bottom-color: #C0392B;
    font-weight: bold;
}

.pb-cuenta-section {
    background: #fff;
    border: 1px solid #e0ddd5;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
}
[data-theme="dark"] .pb-cuenta-section {
    background: #1f1f1d;
    border-color: #3a3a36;
}
.pb-cuenta-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    margin: 0 0 16px 0;
}
.pb-cuenta-section .pb-help-text {
    margin-bottom: 16px;
}

.pb-cuenta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0ede5;
}
[data-theme="dark"] .pb-cuenta-row {
    border-bottom-color: #2a2a26;
}
.pb-cuenta-row:last-child {
    border-bottom: none;
}
.pb-cuenta-row-label {
    color: #666;
    font-size: 13px;
}
[data-theme="dark"] .pb-cuenta-row-label {
    color: #aaa;
}
.pb-cuenta-row-value {
    font-weight: 500;
}
.pb-cuenta-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #C0392B;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}
.pb-cuenta-badge-base {
    background: #888;
}

.pb-cuenta-danger-zone {
    background: #FBE9E7;
    border: 1px solid #C0392B;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}
[data-theme="dark"] .pb-cuenta-danger-zone {
    background: #2a1815;
    border-color: #c0392b;
}
.pb-cuenta-danger-zone h3 {
    color: #C0392B;
    margin: 0 0 8px 0;
    font-size: 16px;
}

/* ============ AYUDA (IA + FAQ) ============ */
.pb-ayuda-hero {
    background: linear-gradient(135deg, #FAF8F2 0%, #f4eee0 100%);
    border-radius: 12px;
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 32px;
}
[data-theme="dark"] .pb-ayuda-hero {
    background: linear-gradient(135deg, #232320 0%, #1a1a18 100%);
}
.pb-ayuda-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    margin: 0 0 8px 0;
}
.pb-ayuda-hero p {
    color: #666;
    margin: 0 0 24px 0;
}
[data-theme="dark"] .pb-ayuda-hero p {
    color: #aaa;
}
.pb-ayuda-form {
    max-width: 600px;
    margin: 0 auto;
}
.pb-ayuda-input {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    font-size: 15px;
    border: 1px solid #d0cec7;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    box-sizing: border-box;
}
[data-theme="dark"] .pb-ayuda-input {
    background: #1f1f1d;
    color: #f4f1eb;
    border-color: #444;
}
.pb-ayuda-input:focus {
    border-color: #C0392B;
    outline: none;
}

.pb-ayuda-respuesta {
    background: #fff;
    border: 1px solid #e0ddd5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}
[data-theme="dark"] .pb-ayuda-respuesta {
    background: #1f1f1d;
    border-color: #3a3a36;
}
.pb-ayuda-respuesta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}
.pb-ayuda-respuesta-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #C0392B;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.pb-faq {
    margin-top: 40px;
}
.pb-faq h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 24px;
    margin: 0 0 20px 0;
}
.pb-faq-cat {
    margin-bottom: 32px;
}
.pb-faq-cat h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #C0392B;
    margin: 0 0 12px 0;
    border-bottom: 1px solid #C0392B;
    padding-bottom: 4px;
}
.pb-faq-item {
    background: #fff;
    border: 1px solid #e0ddd5;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
[data-theme="dark"] .pb-faq-item {
    background: #1f1f1d;
    border-color: #3a3a36;
}
.pb-faq-item summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pb-faq-item summary::-webkit-details-marker {
    display: none;
}
.pb-faq-item summary::after {
    content: '+';
    color: #C0392B;
    font-size: 20px;
    font-weight: bold;
}
.pb-faq-item[open] summary::after {
    content: '−';
}
.pb-faq-item-content {
    padding: 0 18px 16px 18px;
    color: #555;
    line-height: 1.6;
}
[data-theme="dark"] .pb-faq-item-content {
    color: #c4c1b8;
}

/* ============ REPORTE COMPLETO (FULL SCREEN) ============ */
.pb-reporte-fullscreen {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px;
}
.pb-reporte-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 20px;
    padding: 6px 12px;
    border: 1px solid #d0cec7;
    border-radius: 20px;
}
.pb-reporte-back:hover {
    background: rgba(0,0,0,0.04);
}
[data-theme="dark"] .pb-reporte-back {
    border-color: #444;
    color: #aaa;
}
.pb-reporte-fs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.pb-reporte-fs-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    margin: 0;
}
.pb-reporte-fs-meta {
    color: #888;
    font-size: 13px;
    margin: 4px 0 0 0;
}
.pb-reporte-fs-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.pb-mencion-card {
    background: #fff;
    border: 1px solid #e0ddd5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}
[data-theme="dark"] .pb-mencion-card {
    background: #1f1f1d;
    border-color: #3a3a36;
}
.pb-mencion-titulo {
    font-weight: bold;
    margin-bottom: 4px;
}
.pb-mencion-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}
.pb-mencion-medio {
    color: #C0392B;
    font-weight: bold;
}
.pb-mencion-bajada {
    color: #555;
    font-size: 14px;
    font-style: italic;
}
[data-theme="dark"] .pb-mencion-bajada {
    color: #b4b1a8;
}


/* ============================================================
   V2-COMPLEMENTS: clases que el v2 usa y que no existían en v1
   Construidas usando las mismas variables del v1 para que
   el dark mode funcione automáticamente.
   ============================================================ */

/* Botones v2 (alias a las clases v1 pero con prefijo pb-btn) */
.pb-btn {
  display: inline-block;
  padding: 11px 22px;
  font-size: 14px;
  font-family: Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid var(--ink);
  background: var(--bg-card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
}
.pb-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.pb-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pb-btn-primary:hover { background: #A02E22; border-color: #A02E22; color: #fff; }
.pb-btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.pb-btn-secondary:hover { background: var(--ink); color: var(--bg); }
.pb-btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.pb-btn-danger:hover { background: var(--danger); color: #fff; }
.pb-btn-link {
  background: transparent;
  color: var(--accent);
  border: none;
  padding: 8px 0;
  text-decoration: underline;
}
.pb-btn-link:hover {
  background: transparent;
  color: #A02E22;
  text-decoration: underline;
}
.pb-btn-block { display: block; width: 100%; text-align: center; }
.pb-btn-large { padding: 15px 30px; font-size: 16px; }
.pb-btn-sm { padding: 7px 14px; font-size: 12px; }

/* Flashes */
.pb-flashes { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.pb-flash {
  padding: 13px 18px;
  margin: 12px 0;
  border-left: 4px solid;
  background: var(--bg-card);
  font-size: 14px;
  font-family: Georgia, serif;
  color: var(--ink);
}
.pb-flash.success { border-color: var(--success); }
.pb-flash.warning { border-color: var(--warning); }
.pb-flash.danger { border-color: var(--danger); }
.pb-flash.info { border-color: var(--accent); }

/* Avatar / dropdown del header */
.pb-user-menu { position: relative; }
.pb-avatar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: #F4F1EB;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: Georgia, serif;
  font-size: 13px;
}
.pb-avatar:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: #F4F1EB;
}
.pb-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  color: white;
  font-family: Georgia, serif;
  letter-spacing: 0.5px;
}
.pb-user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  min-width: 220px;
  z-index: 100;
}
.pb-user-menu.open .pb-user-dropdown { display: block; }
.pb-user-dropdown a {
  display: block;
  padding: 13px 18px;
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, serif;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.pb-user-dropdown a:last-child { border-bottom: none; }
.pb-user-dropdown a:hover { background: var(--bg); }
.pb-user-dropdown a.danger { color: var(--danger); }

/* Header navegación - items activos como <span> */
.pb-nav .active,
.pb-nav span.active,
.pb-nav a.active {
  color: var(--accent);
  cursor: default;
  position: relative;
}
.pb-nav .active::after,
.pb-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
}
.pb-nav > span {
  color: #F4F1EB;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-family: Georgia, serif;
}

/* Logo span (no link) */
span.pb-logo { cursor: default; }

/* Pb-section-title (encabezado de sección de reporte) */
.pb-section-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  color: var(--accent);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Selector de perfil arriba del reporte */
.pb-perfil-selector {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pb-perfil-selector .info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.pb-perfil-selector img,
.pb-perfil-selector .placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-family: "Playfair Display", Georgia, serif;
}
.pb-perfil-selector .nombre {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-weight: 900;
  display: block;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.pb-perfil-selector .cargo {
  font-size: 13px;
  color: var(--ink-muted);
  display: block;
  font-style: italic;
}
.pb-perfil-selector select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  font-family: Georgia, serif;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--ink);
}

/* Chips para navegación de secciones (no chip-input del v1) */
.pb-chips {
  display: flex;
  gap: 8px;
  margin: 16px 0 28px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pb-chip {
  background: var(--bg-card);
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 8px 16px;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.pb-chip:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}
.pb-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Métricas */
.pb-metricas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}
.pb-metrica {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 26px 16px;
  text-align: center;
}
.pb-metrica .valor {
  font-size: 42px;
  font-weight: 900;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -2px;
}
.pb-metrica .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  margin-top: 10px;
  font-family: Georgia, serif;
}

/* Bullets de reporte */
.pb-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pb-bullets li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.65;
  position: relative;
  padding-left: 24px;
  font-family: Georgia, serif;
  color: var(--ink);
}
.pb-bullets li::before {
  content: '■';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
  top: 18px;
}
.pb-bullets li:last-child { border-bottom: none; }
.pb-bullets .medios {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
  font-style: italic;
}
.pb-bullets .sentimiento {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  font-family: Georgia, serif;
}
.pb-bullets .sentimiento.positivo { background: #DAEFE2; color: var(--success); }
.pb-bullets .sentimiento.negativo { background: #F8E0DA; color: var(--danger); }
.pb-bullets .sentimiento.neutral  { background: #EFE9DA; color: var(--warning); }

/* Hechos agrupados */
.pb-hecho {
  background: var(--bg);
  border-left: 4px solid var(--accent);
  padding: 18px 20px;
  margin: 14px 0;
}
.pb-hecho h4 {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 18px;
  color: var(--ink);
}
.pb-hecho .medios {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 10px;
  font-style: italic;
}
.pb-hecho .links a {
  display: inline-block;
  margin-right: 12px;
  margin-bottom: 4px;
  font-size: 13px;
}
.pb-hecho .sentimiento {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  font-family: Georgia, serif;
}
.pb-hecho .sentimiento.positivo { background: #DAEFE2; color: var(--success); }
.pb-hecho .sentimiento.negativo { background: #F8E0DA; color: var(--danger); }
.pb-hecho .sentimiento.neutral  { background: #EFE9DA; color: var(--warning); }

/* Tapas grid */
.pb-tapas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.pb-tapa {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 14px;
  text-align: center;
}
.pb-tapa-thumb {
  background: var(--ink);
  color: var(--bg);
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.pb-tapa-thumb img { max-width: 100%; max-height: 100%; }
.pb-tapa-titular {
  font-size: 14px;
  margin: 10px 0 4px;
  color: var(--ink);
  line-height: 1.4;
  font-family: Georgia, serif;
}
.pb-tapa-diario {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: Georgia, serif;
}

/* Personas (aliados / adversarios) */
.pb-personas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.pb-persona {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 18px;
}
.pb-persona-nombre {
  font-weight: bold;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 17px;
  margin-bottom: 6px;
  color: var(--ink);
}

/* Acciones reporte */
.pb-acciones-reporte {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Perfiles grid (listado) */
.pb-perfiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.pb-perfil-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.pb-perfil-card .foto {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 16px;
  object-fit: cover;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 38px;
  letter-spacing: -1px;
}
.pb-perfil-card .nombre {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.pb-perfil-card .cargo {
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
}
.pb-perfil-card .meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.pb-perfil-card .plan-info {
  font-size: 12px;
  color: var(--ink);
  margin: 8px 0;
}
.pb-perfil-card .ultimo-reporte {
  font-size: 12px;
  background: var(--bg);
  padding: 8px 12px;
  margin: 12px 0;
  width: 100%;
  color: var(--ink-muted);
  font-family: Georgia, serif;
  border-left: 3px solid var(--accent);
}
.pb-perfil-card .acciones {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}
.pb-perfil-card .acciones .pb-btn {
  flex: 1;
  padding: 10px;
  font-size: 12px;
}
.pb-perfil-card.crear {
  border-style: dashed;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.pb-perfil-card.crear .plus {
  font-size: 70px;
  color: var(--accent);
  margin-bottom: 12px;
  line-height: 1;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 900;
}

/* Sidebar de /cuenta */
.pb-cuenta-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}
.pb-cuenta-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 16px 0;
  height: fit-content;
  font-family: Georgia, serif;
}
.pb-cuenta-sidebar h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  padding: 0 16px;
  margin: 0 0 8px;
}
.pb-cuenta-sidebar a, .pb-cuenta-sidebar span {
  display: block;
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  font-family: Georgia, serif;
}
.pb-cuenta-sidebar a:hover {
  background: var(--bg);
  text-decoration: none;
}
.pb-cuenta-sidebar .active,
.pb-cuenta-sidebar a.active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  background: var(--bg);
  cursor: default;
}
.pb-cuenta-sidebar .danger { color: var(--danger); }
.pb-cuenta-sidebar hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}
@media (max-width: 700px) {
  .pb-cuenta-layout { grid-template-columns: 1fr; }
}

/* Modal v2 */
.pb-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pb-modal-overlay.open { display: flex; }
.pb-modal {
  background: var(--bg-card);
  max-width: 580px;
  width: 100%;
  padding: 36px;
  position: relative;
  border: 1px solid var(--line);
}
.pb-modal h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}
.pb-modal-subtitle {
  color: var(--ink-muted);
  margin-bottom: 18px;
  font-style: italic;
}
.pb-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.pb-modal textarea {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  border: 1px solid var(--line);
  font-family: Georgia, serif;
  font-size: 14px;
  resize: vertical;
  background: var(--bg);
  color: var(--ink);
}

/* Toast */
.pb-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 15px 28px;
  font-family: Georgia, serif;
  font-size: 14px;
  z-index: 1100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  border-left: 4px solid var(--accent);
  display: none;
}
.pb-toast.visible { display: block; }

/* Field help text */
.pb-field-help {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Hora card de onboarding paso preferencias */
.pb-hora-card {
  border: 2px solid var(--line);
  padding: 20px;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
  background: var(--bg-card);
}
.pb-hora-card .num {
  font-size: 28px;
  font-weight: 900;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--ink);
}

/* Error page (404/403/500) */
.pb-error-page {
  text-align: center;
  padding: 80px 24px;
}
.pb-error-page .code {
  font-size: 100px;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--accent);
  margin: 0;
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1;
}
.pb-error-page h2 { margin: 16px 0 24px; }
.pb-error-page .acciones {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Features de la landing */
.pb-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.pb-feature {
  background: var(--bg-card);
  padding: 28px;
  border-top: 4px solid var(--accent);
}
.pb-feature h3 {
  margin-top: 0;
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
}

/* Hero v2 landing - usa más el espacio */
.pb-hero h1 span { color: var(--accent); }
.pb-hero .slogan {
  font-size: 22px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 36px;
  font-family: Georgia, serif;
}
.pb-hero p.lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
  font-family: Georgia, serif;
}
.pb-hero .cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* code/pre */
code, pre {
  font-family: 'Courier New', monospace;
  background: var(--bg);
  padding: 2px 6px;
  font-size: 13px;
  color: var(--ink);
}

/* ============================================================
   R4 — Protección anti-overflow: nombres/textos muy largos
   no deben romper el layout aunque pasen por DB legacy.
   ============================================================ */
.pb-perfil-selector .nombre,
.pb-perfil-card .nombre,
.pb-perfil-card .cargo,
.pb-perfil-card .meta,
.pb-persona-nombre,
.pb-hecho h4,
.pb-bullets li {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.pb-table td {
  max-width: 360px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
