:root {
  --rosa: #F8E8EE;
  --rosa-hover: #F0D0DC;
  --rosa-deep: #E8B4C8;
  --vino: #8B2252;
  --vino-light: #A0365F;
  --dorado: #C9A84C;
  --dorado-light: #E5CC7A;
  --blanco: #FFFAF5;
  --gris-suave: #F5F0EB;
  --texto: #3D2B2B;
  --texto-light: #7A6565;
  --verde: #4CAF50;
  --amarillo: #FFC107;
  --rojo: #E53935;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --surface-shadow: 0 2px 10px rgba(139, 34, 82, 0.07);
  --surface-shadow-hover: 0 6px 18px rgba(139, 34, 82, 0.1);
  --control-height: 42px;
  --card-padding: 20px;
  --section-gap: 16px;
  --page-frame-gutter-x: clamp(18px, 2.2vw, 32px);
  --sidebar-rail-width: 72px;
}

* {
  box-sizing: border-box;
}

.ti,
.material-symbols-sharp,
.lucide {
  display: inline-block;
  flex: 0 0 auto;
  line-height: 1;
}

.material-symbols-sharp {
  font-size: 1.2em;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  vertical-align: -0.18em;
}

.lucide {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  vertical-align: -0.16em;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(232, 180, 200, 0.12), transparent 26%),
    linear-gradient(180deg, #fffdfa 0%, #fff7fa 100%);
  color: var(--texto);
  font-family: 'Nunito', sans-serif;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: 'Playfair Display', serif;
  color: var(--texto);
  margin-top: 0;
}

.layout-wrapper {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 252px, rgba(255, 255, 255, 0.35) 252px, rgba(255, 255, 255, 0.35) 100%);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 252px;
  z-index: 1100;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #7b1a48 0%, #5e1237 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 24px rgba(83, 15, 47, 0.22);
  overflow: hidden;
}

.sidebar-header {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(43, 9, 25, 0.18);
  overflow: hidden;
}

.sidebar-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.sidebar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 700;
  margin-top: 10px;
}

.sidebar-tagline {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-top: 6px;
}

.sidebar-section-label {
  padding: 0 18px;
  margin: 16px 0 8px;
  color: rgba(255, 244, 247, 0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0 10px;
}

.sidebar-nav-group + .sidebar-nav-group {
  margin-top: 4px;
}

.sidebar > nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.sidebar > nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar > nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.sidebar-nav li {
  margin-bottom: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
  padding: 8px 12px 8px 36px;
  border-radius: 0;
  font-weight: 700;
  font-size: 13px;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 244, 247, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.sidebar-nav a:hover {
  transform: translateX(2px);
}

.nav-badge,
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  width: max-content;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #9b1b59;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: var(--pd-numeric-features);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 6px 16px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
  overflow: hidden;
}

.nav-badge-alert {
  animation: navBadgeAttention 1.25s ease-in-out infinite;
}

@keyframes navBadgeAttention {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 6px 16px rgba(0, 0, 0, 0.18);
  }
  35% {
    transform: scale(1.08);
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.22);
  }
  55% {
    transform: scale(0.98);
  }
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-icon--auto {
  position: relative;
  color: currentColor;
}

.nav-icon--auto::before,
.nav-icon--auto::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.nav-icon--auto::after {
  inset: 7px 3px 3px 7px;
  border-left: 0;
  border-top: 0;
  opacity: 0.75;
}

.nav-icon--auto[data-module="direccion"]::before {
  inset: 3px;
  border-radius: 2px;
  box-shadow:
    5px 0 0 -2px currentColor,
    0 5px 0 -2px currentColor,
    5px 5px 0 -2px currentColor;
}

.nav-icon--auto[data-module="direccion"]::after {
  display: none;
}

.nav-icon--auto[data-module="comercial"]::before,
.nav-icon--auto[data-module="ventas"]::before,
.nav-icon--auto[data-module="crm"]::before {
  inset: 4px 3px 3px;
  border: 0;
  border-bottom: 1.8px solid currentColor;
  border-radius: 0;
  box-shadow: 4px -3px 0 -2px currentColor, 8px -7px 0 -2px currentColor;
}

.nav-icon--auto[data-module="comercial"]::after,
.nav-icon--auto[data-module="ventas"]::after,
.nav-icon--auto[data-module="crm"]::after {
  inset: auto 2px 3px 3px;
  width: 11px;
  height: 8px;
  border: 1.8px solid currentColor;
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  transform: skewY(-25deg);
}

.nav-icon--auto[data-module="produccion"]::before,
.nav-icon--auto[data-module="operacion"]::before {
  inset: 3px 2px;
  border-radius: 2px;
}

.nav-icon--auto[data-module="produccion"]::after,
.nav-icon--auto[data-module="operacion"]::after {
  inset: 6px 5px 4px;
  border: 0;
  border-top: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  border-radius: 0;
}

.nav-icon--auto[data-module="logistica"]::before {
  inset: 5px 2px 4px 2px;
  border-radius: 2px;
}

.nav-icon--auto[data-module="logistica"]::after {
  inset: auto 2px 2px auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1.6px solid currentColor;
}

.nav-icon--auto[data-module="fallas"]::before {
  inset: 2px 4px;
  border-radius: 50% 50% 3px 3px;
}

.nav-icon--auto[data-module="fallas"]::after {
  inset: 10px 7px 3px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
}

.nav-icon--auto[data-module="administracion"]::before,
.nav-icon--auto[data-module="sistema"]::before {
  inset: 3px 3px 4px;
  border-radius: 2px;
}

.nav-icon--auto[data-module="administracion"]::after,
.nav-icon--auto[data-module="sistema"]::after {
  inset: 5px 4px auto;
  height: 3px;
  border: 0;
  border-top: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  border-radius: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar-user {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.sidebar-user-name {
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

.logout-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.sidebar-group-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  margin-top: 4px;
  margin-bottom: 0;
}

.sidebar-group-toggle[aria-expanded="true"],
.sidebar-group-toggle:hover {
  background: rgba(255, 244, 247, 0.14);
}

.sidebar-group-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-group-toggle .sidebar-section-label {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.sidebar-group-toggle .toggle-chevron {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  background: transparent;
  border: 0;
  opacity: 0.45;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 0;
}

.sidebar-group-toggle .toggle-chevron svg {
  width: 14px;
  height: 14px;
}

.sidebar-group-toggle[aria-expanded="false"] .toggle-chevron {
  transform: rotate(-90deg);
}

.sidebar-group-toggle[aria-expanded="true"] .toggle-chevron {
  transform: rotate(0deg);
}

.sidebar-group-toggle:hover .sidebar-section-label {
  opacity: 1;
}

.sidebar-collapsible {
  overflow: hidden;
  max-height: 800px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}

.sidebar-collapsible.sidebar-collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  margin-bottom: 0;
  opacity: 1;
  letter-spacing: 0;
  text-transform: none;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.preview-picker-trigger {
  color: rgba(255, 255, 255, 0.82);
}

.preview-picker-trigger:hover,
.preview-picker-trigger:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.preview-mode-banner {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: -2rem -2rem 1.25rem;
  padding: 0.65rem 2rem;
  color: #4a2333;
  background: #fff4d6;
  border-bottom: 1px solid rgba(201, 168, 76, 0.42);
  box-shadow: 0 8px 24px rgba(80, 35, 54, 0.07);
}

.preview-mode-banner__icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--vino);
  background: rgba(139, 34, 82, 0.08);
  border-radius: 999px;
  flex: 0 0 auto;
}

.preview-mode-banner__icon svg {
  width: 1rem;
  height: 1rem;
}

.preview-mode-banner__copy {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.preview-mode-banner__copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-mode-banner__copy span {
  color: #876f59;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-mode-banner form {
  margin: 0;
}

.preview-mode-banner__change,
.preview-mode-banner__exit {
  appearance: none;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.preview-mode-banner__change {
  color: var(--vino);
  background: transparent;
  border: 1px solid rgba(139, 34, 82, 0.24);
}

.preview-mode-banner__exit {
  color: #fff;
  background: var(--vino);
  border: 1px solid var(--vino);
}

.preview-picker {
  width: min(600px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  padding: 0;
  color: var(--texto);
  background: #fffdfa;
  border: 1px solid rgba(139, 34, 82, 0.13);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(59, 25, 39, 0.24);
}

.preview-picker::backdrop {
  background: rgba(49, 24, 34, 0.48);
  backdrop-filter: blur(3px);
}

.preview-picker__shell {
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 2rem));
  margin: 0;
}

.preview-picker__header {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
}

.preview-picker__header > div {
  flex: 1;
}

.preview-picker__eyebrow {
  color: var(--vino);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-picker__header h2 {
  margin: 0.2rem 0 0.3rem;
  font-family: "Playfair Display", serif;
  font-size: 1.65rem;
}

.preview-picker__header p {
  margin: 0;
  color: var(--texto-light);
  font-size: 0.9rem;
}

.preview-picker__close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--texto-light);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 1.55rem;
  cursor: pointer;
}

.preview-picker__close:hover {
  background: var(--rosa);
  color: var(--vino);
}

.preview-picker__search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 1.5rem;
  padding: 0.72rem 0.9rem;
  background: #fff;
  border: 1px solid rgba(122, 101, 101, 0.24);
  border-radius: 12px;
}

.preview-picker__search:focus-within {
  border-color: var(--vino);
  box-shadow: 0 0 0 3px rgba(139, 34, 82, 0.09);
}

.preview-picker__search svg {
  width: 1.1rem;
  color: var(--texto-light);
}

.preview-picker__search input {
  width: 100%;
  padding: 0;
  color: var(--texto);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
}

.preview-picker__status {
  padding: 0.75rem 1.5rem 0.5rem;
  color: var(--texto-light);
  font-size: 0.78rem;
}

.preview-picker__results {
  overflow-y: auto;
  padding: 0 0.75rem 1rem;
}

.preview-person {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.8rem;
  color: var(--texto);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.preview-person:hover,
.preview-person:focus-visible {
  background: var(--rosa);
  outline: 0;
}

.preview-person__avatar {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  color: var(--vino);
  background: #f7e7ed;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.preview-person__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-person__copy strong,
.preview-person__copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-person__copy span {
  color: var(--texto-light);
  font-size: 0.78rem;
}

.preview-person__arrow {
  color: var(--vino);
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .preview-mode-banner {
    position: relative;
    flex-wrap: wrap;
    margin: -1rem -1rem 1rem;
    padding: 0.7rem 1rem;
  }

  .preview-mode-banner__copy {
    flex-basis: calc(100% - 3rem);
    flex-direction: column;
    gap: 0;
  }

  .preview-mode-banner__change {
    margin-left: 2.75rem;
  }

  .preview-picker__header,
  .preview-picker__status {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .preview-picker__search {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.sidebar .fas,
.sidebar .fa,
.sidebar .far,
.sidebar .fab {
  display: none;
}

.main-content {
  margin-left: 252px;
  width: calc(100% - 252px);
  max-width: none;
  min-width: 0;
  min-height: 100vh;
  padding-inline: var(--page-frame-gutter-x);
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(232, 180, 200, 0.6);
  box-shadow: 0 8px 24px rgba(139, 34, 82, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.header-title {
  margin: 0;
  font-size: 24px;
  color: var(--vino);
}

.header-meta {
  color: var(--texto-light);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-context-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(110, 32, 58, 0.07);
  color: var(--vino);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.container {
  padding: clamp(14px, 1.6vw, 24px);
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  width: min(100%, 1580px);
  margin: 0 auto;
}

.card {
  background: #fff;
  border: 1px solid rgba(232, 180, 200, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(139, 34, 82, 0.055);
  padding: clamp(16px, 1.35vw, 20px);
  margin-bottom: 14px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.card:hover {
  border-color: rgba(168, 54, 95, 0.28);
  box-shadow: 0 12px 26px rgba(139, 34, 82, 0.07);
  transform: translateY(-1px);
}

.card-form-narrow {
  max-width: 640px;
}

.card-header {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 1.55vw, 1.75rem);
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--texto);
}

.page-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--texto);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--section-gap);
  margin-bottom: 16px;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--rosa);
  border-radius: var(--radius-md);
  box-shadow: var(--surface-shadow);
  padding: 18px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-number {
  font-family: 'Playfair Display', serif;
  font-size: 50px;
  line-height: 1;
  color: var(--vino);
}

.kpi-number.is-success {
  color: var(--verde);
}

.kpi-number.is-warning {
  color: var(--dorado);
}

.kpi-number.is-danger {
  color: var(--rojo);
}

.kpi-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--texto-light);
  letter-spacing: 0.05em;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(67, 24, 41, 0.06);
}

.erp-group-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.module-tab {
  text-decoration: none;
  color: var(--vino);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.module-tab-label {
  min-width: 0;
  white-space: nowrap;
}

.erp-group-tabs .module-tab {
  flex: 0 0 auto;
  width: max-content;
  white-space: nowrap;
}

.erp-group-tabs .module-tab-label,
.erp-group-tabs .tab-badge {
  flex: 0 0 auto;
}

.tab-badge {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 6px 16px rgba(0, 0, 0, 0.12);
}

.module-tab.active,
.module-tab:hover {
  background: #fff7fa;
  border-color: rgba(110, 32, 58, 0.12);
  box-shadow: 0 10px 24px rgba(110, 32, 58, 0.1);
  transform: translateY(-1px);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--control-height);
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--vino);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 34, 82, 0.2);
}

.btn-primary:hover {
  background: var(--vino-light);
}

.btn-secondary {
  background: var(--rosa);
  color: var(--vino);
  border: 1px solid var(--rosa-deep);
}

.btn-secondary:hover {
  background: var(--rosa-hover);
}

.btn-success {
  background: var(--verde);
  color: #fff;
}

.btn-danger {
  background: var(--rojo);
  color: #fff;
}

.btn-outline-primary {
  background: #fff;
  color: var(--vino);
  border: 1px solid var(--rosa-deep);
}

.btn-outline-secondary {
  background: #fff;
  color: var(--texto-light);
  border: 1px solid var(--rosa-deep);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.density-toggle {
  min-width: 122px;
  white-space: nowrap;
}

.w-100 { width: 100%; }

.form-group {
  margin-bottom: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-section {
  margin-bottom: 14px;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height);
  padding: 8px 10px;
  border: 1px solid var(--rosa-deep);
  border-radius: var(--radius-sm);
  background: #fff;
}

.field-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.danger-box {
  border: 1px solid #f4c5ce;
  background: #fff3f5;
  color: #8f2340;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

label,
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--texto);
}

.input-field,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea,
.form-control,
.form-select {
  width: 100%;
  border: 1px solid var(--rosa-deep);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--texto);
  background: #fff;
  min-height: var(--control-height);
  line-height: 1.25;
}

.input-readonly {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  background: var(--gris-suave);
  color: var(--texto);
  border-style: dashed;
}

.input-readonly code {
  color: var(--vino);
  font-weight: 700;
}

.input-field:focus,
input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
  outline: none;
}

.pd-select-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.pd-searchable-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.pd-searchable-select__input {
  width: 100%;
  padding-right: 42px;
}

.pd-searchable-select__input::placeholder {
  color: var(--gris);
}

.pd-searchable-select__input[aria-expanded="true"],
.pd-searchable-select.is-open .pd-searchable-select__input {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
  outline: none;
}

.pd-searchable-select.is-invalid .pd-searchable-select__input {
  border-color: #b42342;
  box-shadow: 0 0 0 3px rgba(180, 35, 66, 0.14);
}

.pd-searchable-select__chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--vino);
  pointer-events: none;
  transform: translateY(-50%);
}

.pd-searchable-select__chevron::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.pd-searchable-select__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 2200;
  display: none;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--rosa-deep);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 16px 36px rgba(60, 34, 49, 0.16);
}

.pd-searchable-select.is-open .pd-searchable-select__list {
  display: block;
}

.pd-searchable-select.has-no-results .pd-searchable-select__list {
  pointer-events: none;
}

.pd-searchable-select__option,
.pd-searchable-select__empty {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
}

.pd-searchable-select__option {
  border: 0;
  background: transparent;
  color: var(--texto);
  cursor: pointer;
}

.pd-searchable-select__option:hover,
.pd-searchable-select__option.is-active {
  background: rgba(139, 34, 82, 0.08);
  color: var(--vino);
}

.pd-searchable-select__option.is-selected {
  background: rgba(201, 168, 76, 0.16);
  color: #6f4b06;
  font-weight: 800;
}

.pd-searchable-select__empty {
  color: var(--gris);
}

.table-responsive {
  --table-min-width: 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: auto;
  border: 1px solid var(--rosa);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0;
}

.table-responsive::-webkit-scrollbar {
  height: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(139, 34, 82, 0.35);
  border-radius: 999px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f7eef2;
  border-radius: 999px;
}

