/* ============================================================================
   PLANIORA v3.0 — SISTEMA DE DISEÑO FUTURISTA (UI/UX PREMIUM, MÓVIL + LAPTOP)
   Identidad oficial: Azul Índigo Profundo (#0B1120 / #0F172A / #1E3A8A)
                      Turquesa Esmeralda (#06B6D4 -> #10B981)
   ============================================================================ */

:root {
  --indigo-950: #0B1120;
  --indigo-900: #0F172A;
  --indigo-800: #1E293B;
  --indigo-brand: #1E3A8A;
  --cyan: #06B6D4;
  --cyan-bright: #22D3EE;
  --emerald: #10B981;
  --emerald-dark: #059669;
  --accent-grad: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
  --indigo-grad: linear-gradient(135deg, #0B1120 0%, #172554 55%, #0F172A 100%);

  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-glass: rgba(255, 255, 255, 0.84);
  --fg: #0F172A;
  --muted: #475569;
  --border: #E2E8F0;
  --border-glow: rgba(6, 182, 212, 0.45);
  --ok: #059669;
  --danger: #DC2626;
  --warn-bg: #FEF3C7;
  --warn-fg: #92400E;
  --warn-bd: #F59E0B;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 14px 36px rgba(15, 23, 42, 0.10);
  --shadow-glow: 0 10px 32px rgba(6, 182, 212, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 66px;
  --mobbar-h: 68px;
  box-sizing: border-box;
}

:root[data-theme="dark"] {
  --bg: #050914;
  --surface: #0D1526;
  --surface-2: #13203A;
  --surface-glass: rgba(13, 21, 38, 0.85);
  --fg: #F1F5F9;
  --muted: #94A3B8;
  --border: #1E2E4A;
  --cyan: #22D3EE;
  --emerald: #34D399;
  --warn-bg: #2D2106;
  --warn-fg: #FDE68A;
  --warn-bd: #B45309;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 12px 38px rgba(34, 211, 238, 0.18);
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100dvh;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Poppins', 'Inter', system-ui, sans-serif;
  margin: 0;
  letter-spacing: -0.025em;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.hide { display: none !important; }

/* === CONTROLES BASE ACCESIBLES (>= 44px TÁCTIL) === */
button, input, select, textarea {
  font: inherit;
  color: var(--fg);
  border-radius: var(--radius-sm);
  min-height: 44px;
  min-width: 0;
}

input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  padding: 10px 13px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea { resize: vertical; min-height: 82px; }
input[type="file"] { padding: 7px 10px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.22);
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* === BOTONES FUTURISTAS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--cyan); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #0284C7 0%, #06B6D4 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.28);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369A1 0%, #0891B2 100%);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.38);
}

.btn-accent, .btn-gold {
  background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
  border-color: transparent;
  color: #031520;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.28);
}
.btn-accent:hover:not(:disabled), .btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.38);
}

.btn-ok { background: var(--ok); border-color: var(--ok); color: #FFFFFF; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); }
.btn-top-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.30);
  color: #F8FAFC;
  backdrop-filter: blur(8px);
}
.btn-top-ghost:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--cyan-bright);
  color: #FFFFFF;
}
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 12.5px; }

