:root,
[data-st-theme="light"] {
  color-scheme: light;
  --st-primary: #2473de;
  --st-primary-hover: #1d4ed8;
  --st-primary-soft: #505bf929;
  --st-secondary: #063ea5;
  --st-secondary-hover: #0d3e81;
  --st-accent: #2473de;
  --st-accent-soft: #e0f2fe;
  --st-bg: #f4f7fb;
  --st-surface: #ffffff;
  --st-text: #1f2937;
  --st-muted: #a4b5d1;
  --st-border: #e5e7eb;
  --st-danger: #dc2626;
  --st-danger-soft: #fef2f2;
  --st-warning: #92400e;
  --st-warning-soft: #fffbeb;
  --st-on-strong: #ffffff;
  --st-overlay: rgba(15, 23, 42, 0.35);
  --st-radius: 12px;
  --st-radius-sm: 8px;
  --st-radius-pill: 999px;
  --st-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --st-sidebar-width: 248px;
  --st-sidebar-rail: 72px;
  --st-topbar-height: 64px;
  --st-font: "Segoe UI", system-ui, sans-serif;
}

[data-st-theme="dark"] {
  color-scheme: dark;
  --st-primary: #2473de;
  --st-primary-hover: #1d4ed8;
  --st-primary-soft: #3c4080;
  --st-secondary: #6b7280;
  --st-secondary-hover: #4b5563;
  --st-accent: #2473de;
  --st-accent-soft: #0c4a6e;
  --st-bg: #0f172a;
  --st-surface: #1e293b;
  --st-text: #e5e7eb;
  --st-muted: #94a3b8;
  --st-border: #334155;
  --st-danger: #f87171;
  --st-danger-soft: #3f1d1d;
  --st-warning: #fbbf24;
  --st-warning-soft: #422006;
  --st-on-strong: #ffffff;
  --st-overlay: rgba(0, 0, 0, 0.5);
  --st-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html {
  font-size: 15px;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--st-font);
  color: var(--st-text);
  background: var(--st-bg);
}

a {
  color: var(--st-accent);
  text-decoration: none;
}

a:hover {
  color: var(--st-primary);
}

.st-app {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  background: var(--st-bg);
}

.st-sidebar {
  width: var(--st-sidebar-width);
  background: var(--st-surface);
  border-right: 1px solid var(--st-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.2s ease, border-color 0.2s ease;
}

html[data-st-sidebar="collapsed"] .st-sidebar {
  width: var(--st-sidebar-rail);
}

html[data-st-sidebar="collapsed"] .st-brand {
  justify-content: center;
  padding-inline: 0;
}

html[data-st-sidebar="collapsed"] .st-brand-name,
html[data-st-sidebar="collapsed"] .st-side-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-st-sidebar="collapsed"] .st-side-nav {
  padding-inline: 8px;
}

html[data-st-sidebar="collapsed"] .st-side-nav a,
html[data-st-sidebar="collapsed"] .st-side-toggle {
  justify-content: center;
  padding-inline: 0;
}

html[data-st-sidebar="collapsed"] .st-side-sub,
html[data-st-sidebar="collapsed"] .st-side-chevron {
  display: none;
}

.st-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  color: var(--st-text);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.st-brand:hover {
  color: var(--st-text);
}

.st-brand-mark,
.st-brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.st-auth-brand .st-brand-logo {
  width: 40px;
  height: 40px;
}

.st-side-nav {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.st-side-nav a,
.st-side-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--st-radius-sm);
  background: transparent;
  color: var(--st-text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.st-side-nav a:hover,
.st-side-nav a.is-active,
.st-side-toggle:hover,
.st-side-toggle.is-active {
  background: var(--st-bg);
  color: var(--st-text);
}

.st-side-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 4px 12px;
}

.st-side-sub .st-side-icon,
.st-side-sub .st-side-icon svg {
  width: 16px;
  height: 16px;
}

.st-side-group:not([data-st-open="true"]) .st-side-sub {
  display: none;
}

.st-side-chevron {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--st-muted);
  border-bottom: 2px solid var(--st-muted);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.st-side-group[data-st-open="true"] .st-side-chevron {
  transform: rotate(-135deg);
}

.st-side-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--st-accent);
}

.st-side-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.st-side-nav a:hover .st-side-icon,
.st-side-nav a.is-active .st-side-icon,
.st-side-toggle:hover .st-side-icon,
.st-side-toggle.is-active .st-side-icon {
  color: var(--st-accent);
}

.st-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.st-topbar {
  height: var(--st-topbar-height);
  background: var(--st-surface);
  border-bottom: 1px solid var(--st-border);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--st-primary-soft) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
}

.st-topbar-left,
.st-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.st-topbar-right {
  margin-left: auto;
  flex-shrink: 0;
}

.st-topbar-toggle {
  border: 0;
  background: transparent;
  color: var(--st-text);
  width: 36px;
  height: 36px;
  border-radius: var(--st-radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.st-topbar-toggle:hover {
  background: var(--st-primary-soft);
  color: var(--st-primary);
}

.st-topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--st-border);
  flex-shrink: 0;
}

.st-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.st-topbar-logo-wrap {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: var(--st-radius-sm);
  background: var(--st-primary-soft);
  border: 1px solid color-mix(in srgb, var(--st-primary) 18%, var(--st-border));
  overflow: hidden;
}

.st-topbar-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.st-topbar-brand-text,
.st-topbar-branch {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.st-topbar-branch {
  flex: 0 1 auto;
  min-width: 10rem;
}

.st-topbar-brand-label {
  color: var(--st-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.st-topbar-company,
.st-topbar-branch-name {
  color: var(--st-text);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
  line-height: 1.2;
}

.st-topbar-branch-select,
select.st-topbar-branch-select {
  box-sizing: border-box;
  width: auto;
  min-width: 12rem;
  max-width: 18rem;
  height: auto;
  min-height: 36px;
  padding: 6px 2rem 6px 10px;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
  background-color: var(--st-bg);
  color: var(--st-text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: visible;
}

.st-topbar-branch-select option {
  color: var(--st-text);
  background-color: var(--st-surface);
}

.st-topbar-branch-static .st-topbar-branch-name {
  max-width: 12rem;
}

.st-topbar-action {
  height: 36px;
  padding-inline: 12px;
  border-radius: var(--st-radius-pill);
  font-size: 0.88rem;
}

.st-topbar-userchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 10px 4px 4px;
  border-radius: var(--st-radius-pill);
  background: var(--st-bg);
  border: 1px solid var(--st-border);
}

.st-topbar-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--st-secondary);
  color: var(--st-on-strong);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.st-topbar-user {
  color: var(--st-text);
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 28px 32px 40px;
}

.st-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.st-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.st-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--st-muted);
  font-size: 0.8rem;
}