.recipe-detail .table-responsive {
  border-radius: 12px;
}

.recipe-detail .card {
  overflow: visible;
}

.recipe-detail .table-responsive.card,
.recipe-detail .card .table-responsive {
  overflow-x: auto;
  overflow-y: hidden;
}

.table-responsive > table,
.table-responsive > .table {
  width: max-content;
  min-width: max(100%, var(--table-min-width));
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  table-layout: auto;
  background: transparent;
  border: 0;
}

.table-responsive > table th,
.table-responsive > table td,
.table-responsive > .table th,
.table-responsive > .table td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
  vertical-align: middle;
}

.table-responsive > table:has(thead th:nth-child(10)),
.table-responsive > .table:has(thead th:nth-child(10)) {
  min-width: max(var(--table-min-width), 1320px);
}

.table-responsive > table:has(thead th:nth-child(12)),
.table-responsive > .table:has(thead th:nth-child(12)) {
  min-width: max(var(--table-min-width), 1580px);
}

.table-responsive .cell-wrap,
.table-responsive .cell-long,
.table-responsive .table-cell-wrap,
.table-responsive [data-cell-wrap="true"] {
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
}

.table-responsive .cell-status,
.table-responsive .cell-actions,
.table-responsive .cell-action,
.table-responsive .cell-button,
.table-responsive .cell-badge,
.table-responsive [data-cell-status="true"],
.table-responsive [data-cell-actions="true"] {
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
  hyphens: manual;
}

.table-responsive .cell-status .badge,
.table-responsive .cell-status .bi-tone,
.table-responsive .cell-status .bi-pill,
.table-responsive .cell-status .bi-mix-pill,
.table-responsive .cell-badge .badge,
.table-responsive [data-cell-status="true"] .badge {
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  white-space: normal;
}

.table-responsive .cell-actions .quick-actions,
.table-responsive .cell-action .quick-actions,
.table-responsive [data-cell-actions="true"] .quick-actions {
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.table-responsive .cell-actions .btn,
.table-responsive .cell-action .btn,
.table-responsive .cell-button .btn,
.table-responsive [data-cell-actions="true"] .btn {
  white-space: nowrap;
  min-width: max-content;
}

.table-responsive .cell-nowrap,
.table-responsive .cell-date,
.table-responsive .cell-money,
.table-responsive .cell-number,
.table-responsive .table-cell-nowrap,
.table-responsive [data-cell-nowrap="true"] {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
}

.table-responsive > table th,
.table-responsive > .table th {
  min-width: 9ch;
  text-wrap: balance;
}

.table-responsive > table th.text-end,
.table-responsive > table td.text-end,
.table-responsive > table th.text-center,
.table-responsive > table td.text-center,
.table-responsive > .table th.text-end,
.table-responsive > .table td.text-end,
.table-responsive > .table th.text-center,
.table-responsive > .table td.text-center {
  white-space: nowrap;
}

.logi-bitacoras-page {
  display: grid;
  gap: clamp(14px, 1.5vw, 22px);
  padding-top: clamp(14px, 1.6vw, 24px);
}

.logi-bitacoras-page .module-tabs {
  margin-bottom: 0;
}

.logi-bitacoras-head {
  align-items: start;
  margin-bottom: 0;
}

.logi-bitacoras-filter-panel {
  padding: clamp(14px, 1.35vw, 20px);
}

.logi-bitacoras-filter {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.05fr)
    minmax(220px, 1.2fr)
    minmax(150px, 0.78fr)
    minmax(150px, 0.78fr)
    minmax(150px, 0.78fr)
    auto;
  gap: 12px;
  align-items: end;
}

.logi-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.logi-field label {
  margin: 0;
  color: var(--pd-muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.logi-field .input-field,
.logi-field .pd-searchable-select__input {
  min-height: var(--pd-control-height);
}

.logi-bitacoras-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: flex-end;
}

.logi-bitacoras-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--pd-control-height);
  padding-inline: 18px;
  white-space: nowrap;
}

.logi-bitacoras-results {
  overflow: hidden;
  padding: 0;
}

.logi-bitacoras-results-head {
  align-items: center;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--pd-border);
}

.logi-bitacoras-results-head h2 {
  margin: 0;
  color: var(--pd-wine);
  font-family: var(--pd-font-body);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.log-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.log-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.log-badge.ok {
  background: var(--pd-success-soft);
  color: var(--pd-success);
}

.log-badge.warn {
  background: var(--pd-warning-soft);
  color: var(--pd-warning);
}

.log-badge.danger {
  background: var(--pd-danger-soft);
  color: var(--pd-danger);
}

.logi-bitacoras-table-wrap {
  --table-min-width: 1900px;
  border: 0;
  border-radius: 0;
}

.table-responsive > table.logi-bitacoras-table {
  width: 100%;
  min-width: 1900px;
}

.logi-bitacoras-table th,
.logi-bitacoras-table td {
  vertical-align: top;
}

.logi-bitacoras-table .logi-fuel-cell {
  min-width: 220px;
  max-width: 280px;
}

.logi-bitacoras-table .logi-photos-cell {
  min-width: 142px;
}

.logi-bitacoras-table .logi-ticket-cell {
  min-width: 92px;
  max-width: 156px;
}

.logi-bitacoras-table .logi-audit-cell {
  min-width: 190px;
  white-space: normal;
}

.log-audit {
  display: grid;
  gap: 3px;
  justify-items: start;
  max-width: 230px;
}

.log-audit .log-muted {
  font-size: 0.78rem;
  line-height: 1.3;
}

.log-audit + .log-audit {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--pd-border);
}

.logi-ticket-cell a + a,
.logi-audit-cell .log-badge + .log-badge {
  margin-left: 6px;
}

.log-badge.audit-ok {
  background: var(--pd-success-soft);
  color: var(--pd-success);
}

.log-badge.audit-pendiente,
.log-badge.audit-error {
  background: var(--pd-warning-soft);
  color: var(--pd-warning);
}

.log-badge.audit-revision,
.log-badge.audit-alto_riesgo {
  background: var(--pd-danger-soft);
  color: var(--pd-danger);
}

.log-fuel {
  display: grid;
  gap: 3px;
  min-width: 180px;
  max-width: 260px;
}

.log-fuel + .log-fuel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--pd-border);
}

.log-fuel strong {
  color: var(--pd-wine);
  font-variant-numeric: var(--pd-numeric-features);
  line-height: 1.25;
}

.log-fuel a {
  color: var(--pd-wine);
  font-weight: 800;
  text-decoration: none;
}

.log-fuel a:hover {
  text-decoration: underline;
}

.log-muted {
  color: var(--pd-muted);
  font-size: 13px;
}

.log-thumb {
  width: 64px;
  height: 46px;
  object-fit: cover;
  border: 1px solid var(--pd-border-strong);
  border-radius: var(--pd-radius-md);
}

.log-ticket-thumb {
  height: 64px;
  background: #fff;
  object-fit: contain;
}

tr.log-overdue td {
  background: var(--pd-warning-soft);
}

.log-pager {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px 18px;
}

@media (max-width: 1320px) {
  .logi-bitacoras-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .logi-bitacoras-actions {
    justify-content: stretch;
  }

  .logi-bitacoras-actions .btn {
    flex: 1 1 0;
  }
}

@media (max-width: 760px) {
  .logi-bitacoras-head,
  .logi-bitacoras-results-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .logi-bitacoras-filter {
    grid-template-columns: 1fr;
  }

  .logi-bitacoras-actions,
  .log-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .logi-bitacoras-actions .btn,
  .log-pager .btn {
    width: 100%;
    min-height: var(--pd-control-height-mobile);
  }
}

.recipes-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
  grid-auto-rows: minmax(var(--control-height), auto);
}

/* Uniforma visualmente filtros y botones (evita selects más "delgados" en Safari). */
.recipes-filters .form-control,
.recipes-filters .form-select,
.recipes-filters .btn {
  min-height: var(--control-height);
  height: var(--control-height);
  margin: 0;
}

.recipes-filters .btn {
  padding-top: 0;
  padding-bottom: 0;
}

.recipes-filters .form-select {
  line-height: 1.15;
}

.point-sync-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 0 18px;
  padding: 16px 0;
  border-top: 1px solid rgba(139, 34, 82, 0.16);
  border-bottom: 1px solid rgba(139, 34, 82, 0.16);
}

.point-sync-copy {
  display: grid;
  gap: 4px;
  max-width: 68ch;
}

.point-sync-copy h3 {
  margin: 0;
  color: var(--texto);
  font-size: 18px;
  line-height: 1.25;
}

.point-sync-copy p {
  margin: 0;
  color: var(--texto-light);
  font-size: 14px;
  line-height: 1.5;
}

.point-sync-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.point-sync-actions form {
  margin: 0;
}

.point-sync-actions .btn {
  min-height: var(--control-height);
  margin: 0;
  white-space: nowrap;
}

.point-sync-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -6px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(50, 106, 136, 0.28);
  border-radius: 12px;
  background: rgba(50, 106, 136, 0.07);
  color: var(--texto);
}

.point-sync-status--success {
  border-color: rgba(47, 126, 87, 0.28);
  background: rgba(47, 126, 87, 0.08);
}

.point-sync-status--danger {
  border-color: rgba(179, 53, 67, 0.3);
  background: rgba(179, 53, 67, 0.08);
}

.point-sync-status__main {
  min-width: 0;
}

.point-sync-status__heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.point-sync-status__heading strong {
  font-size: 15px;
}

.point-sync-status__badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--texto-light);
  font-size: 12px;
  font-weight: 800;
}

.point-sync-status p {
  max-width: 72ch;
  margin: 4px 0 0;
  color: var(--texto-light);
  font-size: 14px;
  line-height: 1.45;
}

.point-sync-status small {
  display: block;
  margin-top: 5px;
  color: var(--texto-light);
}

.point-sync-status__summary {
  display: flex;
  flex: 0 0 auto;
  gap: 18px;
  margin: 0;
}

.point-sync-status__summary div {
  min-width: 92px;
}

.point-sync-status__summary dt {
  color: var(--texto-light);
  font-size: 11px;
  font-weight: 700;
}

.point-sync-status__summary dd {
  margin: 2px 0 0;
  color: var(--texto);
  font-size: 18px;
  font-weight: 800;
}

.point-sync-status__error {
  font-weight: 700;
}

.form-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-mini .kpi-card {
  padding: 14px;
}

.kpi-mini .kpi-card.kpi-card-summary {
  min-width: 280px;
}

.kpi-mini .kpi-number {
  font-size: 32px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #fff 0%, #fff7fa 100%);
}

.dashboard-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--vino);
  margin-bottom: 4px;
}

.dashboard-hero-subtitle {
  color: var(--texto-light);
  font-size: 14px;
}

.dashboard-hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.executive-shell {
  display: grid;
  gap: 18px;
}

.executive-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(110, 32, 58, 0.12);
  box-shadow: 0 18px 42px rgba(110, 32, 58, 0.08);
}

.executive-hero::before {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 153, 82, 0.18) 0%, rgba(197, 153, 82, 0) 72%);
  pointer-events: none;
}

.executive-hero-copy {
  position: relative;
  z-index: 1;
}

.executive-eyebrow,
.executive-section-kicker {
  color: var(--texto-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.executive-eyebrow {
  margin-bottom: 8px;
}

.executive-grid {
  display: grid;
  gap: 18px;
}

.executive-grid-primary {
  grid-template-columns: 1fr;
  align-items: start;
}

.executive-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.executive-stack {
  display: grid;
  gap: 18px;
}

.executive-section {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(110, 32, 58, 0.12);
  box-shadow: 0 14px 32px rgba(110, 32, 58, 0.06);
}

.executive-section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--vino) 0%, rgba(197, 153, 82, 0.88) 100%);
}

.executive-section-highlight {
  background:
    radial-gradient(circle at top right, rgba(232, 180, 200, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.98) 0%, rgba(255, 247, 250, 1) 100%);
}

.executive-section-spotlight {
  background:
    linear-gradient(180deg, rgba(110, 32, 58, 0.06) 0%, rgba(255, 255, 255, 0.98) 28%),
    #fff;
}

.executive-section-alert {
  background:
    linear-gradient(180deg, rgba(229, 57, 53, 0.05) 0%, rgba(255, 255, 255, 0.98) 28%),
    #fff;
}

.executive-section-alert-wide {
  margin-top: 18px;
}

.executive-subsection {
  box-shadow: none;
}

.executive-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.executive-section-copy {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--texto-light);
  font-size: 14px;
  line-height: 1.55;
}

.executive-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(110, 32, 58, 0.08);
  color: var(--vino);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.executive-kpi-grid {
  margin-bottom: 0;
  align-items: stretch;
}

.executive-kpi-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.executive-kpi-card {
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  height: 100%;
}

.executive-kpi-grid-compact .executive-kpi-card {
  padding: 14px 16px;
  min-height: 124px;
}

.executive-kpi-grid-compact .kpi-number {
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1;
}

.executive-kpi-grid-compact .executive-kpi-number-text,
.executive-kpi-grid-compact .kpi-number.is-warning,
.executive-kpi-grid-compact .kpi-number.is-danger,
.executive-kpi-grid-compact .kpi-number.is-success,
.executive-kpi-grid-compact .kpi-number.is-primary {
  font-size: clamp(21px, 2vw, 32px);
}

