/* ============================================================================
   PLANIORA v3.4.0 — CAPA VISUAL FUTURISTA, LIMPIA Y SUPER-PREMIUM
   Paleta oficial: #073B43 · #087E83 · #27D7C4 · #E9A82D · #F4F7F8
   Cero conflictos con css/styles.css, css/planiora-ops.css y css/planiora-media.css
   ============================================================================ */

:root {
  --v34-petrol: #073B43;
  --v34-teal: #087E83;
  --v34-cyan: #27D7C4;
  --v34-gold: #E9A82D;
  --v34-glow: rgba(39, 215, 196, 0.36);
  --v34-gold-glow: rgba(233, 168, 45, 0.35);
  --v34-glass: rgba(255, 255, 255, 0.88);
  --v34-glass-border: rgba(8, 126, 131, 0.18);
}

[data-theme="dark"] {
  --v34-glass: rgba(15, 27, 36, 0.86);
  --v34-glass-border: rgba(39, 215, 196, 0.24);
}

/* --- BOTONES DINÁMICOS CON HALO CIAN + ONDA ENERGÉTICA AL CLIC --- */
.btn,
.v34-hub-card,
.nav-item,
.wiz-step,
.v34-pro-tab {
  position: relative;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
  border-color: rgba(39, 215, 196, 0.65);
  box-shadow: 0 6px 20px -4px var(--v34-glow);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.975);
}

.btn-primary {
  background: linear-gradient(135deg, var(--v34-petrol) 0%, var(--v34-teal) 100%);
  border-color: rgba(39, 215, 196, 0.45);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #094A54 0%, #0A969C 100%);
  box-shadow: 0 8px 24px -4px rgba(39, 215, 196, 0.55);
}

.v34-btn-aurora {
  background: linear-gradient(135deg, #073B43 0%, #087E83 55%, #0D9488 100%) !important;
  color: #FFFFFF !important;
  border: 1.5px solid rgba(39, 215, 196, 0.72) !important;
  box-shadow: 0 0 0 1px rgba(39, 215, 196, 0.22), 0 8px 24px -6px rgba(39, 215, 196, 0.52);
  animation: v34AuroraPulse 3.4s ease-in-out infinite;
}

.v34-btn-aurora:hover:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(39, 215, 196, 0.48), 0 10px 28px -4px rgba(39, 215, 196, 0.74);
}

@keyframes v34AuroraPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(39, 215, 196, 0.22), 0 6px 20px -6px rgba(39, 215, 196, 0.45); }
  50% { box-shadow: 0 0 0 2px rgba(233, 168, 45, 0.36), 0 10px 26px -4px rgba(39, 215, 196, 0.66); }
}

.v34-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(39, 215, 196, 0.65) 0%, rgba(39, 215, 196, 0.08) 70%, transparent 100%);
  transform: scale(0);
  animation: v34RippleAnim 0.48s cubic-bezier(.16,1,.3,1) forwards;
}

@keyframes v34RippleAnim {
  to { transform: scale(3.4); opacity: 0; }
}

/* --- TOPBAR MODERNO --- */
.app-topbar {
  background: linear-gradient(95deg, #073B43 0%, #094D57 60%, #087E83 100%) !important;
  border-bottom: 1px solid rgba(39, 215, 196, 0.28) !important;
  box-shadow: 0 4px 20px rgba(7, 59, 67, 0.16);
}

.credit-chip {
  background: rgba(39, 215, 196, 0.14) !important;
  border: 1px solid rgba(39, 215, 196, 0.42) !important;
  color: #E6FFFA !important;
}

/* --- CENTRO DE MANDO (4 TARJETAS GRANDES EFECTO CRISTAL) --- */
.dash-hero {
  background: linear-gradient(125deg, #073B43 0%, #0B5661 52%, #087E83 100%) !important;
  border: 1px solid rgba(39, 215, 196, 0.35) !important;
  box-shadow: 0 16px 38px -14px rgba(7, 59, 67, 0.45);
  position: relative;
  overflow: hidden;
}

.dash-hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -8%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(39, 215, 196, 0.24) 0%, transparent 70%);
  pointer-events: none;
}

.v34-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.v34-hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--v34-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--v34-glass-border);
  box-shadow: 0 6px 22px -12px rgba(7, 59, 67, 0.18);
  cursor: pointer;
  color: var(--fg);
}

.v34-hub-card:hover {
  transform: translateY(-3px);
  border-color: rgba(39, 215, 196, 0.72);
  box-shadow: 0 14px 30px -10px var(--v34-glow);
}

.v34-hub-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v34-hub-ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(8, 126, 131, 0.14), rgba(39, 215, 196, 0.22));
  border: 1px solid rgba(39, 215, 196, 0.34);
  flex-shrink: 0;
}

.v34-hub-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 4px;
}

.v34-hub-desc {
  font-size: 12.8px;
  color: var(--muted);
  margin: 0;
  line-height: 1.44;
}

.v34-hub-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.v34-pill-link {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(8, 126, 131, 0.26);
  background: rgba(8, 126, 131, 0.08);
  color: var(--v34-teal);
  cursor: pointer;
  transition: all .16s ease;
}

[data-theme="dark"] .v34-pill-link {
  color: var(--v34-cyan);
  background: rgba(39, 215, 196, 0.12);
  border-color: rgba(39, 215, 196, 0.34);
}

.v34-pill-link:hover {
  background: var(--v34-teal);
  color: #FFFFFF;
  border-color: var(--v34-cyan);
}