/* === TARJETAS GLASS & BORDES SUTILES === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.card-glow:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.14);
  color: #0E7490;
  border: 1px solid rgba(6, 182, 212, 0.25);
}
:root[data-theme="dark"] .badge { color: #67E8F9; background: rgba(34, 211, 238, 0.14); }

.badge-gold, .badge-accent {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(16, 185, 129, 0.22));
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.42);
}
:root[data-theme="dark"] .badge-gold, :root[data-theme="dark"] .badge-accent {
  color: #6EE7B7;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.24), rgba(16, 185, 129, 0.26));
}
.badge-hero {
  background: rgba(6, 182, 212, 0.18);
  color: #67E8F9;
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.22);
}
.badge-ok { background: rgba(16, 185, 129, 0.15); color: #047857; border-color: rgba(16, 185, 129, 0.35); }
:root[data-theme="dark"] .badge-ok { color: #6EE7B7; }
.badge-danger { background: rgba(220, 38, 38, 0.14); color: #DC2626; border-color: rgba(220, 38, 38, 0.30); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13.5px; }
.small { font-size: 12px; color: var(--muted); }
.err-txt { color: var(--danger); font-size: 12.5px; font-weight: 600; }

/* === BANNERS SUPERIORES (ALTO CONTRASTE CORREGIDO) === */
.sys-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  font-size: 13px;
}
.sys-banner.promo {
  background: linear-gradient(90deg, #061830 0%, #0C2B54 50%, #063547 100%);
  color: #F8FAFC;
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
}
.sys-banner.promo code {
  background: rgba(16, 185, 129, 0.22);
  color: #6EE7B7;
  border: 1px solid rgba(52, 211, 153, 0.55);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.sys-banner.update { background: #0B1120; color: #FFFFFF; border-bottom: 1px solid var(--cyan); }
.sys-banner.news { background: linear-gradient(90deg, #0F172A, #164E63); color: #F0F9FF; border-bottom: 1px solid rgba(34, 211, 238, 0.4); }
.sys-banner.warn { background: var(--warn-bg); color: var(--warn-fg); border-bottom: 1px solid var(--warn-bd); }

/* === 1. LANDING PAGE FUTURISTA === */
.land-nav {
  position: sticky; top: 0; z-index: 35;
  background: rgba(11, 17, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(34, 211, 238, 0.18);
}
.land-nav-in {
  max-width: 1240px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.land-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #FFFFFF; }
.land-brand img.logo-h { height: 34px; width: auto; display: block; }
.land-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.land-links a { color: #CBD5E1; font-weight: 500; font-size: 13.5px; transition: color .15s ease; }
.land-links a:hover { color: var(--cyan-bright); text-decoration: none; }

/* SELECTOR DE PAÍS EN PORTADA */
.country-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  margin-bottom: 16px;
}
.country-pill {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s ease;
}
.country-pill.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(16, 185, 129, 0.25));
  color: #FFFFFF;
  border: 1px solid rgba(34, 211, 238, 0.55);
}
.country-pill:hover:not(.active) { color: #E2E8F0; background: rgba(255,255,255,0.06); }
.country-pill em {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #CBD5E1;
}

/* HERO CYBER-GRID FUTURISTA */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(6, 182, 212, 0.24), transparent 44%),
    radial-gradient(circle at 12% 85%, rgba(16, 185, 129, 0.16), transparent 42%),
    linear-gradient(145deg, #060B17 0%, #0F172A 48%, #0E1F47 100%);
  color: #FFFFFF;
  padding: 52px 20px 64px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 80%);
  pointer-events: none;
}
.hero-in {
  position: relative;
  z-index: 2;
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.06fr 0.94fr; gap: 38px; align-items: center;
}
.hero h1 { font-size: clamp(29px, 4.2vw, 48px); line-height: 1.12; margin: 12px 0 16px; font-weight: 800; }
.hero h1 span {
  background: linear-gradient(90deg, #22D3EE 0%, #34D399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: #CBD5E1; font-size: 16px; margin: 0 0 24px; max-width: 560px; }
.hero-acts { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.hero-pill {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; color: #E2E8F0;
  backdrop-filter: blur(8px);
}

/* PANEL FUTURISTA INTERACTIVO EN HERO */
.hero-console {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.50), 0 0 40px rgba(6, 182, 212, 0.16);
  backdrop-filter: blur(16px);
}
.console-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.console-dots { display: flex; gap: 6px; }
.console-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.console-dots i:nth-child(1) { background: #F87171; }
.console-dots i:nth-child(2) { background: #FBBF24; }
.console-dots i:nth-child(3) { background: #34D399; }
.console-url {
  font-size: 11.5px; color: #94A3B8; background: rgba(2, 6, 23, 0.55);
  padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.2);
}
.console-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.console-tile {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 12px;
}
.console-tile strong { display: block; font-size: 13px; color: #F8FAFC; margin-top: 4px; }
.console-tile span { font-size: 11.5px; color: #94A3B8; }
.console-preview {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(16, 185, 129, 0.10));
  border: 1px solid rgba(34, 211, 238, 0.30);
  border-radius: 14px;
  padding: 14px;
  font-size: 12.5px;
  color: #E2E8F0;
}
.console-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.console-tags span {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.85); color: #67E8F9; border: 1px solid rgba(34, 211, 238, 0.32);
}

/* SECCIÓN GANCHO VIRAL GRATUITO EN PORTADA */
.viral-box {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1.5px solid rgba(6, 182, 212, 0.38);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.viral-preview {
  position: relative;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  padding: 24px;
  margin-top: 16px;
  overflow-x: auto;
}
.viral-preview .vg-wm {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 36px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.055);
  transform: rotate(-24deg);
  text-transform: uppercase;
  text-align: center;
  z-index: 2;
}
.viral-preview table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.viral-preview th, .viral-preview td { border: 1px solid #94A3B8; padding: 6px 8px; text-align: left; }
.viral-preview th { background: #E0F2FE; color: #0F172A; font-weight: 700; }
.viral-foot {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed #94A3B8;
  font-size: 11px; color: #475569; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
}

.land-sec { max-width: 1240px; margin: 0 auto; padding: 52px 20px; }
.land-sec-hdr { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.land-sec-hdr h2 { font-size: clamp(23px, 3vw, 33px); margin: 10px 0 8px; font-weight: 800; }

.step-num {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--indigo-grad); color: var(--cyan-bright);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 12px;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan-card {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 26px; border-radius: 22px; background: var(--surface);
  border: 1.5px solid var(--border); box-shadow: var(--shadow-sm); position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.plan-card.featured {
  border-color: var(--cyan);
  box-shadow: 0 18px 44px rgba(6, 182, 212, 0.20);
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--cyan) 6%, var(--surface)) 100%);
}
.plan-price { font-size: 34px; font-weight: 800; color: var(--fg); margin: 12px 0 4px; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-sub-prices { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.plan-list { list-style: none; padding: 0; margin: 14px 0 22px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }

.land-footer {
  background: #060B17; color: #94A3B8; padding: 34px 20px; text-align: center; font-size: 13px;
  border-top: 1px solid rgba(34, 211, 238, 0.16);
}
.land-footer strong { color: #F8FAFC; }

/* === 2. SHELL APP AUTENTICADA === */
.app-topbar {
  position: sticky; top: 0; z-index: 25; height: var(--nav-h);
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(14px);
  color: #FFFFFF;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.20);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}
.app-topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-topbar .brand img { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; border: 1px solid rgba(34, 211, 238, 0.35); }
.app-topbar .brand-title { font-weight: 800; font-size: 16px; line-height: 1.15; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.app-topbar .brand-sub { font-size: 11.5px; color: #94A3B8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.app-topbar .top-right { display: flex; align-items: center; gap: 7px; }
.credit-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(52, 211, 153, 0.55);
  color: #6EE7B7; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.country-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(148, 163, 184, 0.28);
  color: #E2E8F0; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
}

.app-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100dvh - var(--nav-h)); }
.app-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: var(--nav-h); height: calc(100dvh - var(--nav-h)); overflow-y: auto;
}
.nav-item {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 13px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--fg);
  font-weight: 600; font-size: 13.5px; cursor: pointer; text-align: left; transition: all .15s ease;
}
.nav-item:hover { background: var(--surface-2); border-color: var(--border); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(16, 185, 129, 0.12));
  border-color: rgba(6, 182, 212, 0.38);
  color: #0E7490;
}
:root[data-theme="dark"] .nav-item.active { color: #67E8F9; }
.nav-sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 14px 12px 4px; }

.app-main { padding: 20px 22px 48px; max-width: 1460px; width: 100%; margin: 0 auto; min-width: 0; }

.mob-bottom-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  height: var(--mobbar-h); background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(5, 1fr); gap: 4px;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.10);
}
.mob-bottom-bar button {
  min-height: 48px; border: none; background: transparent; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 2px; cursor: pointer;
}
.mob-bottom-bar button.active { color: var(--cyan); background: rgba(6, 182, 212, 0.12); }
.mob-bottom-bar button span.ico { font-size: 18px; line-height: 1; }

/* === 3. DASHBOARD, WIZARD 5 PASOS Y EDITOR A4 === */
.dash-hero {
  background: var(--indigo-grad);
  color: #FFFFFF;
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: var(--shadow-md);
}
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.quick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border);
  text-align: left; cursor: pointer; transition: transform .15s ease, border-color .18s ease, box-shadow .18s ease;
}
.quick-card:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: var(--shadow-glow); }
.quick-ico {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(16, 185, 129, 0.14));
  border: 1px solid rgba(6, 182, 212, 0.22);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}

.wizard-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.wiz-step {
  padding: 10px 8px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted);
  cursor: pointer; text-align: center; transition: all .15s ease;
}
.wiz-step.active {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(16, 185, 129, 0.10));
  color: #0E7490;
}
:root[data-theme="dark"] .wiz-step.active { color: #67E8F9; }
.wiz-step.done { border-color: var(--emerald); color: var(--emerald-dark); }

.workspace-split { display: grid; grid-template-columns: 435px minmax(0, 1fr); gap: 16px; align-items: start; }
.mob-split-tabs { display: none; gap: 8px; margin-bottom: 12px; }
.mob-split-tabs button { flex: 1; }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1.5px solid var(--border); font-size: 12.5px; font-weight: 600;
  cursor: pointer; user-select: none; min-height: 36px;
}
.chip input { width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; }
.chip.active { border-color: var(--cyan); background: rgba(6, 182, 212, 0.12); color: #0E7490; }
:root[data-theme="dark"] .chip.active { color: #67E8F9; }

.sample-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border);
  margin-bottom: 12px;
}
.sample-bar .small { width: 100%; font-weight: 700; margin-bottom: 2px; }

.doc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* HOJA A4 + 4 PLANTILLAS WORD OFICIALES */
.doc-sheet {
  position: relative; background: #FFFFFF; color: #0F172A; border: 1px solid #CBD5E1;
  border-radius: 14px; padding: 26px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
  overflow-x: auto; min-height: 520px;
}
.doc-sheet.tpl-ugel_compacto { padding: 16px; font-size: 11.5px; }
.doc-sheet.tpl-ugel_compacto table { font-size: 11px; }
.doc-sheet.tpl-ugel_compacto th, .doc-sheet.tpl-ugel_compacto td { padding: 4px 6px; }
.doc-sheet.tpl-minedu_clasico h2 { color: #1E3A8A; border-bottom-color: #1E3A8A; }
.doc-sheet.tpl-minedu_clasico th { background: #E2E8F0; color: #0F172A; }
.doc-sheet.tpl-institucional_escudo .hdr-box { flex-direction: column; text-align: center; border-bottom: 3px double #1E3A8A; }
.doc-sheet.tpl-institucional_escudo .hdr-box > div { justify-content: center; text-align: center !important; }

.doc-wm {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; font-size: 42px; font-weight: 900; color: rgba(15, 23, 42, 0.065);
  transform: rotate(-28deg); text-transform: uppercase; text-align: center; z-index: 2;
}
.doc-inner { position: relative; z-index: 1; }
.doc-sheet h2 { color: #0F172A; font-size: 15px; margin: 16px 0 8px; padding-bottom: 4px; border-bottom: 2px solid #06B6D4; }
.doc-sheet h3 { color: #1E293B; font-size: 13.5px; margin: 12px 0 6px; }
.doc-sheet table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 12px; }
.doc-sheet th, .doc-sheet td { border: 1px solid #94A3B8; padding: 6px 8px; vertical-align: top; text-align: left; }
.doc-sheet th { background: #EFF6FF; color: #0F172A; font-weight: 700; }
.doc-sheet input { background: #FFFFFF; color: #0F172A; border-color: #94A3B8; }
.doc-sheet .hdr-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 3px solid #0F172A; padding-bottom: 10px; margin-bottom: 12px; }
.doc-sheet .hdr-logo { max-height: 60px; max-width: 115px; object-fit: contain; }
.doc-sheet .ef-blank { background: #F8FAFC; color: #475569; font-style: italic; border-left: 4px solid #94A3B8; padding: 8px 10px; }
.doc-sheet .ficha-box { border: 2px dashed #06B6D4; border-radius: 12px; padding: 14px; margin-top: 14px; background: #F8FAFC; }
.doc-sheet .ficha-img-wrap {
  margin: 10px 0; padding: 10px; background: #FFFFFF; border: 1.5px solid #CBD5E1;
  border-radius: 10px; text-align: center;
}
.doc-sheet .ficha-img-wrap img { max-width: 100%; max-height: 230px; object-fit: contain; display: block; margin: 0 auto 6px; }
.doc-sheet .nee-box { border-left: 4px solid #10B981; background: #ECFDF5; padding: 10px 12px; border-radius: 8px; margin-top: 10px; font-size: 12px; }
.doc-sheet .norma-box { border-left: 4px solid #0284C7; background: #F0F9FF; padding: 10px 12px; border-radius: 8px; margin-top: 10px; font-size: 12px; }
.doc-sheet .mini-btn { background: #0284C7; color: #FFFFFF; border: none; border-radius: 6px; padding: 5px 9px; font-size: 11.5px; min-height: 28px; cursor: pointer; }

.grade-btn {
  min-width: 38px; min-height: 32px; padding: 2px 8px; border-radius: 8px;
  border: 1px solid #CBD5E1; font-weight: 800; font-size: 12px; cursor: pointer;
}
.g-AD { background: #DCFCE7; border-color: #15803D; color: #14532D; }
.g-A  { background: #DBEAFE; border-color: #1D4ED8; color: #1E3A8A; }
.g-B  { background: #FEF9C3; border-color: #CA8A04; color: #713F12; }
.g-C  { background: #FEE2E2; border-color: #DC2626; color: #7F1D1D; }

.chat-log { max-height: 175px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; margin: 10px 0; }
.chat-msg { padding: 8px 12px; border-radius: 11px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.chat-msg.u { border-left: 4px solid var(--emerald); }
.chat-msg.a { border-left: 4px solid var(--cyan); }
.chat-row { display: flex; gap: 8px; }
.chat-row input { flex: 1; }

/* BANCO DE IMÁGENES EN ADMIN */
.img-bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; margin-top: 12px; }
.img-bank-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.img-bank-card img {
  width: 100%; height: 118px; object-fit: contain; background: #FFFFFF;
  border-radius: 10px; border: 1px solid var(--border); padding: 4px;
}

/* === 4. SIMULADOR, TABLAS, MODALES, TOAST === */
.sim-q { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.sim-opt {
  display: block; width: 100%; text-align: left; margin: 7px 0; padding: 11px 14px;
  border-radius: 11px; background: var(--surface-2); border: 1.5px solid var(--border); font-weight: 500; cursor: pointer;
}
.sim-opt.sel { border-color: var(--cyan); background: rgba(6, 182, 212, 0.14); }
.sim-opt.ok  { border-color: var(--ok); background: #DCFCE7; color: #14532D; }
.sim-opt.bad { border-color: var(--danger); background: #FEE2E2; color: #7F1D1D; }
.sim-exp { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(6, 182, 212, 0.12); border-left: 4px solid var(--cyan); font-size: 13px; }

.data-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-tbl th, .data-tbl td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; vertical-align: middle; }
.data-tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); }

.stat-card { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat-val { font-size: 26px; font-weight: 800; color: var(--cyan); margin-top: 4px; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(6, 11, 23, 0.72); backdrop-filter: blur(6px);
  z-index: 60; display: flex; align-items: center; justify-content: center; padding: 14px;
}
.modal-card {
  background: var(--surface); border: 1px solid rgba(34, 211, 238, 0.25); border-radius: 22px;
  padding: 24px; max-width: 510px; width: 100%; max-height: 90dvh; overflow-y: auto; box-shadow: var(--shadow-md);
}

.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(6, 182, 212, 0.25);
  border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  height: 18px; border-radius: 8px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

#toast-wrap { position: fixed; right: 16px; bottom: 84px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: 350px; }
.toast { padding: 12px 16px; border-radius: 14px; background: #0F172A; color: #FFFFFF; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); border: 1px solid rgba(34, 211, 238, 0.35); border-left: 4px solid var(--cyan); }
.toast.err { border-left-color: var(--danger); background: #450A0A; border-color: #DC2626; }
.toast.ok  { border-left-color: var(--emerald); }

/* === 5. RESPONSIVE === */
@media (max-width: 1080px) {
  .workspace-split { grid-template-columns: 1fr; }
  .mob-split-tabs { display: flex; }
  .split-pane.mob-hidden { display: none; }
  .plans-grid { grid-template-columns: 1fr; }
  .hero-in { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-acts, .hero-pills { justify-content: center; }
  .country-bar { margin-left: auto; margin-right: auto; }
}

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .mob-bottom-bar { display: grid; }
  .app-main { padding: 14px 12px calc(var(--mobbar-h) + 24px); }
  .grid-2, .grid-3, .grid-4, .console-grid { grid-template-columns: 1fr; }
  .wizard-bar { gap: 4px; }
  .wiz-step span { display: none; }
  .doc-sheet { padding: 14px; }
  .app-topbar .brand-sub { max-width: 150px; }
}

@media (max-width: 560px) {
  .app-topbar { padding: 0 10px; gap: 6px; }
  .app-topbar .brand img { width: 32px; height: 32px; }
  .app-topbar .brand-sub, .country-chip { display: none; }
  .app-topbar .top-right { gap: 4px; }
  .app-topbar .btn-sm { padding: 5px 8px; font-size: 12px; }
  .credit-chip { padding: 5px 8px; font-size: 11.5px; }
}

/* === 6. IMPRESIÓN / PDF A4 === */
@media print {
  .app-topbar, .app-sidebar, .mob-bottom-bar, .sys-banner, .wizard-bar,
  .mob-split-tabs, .doc-toolbar, .doc-tabs, #pane-editor, #toast-wrap, .modal-bg, .no-print {
    display: none !important;
  }
  body { background: #FFFFFF; color: #000000; }
  .app-layout, .app-main, .workspace-split { display: block !important; padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  #pane-preview, #pane-preview.mob-hidden { display: block !important; }
  .land-sec, .viral-box, .card { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; background: #FFFFFF !important; }
  .doc-sheet, .viral-preview { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }
  .doc-sheet input { background: #FFFFFF !important; color: #000000 !important; border: 1px solid #94A3B8 !important; }
  .doc-sheet tr, .viral-preview tr { break-inside: avoid; }
  .doc-sheet .secuencia-tbl tr, .viral-preview .secuencia-tbl tr { break-inside: auto; }
  .doc-sheet .proc-block, .viral-preview .proc-block { break-inside: avoid; page-break-inside: avoid; }
  .doc-sheet .ficha-box, .viral-preview .ficha-box, .anexo-break { break-before: page; page-break-before: always; }
}