.executive-kpi-grid-compact .executive-kpi-note {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.executive-kpi-number-text {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

.executive-kpi-note {
  margin-top: 8px;
  line-height: 1.45;
}

.executive-chart-card-muted {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(110, 32, 58, 0.03) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.executive-chart-grid {
  align-items: stretch;
}

.executive-chart-card {
  height: 100%;
}

.page-dashboard .executive-grid-two,
.page-reportes-bi .executive-grid-two {
  grid-template-columns: 1fr;
}

.executive-kpi-card-action {
  display: grid;
  align-content: start;
  gap: 10px;
}

.executive-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.executive-inline-actions-wrap .btn {
  flex: 0 0 auto;
}

.executive-decision-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding-bottom: 0;
  align-items: stretch;
}

.executive-decision-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "rank copy"
    "rank action";
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  min-height: 148px;
  height: 100%;
}

.executive-decision-item.tone-danger {
  border-color: rgba(229, 57, 53, 0.18);
  background: linear-gradient(180deg, rgba(229, 57, 53, 0.04) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.executive-decision-item.tone-warning {
  border-color: rgba(197, 153, 82, 0.24);
  background: linear-gradient(180deg, rgba(197, 153, 82, 0.06) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.executive-decision-rank {
  grid-area: rank;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(110, 32, 58, 0.08);
  color: var(--vino);
  font-size: 18px;
  font-weight: 800;
}

.executive-decision-copy {
  grid-area: copy;
  min-width: 0;
}

.executive-decision-title {
  color: var(--texto);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.executive-decision-detail {
  margin-top: 4px;
  color: var(--texto-light);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.executive-decision-item .btn {
  grid-area: action;
  justify-self: start;
  white-space: nowrap;
}

.executive-callout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(110, 32, 58, 0.1);
  background: rgba(255, 247, 250, 0.92);
}

.executive-callout.tone-danger {
  border-color: rgba(229, 57, 53, 0.24);
  background: linear-gradient(180deg, rgba(229, 57, 53, 0.05) 0%, rgba(255, 247, 250, 0.98) 100%);
}

.executive-callout.tone-warning {
  border-color: rgba(197, 153, 82, 0.26);
  background: linear-gradient(180deg, rgba(197, 153, 82, 0.08) 0%, rgba(255, 247, 250, 0.98) 100%);
}

.executive-callout-title {
  color: var(--vino);
  font-weight: 800;
}

.executive-callout-detail {
  margin-top: 4px;
  color: var(--texto-light);
  line-height: 1.45;
}

.executive-callout-copy {
  min-width: 0;
}

.executive-callout-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.executive-callout-metric {
  color: var(--texto);
  font-size: 13px;
  font-weight: 700;
}

.executive-callout-actions .btn {
  white-space: nowrap;
}

.executive-critical-queue {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 340px);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.executive-critical-card {
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(110, 32, 58, 0.05);
  min-height: 190px;
  scroll-snap-align: start;
  display: grid;
  align-content: start;
}

.executive-critical-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.executive-critical-card-head .btn {
  white-space: nowrap;
}

.executive-critical-card-title {
  color: var(--texto);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.executive-critical-card-meta {
  margin-top: 6px;
  color: var(--texto-light);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.executive-critical-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.executive-critical-stat {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(110, 32, 58, 0.04);
}

.executive-critical-stat strong {
  color: var(--texto);
  font-size: 20px;
  line-height: 1.1;
}

.executive-critical-stat-label {
  color: var(--texto-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.executive-critical-card-gap {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  color: var(--texto);
  align-content: start;
}

.executive-critical-card-gap div {
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.executive-decision-list::-webkit-scrollbar,
.executive-critical-queue::-webkit-scrollbar {
  height: 8px;
}

.executive-decision-list::-webkit-scrollbar-thumb,
.executive-critical-queue::-webkit-scrollbar-thumb {
  background: rgba(110, 32, 58, 0.18);
  border-radius: 999px;
}

.executive-master-block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.executive-master-block-card {
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(110, 32, 58, 0.05);
  display: grid;
  gap: 14px;
}

.executive-master-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.executive-master-block-title {
  color: var(--texto);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.executive-master-block-meta {
  margin-top: 6px;
  color: var(--texto-light);
  font-size: 13px;
  line-height: 1.45;
}

.executive-master-block-metrics {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
}

.executive-master-block-gap,
.executive-master-block-products {
  display: grid;
  gap: 6px;
  color: var(--texto);
}

.executive-master-block-actions {
  display: flex;
  justify-content: flex-start;
}

.executive-table-shell {
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.executive-table-shell .table {
  margin-bottom: 0;
}

.executive-table-shell .table thead th {
  background: rgba(110, 32, 58, 0.04);
  border-bottom-width: 1px;
}

.executive-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.executive-list-card {
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 16px;
}

.executive-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.executive-chart-card {
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 251, 0.96));
  padding: 16px 18px;
}

.executive-chart-title {
  color: var(--vino);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.executive-bar-list {
  display: grid;
  gap: 12px;
}

.executive-bar-list-monthly .executive-bar-row {
  grid-template-columns: minmax(64px, 88px) minmax(0, 1fr) auto;
}

.executive-bar-row {
  display: grid;
  grid-template-columns: minmax(128px, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.executive-bar-row-detailed {
  grid-template-columns: minmax(180px, 1.5fr) minmax(0, 1fr) auto;
}

.executive-bar-copy {
  min-width: 0;
}

.executive-bar-label {
  color: var(--texto);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.executive-bar-meta {
  color: var(--texto-light);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.2;
}

.executive-bar-detail {
  color: var(--texto-light);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.35;
}

.executive-bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(110, 32, 58, 0.08);
  overflow: hidden;
}

.executive-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b1e53 0%, #d74f7e 100%);
}

.executive-bar-fill.is-accent {
  background: linear-gradient(90deg, #db7a18 0%, #f3b347 100%);
}

.executive-bar-fill.is-neutral {
  background: linear-gradient(90deg, #5a3d4a 0%, #8c6674 100%);
}

.executive-bar-fill.is-danger {
  background: linear-gradient(90deg, #b6244e 0%, #f06a8d 100%);
}

.executive-bar-fill.is-warning {
  background: linear-gradient(90deg, #d88918 0%, #f1c25b 100%);
}

.executive-bar-fill.is-success {
  background: linear-gradient(90deg, #34785a 0%, #63b58e 100%);
}

.executive-bar-value {
  color: var(--texto);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.executive-bar-side {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.executive-list-title {
  color: var(--vino);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.executive-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, auto);
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(110, 32, 58, 0.08);
  color: var(--texto-light);
  font-size: 13px;
}

.executive-list-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.executive-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.executive-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(110, 32, 58, 0.1);
  background: rgba(255, 247, 250, 0.96);
  color: var(--texto);
  font-size: 12px;
}

.executive-note {
  margin-top: 12px;
  color: var(--texto-light);
  font-size: 13px;
}

.executive-fact-list {
  display: grid;
  gap: 10px;
  color: var(--texto-light);
  font-size: 13px;
  line-height: 1.5;
}

.executive-advanced-panel {
  margin-bottom: 0;
}

.executive-advanced-body {
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.94) 0%, rgba(255, 255, 255, 1) 100%);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.sync-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 14px;
  margin-bottom: 12px;
}

.sync-item {
  border: 1px solid var(--rosa);
  border-radius: 9px;
  background: #fff;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sync-item-full {
  grid-column: 1 / -1;
}

.sync-label {
  color: var(--texto-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sync-value {
  color: var(--texto);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.recipe-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--texto);
  font-weight: 600;
}

.mt-2 {
  margin-top: 10px;
}

table,
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
}

th,
.table th,
.table thead th {
  background: var(--rosa);
  color: var(--vino);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rosa-deep);
  vertical-align: middle;
}

td,
.table td {
  border-bottom: 1px solid var(--gris-suave);
  font-size: 14px;
  padding: 12px 14px;
  vertical-align: middle;
}

tr:hover,
.table tbody tr:hover {
  background: var(--rosa-hover);
}

.row-needs-point td {
  background: #fff4f6;
}

.row-needs-point:hover td {
  background: #ffe9ef !important;
}

.recipe-lines-table {
  table-layout: fixed;
  min-width: 1280px;
}

.recipe-lines-table .col-pos { width: 56px; }
.recipe-lines-table .col-type { width: 120px; }
.recipe-lines-table .col-stage { width: 170px; }
.recipe-lines-table .col-ingredient { width: 190px; }
.recipe-lines-table .col-linked { width: 210px; }
.recipe-lines-table .col-origin { width: 110px; }
.recipe-lines-table .col-qty { width: 110px; }
.recipe-lines-table .col-unit { width: 70px; }
.recipe-lines-table .col-cost { width: 120px; }
.recipe-lines-table .col-match { width: 170px; }
.recipe-lines-table .col-actions { width: 165px; }

.recipe-lines-table td,
.recipe-lines-table th {
  vertical-align: middle;
}

.recipe-lines-table .cell-stage,
.recipe-lines-table .cell-ingredient {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  line-height: 1.3;
}

.recipe-lines-table .cell-qty,
.recipe-lines-table .cell-unit,
.recipe-lines-table .cell-cost {
  white-space: nowrap;
}

.recipe-lines-table tfoot th {
  background: #fff7fa;
  border-top: 2px solid var(--rosa-deep);
  color: var(--vino);
  font-size: 13px;
}

.recipe-actions-compact {
  gap: 6px;
}

.recipe-actions-compact .btn {
  min-width: 86px;
  padding: 8px 12px;
}

.recipe-line-inline-actions-row td {
  padding-top: 0;
  border-top: 0;
}

.recipe-line-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 0 12px;
}

.recipe-line-inline-actions form {
  margin: 0;
}

.badge,
.badge-verde,
.badge-amarillo,
.badge-rojo,
.bg-success,
.bg-warning,
.bg-danger,
.bg-primary {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
  vertical-align: middle;
}

/* Hallmark · component: status chips + table labels · genre: utilitarian
 * states: default · hover · focus · active · disabled · loading · error · success
 * contrast: pass (46-50)
 */
.module-chip,
.status-pill,
.bi-pill,
.ch-status,
.cedis-badge,
.fallas-badge,
.executive-meta-pill,
.header-context-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  vertical-align: middle;
}

.badge-verde,
.bg-success {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-amarillo,
.bg-warning,
.bg-primary {
  background: #FFF8E1;
  color: #F57F17;
}

.badge-rojo,
.bg-danger {
  background: #FFEBEE;
  color: #C62828;
}

.page-activos-catalogo .table-responsive > table,
.page-activos-ordenes .table-responsive > table,
.page-activos-planes .table-responsive > table,
.page-activos-reportes .table-responsive > table,
.page-activos-catalogo .table-responsive > .table,
.page-activos-ordenes .table-responsive > .table,
.page-activos-planes .table-responsive > .table,
.page-activos-reportes .table-responsive > .table {
  min-width: max(var(--table-min-width), 1160px);
}

.page-activos-catalogo .table-responsive > table:has(thead th:nth-child(10)),
.page-activos-ordenes .table-responsive > table:has(thead th:nth-child(10)),
.page-activos-planes .table-responsive > table:has(thead th:nth-child(10)),
.page-activos-reportes .table-responsive > table:has(thead th:nth-child(9)),
.page-activos-catalogo .table-responsive > .table:has(thead th:nth-child(10)),
.page-activos-ordenes .table-responsive > .table:has(thead th:nth-child(10)),
.page-activos-planes .table-responsive > .table:has(thead th:nth-child(10)),
.page-activos-reportes .table-responsive > .table:has(thead th:nth-child(9)) {
  min-width: 1420px;
}

.page-activos-catalogo .table-responsive th:last-child,
.page-activos-catalogo .table-responsive td:last-child,
.page-activos-ordenes .table-responsive th:last-child,
.page-activos-ordenes .table-responsive td:last-child,
.page-activos-planes .table-responsive th:last-child,
.page-activos-planes .table-responsive td:last-child,
.page-activos-reportes .table-responsive th:last-child,
.page-activos-reportes .table-responsive td:last-child {
  min-width: 132px;
  text-align: center;
}

.page-activos-catalogo .table-responsive th:nth-last-child(2),
.page-activos-catalogo .table-responsive td:nth-last-child(2),
.page-activos-ordenes .table-responsive th:nth-last-child(2),
.page-activos-ordenes .table-responsive td:nth-last-child(2),
.page-activos-planes .table-responsive th:nth-last-child(2),
.page-activos-planes .table-responsive td:nth-last-child(2),
.page-activos-reportes .table-responsive th:nth-last-child(2),
.page-activos-reportes .table-responsive td:nth-last-child(2) {
  min-width: 220px;
  white-space: normal;
}

.page-activos-catalogo .table-responsive .badge,
.page-activos-ordenes .table-responsive .badge,
.page-activos-planes .table-responsive .badge,
.page-activos-reportes .table-responsive .badge {
  width: max-content;
  max-width: none;
  margin-inline: auto;
}

.erp-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(139, 34, 82, 0.08);
  overflow: hidden;
}

.erp-progress-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
  background: rgba(139, 34, 82, 0.35);
}

.erp-progress-fill.is-success {
  background: linear-gradient(90deg, #4CAF50 0%, #81C784 100%);
}

.erp-progress-fill.is-warning {
  background: linear-gradient(90deg, #F6B73C 0%, #FFD54F 100%);
}

.erp-progress-fill.is-danger {
  background: linear-gradient(90deg, #E53935 0%, #EF5350 100%);
}

.erp-progress-fill.is-primary {
  background: linear-gradient(90deg, var(--vino) 0%, var(--vino-light) 100%);
}

/* Hallmark · component: dismissible alert · genre: utilitarian
 * states: default · hover · focus · active · disabled · loading · error · success
 * contrast: pass
 */
.messages-container {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 12px 12px 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(61, 43, 43, 0.06);
}

.messages-container .alert {
  margin-bottom: 0;
}

.alert > span {
  min-width: 0;
}

.alert-close {
  appearance: none;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid currentColor;
  border-radius: 7px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  opacity: 0.72;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.alert-close svg {
  display: block;
  width: 14px;
  height: 14px;
}

.alert-close:hover,
.alert-close.is-hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.alert-close:focus-visible,
.alert-close.is-focus {
  outline: 2px solid var(--vino);
  outline-offset: 2px;
  opacity: 1;
}

.alert-close:active,
.alert-close.is-active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(61, 43, 43, 0.16);
}

.alert-close:disabled,
.alert-close.is-disabled,
.alert-close[aria-busy="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.alert-danger {
  border: 1px solid #f4c5ce;
  background: #fff3f5;
  color: #b02b46;
}

.alert-success {
  border: 1px solid #bee5c2;
  background: #eefaf0;
  color: #2f7b36;
}

.alert-warning {
  border: 1px solid #ffe082;
  background: #fffbf0;
  color: #7c5a00;
}

.alert-info {
  border: 1px solid var(--rosa-deep);
  background: #fff7fa;
  color: var(--vino);
}

.login-container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--vino) 0%, #6B1740 100%);
}

.login-card {
  background: #fff;
  border: 1px solid var(--rosa);
  border-radius: 16px;
  width: min(420px, 92vw);
  padding: 30px;
  box-shadow: 0 2px 8px rgba(139, 34, 82, 0.15);
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
}

.login-logo img {
  display: block;
  width: 96px;
  max-width: 34vw;
  height: auto;
}

.login-title {
  margin: 4px 0;
  color: var(--vino);
}

.login-subtitle {
  color: var(--texto-light);
  font-size: 14px;
}

.text-muted,
.muted {
  color: var(--texto-light);
}

.text-end { text-align: right; }
.text-success { color: #2E7D32; }
.text-danger { color: #C62828; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 16px; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.gap-2 { gap: 8px; }

.pagination {
  list-style: none;
  padding: 0;
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rosa-deep);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--vino);
  background: #fff;
}

.module-shell {
  display: grid;
  gap: var(--section-gap);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.module-shell > .card {
  margin-bottom: 0;
  min-width: 0;
}

/* Hallmark · ERP layout containment guard
 * New module/page wrappers inside the ERP viewport must shrink to the real
 * content frame. Wide tables may scroll inside .table-responsive, but they must
 * not enlarge the whole screen behind the sidebar.
 */
.main-content > :where(.module-shell, .container, [class$="-page"], [class*="-page "]) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.main-content > :where(.module-shell, [class$="-page"], [class*="-page "]) {
  grid-template-columns: minmax(0, 1fr);
}

.main-content > :where(.module-shell, .container, [class$="-page"], [class*="-page "]) > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.recipe-technical-adjustment {
  border: 1px solid rgba(139, 34, 82, 0.18);
  border-radius: 8px;
  background: #fffafc;
  overflow: hidden;
}

.recipe-technical-adjustment > summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--vino);
  font-weight: 900;
  list-style-position: inside;
}

.recipe-technical-adjustment[open] > summary {
  border-bottom: 1px solid rgba(139, 34, 82, 0.14);
  background: #f8edf2;
}

.recipe-technical-adjustment .recipe-main-form {
  padding: 14px;
}

.recipe-name-cell {
  min-width: 260px;
}

.recipe-composition-trigger {
  appearance: none;
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--vino);
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
}

.recipe-composition-trigger:hover .recipe-name-main,
.recipe-composition-trigger:focus-visible .recipe-name-main {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recipe-composition-trigger:focus-visible {
  outline: 3px solid rgba(139, 34, 82, 0.18);
  outline-offset: 4px;
  border-radius: 8px;
}

.recipe-name-main {
  font-weight: 800;
  line-height: 1.2;
}

.recipe-name-meta {
  width: fit-content;
  color: #7f5d69;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recipe-composition-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.recipe-composition-modal.is-open {
  display: block;
}

.recipe-composition-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(49, 29, 38, 0.56);
}

.recipe-composition-panel {
  position: absolute;
  inset: 4vh clamp(14px, 4vw, 56px);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
  border: 1px solid rgba(139, 34, 82, 0.22);
  border-radius: 8px;
  background: #fffafc;
  box-shadow: 0 24px 70px rgba(49, 29, 38, 0.28);
  padding: clamp(16px, 2.4vw, 26px);
  overflow: hidden;
}

.recipe-composition-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid rgba(139, 34, 82, 0.14);
  padding-bottom: 12px;
}

.recipe-composition-header h2 {
  margin: 0;
  color: var(--vino);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
}

.composition-eyebrow {
  color: #a56a7b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.composition-subtitle {
  margin-top: 5px;
  color: #70525d;
  font-weight: 700;
}

.recipe-composition-close {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(139, 34, 82, 0.24);
  border-radius: 8px;
  background: #fff;
  color: var(--vino);
  cursor: pointer;
}

.recipe-composition-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.composition-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.composition-summary > div {
  border: 1px solid rgba(139, 34, 82, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.composition-summary span {
  display: block;
  color: #80616c;
  font-size: 12px;
  font-weight: 800;
}

.composition-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--vino);
  font-size: 18px;
  line-height: 1.15;
}

.composition-search-row {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 10px;
}

.composition-search-row label {
  margin: 0 0 9px;
  color: #3e3337;
  font-weight: 900;
}

.composition-search-row .form-control {
  width: min(320px, 52vw);
}

.composition-loading,
.composition-error {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 800;
}

.composition-loading {
  background: #f7eef2;
  color: var(--vino);
}

.composition-error {
  background: #fff3f0;
  color: #a73428;
}

.composition-table-wrap {
  min-height: 0;
  overflow: auto;
}

.composition-table {
  --table-min-width: 980px;
}

.composition-table th {
  background: #f8edf2;
  color: var(--vino);
  font-weight: 900;
}

.composition-table td,
.composition-table th {
  font-size: 14px;
}

.composition-row-warning td {
  background: #fff8e8;
}

.composition-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  border-radius: 999px;
  background: #f7eef2;
  color: var(--vino);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
}

.composition-chip.is-warning {
  background: #fff0c2;
  color: #805b00;
}

.composition-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(139, 34, 82, 0.14);
  padding-top: 12px;
}

.composition-footer span {
  color: #70525d;
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .recipe-composition-panel {
    inset: 10px;
    padding: 14px;
  }

  .composition-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .composition-search-row {
    display: grid;
    justify-content: stretch;
  }

  .composition-search-row .form-control {
    width: 100%;
  }

  .composition-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

.card-subtle {
  border: 1px solid var(--rosa);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 14px;
}

.integraciones-shell .card-header {
  font-size: 32px;
  line-height: 1.1;
}

.integraciones-shell .kpi-card .kpi-number {
  font-size: 36px;
}

.integraciones-alertas {
  display: grid;
  gap: 8px;
}

.integraciones-alerta {
  border: 1px solid var(--rosa);
  border-left-width: 4px;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.integraciones-alerta-title {
  font-weight: 700;
  color: var(--texto);
}

.integraciones-alerta--ok { border-left-color: #2E7D32; }
.integraciones-alerta--warning { border-left-color: #F57F17; }
.integraciones-alerta--danger { border-left-color: #C62828; }

.integraciones-homologacion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.integraciones-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.integraciones-subtitle {
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--texto);
}

.integraciones-key-box {
  border: 1px solid var(--rosa-deep);
  border-radius: 8px;
  background: #fff7fa;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  color: var(--vino);
  overflow-x: auto;
  white-space: nowrap;
}

.compras-solicitudes .card,
.plan-produccion-shell .card,
.recipe-detail-shell .card {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  min-width: 0;
}

.compras-solicitudes .card-header,
.plan-produccion-shell .card-header {
  font-size: 38px;
  line-height: 1.08;
}

.compras-solicitudes .form-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.compras-solicitudes .form-grid-auto,
.plan-produccion-shell .form-grid-auto,
.reportes-shell .form-grid-auto,
.page-compras-ordenes .form-grid-auto,
.page-compras-recepciones .form-grid-auto {
  align-items: end;
  grid-auto-rows: minmax(var(--control-height), auto);
}

.compras-solicitudes .form-grid-auto .input-field,
.compras-solicitudes .form-grid-auto .form-control,
.compras-solicitudes .form-grid-auto .form-select,
.compras-solicitudes .form-grid-auto .btn,
.plan-produccion-shell .form-grid-auto .input-field,
.plan-produccion-shell .form-grid-auto .form-control,
.plan-produccion-shell .form-grid-auto .form-select,
.plan-produccion-shell .form-grid-auto .btn,
.reportes-shell .form-grid-auto .input-field,
.reportes-shell .form-grid-auto .form-control,
.reportes-shell .form-grid-auto .form-select,
.reportes-shell .form-grid-auto .btn,
.page-compras-ordenes .form-grid-auto .input-field,
.page-compras-ordenes .form-grid-auto .form-control,
.page-compras-ordenes .form-grid-auto .form-select,
.page-compras-ordenes .form-grid-auto .btn,
.page-compras-recepciones .form-grid-auto .input-field,
.page-compras-recepciones .form-grid-auto .form-control,
.page-compras-recepciones .form-grid-auto .form-select,
.page-compras-recepciones .form-grid-auto .btn {
  min-height: var(--control-height);
  height: var(--control-height);
  margin: 0;
}

.compras-solicitudes .toolbar,
.plan-produccion-shell .toolbar {
  overflow-x: auto;
  white-space: nowrap;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.compras-solicitudes .toolbar .btn,
.plan-produccion-shell .toolbar .btn {
  flex-shrink: 0;
}

.compras-solicitudes .table-responsive,
.plan-produccion-shell .table-responsive,
.recipe-detail-shell .table-responsive {
  position: relative;
  z-index: 1;
  border-color: var(--rosa);
}

.recipe-detail-shell .table-responsive {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-gutter: auto;
}

.recipe-detail-shell .table-responsive > table,
.recipe-detail-shell .table-responsive > .table {
  width: max(100%, var(--table-min-width, 100%));
  min-width: var(--table-min-width, 100%);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.compras-solicitudes .table-responsive table {
  min-width: 1180px;
}

.page-compras-ordenes .table-responsive table,
.page-compras-recepciones .table-responsive table {
  min-width: 1080px;
}

.plan-produccion-shell .table-responsive table {
  min-width: 1180px;
}

.reportes-shell .table-responsive table {
  min-width: 980px;
}

.reportes-shell .toolbar,
.reportes-shell .form-grid-auto {
  gap: 12px;
}

.reportes-shell .card-header {
  font-size: 34px;
  line-height: 1.1;
}

.page-compras-solicitudes .header {
  position: sticky;
}

.page-compras-solicitudes .main-content {
  overflow-x: hidden;
}

.page-compras-ordenes .main-content,
.page-compras-recepciones .main-content,
.page-plan-produccion .main-content,
.page-reportes-costo .main-content,
.page-reportes-consumo .main-content,
.page-reportes-faltantes .main-content,
.page-reportes-bi .main-content {
  overflow-x: hidden;
}

.recipe-detail-shell .recipe-actions {
  gap: 6px;
}

.recipe-detail-shell .kpi-number {
  font-size: 44px;
}

.recipe-detail-shell .recipe-lines-table {
  min-width: 1520px;
}

.recipe-detail-shell .recipe-presentaciones-card {
  border-color: rgba(139, 34, 82, 0.14);
}

.recipe-detail-shell .recipe-mix-matrix-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  --table-min-width: 1040px;
}

.recipe-detail-shell .recipe-mix-matrix-table {
  width: max(100%, var(--table-min-width));
  min-width: var(--table-min-width);
  margin: 0;
  table-layout: fixed;
}

.recipe-detail-shell .recipe-mix-matrix-table .col-mix-label {
  width: 320px;
  min-width: 320px;
}

.recipe-detail-shell .recipe-mix-matrix-table .col-mix-value {
  width: 170px;
  min-width: 170px;
}

.recipe-detail-shell .recipe-mix-matrix-table .mix-label-heading,
.recipe-detail-shell .recipe-mix-matrix-table .mix-row-label {
  white-space: nowrap;
  text-align: left;
}

.recipe-detail-shell .recipe-mix-matrix-table .mix-head-value {
  text-align: center !important;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}

.recipe-detail-shell .recipe-mix-matrix-table .mix-cell-number {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: center !important;
  padding-left: 10px;
  padding-right: 10px;
}

.recipe-detail-shell .recipe-mix-matrix-table th,
.recipe-detail-shell .recipe-mix-matrix-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-detail-shell .recipe-presentaciones-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0;
  --table-min-width: 1120px;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.recipe-detail-shell .recipe-presentaciones-card .card-header,
.recipe-detail-shell .recipe-presentaciones-card h3 {
  letter-spacing: 0.01em;
}

.recipe-detail-shell .recipe-presentaciones-table {
  width: max(100%, var(--table-min-width));
  min-width: var(--table-min-width);
  margin: 0;
  table-layout: fixed;
}

.recipe-detail-shell .recipe-presentaciones-table .col-pres-name { width: 160px; min-width: 160px; }
.recipe-detail-shell .recipe-presentaciones-table .col-pres-derived { width: 360px; min-width: 320px; }
.recipe-detail-shell .recipe-presentaciones-table .col-pres-qty { width: 220px; min-width: 210px; }
.recipe-detail-shell .recipe-presentaciones-table .col-pres-cost { width: 180px; min-width: 170px; }
.recipe-detail-shell .recipe-presentaciones-table .col-pres-status { width: 130px; min-width: 120px; }
.recipe-detail-shell .recipe-presentaciones-table .col-pres-actions { width: 170px; min-width: 160px; }

.recipe-detail-shell .recipe-presentaciones-table thead th {
  vertical-align: bottom;
  padding-top: 11px;
  padding-bottom: 11px;
  padding-left: 16px;
  padding-right: 16px;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: initial;
}

.recipe-detail-shell .recipe-presentaciones-table tbody td {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
}

.recipe-detail-shell .recipe-presentaciones-table .cell-pres-name,
.recipe-detail-shell .recipe-presentaciones-table .cell-pres-derived {
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-overflow: initial;
}

.recipe-detail-shell .recipe-presentaciones-table .pres-head-qty,
.recipe-detail-shell .recipe-presentaciones-table .pres-head-cost {
  white-space: nowrap;
  line-height: 1.2;
  text-align: center !important;
}

.recipe-detail-shell .recipe-presentaciones-table .pres-head-label {
  display: inline;
  white-space: nowrap;
  line-height: 1.15;
}

.recipe-detail-shell .recipe-presentaciones-table .pres-head-unit {
  display: inline;
  font-size: 11px;
  line-height: 1.1;
  opacity: 0.85;
  margin-top: 0;
  margin-left: 4px;
  white-space: nowrap;
}

.recipe-detail-shell .recipe-presentaciones-table .cell-pres-qty,
.recipe-detail-shell .recipe-presentaciones-table .cell-pres-cost {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: center !important;
}

.recipe-detail-shell .recipe-presentaciones-table .pres-head-status,
.recipe-detail-shell .recipe-presentaciones-table .pres-head-actions,
.recipe-detail-shell .recipe-presentaciones-table tbody td:nth-child(5) {
  text-align: center;
}

.recipe-detail-shell .recipe-presentaciones-table th:nth-child(n+3),
.recipe-detail-shell .recipe-presentaciones-table td:nth-child(n+3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-detail-shell .recipe-presentaciones-table .cell-pres-actions .recipe-actions {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.recipe-detail-shell .recipe-presentaciones-table .cell-pres-actions .btn {
  min-width: 68px;
  min-height: 34px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 13px;
}

.page-receta-detail .main-content {
  overflow-x: hidden;
}

.page-receta-detail .container,
.page-receta-detail .module-shell,
.page-receta-detail .card {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.page-receta-detail .card .table-responsive {
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.recipe-detail-shell .recipe-lines-scroll {
  display: block;
  width: 100%;
  --table-min-width: 1520px;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  touch-action: pan-x;
  cursor: grab;
  max-height: none;
}

.recipe-detail-shell .recipe-lines-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.recipe-detail-shell .recipe-lines-scroll .recipe-lines-table {
  width: 100%;
  min-width: 1520px;
}

.recipe-detail-shell .recipe-lines-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.table-scroll-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.recipe-detail-shell .recipe-main-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.enterprise-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.enterprise-pill-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.recipes-quick-nav {
  display: grid;
  gap: 12px;
}

.recipes-quick-group {
  border: 1px solid rgba(168, 54, 95, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.36) 0%, rgba(255, 250, 245, 0.92) 100%);
  padding: 14px 16px;
}

.recipes-quick-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vino);
}

.recipes-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recipes-quick-chips .btn.is-active {
  background: var(--vino);
  color: var(--blanco);
  border-color: var(--vino);
}

.recipe-next-steps {
  border: 1px solid rgba(168, 54, 95, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.46) 0%, rgba(255, 250, 245, 0.92) 100%);
  padding: 18px 20px;
}

.recipe-next-steps-compact {
  padding: 14px 16px;
}

.recipe-next-steps-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 14px;
}

.recipe-next-steps-head h4 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 24px;
  color: var(--vino);
}

.recipe-next-steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.recipe-next-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(168, 54, 95, 0.12);
  color: var(--texto);
}

.recipe-next-step-index {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--vino);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.recipe-line-group-card {
  gap: 12px;
}

.recipe-line-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.recipe-line-group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.recipe-line-group-meta .btn {
  flex: 0 0 auto;
}

.recipe-line-group-subtotal {
  font-weight: 800;
  color: var(--vino);
}

.recipe-line-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.recipe-line-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(168, 54, 95, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.recipe-line-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recipe-line-card-index {
  font-weight: 800;
  color: var(--vino);
}

.recipe-line-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.recipe-line-card-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--texto);
}

.recipe-line-card-note {
  color: var(--muted);
  font-size: 13px;
}

.recipe-line-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.recipe-line-metric {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 233, 239, 0.55);
}

.recipe-line-metric-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.recipe-line-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-line-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.recipe-line-card-actions form {
  margin: 0;
}

.recipe-line-group-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.recipe-flow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recipe-flow-section {
  margin-bottom: 16px;
}

.recipe-flow-section-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-light);
}

.recipe-chain-focus-alert {
  margin-bottom: 10px;
}

.recipe-stage-playbook-compact {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.recipe-stage-playbook-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-light);
}

.recipe-stage-playbook-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(232, 180, 200, 0.65);
  border-radius: 12px;
  background: rgba(255, 250, 245, 0.88);
}

.recipe-stage-playbook-copy {
  min-width: 0;
}

.recipe-stage-playbook-label {
  font-weight: 800;
  color: var(--texto);
}

.enterprise-stage-playbook {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.enterprise-stage-step {
  padding: 14px 16px;
  border: 1px solid var(--rosa);
  border-radius: 14px;
  background: #fff;
}

.enterprise-stage-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.recipe-flow-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rosa-deep);
  background: #fff;
  color: var(--vino);
  font-weight: 700;
  text-decoration: none;
}

.recipe-flow-chip.is-muted {
  color: var(--texto-light);
  border-style: dashed;
}

.recipe-inline-link {
  color: var(--vino);
  font-weight: 700;
  text-decoration: none;
}

.recipe-inline-link:hover {
  color: var(--vino-light);
  text-decoration: underline;
}

.recipes-inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recipe-integrity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.recipe-integrity-item {
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--rosa-deep);
  background: rgba(248, 232, 238, 0.42);
}

.recipe-integrity-item.is-danger {
  border-color: rgba(229, 57, 53, 0.25);
  background: rgba(255, 235, 238, 0.9);
}

.recipe-integrity-item.is-warning {
  border-color: rgba(201, 168, 76, 0.28);
  background: rgba(255, 248, 225, 0.95);
}

.recipe-integrity-title {
  font-weight: 800;
  color: var(--texto);
  margin-bottom: 4px;
}

.recipe-integrity-description {
  font-size: 13px;
  line-height: 1.45;
  color: var(--texto-light);
}

.recipe-integrity-actions {
  margin-top: 10px;
}

.enterprise-pill-card {
  border: 1px solid var(--rosa-deep);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.75) 0%, rgba(255, 250, 245, 0.95) 100%);
  padding: 14px 16px;
  min-width: 0;
}

