/* ═══════════════════════════════════════════════════════════════
   lk-mobile.css — LUZOcrm V2 Mobile & Responsive
   Breakpoints: mobile ≤768px | tablet 769–1024px
═══════════════════════════════════════════════════════════════ */

/* ── Bottom nav: oculto en desktop por defecto ─────────────── */
.bn-bar { display: none; }

@media (min-width: 769px) {
  .bn-bar { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE  ≤768px
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Shell layout ─────────────────────────────────────────── */
  .ul0-rail, .ul1-panel { display: none !important; }

  #lz-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 44px 1fr 56px;
  }

  /* ── Top bar slim ─────────────────────────────────────────── */
  .tx-top {
    height: 44px;
    padding: 0 12px;
    /* Soporte notch superior iOS */
    padding-top: env(safe-area-inset-top, 0px);
  }
  .top-hello  { display: none; }
  .top-clock  { display: none; }
  .top-center { flex: none; }

  /* ── Content ──────────────────────────────────────────────── */
  .tx-main { grid-column: 1; }

  .tx-content {
    height: calc(
      100dvh
      - 44px
      - 56px
      - env(safe-area-inset-top, 0px)
      - env(safe-area-inset-bottom, 0px)
    );
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Footer: ocultar ─────────────────────────────────────── */
  .tx-footer { display: none; }

  /* ── Blades: pantalla completa ───────────────────────────── */
  .ld-blade  { width: 100vw !important; border-radius: 0 !important; }
  .ld-dimmer { display: none !important; }

  /* ── Modals: slide-up desde abajo ────────────────────────── */
  .lk-modal {
    border-radius: 16px 16px 0 0 !important;
    height: auto !important;
    max-height: 92dvh;
    width: 100% !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    top: auto !important;
    transform: none !important;
  }

  /* ── Toast: top center en mobile ─────────────────────────── */
  #lz-toast {
    bottom: auto;
    top: calc(52px + env(safe-area-inset-top, 0px));
    right: 50%;
    transform: translateX(50%);
    min-width: 280px;
    max-width: calc(100vw - 32px);
  }

  /* ── Touch targets mínimo 44×44px (WCAG 2.5.5) ──────────── */
  button,
  a,
  [data-nav-id],
  [data-action],
  [data-bn-group],
  select {
    min-height: 44px;
    min-width:  44px;
  }

  /* ── Inputs 16px: evita zoom automático en iOS ───────────── */
  input, textarea, select { font-size: 16px !important; }

  /* ── Module layout helpers ───────────────────────────────── */
  .mod-split {
    flex-direction: column;
  }
  .mod-left {
    width: 100%;
    border-right: none;
    border-bottom: 0.5px solid var(--border-soft);
    max-height: 40vh;
    overflow-y: auto;
  }
  .mod-right {
    width: 100%;
    flex: 1;
  }

  /* ── Bottom nav visible ──────────────────────────────────── */
  .bn-bar {
    display: flex !important;
    align-items: stretch;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--panel, #1c1c1e);
    border-top: 0.5px solid var(--border-soft, rgba(255,255,255,.08));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM NAV — estilos (activos en mobile, inerte en desktop)
═══════════════════════════════════════════════════════════════ */
.bn-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--tx-muted, #94a3b8);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 6px 4px;
  position: relative;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.bn-tab:hover  { color: var(--tx-main, #f1f5f9); }
.bn-tab.bn-active { color: var(--accent, #6d28d9); }

.bn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: relative;
}

.bn-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bn-label {
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

/* Badge de notificaciones en bottom nav */
.bn-badge {
  display: none;
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--tx-red, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   TABLET  769–1024px  (ajustes menores)
═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .ul1-panel { width: 200px; }

  .tx-content {
    height: calc(100dvh - var(--topbar-h, 52px) - var(--footer-h, 32px));
  }

  /* Blades más angostos en tablet */
  .ld-blade { width: min(480px, 90vw) !important; }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESIBILIDAD — reduced motion
═══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ld-blade,
  .lk-modal,
  .bn-tab,
  #lz-toast,
  .tx-content {
    transition: none !important;
    animation: none !important;
  }
}