.st-breadcrumb a {
  color: var(--st-muted);
}

.st-breadcrumb a:hover {
  color: var(--st-primary);
}

.st-page-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.st-page-subtitle {
  margin: 6px 0 0;
  color: var(--st-muted);
  font-size: 0.92rem;
}

.st-page-meta {
  margin: 4px 0 0;
  color: var(--st-muted);
  font-size: 0.85rem;
}

.st-tasa-panel {
  margin-bottom: 20px;
}

.st-alert a {
  color: inherit;
  font-weight: 600;
}

[data-st-costos] {
  display: contents;
}

[data-st-costos] input[type="hidden"] {
  display: none;
}

.st-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  padding: 20px;
}

.st-card-narrow {
  max-width: 480px;
}

.st-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.st-dashboard {
  display: grid;
  gap: 20px;
}

.st-dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

a.st-dashboard-kpi {
  color: var(--st-text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.st-dashboard-kpi:hover {
  border-color: var(--st-primary);
  color: var(--st-text);
}

.st-dashboard-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
}

.st-dashboard-kpi-alerta {
  border-color: color-mix(in srgb, var(--st-warning) 45%, var(--st-border));
  background: var(--st-warning-soft);
}

.st-dashboard-kpi-valor {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--st-text);
}

.st-dashboard-kpi-etiqueta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--st-text);
}

.st-dashboard-kpi-detalle {
  font-size: 0.82rem;
  color: var(--st-muted);
  margin-top: 2px;
}

.st-dashboard-paneles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.st-dashboard-panel .st-section-title {
  margin: 0 0 4px;
}

.st-dashboard-sub {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--st-muted);
  text-transform: capitalize;
}

.st-dashboard-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.st-dashboard-lista li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--st-radius-sm);
  background: color-mix(in srgb, var(--st-bg) 55%, var(--st-surface));
  border: 1px solid var(--st-border);
}

.st-dashboard-estado {
  font-weight: 600;
  font-size: 0.9rem;
}

.st-dashboard-cantidad {
  font-size: 0.85rem;
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.st-dashboard-nota {
  margin: 14px 0 0;
  font-size: 0.85rem;
}

.st-table [data-st-qty] {
  max-width: 5.5rem;
}

.st-caja-turno {
  margin-bottom: 20px;
}

.st-dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  border: none;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--st-primary) 88%, var(--st-text)) 0%,
    color-mix(in srgb, var(--st-accent-soft) 35%, var(--st-primary)) 100%
  );
  color: var(--st-on-strong);
  box-shadow: var(--st-shadow);
}

.st-dashboard-hero-title,
.st-dashboard-hero-text,
.st-dashboard-hero-score,
.st-dashboard-hero-score-sub {
  color: var(--st-on-strong);
}

.st-dashboard-hero-ring {
  --st-dash-pct: 0;
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 8px;
  background: conic-gradient(
    var(--st-on-strong) calc(var(--st-dash-pct) * 1%),
    color-mix(in srgb, var(--st-on-strong) 28%, transparent) 0
  );
}

.st-dashboard-hero-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--st-primary) 75%, var(--st-text));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.st-dashboard-hero-score {
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.st-dashboard-hero-score-sub {
  font-size: 0.72rem;
  opacity: 0.85;
}

.st-dashboard-hero-body {
  flex: 1;
  min-width: min(100%, 280px);
}

.st-dashboard-hero-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
}

.st-dashboard-hero-text {
  margin: 0 0 12px;
  font-size: 0.92rem;
  opacity: 0.92;
  max-width: 52rem;
}

.st-dashboard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-dashboard-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--st-radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--st-on-strong) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-on-strong) 22%, transparent);
}

a.st-dashboard-chip-link,
a.st-dashboard-chip-alerta {
  color: var(--st-on-strong);
  text-decoration: none;
}

a.st-dashboard-chip-link:hover,
a.st-dashboard-chip-alerta:hover {
  background: color-mix(in srgb, var(--st-on-strong) 24%, transparent);
  color: var(--st-on-strong);
}

.st-dashboard-chip-alerta {
  background: color-mix(in srgb, var(--st-warning) 35%, transparent);
  border-color: color-mix(in srgb, var(--st-on-strong) 30%, transparent);
}

.st-dashboard-kpi-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--st-radius-pill);
  margin-bottom: 4px;
  background: var(--st-primary-soft);
  color: var(--st-primary);
}

.st-dashboard-kpi-tag-productos {
  background: color-mix(in srgb, var(--st-accent) 18%, var(--st-surface));
  color: var(--st-accent);
}

.st-dashboard-kpi-tag-caja,
.st-dashboard-kpi-tag-devol {
  background: var(--st-warning-soft);
  color: var(--st-warning);
}

.st-dashboard-graficos {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.st-dashboard-panel-chart {
  grid-column: span 12;
}

@media (min-width: 900px) {
  .st-dashboard-panel-chart:not(.st-dashboard-panel-wide):not(.st-dashboard-panel-lista) {
    grid-column: span 4;
  }

  .st-dashboard-panel-lista {
    grid-column: span 4;
  }
}

.st-dashboard-panel-full {
  grid-column: span 12;
}

.st-dashboard-chart-wrap {
  position: relative;
  min-height: 220px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
}

@media (min-width: 520px) {
  .st-dashboard-chart-wrap:not(.st-dashboard-chart-wrap-bar) {
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.85fr);
  }
}

.st-dashboard-chart-wrap-bar {
  min-height: 200px;
  height: 220px;
}

.st-dashboard-leyenda {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
}

.st-dashboard-leyenda li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
}

.st-dashboard-leyenda-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.st-dashboard-leyenda-text {
  color: var(--st-text);
  font-weight: 600;
}

.st-dashboard-leyenda-qty {
  font-variant-numeric: tabular-nums;
  color: var(--st-muted);
}