.enterprise-pill-card.is-active {
  border-color: var(--vino);
  box-shadow: 0 8px 18px rgba(139, 34, 82, 0.08);
}

.enterprise-readiness-card.is-success {
  border-color: rgba(76, 175, 80, 0.35);
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.78) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.enterprise-readiness-card.is-warning {
  border-color: rgba(201, 168, 76, 0.34);
  background: linear-gradient(180deg, rgba(255, 248, 225, 0.78) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.enterprise-readiness-card.is-danger {
  border-color: rgba(229, 57, 53, 0.28);
  background: linear-gradient(180deg, rgba(255, 235, 238, 0.8) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.kpi-card.is-active {
  border-color: var(--vino);
  box-shadow: 0 10px 22px rgba(139, 34, 82, 0.08);
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.72) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.enterprise-pill-title {
  font-family: "Playfair Display", serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--vino);
  line-height: 1.1;
  margin-bottom: 6px;
}

.enterprise-pill-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--texto-light);
}

.enterprise-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.enterprise-flow-card {
  border: 1px solid var(--rosa-deep);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.7) 0%, rgba(255, 250, 245, 0.98) 100%);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.enterprise-flow-step {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vino);
}

.enterprise-flow-title {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  color: var(--texto);
  line-height: 1.1;
}

.enterprise-flow-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--texto-light);
}

.enterprise-flow-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.enterprise-release-banner {
  border: 1px solid var(--rosa-deep);
  border-radius: 14px;
  padding: 16px 18px;
}

.enterprise-release-banner.is-success {
  border-color: rgba(76, 175, 80, 0.35);
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.72) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.enterprise-release-banner.is-warning {
  border-color: rgba(201, 168, 76, 0.34);
  background: linear-gradient(180deg, rgba(255, 248, 225, 0.74) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.module-note {
  border: 1px solid rgba(201, 168, 76, 0.28);
  background: rgba(201, 168, 76, 0.08);
  color: var(--texto);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.enterprise-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}

.enterprise-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--texto-light);
}

.enterprise-checklist-item.is-ok {
  color: #2e7d32;
  font-weight: 700;
}

.enterprise-checklist-item.is-pending {
  color: #a0365f;
  font-weight: 700;
}

.enterprise-checklist-item.is-muted {
  opacity: 0.42;
}

.enterprise-check-icon {
  width: 18px;
  text-align: center;
  font-weight: 800;
}

.form-group.is-required-by-type label::after {
  content: " *";
  color: var(--rojo);
  font-weight: 800;
}

.insumo-duplicate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.insumo-duplicate-card {
  border: 1px solid rgba(168, 54, 95, 0.16);
  border-radius: 14px;
  background: rgba(255, 250, 245, 0.88);
  padding: 14px;
}

.insumo-duplicate-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.insumo-duplicate-title {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  color: var(--vino);
}

.insumo-duplicate-canonical {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 232, 238, 0.58);
  margin-bottom: 10px;
}

.insumo-duplicate-list {
  display: grid;
  gap: 8px;
}

