/* ============================================================================
   PLANIORA v3.5.0 (FASE 1) — TIPOGRAFÍA POPPINS, MÓDULO TOE Y ARQUITECTURA 2027
   Paleta oficial: #073B43 · #087E83 · #27D7C4 · #E9A82D · #F4F7F8
   100% modular: conserva intactos styles.css, planiora-ops.css, media.css y v34.css
   ============================================================================ */

h1, h2, h3, h4, .brand-title, .v34-hub-title {
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- CONTROLES CONTEXTUALES PASO 1 Y 2 --- */
.f1-ctx-box {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(8, 126, 131, 0.07);
  border: 1px solid rgba(8, 126, 131, 0.24);
}

[data-theme="dark"] .f1-ctx-box {
  background: rgba(39, 215, 196, 0.08);
  border-color: rgba(39, 215, 196, 0.28);
}

.f1-opt-primaria {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1.5px dashed rgba(8, 126, 131, 0.36);
}

.f1-opt-primaria label.f1-chk-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  min-height: 44px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
}

.f1-opt-primaria input[type="checkbox"] {
  width: 19px;
  height: 19px;
  min-height: 19px;
  flex-shrink: 0;
  accent-color: #087E83;
}

/* --- MÓDULO INDEPENDIENTE TOE (R.V.M. 212-2020) Y CONDUCTA 2027 (D.S. 021-2026) --- */
.f1-toe-hero {
  background: linear-gradient(125deg, #073B43 0%, #087E83 68%, #0E9F9B 100%);
  color: #FFFFFF;
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 14px;
  border: 1px solid rgba(39, 215, 196, 0.38);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.f1-toe-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 780px) {
  .f1-toe-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.f1-toe-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 10px;
  min-height: 46px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
}

.f1-toe-tab:hover {
  border-color: rgba(39, 215, 196, 0.72);
  box-shadow: 0 6px 18px -6px rgba(39, 215, 196, 0.36);
}

.f1-toe-tab.active {
  background: linear-gradient(135deg, #073B43 0%, #087E83 100%);
  color: #FFFFFF;
  border-color: #27D7C4;
}

.f1-no-grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(233, 168, 45, 0.16);
  border: 1px solid rgba(233, 168, 45, 0.5);
  color: var(--fg);
  margin-bottom: 10px;
}

.f1-conducta-banner {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(7, 59, 67, 0.08);
  border: 1.5px solid rgba(8, 126, 131, 0.32);
  font-size: 12.8px;
  margin-bottom: 12px;
}

.f1-conducta-warn {
  padding: 10px 13px;
  border-radius: 11px;
  background: #FEF2F2;
  border: 1.5px solid #EF4444;
  color: #991B1B;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 8px;
}

.f1-cond-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 10px;
}

.f1-cond-table th,
.f1-cond-table td {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: top;
}

.f1-cond-table th {
  background: var(--surface-2);
  text-align: left;
  font-weight: 700;
}

.f1-cond-row-alert {
  background: rgba(239, 68, 68, 0.08);
}

.f1-inc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.f1-inc-leve { background: #FEF3C7; color: #92400E; }
.f1-inc-grave { background: #FFEDD5; color: #9A3412; }
.f1-inc-muy_grave { background: #FEE2E2; color: #991B1B; }

/* --- PANEL ADMIN CONFIG 2027 --- */
.f1-admin-2027 {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(8, 126, 131, 0.06);
  border: 1.5px solid rgba(39, 215, 196, 0.35);
}

.f1-scale-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(39, 215, 196, 0.16);
  border: 1px solid rgba(39, 215, 196, 0.45);
  color: #073B43;
}

[data-theme="dark"] .f1-scale-chip {
  color: #27D7C4;
}

@media (max-width: 780px) {
  .v34-pill-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
  }
  .btn-sm {
    min-height: 44px;
    padding: 8px 12px;
  }
}

/* --- BIBLIOTECA APARTE DE NORMATIVA OFICIAL MINEDU VIGENTE (ENLACES AZULES) --- */
.f1-norm-grp {
  margin-bottom: 16px;
}

.f1-norm-cat {
  font-size: 12.5px;
  font-weight: 800;
  color: #073B43;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 12px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid rgba(8, 126, 131, 0.25);
}

[data-theme="dark"] .f1-norm-cat {
  color: #27D7C4;
  border-bottom-color: rgba(39, 215, 196, 0.28);
}

.f1-norm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 780px) {
  .f1-norm-grid { grid-template-columns: 1fr; }
}

.f1-norm-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  min-height: 44px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.f1-norm-item:hover {
  border-color: #0284C7;
  box-shadow: 0 8px 20px -12px rgba(2, 132, 199, 0.45);
}

.f1-norm-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.f1-norm-link {
  color: #0369A1;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.35;
}

.f1-norm-link:hover {
  color: #0284C7;
}

[data-theme="dark"] .f1-norm-link {
  color: #38BDF8;
}

[data-theme="dark"] .f1-norm-link:hover {
  color: #7DD3FC;
}

.f1-norm-url {
  display: block;
  font-size: 11px;
  color: #0284C7;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

[data-theme="dark"] .f1-norm-url {
  color: #38BDF8;
}

.f1-norm-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(8, 126, 131, 0.14);
  color: #073B43;
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme="dark"] .f1-norm-tag {
  background: rgba(39, 215, 196, 0.18);
  color: #27D7C4;
}

.f1-norm-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

@media print {
  .f1-toe-hero,
  .f1-toe-tabs,
  .f1-no-grade-pill,
  #view-normativa .grid-2,
  .f1-toe-pane:not([data-f1-toe-pane="conducta"]) > *:not(.v34-doc-preview-box),
  .v34-pro-pane:not([data-v34-pane="conclusiones"]) > *:not(.v34-doc-preview-box) {
    display: none !important;
  }
}