.st-dashboard-vacio {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--st-muted);
}

.st-dashboard-pendientes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.st-dashboard-pendiente {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
  background: color-mix(in srgb, var(--st-bg) 50%, var(--st-surface));
  color: var(--st-text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.st-dashboard-pendiente:hover {
  border-color: var(--st-primary);
  color: var(--st-text);
}

.st-dashboard-pendiente-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.st-dashboard-pendiente-doc {
  font-weight: 700;
  font-size: 0.88rem;
}

.st-dashboard-pendiente-cliente {
  font-size: 0.82rem;
  color: var(--st-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-dashboard-pendiente-total {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.st-dashboard-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--st-radius-pill);
}

.st-dashboard-badge-atraso {
  background: var(--st-danger-soft);
  color: var(--st-danger);
}

.st-dashboard-badge-hoy {
  background: var(--st-warning-soft);
  color: var(--st-warning);
}

.st-dashboard-badge-plazo {
  background: var(--st-primary-soft);
  color: var(--st-primary);
}

.st-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--st-accent-soft);
  color: var(--st-accent);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}

a.st-card-link {
  display: block;
  color: var(--st-text);
  text-decoration: none;
}

a.st-card-link:hover {
  border-color: var(--st-primary);
  color: var(--st-text);

  margin: 0 0 6px;
  font-size: 1rem;
}

.st-card p {
  margin: 0;
  color: var(--st-muted);
  font-size: 0.9rem;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--st-radius-pill);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
}

.st-btn-primary {
  background: var(--st-primary);
  color: var(--st-on-strong);
}

.st-btn-primary:hover {
  background: var(--st-primary-hover);
  color: var(--st-on-strong);
}

.st-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.st-btn-secondary {
  background: var(--st-secondary);
  color: var(--st-on-strong);
}

.st-btn-secondary:hover {
  background: var(--st-secondary-hover);
  color: var(--st-on-strong);
}

.st-btn-ghost {
  background: transparent;
  color: var(--st-text);
  border: 1px solid var(--st-border);
}

.st-btn-danger {
  background: var(--st-danger);
  color: var(--st-on-strong);
}

a.st-btn {
  text-decoration: none;
}

.st-btn-outline {
  background: var(--st-primary-soft);
  color: var(--st-primary);
  border: 1px solid transparent;
}

.st-btn-outline:hover {
  background: var(--st-primary);
  color: var(--st-on-strong);
}

.st-btn-outline-danger {
  background: var(--st-danger-soft);
  color: var(--st-danger);
}

.st-btn-outline-danger:hover {
  background: var(--st-danger);
  color: var(--st-on-strong);
}

.st-btn-plus {
  font-size: 1.1rem;
  line-height: 1;
}

.st-card-form,
.st-card-form-wide,
.st-card-form-sheet,
.st-card-form-full,
.st-card.st-card-form.st-card-form-full {
  width: 100%;
  max-width: none;
  padding: 28px 28px 20px;
  container-type: inline-size;
  container-name: st-doc-form;
}

.st-btn-icon {
  padding: 6px;
  line-height: 0;
}

.st-compra-grid-bar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.st-table.st-compra-table th,
.st-table.st-compra-table td {
  padding: 8px;
  vertical-align: middle;
}

.st-compra-table .st-input {
  min-width: 4.5rem;
}

.st-compra-num {
  width: 2rem;
  color: var(--st-muted);
}

.st-input-num,
.st-compra-money {
  text-align: right;
}

.st-compra-accion {
  width: 2.5rem;
  text-align: right;
  white-space: nowrap;
}

[data-st-inventario-moto="true"] .st-compra-accion {
  width: auto;
}

[data-st-inventario-moto="true"] .st-compra-accion [data-st-moto-abrir] {
  margin-right: 4px;
  padding: 6px 8px;
  line-height: 1.2;
  font-size: 0.75rem;
}

.st-compra-help {
  margin: 8px 0 16px;
  color: var(--st-muted);
  font-size: 0.85rem;
}

.st-compra-totales {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 12px;
}

.st-compra-totales .st-input {
  background: var(--st-bg);
}

.st-doc-totales {
  width: min(280px, 100%);
  margin: 4px 0 0 auto;
}

.st-doc-totales > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 7px 0;
  border-bottom: 1px solid var(--st-border);
}

.st-doc-totales dt,
.st-doc-totales dd {
  margin: 0;
}