.insumo-duplicate-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(168, 54, 95, 0.12);
  background: #fff;
}

.insumo-duplicate-item.is-canonical {
  border-color: rgba(76, 175, 80, 0.28);
  background: rgba(232, 245, 233, 0.58);
}

.recipe-detail-shell .recipe-main-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.recipe-detail-shell .recipe-main-grid > * {
  min-width: 0;
  grid-column: auto;
}

.recipe-detail-shell .recipe-head {
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.recipe-detail-shell .recipe-head > *:first-child {
  min-width: 0;
}

.recipe-detail-shell .recipe-head .recipe-actions {
  margin-left: auto;
}

.recipe-detail-shell .recipe-main-grid .form-control,
.recipe-detail-shell .recipe-main-grid .form-select,
.recipe-detail-shell .recipe-main-controls .field-check {
  height: var(--control-height);
}

.recipe-detail-shell .recipe-main-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.recipe-detail-shell .field-check-compact {
  padding: 0 12px;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.recipe-detail-shell .field-check-compact span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.recipe-detail-shell .recipe-main-submit {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.recipe-detail-shell .recipe-lines-scroll {
  scrollbar-gutter: auto;
}

.recipe-detail-shell .recipe-lines-scroll::-webkit-scrollbar {
  height: 12px;
}

.recipe-detail-shell .recipe-lines-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 34, 82, 0.35);
  border-radius: 999px;
}

.recipe-detail-shell .recipe-lines-scroll::-webkit-scrollbar-track {
  background: rgba(240, 208, 220, 0.35);
  border-radius: 999px;
}

.recipe-detail-shell .recipes-filters-compare {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.recipe-detail-shell .recipes-filters-compare > div {
  min-width: 0;
}

.recipe-detail-shell .recipes-filters-compare .form-label {
  min-height: 20px;
}

.recipe-detail-shell .recipes-filters-compare .form-action {
  display: flex;
  align-items: flex-end;
}

.recipe-detail-shell .recipes-filters-compare .form-action .btn {
  width: 100%;
}

.recipe-detail-shell .recipes-filters-compare .compare-action {
  min-height: calc(var(--control-height) + 20px);
}

body.ui-compact {
  --control-height: 36px;
  --card-padding: 14px;
  --section-gap: 10px;
}

body.ui-compact .container {
  padding: 16px;
}

body.ui-compact .header {
  padding: 10px 18px;
}

body.ui-compact .header-title {
  font-size: 21px;
}

body.ui-compact .header-meta {
  font-size: 12px;
}

body.ui-compact .card {
  margin-bottom: 10px;
}

body.ui-compact .card-header {
  font-size: 25px;
  margin-bottom: 10px;
}

body.ui-compact .btn {
  padding: 7px 12px;
  font-size: 12px;
}

body.ui-compact .module-tab {
  min-height: 34px;
  padding: 6px 12px;
}

body.ui-compact .kpi-card {
  min-height: 104px;
  padding: 14px;
}

body.ui-compact .kpi-number {
  font-size: 40px;
}

body.ui-compact .kpi-label {
  font-size: 11px;
}

body.ui-compact th,
body.ui-compact .table th,
body.ui-compact .table thead th {
  font-size: 11px;
  padding: 9px 10px;
}

body.ui-compact td,
body.ui-compact .table td {
  font-size: 13px;
  padding: 9px 10px;
}

body.ui-compact .recipe-detail-shell .recipe-main-submit {
  min-width: 190px;
}

@media (max-width: 1100px) {
  .recipe-detail-shell .recipe-main-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recipe-detail-shell .recipes-filters-compare {
    grid-template-columns: repeat(2, minmax(min(200px, 100%), 1fr));
  }

  .recipe-detail-shell .recipe-head .recipe-actions {
    margin-left: 0;
  }

  .recipe-detail-shell .recipe-main-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .recipe-detail-shell .recipe-main-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-detail-shell .recipe-main-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .recipe-detail-shell .field-check-compact {
    min-width: 0;
    max-width: 100%;
  }

  .recipe-detail-shell .recipe-main-submit {
    width: 100%;
    min-width: 0;
  }

  .recipe-detail-shell .recipes-filters-compare {
    grid-template-columns: 1fr;
  }
}

.plan-produccion-shell .form-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.mobile-capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mobile-capture-form {
  border: 1px solid var(--rosa);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.mobile-capture-form h3 {
  margin: 0 0 10px;
  color: var(--vino);
  font-size: 21px;
}

.mobile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-form-grid .full-width {
  grid-column: 1 / -1;
}

.mobile-form-grid input,
.mobile-form-grid select {
  font-size: 15px;
  padding: 11px 12px;
}

.mobile-submit-btn {
  width: 100%;
  margin-top: 10px;
  min-height: 42px;
  font-size: 14px;
}

.page-reabasto-captura .header-meta .density-toggle {
  display: none;
}

.page-reabasto-captura .card-header {
  font-size: clamp(28px, 2.6vw, 36px);
}

.capture-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.capture-meta-pill {
  border: 1px solid var(--rosa);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.capture-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-light);
  font-weight: 700;
}

.capture-status-toolbar {
  margin-bottom: 8px;
}

.capture-table-wrap {
  max-height: none;
}

.capture-simple-table th,
.capture-simple-table td {
  white-space: nowrap;
}

.capture-simple-table td:first-child,
.capture-simple-table th:first-child {
  white-space: normal;
  min-width: 260px;
}

.capture-notes {
  margin-top: 10px;
  margin-bottom: 4px;
}

.capture-notes summary {
  cursor: pointer;
  color: var(--vino);
  font-weight: 700;
}

.recipe-component-guidance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.recipe-component-guidance-item {
  border: 1px solid rgba(232, 180, 200, 0.95);
  border-radius: 14px;
  background: rgba(255, 250, 245, 0.92);
  padding: 14px 16px;
}

.recipe-component-guidance-item.is-active {
  border-color: var(--vino);
  box-shadow: 0 8px 18px rgba(139, 34, 82, 0.08);
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.8) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.recipe-component-guidance-title {
  font-weight: 800;
  color: var(--vino);
  margin-bottom: 4px;
}

.recipe-component-guidance-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--texto-light);
}

.capture-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 250, 245, 0.35) 0%, rgba(255, 250, 245, 1) 35%);
  padding: 12px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  margin-top: 8px;
}

