/* ============================================================================
   ESPERALOYA — ventas.css  v6.0
   Formularios Ventas y Gastos — móvil-first + escritorio profesional
   ============================================================================ */

/* ── Hero card ───────────────────────────────────────────────────────────── */
.mod-hero {
  border-radius: var(--r-lg); padding: 22px 20px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  overflow: hidden; position: relative;
}
.mod-hero__left  { display: flex; align-items: center; gap: 14px; flex: 1; }
.mod-hero__icon  {
  width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mod-hero__icon .icon-svg { width: 22px; height: 22px; color: white; }
.mod-hero__text h1 { font-size: 20px; font-weight: 800; color: white; margin: 0 0 2px; letter-spacing: -.4px; }
.mod-hero__text p  { font-size: 12px; color: rgba(255,255,255,.75); margin: 0; }
.mod-hero__kpi { text-align: right; flex-shrink: 0; }
.mod-hero__kpi-label { display: block; font-size: 10.5px; color: rgba(255,255,255,.7); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.mod-hero__kpi-value { font-size: 22px; font-weight: 800; color: white; letter-spacing: -.5px; }

.mod-hero--ventas { background: linear-gradient(135deg,#2563EB 0%,#1D4ED8 60%,#1e40af 100%); box-shadow: 0 8px 28px rgba(37,99,235,.3); }
.mod-hero--gastos { background: linear-gradient(135deg,#EF4444 0%,#DC2626 60%,#b91c1c 100%); box-shadow: 0 8px 28px rgba(239,68,68,.3); }

/* ── Etiqueta de sección ─────────────────────────────────────────────────── */
.fields-section-label {
  font-size: 11px; font-weight: 700; color: var(--g400);
  text-transform: uppercase; letter-spacing: .07em; margin: 6px 0 10px;
}

/* ── Grid de campos (móvil: 1 col) ──────────────────────────────────────── */
.g-fields-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.g-field-full  { width: 100%; }

/* ── Campo standalone ────────────────────────────────────────────────────── */
.field-standalone {
  background: var(--white); border-radius: var(--r-md);
  border: 1.5px solid rgba(226,232,240,.8);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t), box-shadow var(--t);
}
.field-standalone:focus-within {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1), var(--shadow-sm);
}
.field-standalone__icon { flex-shrink: 0; }
.field-standalone__body { flex: 1; min-width: 0; }
.field-standalone__body label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--g400); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px;
}
.field-standalone__body label .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--g300); }
.field-standalone__body input,
.field-standalone__body select {
  border: none; background: none; padding: 0;
  height: auto; font-size: 16px; font-weight: 600;
  color: var(--navy); width: 100%; box-shadow: none;
}
.field-standalone__body input::placeholder { font-weight: 400; color: var(--g300); font-size: 15px; }
.field-standalone__body input:focus,
.field-standalone__body select:focus { outline: none; }
.field-standalone__right { display: flex; align-items: baseline; gap: 6px; }
.field-standalone__right input { text-align: right; flex: 1; }
.currency-prefix { font-size: 13px; font-weight: 700; color: var(--g400); flex-shrink: 0; }

/* ── Íconos de campo ─────────────────────────────────────────────────────── */
.field-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.field-icon .icon-svg { width: 17px; height: 17px; }
.field-icon.blue   { background: var(--blue-light);   color: var(--blue); }
.field-icon.green  { background: var(--green-light);  color: var(--green); }
.field-icon.purple { background: var(--purple-light); color: var(--purple); }
.field-icon.pink   { background: var(--pink-light);   color: var(--pink); }
.field-icon.orange { background: var(--orange-light); color: var(--orange); }
.field-icon.red    { background: var(--red-light);    color: var(--red); }
.field-icon.gray   { background: var(--g100);          color: var(--g500); }