.st-doc-totales dt {
  color: var(--st-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.st-doc-totales dd {
  color: var(--st-text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.st-doc-totales > .st-doc-totales-total {
  margin-top: 4px;
  padding-top: 10px;
  border-bottom: none;
}

.st-doc-totales > .st-doc-totales-total dt,
.st-doc-totales > .st-doc-totales-total dd {
  color: var(--st-text);
  font-size: 1.05rem;
  font-weight: 700;
}

.st-modal[hidden] {
  display: none;
}

.st-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.st-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: var(--st-overlay);
  cursor: pointer;
}

.st-modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(72vh, 640px);
  overflow: auto;
  background: var(--st-surface);
  color: var(--st-text);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  padding: 20px;
}

.st-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.st-modal-head .st-section-title {
  margin: 0;
}

.st-catalogo-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-catalogo-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.st-catalogo-item:hover {
  border-color: var(--st-primary);
}

.st-catalogo-item small {
  color: var(--st-muted);
}

.st-existencia {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.st-existencia-baja {
  color: var(--st-danger);
  font-weight: 600;
}

.st-existencia-lista {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  color: var(--st-text);
  font-size: 0.85rem;
  line-height: 1.3;
}

.st-existencias-pop {
  position: fixed;
  z-index: 45;
  width: min(320px, calc(100vw - 16px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  box-shadow: var(--st-shadow);
}

.st-existencias-pop[hidden] {
  display: none;
}

.st-existencias-pop-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.st-existencias-pop-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-existencias-pop-lista {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.st-existencias-pop-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--st-border);
  font-size: 0.9rem;
}

.st-existencias-pop-fila:last-child {
  border-bottom: 0;
}

.st-existencias-pop-fila strong {
  font-variant-numeric: tabular-nums;
}

.st-existencias-pop-vacio {
  margin: 0;
  color: var(--st-muted);
  font-size: 0.9rem;
}

.st-catalogo-vacio {
  margin: 0;
  color: var(--st-muted);
}

.st-buscador-panel {
  width: min(960px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 16px;
}

.st-buscador-titulo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.st-buscador-icono {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--st-radius-sm);
  background: var(--st-primary-soft);
  color: var(--st-primary);
  flex: 0 0 auto;
}

.st-buscador-icono svg {
  width: 1.25rem;
  height: 1.25rem;
}

.st-buscador-paso {
  margin: 2px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.st-buscador-filtros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 12px;
}

.st-buscador-filtro {
  margin: 0;
}

.st-buscador-filtro span {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.st-buscador-filtro-general {
  grid-column: 1 / -1;
}

.st-buscador-tabla-wrap {
  min-height: 180px;
  max-height: min(48vh, 420px);
  overflow: auto;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
}

.st-buscador-tabla {
  margin: 0;
}

.st-buscador-tabla thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--st-surface);
}

.st-buscador-col-accion {
  width: 3.25rem;
  text-align: right;
}

.st-buscador-seleccionar {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--st-primary);
  color: var(--st-on-strong);
  cursor: pointer;
}

.st-buscador-seleccionar:hover {
  background: var(--st-primary-hover);
}

.st-buscador-fila-seleccionable {
  cursor: pointer;
  user-select: none;
}

.st-buscador-fila-seleccionable:hover td {
  background: var(--st-bg);
}

.st-buscador-fila-seleccionable.is-seleccionada td {
  background: var(--st-primary-soft);
}

.st-buscador-fila-seleccionable.is-seleccionada .st-buscador-seleccionar {
  background: var(--st-primary-hover);
}

.st-buscador-seleccionar svg {
  width: 1rem;
  height: 1rem;
}

.st-buscador-vacio {
  margin: 16px;
  color: var(--st-muted);
}

.st-buscador-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.st-buscador-pie-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.st-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.st-picker-acciones {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.st-categoria-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 1.5rem;
}

.st-categoria-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px 4px 10px;
  border-radius: var(--st-radius);
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-text);
  font-size: 0.875rem;
}

.st-categoria-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-categoria-chip-quitar {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--st-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
}

.st-categoria-chip-quitar:hover {
  color: var(--st-danger);
}

.st-categoria-arbol-card {
  padding: 16px 18px 20px;
}

.st-categoria-arbol-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 16px;
}

.st-categoria-arbol-buscar {
  flex: 1 1 220px;
  margin-bottom: 0;
}

.st-categoria-arbol-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-categoria-arbol,
.st-categoria-hijos {
  list-style: none;
  margin: 0;
  padding: 0;
}

.st-categoria-hijos {
  margin-left: 1.15rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--st-border);
}

.st-categoria-hijos.is-collapsed {
  display: none;
}

.st-categoria-nodo {
  margin: 0;
}

.st-categoria-nodo-fila {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--st-radius-sm);
  border: 1px solid transparent;
}

.st-categoria-nodo-fila:hover {
  background: color-mix(in srgb, var(--st-primary) 6%, var(--st-surface));
  border-color: var(--st-border);
}

.st-categoria-nodo.is-match > .st-categoria-nodo-fila {
  background: color-mix(in srgb, var(--st-primary) 10%, var(--st-surface));
  border-color: color-mix(in srgb, var(--st-primary) 35%, var(--st-border));
}

.st-categoria-nodo-toggle,
.st-categoria-nodo-hoja {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.st-categoria-nodo-toggle {
  appearance: none;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-muted);
  cursor: pointer;
  padding: 0;
}

.st-categoria-nodo-toggle::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
  transform: rotate(0deg);
  transition: transform 0.12s ease;
}

.st-categoria-nodo-toggle.is-open::before {
  transform: rotate(90deg);
}

.st-categoria-nodo-hoja::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--st-border);
}

.st-categoria-nodo-texto {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.st-categoria-nodo-nombre {
  font-weight: 600;
  color: var(--st-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-categoria-nodo-ruta {
  font-size: 0.78rem;
  color: var(--st-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-categoria-nodo-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.st-categoria-arbol-vacio {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .st-categoria-nodo-fila {
    grid-template-columns: 1.5rem minmax(0, 1fr);
  }

  .st-categoria-nodo-acciones {
    grid-column: 2;
    justify-content: flex-start;
  }
}

.st-picker .st-input[readonly] {
  cursor: pointer;
  background: var(--st-surface);
}

.st-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  column-gap: 16px;
}

/* Cabecera documento (compra, cotización, venta): grid denso según ancho del formulario */
.st-doc-cabecera {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
}

.st-doc-cabecera .st-field {
  margin-bottom: 0;
}

@container st-doc-form (min-width: 900px) {
  .st-doc-cabecera {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container st-doc-form (min-width: 1200px) {
  .st-doc-cabecera {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.st-field-wide {
  grid-column: 1 / -1;
}

.st-precio-panel {
  margin-top: 4px;
  padding: 16px 18px;
  background: var(--st-bg);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
}

.st-precio-panel-head .st-section-title {
  margin: 0 0 4px;
}

.st-precio-panel-head .st-page-meta {
  margin: 0 0 14px;
}

.st-precio-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.st-precio-pair .st-field {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .st-precio-pair {
    grid-template-columns: 1fr;
  }
}

fieldset.st-field {
  border: 0;
  padding: 0;
  min-width: 0;
}

.st-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}

.st-field > span,
.st-field > label,
.st-label {
  font-size: 0.85rem;
  color: var(--st-text);
}

.st-input,
.st-select,
input.st-input,
select.st-select,
.form-control,
.form-select {
  width: 100%;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 8px 12px;
  background: var(--st-surface);
  color: var(--st-text);
  font: inherit;
}

.st-input:focus,
.st-select:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--st-accent);
  outline-offset: 1px;
  box-shadow: none;
  border-color: var(--st-accent);
}

.st-input-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.st-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--st-border);
}

.st-table-wrap {
  width: 100%;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
}

.st-table-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 18px 6px;
}

.st-table-search {
  margin: 0;
  flex: 1;
  max-width: 420px;
  min-width: 0;
}

.st-table-range {
  margin: 0;
  width: 190px;
}

.st-table-filter {
  margin: 0;
  min-width: 160px;
  max-width: 220px;
}

.st-table-search > span,
.st-table-range > span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.st-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 18px 16px;
}

.st-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: var(--st-surface);
  color: var(--st-text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.st-pager-btn.is-current {
  background: var(--st-primary);
  border-color: var(--st-primary);
  color: var(--st-on-strong);
}

.st-pager-gap {
  color: var(--st-muted);
  padding: 0 4px;
}

.st-fecha {
  position: relative;
  display: block;
  width: 100%;
}

.st-fecha .st-input {
  padding-right: 40px;
}

.st-fecha-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--st-radius-sm);
  background: transparent;
  color: var(--st-muted);
  cursor: pointer;
}