.capture-sticky-actions .btn {
  flex: 0 1 320px;
  min-height: 42px;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 72px;
    transition: width 0.18s ease, box-shadow 0.18s ease;
  }

  .layout-wrapper {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 72px, rgba(255, 255, 255, 0.35) 72px, rgba(255, 255, 255, 0.35) 100%);
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: 252px;
    box-shadow: 12px 0 32px rgba(83, 15, 47, 0.26);
  }

  .sidebar-header {
    display: grid;
    justify-items: center;
    padding: 16px 10px 12px;
  }

  .sidebar:hover .sidebar-header,
  .sidebar:focus-within .sidebar-header {
    display: block;
    padding: 22px 18px 18px;
  }

  .sidebar-brand,
  .sidebar-tagline,
  .sidebar-group-toggle .sidebar-section-label,
  .sidebar-group-toggle .toggle-chevron,
  .sidebar-collapsible,
  .sidebar-nav a span:last-child,
  .sidebar-user,
  .logout-link {
    display: none;
  }

  .sidebar:hover .sidebar-brand,
  .sidebar:hover .sidebar-tagline,
  .sidebar:hover .sidebar-group-toggle .sidebar-section-label,
  .sidebar:hover .sidebar-group-toggle .toggle-chevron,
  .sidebar:hover .sidebar-collapsible:not(.sidebar-collapsed),
  .sidebar:hover .sidebar-nav a span:last-child,
  .sidebar:hover .sidebar-user,
  .sidebar:hover .logout-link,
  .sidebar:focus-within .sidebar-brand,
  .sidebar:focus-within .sidebar-tagline,
  .sidebar:focus-within .sidebar-group-toggle .sidebar-section-label,
  .sidebar:focus-within .sidebar-group-toggle .toggle-chevron,
  .sidebar:focus-within .sidebar-collapsible:not(.sidebar-collapsed),
  .sidebar:focus-within .sidebar-nav a span:last-child,
  .sidebar:focus-within .sidebar-user,
  .sidebar:focus-within .logout-link {
    display: revert;
  }

  .sidebar:hover .sidebar-user,
  .sidebar:focus-within .sidebar-user,
  .sidebar:hover .sidebar-actions,
  .sidebar:focus-within .sidebar-actions,
  .sidebar:hover .sidebar-group-title,
  .sidebar:focus-within .sidebar-group-title {
    display: flex;
  }

  .sidebar-nav {
    padding: 0 8px;
  }

  .sidebar-group-toggle {
    justify-content: center;
    padding: 11px 0;
  }

  .sidebar:hover .sidebar-group-toggle,
  .sidebar:focus-within .sidebar-group-toggle {
    justify-content: space-between;
    padding: 10px 12px;
  }

  .sidebar-group-title {
    justify-content: center;
    width: 100%;
  }

  .sidebar:hover .sidebar-group-title,
  .sidebar:focus-within .sidebar-group-title {
    justify-content: flex-start;
    width: auto;
  }

  .sidebar .nav-icon,
  .sidebar .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .main-content {
    margin-left: 72px;
    width: calc(100% - 72px);
    max-width: none;
    padding-inline: clamp(16px, 2.4vw, 24px);
  }

  .sidebar-nav a {
    justify-content: center;
    padding: 9px 0;
  }

  .sidebar:hover .sidebar-nav a,
  .sidebar:focus-within .sidebar-nav a {
    justify-content: flex-start;
    padding: 8px 12px 8px 36px;
  }

  .sidebar-actions {
    justify-content: center;
    flex-direction: column;
    gap: 8px;
  }

  .sidebar:hover .sidebar-actions,
  .sidebar:focus-within .sidebar-actions {
    flex-direction: row;
    gap: 0.5rem;
  }

  .sidebar-footer {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 720px) {
  :root {
    --sidebar-rail-width: 64px;
  }

  .sidebar {
    position: fixed;
    width: var(--sidebar-rail-width);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .layout-wrapper {
    display: block;
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) var(--sidebar-rail-width), rgba(255, 255, 255, 0.35) var(--sidebar-rail-width), rgba(255, 255, 255, 0.35) 100%);
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: min(252px, calc(100vw - 12px));
    box-shadow: 8px 0 24px rgba(83, 15, 47, 0.22);
  }

  .sidebar-header {
    display: grid;
    justify-items: center;
    padding: 14px 8px 12px;
  }

  .sidebar:hover .sidebar-header,
  .sidebar:focus-within .sidebar-header {
    display: block;
    padding: 18px 16px 16px;
  }

  .main-content {
    margin-left: var(--sidebar-rail-width);
    width: calc(100% - var(--sidebar-rail-width));
    max-width: calc(100vw - var(--sidebar-rail-width));
    min-width: 0;
    padding-inline: 12px;
  }

  .sidebar-brand,
  .sidebar-tagline,
  .sidebar-group-toggle .sidebar-section-label,
  .sidebar-group-toggle .toggle-chevron,
  .sidebar-collapsible,
  .sidebar-nav a span:last-child,
  .logout-link {
    display: none;
  }

  .sidebar-group-toggle .toggle-chevron {
    display: none;
  }

  .sidebar-collapsible {
    display: none;
  }

  .sidebar-user {
    display: none;
  }

  .sidebar:hover .sidebar-brand,
  .sidebar:hover .sidebar-tagline,
  .sidebar:hover .sidebar-group-toggle .sidebar-section-label,
  .sidebar:hover .sidebar-group-toggle .toggle-chevron,
  .sidebar:hover .sidebar-collapsible:not(.sidebar-collapsed),
  .sidebar:hover .sidebar-nav a span:last-child,
  .sidebar:hover .logout-link,
  .sidebar:focus-within .sidebar-brand,
  .sidebar:focus-within .sidebar-tagline,
  .sidebar:focus-within .sidebar-group-toggle .sidebar-section-label,
  .sidebar:focus-within .sidebar-group-toggle .toggle-chevron,
  .sidebar:focus-within .sidebar-collapsible:not(.sidebar-collapsed),
  .sidebar:focus-within .sidebar-nav a span:last-child,
  .sidebar:focus-within .logout-link {
    display: revert;
  }

  .sidebar:hover .sidebar-user,
  .sidebar:focus-within .sidebar-user,
  .sidebar:hover .sidebar-actions,
  .sidebar:focus-within .sidebar-actions,
  .sidebar:hover .sidebar-group-title,
  .sidebar:focus-within .sidebar-group-title {
    display: flex;
  }

  .sidebar > nav {
    padding-bottom: 8px;
  }

  .sidebar-nav {
    padding: 0 8px;
  }

  .sidebar-group-toggle {
    justify-content: center;
    padding: 11px 0;
  }

  .sidebar:hover .sidebar-group-toggle,
  .sidebar:focus-within .sidebar-group-toggle {
    justify-content: space-between;
    padding: 10px 12px;
  }

  .sidebar-group-title {
    justify-content: center;
    width: 100%;
  }

  .sidebar:hover .sidebar-group-title,
  .sidebar:focus-within .sidebar-group-title {
    justify-content: flex-start;
    width: auto;
  }

  .sidebar-nav a {
    justify-content: center;
    padding: 9px 0;
  }

  .sidebar:hover .sidebar-nav a,
  .sidebar:focus-within .sidebar-nav a {
    justify-content: flex-start;
    padding: 8px 12px 8px 36px;
  }

  .sidebar-actions {
    justify-content: center;
  }

  .header {
    position: static;
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .header-title {
    font-size: 22px;
  }

  .container {
    padding: 16px;
  }

  .module-tabs,
  .rrhh-tabs,
  .mant-tabs {
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px;
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: auto;
  }

  .module-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .card,
  .section-panel,
  .bi-panel,
  .fallas-card,
  .ch-card,
  .ch-panel,
  .cedis-card,
  .cedis-panel,
  .orch-card,
  .orch-panel,
  .ops-stat,
  .rrhh-metric,
  .users-kpi-card,
  .users-compact-card,
  .users-step {
    max-width: 100%;
    min-width: 0;
  }

  .users-shell,
  .users-shell > *,
  .users-advanced-body,
  .users-advanced-body > section,
  .bi-shell,
  .bi-shell > *,
  #fallas-app,
  #fallas-app > *,
  #panel-reportes {
    max-width: 100%;
    min-width: 0;
  }

  .bi-hero,
  .bi-hero > *,
  .bi-panel,
  .module-tabs {
    min-width: 0;
  }

  .fallas-table-wrap,
  .cedis-table-wrap,
  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .ch-card,
  .ch-panel,
  .orch-card,
  .orch-panel {
    overflow-x: auto;
  }

  .ch-table,
  .fallas-table,
  .orch-table {
    min-width: min(760px, calc(100vw - var(--sidebar-rail-width) - 24px));
  }

  .ops-topline,
  .rrhh-summary,
  .users-kpi-grid,
  .users-compact-grid,
  .users-workflow-grid {
    grid-template-columns: 1fr !important;
  }

  .fallas-toolbar,
  .fallas-detail-grid,
  .fallas-category-layout,
  .kpi-charts,
  .cedis-hero-grid,
  .cedis-command-grid,
  .cedis-story-grid,
  .cedis-grid-4,
  .cedis-grid-3,
  .cedis-grid-2,
  .cedis-chart-grid,
  .cedis-quality-grid,
  .cedis-filter {
    grid-template-columns: 1fr !important;
  }

  .fallas-head,
  .cedis-panel-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cedis-hero-badges,
  .cedis-actions,
  .fallas-actions {
    justify-content: flex-start;
  }

  .cedis-badge,
  .fallas-head .btn-wine,
  .fallas-toolbar .btn,
  .ch-fields .btn {
    width: 100%;
  }

  .recipes-filters {
    grid-template-columns: 1fr;
  }

  .point-sync-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .point-sync-actions {
    justify-content: flex-start;
  }

  .point-sync-actions form,
  .point-sync-actions .btn {
    width: 100%;
  }

  .point-sync-status,
  .point-sync-status__summary {
    align-items: stretch;
    flex-direction: column;
  }

  .point-sync-status__summary {
    gap: 8px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero-badges {
    justify-content: flex-start;
  }

  .executive-grid-primary,
  .executive-grid-two,
  .executive-list-grid,
  .executive-chart-grid,
  .executive-kpi-grid-compact {
    grid-template-columns: 1fr;
  }

  .executive-section-head,
  .executive-callout {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .executive-decision-list {
    grid-template-columns: 1fr;
  }

  .executive-critical-queue {
    grid-auto-columns: minmax(280px, 88vw);
  }

  .executive-callout-actions {
    justify-content: flex-start;
  }

  .executive-critical-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .executive-critical-card-head .btn {
    align-self: flex-start;
  }

  .executive-critical-card-stats {
    grid-template-columns: 1fr;
  }

  .executive-master-block-grid,
  .executive-master-block-metrics {
    grid-template-columns: 1fr;
  }

  .executive-master-block-head {
    flex-direction: column;
    align-items: stretch;
  }

  .executive-decision-rank {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .executive-list-item {
    grid-template-columns: 1fr;
  }

  .executive-bar-row,
  .executive-bar-list-monthly .executive-bar-row {
    grid-template-columns: 1fr;
  }

  .executive-bar-side {
    justify-items: start;
  }

  .recipe-lines-table {
    min-width: 980px;
  }

  .recipe-detail-shell .recipe-presentaciones-table {
    min-width: 1240px;
  }

  .recipe-detail-shell .recipe-mix-matrix-table {
    min-width: 980px;
  }

  .recipe-detail-shell .recipe-mix-matrix-table .col-mix-label {
    width: 280px;
  }

  .recipe-detail-shell .recipe-mix-matrix-table .col-mix-value {
    width: 110px;
  }

  .recipe-actions-compact .btn {
    min-width: 78px;
    padding: 7px 10px;
  }

  .recipe-line-inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .recipe-line-card-grid {
    grid-template-columns: 1fr;
  }

  .recipe-line-card-metrics {
    grid-template-columns: 1fr;
  }

  .recipe-line-group-footer {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .module-shell {
    gap: 12px;
  }

  .compras-solicitudes .form-grid-auto,
  .plan-produccion-shell .form-grid-auto {
    grid-template-columns: 1fr;
  }

  .compras-solicitudes .card-header,
  .plan-produccion-shell .card-header,
  .integraciones-shell .card-header {
    font-size: 32px;
  }

  .integraciones-columns {
    grid-template-columns: 1fr;
  }

  .recipe-detail-shell .recipe-actions {
    width: 100%;
  }

  .recipe-detail-shell .recipe-actions .btn {
    flex: 1;
  }

  .recipe-next-steps-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .recipe-line-group-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .recipe-line-group-meta {
    justify-content: flex-start;
  }

  .recipe-detail-shell .kpi-number {
    font-size: 36px;
  }

  .mobile-capture-grid {
    grid-template-columns: 1fr;
  }

  .mobile-form-grid {
    grid-template-columns: 1fr;
  }

  .page-compras-solicitudes .header {
    position: static;
  }

  .capture-meta-row {
    grid-template-columns: 1fr;
  }

  .capture-sticky-actions .btn {
    flex: 1;
  }
}

@media (max-width: 380px) {
  :root {
    --sidebar-rail-width: 58px;
  }

  .main-content {
    padding-inline: 10px;
  }

  .sidebar .nav-icon,
  .sidebar .nav-icon svg {
    width: 17px;
    height: 17px;
  }

  .sidebar-logo {
    width: 30px;
    height: 30px;
  }

  .sidebar-logo img {
    width: 27px;
    height: 27px;
  }
}

@media (max-width: 560px) {
  .recipe-detail-shell .recipe-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Inventario > Existencias: evita apilado de encabezados/badges por columnas comprimidas */
.page-inventario-existencias .table-responsive {
  --table-min-width: 1760px;
}

.page-inventario-existencias .table-responsive > table th,
.page-inventario-existencias .table-responsive > table td,
.page-inventario-existencias .table-responsive > .table th,
.page-inventario-existencias .table-responsive > .table td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.page-inventario-existencias .table-responsive > table th:first-child,
.page-inventario-existencias .table-responsive > table td:first-child,
.page-inventario-existencias .table-responsive > .table th:first-child,
.page-inventario-existencias .table-responsive > .table td:first-child {
  white-space: normal;
  min-width: 170px;
}

.page-inventario-existencias .table-responsive > table th:nth-child(2),
.page-inventario-existencias .table-responsive > table td:nth-child(2),
.page-inventario-existencias .table-responsive > .table th:nth-child(2),
.page-inventario-existencias .table-responsive > .table td:nth-child(2) {
  min-width: 72px;
  text-align: center;
}

.page-inventario-existencias .table-responsive > table th:nth-child(3),
.page-inventario-existencias .table-responsive > table td:nth-child(3),
.page-inventario-existencias .table-responsive > .table th:nth-child(3),
.page-inventario-existencias .table-responsive > .table td:nth-child(3) {
  min-width: 150px;
}

.page-inventario-existencias .table-responsive > table th:nth-child(13),
.page-inventario-existencias .table-responsive > table td:nth-child(13),
.page-inventario-existencias .table-responsive > .table th:nth-child(13),
.page-inventario-existencias .table-responsive > .table td:nth-child(13) {
  min-width: 220px;
}

.page-inventario-existencias .table-responsive > table th:last-child,
.page-inventario-existencias .table-responsive > table td:last-child,
.page-inventario-existencias .table-responsive > .table th:last-child,
.page-inventario-existencias .table-responsive > .table td:last-child {
  min-width: 132px;
  text-align: center;
}

.page-inventario-existencias .badge,
.page-inventario-existencias .badge-verde,
.page-inventario-existencias .bg-success,
.page-inventario-existencias .bg-danger,
.page-inventario-existencias .bg-warning,
.page-inventario-existencias .bg-primary {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-inventario-existencias td .badge-verde {
  margin-top: 6px;
}

.page-inventario-existencias .table-responsive .btn-sm {
  white-space: nowrap;
}

.page-inventario-movimientos .table-responsive {
  --table-min-width: 1220px;
}

.page-inventario-movimientos .table-responsive > table th,
.page-inventario-movimientos .table-responsive > table td,
.page-inventario-movimientos .table-responsive > .table th,
.page-inventario-movimientos .table-responsive > .table td {
  white-space: nowrap;
}

.page-inventario-movimientos .table-responsive > table th:nth-child(3),
.page-inventario-movimientos .table-responsive > table td:nth-child(3),
.page-inventario-movimientos .table-responsive > .table th:nth-child(3),
.page-inventario-movimientos .table-responsive > .table td:nth-child(3) {
  min-width: 220px;
  white-space: normal;
}

.page-inventario-movimientos .table-responsive > table th:nth-child(4),
.page-inventario-movimientos .table-responsive > table td:nth-child(4),
.page-inventario-movimientos .table-responsive > .table th:nth-child(4),
.page-inventario-movimientos .table-responsive > .table td:nth-child(4) {
  min-width: 150px;
}

.page-inventario-movimientos .table-responsive > table th:last-child,
.page-inventario-movimientos .table-responsive > table td:last-child,
.page-inventario-movimientos .table-responsive > .table th:last-child,
.page-inventario-movimientos .table-responsive > .table td:last-child {
  min-width: 220px;
}

.page-inventario-ajustes .table-responsive {
  --table-min-width: 1560px;
}

.page-inventario-ajustes .table-responsive > table th,
.page-inventario-ajustes .table-responsive > table td,
.page-inventario-ajustes .table-responsive > .table th,
.page-inventario-ajustes .table-responsive > .table td {
  white-space: nowrap;
}

.page-inventario-ajustes .table-responsive > table th:nth-child(2),
.page-inventario-ajustes .table-responsive > table td:nth-child(2),
.page-inventario-ajustes .table-responsive > .table th:nth-child(2),
.page-inventario-ajustes .table-responsive > .table td:nth-child(2) {
  min-width: 220px;
  white-space: normal;
}

.page-inventario-ajustes .table-responsive > table th:nth-child(3),
.page-inventario-ajustes .table-responsive > table td:nth-child(3),
.page-inventario-ajustes .table-responsive > .table th:nth-child(3),
.page-inventario-ajustes .table-responsive > .table td:nth-child(3) {
  min-width: 150px;
}

.page-inventario-ajustes .table-responsive > table th:nth-child(8),
.page-inventario-ajustes .table-responsive > table td:nth-child(8),
.page-inventario-ajustes .table-responsive > .table th:nth-child(8),
.page-inventario-ajustes .table-responsive > .table td:nth-child(8) {
  min-width: 220px;
}

.page-inventario-alertas .table-responsive {
  --table-min-width: 1680px;
}

.page-inventario-alertas .table-responsive > table th,
.page-inventario-alertas .table-responsive > table td,
.page-inventario-alertas .table-responsive > .table th,
.page-inventario-alertas .table-responsive > .table td {
  white-space: nowrap;
}

.page-inventario-alertas .table-responsive > table th:first-child,
.page-inventario-alertas .table-responsive > table td:first-child,
.page-inventario-alertas .table-responsive > .table th:first-child,
.page-inventario-alertas .table-responsive > .table td:first-child {
  min-width: 200px;
  white-space: normal;
}

.page-inventario-alertas .table-responsive > table th:nth-child(2),
.page-inventario-alertas .table-responsive > table td:nth-child(2),
.page-inventario-alertas .table-responsive > .table th:nth-child(2),
.page-inventario-alertas .table-responsive > .table td:nth-child(2) {
  min-width: 72px;
  text-align: center;
}

.page-inventario-alertas .table-responsive > table th:nth-child(3),
.page-inventario-alertas .table-responsive > table td:nth-child(3),
.page-inventario-alertas .table-responsive > .table th:nth-child(3),
.page-inventario-alertas .table-responsive > .table td:nth-child(3) {
  min-width: 150px;
}

.page-inventario-alertas .table-responsive > table th:nth-child(12),
.page-inventario-alertas .table-responsive > table td:nth-child(12),
.page-inventario-alertas .table-responsive > .table th:nth-child(12),
.page-inventario-alertas .table-responsive > .table td:nth-child(12) {
  min-width: 220px;
}

.page-inventario-alertas .table-responsive > table th:last-child,
.page-inventario-alertas .table-responsive > table td:last-child,
.page-inventario-alertas .table-responsive > .table th:last-child,
.page-inventario-alertas .table-responsive > .table td:last-child {
  min-width: 120px;
  text-align: center;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1300;
  transform: translateY(-140%);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--vino);
  box-shadow: var(--surface-shadow);
  padding: 10px 12px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.mobile-nav-toggle,
.mobile-nav-backdrop,
.mobile-app-bar {
  display: none;
}

.mobile-app-bar {
  --mobile-bar-bg: var(--vino);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1230;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  align-items: center;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  background: var(--mobile-bar-bg);
  color: #fff;
  border-bottom: 2px solid rgba(201, 168, 76, 0.86);
  box-shadow: 0 2px 10px rgba(83, 15, 47, 0.2);
}

.mobile-app-bar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
}

.mobile-app-bar-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 4px rgba(43, 9, 25, 0.16);
  overflow: hidden;
  flex: 0 0 auto;
}

.mobile-app-bar-mark img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  display: block;
}

.mobile-app-bar-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mobile-app-bar-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-app-bar-subtitle {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-app-bar-action {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.mobile-app-bar-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-app-bar-action:active {
  background: rgba(255, 255, 255, 0.14);
}

.mobile-nav-toggle {
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.mobile-nav-toggle:active {
  background: rgba(255, 255, 255, 0.14);
}

.mobile-nav-toggle-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mobile-nav-toggle-icon,
.mobile-nav-toggle-icon::before,
.mobile-nav-toggle-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-nav-toggle-icon {
  position: relative;
}

.mobile-nav-toggle-icon::before,
.mobile-nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.mobile-nav-toggle-icon::before {
  top: -5px;
}

.mobile-nav-toggle-icon::after {
  top: 5px;
}

@media (max-width: 720px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .mobile-app-bar {
    display: grid;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1240;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(36, 24, 32, 0.36);
    cursor: pointer;
  }

  .mobile-nav-backdrop:not([hidden]) {
    display: block;
  }

  .layout-wrapper {
    background: #fffdfa;
  }

  .sidebar {
    z-index: 1260;
    width: min(286px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    transform: translateX(calc(-100% - 18px));
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: none;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 10px 0 28px rgba(83, 15, 47, 0.24);
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: min(286px, calc(100vw - 28px));
  }

  .sidebar-header,
  .sidebar:hover .sidebar-header,
  .sidebar:focus-within .sidebar-header {
    display: block;
    padding: 18px 16px 16px;
  }

  .sidebar-brand,
  .sidebar-tagline,
  .sidebar-group-toggle .sidebar-section-label,
  .sidebar-group-toggle .toggle-chevron,
  .sidebar-collapsible,
  .sidebar-user,
  .logout-link {
    display: revert;
  }

  .sidebar-nav a .nav-badge,
  .sidebar-nav a > span:first-child,
  .sidebar-group-title .nav-badge {
    display: inline-flex;
  }

  .sidebar-nav a > span:first-child {
    display: block;
    min-width: 0;
  }

  .sidebar-user,
  .sidebar-actions,
  .sidebar-group-title {
    display: flex;
  }

  .sidebar > nav {
    padding-bottom: 12px;
  }

  .sidebar-nav {
    padding: 0 10px;
  }

  .sidebar-group-toggle,
  .sidebar:hover .sidebar-group-toggle,
  .sidebar:focus-within .sidebar-group-toggle {
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 12px;
  }

  .sidebar-group-title,
  .sidebar:hover .sidebar-group-title,
  .sidebar:focus-within .sidebar-group-title {
    justify-content: flex-start;
    width: auto;
  }

  .sidebar-nav a,
  .sidebar:hover .sidebar-nav a,
  .sidebar:focus-within .sidebar-nav a {
    justify-content: space-between;
    min-height: 44px;
    padding: 10px 12px;
  }

  .sidebar-collapsible,
  .sidebar:hover .sidebar-collapsible:not(.sidebar-collapsed),
  .sidebar:focus-within .sidebar-collapsible:not(.sidebar-collapsed) {
    display: block;
  }

  .sidebar-actions,
  .sidebar:hover .sidebar-actions,
  .sidebar:focus-within .sidebar-actions {
    flex-direction: row;
    justify-content: flex-start;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
    padding: calc(68px + env(safe-area-inset-top, 0px)) 12px 20px !important;
  }
}

@media (max-width: 380px) {
  .main-content {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .sidebar {
    transition: none !important;
  }
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.info-card {
  border: 1px solid var(--rosa-deep);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.9) 0%, rgba(255, 250, 245, 1) 100%);
  padding: 16px 18px;
}

.info-title {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  color: var(--vino);
  margin-bottom: 8px;
}

.info-text {
  color: var(--texto-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

.table-row-detail td {
  background: rgba(248, 232, 238, 0.35);
  border-top: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  padding-top: 10px;
  padding-bottom: 14px;
}

.enterprise-focus-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-radius: 16px;
  border: 1px solid var(--rosa-deep);
  background: linear-gradient(180deg, rgba(248, 232, 238, 0.78) 0%, rgba(255, 250, 245, 0.98) 100%);
}

.enterprise-focus-alert-copy {
  display: grid;
  gap: 6px;
}

.enterprise-focus-alert-title {
  font-family: "Playfair Display", serif;
  font-size: 1.18rem;
  color: var(--vino);
}

.enterprise-focus-alert-summary {
  color: var(--texto);
  font-weight: 700;
}

.enterprise-focus-alert-detail {
  color: var(--texto-light);
  font-size: 0.95rem;
}

.enterprise-focus-alert-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 260px;
}

.enterprise-focus-alert-success {
  border-color: rgba(76, 175, 80, 0.28);
}

.enterprise-focus-alert-warning {
  border-color: rgba(201, 168, 76, 0.36);
}

.enterprise-focus-alert-danger {
  border-color: rgba(229, 57, 53, 0.28);
}

@media (max-width: 880px) {
  .enterprise-focus-alert {
    flex-direction: column;
  }

  .enterprise-focus-alert-actions {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

.erp-progress-shell {
  display: grid;
  gap: 8px;
}

.erp-progress-label {
  font-size: 13px;
  color: var(--texto-light);
  font-weight: 700;
}

.erp-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(232, 180, 200, 0.35);
  overflow: hidden;
}

.erp-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--vino) 0%, var(--dorado) 100%);
}

.recipes-hero-card,
.recipe-hero-card {
  background:
    radial-gradient(circle at top right, rgba(232, 180, 200, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 250, 247, 0.98), rgba(255, 245, 238, 0.96));
  border: 1px solid rgba(110, 32, 58, 0.12);
}

.recipes-hero-head,
.recipe-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.recipes-hero-title,
.recipe-hero-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.05;
}

.recipes-hero-copy,
.recipe-hero-copy {
  margin: 0;
  max-width: 920px;
  color: var(--texto-light);
}

.recipe-hero-eyebrow {
  margin-bottom: 8px;
  color: var(--texto-light);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.recipes-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.recipe-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recipe-jump-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rosa);
  background: #fff7fa;
  color: var(--vino);
  text-decoration: none;
  font-weight: 600;
}

.recipe-jump-link:hover {
  border-color: var(--rosa-deep);
  background: #fff;
}

.erp-advanced-panel {
  margin: 0 0 20px;
  overflow: hidden;
  border: 1px solid rgba(110, 32, 58, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(67, 24, 41, 0.05);
}

.erp-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--vino);
  background: rgba(110, 32, 58, 0.05);
}

.erp-advanced-summary::-webkit-details-marker {
  display: none;
}

.erp-advanced-summary::after {
  content: "Mostrar";
  color: var(--texto-light);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.erp-advanced-panel[open] .erp-advanced-summary::after {
  content: "Ocultar";
}

.erp-advanced-body {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.recipe-filter-advanced {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.recipe-filter-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.page-recetas-list .container,
.page-recetas-list .module-shell,
.page-recetas-list .card,
.page-recetas-list .recipes-shell {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.recipes-shell {
  gap: 18px;
}

.recipes-filter-card {
  display: grid;
  gap: 18px;
}

.recipes-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.recipes-filter-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  line-height: 1.08;
  color: var(--texto);
}

.recipes-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recipes-filters-clean {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(170px, 1fr)) auto;
  gap: 12px;
  align-items: start;
}

.recipes-filter-submit {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.recipes-context-shell {
  padding: 18px 22px;
}

.recipes-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recipes-context-card {
  margin: 0;
}

.recipes-context-title {
  color: var(--vino);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.recipes-catalog-grid {
  display: grid;
  gap: 18px;
}

.recipe-catalog-card {
  padding: 20px 22px;
  border: 1px solid rgba(110, 32, 58, 0.1);
  background:
    radial-gradient(circle at top right, rgba(232, 180, 200, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 249, 251, 1) 100%);
}

.recipe-catalog-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.recipe-catalog-title {
  display: inline-block;
  color: var(--texto);
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  line-height: 1.08;
  text-decoration: none;
}

.recipe-catalog-title:hover {
  color: var(--vino);
}

.recipe-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 10px;
  color: var(--texto-light);
  font-size: 13px;
  font-weight: 700;
}

.recipe-catalog-head-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: 320px;
}

.recipe-catalog-metric {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(110, 32, 58, 0.05);
}

.recipe-catalog-metric-label {
  color: var(--texto-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recipe-catalog-metric strong {
  color: var(--texto);
  font-size: 22px;
  line-height: 1.1;
}

.recipe-catalog-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.recipe-catalog-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
}

.recipe-catalog-column {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(110, 32, 58, 0.08);
}

.recipe-catalog-card-clean .recipe-catalog-column:last-child {
  align-content: start;
}

.recipe-catalog-section-title {
  color: var(--vino);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.recipe-catalog-focus {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.45;
}

.recipe-catalog-focus strong {
  font-size: 17px;
  line-height: 1.2;
}

.recipe-catalog-focus.tone-danger {
  border: 1px solid rgba(229, 57, 53, 0.18);
  background: linear-gradient(180deg, rgba(229, 57, 53, 0.06) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.recipe-catalog-focus.tone-warning {
  border: 1px solid rgba(197, 153, 82, 0.22);
  background: linear-gradient(180deg, rgba(197, 153, 82, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.recipe-catalog-focus.tone-success {
  border: 1px solid rgba(76, 175, 80, 0.18);
  background: linear-gradient(180deg, rgba(76, 175, 80, 0.06) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.recipe-catalog-details {
  margin-top: 14px;
  border-top: 1px solid rgba(110, 32, 58, 0.08);
  padding-top: 14px;
}

.recipe-catalog-details > summary {
  cursor: pointer;
  list-style: none;
  color: var(--vino);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recipe-catalog-details > summary::-webkit-details-marker {
  display: none;
}

.recipe-catalog-details-body {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.recipes-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.recipes-context-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recipe-advanced-matrix {
  display: grid;
  gap: 14px;
}

.recipe-advanced-row {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(110, 32, 58, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 247, 250, 0.96) 100%);
}

.recipe-advanced-row-main {
  display: grid;
  gap: 10px;
}

.recipe-advanced-row-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  line-height: 1.1;
  color: var(--texto);
  text-decoration: none;
}

.recipe-advanced-row-title:hover {
  color: var(--vino);
}

.recipe-advanced-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recipe-advanced-row-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.recipe-advanced-cell {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(110, 32, 58, 0.04);
}

.recipe-advanced-label {
  color: var(--texto-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recipe-advanced-cell strong {
  font-size: 16px;
  line-height: 1.35;
  color: var(--texto);
}

@media (max-width: 880px) {
  .executive-hero {
    padding: 20px 18px;
  }

  .recipes-hero-head,
  .recipe-hero-head {
    flex-direction: column;
  }

  .recipes-hero-actions {
    justify-content: flex-start;
  }

  .recipe-catalog-card-head {
    flex-direction: column;
  }

  .recipe-catalog-content-grid {
    grid-template-columns: 1fr;
  }

  .recipes-filter-head,
  .recipes-filters-clean,
  .recipes-context-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .recipe-advanced-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-catalog-head-actions {
    min-width: 0;
    width: 100%;
  }

  .erp-advanced-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .recipe-catalog-title {
    font-size: 24px;
  }

  .recipe-catalog-head-actions,
  .recipe-catalog-content-grid {
    grid-template-columns: 1fr;
  }

  .recipes-filter-submit,
  .recipes-filter-actions {
    width: 100%;
  }

  .recipe-advanced-row-title {
    font-size: 24px;
  }

  .recipe-advanced-row-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   FASE 1 — Refinamiento Visual
   ============================================================ */

/* Transición en filas de tabla */
tr,
.table tbody tr {
  transition: background-color 0.15s ease;
}

/* KPI card hover elevado */
.kpi-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.kpi-card:hover {
  border-color: var(--rosa-deep);
  box-shadow: var(--surface-shadow-hover);
  transform: translateY(-2px);
}

/* KPI card con icono (inner layout) */
.kpi-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.kpi-body {
  flex: 1;
  min-width: 0;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--rosa);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--vino);
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.is-success { background: #E8F5E9; color: #2E7D32; }
.kpi-icon.is-warning { background: #FFF8E1; color: #F57F17; }
.kpi-icon.is-danger  { background: #FFEBEE; color: #C62828; }
.kpi-icon.is-dorado  { background: #FDF8EE; color: var(--dorado); }

/* Delta de KPI (variación vs período anterior) */
.kpi-delta {
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kpi-delta.up   { color: #2E7D32; }
.kpi-delta.down { color: #C62828; }
.kpi-delta.flat { color: var(--texto-light); }

/* Dashboard grid 2 columnas */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--section-gap);
}
@media (max-width: 900px) {
  .dashboard-grid-2 { grid-template-columns: 1fr; }
}

/* Separador de sección */
.section-sep {
  border: none;
  border-top: 1px solid var(--rosa-deep);
  margin: 4px 0 16px;
  opacity: 0.6;
}

/* Cabecera de sección reutilizable */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.section-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--texto);
  margin: 0;
}
.section-header-action {
  font-size: 13px;
  font-weight: 700;
  color: var(--vino);
  text-decoration: none;
}
.section-header-action:hover { text-decoration: underline; }

/* Estado vacío */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 10px;
  color: var(--texto-light);
  text-align: center;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  opacity: 0.35;
  color: var(--vino);
}
.empty-state-icon svg { width: 48px; height: 48px; }
.empty-state-msg { font-size: 14px; font-weight: 600; }

/* Animación fade-in escalonada para KPI cards */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-animate { animation: fadeInUp 0.3s ease both; }
.kpi-grid .kpi-card:nth-child(1) { animation: fadeInUp 0.3s 0.05s ease both; }
.kpi-grid .kpi-card:nth-child(2) { animation: fadeInUp 0.3s 0.10s ease both; }
.kpi-grid .kpi-card:nth-child(3) { animation: fadeInUp 0.3s 0.15s ease both; }
.kpi-grid .kpi-card:nth-child(4) { animation: fadeInUp 0.3s 0.20s ease both; }

/* Banners de alerta sutiles */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
.alert-banner-danger  { background: #fff0f2; border: 1px solid #f4c5ce; border-left: 4px solid var(--rojo);    color: #b02b46; }
.alert-banner-warning { background: #fffbf0; border: 1px solid #ffe082; border-left: 4px solid var(--amarillo); color: #7c5a00; }
.alert-banner-info    { background: #fff7fa; border: 1px solid var(--rosa-deep); border-left: 4px solid var(--vino); color: var(--vino); }

/* Barra de progreso (para presupuesto) */
.progress-bar-wrap {
  width: 100%;
  background: var(--gris-suave);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--verde);
  transition: width 0.5s ease;
}
.progress-bar-fill.is-warning { background: var(--amarillo); }
.progress-bar-fill.is-danger  { background: var(--rojo); }

/* Hero — mini-stats horizontales */
.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--rosa-deep);
  gap: 2px;
}
.hero-stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  line-height: 1;
  color: var(--vino);
  font-weight: 700;
}
.hero-stat-number.is-danger  { color: var(--rojo); }
.hero-stat-number.is-warning { color: var(--dorado); }
.hero-stat-number.is-success { color: var(--verde); }
.hero-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--texto-light);
  letter-spacing: 0.05em;
  text-align: center;
}

/* Accesos rápidos en grid de cards */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  background: #fff;
  border: 1px solid var(--rosa-deep);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--texto);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 80px;
}
.quick-action-card:hover {
  background: var(--rosa);
  border-color: var(--vino);
  color: var(--vino);
  transform: translateY(-2px);
  box-shadow: var(--surface-shadow-hover);
}
.quick-action-icon { width: 28px; height: 28px; color: var(--vino); opacity: 0.85; }
.quick-action-icon svg { width: 28px; height: 28px; }

/* Compact mode overrides nuevos elementos */
body.ui-compact .kpi-icon { width: 36px; height: 36px; }
body.ui-compact .kpi-icon svg { width: 18px; height: 18px; }
body.ui-compact .hero-stat-number { font-size: 18px; }
body.ui-compact .quick-action-card { padding: 12px 10px; min-height: 68px; }

/* === Producido vs Vendido === */
.production-report .card-header { margin-bottom: 0; }
.production-page-header {
  align-items: flex-start;
  gap: 18px;
}
.production-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.production-source-list,
.production-banner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.production-source-summary {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #ead7df;
  border-radius: var(--radius-md);
  background: #fff9fb;
  color: var(--texto);
}
.production-source-summary.is-success {
  border-color: #bad8c4;
  background: #f3faf5;
}
.production-source-summary.is-info {
  border-color: #c8d8e8;
  background: #f4f8fc;
}
.production-source-summary span { line-height: 1.45; }
.production-source-diagnostics { margin-top: 10px; color: var(--texto-light); }
.production-source-diagnostics summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--vino);
  font-weight: 800;
  cursor: pointer;
}
.production-source-diagnostics p { margin: 6px 0; line-height: 1.45; overflow-wrap: anywhere; }
.production-filter-action { align-self: end; }
.production-kpi-card .kpi-card-inner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  overflow: clip;
}
.production-kpi-card .kpi-body {
  min-width: 0;
  max-width: 100%;
  overflow: clip;
}
.production-kpi-card .kpi-number {
  display: block;
  width: 100%;
  font-size: clamp(1.55rem, 1.75vw, 2.05rem);
  line-height: 0.95;
  max-width: 100%;
  overflow: clip;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.production-kpi-card .kpi-label {
  text-align: left;
}
.production-kpi-number-currency {
  display: block;
  width: 100%;
  font-size: clamp(1.55rem, 1.75vw, 2.05rem);
  line-height: 0.95;
  max-width: 100%;
  overflow: clip;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.production-table-card {
  display: grid;
  gap: 18px;
}
.production-section-header {
  align-items: end;
}
.production-table-meta {
  margin: 4px 0 0;
  color: var(--texto-light);
  font-size: 0.95rem;
  line-height: 1.45;
}
.production-data-shell {
  display: grid;
  gap: 14px;
}
.production-analytic-table {
  --table-min-width: 100%;
}

.production-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100dvh - 112px);
  -webkit-overflow-scrolling: touch;
}
.table-responsive.production-table-wrap {
  overflow-y: auto !important;
}
.production-table-wrap > table.table {
  overflow: visible;
  width: max-content;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
.production-primary-table {
  --table-min-width: 1780px;
}
.production-secondary-table {
  --table-min-width: 1160px;
}
.production-table-wrap .production-col-receta {
  width: 280px;
  min-width: 280px;
}
.production-table-wrap .production-col-categoria {
  width: 150px;
  min-width: 150px;
}
.production-table-wrap .production-col-small,
.production-table-wrap .production-col-merma,
.production-table-wrap .production-col-dif,
.production-table-wrap .production-col-costo,
.production-table-wrap .production-col-percent,
.production-table-wrap .production-col-enteros,
.production-table-wrap .production-col-inv {
  width: 112px;
  min-width: 112px;
}
.production-table-wrap .production-col-estado {
  width: 260px;
  min-width: 260px;
}
.production-table-wrap .table thead th:first-child,
.production-table-wrap .table tbody td:first-child,
.production-table-wrap .table thead th:nth-child(2),
.production-table-wrap .table tbody td:nth-child(2) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: manual;
  line-height: 1.35;
}
.production-table-wrap .table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--rosa);
  font-size: 0.78rem;
  letter-spacing: 0;
  padding-left: 8px;
  padding-right: 8px;
  box-shadow: 0 1px 0 var(--rosa-deep);
}
.production-table-wrap .table thead th.text-end {
  text-align: right;
}
.production-table-wrap .table thead th.text-center {
  text-align: center;
}
.production-subtotal-row td {
  background: var(--gris-suave);
  color: var(--vino);
  font-weight: 800;
}
.production-grand-total-row td {
  background: #fff7fa;
  border-top: 2px solid var(--rosa-deep);
  color: var(--vino);
  font-weight: 900;
}
.production-state-cell {
  text-align: center;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.production-state-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 100%;
  text-align: center;
}
.production-state-label.is-success {
  background: rgba(47, 126, 87, 0.13);
  color: var(--verde);
}
.production-state-label.is-warning {
  background: rgba(214, 165, 45, 0.18);
  color: #96680d;
}
.production-state-label.is-danger {
  background: rgba(179, 53, 67, 0.14);
  color: var(--rojo);
}
.production-state-label.is-neutral,
.production-state-label.is-subtotal,
.production-state-label.is-total {
  background: rgba(110, 32, 58, 0.1);
  color: var(--vino);
}

/* ── bi-shell / bi-hero ─────────────────────────────── */
.bi-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff7fa 0%, var(--rosa) 100%);
  border: 1.5px solid rgba(139, 34, 82, 0.18);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 6px 24px rgba(67, 24, 41, 0.10);
}

.bi-hero-main {
  flex: 1;
  min-width: 0;
}

.bi-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--vino);
  opacity: .75;
  margin-bottom: 6px;
}

.bi-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--texto);
  margin: 0 0 8px;
  line-height: 1.2;
}