/* ── Resumen card ────────────────────────────────────────────────────────── */
.summary-card {
  border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 14px;
  border: 1px solid transparent;
}
.summary-card.venta { background: linear-gradient(135deg,#EFF4FF 0%,#DBEAFE 100%); border-color: #BFDBFE; }
.summary-card.gasto { background: linear-gradient(135deg,#FFF0F9 0%,#FCE7F3 100%); border-color: #FBCFE8; }
.summary-card h3 { font-size: 13px; margin: 0 0 14px; color: var(--navy); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; color: var(--g600); }
.summary-row.total { border-top: 1px solid rgba(13,27,42,.1); margin-top: 8px; padding-top: 14px; font-size: 17px; font-weight: 800; color: var(--navy); }
.summary-row .val  { font-weight: 600; }
.summary-chips { display: flex; gap: 24px; flex-wrap: wrap; }
.summary-chip .chip-label { font-size: 10px; color: var(--g400); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 3px; }
.summary-chip .chip-value { font-size: 14px; font-weight: 700; color: var(--pink); }
.summary-chip .chip-value.neutral { color: var(--navy); }
.summary-chip .chip-value.danger  { color: var(--red); }

/* ── Botón submit ────────────────────────────────────────────────────────── */
.btn-submit {
  width: 100%; height: 52px; border: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  color: white; letter-spacing: -.1px; margin-bottom: 14px;
  transition: opacity var(--t), box-shadow var(--t), transform var(--t);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.btn-submit:hover  { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.22); }
.btn-submit:active { transform: none; }
.btn-submit .icon-svg { width: 18px; height: 18px; }
.btn-submit.blue { background: linear-gradient(135deg,var(--blue) 0%,#1D4ED8 100%); }
.btn-submit.red  { background: linear-gradient(135deg,var(--red)  0%,#DC2626 100%); }

/* ══════════════════════════════════════════════════════════════════════════
   ESCRITORIO (≥901px) — Layout profesional tipo ERP
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {

  /* ── Hero más grande ──────────────────────────────────────────────────── */
  .mod-hero { padding: 28px 36px; margin-bottom: 28px; border-radius: 20px; }
  .mod-hero__icon  { width: 54px; height: 54px; }
  .mod-hero__icon .icon-svg { width: 26px; height: 26px; }
  .mod-hero__text h1 { font-size: 26px; }
  .mod-hero__text p  { font-size: 14px; }
  .mod-hero__kpi-label { font-size: 11px; }
  .mod-hero__kpi-value { font-size: 32px; letter-spacing: -.8px; }

  /* ── Layout maestro escritorio: FORMULARIO | PANEL LATERAL ───────────── */
  .venta-desktop-layout,
  .gasto-desktop-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
  }

  /* Columna izquierda: campos */
  .venta-form-col,
  .gasto-form-col {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Columna derecha: resumen + botón */
  .venta-side-col,
  .gasto-side-col {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* ── Campos en 2 columnas dentro de la columna izquierda ─────────────── */
  .g-fields-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .g-field-full { grid-column: 1 / -1; }

  /* ── Campos más refinados ─────────────────────────────────────────────── */
  .field-standalone {
    padding: 18px 20px; gap: 16px; border-radius: 16px;
  }
  .field-icon { width: 40px; height: 40px; border-radius: 11px; }
  .field-icon .icon-svg { width: 19px; height: 19px; }
  .field-standalone__body label {
    font-size: 10px; letter-spacing: .07em; margin-bottom: 6px;
  }
  .field-standalone__body input,
  .field-standalone__body select { font-size: 17px; }

  /* ── Resumen card en panel lateral ───────────────────────────────────── */
  .summary-card { margin-bottom: 0; }
  .summary-card h3 { font-size: 12px; margin-bottom: 16px; }
  .summary-row { font-size: 13px; padding: 7px 0; }
  .summary-row.total { font-size: 18px; padding-top: 16px; }

  /* Resumen de gasto vertical en el panel lateral */
  .summary-card.gasto .summary-chips {
    flex-direction: column; gap: 12px;
  }
  .summary-chip .chip-label { font-size: 9.5px; margin-bottom: 2px; }
  .summary-chip .chip-value { font-size: 15px; }

  /* ── Botón submit en panel lateral ───────────────────────────────────── */
  .btn-submit { max-width: 100%; height: 50px; font-size: 15px; margin-bottom: 0; border-radius: 14px; }

  /* ── Historial debajo del layout de 2 cols ────────────────────────────── */
  .tbl-card { margin-top: 24px; }

  /* Etiqueta de sección con más espacio */
  .fields-section-label { margin-top: 6px; margin-bottom: 12px; font-size: 10.5px; }
}
