.boe-body {
  --boe-accent: #f97316;
  --boe-accent-soft: rgba(249, 115, 22, 0.14);
  --boe-border: rgba(255, 255, 255, 0.09);
  --boe-muted: rgba(255, 255, 255, 0.5);
  --boe-text: rgba(255, 255, 255, 0.92);
  --boe-surface: rgba(255, 255, 255, 0.03);
}

.boe-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(0.85rem, 2vw, 1.25rem) 3rem;
}

.boe-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.boe-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--boe-accent);
}

.boe-title {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.boe-subtitle {
  margin: 0;
  color: var(--boe-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 560px;
}

.boe-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.boe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.boe-btn:hover { text-decoration: none; }

.boe-btn-primary {
  background: var(--boe-accent);
  color: #fff;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.28);
}

.boe-btn-primary:hover { color: #fff; background: #ea580c; }

.boe-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: var(--boe-border);
}

.boe-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: var(--boe-border);
}

.boe-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.28);
}

.boe-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--boe-border);
  border-radius: 14px;
  background: var(--boe-surface);
}

.boe-search-wrap {
  position: relative;
}

.boe-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--boe-muted);
  pointer-events: none;
}

.boe-search {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--boe-border);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.boe-search::placeholder { color: rgba(255, 255, 255, 0.35); }

.boe-search:focus {
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.boe-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.75rem;
}

.boe-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: min(100%, 160px);
  flex: 1;
}

.boe-select-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--boe-muted);
}

.boe-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 9px;
  border: 1px solid var(--boe-border);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.84rem;
  outline: none;
}

.boe-select option {
  background: #111;
  color: #fff;
}

.boe-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  border-radius: 9px;
  border: 1px solid var(--boe-border);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.boe-check {
  width: 15px;
  height: 15px;
  accent-color: var(--boe-accent);
}

.boe-meta {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--boe-muted);
}

.boe-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  align-items: start;
}

.boe-list-panel,
.boe-reader {
  border: 1px solid var(--boe-border);
  border-radius: 16px;
  background: var(--boe-surface);
  overflow: hidden;
}

.boe-list-panel {
  max-height: calc(100vh - 12rem);
  display: flex;
  flex-direction: column;
}

.boe-list {
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.boe-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.boe-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.boe-card.is-active {
  border-color: rgba(249, 115, 22, 0.4);
  background: var(--boe-accent-soft);
  box-shadow: inset 2px 0 0 var(--boe-accent);
}

.boe-card-year {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--boe-muted);
}

.boe-card-title {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.boe-card-ministerio {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  color: var(--boe-accent);
  font-weight: 600;
}

.boe-card-excerpt {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--boe-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.boe-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.boe-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
}

.boe-badge-pdf {
  background: rgba(249, 115, 22, 0.14);
  color: #fed7aa;
}

.boe-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--boe-muted);
  font-size: 0.88rem;
}

.boe-reader {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.boe-reader-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 2rem;
  text-align: center;
  color: var(--boe-muted);
  font-size: 0.9rem;
}

.boe-reader-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.boe-reader-head {
  padding: 1.1rem 1.15rem 0.65rem;
}

.boe-reader-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--boe-accent);
}

.boe-reader-title {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1.3;
}

.boe-reader-date {
  margin: 0;
  font-size: 0.8rem;
  color: var(--boe-muted);
}

.boe-reader-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1.15rem 0.65rem;
}

.boe-tab {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--boe-border);
  background: transparent;
  color: var(--boe-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.boe-tab.is-active {
  background: var(--boe-accent-soft);
  border-color: rgba(249, 115, 22, 0.4);
  color: #fff;
}

.boe-reader-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1.15rem 1rem;
  color: var(--boe-text);
  font-size: 0.92rem;
  line-height: 1.65;
}

.boe-reader-body p { margin-bottom: 0.85rem; }
.boe-reader-body ul,
.boe-reader-body ol { padding-left: 1.25rem; margin-bottom: 0.85rem; }
.boe-reader-body a { color: #fdba74; }
.boe-reader-body strong { color: #fff; }

.boe-pdf-wrap {
  flex: 1;
  min-height: 0;
  padding: 0 1.15rem 1rem;
  display: flex;
  flex-direction: column;
}

.boe-pdf-frame {
  width: 100%;
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--boe-border);
  border-radius: 12px;
  background: #111;
}

.boe-reader-doc {
  padding: 0 1.15rem 1rem;
}

.boe-reader-doc a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #fdba74;
  font-weight: 600;
  word-break: break-all;
}

.boe-reader-doc-locked {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 0.84rem;
}

.boe-reader-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.75rem 1.15rem 1rem;
  border-top: 1px solid var(--boe-border);
}

.boe-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.boe-mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.boe-mobile-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(92dvh, 92vh);
  background: #000;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--boe-border);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.boe-mobile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--boe-border);
}

.boe-mobile-sheet-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.boe-mobile-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.boe-mobile-sheet-body {
  overflow-y: auto;
  padding: 0 0 max(5.5rem, env(safe-area-inset-bottom));
}

/* Formularios admin */
.boe-form-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(0.85rem, 2vw, 1.25rem) 3rem;
}

.boe-form-card {
  padding: 1.25rem;
  border: 1px solid var(--boe-border);
  border-radius: 16px;
  background: var(--boe-surface);
}

.boe-form-card h1 {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.boe-form-meta {
  margin: 0 0 1.25rem;
  color: var(--boe-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.boe-field {
  margin-bottom: 1rem;
}

.boe-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--boe-muted);
}

.boe-input,
.boe-textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--boe-border);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.boe-textarea {
  min-height: 280px;
  resize: vertical;
}

.boe-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .boe-layout {
    grid-template-columns: 1fr;
  }

  .boe-list-panel {
    max-height: none;
  }

  .boe-reader {
    display: none;
  }

  .boe-hero-actions {
    width: 100%;
  }

  .boe-hero-actions .boe-btn {
    width: 100%;
  }

  .boe-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .boe-select-wrap {
    min-width: 0;
  }
}

@media (min-width: 901px) {
  .boe-mobile-sheet {
    display: none !important;
  }
}