.bi-copy {
  color: var(--texto-light);
  font-size: 14px;
  margin: 0 0 16px;
  max-width: 600px;
  line-height: 1.5;
}

.bi-hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bi-hero-highlight {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(139, 34, 82, 0.09);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 120px;
}

.bi-hero-highlight-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--texto-light);
  margin-bottom: 4px;
}

.bi-hero-highlight-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--texto);
  line-height: 1.1;
  margin-bottom: 4px;
}

.bi-hero-highlight-value.is-success { color: var(--verde); }
.bi-hero-highlight-value.is-warning { color: #d97706; }
.bi-hero-highlight-value.is-danger  { color: var(--rojo); }

.bi-hero-highlight-meta {
  font-size: 12px;
  color: var(--texto-light);
  line-height: 1.3;
}

.bi-hero-side {
  flex-shrink: 0;
  min-width: 180px;
}

.bi-hero-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bi-status-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(139, 34, 82, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bi-status-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--texto-light);
}

.bi-status-card strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--texto);
}

@media (max-width: 768px) {
  .bi-hero {
    flex-direction: column;
  }
  .bi-hero-side {
    min-width: 0;
    width: 100%;
  }
  .bi-hero-status-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* ── Plan de Producción V2 ──────────────────────────── */
.plan-shell{max-width:860px;margin:0 auto;padding:0 0 4rem}
.plan-header{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}
.plan-header__titulo{display:flex;align-items:center;gap:.75rem}
.plan-header__titulo h1{margin:0;color:var(--vino);font-size:1.45rem;font-weight:700;letter-spacing:0}
.plan-header__meta{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.plan-meta-fecha{color:var(--texto-light);font-size:.86rem}
.plan-vista-tabs{display:flex;gap:.25rem;padding:3px;border:1px solid rgba(139,34,82,.14);border-radius:8px;background:rgba(248,232,238,.72);overflow-x:auto}
.plan-vista-tabs a{display:inline-flex;align-items:center;white-space:nowrap;padding:.38rem .72rem;border-radius:6px;color:#6f5f68;font-size:.8rem;font-weight:700;text-decoration:none}
.plan-vista-tabs a:hover,.plan-vista-tabs a.active{background:var(--vino);color:#fff}
.plan-badge{display:inline-flex;align-items:center;padding:.22rem .65rem;border-radius:999px;font-size:.78rem;font-weight:800}
.plan-badge--SIN_PLAN{background:#f3edf0;color:#6f5f68}.plan-badge--BORRADOR,.plan-badge--CONSUMO_APLICADO{background:rgba(201,168,76,.18);color:#8a5d0d}.plan-badge--LIBERADO,.plan-badge--CERRADO{background:rgba(139,34,82,.12);color:var(--vino)}
.plan-progreso{display:flex;align-items:flex-start;gap:0;margin-bottom:1.2rem;padding-bottom:.35rem;overflow-x:auto}
.plan-progreso__paso{position:relative;display:flex;flex:1 0 92px;flex-direction:column;align-items:center;gap:.35rem;min-width:84px;border:0;background:transparent;color:#8d7b84;cursor:pointer}
.plan-progreso__paso:not(:last-child)::after{content:"";position:absolute;top:14px;left:calc(50% + 16px);width:calc(100% - 32px);height:2px;background:#e8dfe4}
.plan-progreso__paso.completado:not(:last-child)::after{background:var(--vino)}
.plan-progreso__circulo{z-index:1;display:grid;place-items:center;width:30px;height:30px;border:2px solid #e2d5dc;border-radius:50%;background:#fff;color:#9a8790;font-size:.78rem;font-weight:800}
.plan-progreso__paso.activo .plan-progreso__circulo{border-color:var(--vino);color:var(--vino);box-shadow:0 0 0 3px rgba(139,34,82,.12)}
.plan-progreso__paso.completado .plan-progreso__circulo{background:var(--vino);border-color:var(--vino);color:#fff}
.plan-progreso__label{color:inherit;font-size:.72rem;font-weight:800;line-height:1.2;text-align:center}
.plan-progreso__paso.activo,.plan-progreso__paso.completado{color:var(--vino)}
.plan-pasos{display:flex;flex-direction:column;gap:.6rem}
.plan-paso{overflow:hidden;border:1px solid #eadde4;border-radius:10px;background:#fff}
.plan-paso[open]{border-color:rgba(139,34,82,.65);box-shadow:0 8px 24px rgba(139,34,82,.08)}
.plan-paso__header{display:flex;align-items:center;gap:.75rem;padding:.9rem 1rem;list-style:none;cursor:pointer;user-select:none}
.plan-paso__header::-webkit-details-marker{display:none}
.plan-paso__numero{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:50%;background:rgba(248,232,238,.85);color:var(--vino);font-size:.8rem;font-weight:800}
.plan-paso[open] .plan-paso__numero{background:var(--vino);color:#fff}
.plan-paso__info{display:flex;flex:1;flex-direction:column;min-width:0}
.plan-paso__info strong{color:#31242b;font-size:.96rem}.plan-paso__info small{color:#887681;font-size:.79rem}
.plan-paso__chevron{color:#9f8d96;transition:transform .16s ease}.plan-paso[open] .plan-paso__chevron{transform:rotate(180deg)}
.plan-paso__body{padding:1rem 1.15rem 1.15rem;border-top:1px solid #f1e7ec}
.plan-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:.7rem}
.plan-kpi{display:flex;flex-direction:column;gap:.2rem;padding:.72rem .85rem;border:1px solid #f0e3e9;border-radius:8px;background:#fff9fc}
.plan-kpi__label{color:#927f89;font-size:.7rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.plan-kpi__valor{color:var(--vino);font-size:1.05rem;font-weight:800}
.plan-siguiente{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:1rem;padding:1rem;border:1px solid #f0e3e9;border-radius:10px;background:linear-gradient(180deg,#fff,#fff8fb)}
.plan-siguiente__texto{min-width:0}.plan-siguiente__texto span{display:block;color:#927f89;font-size:.72rem;font-weight:900;letter-spacing:.04em;text-transform:uppercase}.plan-siguiente__texto strong{display:block;margin-top:.12rem;color:#31242b;font-size:1rem}.plan-siguiente__texto p{max-width:62ch;margin:.25rem 0 0;color:#6f5f68;font-size:.86rem;line-height:1.35}
.plan-fuente-selector{display:flex;flex-wrap:wrap;gap:.45rem;margin-bottom:.9rem}
.plan-fuente-opcion{display:inline-flex;align-items:center;border:1px solid #e3d4dc;border-radius:999px;background:#fff;color:#67545d;font-size:.84rem;font-weight:800;cursor:pointer}
.plan-fuente-opcion span{display:inline-flex;align-items:center;min-height:40px;padding:.42rem .86rem}.plan-fuente-opcion input{position:absolute;opacity:0;pointer-events:none}.plan-fuente-opcion:has(input:checked){border-color:var(--vino);background:#fff4f8;color:var(--vino)}
.plan-panel-tabla{overflow-x:auto}.plan-tabla{width:100%;border-collapse:collapse;font-size:.86rem}.plan-tabla th{padding:.55rem .65rem;border-bottom:2px solid rgba(139,34,82,.5);color:var(--vino);font-size:.72rem;font-weight:800;letter-spacing:.04em;text-align:left;text-transform:uppercase}.plan-tabla td{padding:.56rem .65rem;border-bottom:1px solid #f0e7ec;color:#352932}.plan-tabla tr:hover td{background:#fff8fb}.plan-tabla__num{text-align:right;font-variant-numeric:tabular-nums}
.plan-input-cantidad,.plan-input-ajuste,.plan-select-destino{min-height:38px;border:1px solid #ddccd5;border-radius:6px;background:#fff;color:#30262c;font:inherit}.plan-input-cantidad,.plan-input-ajuste{width:88px;padding:.3rem .5rem;text-align:right}.plan-select-destino{padding:.3rem .5rem}.plan-input-cantidad:focus,.plan-input-ajuste:focus,.plan-select-destino:focus{outline:0;border-color:var(--vino);box-shadow:0 0 0 3px rgba(139,34,82,.11)}
.plan-hint{display:flex;align-items:center;min-height:42px;margin:0;padding:.75rem .9rem;border:1px solid #f0e3e9;border-radius:8px;background:#fff9fc;color:#796871;font-size:.84rem}.plan-hint--cargando{color:var(--vino)}.plan-hint--error{border-color:rgba(139,34,82,.22);background:#fff1f5;color:var(--vino)}
.plan-bom-tabs{display:flex;gap:.25rem;margin-bottom:.85rem;border-bottom:1px solid #eadde4}.plan-bom-tab{display:inline-flex;align-items:center;gap:.4rem;margin-bottom:-1px;padding:.52rem .85rem;border:0;border-bottom:2px solid transparent;background:transparent;color:#76646d;font-size:.86rem;font-weight:800;cursor:pointer}.plan-bom-tab.active{border-bottom-color:var(--vino);color:var(--vino)}
.plan-badge-count{min-width:1.3rem;padding:.05rem .38rem;border-radius:999px;background:rgba(201,168,76,.18);color:#8a5d0d;font-size:.72rem;text-align:center}
.plan-checklist{display:grid;gap:.55rem}.plan-check-item{display:flex;align-items:center;gap:.65rem;padding:.65rem .8rem;border:1px solid #f0e3e9;border-radius:8px;background:#fff9fc;color:#3d3038;font-size:.9rem;font-weight:800;cursor:pointer}.plan-check-item input{width:16px;height:16px;accent-color:var(--vino)}.plan-check-item:has(input:checked){border-color:rgba(139,34,82,.26);background:rgba(248,232,238,.72);color:var(--vino)}
.plan-resumen-liberacion{margin-top:.9rem}.plan-accion-row{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin-top:1rem;padding-top:1rem;border-top:1px solid #f0e7ec}
.plan-btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:.55rem 1rem;border:1px solid transparent;border-radius:8px;font-size:.86rem;font-weight:800;text-decoration:none;cursor:pointer;touch-action:manipulation;transition:transform .12s ease,box-shadow .12s ease,background .12s ease}.plan-btn:disabled{opacity:.48;cursor:not-allowed}.plan-btn:hover:not(:disabled){transform:translateY(-1px)}.plan-btn--primario,.plan-btn--liberar{background:var(--vino);border-color:var(--vino);color:#fff;box-shadow:0 8px 18px rgba(139,34,82,.18)}.plan-btn--secundario{background:#f8edf3;border-color:#ead4df;color:var(--vino)}.plan-btn--outline{background:#fff;border-color:#dac7d1;color:#5d4d55}
.plan-btn:focus-visible,.plan-vista-tabs a:focus-visible,.plan-progreso__paso:focus-visible,.plan-paso__header:focus-visible,.plan-bom-tab:focus-visible{outline:3px solid rgba(201,168,76,.55);outline-offset:3px}.plan-fuente-opcion:focus-within,.plan-check-item:focus-within{box-shadow:0 0 0 3px rgba(201,168,76,.28)}
.plan-flujo-diagrama{display:flex;align-items:center;flex-wrap:wrap;gap:.45rem;padding:.5rem 0}.plan-flujo-nodo{display:inline-flex;align-items:center;justify-content:center;min-height:42px;min-width:78px;padding:.55rem .75rem;border:1px solid #eadde4;border-radius:8px;background:#fff9fc;color:var(--vino);font-size:.78rem;font-weight:800;text-align:center}.plan-flujo-nodo--liberado{border-color:rgba(201,168,76,.38);background:rgba(201,168,76,.13);color:#8a5d0d}.plan-flujo-flecha{color:#b69aa8;font-weight:800}
.plan-secundaria{padding:.5rem 0 4rem}.plan-secundaria h2{margin:0 0 1rem;color:var(--vino);font-size:1.12rem;font-weight:800}
.plan-toast{position:fixed;right:1.25rem;bottom:1.25rem;z-index:9999;max-width:min(360px,calc(100vw - 2.5rem));padding:.7rem 1rem;border:1px solid rgba(139,34,82,.22);border-radius:8px;background:#fff;box-shadow:0 12px 30px rgba(49,36,43,.16);color:var(--vino);font-size:.88rem;font-weight:800;animation:plan-toast-in .18s ease-out}.plan-toast--ok{border-color:rgba(201,168,76,.38);color:#8a5d0d}.plan-toast--error{background:#fff1f5}@keyframes plan-toast-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){.plan-toast,.plan-btn,.plan-paso__chevron{animation:none;transition:none}.plan-btn:hover:not(:disabled){transform:none}}
.plan-produccion-shell>.plan-daily-header,.plan-produccion-shell>.plan-daily-tabs,.plan-produccion-shell>.plan-daily-section,.plan-produccion-shell>.plan-daily-layout,.plan-produccion-shell>.plan-process-board{display:none}
@media (min-width:900px) and (max-width:1099px){.plan-shell{max-width:1040px}.plan-header__titulo h1{font-size:1.6rem}.plan-kpis{grid-template-columns:repeat(4,minmax(118px,1fr))}}
@media (max-width:720px){.page-plan-produccion .main-content{overflow-x:hidden}.plan-shell{width:100%;max-width:100%;padding:0 .75rem 2.5rem}.plan-header{flex-direction:column}.plan-header__meta{width:100%;min-width:0}.plan-vista-tabs{width:100%;max-width:100%;scroll-snap-type:x proximity}.plan-vista-tabs a{flex:0 0 auto;scroll-snap-align:start}.plan-progreso{max-width:100%;margin-inline:0}.plan-progreso__paso{flex:0 0 76px;min-width:76px}.plan-kpis{grid-template-columns:1fr 1fr}.plan-siguiente{align-items:stretch;flex-direction:column}.plan-paso__body{padding:.9rem}.plan-accion-row{align-items:stretch;flex-direction:column}.plan-btn{width:100%;min-height:44px}.plan-input-cantidad,.plan-input-ajuste,.plan-select-destino{min-height:44px}.plan-fuente-opcion span{min-height:44px}.plan-flujo-diagrama{align-items:stretch;flex-direction:column}.plan-flujo-flecha{transform:rotate(90deg);align-self:center}}
.plan-desktop-resumen{display:none}
@media (min-width:1100px){
  .page-plan-produccion .container{width:100%;margin:0;padding:clamp(18px,1.8vw,30px) clamp(22px,2.2vw,40px)}
  .plan-shell{width:100%;max-width:1500px;margin:0;padding:clamp(18px,1.8vw,30px) clamp(22px,2.2vw,40px) 4rem}
  .plan-header{display:grid;grid-template-columns:minmax(320px,1fr) auto;align-items:end;margin-bottom:1.15rem}
  .plan-header__titulo h1{font-size:1.7rem}
  .plan-operativo{display:grid;grid-template-columns:minmax(0,1fr) 320px;grid-template-areas:"progreso progreso" "pasos resumen";gap:1rem 1.15rem;align-items:start}
  .plan-progreso{grid-area:progreso;max-width:1120px;margin-bottom:.2rem}
  .plan-pasos{grid-area:pasos;gap:.7rem;min-width:0}
  .plan-paso__header{padding:1rem 1.15rem}
  .plan-paso__body{padding:1.15rem 1.25rem 1.25rem}
  .plan-kpis{grid-template-columns:repeat(4,minmax(132px,1fr))}
  .plan-desktop-resumen{position:sticky;top:1.2rem;grid-area:resumen;display:block;border:1px solid #eadde4;border-radius:12px;background:#fff;box-shadow:0 10px 28px rgba(139,34,82,.07);padding:1rem}
  .plan-desktop-resumen__header{display:flex;align-items:flex-start;justify-content:space-between;gap:.8rem;padding-bottom:.8rem;border-bottom:1px solid #f0e7ec;color:#31242b;font-size:.95rem;font-weight:900}
  .plan-desktop-resumen__header strong{display:inline-flex;align-items:center;min-height:24px;padding:.18rem .55rem;border-radius:999px;background:rgba(201,168,76,.18);color:#8a5d0d;font-size:.76rem}
  .plan-desktop-resumen__datos{display:grid;gap:.65rem;margin:.9rem 0 0}
  .plan-desktop-resumen__datos div{display:grid;grid-template-columns:96px 1fr;gap:.65rem;align-items:baseline}
  .plan-desktop-resumen__datos dt{color:#927f89;font-size:.72rem;font-weight:900;letter-spacing:.04em;text-transform:uppercase}
  .plan-desktop-resumen__datos dd{margin:0;color:var(--vino);font-size:.95rem;font-weight:900;text-align:right}
  .plan-desktop-resumen__flujo{display:grid;gap:.45rem;margin:1rem 0 0;padding:.9rem 0 0 1.1rem;border-top:1px solid #f0e7ec;color:#6f5f68;font-size:.82rem;font-weight:800}
  .plan-desktop-resumen__flujo li::marker{color:var(--dorado)}
  .plan-desktop-resumen__acciones{display:grid;gap:.55rem;margin-top:1rem;padding-top:1rem;border-top:1px solid #f0e7ec}
  .plan-desktop-resumen__acciones .plan-btn{width:100%}
}
@media (min-width:1500px){
  .plan-shell{max-width:1680px}
  .plan-operativo{grid-template-columns:minmax(820px,1080px) 340px;gap:1.1rem 1.35rem}
}
@media (min-width:1900px){
  .plan-shell{max-width:1760px}
  .plan-operativo{grid-template-columns:minmax(900px,1160px) 360px}
}
/* Progressive action feedback: floating, non-blocking and layout-stable. */
.erp-toast-region {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 1500;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}
.erp-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid #d8c8d0;
  border-left: 4px solid #486b57;
  border-radius: 12px;
  background: #fff;
  color: #31242b;
  box-shadow: 0 14px 36px rgba(49, 36, 43, .18);
  pointer-events: auto;
  animation: erp-toast-in 160ms ease-out;
}
.erp-toast--error { border-left-color: #a32945; }
.erp-toast--warning { border-left-color: #a26b0b; }
.erp-toast--info { border-left-color: #326a88; }
.erp-toast__close { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 22px; line-height: 1; }
.erp-toast__close:focus-visible { outline: 3px solid rgba(139, 34, 82, .28); outline-offset: 2px; }
@keyframes erp-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .erp-toast-region { right: 16px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .erp-toast { animation: none; }
}
.erp-confirm[hidden] { display: none; }
.erp-confirm { position: fixed; inset: 0; z-index: 1600; display: grid; place-items: center; padding: 20px; }
.erp-confirm__backdrop { position: absolute; inset: 0; background: rgba(49, 36, 43, .45); }
.erp-confirm__panel { position: relative; width: min(460px, 100%); padding: 22px; border-radius: 14px; background: #fff; box-shadow: 0 24px 60px rgba(49, 36, 43, .28); }
.erp-confirm__panel h2 { margin: 0 0 8px; color: var(--vino); }
.erp-confirm__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