.st-fecha-btn:hover {
  color: var(--st-primary);
  background: var(--st-primary-soft);
}

.st-datepicker {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  padding: 12px;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
}

.st-datepicker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.st-datepicker-titulo {
  flex: 1;
  text-align: center;
  font-weight: 600;
  color: var(--st-text);
}

.st-datepicker-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  cursor: pointer;
}

.st-datepicker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.st-datepicker-dow {
  text-align: center;
  font-size: 0.72rem;
  color: var(--st-muted);
  padding: 4px 0;
}

.st-datepicker-dia {
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--st-radius-sm);
  background: transparent;
  color: var(--st-text);
  cursor: pointer;
}

.st-datepicker-dia:hover {
  background: var(--st-primary-soft);
}

.st-datepicker-dia.is-fuera {
  color: var(--st-muted);
}

.st-datepicker-dia.is-hoy {
  border-color: var(--st-primary);
}

.st-datepicker-dia.is-sel,
.st-datepicker-dia.is-sel:hover {
  background: var(--st-primary);
  border-color: var(--st-primary);
  color: var(--st-on-strong);
}

.st-datepicker-hoy {
  width: 100%;
  margin-top: 8px;
  height: 32px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-primary);
  cursor: pointer;
}

.st-table-scroll {
  overflow-x: auto;
}

.st-table {
  width: 100%;
  border-collapse: collapse;
}

.st-table th,
.st-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--st-border);
  text-align: left;
  font-size: 0.92rem;
  vertical-align: middle;
}

.st-table th {
  color: var(--st-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.st-table-empty td {
  text-align: center;
  color: var(--st-muted);
  padding: 36px 14px;
}

.st-table-actions {
  text-align: right;
  white-space: nowrap;
}

.st-table-actions .st-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.st-table-actions .st-btn + .st-btn {
  margin-left: 8px;
}

.st-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--st-radius-pill);
  background: var(--st-primary-soft);
  color: var(--st-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.st-table tr.is-hidden {
  display: none;
}


.st-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--st-bg);
}

.st-auth-card {
  width: min(420px, 100%);
}

.st-auth-card-wide {
  width: min(480px, 100%);
}

.st-auth-panel {
  padding: 36px 32px 28px;
  text-align: center;
}

.st-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--st-text);
}

.st-auth-kicker {
  margin: 0 0 8px;
  color: var(--st-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.st-auth-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
}

.st-auth-form {
  text-align: left;
  margin-top: 24px;
}

.st-empresa-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
}

.st-empresa-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: var(--st-surface);
  color: var(--st-text);
  cursor: pointer;
  text-align: left;
}

.st-empresa-item:hover {
  border-color: var(--st-primary);
  background: var(--st-accent-soft);
}

.st-empresa-item:has(input:focus-visible) {
  outline: 2px solid var(--st-primary);
  outline-offset: 2px;
}

.st-empresa-item:has(input:checked) {
  border-color: var(--st-primary);
  background: var(--st-accent-soft);
  box-shadow: 0 0 0 2px var(--st-primary-soft);
}

.st-empresa-item input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--st-primary);
}

.st-empresa-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--st-radius-sm);
  background: var(--st-primary);
  color: var(--st-on-strong);
  font-size: 0.95rem;
  font-weight: 700;
}

.st-empresa-nombre {
  font-weight: 600;
  line-height: 1.3;
}

.st-btn-block {
  width: 100%;
  padding: 12px 16px;
  margin-top: 4px;
}

.st-auth-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--st-primary);
  font-size: 0.9rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.st-auth-link:hover {
  color: var(--st-primary-hover);
}

.st-auth-link:disabled {
  color: var(--st-muted);
  cursor: default;
}

.st-mfa-digits {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 18px;
}

.st-mfa-digit {
  width: 48px;
  height: 56px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--st-text);
  background: var(--st-surface);
}

.st-mfa-digit:focus {
  outline: 2px solid var(--st-primary);
  outline-offset: 1px;
  border-color: var(--st-primary);
}

.st-mfa-digits.is-error .st-mfa-digit {
  border-color: var(--st-danger);
}

.st-mfa-digit.is-ok {
  border-color: var(--st-primary);
  background: var(--st-primary-soft);
  color: var(--st-primary);
}

.st-mfa-ok {
  color: var(--st-primary);
  font-size: 0.9rem;
  text-align: center;
  margin: -8px 0 12px;
}

.st-mfa-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--st-muted);
  font-size: 0.85rem;
}

.st-mfa-hint {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--st-border);
  color: var(--st-muted);
  font-size: 0.8rem;
}

.st-mfa-resend {
  margin-top: 0;
}

.st-alert {
  border-radius: var(--st-radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.st-alert-danger {
  background: var(--st-danger-soft);
  color: var(--st-danger);
}

.validation-summary-valid {
  display: none;
}

.st-alert-warning {
  background: var(--st-warning-soft);
  color: var(--st-warning);
}

.st-alert-ok {
  background: var(--st-accent-soft);
  color: var(--st-primary);
}

.st-theme-icon-sun {
  display: none;
}

[data-st-theme="dark"] .st-theme-icon-moon {
  display: none;
}

[data-st-theme="dark"] .st-theme-icon-sun {
  display: block;
}

.st-swal {
  background: var(--st-surface) !important;
  border-radius: var(--st-radius) !important;
  font-family: var(--st-font);
  color: var(--st-text);
}

.st-swal-title {
  color: var(--st-text) !important;
  font-size: 1.2rem !important;
}

.st-swal-text {
  color: var(--st-muted) !important;
}

.st-swal-actions {
  gap: 10px !important;
}

.st-section-title {
  margin: 8px 0 12px;
  font-size: 1rem;
}

.st-section-title.st-section-follow,
.st-alert.st-section-follow,
.st-card.st-section-follow,
.st-section-follow {
  margin-top: 28px;
}

.st-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--st-border);
  overflow-x: auto;
}

