/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Author: Tu Nombre o Empresa
Author URI: https://staloshop.com
Template: generatepress
Description: Tema hijo personalizado para StaloShop
Version: 1.0
*/

@import url("../generatepress/style.css");

/* =========================================
   STALO CRM — LAYOUT GENERAL
   SOLO PARA PÁGINAS DEL CRM
   ========================================= */

body.stl-crm-page.right-sidebar .site-content,
body.stl-crm-page.left-sidebar .site-content {
  display: grid;
  grid-template-columns: 20% 80%;
  gap: 24px;
  align-items: start;
}

/* Si el sidebar está a la derecha, lo movemos visualmente a la izquierda */
body.stl-crm-page.right-sidebar .site-content .widget-area,
body.stl-crm-page.right-sidebar .site-content .inside-right-sidebar {
  order: 1;
  width: auto;
  float: none;
  margin: 0;
}

body.stl-crm-page.right-sidebar .site-content .content-area {
  order: 2;
  width: auto;
  float: none;
  margin: 0;
}

/* Si el sidebar ya está a la izquierda */
body.stl-crm-page.left-sidebar .site-content .widget-area,
body.stl-crm-page.left-sidebar .site-content .inside-left-sidebar {
  width: auto;
  float: none;
  margin: 0;
}

body.stl-crm-page.left-sidebar .site-content .content-area {
  width: auto;
  float: none;
  margin: 0;
}

body.stl-crm-page .site-main {
  width: 100%;
}

body.stl-crm-page .site.grid-container,
body.stl-crm-page .inside-article {
  max-width: 100%;
}

/* =========================================
   MENÚ LATERAL CRM / CATÁLOGO
   ========================================= */

body.stl-crm-page #menu-lateral-titulo {
  margin: 0 0 14px 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}

body.stl-crm-page #menu-lateral-container {
  width: 100%;
  min-width: 0;
}

/* =========================================
   MENÚ CRM SIMPLE — VISTA PRO
   ========================================= */

body.stl-crm-page .crm-menu--simple {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 2px 10px rgba(15, 23, 42, 0.04);
}

body.stl-crm-page .crm-menu__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

