/* Venta sin conexión: barra en la pantalla Vender y cuadro de cobro. Usa los
   colores del tema (normal y oscuro). */

.vo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-info-border, #9db8d6);
  border-radius: 12px;
  background: var(--color-info-surface, #eaf2fb);
  color: var(--color-text, #0e1116);
}
.vo-bar.is-offline {
  border-color: var(--color-warning-border, #d9a441);
  background: var(--color-warning-surface, #fff4d6);
}
.vo-bar-text { flex: 1 1 260px; font-weight: 600; }
/* En la pantalla de acceso (sesión recordada, sin conexión). */
.auth-gate .vo-bar { margin: 16px 0 0; text-align: left; }
.auth-gate .vo-bar-text { text-transform: none; letter-spacing: normal; font-size: 15px; color: var(--color-text, #0e1116); }
.vo-bar button { min-height: 44px; }

.vo-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 18px;
  border: 1px solid var(--color-border-strong, #7b8594);
  border-radius: 16px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0e1116);
  overflow-y: auto;
}
.vo-dialog::backdrop { background: rgba(8, 10, 14, 0.6); }
.vo-dialog[open] { display: flex; flex-direction: column; gap: 12px; }

.vo-head h2 { margin: 0; font-size: 20px; }
.vo-head p { margin: 4px 0 0; color: var(--color-text-muted, #55606e); }

.vo-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.vo-field input {
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--color-border-strong, #7b8594);
  border-radius: 10px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #0e1116);
  font: inherit;
  font-weight: 400;
}

.vo-results { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.vo-results:empty { display: none; }
.vo-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--color-border, #d5d9e0);
  border-radius: 10px;
  background: var(--color-surface-subtle, #f6f7f9);
  color: var(--color-text, #0e1116);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.vo-result strong { white-space: nowrap; }

.vo-lines { display: flex; flex-direction: column; gap: 8px; }
.vo-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border, #d5d9e0);
}
.vo-line-name { min-width: 0; display: flex; flex-direction: column; }
.vo-line-name span { overflow-wrap: anywhere; }
.vo-line-name small { color: var(--color-text-muted, #55606e); }
.vo-line-total { min-width: 84px; text-align: right; white-space: nowrap; }
.vo-qty { display: flex; align-items: center; gap: 8px; }
.vo-qty button { width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
.vo-qty strong { min-width: 24px; text-align: center; }

.vo-totals { display: flex; justify-content: space-between; align-items: baseline; }
.vo-total { font-size: 28px; }
.vo-change { margin: 0; font-weight: 700; }
.vo-empty { margin: 0; color: var(--color-text-muted, #55606e); }
.vo-error { margin: 0; color: var(--color-danger, #a3261d); font-weight: 700; }

.vo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.vo-actions button { min-height: 46px; }

.vo-receipt { display: flex; flex-direction: column; gap: 4px; }
.vo-receipt-title { font-size: 18px; }
.vo-receipt-code { font-size: 17px; overflow-wrap: anywhere; }
.vo-receipt-lines { margin: 8px 0; padding: 8px 0; border-top: 1px dashed var(--color-border-strong, #7b8594); border-bottom: 1px dashed var(--color-border-strong, #7b8594); }
.vo-receipt-line { display: flex; justify-content: space-between; gap: 12px; }
.vo-receipt-line span:first-child { overflow-wrap: anywhere; }

.vo-saved { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border, #d5d9e0); }
.vo-saved strong { overflow-wrap: anywhere; }
.vo-saved-state { color: var(--color-text-muted, #55606e); }
.vo-saved-state.is-review { color: var(--color-danger, #a3261d); font-weight: 600; }
.vo-saved button { align-self: flex-start; margin-top: 4px; min-height: 44px; }

@media print {
  body.vo-printing > *:not(.vo-dialog) { display: none !important; }
  body.vo-printing .vo-dialog {
    position: static;
    width: auto;
    max-height: none;
    border: 0;
    padding: 0;
    color: #000;
    background: #fff;
  }
  body.vo-printing .vo-head,
  body.vo-printing .vo-actions { display: none !important; }
}

/* La aplicación atenúa sus botones cuando no hay conexión. Estos son justo
   los que sí funcionan sin conexión. */
.vo-bar button:not(:disabled),
.vo-dialog button:not(:disabled) { opacity: 1 !important; }