.st-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 14px;
  color: var(--st-muted);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.st-tab:hover {
  color: var(--st-text);
}

.st-tab.is-active {
  color: var(--st-primary);
  border-bottom-color: var(--st-primary);
}

.st-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.st-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--st-text);
}

.st-field .st-checks {
  margin-bottom: 0;
}

.st-permiso-grupo {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 12px 14px 4px;
  margin-bottom: 12px;
}

.st-permiso-grupo legend {
  padding: 0 6px;
  color: var(--st-text);
  font-size: 0.9rem;
  cursor: pointer;
}

.st-btn-sm {
  padding: 4px 10px;
  font-size: 0.82rem;
}

.st-permisos {
  display: grid;
  gap: 16px;
}

.st-permisos-filtros {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(140px, 0.8fr)) auto;
  gap: 12px 14px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-primary-soft);
}

.st-permisos-resumen {
  color: var(--st-muted);
  font-size: 0.85rem;
  padding-bottom: 8px;
  white-space: nowrap;
}

.st-permisos-lista {
  display: grid;
  gap: 14px;
}

.st-permisos-menu {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: var(--st-surface);
  overflow: hidden;
}

.st-permisos-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--st-border);
  background: color-mix(in srgb, var(--st-bg) 70%, var(--st-surface));
}

.st-permisos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--st-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.st-permisos-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--st-muted);
  border-bottom: 2px solid var(--st-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}

.st-permisos-menu[data-st-open="false"] > .st-permisos-menu-head .st-permisos-chevron {
  transform: rotate(-45deg);
}

.st-permisos-menu[data-st-open="false"] > .st-permisos-modulos {
  display: none;
}

.st-permisos-modulos {
  display: grid;
  gap: 0;
}

.st-permisos-modulo {
  border-top: 1px solid var(--st-border);
}

.st-permisos-modulo:first-child {
  border-top: 0;
}

.st-permisos-modulo-head {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  padding: 10px 14px 10px 28px;
  background: color-mix(in srgb, var(--st-bg) 40%, var(--st-surface));
}

.st-permisos-toggle-modulo {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.st-permisos-menu-check {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--st-muted);
}

.st-permisos-modulo-nombre {
  font-weight: 600;
  color: var(--st-text);
}

.st-permisos-modulo-recurso {
  color: var(--st-muted);
  font-size: 0.85rem;
}

.st-permisos-modulo-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--st-radius-sm);
  background: var(--st-accent-soft);
  color: var(--st-text);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.st-permisos-modulo[data-st-estado="con"] .st-permisos-modulo-tag {
  background: var(--st-primary-soft);
}

.st-permisos-modulo[data-st-estado="sin"] .st-permisos-modulo-tag {
  background: var(--st-bg);
  color: var(--st-muted);
}

.st-permisos-modulo[data-st-open="false"] > .st-permisos-modulo-head .st-permisos-chevron {
  transform: rotate(-45deg);
}

.st-permisos-modulo[data-st-open="false"] > .st-permisos-modulo-body {
  display: none;
}

.st-permisos-modulo-body {
  padding: 0 14px 12px 48px;
}

.st-permisos-nivel-acciones {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
}

.st-permisos-nivel-label {
  color: var(--st-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.st-permisos-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.st-permisos-accion {
  min-width: 5.5rem;
}

.st-permisos-sin-acciones,
.st-permisos-vacio {
  margin: 0;
  color: var(--st-muted);
  font-size: 0.88rem;
}

.st-asignacion {
  display: grid;
  gap: 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--st-border);
}

.st-asignacion:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.st-asignacion-items {
  display: grid;
  gap: 0;
}

.st-asignacion-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px 12px 28px;
  border-top: 1px solid var(--st-border);
}

.st-asignacion-item:first-child {
  border-top: 0;
}

.st-asignacion-item input {
  margin-top: 3px;
}

.st-asignacion-texto {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.st-asignacion-nombre {
  color: var(--st-text);
  font-weight: 600;
}

.st-asignacion-meta {
  color: var(--st-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.st-asignacion-item[data-st-asignado="con"] {
  background: color-mix(in srgb, var(--st-primary-soft) 45%, var(--st-surface));
}

@media (max-width: 900px) {
  .st-permisos-filtros {
    grid-template-columns: 1fr;
  }

  .st-permisos-resumen {
    white-space: normal;
    padding-bottom: 0;
  }
}

.st-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .st-sidebar {
    position: fixed;
    z-index: 20;
    width: var(--st-sidebar-width);
    border-right: 1px solid var(--st-border);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  html[data-st-sidebar="collapsed"] .st-sidebar,
  html[data-st-sidebar="open"] .st-sidebar {
    width: var(--st-sidebar-width);
    border-right-color: var(--st-border);
  }

  html[data-st-sidebar="open"] .st-sidebar {
    transform: translateX(0);
  }

  .st-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    border: 0;
    padding: 0;
    background: var(--st-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  html[data-st-sidebar="open"] .st-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .st-topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--st-topbar-height);
    padding: 10px 16px;
    gap: 10px;
  }

  .st-topbar-left {
    flex: 1 1 auto;
  }

  .st-topbar-company,
  .st-topbar-branch-name {
    max-width: 9rem;
  }

  .st-topbar-branch {
    min-width: 8.5rem;
  }

  .st-topbar-branch-select,
  select.st-topbar-branch-select {
    min-width: 8.5rem;
    max-width: 12rem;
  }

  .st-topbar-action {
    padding-inline: 10px;
  }

  .st-topbar-user {
    display: none;
  }

  .st-topbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .st-content {
    padding: 20px 16px 32px;
  }

  .st-page-header {
    flex-direction: column;
  }

  .st-page-title {
    font-size: 1.5rem;
  }

  .st-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .st-table-search,
  .st-table-range,
  .st-table-filter {
    max-width: none;
    width: 100%;
  }

  .st-doc-cabecera {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .st-form-actions {
    flex-direction: column-reverse;
  }

  .st-form-actions .st-btn {
    width: 100%;
  }

  .st-card-form,
  .st-card-form-wide,
  .st-card-form-sheet,
  .st-card-form-full {
    padding: 20px 16px 16px;
  }

}

.st-print-only {
  display: none;
}

.st-factura {
  position: relative;
  background: var(--st-surface);
  color: var(--st-text);
  margin: 0 auto 24px;
  padding: 24px;
  overflow: hidden;
}

.st-factura-carta {
  max-width: 760px;
}

.st-factura-ticket {
  max-width: 80mm;
  padding: 8px;
  font-size: 0.78rem;
}

.st-factura-empresa {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 8px;
}

.st-factura-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}

.st-factura-ticket .st-factura-logo {
  width: 48px;
  height: 48px;
}

.st-factura-empresa-datos {
  min-width: 0;
  color: var(--st-text);
  font-weight: 700;
}

.st-factura-meta,
.st-factura-cliente,
.st-factura-nota {
  margin: 0 0 8px;
  color: var(--st-text);
  font-weight: 700;
}

.st-factura-pie {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--st-border);
  text-align: center;
}

.st-factura-pie-texto,
.st-factura-pie-auth {
  margin: 0 0 4px;
  color: var(--st-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.st-factura-ticket .st-factura-pie-texto,
.st-factura-ticket .st-factura-pie-auth {
  font-size: 0.72rem;
}

.st-empresa-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 220px;
  height: 110px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px dashed var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-bg);
  overflow: hidden;
}

.st-empresa-logo-preview-dark {
  border-style: solid;
  background: var(--st-text);
}

.st-empresa-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.st-factura-titulo {
  margin: 12px 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--st-text);
}