/* --- MENÚS DESPLEGABLES LIMPIOS --- */
.v34-drop-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.v34-drop-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid rgba(39, 215, 196, 0.42);
  box-shadow: 0 18px 40px -10px rgba(7, 59, 67, 0.34);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.v34-drop-menu.left-align {
  right: auto;
  left: 0;
}

.v34-drop-menu.hide {
  display: none !important;
}

.v34-drop-menu .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: 10px;
}

/* --- CAJONES COLAPSABLES (AJUSTES AVANZADOS Y CHAT IA) --- */
details.v34-adv,
details.v34-chat-drawer {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

details.v34-adv > summary,
details.v34-chat-drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  transition: background .16s ease;
}

details.v34-adv > summary::-webkit-details-marker,
details.v34-chat-drawer > summary::-webkit-details-marker {
  display: none;
}

details.v34-adv > summary:hover,
details.v34-chat-drawer > summary:hover {
  background: rgba(39, 215, 196, 0.1);
}

details.v34-adv[open] > summary,
details.v34-chat-drawer[open] > summary {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 126, 131, 0.08);
}

.v34-adv-body {
  padding: 12px 14px;
}

.v34-caret {
  font-size: 11px;
  opacity: 0.72;
  transition: transform .2s ease;
}

details[open] > summary .v34-caret {
  transform: rotate(180deg);
}

.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
}

#doc-loading {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(39, 215, 196, 0.35);
}

#doc-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(39, 215, 196, 0.18), transparent);
  animation: v34Scan 1.6s linear infinite;
  pointer-events: none;
}

@keyframes v34Scan {
  to { left: 115%; }
}

/* --- SUITE AULA & SIAGIE PRO (v3.4.0) --- */
.v34-pro-hero {
  background: linear-gradient(125deg, #073B43 0%, #0A5D66 60%, #087E83 100%);
  color: #FFFFFF;
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 14px;
  border: 1px solid rgba(39, 215, 196, 0.35);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

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

.v34-pro-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;
}

.v34-pro-tab:hover {
  border-color: rgba(39, 215, 196, 0.7);
  box-shadow: 0 6px 18px -6px var(--v34-glow);
}

.v34-pro-tab.active {
  background: linear-gradient(135deg, #073B43 0%, #087E83 100%);
  color: #FFFFFF;
  border-color: #27D7C4;
  box-shadow: 0 8px 22px -6px rgba(39, 215, 196, 0.5);
}

.v34-siagie-alert {
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(233, 168, 45, 0.13);
  border: 1px solid rgba(233, 168, 45, 0.42);
  color: var(--fg);
  font-size: 12.8px;
  margin-bottom: 12px;
}

.v34-conc-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.v34-conc-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.v34-conc-item:hover {
  border-color: rgba(39, 215, 196, 0.65);
  box-shadow: 0 8px 22px -10px var(--v34-glow);
}

.v34-grade-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.v34-grade-B { background: #FEF3C7; color: #92400E; border: 1px solid #F59E0B; }
.v34-grade-C { background: #FEE2E2; color: #991B1B; border: 1px solid #EF4444; }
.v34-grade-A { background: #DBEAFE; color: #1E40AF; border: 1px solid #3B82F6; }
.v34-grade-AD { background: #DCFCE7; color: #166534; border: 1px solid #22C55E; }

.v34-doc-preview-box {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 14px;
  border: 1px solid #CBD5E1;
  padding: 22px 24px;
  margin-top: 12px;
  box-shadow: 0 10px 28px -14px rgba(15, 23, 42, 0.16);
}

.v34-doc-preview-box h2 {
  font-size: 14.5px;
  color: #073B43;
  border-bottom: 2px solid #087E83;
  padding-bottom: 4px;
  margin: 14px 0 8px;
}

.v34-doc-preview-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0 12px;
}

.v34-doc-preview-box th,
.v34-doc-preview-box td {
  border: 1px solid #CBD5E1;
  padding: 7px 9px;
  vertical-align: top;
}

.v34-doc-preview-box th {
  background: #F0FDFA;
  color: #073B43;
  text-align: left;
  font-weight: 700;
}

.toe-box {
  border-left: 4px solid #087E83;
  background: #F0FDFA;
  color: #0F172A;
  padding: 9px 12px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  font-size: 12px;
}

.multigrado-box {
  border-left: 4px solid #E9A82D;
  background: #FFFBEB;
  color: #0F172A;
  padding: 9px 12px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  font-size: 12px;
}

.v34-legal-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
}

.v34-legal-links button {
  background: none;
  border: none;
  color: #67E8F9;
  cursor: pointer;
  text-decoration: underline;
  font-size: 12px;
  padding: 2px 4px;
}

.v34-legal-links button:hover {
  color: #FFFFFF;
}

/* --- PULIDO FINAL v3.4.2: MÓVIL + PORTADA + IMPRESIÓN LIMPIA --- */
.v34-drop-menu {
  max-width: calc(100vw - 24px);
}

.hero .btn-accent {
  box-shadow: 0 10px 26px -6px var(--v34-gold-glow);
}

.hero .btn-accent:hover {
  box-shadow: 0 14px 32px -6px rgba(233, 168, 45, 0.55);
}

.v34-hub-card:focus-visible,
.btn:focus-visible,
.v34-pro-tab:focus-visible {
  outline: 2.5px solid var(--v34-cyan);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .v34-drop-menu.left-align {
    left: auto;
    right: 0;
  }
  .v34-doc-preview-box {
    padding: 14px 12px;
  }
}

@media print {
  .v34-ripple,
  .v34-drop-menu,
  .v34-pro-hero,
  .v34-pro-tabs,
  .v34-legal-links {
    display: none !important;
  }
  .v34-doc-preview-box {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}