body.stl-crm-page .crm-menu__link:hover {
  background: #f8fafc;
  color: #111827;
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

body.stl-crm-page .crm-menu__link:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

body.stl-crm-page .crm-menu__link.active {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #ffffff;
  border-color: #111827;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.22);
}

body.stl-crm-page .crm-menu__link.active::before {
  content: "";
  width: 4px;
  align-self: stretch;
  border-radius: 999px;
  background: #ffffff;
  opacity: 0.95;
}

body.stl-crm-page .crm-menu__sin-acceso {
  padding: 12px 14px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #991b1b;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

/* =========================================
   COTIZACIONES
   ========================================= */

body.stl-crm-page .stl-cotizacion-app {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: inherit;
  color: #111827;
}

body.stl-crm-page .stl-cotizacion__topbar,
body.stl-crm-page .stl-card__cabecera,
body.stl-crm-page .stl-concepto__cabecera,
body.stl-crm-page .stl-modal__cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

body.stl-crm-page .stl-cotizacion__titulo-modulo,
body.stl-crm-page .stl-card__titulo,
body.stl-crm-page .stl-concepto__titulo,
body.stl-crm-page .stl-modal__titulo {
  margin: 0;
  line-height: 1.2;
}

body.stl-crm-page .stl-cotizacion__titulo-modulo {
  font-size: 28px;
  font-weight: 800;
}

body.stl-crm-page .stl-card__titulo,
body.stl-crm-page .stl-concepto__titulo,
body.stl-crm-page .stl-modal__titulo {
  font-size: 18px;
  font-weight: 700;
}

body.stl-crm-page .stl-cotizacion__subtitulo-modulo {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

body.stl-crm-page .stl-cotizacion__mensaje {
  display: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

body.stl-crm-page .stl-cotizacion__mensaje:not(:empty) {
  display: block;
}

body.stl-crm-page .stl-cotizacion__mensaje--ok {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

body.stl-crm-page .stl-cotizacion__mensaje--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

body.stl-crm-page .stl-card,
body.stl-crm-page .stl-concepto {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

body.stl-crm-page .stl-cotizacion__grid-principal {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

body.stl-crm-page .stl-form-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

body.stl-crm-page .stl-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.stl-crm-page .stl-form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.stl-crm-page .stl-form-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.stl-crm-page .stl-campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

body.stl-crm-page .stl-campo--alineado-final {
  justify-content: flex-end;
}

body.stl-crm-page .stl-campo__label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  line-height: 1.35;
}

body.stl-crm-page .stl-campo__input,
body.stl-crm-page .stl-campo__select,
body.stl-crm-page .stl-campo__textarea,
body.stl-crm-page .stl-celda-input,
body.stl-crm-page .stl-celda-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font-size: 14px;
  color: #111827;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.stl-crm-page .stl-campo__input:focus,
body.stl-crm-page .stl-campo__select:focus,
body.stl-crm-page .stl-campo__textarea:focus,
body.stl-crm-page .stl-celda-input:focus,
body.stl-crm-page .stl-celda-select:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

body.stl-crm-page .stl-campo__input[readonly] {
  background: #f9fafb;
}

body.stl-crm-page .stl-campo__textarea {
  min-height: 110px;
  resize: vertical;
}

body.stl-crm-page .stl-campo__solo-lectura {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
}

body.stl-crm-page .stl-btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  transition: transform 0.12s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

body.stl-crm-page .stl-btn:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

body.stl-crm-page .stl-btn:active {
  transform: translateY(1px);
}

body.stl-crm-page .stl-btn--primario {
  background: #111827;
  color: #fff;
}

body.stl-crm-page .stl-btn--secundario {
  background: #f3f4f6;
  color: #111827;
}

body.stl-crm-page .stl-btn--peligro {
  background: #fee2e2;
  color: #991b1b;
}

body.stl-crm-page .stl-btn--mini {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 8px;
}

body.stl-crm-page .stl-resumen__fila {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

body.stl-crm-page .stl-resumen__fila:last-child {
  border-bottom: none;
}

body.stl-crm-page .stl-resumen__label {
  font-size: 14px;
  color: #4b5563;
}

body.stl-crm-page .stl-resumen__valor {
  text-align: right;
  font-size: 15px;
  color: #111827;
}

body.stl-crm-page .stl-resumen__fila--total .stl-resumen__label,
body.stl-crm-page .stl-resumen__fila--total .stl-resumen__valor {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

body.stl-crm-page .stl-conceptos__contenedor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.stl-crm-page .stl-concepto {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.stl-crm-page .stl-detalles {
  margin-top: 8px;
}

body.stl-crm-page .stl-detalles__titulo {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
  color: #111827;
}

body.stl-crm-page .stl-detalles__tabla-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

body.stl-crm-page .stl-tabla-detalles {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  background: #fff;
}

body.stl-crm-page .stl-tabla-detalles th,
body.stl-crm-page .stl-tabla-detalles td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

body.stl-crm-page .stl-tabla-detalles thead th {
  background: #f9fafb;
  font-weight: 800;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 1;
}

body.stl-crm-page .stl-tabla-detalles__vacio {
  text-align: center;
  color: #6b7280;
  padding: 18px 12px;
}

/* =========================================
   LISTADOS CRM
   ========================================= */

body.stl-crm-page .stl-catalogo-items-app,
body.stl-crm-page .stl-cotizaciones-listado-app {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

body.stl-crm-page .stl-catalogo-items__topbar,
body.stl-crm-page .stl-cotizaciones-listado__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

body.stl-crm-page .stl-catalogo-items__titulo-modulo,
body.stl-crm-page .stl-cotizaciones-listado__titulo-modulo {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

body.stl-crm-page .stl-catalogo-items__subtitulo-modulo,
body.stl-crm-page .stl-cotizaciones-listado__subtitulo-modulo {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

body.stl-crm-page .stl-tabla-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.stl-crm-page .stl-tabla-general {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  background: #fff;
}

body.stl-crm-page .stl-tabla-general th,
body.stl-crm-page .stl-tabla-general td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

body.stl-crm-page .stl-tabla-general thead th {
  background: #f9fafb;
  font-weight: 800;
  color: #374151;
}

body.stl-crm-page .stl-cards-listado {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.stl-crm-page .stl-card-listado {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

body.stl-crm-page .stl-card-listado__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

body.stl-crm-page .stl-card-listado__title {
  font-weight: 800;
  line-height: 1.35;
}

body.stl-crm-page .stl-card-listado__id {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

body.stl-crm-page .stl-card-listado__body {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}

body.stl-crm-page .stl-card-listado__footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

body.stl-crm-page .stl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

body.stl-crm-page .stl-badge--borrador { background: #f3f4f6; color: #374151; }
body.stl-crm-page .stl-badge--enviada { background: #dbeafe; color: #1d4ed8; }
body.stl-crm-page .stl-badge--aceptada { background: #dcfce7; color: #166534; }
body.stl-crm-page .stl-badge--rechazada { background: #fee2e2; color: #991b1b; }
body.stl-crm-page .stl-badge--cancelada { background: #f3f4f6; color: #6b7280; }

body.stl-crm-page .mobile-only { display: none; }
body.stl-crm-page .desktop-only { display: block; }

/* =========================================
   RESPONSIVE CRM
   ========================================= */

@media (max-width: 1024px) {
  body.stl-crm-page.right-sidebar .site-content,
  body.stl-crm-page.left-sidebar .site-content {
    grid-template-columns: 1fr;
  }

  body.stl-crm-page .stl-cotizacion__grid-principal {
    grid-template-columns: 1fr;
  }

  body.stl-crm-page .stl-form-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.stl-crm-page .stl-form-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.stl-crm-page .stl-form-grid--2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  body.stl-crm-page.right-sidebar .site-content,
  body.stl-crm-page.left-sidebar .site-content {
    display: flex;
    flex-direction: column;
  }

  body.stl-crm-page.right-sidebar .site-content .widget-area,
  body.stl-crm-page.right-sidebar .site-content .inside-right-sidebar,
  body.stl-crm-page.left-sidebar .site-content .widget-area,
  body.stl-crm-page.left-sidebar .site-content .inside-left-sidebar {
    order: 1;
    width: 100%;
    margin-bottom: 16px;
  }

  body.stl-crm-page.right-sidebar .site-content .content-area,
  body.stl-crm-page.left-sidebar .site-content .content-area {
    order: 2;
    width: 100%;
  }

  body.stl-crm-page #menu-lateral-titulo {
    font-size: 16px;
    margin-bottom: 10px;
  }

  body.stl-crm-page .crm-menu--simple {
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
  }

  body.stl-crm-page .crm-menu__link {
    padding: 11px 12px;
    min-height: 44px;
    font-size: 14px;
    border-radius: 12px;
  }

  body.stl-crm-page #menu-lateral-container::before {
    content: "Menú CRM";
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  body.stl-crm-page .desktop-only { display: none; }
  body.stl-crm-page .mobile-only { display: block; }

  body.stl-crm-page .stl-card-listado__footer {
    flex-direction: column;
  }

  body.stl-crm-page .stl-card-listado__footer .stl-btn,
  body.stl-crm-page .stl-card-listado__footer a.stl-btn {
    width: 100%;
    text-align: center;
  }
}