.st-factura-ticket .st-factura-titulo {
  font-size: 0.95rem;
}

.st-factura-lineas {
  width: 100%;
  margin: 12px 0;
}

.st-factura-lineas th,
.st-factura-lineas td {
  color: var(--st-text);
  font-weight: 700;
}

.st-factura-totales {
  margin: 0;
}

.st-factura-totales div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.st-factura-totales dt,
.st-factura-totales dd {
  margin: 0;
  color: var(--st-text);
  font-weight: 700;
}

.st-factura-copia::before {
  content: "COPIA";
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--st-muted);
  opacity: 0.35;
  pointer-events: none;
}

.st-factura-ticket.st-factura-copia::before {
  font-size: 2rem;
}

/* Formato MotoGigante: encabezado en dos columnas, datos del cliente, tabla y totales. */
.st-factura-moto {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.st-factura-moto .st-moto {
  margin: 0;
}

.st-moto {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 216mm;
  max-width: 100%;
  min-height: 279mm;
  margin: 0 auto 24px;
  padding: 10mm;
  background: var(--st-surface);
  color: var(--st-text);
  font-size: 0.9rem;
}

.st-moto-bottom {
  margin-top: auto;
  padding-top: 12px;
}

.st-moto-cabecera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--st-primary);
}

.st-moto-emisor {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  color: var(--st-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.st-moto-emisor-datos {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.st-moto-logo {
  flex: 0 0 auto;
  width: 120px;
  max-height: 68px;
  object-fit: contain;
  object-position: left top;
}

.st-moto-razon {
  color: var(--st-text);
  font-size: 1rem;
  font-weight: 700;
}

.st-moto-documento {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  font-size: 0.82rem;
}

.st-moto-tipo {
  color: var(--st-text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.st-moto-serie,
.st-moto-ruc,
.st-moto-fecha {
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-numero {
  font-size: 1rem;
  font-weight: 700;
  color: var(--st-text);
}

.st-moto-datos {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.st-moto-datos th,
.st-moto-datos td {
  padding: 4px 6px;
  border: 1px solid var(--st-border);
  text-align: left;
  vertical-align: top;
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-datos th {
  width: 1%;
  color: var(--st-text);
  font-weight: 700;
  white-space: nowrap;
  background: var(--st-bg);
}

.st-moto-cuerpo {
  display: block;
  width: 100%;
}

.st-moto-lineas {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.st-moto-lineas th,
.st-moto-lineas td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--st-border);
  text-align: left;
  vertical-align: top;
}

.st-moto-lineas thead th {
  border-top: 1px solid var(--st-border);
  border-bottom: 1px solid var(--st-border);
  color: var(--st-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--st-bg);
  text-align: left;
}

.st-moto-lineas thead th.st-moto-col-cantidad {
  text-align: center;
}

.st-moto-lineas thead th.st-moto-col-monto {
  text-align: right;
}

.st-moto-lineas tbody td {
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-lineas tbody td.st-moto-col-monto {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.st-moto-lineas tbody td.st-moto-col-cantidad {
  text-align: center;
}

.st-moto-col-codigo {
  width: 14%;
  white-space: nowrap;
}

.st-moto-col-cantidad {
  width: 10%;
  text-align: center;
}

.st-moto-col-descripcion {
  width: auto;
}

.st-moto-col-monto {
  width: 18%;
  text-align: right;
  white-space: nowrap;
}

.st-moto-producto,
.st-moto-marca,
.st-moto-descuento-linea {
  display: block;
}

.st-moto-marca {
  color: var(--st-text);
  font-size: 0.76rem;
  font-weight: 700;
}

.st-moto-vin {
  display: block;
  color: var(--st-text);
  font-size: 0.74rem;
}

.st-moto-ficha {
  display: grid;
  gap: 2px 12px;
  margin: 8px 0 4px;
  max-width: 22rem;
}

.st-moto-ficha > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.st-moto-ficha dt {
  margin: 0;
  color: var(--st-text);
  font-size: 0.76rem;
  font-weight: 700;
}

.st-moto-ficha dd {
  margin: 0;
  color: var(--st-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.st-moto-constancia {
  display: block;
  margin: 8px 0 0;
  max-width: 42rem;
  color: var(--st-text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

[data-st-inventario-moto="false"] [data-st-moto-abrir],
[data-st-es-venta="false"] [data-st-moto-abrir],
[data-st-linea][data-st-es-moto="false"] [data-st-moto-abrir] {
  display: none;
}

.st-moto-descuento-linea {
  color: var(--st-text);
  font-size: 0.75rem;
  font-weight: 700;
}

.st-moto-totales {
  box-sizing: border-box;
  width: 280px;
  max-width: 100%;
  margin: 10px 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--st-border);
  border-radius: 6px;
  font-size: 0.82rem;
  break-inside: avoid;
  page-break-inside: avoid;
}

.st-moto-totales div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}

.st-moto-totales dt,
.st-moto-totales dd {
  margin: 0;
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-gran-total {
  margin-top: 4px;
  padding-top: 6px !important;
  border-top: 1px solid var(--st-border);
}

.st-moto-gran-total dt,
.st-moto-gran-total dd {
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-pie-datos {
  margin-top: 14px;
}

.st-moto-notas {
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--st-text);
  font-size: 0.76rem;
  font-weight: 700;
}

.st-moto-notas li {
  margin-bottom: 2px;
}

.st-moto-auth {
  margin: 0;
  color: var(--st-text);
  font-size: 0.76rem;
  font-weight: 700;
}

/* Número de autorización de la DGI: parte inferior derecha de la factura. */
.st-moto-auth-dgi {
  margin: 10px 0 0;
  align-self: flex-end;
  text-align: right;
  color: var(--st-text);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Marca de documento anulado, sobre la factura impresa. */
.st-moto-anulada {
  position: absolute;
  top: 38%;
  left: 50%;
  z-index: 2;
  padding: 4px 28px;
  border: 6px solid var(--st-danger);
  border-radius: var(--st-radius-sm);
  color: var(--st-danger);
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.1;
  opacity: 0.35;
  transform: translate(-50%, -50%) rotate(-25deg);
  pointer-events: none;
  white-space: nowrap;
}

.st-moto-firmas {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem);
  justify-content: end;
  gap: 16px;
  margin-top: 26px;
}

.st-moto-firmas div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.st-moto-firma-linea {
  display: block;
  height: 1px;
  border-top: 1px solid var(--st-text);
}

.st-moto-firma-texto {
  color: var(--st-text);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.st-moto-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--st-border);
  color: var(--st-text);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.st-moto-recibo-cuerpo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0 8px;
}

.st-moto-recibo-fila,
.st-moto-recibo-montos {
  display: grid;
  gap: 8px 16px;
  align-items: baseline;
}

.st-moto-recibo-fila {
  grid-template-columns: 8.5rem minmax(0, 1fr);
}

.st-moto-recibo-montos {
  grid-template-columns: minmax(0, 1fr);
}

.st-moto-recibo-montos > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.st-moto-recibo-cuerpo dt {
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-recibo-cuerpo dd {
  margin: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--st-border);
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-recibo-pagos {
  margin-top: 18px;
}

.st-moto-recibo-pagos p,
.st-moto-recibo-pagos li,
.st-moto-recibo-ref {
  margin: 0 0 8px;
  color: var(--st-text);
  font-weight: 700;
}

.st-moto-recibo-pagos ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.st-moto-recibo-pagos li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.st-moto-recibo-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  border: 1px solid var(--st-text);
  color: var(--st-text);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.st-moto-recibo-check.is-on::after {
  content: "X";
}

.st-moto-recibo-otro {
  min-width: 12rem;
}

.st-moto-recibo-linea {
  display: inline-block;
  min-width: 8rem;
  margin-left: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--st-text);
}

.st-moto-recibo-ref {
  font-weight: 700;
}

.st-caja-calculo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.st-caja-calculo-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--st-border);
  border-radius: 8px;
  background: var(--st-surface);
}

.st-caja-calculo-item span {
  color: var(--st-muted);
  font-size: 0.8rem;
}

.st-caja-calculo-item strong {
  font-size: 1.15rem;
}

.st-caja-calculo-falta {
  background: var(--st-warning-soft);
  border-color: color-mix(in srgb, var(--st-warning) 45%, var(--st-border));
}

.st-caja-calculo-sobra {
  background: var(--st-danger-soft);
  border-color: color-mix(in srgb, var(--st-danger) 45%, var(--st-border));
}

.st-caja-calculo-listo {
  background: var(--st-surface);
  border-color: var(--st-border);
}

@media screen and (max-width: 760px) {
  .st-moto-cabecera {
    flex-direction: column;
  }

  .st-moto-documento {
    align-items: flex-start;
    text-align: left;
  }

  .st-moto-totales {
    width: 100%;
  }

  .st-moto-firmas {
    grid-template-columns: minmax(10rem, 14rem);
    justify-content: end;
    gap: 22px;
  }
}

@media print {
  @page {
    margin: 0;
  }

  .st-factura-copia::before {
    display: none;
  }

  .st-factura,
  .st-moto {
    color: var(--st-text);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .st-moto-anulada {
    color: var(--st-danger);
    border-color: var(--st-danger);
    opacity: 0.85;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .st-moto-cabecera {
    flex-direction: row;
  }

  .st-moto-firmas {
    grid-template-columns: minmax(10rem, 14rem);
    justify-content: end;
  }

  .st-sidebar,
  .st-sidebar-backdrop,
  .st-topbar,
  .st-print-hide,
  .st-table-toolbar,
  .st-pager,
  .st-table-actions {
    display: none !important;
  }

  .st-print-only {
    display: block;
    margin: 0 0 12px;
    color: var(--st-text);
  }

  .st-app {
    display: block;
    background: var(--st-surface);
  }

  .st-main,
  .st-content {
    margin: 0;
    padding: 10mm;
    width: 100%;
  }

  .st-content:has(.st-factura-moto) {
    padding: 0;
  }

  .st-card {
    box-shadow: none;
  }

  .st-factura {
    box-shadow: none;
    margin: 0;
    padding: 0;
    break-after: page;
    page-break-after: always;
  }

  .st-factura:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .st-moto {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-height: 256mm;
    margin: 0;
    padding: 0;
    overflow: visible;
    box-shadow: none;
  }

  .st-moto-bottom {
    margin-top: auto;
  }

  .st-moto-totales {
    width: 72mm;
    max-width: 100%;
    margin-left: auto;
  }

  .st-moto-lineas tr,
  .st-moto-totales,
  .st-moto-firmas {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .st-moto-lineas thead th,
  .st-moto-datos th {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .st-factura-copia::before {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.st-moto-vin-panel {
  width: min(920px, 100%);
  max-height: min(80vh, 760px);
}

.st-moto-captura {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--st-border);
}

.st-moto-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.st-moto-excel {
  margin: 12px 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--st-border);
}

.st-moto-excel-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.st-moto-excel-file {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
