/* === 00-fonts-local.css === */
/* Fuentes locales — evita peticiones bloqueantes a Google Fonts */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/roboto-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/roboto-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/roboto-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/roboto-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('assets/fonts/material-icons.woff2') format('woff2');
}
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* === 01-variables.css === */
/* Tema Pangu — más contraste y color; texto legible Google/Android */
:root {
  /* Marca Pangu (reservado logo / alertas fuertes) */
  --brand-red: #e31b23;
  --brand-red-dark: #c4161e;
  --brand-red-darker: #a81218;
  --brand-yellow: #ffcc00;
  --brand-yellow-dark: #e6b800;
  --brand-yellow-tint: #fff3bf;
  --brand-red-tint: #fde8e9;
  --brand-red-light: #f9c4c6;

  /* Google Classic Blue — chrome principal */
  --google-chrome-blue: #1a73e8;
  --google-chrome-blue-dark: #1967d2;
  --google-chrome-blue-darker: #1557b0;
  --google-chrome-surface: #e8f0fe;

  /* Tipografía — alto contraste */
  --text-primary: #1a1a1a;
  --text-secondary: #444746;
  --text-muted: #6b7280;
  --text-on-brand: #ffffff;

  /* Enlaces */
  --link: #1565d8;
  --link-hover: #0d47a1;
  --link-visited: #681da8;

  /* Superficies con más color */
  --gray-light: #e8edf4;
  --gray-medium: #c5cdd8;
  --white: #ffffff;
  --bg-base: #e4ecf6;
  --bg-surface: #f6f9fd;
  --bg-card: #ffffff;
  --bg-elevated: #edf2fa;
  --bg-panel: linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);

  /* Aliases */
  --blue: var(--link);
  --border: #b0bcc9;
  --border-strong: #8fa3b8;
  --border-accent: var(--google-blue-mid);
  --accent: var(--google-chrome-blue);
  --accent-hover: var(--google-chrome-blue-dark);
  --accent-pressed: var(--google-chrome-blue-darker);
  --google-blue-tint: #d4e4fc;
  --google-blue-light: #a8c7fa;
  --google-blue-mid: #7baaf7;
  --google-teal-tint: #d7f0e8;
  --google-purple-tint: #ede7f6;
  --success: #0d7a3e;
  --success-tint: #ceead6;
  --warning: #e37400;
  --warning-tint: #ffe082;
  --danger: #c5221f;
  --danger-tint: #fce8e6;

  /* Fondos con gradiente */
  --gradient-page-bg: linear-gradient(165deg, #c8daf5 0%, #dce8f7 38%, #e8eef6 68%, #f0f4fa 100%);
  --gradient-app-bar: linear-gradient(180deg, #1a73e8 0%, #1967d2 55%, #1557b0 100%);
  --gradient-page-hero: linear-gradient(135deg, #aecbfa 0%, #c5d9f8 42%, #dce8f7 78%, #f0f6ff 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #f4f8fe 100%);
  --gradient-filter: linear-gradient(180deg, #edf3fc 0%, #e2ebf8 100%);
  --btn-primary: #1565d8;
  --btn-primary-hover: #0d47a1;
  --btn-primary-pressed: #0a3d91;
  --radius-shell: 8px;
  --radius-card: 8px;
  --radius-input: 4px;
  --shadow-hero: 0 3px 12px rgba(21, 101, 216, 0.22), 0 1px 4px rgba(60, 64, 67, 0.14);
  --shadow-card: 0 2px 8px rgba(21, 101, 216, 0.14), 0 1px 3px rgba(60, 64, 67, 0.18);
  --shadow-card-hover: 0 6px 18px rgba(21, 101, 216, 0.2), 0 2px 6px rgba(60, 64, 67, 0.16);
  --border-card: 1px solid #9eb4d0;
  --table-head-bg: #c5d5e8;
  --table-head-text: #1a1a1a;
  --table-row-base: #ffffff;
  --table-row-alt: #e8eef6;
  --table-row-hover: #d4e4fc;
  --table-border: #b0bcc9;
  /* Hoja de cálculo (solo colores; dimensiones en 09-mobile-sheet-tables) */
  --sheet-row-base: #ffffff;
  --sheet-row-alt: #dbe4f0;
  --sheet-row-hover: #c8daf5;
  --sheet-head-bg: #b8c9de;
  --sheet-border-row: #a8b8ca;
  --sheet-border-head: #7f97b0;
  /* Densidad uniforme */
  --bodega-row-py: 0.26rem;
  --bodega-row-px: 0.5rem;
  --bodega-row-fs: 0.82rem;
  --bodega-row-lh: 1.2;
  --bodega-field-h: 2rem;
  --bodega-field-py: 0.24rem;
  --bodega-field-px: 0.45rem;
  --bodega-field-fs: 0.84rem;
  --bodega-form-gap: 0.35rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  background: var(--gradient-page-bg);
  background-attachment: fixed;
  color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
}
p, li, td, th, label, .muted {
  color: inherit;
}
label,
.form-group label,
.rrhh-page-sub,
.card-hint,
.page-sub,
.subtitle {
  color: var(--text-secondary);
}
/* === 02-login-forms-buttons.css === */
/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-page-bg);
}
.login-box {
  background: var(--white);
  padding: 2.5rem 2.75rem;
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow-card-hover);
  border: var(--border-card);
  width: 100%;
  max-width: 380px;
}
.login-logo-wrap {
  width: min(220px, 80%);
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  transform: none;
  -webkit-backface-visibility: hidden;
}
.login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.login-box h1 {
  margin: 0 0 1.5rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}
.login-box .error { color: var(--danger); font-size: 0.9rem; margin-bottom: 0.75rem; }
.login-box .hint { font-size: 0.8rem; color: var(--text-secondary); margin-top: 1rem; }

/* Login: mismo ancho email y contraseña (el sitio limita email/tel a 180px en .form-group) */
.login-box .form-group input[type="email"],
.login-box .form-group input[type="password"] {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.login-box button[type="submit"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-input);
  border: none;
  background: var(--btn-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease;
}
.login-box button[type="submit"]:hover {
  background: var(--btn-primary-hover);
}

/* Formularios */
.form-group { margin-bottom: var(--bodega-form-gap, 0.6rem); }
.form-group label {
  display: block;
  margin-bottom: 0.12rem;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: var(--bodega-field-h, 2rem);
  padding: var(--bodega-field-py, 0.24rem) var(--bodega-field-px, 0.45rem);
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  font-size: var(--bodega-field-fs, 0.84rem);
  line-height: var(--bodega-row-lh, 1.2);
  font-family: "Roboto", sans-serif;
  outline: none;
  background: var(--white);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: 0.85rem;
  height: 0.85rem;
  min-width: 0.85rem;
  min-height: 0.85rem;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  accent-color: var(--primary, #1a73e8);
  flex-shrink: 0;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="email"] {
  max-width: 180px;
}
.form-group input.short,
.form-group select.short {
  max-width: 160px;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.25);
}

/* Botones estilo Google — planos, sin gradiente 3D */
button,
.btn {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-input);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: "Roboto", sans-serif;
  letter-spacing: normal;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
button.primary,
.btn.primary,
.btn:not(.secondary):not(.btn-secondary):not(.danger):not(.warning):not(.success):not(.btn-act-icon):not(.link-act-icon) {
  background: var(--btn-primary);
  color: var(--white);
  box-shadow: none;
}
button.secondary,
.btn.secondary,
.btn-secondary {
  background: var(--white);
  color: var(--link);
  border: 1px solid var(--border);
  box-shadow: none;
}
button.danger,
.btn.danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: none;
}
.btn.success,
button.success {
  background: var(--success);
  color: var(--white);
  box-shadow: none;
}
.btn.warning,
button.warning {
  background: var(--brand-yellow-tint);
  color: #8a6d00;
  border: 1px solid var(--brand-yellow);
  box-shadow: none;
}
button:hover,
.btn:hover {
  box-shadow: none;
  transform: none;
}
button.primary:hover, .btn.primary:hover, .btn:hover:not(.secondary):not(.btn-secondary):not(.warning):not(.danger):not(.btn-act-icon):not(.link-act-icon) {
  background: var(--btn-primary-hover);
  color: var(--white);
}
button.secondary:hover, .btn-secondary:hover, .btn.secondary:hover {
  background: var(--google-blue-tint);
  border-color: var(--google-blue-light);
}
button.danger:hover, .btn.danger:hover {
  background: #a50e0e;
}
button.success:hover, .btn.success:hover {
  background: #0d652d;
}
button:active,
.btn:active:not(.btn-act-icon):not(.link-act-icon) {
  background: var(--btn-primary-pressed);
  transform: none;
}
button.secondary:active, .btn-secondary:active, .btn.secondary:active {
  background: var(--google-blue-light);
}


/* === 03-layout.css === */
/* Layout principal */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--gradient-page-bg);
}

/* App bar — mismo lenguaje visual que el hero de Operaciones */
.app-bar {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 1rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-top: max(0px, env(safe-area-inset-top, 0px));
  background: var(--gradient-app-bar);
  color: var(--white);
  box-shadow: 0 3px 12px rgba(26, 115, 232, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 -0.5rem;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  border-radius: 50%;
  transition: background .2s;
}
.menu-toggle:hover {
  background: rgba(255,255,255,.2);
}
.menu-toggle .material-icons {
  font-size: 24px;
}
.app-bar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 500;
  margin-left: 0.5rem;
}
.app-logo {
  font-size: 28px !important;
  opacity: .95;
}
.app-bar-logo-wrap {
  width: 108px;
  height: 48px;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.app-bar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.app-bar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-bar-user .user-name {
  font-size: 0.9rem;
  color: var(--white);
  opacity: .95;
}
.app-bar-user .badge-role {
  background: rgba(255,255,255,.25);
  color: var(--white);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
.realtime-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(120, 53, 15, 0.72);
  color: var(--white);
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}
.realtime-status[hidden] { display: none !important; }
.realtime-status .material-icons { font-size: 1rem; }
@media (max-width: 900px) {
  .realtime-status { padding: 0.3rem; }
  .realtime-status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.app-bar-ia {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #1d4e9e 0%, #102a54 72%);
  box-shadow: 0 2px 6px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.2);
  color: var(--white);
  transition: transform .15s, box-shadow .15s;
}
.app-bar-ia:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25);
}
.app-bar-ia svg {
  width: 24px;
  height: 24px;
  display: block;
}
.notif-bell-wrap {
  position: relative;
}
.presence-led-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.presence-led {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  cursor: default;
}
.presence-led-lamp {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #9aa0a6, #3c4043 62%, #202124);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.25), 0 0 0 1px rgba(0,0,0,0.35);
}
.presence-led.is-on .presence-led-lamp {
  background: radial-gradient(circle at 35% 30%, #d1fae5, #22c55e 55%, #15803d);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.55),
    0 0 0 1px rgba(22, 163, 74, 0.45),
    0 0 8px 2px rgba(34, 197, 94, 0.75);
  animation: presence-led-pulse 1.6s ease-in-out infinite;
}
.presence-led-count {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  min-width: 0.7rem;
  text-align: center;
}
.presence-led-tip {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 12rem;
  max-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: #202124;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  z-index: 1300;
  text-align: left;
}
.presence-led-wrap.is-on:hover .presence-led-tip,
.presence-led-wrap.is-on:focus-within .presence-led-tip {
  display: block;
}
.presence-led-tip strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6368;
  margin-bottom: 0.35rem;
}
.presence-led-tip ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.presence-led-tip li {
  font-size: 0.82rem;
  line-height: 1.3;
  padding: 0.18rem 0;
  border-top: 1px solid #f1f3f4;
}
.presence-led-tip li:first-child { border-top: 0; padding-top: 0; }
.presence-led-tip li span {
  color: #80868b;
  font-size: 0.75rem;
}
@keyframes presence-led-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
.notif-bell-btn {
  position: relative;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
}
.notif-bell-btn:hover {
  background: rgba(0, 0, 0, 0.34);
}
.notif-bell-btn .material-icons {
  font-size: 1.35rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #ffc107;
  color: #1a237e;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.1rem;
  text-align: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.notif-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(22rem, calc(100vw - 1.2rem));
  max-height: min(70vh, 26rem);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #202124;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  z-index: 1200;
  overflow: hidden;
}
.notif-panel[hidden] { display: none !important; }
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e8eaed;
  background: #f8f9fa;
}
.notif-panel-head strong { font-size: 0.9rem; }
.notif-list {
  overflow-y: auto;
  max-height: 22rem;
  min-height: 0;
}
.notif-empty {
  margin: 0;
  padding: 1rem 0.85rem;
  font-size: 0.85rem;
}
.notif-item {
  display: block;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f3f4;
  text-decoration: none;
  color: inherit;
  background: #eef4ff;
}
.notif-item.is-read { background: #fff; }
.notif-item:hover { background: #e8f0fe; }
.notif-item-title {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  margin-bottom: 0.15rem;
  overflow-wrap: anywhere;
}
.notif-item-body {
  display: block;
  font-size: 0.78rem;
  color: #5f6368;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.notif-item-time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #80868b;
}
.notif-toast-host {
  position: fixed;
  top: 4.2rem;
  right: 0.75rem;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  pointer-events: none;
}
.notif-toast {
  pointer-events: auto;
  display: block;
  text-decoration: none;
  color: #202124;
  background: #fff;
  border-left: 4px solid #1a73e8;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  padding: 0.7rem 0.85rem;
  animation: notifToastIn .2s ease-out;
}
.notif-toast strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 0.15rem;
}
.notif-toast span {
  display: block;
  font-size: 0.78rem;
  color: #5f6368;
}
.notif-toast.is-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .28s, transform .28s;
}
@keyframes notifToastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  /* La campana no está en el borde derecho de la barra, así que anclar el panel
     a ella lo dejaba fuera de pantalla: se centra en el viewport. El JS ajusta
     top y max-height al alto real de la barra; esto es el respaldo. */
  .notif-panel {
    position: fixed;
    top: 3.5rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(24rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 4.25rem);
    max-height: calc(100dvh - 4.25rem);
  }
  .notif-panel-head {
    flex-wrap: wrap;
  }
  .notif-list {
    max-height: none;
    flex: 1 1 auto;
  }
}
.global-search-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.global-search-mobile-toggle:hover,
.global-search-mobile-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}
.global-search-mobile-toggle .material-icons {
  font-size: 24px;
}
.global-search-mobile-close {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
}
.global-search-mobile-close .material-icons {
  font-size: 1.35rem !important;
}
.global-search-wrap {
  position: relative;
  margin-left: 1rem;
  flex: 1;
  max-width: min(560px, 42vw);
  z-index: 1100;
}
.global-search-input {
  width: 100%;
  padding: 0.45rem 0.65rem 0.45rem 2.1rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius-input);
  background: rgba(255,255,255,.22);
  color: var(--white);
  font-size: 0.9rem;
  font-family: "Roboto", sans-serif;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.global-search-input::placeholder { color: rgba(255,255,255,.8); }
.global-search-input:focus {
  border-color: var(--white);
  background: rgba(255,255,255,.25);
  outline: none;
}
.global-search-wrap .global-search-icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: rgba(255,255,255,.9);
  pointer-events: none;
}
/* Panel de búsqueda global — estilo Google + barra lateral */
.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: min(100%, 520px);
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(60, 64, 67, 0.18), 0 2px 8px rgba(60, 64, 67, 0.08);
  max-height: min(70vh, 480px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1200;
}
.global-search-results.gs-has-nav {
  min-width: min(100%, 640px);
  max-height: min(80vh, 560px);
}
.gs-layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.gs-nav {
  flex: 0 0 auto;
  width: 9.5rem;
  max-width: 38%;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.35rem;
  background: var(--bg-base);
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #b0bec5 transparent;
}
.gs-nav-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  cursor: pointer;
  text-align: left;
  color: #37474f;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.12s ease, color 0.12s ease;
}
.gs-nav-item:hover {
  background: var(--google-blue-tint);
  color: var(--text-primary);
}
.gs-nav-item.is-active {
  background: var(--google-blue-tint);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--link);
}
.gs-nav-icon {
  font-size: 1rem !important;
  flex-shrink: 0;
  color: var(--text-secondary);
  opacity: 0.9;
}
.gs-nav-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-nav-count {
  flex-shrink: 0;
  min-width: 1.15rem;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  background: #e3eaf2;
  color: #455a64;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
}
.gs-nav-item.is-active .gs-nav-count {
  background: var(--accent);
  color: #fff;
}
.gs-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.gs-loading,
.gs-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.gs-empty-icon {
  font-size: 2rem !important;
  color: var(--text-muted);
  display: block;
  margin: 0 auto 0.35rem;
}
.gs-empty-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}
.gs-loading .spin {
  animation: gs-spin 0.9s linear infinite;
  vertical-align: middle;
  margin-right: 0.35rem;
}
@keyframes gs-spin {
  to { transform: rotate(360deg); }
}
.gs-list {
  overflow-y: visible;
  padding: 0.35rem 0;
  flex: 1 1 auto;
}
.gs-scroll-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.gs-elevator-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2rem;
  border: none;
  background: #f0f4f8;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.gs-elevator-btn .material-icons {
  font-size: 1.35rem !important;
}
.gs-elevator-btn:hover:not(:disabled) {
  background: var(--google-blue-tint);
  color: var(--text-primary);
}
.gs-elevator-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.gs-elevator-up {
  border-bottom: 1px solid #e8ecf0;
  border-radius: 16px 16px 0 0;
}
.gs-elevator-down {
  border-top: 1px solid #e8ecf0;
}
.gs-list-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.gs-list.gs-list--scroll {
  max-height: calc(4.35rem * 6);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #90a4ae #eef2f6;
}
.gs-list.gs-list--scroll::-webkit-scrollbar {
  width: 10px;
}
.gs-list.gs-list--scroll::-webkit-scrollbar-track {
  background: #eef2f6;
  border-radius: 8px;
}
.gs-list.gs-list--scroll::-webkit-scrollbar-thumb {
  background: #90a4ae;
  border-radius: 8px;
  border: 2px solid #eef2f6;
}
.gs-list.gs-list--scroll::-webkit-scrollbar-thumb:hover {
  background: #607d8b;
}
.global-search-results.gs-has-elevator {
  max-height: min(78vh, 520px);
}
.global-search-results.gs-has-nav.gs-has-elevator {
  max-height: min(82vh, 580px);
}
.gs-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f3f6;
  transition: background 0.12s ease;
}
.gs-item:last-child {
  border-bottom: none;
}
.gs-item:hover,
.gs-item.is-active {
  background: #f1f7ff;
}
.gs-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--google-blue-tint);
  color: var(--text-secondary);
  font-size: 20px !important;
}
.gs-item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.gs-item-type {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.gs-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a0dab;
  line-height: 1.25;
  word-break: break-word;
}
.gs-item:hover .gs-item-title,
.gs-item.is-active .gs-item-title {
  text-decoration: underline;
}
.gs-item-sub,
.gs-item-meta {
  font-size: 0.8rem;
  color: #4d5156;
  line-height: 1.3;
  word-break: break-word;
}
.gs-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.gs-item-ext {
  flex-shrink: 0;
  font-size: 1rem !important;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.gs-mark {
  background: #fff3b0;
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
  font-weight: 700;
}
.gs-footer {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid #eef1f4;
  background: #fafbfc;
  border-radius: 0 0 16px 16px;
}
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--white);
  border-radius: 50%;
  transition: background .2s;
}
.btn-icon:hover {
  background: rgba(255,255,255,.2);
}

/* Sidebar — fondo blanco, borde azul */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--white);
  box-shadow: 6px 0 28px rgba(227, 27, 35, 0.12);
  border-right: 1px solid rgba(227, 27, 35, 0.12);
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
}
.sidebar.is-open {
  transform: translateX(0);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.sidebar-header strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  transition: background .2s;
}
.sidebar-close:hover {
  background: var(--gray-light);
  color: var(--text-primary);
}
.sidebar .user-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar .badge {
  background: var(--gray-light);
  color: var(--text-secondary);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.15rem;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.sidebar-nav > a,
.sidebar-nav > .sidebar-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.sidebar-nav > .sidebar-group {
  display: block;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background .15s, color .15s;
  min-width: 0;
}
.sidebar-nav a:hover {
  background: var(--gray-light);
  color: var(--text-primary);
}
.sidebar-nav a .material-icons {
  font-size: 20px;
  color: var(--text-muted);
}
.sidebar-nav a:hover .material-icons {
  color: var(--text-secondary);
}
.sidebar-nav a.nav-active {
  background: var(--google-blue-tint);
  color: var(--text-primary);
  font-weight: 500;
  border-left: 3px solid var(--btn-primary);
  padding-left: calc(0.9rem - 3px);
}
.sidebar-nav a.nav-active .material-icons {
  color: var(--text-secondary);
}
.sidebar-nav .sidebar-group {
  margin: 0.1rem 0;
  border-radius: 8px;
}
.sidebar-group:not([open]) > .sidebar-group-links {
  display: none;
}
.sidebar-group-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  user-select: none;
  transition: background .15s, color .15s;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.sidebar-group-summary::-webkit-details-marker { display: none; }
.sidebar-group-summary::marker { content: ''; }
.sidebar-group-summary .material-icons:first-of-type {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sidebar-group-summary > span:not(.material-icons) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-group-chevron {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 20px !important;
  color: var(--text-muted) !important;
  transition: transform .2s;
}
.sidebar-group[open] .sidebar-group-chevron {
  transform: rotate(180deg);
}
.sidebar-group:has(.nav-active) .sidebar-group-summary {
  color: var(--text-primary);
  font-weight: 500;
}
.sidebar-group:has(.nav-active) .sidebar-group-summary .material-icons:first-of-type {
  color: var(--text-secondary);
}
.sidebar-group-summary:hover {
  background: var(--gray-light);
  color: var(--text-primary);
}
.sidebar-group-summary:hover .material-icons {
  color: var(--text-secondary);
}
.sidebar-group-links {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.15rem 0 0.4rem 0.35rem;
  margin: 0 0 0.25rem 0.65rem;
  border-left: 2px solid var(--border);
}
.sidebar-group-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-group-links a .material-icons {
  font-size: 18px;
  color: var(--text-muted);
}
.sidebar-group-links a:hover {
  background: var(--gray-light);
  color: var(--text-primary);
}
.sidebar-group-links a:hover .material-icons { color: var(--text-secondary); }
.sidebar-group-links a.nav-active {
  background: var(--google-blue-tint);
  color: var(--text-primary);
  font-weight: 500;
  border-left: 3px solid var(--btn-primary);
  margin-left: -2px;
  padding-left: calc(0.55rem - 1px);
}
.sidebar-group-links a.nav-active .material-icons { color: var(--text-secondary); }
.sidebar-logout {
  margin-top: 1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.content {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 1.25rem 1.5rem;
  overflow: auto;
  margin-top: 0;
  background: transparent;
}
/* h2 de sección (no sustituye al título de página siguiente) */
.content h2 {
  margin: 0.9rem 0 0.55rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
}
.content .card h2 {
  margin-top: 0;
}

/* === 04-dashboard-cards.css === */
/* Título principal: hero alineado con Operaciones (incl. módulos calidad con .calidad-page) */
.content > h2:first-of-type,
.content .calidad-page > h2:first-of-type {
  margin: 0 0 1.1rem;
  padding: 1.05rem 1.25rem;
  font-size: 1.48rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #0d2d6b;
  background: var(--gradient-page-hero);
  border: 1px solid var(--google-blue-mid);
  border-left: 5px solid var(--btn-primary);
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow-hero);
}
.content > h2:first-of-type a,
.content .calidad-page > h2:first-of-type a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.content > h2:first-of-type a:hover,
.content .calidad-page > h2:first-of-type a:hover {
  color: var(--link-hover);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
/* Inicio (escritorio): una fila compacta; si no caben, scroll horizontal */
.cards.dashboard-cards.dashboard-cards-narrow {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  grid-template-columns: unset;
}
.dashboard-cards-narrow a.card-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  flex: 1 1 0;
  min-width: 4.5rem;
  height: auto;
  min-height: 2.55rem;
  max-height: none;
  padding: 0.32rem 0.48rem;
  gap: 0.4rem;
  box-sizing: border-box;
}
.dashboard-cards-narrow .card:not(a) {
  padding: 0.35rem 0.45rem;
  min-height: 0;
}
.dashboard-cards-narrow .card h3 {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.18;
  flex: 1 1 auto;
  min-width: 0;
  order: 1;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-cards-narrow .card .big {
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  flex: 0 0 auto;
  order: 2;
  min-width: 1.6rem;
  text-align: right;
  align-self: center;
}
.dashboard-cards-narrow a.card-link .card-hint {
  display: none !important;
}
.dashboard-cards-narrow .card-hint {
  font-size: 0.63rem;
  line-height: 1.08;
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card {
  background: var(--white);
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: var(--border-card);
  transition: box-shadow .2s, transform .15s, border-color .15s;
}
.card-narrow {
  max-width: 520px;
  margin: 0 auto 0.75rem;
}
/* Tarjetas semáforo: ok = gris neutro; alerta = amarillo pastel */
.card.card-semaforo-ok,
body.pangu-next .content a.home-role-task.home-returns-button:not(.has-pending) {
  background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f4 100%) !important;
  border: 1px solid #dadce0 !important;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12), inset 0 1px 0 rgba(255,255,255,.6);
  border-radius: 8px;
}
.card.card-semaforo-ok .card-hint,
.card.card-semaforo-ok h3,
.card.card-semaforo-ok .big { color: #5f6368; }
.card.card-semaforo-ok .card-hint { opacity: .9; }
.card.card-semaforo-alerta,
body.pangu-next .content a.home-role-task.home-returns-button.has-pending {
  background: linear-gradient(180deg, #fff9e5 0%, #fff3d4 48%, #ffedad 100%) !important;
  border: 1px solid #e8dba0 !important;
  box-shadow: 0 2px 5px rgba(180, 150, 60, 0.14), inset 0 1px 0 rgba(255,255,255,.7);
  border-radius: 8px;
}
.card.card-semaforo-alerta .card-hint,
.card.card-semaforo-alerta h3,
.card.card-semaforo-alerta .big { color: #6b5e2e; }
.card.card-semaforo-alerta .card-hint { opacity: .92; color: #7a6d3a; }
.card.card-semaforo.card-link:hover,
body.pangu-next .content a.home-role-task.home-returns-button:hover {
  box-shadow: 0 4px 10px rgba(60, 64, 67, 0.16), inset 0 1px 0 rgba(255,255,255,.4);
}
.card.card-semaforo-alerta.card-link:hover,
body.pangu-next .content a.home-role-task.home-returns-button.has-pending:hover {
  box-shadow: 0 3px 8px rgba(180, 150, 60, 0.2), inset 0 1px 0 rgba(255,255,255,.65);
  border-color: #e2d492 !important;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(25, 118, 210, 0.22);
}
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(25,118,210,.2);
}
.card-link .card-hint {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  color: var(--blue);
}
.card-link:hover .card-hint {
  text-decoration: underline;
}
/* Por encima de .card-link .card-hint: panel inicio conserva tipografía del grid */
.dashboard-cards-narrow a.card-link:hover .card-hint {
  text-decoration: none;
}
.card-semaforo-ok .card-hint { color: var(--text-secondary); }
.card-semaforo-alerta .card-hint { color: #7a6d3a; }
.valorizacion-bar-wrap {
  margin-bottom: 0.75rem;
}
.valorizacion-bar {
  display: flex;
  height: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-medium);
  margin-bottom: 0.4rem;
}
.valorizacion-bar-segment {
  display: block;
  min-width: 2px;
  transition: width .2s;
}
.valorizacion-bar-segment.valorizacion-pagado { background: var(--blue); }
.valorizacion-bar-segment.valorizacion-credito { background: var(--gray-medium); }
.valorizacion-bar-segment.valorizacion-mora { background: var(--danger); }
.valorizacion-bar-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.valorizacion-leyenda-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.valorizacion-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.valorizacion-dot.valorizacion-pagado { background: var(--blue); }
.valorizacion-dot.valorizacion-credito { background: var(--gray-medium); }
.valorizacion-dot.valorizacion-mora { background: var(--danger); }
.dashboard-links {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.dashboard-links a {
  color: var(--blue);
  text-decoration: none;
}
.dashboard-links a:hover {
  text-decoration: underline;
}
.card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.card .big {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: var(--border-card);
}
th,
td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  text-align: left;
  border-bottom: 1px solid var(--table-border);
  font-size: var(--bodega-row-fs);
  color: var(--text-primary);
  line-height: var(--bodega-row-lh);
  vertical-align: middle;
}
th {
  background: var(--table-head-bg);
  font-weight: 700;
  color: var(--table-head-text);
  font-size: 0.78rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.01em;
}
.content table tbody tr:nth-child(odd) td {
  background: var(--table-row-base);
}
.content table tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}
tr:hover td {
  background: var(--table-row-hover) !important;
}


/* === 05-tables-modals.css === */
/* Números: derecha, tabulares; enteros/2 decimales se resuelven en formatters */
.content table th.col-num,
.content table td.col-num,
.content table th.col-stock,
.content table td.col-stock,
.content table th.col-min,
.content table td.col-min,
.content table th.col-lotes,
.content table td.col-lotes,
.content table th.num,
.content table td.num,
.content table th.text-right,
.content table td.text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Densidad uniforme en tablas y formularios (sitio completo) */
body.audit-density th,
body.audit-density td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  font-size: var(--bodega-row-fs);
  line-height: var(--bodega-row-lh);
  vertical-align: middle;
}
body.audit-density table input[type="checkbox"],
body.audit-density table input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  vertical-align: middle;
}
body.audit-density .form-group { margin-bottom: var(--bodega-form-gap); }
body.audit-density .form-group label {
  margin-bottom: 0.1rem;
  font-size: 0.78rem;
}
body.audit-density .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.audit-density .form-group select,
body.audit-density .form-group textarea,
body.audit-density .inline-input input {
  min-height: var(--bodega-field-h);
  padding: var(--bodega-field-py) var(--bodega-field-px);
  font-size: var(--bodega-field-fs);
  line-height: var(--bodega-row-lh);
}
body.audit-density .form-grid-2 {
  gap: var(--bodega-form-gap) 0.65rem;
  align-items: center;
}
body.audit-density .form-inline .inline-input {
  align-items: center;
  min-height: var(--bodega-field-h);
}
body.audit-density table .btn-sm,
body.audit-density table .btn-act-icon {
  min-height: 1rem;
  min-width: 1rem;
  padding: 0.12rem 0.28rem;
  vertical-align: middle;
  line-height: 1;
}
body.audit-density table .prod-oci-icon,
body.audit-density table .prod-op-icon {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}
body.audit-density table .prod-oci-icon .material-icons,
body.audit-density table .prod-op-icon .material-icons {
  font-size: 0.8rem !important;
  line-height: 1 !important;
}
body.audit-density table .badge {
  padding: 0 0.28rem;
  font-size: 0.65rem;
  line-height: 1.1;
  vertical-align: middle;
  border: none;
  font-weight: 500;
  white-space: nowrap;
  display: inline;
}
body.audit-density .modal table th,
body.audit-density .modal table td,
body.audit-density .info-table th,
body.audit-density .info-table td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  font-size: var(--bodega-row-fs);
  line-height: var(--bodega-row-lh);
  vertical-align: middle;
}

/* Tablas de trabajo: mejor aprovechamiento horizontal en escritorio */
@media (min-width: 1024px) {
  .content table {
    table-layout: auto;
  }
  .content table th,
  .content table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
  }
  .content #hubMovTable th,
  .content #hubMovTable td,
  .content #hubMovTable td.hub-mov-prod,
  .content #hubMovTable td.hub-mov-dea {
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }
  .content table td .btn,
  .content table td .badge {
    white-space: nowrap;
  }
  /* Autoajuste global de columnas (aplicado por JS) */
  .content table.bodega-auto-cols {
    table-layout: auto !important;
  }
  .content table.bodega-auto-cols th,
  .content table.bodega-auto-cols td {
    vertical-align: middle;
  }
  .content table.bodega-auto-cols .bodega-col-num {
    width: 1%;
    white-space: nowrap;
  }
  .content table.bodega-auto-cols .bodega-col-wide {
    min-width: 18ch;
    white-space: normal;
  }
  .content table.bodega-auto-cols .bodega-col-mid {
    min-width: 10ch;
  }
  /* Utilidades para tablas con layout dedicado */
  .content table.bodega-auto-skip .col-num {
    text-align: right;
    white-space: nowrap;
  }
  .content table.bodega-auto-skip .col-nowrap {
    white-space: nowrap;
  }
  .content table.bodega-auto-skip .col-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Densidad uniforme en escritorio = altura fila LOTES */
@media (min-width: 1024px) {
  .content table th,
  .content table td {
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    line-height: var(--bodega-row-lh) !important;
    font-size: var(--bodega-row-fs) !important;
  }
  .content .btn.btn-sm {
    padding: 0.22rem 0.38rem !important;
  }
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
}
.badge.borrador { background: #eceff1; color: #263238; border: 1px solid #90a4ae; font-weight: 600; }
.badge.enviada { background: #fff3e0; color: #bf360c; border: 1px solid #e65100; font-weight: 600; }
.badge.aprobada { background: var(--google-blue-tint); color: var(--text-secondary); border: 1px solid var(--google-blue-light); font-weight: 600; }
.badge.rechazada { background: #ffebee; color: #b71c1c; border: 1px solid #c62828; font-weight: 600; }
.badge.parcial { background: #f3e5f5; color: #6a1b9a; border: 1px solid #7b1fa2; font-weight: 600; }
.badge.completa { background: #e8f5e9; color: #1b5e20; border: 1px solid #2e7d32; font-weight: 600; }
.badge.completada { background: #e8f5e9; color: #1b5e20; border: 1px solid #2e7d32; font-weight: 600; }
.badge.pendiente { background: #fff8e1; color: #e65100; border: 1px solid #f57c00; font-weight: 600; }
.badge.bajo-minimo { background: #fff3e0; color: #e65100; border: none; font-weight: 500; font-size: 0.65rem; line-height: 1.1; white-space: nowrap; }
tr.row-bajo-minimo td { background: var(--gray-light) !important; }
.vence-mora { color: var(--danger); font-weight: 700; }
.vence-mora strong { color: var(--danger); font-weight: 700; }
tr.row-bajo-minimo:hover td { background: var(--gray-medium) !important; }
.card.alert-card { border-left: 4px solid var(--warning); }
.card.alert-card a { color: var(--blue); text-decoration: none; }
.card.alert-card a:hover { text-decoration: underline; }
.mb1 { margin-bottom: 1rem; }
/* Producción / Transformación: formulario compacto (¼) + historial */
.produccion-page-layout {
  display: grid;
  grid-template-columns: minmax(240px, 25%) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.produccion-form-panel { margin-bottom: 0 !important; }
.produccion-form-panel h3,
.produccion-list-panel h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.produccion-form .form-group { margin-bottom: 0.45rem; }
.produccion-form .form-group label { font-size: 0.78rem; margin-bottom: 0.15rem; }
.produccion-form .form-group input,
.produccion-form .form-group select { padding: 0.35rem 0.45rem; font-size: 0.85rem; }
.produccion-form-weights { grid-template-columns: 1fr; gap: 0.35rem; }
.produccion-form .btn-block { width: 100%; margin-top: 0.35rem; padding: 0.45rem 0.6rem; font-size: 0.85rem; }
@media (max-width: 900px) {
  .produccion-page-layout { grid-template-columns: 1fr; }
}
/* Espacio de trabajo — orden de producción cocina */
.po-workspace { border: 2px solid var(--blue); }
.po-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid #e8eaed; }
.po-workspace-section { margin-bottom: 0.5rem; padding: 0.4rem 0.5rem; background: #f8f9fa; border-radius: 6px; border: 1px solid #e8eaed; }
.po-workspace-section:last-child { margin-bottom: 0; }
.po-workspace-section h4 { margin: 0 0 0.28rem; font-size: 0.86rem; display: flex; align-items: center; gap: 0.28rem; line-height: 1.2; }
.po-workspace-section .section-num { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--blue); color: #fff; font-size: 0.68rem; font-weight: 700; flex-shrink: 0; }
.po-workspace-section.po-section-done { opacity: 0.85; background: #f1f8f4; border-color: #c8e6c9; }
.po-progress-checklist { list-style:none; padding:0; margin:0.75rem 0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0.4rem; }
.po-progress-step { display:flex; gap:0.45rem; align-items:flex-start; padding:0.55rem; border:1px solid #d9e1ec; border-radius:8px; background:#f8fafc; font-size:0.82rem; }
.po-progress-step .material-icons { font-size:1.25rem; flex-shrink:0; color:#64748b; }
.po-progress-step strong,.po-progress-step small { display:block; }
.po-progress-step small { margin-top:0.15rem; color:#53657a; }
.po-progress-step--done { background:#effaf2; border-color:#9dd5ad; }
.po-progress-step--done .material-icons { color:#16813b; }
.po-workspace-section .section-num--done { background:#16813b; }
@media(max-width:480px) { .po-progress-checklist { grid-template-columns:1fr; } }
.po-workspace-section.po-section-disabled { opacity: 0.55; pointer-events: none; }
.po-workspace-section > p,
.po-workspace-section > .muted,
.po-section-hint {
  margin: 0 0 0.28rem !important;
  font-size: 0.76rem !important;
  line-height: 1.25 !important;
}
.po-workspace-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.32rem; }
.po-workspace-actions .btn-sm { padding: 0.22rem 0.5rem; font-size: 0.76rem; line-height: 1.2; }
.po-order-card { border: 1px solid #e0e3e7; border-radius: 8px; padding: 0.55rem 0.75rem; margin-bottom: 0.5rem; }
.po-order-card.po-order-active { border-color: var(--blue); box-shadow: 0 0 0 1px rgba(227, 27, 35, 0.2); }
.po-order-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.po-order-visual,
.po-area-chip,
.po-flow-chip {
  --po-area-color: #64748b;
  --po-area-bg: #f1f5f9;
  --po-flow-color: #475569;
  --po-flow-bg: #f1f5f9;
}
.po-area--cocina-caliente { --po-area-color: #c62828; --po-area-bg: #ffebee; }
.po-area--cocina-fria { --po-area-color: #0277bd; --po-area-bg: #e1f5fe; }
.po-area--panaderia { --po-area-color: #795548; --po-area-bg: #efebe9; }
.po-area--sin-categoria { --po-area-color: #64748b; --po-area-bg: #f1f5f9; }
.po-flow--no-supplies { --po-flow-color: #c5221f; --po-flow-bg: #fce8e6; }
.po-flow--partial-supplies { --po-flow-color: #b06000; --po-flow-bg: #fef7e0; }
.po-flow--supplies-complete { --po-flow-color: #137333; --po-flow-bg: #e6f4ea; }
.po-flow--awaiting-warehouse { --po-flow-color: #7627bb; --po-flow-bg: #f3e8fd; }
.po-flow--closed { --po-flow-color: #00695c; --po-flow-bg: #e0f2f1; }
.po-flow--cancelled { --po-flow-color: #64748b; --po-flow-bg: #f1f5f9; }
.po-order-card.po-order-visual {
  border-left-color: var(--po-area-color) !important;
  border-left-width: 6px !important;
  border-bottom-color: var(--po-flow-color) !important;
  border-bottom-width: 3px !important;
}
.po-order-card.po-order-visual.po-order-warning-card {
  border-left-color: var(--po-area-color) !important;
  border-bottom-color: var(--po-flow-color) !important;
}
.op-orders-table tr.po-order-visual > td:first-child {
  box-shadow: inset 5px 0 0 var(--po-area-color);
}
.po-order-visual-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.28rem;
}
.po-area-chip,
.po-flow-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.35rem;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  font-size: 0.69rem;
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
}
.po-area-chip {
  color: var(--po-area-color);
  background: var(--po-area-bg);
  border: 1px solid var(--po-area-color);
}
.po-area-chip::before,
.po-flow-chip::before {
  content: '';
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.po-flow-chip {
  color: var(--po-flow-color);
  background: var(--po-flow-bg);
  border: 1px solid var(--po-flow-color);
}
.po-visual-legend {
  margin: 0 0 0.6rem;
  border: 1px solid #dbe3ed;
  border-radius: 9px;
  background: #f8fafc;
  font-size: 0.76rem;
}
.po-visual-legend summary {
  cursor: pointer;
  padding: 0.38rem 0.55rem;
  color: #334155;
  font-weight: 700;
}
.po-visual-legend-body {
  padding: 0 0.55rem 0.5rem;
  display: grid;
  gap: 0.35rem;
}
.po-visual-legend-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.po-visual-legend-line > strong {
  width: 3.5rem;
  color: #475569;
}
.ws-req-row.ws-req-hidden { display: none; }
.po-order-card.po-order-select { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.po-order-card.po-order-select:hover { border-color: var(--google-blue-light); }
.po-unified-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  align-items: start;
  margin-bottom: 0.5rem;
}
.po-page-intro {
  font-size: 0.82rem;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}
.po-unified-layout.orders-expanded {
  grid-template-columns: minmax(300px, 46%) 1fr;
}
.po-orders-panel {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}
.po-orders-panel.is-collapsed {
  align-self: start;
}
.po-orders-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font: inherit;
  color: inherit;
}
.po-orders-toggle:hover { background: #f1f3f4; }
.po-orders-toggle-icon {
  color: #5f6368;
  font-size: 1.35rem !important;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.po-orders-panel.is-collapsed .po-orders-toggle-icon { transform: rotate(-90deg); }
.po-orders-panel:not(.is-collapsed) .po-orders-toggle-icon { transform: rotate(0deg); }
.po-orders-toggle-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.po-orders-toggle-text strong { font-size: 0.92rem; }
.po-orders-summary {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.po-orders-count {
  flex-shrink: 0;
  background: var(--google-blue-tint);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 10px;
  min-width: 1.25rem;
  text-align: center;
}
.po-orders-count[hidden] { display: none; }
.po-orders-body {
  padding: 0 0.65rem 0.65rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.po-list-filters {
  padding: 0.45rem 0 0.55rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid #e8eaed;
}
.po-list-filters--simple {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.po-list-filters--simple .po-filter-grow {
  flex: 1 1 auto;
  width: 100%;
}

/* Cocina — dashboard compacto en listas */
.po-page-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.po-page-top .po-page-title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.po-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #f1f3f4;
  color: #3c4043;
  text-decoration: none;
}
.po-back-link .material-icons { font-size: 1.25rem; }
.po-orders-static-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-bottom: 1px solid #e8eaed;
}
.po-unified-layout--disponibles.po-pick-mode,
.po-unified-layout--mias.po-pick-mode {
  grid-template-columns: 1fr;
}
.po-unified-layout--disponibles.po-pick-mode .po-orders-panel,
.po-unified-layout--mias.po-pick-mode .po-orders-panel {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.po-unified-layout--disponibles .po-orders-panel,
.po-unified-layout--mias .po-orders-panel {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.po-unified-layout--disponibles .po-orders-body,
.po-unified-layout--mias .po-orders-body {
  padding: 0;
}
.po-list-empty {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
  color: #5f6368;
  margin: 0;
}
.po-orders-list-cards--pick { gap: 0.55rem; }
.po-order-card--pick {
  padding: 0.85rem 1rem !important;
  margin-bottom: 0 !important;
  border-radius: 12px !important;
  border-width: 2px !important;
  min-height: 4.5rem;
}
.po-order-card--available {
  background: #fff;
  border-color: #66bb6a !important;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.12);
}
.po-order-card--available.po-order-select:active,
.po-order-card--available.po-order-select:hover {
  border-color: #2e7d32 !important;
  background: #f1f8e9;
}
.po-order-card--mine {
  background: var(--po-flow-bg);
  border-color: var(--po-flow-color) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--po-flow-color) 20%, transparent);
}
.po-order-card--mine.po-order-warning-card {
  border-color: var(--po-flow-color) !important;
  background: var(--po-flow-bg);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--po-flow-color) 24%, transparent);
}
.po-order-card--mine.po-order-active {
  outline: 2px solid color-mix(in srgb, var(--po-flow-color) 48%, #fff);
  outline-offset: 1px;
}
.po-pick-main { margin-bottom: 0.35rem; }
.po-pick-product {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #202124;
  line-height: 1.25;
}
.po-pick-qty {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  color: #5f6368;
}
.po-pick-qty strong {
  font-size: 1.35rem;
  color: #1a1a1a;
  font-weight: 800;
}
.po-pick-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.po-pick-code {
  font-size: 0.72rem;
  font-weight: 600;
  color: #80868b;
  letter-spacing: 0.02em;
}
.po-pick-action {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2e7d32;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.po-pick-action .material-icons { font-size: 1.1rem; }
.po-pick-action--warn { color: #e65100; }
.po-pick-action--warn .material-icons { font-size: 1.2rem; }

.po-orders-list-cards--cats { gap: 0.75rem; }
.po-cat-group-card {
  background: #fff;
  border: 2px solid #66bb6a;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.12);
}
.po-cat-group-head { margin-bottom: 0.45rem; }
.po-cat-group-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1b5e20;
  letter-spacing: 0.02em;
}
.po-cat-group-date {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: #5f6368;
  font-weight: 600;
}
.po-cat-group-recipes {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
}
.po-cat-group-recipes li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  padding: 0.28rem 0;
  border-top: 1px solid #e8f5e9;
  font-size: 0.9rem;
}
.po-cat-group-recipes li:first-child { border-top: 0; }
.po-cat-group-recipes em {
  font-style: normal;
  font-size: 0.72rem;
  color: #80868b;
  font-weight: 600;
}
.po-cat-group-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.po-cat-group-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2e7d32;
  text-transform: uppercase;
}

.mi-ks-group-head td {
  background: #e8f5e9;
  font-weight: 800;
  font-size: 0.88rem;
  color: #1b5e20;
  padding: 0.55rem 0.65rem;
}
.mi-ks-group-n {
  font-weight: 600;
  color: #5f6368;
  font-size: 0.75rem;
  margin-left: 0.45rem;
}
.mi-ks-group-totals td {
  background: #f1f8e9;
  font-size: 0.8rem;
  color: #33691e;
  padding: 0.4rem 0.65rem;
}
.mi-ks-recipe-head td {
  background: #fff !important;
  border-top: 1px solid #c8e6c9;
  padding: 0.7rem 0.65rem 0.35rem;
  text-align: left;
  vertical-align: top;
}
.mi-ks-recipe-block {
  text-align: left;
}
.mi-ks-recipe-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #1a237e;
  letter-spacing: 0.01em;
}
.mi-ks-recipe-meta {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: #455a64;
  font-weight: 600;
}
.mi-ks-recipe-code {
  color: #78909c;
  font-weight: 600;
  margin-left: 0.35rem;
}
.mi-ks-savings-banner {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.65rem;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
}
.mi-kitchen-delivery-feedback {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.7rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #90caf9;
  border-radius: 8px;
  background: #e3f2fd;
  color: #0d47a1;
}
.mi-kitchen-delivery-feedback[hidden] { display: none !important; }
.mi-kitchen-delivery-feedback.is-success { border-color: #66bb6a; background: #e8f5e9; color: #145a28; }
.mi-kitchen-delivery-feedback.is-error { border-color: #ef5350; background: #ffebee; color: #b71c1c; }
.mi-kitchen-delivery-feedback-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border-radius: 50%;
  background: #1976d2;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}
.mi-kitchen-delivery-feedback.is-success .mi-kitchen-delivery-feedback-icon { background: #2e7d32; }
.mi-kitchen-delivery-feedback.is-error .mi-kitchen-delivery-feedback-icon { background: #c62828; }
.mi-kitchen-delivery-feedback > span:last-child { display: grid; gap: 0.1rem; }
.mi-kitchen-delivery-feedback strong { font-size: 0.9rem; }
.mi-kitchen-delivery-feedback small { color: inherit; font-size: 0.78rem; }
.mi-ks-gather-progress { margin: 0.45rem 0; padding: 0.52rem 0.65rem 0.58rem; background: #fff; }
.mi-ks-gather-progress strong { display: block; margin-bottom: 0.32rem; color: #40546a; font-size: 0.78rem; }
.mi-ks-gather-track { height: 5px; overflow: hidden; border-radius: 999px; background: #dce5ee; }
.mi-ks-gather-track span {
  display: block; width: 0; height: 100%; border-radius: inherit; background: #22a35a;
  transition: width 0.18s ease;
}
.mi-kitchen-consolidado-table col.mi-ks-col-check { width: 3.2rem; }
.mi-kitchen-consolidado-table {
  width: 100% !important;
  min-width: 70rem;
  table-layout: fixed !important;
}
.mi-kitchen-consolidado-table col.mi-ks-col-deliver { width: 11rem; }
.mi-kitchen-consolidado-table col.mi-ks-col-unit { width: 7rem; }
.mi-kitchen-consolidado-table col.mi-ks-col-product { width: 19rem; }
.mi-kitchen-consolidado-table col.mi-ks-col-need { width: 8.5rem; }
.mi-kitchen-consolidado-table col.mi-ks-col-open { width: 12rem; }
.mi-kitchen-consolidado-table th,
.mi-kitchen-consolidado-table td {
  vertical-align: middle;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.mi-kitchen-consolidado-table .mi-ks-product-first,
.mi-kitchen-consolidado-table .mi-ks-cons-recipes,
.mi-kitchen-consolidado-table .mi-ks-open {
  min-width: 0;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}
.mi-kitchen-consolidado-table .mi-ks-product-first { font-weight: 700; }
.mi-kitchen-consolidado-table .mi-ks-check-first { text-align: center; }
.mi-kitchen-consolidado-table tr.mi-ks-gather-row { cursor: pointer; }
.mi-kitchen-consolidado-table tr.mi-ks-gather-row:focus-visible { outline: 2px solid #1976d2; outline-offset: -2px; }
.mi-kitchen-consolidado-table tr.mi-ks-gather-row:active td { background: #f0f7ff !important; }
.mi-kitchen-consolidado-table tr.is-prepared td { background: #f3fbf6 !important; }
.mi-ks-pick-check {
  position: relative; display: inline-grid; place-items: center; cursor: pointer;
}
.mi-ks-pick-check input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.mi-ks-dispatch-check {
  width: 1.75rem; height: 1.75rem; display: grid; place-items: center;
  border: 2px solid #8b99a9; border-radius: 50%; color: transparent;
}
.mi-ks-dispatch-check .material-icons { font-size: 1.18rem; font-weight: 800; }
.mi-kitchen-consolidado-table tr.is-prepared .mi-ks-dispatch-check {
  border-color: #1c9a55; background: #1c9a55; color: #fff;
}
.mi-kitchen-consolidado-table tr.is-prepared .mi-ks-product-name {
  color: #68766f; text-decoration: line-through; text-decoration-thickness: 1px;
}
.mi-kitchen-consolidado-table .mi-ks-need { white-space: nowrap; }
.mi-kitchen-consolidado-table .mi-ks-deliver-first { text-align: right; }
.mi-kitchen-consolidado-table .mi-ks-cons-qty {
  display: block;
  margin-left: auto;
}
.mi-kitchen-consolidado-table .mi-ks-unit-first {
  text-align: left;
  white-space: normal !important;
}
.mi-ks-unit-label {
  display: block;
  font-weight: 600;
  line-height: 1.15;
  word-break: normal;
  overflow-wrap: normal;
}
.mi-ks-stock-equivalent {
  display: block;
  margin-top: 0.16rem;
  color: #607d8b;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}
.mi-ks-cons-recipes { font-size: 0.78rem; color: #546e7a; }
.mi-ks-cons-qty {
  width: 5.6rem;
  padding: 0.28rem 0.35rem;
  border: 1px solid #9aa8b5;
  border-radius: 3px;
  text-align: right;
}

.po-supply-fixed {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
}
.po-supply-fixed--ok {
  font-weight: 600;
  color: #137333;
  font-size: 0.82rem;
}
.po-col-fixed-qty,
.po-col-fixed-unit {
  background: #f8f9fa;
}

.po-list-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: end;
  margin-bottom: 0.35rem;
}
.po-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #5f6368;
  min-width: 0;
}
.po-filter-field input,
.po-filter-field select {
  font-size: 0.8rem;
  padding: 0.28rem 0.4rem;
  min-height: 1.85rem;
}
.po-filter-grow { flex: 1 1 8rem; }
.po-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #3c4043;
  padding-bottom: 0.2rem;
  white-space: nowrap;
}
.po-list-filters-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.po-workspace-head-main {
  flex: 1 1 12rem;
  min-width: 0;
}
.po-workspace-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}
.po-list-summary { font-size: 0.76rem; margin: 0.15rem 0 0; }
.po-table-wrap--orders {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.25rem 0 0;
  max-width: 100%;
}
.po-orders-table {
  width: max-content;
  min-width: 42rem;
  font-size: 0.76rem;
  table-layout: fixed;
  border-collapse: collapse;
}
.content table.po-orders-table th,
.content table.po-orders-table td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  padding: 0.32rem 0.4rem;
  vertical-align: middle;
}
.po-orders-table .po-col-recipe,
.po-orders-table .po-col-product {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9.5rem;
}
.po-orders-table .po-unit {
  font-size: 0.68rem;
  color: #5f6368;
}
.po-orders-table col.po-col-w-date { width: 5.5rem; }
.po-orders-table col.po-col-w-code { width: 7.5rem; }
.po-orders-table col.po-col-w-recipe { width: 6.5rem; }
.po-orders-table col.po-col-w-product { width: 7rem; }
.po-orders-table col.po-col-w-qty { width: 4.25rem; }
.po-orders-table col.po-col-w-prod { width: 3.5rem; }
.po-orders-table col.po-col-w-status { width: 5.5rem; }
.po-orders-table col.po-col-w-tag { width: 4.5rem; }
.po-orders-table th.po-col-w-date,
.po-orders-table th.po-col-w-code,
.po-orders-table th.po-col-w-recipe,
.po-orders-table th.po-col-w-product,
.po-orders-table th.po-col-w-qty,
.po-orders-table th.po-col-w-prod,
.po-orders-table th.po-col-w-status,
.po-orders-table th.po-col-w-tag {
  min-width: 0;
}
.po-orders-table .po-order-tag {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
}
.po-orders-table .po-order-row.po-order-select { cursor: pointer; }
.po-orders-table .po-order-row.po-order-select:hover { background: #f1f8ff; }
.po-orders-table .po-order-row.po-order-active { background: var(--google-blue-tint); }
.po-col-date { font-size: 0.72rem; color: #5f6368; }
.po-col-code strong { font-size: 0.74rem; font-weight: 600; }
.po-col-prod { font-weight: 600; text-align: right; }
.po-col-tag { text-align: center; }
.po-prod-ok { color: #137333; }
.po-prod-mid { color: #b06000; }
.po-prod-low { color: #c5221f; }
.po-recipe-groups { display: flex; flex-direction: column; gap: 0.35rem; }
.po-recipe-group {
  border: 1px solid #e0e3e7;
  border-radius: 8px;
  background: #fafbfc;
}
.po-recipe-group-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  list-style: none;
}
.po-recipe-group-summary::-webkit-details-marker { display: none; }
.po-recipe-group-title { font-weight: 600; font-size: 0.82rem; color: #202124; }
.po-recipe-group-meta { font-size: 0.76rem; color: #5f6368; }
.po-recipe-group-stat {
  font-size: 0.74rem;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}
.po-recipe-group .po-table-wrap { padding: 0 0.35rem 0.35rem; }
.po-orders-panel.is-collapsed .po-orders-body {
  display: none;
}
.po-order-card-compact {
  padding: 0.4rem 0.55rem !important;
  margin-bottom: 0.35rem !important;
}
.po-orders-list-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}
.po-recipe-group-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.po-recipe-group-mobile-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #202124;
  padding: 0.2rem 0.05rem 0.15rem;
  border-bottom: 1px solid #e8eaed;
  line-height: 1.25;
}
.op-order-card-mobile {
  width: 100%;
  box-sizing: border-box;
}
.op-order-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.25;
  margin: 0.2rem 0 0.35rem;
}
.op-order-card-lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.06rem;
}
.op-order-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
  padding-top: 0.32rem;
  border-top: 1px solid #eef1f4;
}
.op-order-card-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.76rem;
  color: #5f6368;
  margin: 0;
}
.po-order-code { font-size: 0.82rem; }
.po-order-meta {
  font-size: 0.72rem;
  margin: 0.12rem 0 0.25rem;
  color: #5f6368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.po-order-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: #f1f3f4;
  color: #5f6368;
}
.po-order-tag-available { background: #fef7e0; color: #b06000; }
.po-order-tag-mine { background: #e6f4ea; color: #137333; }
.po-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}
.po-show-orders-inline {
  flex-shrink: 0;
  white-space: nowrap;
}
.po-whole-unit-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--google-blue-tint);
  padding: 0.02rem 0.25rem;
  border-radius: 3px;
  margin-left: 0.2rem;
  vertical-align: middle;
  line-height: 1.2;
}
.po-stock-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.06rem 0.32rem;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.2;
}
.po-stock-none { background: #fce8e6; color: #c5221f; }
.po-stock-low { background: #fef7e0; color: #b06000; }
.po-stock-ok { background: #e6f4ea; color: #137333; }
.po-row-no-principal-stock td.po-col-product { border-left: 2px solid #f9ab00; }
.po-col-stock-st { white-space: nowrap; text-align: center; font-size: 0.76rem; }
.ws-req-row-pending { background: #f1f8ff; }
.ws-req-row-pending td { color: #5f6368; }
.po-pending-supply-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--google-blue-tint);
  padding: 0.02rem 0.28rem;
  border-radius: 3px;
  margin-left: 0.2rem;
  vertical-align: middle;
  line-height: 1.2;
}
.po-pending-supply-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  font-size: 0.74rem;
  line-height: 1.2;
}
.po-pending-supply-item strong { color: var(--text-primary); font-weight: 600; }
.po-pending-supply-st {
  font-size: 0.68rem;
  font-weight: 600;
  color: #b06000;
  background: #fef7e0;
  padding: 0.04rem 0.3rem;
  border-radius: 3px;
  white-space: nowrap;
}
.po-col-pending-request { font-size: 0.74rem; line-height: 1.2; }
.po-data-table--supplies .po-col-qty,
.po-data-table--supplies th.po-col-qty-h {
  text-align: right !important;
  white-space: nowrap;
}
.po-data-table--supplies .po-col-unit,
.po-data-table--supplies th.po-col-unit-h {
  text-align: left !important;
  white-space: nowrap;
}
.po-data-table--supplies .po-col-action,
.po-data-table--supplies th.po-col-act-h {
  text-align: center !important;
  white-space: nowrap;
}
.po-col-pending-qty .po-pending-qty-val {
  display: inline-block;
  width: 100%;
  max-width: 4.25rem;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.po-col-pending-unit .po-pending-unit-val {
  display: inline-block;
  min-width: 2.5rem;
  font-size: 0.74rem;
  color: #5f6368;
}
.po-col-pending-meta {
  font-size: 0.66rem;
  line-height: 1.15;
  padding-left: 0.2rem !important;
  padding-right: 0.2rem !important;
}
.po-col-pending-meta .po-pending-mi {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.66rem;
  line-height: 1.1;
}
.po-col-pending-meta .po-pending-supply-st {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.62rem;
  padding: 0.04rem 0.22rem;
}
.po-supply-blocked-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  margin: 0 0 0.28rem;
  padding: 0.28rem 0.45rem;
  font-size: 0.74rem;
  line-height: 1.25;
  color: var(--text-primary);
  background: var(--google-blue-tint);
  border: 1px solid var(--google-blue-light);
  border-radius: 4px;
}
.po-supply-blocked-hint .material-icons { font-size: 1rem; flex-shrink: 0; }
.po-supply-receive-alert {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.42rem 0;
  padding: 0.5rem 0.6rem;
  color: #0d652d;
  background: #e6f4ea;
  border: 1px solid #81c995;
  border-radius: 6px;
}
.po-supply-receive-copy { display: flex; align-items: center; gap: 0.42rem; min-width: 0; }
.po-supply-receive-copy .material-icons { flex-shrink: 0; font-size: 1.25rem; }
.po-supply-receive-copy strong,
.po-supply-receive-copy > div > span { display: block; }
.po-supply-receive-copy strong { font-size: 0.82rem; }
.po-supply-receive-copy > div > span { margin-top: 0.08rem; font-size: 0.74rem; line-height: 1.25; }
.po-supply-receive-actions { display: grid; gap: 0.6rem; min-width: 0; }
.po-supply-receive-actions .btn { white-space: normal; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.po-supply-receipt-group { min-width: 0; padding: .5rem; background: #fff; border: 1px solid #b8dbc2; border-radius: 6px; }
.po-supply-receipt-items { margin: .4rem 0 0; padding-left: 1.2rem; font-size: .78rem; line-height: 1.45; overflow-wrap: anywhere; }
.po-supply-receipt-pending { margin: .4rem 0 0; font-size: .75rem; color: #66512a; }
.po-cost-summary ul { margin-bottom: 0; }
.prod-filters-row { display:flex; flex-wrap:wrap; gap:0.5rem 0.75rem; align-items:flex-end; }
.prod-filters-row label { font-size:0.82rem; display:flex; flex-direction:column; gap:0.15rem; }
.prod-kpi-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:0.5rem; margin-bottom:0.75rem; }
.prod-kpi { padding:0.65rem 0.75rem !important; text-align:center; }
.prod-kpi-label { display:block; font-size:0.72rem; color:#5f6368; margin-bottom:0.15rem; }
.prod-kpi strong { font-size:1.15rem; color:var(--text-primary); }
.prod-charts-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:0.65rem; margin-bottom:0.75rem; }
.prod-chart-box { padding:0.75rem !important; }
.prod-chart-box h3 { margin:0 0 0.5rem; font-size:0.92rem; }
.prod-chart-box canvas { width:100% !important; max-height:300px; }
.prod-ranking-table { font-size:0.85rem; width:100%; }
.prod-ranking-table .col-num { text-align:right; }
.prod-history-head { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,25%); gap:0.75rem; align-items:center; padding:0.25rem 0.65rem 0.45rem; color:#5f6368; font-size:0.75rem; font-weight:600; }
.prod-history-sort { justify-self:end; border:0; background:transparent; color:var(--text-primary); font:inherit; font-weight:700; cursor:pointer; padding:0.2rem 0; }
.prod-history-sort:hover, .prod-history-sort:focus-visible { color:var(--link-hover); text-decoration:underline; }
.prod-history-item { border:1px solid #e8eaed; border-radius:8px; padding:0.45rem 0.65rem; margin-bottom:0.45rem; }
.prod-history-item summary { cursor:pointer; font-size:0.88rem; }
.prod-history-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,25%); gap:0.75rem; align-items:center; }
.prod-history-main { min-width:0; overflow-wrap:anywhere; }
.prod-history-efficiency { display:flex; flex-direction:column; align-items:flex-end; text-align:right; min-width:0; }
.prod-history-efficiency strong { color:var(--text-primary); font-size:0.96rem; }
.prod-history-efficiency small { color:#5f6368; font-size:0.73rem; line-height:1.25; }
.prod-history-detail { padding:0.35rem 0 0.15rem; }
@media (max-width: 640px) {
  .prod-history-head, .prod-history-row { grid-template-columns:minmax(0,1fr) minmax(120px,38%); gap:0.4rem; }
  .prod-history-efficiency small { font-size:0.69rem; }
}
.op-tab.active { background:var(--google-blue-tint); color:var(--text-primary); border-color:var(--google-blue-light); font-weight:600; }
.op-orders-table th, .op-orders-table td { padding:0.4rem 0.35rem; vertical-align:middle; }
.po-work-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 360px; color: #5f6368; padding: 1.5rem; }
.po-work-empty-icon { font-size: 2.5rem; color: var(--google-blue-light); margin-bottom: 0.5rem; }
.po-workspace-inline { border: none; box-shadow: none; padding: 0; }
.po-workspace-inline .po-workspace-head { border-bottom: 1px solid #e8eaed; padding-bottom: 0.35rem; margin-bottom: 0.45rem; }
.po-section-accept { background: #fff8e1; border-color: #ffe082; }
.po-order-goal { display: flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.5rem; margin-bottom: 0.38rem; background: var(--google-blue-tint); border: 1px solid var(--google-blue-light); border-radius: 6px; font-size: 0.82rem; line-height: 1.2; }
.po-order-goal .material-icons { color: var(--text-primary); font-size: 1.15rem; flex-shrink: 0; }
.po-order-goal-main { display: grid; gap: 0.06rem; min-width: 0; }
.po-order-goal-qty { color: var(--text-primary); font-size: 1rem; line-height: 1.1; }
.po-order-goal-product { color: var(--text-primary); font-weight: 700; }
.po-order-goal-recipe { color: var(--text-secondary); font-size: 0.72rem; }
.po-pending-alert { display: flex; align-items: center; gap: 0.28rem; padding: 0.32rem 0.45rem; margin-bottom: 0.4rem; background: #fef7e0; border: 1px solid #f9ab00; border-radius: 6px; color: #b06000; font-size: 0.78rem; font-weight: 600; line-height: 1.25; }
.po-pending-alert .material-icons { font-size: 1rem; color: #f9ab00; }
.po-order-warning-badge { display: inline-flex; color: #f9ab00; vertical-align: middle; }
.po-order-warning-badge .material-icons { font-size: 1.1rem; }
.po-order-warning-card { border-color: #f9ab00; background: #fffdf5; }
.po-order-warning-text { font-size: 0.75rem; margin: 0.25rem 0 0; color: #b06000; font-weight: 600; }
.po-work-panel > #poWorkEmpty[hidden], .po-work-panel > #poWorkspace[hidden] { display: none !important; }
.po-work-panel.has-order #poWorkEmpty { display: none !important; }
.po-work-panel.has-order #poWorkspace { display: block !important; }
.po-order-card .po-open-order { margin-top: 0.4rem; width: 100%; }
/* Tablas del espacio de trabajo — producción cocina */
.po-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.15rem 0 0.28rem;
  max-width: 100%;
}
.po-data-table {
  width: 100%;
  font-size: 0.78rem;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}
.content table.po-data-table th,
.content table.po-data-table td {
  vertical-align: middle;
  padding: var(--bodega-row-py) var(--bodega-row-px) !important;
  line-height: var(--bodega-row-lh) !important;
  font-size: var(--bodega-row-fs) !important;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: normal;
}
.content table.po-data-table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  padding-top: var(--bodega-row-py) !important;
  padding-bottom: var(--bodega-row-py) !important;
}
.content table.po-data-table .col-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.po-data-table .po-col-ref { font-size: 0.74rem; }
.po-col-product { min-width: 5rem; max-width: 8.5rem; word-break: break-word; line-height: 1.12; font-size: 0.76rem; }
.po-cell-input {
  width: 100%;
  min-width: 2.75rem;
  max-width: 4.25rem;
  padding: 0.16rem 0.3rem;
  font-size: 0.76rem;
  line-height: 1.15;
  min-height: 1.55rem;
  box-sizing: border-box;
}
.po-cell-select {
  min-width: 3rem;
  max-width: 4.75rem;
  padding: 0.14rem 0.22rem;
  font-size: 0.72rem;
  line-height: 1.15;
  min-height: 1.55rem;
}
.po-col-action { width: 3.25rem; white-space: nowrap; text-align: center; }
.po-col-action .btn-sm { padding: 0.12rem 0.28rem; font-size: 0.68rem; min-height: 0; line-height: 1.15; }
.po-inline-unit { font-size: 0.68rem; color: #5f6368; white-space: nowrap; }
.po-prod-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.po-prod-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.76rem;
  margin: 0;
  line-height: 1.15;
}
.po-prod-fields .po-field-wide { grid-column: 1 / -1; }
.po-field-input {
  width: 100%;
  padding: 0.22rem 0.38rem;
  font-size: 0.78rem;
  line-height: 1.15;
  min-height: 1.55rem;
  box-sizing: border-box;
}
.po-field-unit { font-size: 0.72rem; color: #5f6368; margin-top: 0.05rem; }
.po-data-table--supplies col.po-col-insumo { width: 20%; }
.po-data-table--supplies col.po-col-ref { width: 10%; }
.po-data-table--supplies col.po-col-st { width: 8%; }
.po-data-table--supplies col.po-col-qty { width: 8%; }
.po-data-table--supplies col.po-col-extra { width: 10%; }
.po-data-table--supplies col.po-col-unit { width: 9%; }
.po-data-table--supplies col.po-col-act { width: 3.5rem; }
.po-data-table--supplies .po-col-extra,
.po-data-table--supplies th.po-col-extra-h {
  text-align: right !important;
  white-space: nowrap;
}
.po-col-extra .ws-extra-qty {
  width: 3.4rem;
  min-width: 3.4rem;
  max-width: 4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 0.18rem 0.28rem;
  font-size: 0.8rem;
}
.po-extra-unit { display: block; font-size: 0.68rem; color: #5f6368; }
.po-workspace-actions-extra { margin-top: 0.35rem; }
@media (max-width: 640px) {
  .po-supply-receive-alert { align-items: stretch; flex-direction: column; }
  .po-supply-receive-actions,
  .po-supply-receive-actions .btn { width: 100%; }
}
.po-data-table--close col.po-col-insumo { width: 28%; }
.po-data-table--close col.po-col-ref { width: 14%; }
.po-data-table--close col.po-col-used { width: 12%; }
.po-data-table--close col.po-col-unit { width: 12%; }
.po-data-table--close col.po-col-return { width: 20%; }
.po-data-table--close th.po-col-return,
.po-data-table--close td.po-col-return {
  text-align: right !important;
  white-space: nowrap;
  overflow: visible !important;
}
.po-return-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  max-width: 100%;
  vertical-align: middle;
}
.po-col-return .po-cell-input {
  width: 3.25rem;
  min-width: 3.25rem;
  max-width: 3.25rem;
  flex: 0 0 auto;
  margin: 0;
  display: block;
}
.po-col-return .po-inline-unit {
  flex: 0 0 auto;
  min-width: 2.1rem;
  text-align: left;
  white-space: nowrap;
}
.po-close-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.35rem;
}
.po-close-option-panel {
  margin-top: 0.4rem;
  padding: 0.5rem;
  border: 1px solid #d7e2f1;
  border-radius: 8px;
  background: #fff;
}
.po-close-option-panel[hidden] { display: none !important; }
.po-data-table--return th:first-child,
.po-data-table--return td:first-child,
.po-data-table--close-extra th:first-child,
.po-data-table--close-extra td:first-child { width: 62%; }
.po-data-table--return th:last-child,
.po-data-table--return td:last-child,
.po-data-table--close-extra th:last-child,
.po-data-table--close-extra td:last-child { width: 38%; }
@media (max-width: 900px) {
  .po-unified-layout,
  .po-unified-layout.orders-expanded {
    grid-template-columns: 1fr;
  }
  .po-orders-body { max-height: min(50vh, 360px); }
  .po-orders-table { min-width: 36rem; font-size: 0.72rem; }
  .po-orders-table .po-col-recipe,
  .po-orders-table .po-col-product { max-width: 6.5rem; }
  .po-work-panel { min-height: auto; }
  .po-workspace-head h3 { font-size: 0.95rem !important; }
  #poWorkspaceSubtitle { font-size: 0.78rem !important; line-height: 1.35; word-break: break-word; }
}
@media (max-width: 768px) {
  .prod-charts-grid { grid-template-columns: 1fr; }
  .prod-filters-row label { flex: 1 1 45%; min-width: 8rem; }
  .po-unified-layout .card { padding: 0.65rem 0.7rem; }
  .po-work-empty { min-height: 160px; padding: 1rem; }
  .po-workspace-section { padding: 0.38rem 0.42rem; margin-bottom: 0.42rem; }
  .po-workspace-section h4 { font-size: 0.8825rem; flex-wrap: wrap; margin-bottom: 0.22rem; }
  .po-order-goal { flex-direction: row; font-size: 0.8rem; padding: 0.32rem 0.4rem; margin-bottom: 0.32rem; }
  .po-order-goal .material-icons { font-size: 1.05rem; }
  .po-data-table { font-size: 0.8025rem; }
  .content table.po-data-table th,
  .content table.po-data-table td {
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    line-height: var(--bodega-row-lh) !important;
    font-size: var(--bodega-row-fs) !important;
    vertical-align: middle !important;
  }
  .content table.po-data-table tbody tr {
    min-height: calc(2 * var(--bodega-row-py) + var(--bodega-row-lh) * 1em);
  }
  }
  .po-col-product {
    min-width: 0;
    max-width: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .po-order-card-compact {
    padding: 0.5rem 0.65rem !important;
    margin-bottom: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }
  .po-order-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
    margin: 0.15rem 0 0.3rem;
  }
  .po-orders-list-cards .po-order-card {
    margin-bottom: 0;
  }
  .po-cell-input { max-width: none; min-width: 2.5rem; font-size: 16px; min-height: 2rem; }
  .po-cell-select { max-width: none; min-width: 2.75rem; font-size: 16px; min-height: 2rem; }
  .po-prod-fields { grid-template-columns: 1fr 1fr; gap: 0.3rem; margin-bottom: 0.3rem; }
  .po-prod-fields .po-field-wide { grid-column: 1 / -1; }
  .po-workspace-actions { flex-direction: column; margin-top: 0.28rem; gap: 0.28rem; }
  .po-workspace-actions .btn { width: 100%; justify-content: center; }
  .po-close-choice { display: grid; grid-template-columns: 1fr 1fr; }
  .po-close-choice .btn { width: 100%; justify-content: center; }
  .po-order-card .po-open-order { font-size: 0.82rem; padding: 0.45rem 0.5rem; }
  /* Tablas: scroll horizontal suave con ancho mínimo legible */
  .po-data-table--supplies { min-width: 28rem; }
  .po-data-table--close { min-width: 22rem; }
  .po-table-wrap--accept .po-data-table { min-width: 18rem; }
  .po-list-filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.45rem;
    align-items: end;
  }
  .po-list-filters-row .po-filter-grow,
  .po-list-filters-row .po-filter-check,
  .po-list-filters-row .po-list-filters-actions {
    grid-column: 1 / -1;
  }
  .po-list-filters-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .po-list-filters-actions .btn { width: 100%; justify-content: center; text-align: center; }
  .po-workspace-head {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .po-workspace-head-main { flex: 1 1 auto; min-width: 0; }
  .po-workspace-head-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
  }
  .po-workspace-head-actions .btn { flex: 0 0 auto; justify-content: center; min-width: 2.35rem; padding-inline: 0.55rem; }
  .po-show-orders-label { display: none; }
  .po-recipe-group-summary {
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
  }
  .po-recipe-group-stat { flex: 0 1 auto; }
}
@media (max-width: 480px) {
  .po-data-table .po-col-ref { display: none; }
  .po-data-table--supplies { min-width: 20rem; }
  .po-data-table--close { min-width: 18rem; }
  .po-col-product { min-width: 0; max-width: none; font-size: 0.74rem; }
  .po-col-action { width: 2.75rem; }
  .po-col-action .btn { padding: 0.1rem 0.22rem; font-size: 0.65rem; }
  .po-col-return { min-width: 5.5rem; }
  .po-col-return .po-cell-input { width: 3rem; min-width: 3rem; max-width: 3rem; }
  .po-col-return .po-inline-unit { min-width: 1.85rem; font-size: 0.66rem; }
  .po-prod-fields { grid-template-columns: 1fr; }
  .po-close-choice { grid-template-columns: 1fr; }
  .po-orders-panel h3 { font-size: 0.92rem !important; }
  .po-list-filters-row { grid-template-columns: 1fr; }
  .po-list-filters-row:first-child { grid-template-columns: 1fr 1fr; }
  .po-list-filters-row:first-child .po-filter-grow { grid-column: 1 / -1; }
  .po-filter-field input,
  .po-filter-field select { width: 100%; box-sizing: border-box; font-size: 16px; }
  .po-filter-check { white-space: normal; }
  .po-workspace-head-actions { flex-direction: row; }
  .po-workspace-head-actions .btn { flex: 0 0 auto; width: auto; }
  .po-orders-body { padding: 0 0.45rem 0.55rem; }
  .po-orders-toggle { padding: 0.45rem 0.55rem; }
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--bodega-form-gap, 0.5rem) 0.65rem;
  align-items: center;
}
.form-grid-2.form-grid-gap { gap: 0.75rem 1.25rem; }
.form-actions {
  grid-column: 1 / -1;
  margin-top: 0.2rem;
}
.form-inline .inline-input {
  display: flex;
  gap: 0.25rem;
}
.form-inline .inline-input input {
  flex: 1;
}
.form-inline .inline-input button {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.modal {
  position: fixed;
  inset: 0;
  /* Fondo iOS: translúcido + desenfoque (el panel de la ventana va mate aparte). */
  background: rgba(15, 23, 42, 0.28);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 4vh 1rem;
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal:has(.lightbox-content) {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  align-items: center;
  overflow: auto;
}
/* Ventana flotante: mate opaco (no se ve el contenido detrás). */
.modal-content {
  --modal-max: min(720px, 96vw);
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  max-width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  height: auto;
  max-height: 85dvh;
  margin: 0 auto;
  padding: 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
  isolation: isolate;
}
.modal:has(.lightbox-content) .modal-content,
.modal-content.lightbox-content {
  width: auto !important;
  max-width: 95vw !important;
  height: auto !important;
  max-height: 90dvh !important;
  display: block;
  border: none;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.barcode-scan-modal .modal-content {
  --modal-max: 420px;
  width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  max-width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  height: auto !important;
  max-height: 80dvh !important;
  border-radius: 12px;
  border: 1px solid var(--google-blue-light);
  overflow: visible;
  display: flex;
  flex-direction: column;
}
#barcodeScanner {
  min-height: 300px;
  height: 300px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
#barcodeScanner video,
#barcodeScanner canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 300px !important;
  display: block !important;
  object-fit: cover !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#barcodeScanner canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.dropdown-list {
  position: absolute;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  margin-top: 2px;
}
.dropdown-item {
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.dropdown-item:hover {
  background: var(--gray-light);
}
.form-group:has(#newSupplierSearch) { position: relative; }
tr.order-row.clickable { cursor: pointer; }
.orders-table .sortable { cursor: pointer; user-select: none; }
.orders-table .sortable:hover { background: var(--gray-light); }
.orders-table .sort-icon { font-size: 0.75em; color: var(--text-muted); }
.msg {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-input);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.msg.error { background: #ffebee; color: var(--danger); border: 1px solid var(--danger); }
.msg.success { background: #e8f5e9; color: var(--success); border: 1px solid var(--success); }

.modal-content.modal-lg {
  --modal-max: min(980px, 92vw);
  width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  max-width: min(var(--modal-max), calc(100vw - 2rem)) !important;
}
.modal-content.modal-xl,
.modal-content.order-sheet-modal {
  --modal-max: min(1200px, 92vw);
  width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  max-width: min(var(--modal-max), calc(100vw - 2rem)) !important;
}
@media (min-width: 1440px) {
  .modal-content {
    --modal-max: min(1080px, 90vw);
  }
  .modal-content.modal-lg {
    --modal-max: min(1180px, 90vw);
  }
  .modal-content.modal-xl,
  .modal-content.order-sheet-modal {
    --modal-max: min(1400px, 90vw);
  }
}
@media (min-width: 1800px) {
  .modal-content {
    --modal-max: min(1280px, 88vw);
  }
  .modal-content.modal-lg {
    --modal-max: min(1360px, 88vw);
  }
  .modal-content.modal-xl,
  .modal-content.order-sheet-modal {
    --modal-max: min(1560px, 88vw);
  }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 0;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}
.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.modal-close {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0.15rem 0.45rem;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text-primary); background: #f2f4f7; border-color: #98a2b3; }
button.modal-max-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  cursor: pointer;
  color: #344054;
  flex-shrink: 0;
}
button.modal-max-btn:hover {
  background: #f2f4f7;
  border-color: #98a2b3;
}
button.modal-max-btn .material-icons {
  font-size: 1.25rem;
  line-height: 1;
}
.modal-content.is-maximized {
  border-radius: 16px;
}
.modal-content.is-maximized .modal-resize-handle {
  display: none;
}
#notifDetailModal .notif-detail-content {
  --modal-max: 480px;
}
#notifDetailModal .notif-detail-fields {
  display: grid;
  gap: 0.65rem 1rem;
}
#notifDetailModal .pinfo-cell {
  display: grid;
  gap: 0.15rem;
}
#notifDetailModal .pinfo-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
#notifDetailModal .pinfo-value {
  font-size: 0.92rem;
  color: #202124;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}
#notifDetailModal .modal-footer {
  justify-content: flex-start;
}
#notifDetailModal #notifDetailAttend {
  font-weight: 700;
}
.modal-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.65rem 1rem;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.modal-export-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
}
button.modal-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  flex: 0 0 2.5rem;
  padding: 0.22rem;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  cursor: pointer;
  color: #344054;
  overflow: visible;
}
button.modal-export-btn:hover {
  transform: translateY(-1px);
  background: #f2f4f7;
}
button.modal-export-btn--excel:hover { border-color: #7bc49a; }
button.modal-export-btn--pdf:hover { border-color: #f1999c; }
.modal-export-btn svg,
.modal-export-btn img,
.modal-header .modal-export-btn svg,
.modal-header .modal-export-btn img,
.pinfo-modal-head-actions .modal-export-btn svg,
.pinfo-modal-head-actions .modal-export-btn img,
.seller-modal-head .modal-export-btn svg,
.seller-modal-head .modal-export-btn img {
  width: 1.9rem !important;
  height: 1.9rem !important;
  min-width: 1.9rem !important;
  min-height: 1.9rem !important;
  flex: 0 0 1.9rem;
  display: block;
  overflow: visible;
  object-fit: contain;
}
.modal-content .pinfo-modal-head {
  background: #f8fafc;
  border-bottom-color: #e5e7eb;
}
#productInfoModal .pinfo-edit-btn,
body.pangu-next #productInfoModal .pinfo-edit-btn.btn.primary,
body.pangu-next #productInfoModal .pinfo-edit-btn.btn-act-icon {
  background: #1d4ed8 !important;
  color: #fff !important;
  border: 1px solid #1e40af !important;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.45) !important;
}
#productInfoModal .pinfo-edit-btn:hover,
body.pangu-next #productInfoModal .pinfo-edit-btn.btn.primary:hover {
  background: #1e40af !important;
  border-color: #1e3a8a !important;
  color: #fff !important;
}
#productInfoModal .pinfo-edit-btn .material-icons {
  color: #fff !important;
}
.modal-content table th,
.modal-content .info-table th {
  background: #f1f3f4;
}
.modal.barcode-scan-modal,
.modal:has(#barcodeScanner) {
  background: rgba(11, 25, 40, 0.72);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.modal.barcode-scan-modal .modal-content,
.modal-content.lot-unit-scan-shell,
.modal-content.lightbox-content {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.seller-modal {
  background: rgba(15, 23, 42, 0.28) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
}
.seller-modal-panel {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28) !important;
}
.seller-modal-head {
  background: #f8fafc !important;
  border-bottom-color: #e5e7eb !important;
}
.modal-body,
.modal-content > form:not(.modal-header):not(.modal-footer),
.modal-content > div[id$="Body"] {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1rem 1rem;
}
.modal-body { padding: 0.85rem 1rem 1rem; }

/* Texto de ventanas flotantes: no partir palabras letra a letra ni recortar columnas */
.modal-content table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.modal-content table th,
.modal-content table td,
.modal-content .dg-head,
.modal-content .dg-num,
.modal-content .dg-oci {
  overflow-wrap: normal;
  word-break: normal;
  word-wrap: normal;
}
.modal-content table th,
.modal-content .dg-head {
  white-space: nowrap;
}
.modal-content table td.col-producto,
.modal-content table td.hub-mov-prod,
.modal-content .dg-prod {
  min-width: 12rem;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Redimensionado manual de ventanas flotantes */
.modal-content.is-resizable-modal {
  position: relative;
}
.modal-content .modal-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.15rem;
  height: 1.15rem;
  cursor: nwse-resize;
  z-index: 40;
  touch-action: none;
  background:
    linear-gradient(135deg, transparent 55%, rgba(25, 118, 210, 0.55) 55%, rgba(25, 118, 210, 0.55) 62%, transparent 62%),
    linear-gradient(135deg, transparent 70%, rgba(25, 118, 210, 0.75) 70%, rgba(25, 118, 210, 0.75) 78%, transparent 78%),
    linear-gradient(135deg, transparent 85%, rgba(25, 118, 210, 0.9) 85%);
  border-bottom-right-radius: 10px;
  opacity: 0.85;
}
.modal-content .modal-resize-handle:hover,
.modal-content.is-resizing .modal-resize-handle {
  opacity: 1;
}
body.modal-resizing {
  cursor: nwse-resize !important;
  user-select: none !important;
}
body.modal-moving {
  cursor: move !important;
  user-select: none !important;
}
body.modal-resizing iframe,
body.modal-moving iframe {
  pointer-events: none !important;
}
.modal-content.is-user-resized {
  border-radius: 12px;
}
.modal-content.is-user-moved {
  position: fixed !important;
  margin: 0 !important;
  z-index: 1000;
}
.modal-content.is-moving {
  opacity: 0.97;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
}
.modal-content.is-user-resized .modal-body,
.modal-content.is-user-resized > div[id$="Body"],
.modal-content.is-user-resized > form:not(.modal-header):not(.modal-footer) {
  overflow: auto;
}
.modal-content.is-measuring,
.modal-content.is-measuring table,
.modal-content.is-measuring th,
.modal-content.is-measuring td,
.modal-content.is-measuring .modal-summary-value,
.modal-content.is-measuring .order-detail-value,
.modal-content.is-measuring .invoice-detail-value,
.modal-content.is-measuring .det-traza-label,
.modal-content.is-measuring .det-meta > span,
.modal-content.is-measuring .dg-prod,
.modal-content.is-measuring .modal-header h3 {
  white-space: nowrap !important;
  text-overflow: clip !important;
  overflow: visible !important;
  max-width: none !important;
}
.modal-header.modal-drag-header,
.modal-header[data-modal-resize-bound] {
  cursor: move;
  user-select: none;
}
@media (max-width: 768px) {
  .modal-content .modal-resize-handle {
    width: 1.45rem;
    height: 1.45rem;
    opacity: 0.7;
  }
}

/* Tipografía de modales: escritorio compacto (evitar dobles filas) */
@media (min-width: 769px) {
  .modal-content {
    font-size: 0.78rem;
    line-height: 1.2;
  }
  .modal-header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .modal-header h3 {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .modal-close {
    font-size: 1.15rem;
    padding: 0.1rem 0.35rem;
  }
  .modal-body,
  .modal-content > form:not(.modal-header):not(.modal-footer),
  .modal-content > div[id$="Body"] {
    padding: 0.55rem 0.75rem 0.7rem;
  }
  .modal-footer {
    padding: 0.45rem 0.75rem;
    gap: 0.35rem;
  }
  .modal-footer .btn,
  .modal-footer button {
    font-size: 0.78rem;
    padding: 0.32rem 0.65rem;
    white-space: nowrap;
  }
  .modal-content p,
  .modal-body p {
    font-size: 0.78rem;
    line-height: 1.2;
    margin: 0.15rem 0;
  }
  .modal-content h4,
  .modal-body h4,
  .order-detail-section-title,
  .invoice-detail-section-title {
    font-size: 0.8rem;
    margin: 0.35rem 0 0.25rem;
    padding: 0.3rem 0.5rem;
    line-height: 1.2;
  }
  .modal-summary-line,
  .order-detail-line,
  .invoice-detail-field,
  .report-detail-field {
    grid-template-columns: 4.6rem minmax(0, 1fr);
    gap: 0.25rem 0.45rem;
    align-items: center;
    padding: 0.28rem 0.55rem;
  }
  .modal-summary-label,
  .order-detail-label,
  .invoice-detail-label {
    font-size: 0.66rem;
    line-height: 1.15;
    white-space: nowrap;
  }
  .modal-summary-value,
  .order-detail-value,
  .invoice-detail-value {
    font-size: 0.76rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .modal-content table th,
  .modal-content table td,
  .modal-content .detail-table th,
  .modal-content .detail-table td {
    font-size: 0.74rem !important;
    line-height: 1.15 !important;
    padding: 0.22rem 0.4rem !important;
    white-space: nowrap;
    vertical-align: middle;
  }
  .modal-content .form-group label {
    font-size: 0.72rem;
    margin-bottom: 0.12rem;
    white-space: nowrap;
  }
  .modal-content .form-group input,
  .modal-content .form-group select,
  .modal-content .form-group textarea {
    font-size: 0.78rem;
    padding: 0.28rem 0.4rem;
    line-height: 1.2;
  }
  .modal-content .badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
    white-space: nowrap;
  }
  .modal-content .muted,
  .modal-content .small {
    font-size: 0.72rem;
    line-height: 1.2;
  }
}

/* Tipografía de modales: móvil — letra angosta + hasta 2 filas si no cabe */
@media (max-width: 768px) {
  .modal-content {
    --modal-narrow-font: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", "Helvetica Neue", Arial, sans-serif;
    font-family: var(--modal-narrow-font);
    font-size: 0.88rem;
    line-height: 1.3;
    letter-spacing: -0.015em;
  }
  .modal-header {
    padding: 0.65rem 0.8rem;
    align-items: flex-start;
  }
  .modal-header h3 {
    font-family: var(--modal-narrow-font);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .modal-close {
    font-size: 1.4rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .modal-body,
  .modal-content > form:not(.modal-header):not(.modal-footer),
  .modal-content > div[id$="Body"] {
    padding: 0.7rem 0.8rem 0.9rem !important;
  }
  .modal-content p,
  .modal-body p {
    font-family: var(--modal-narrow-font);
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
    letter-spacing: -0.015em;
    margin: 0.25rem 0;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .modal-content h4,
  .modal-body h4,
  .order-detail-section-title,
  .invoice-detail-section-title {
    font-family: var(--modal-narrow-font);
    font-size: 0.9rem !important;
    line-height: 1.25;
    letter-spacing: -0.015em;
    white-space: normal;
  }
  .modal-summary-line,
  .order-detail-line,
  .invoice-detail-field {
    grid-template-columns: minmax(4.8rem, 32%) minmax(0, 1fr);
    gap: 0.3rem 0.45rem;
    align-items: start;
    padding: 0.4rem 0.55rem;
  }
  .modal-summary-label,
  .order-detail-label,
  .invoice-detail-label {
    font-family: var(--modal-narrow-font);
    font-size: 0.72rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .modal-summary-value,
  .order-detail-value,
  .invoice-detail-value {
    font-family: var(--modal-narrow-font);
    font-size: 0.88rem !important;
    line-height: 1.25 !important;
    letter-spacing: -0.015em;
    white-space: normal !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: break-word;
    word-break: break-word;
    text-overflow: unset;
  }
  .modal-content table,
  .modal-content .detail-table {
    font-family: var(--modal-narrow-font);
    letter-spacing: -0.015em;
  }
  .modal-content table th,
  .modal-content table td,
  .modal-content .detail-table th,
  .modal-content .detail-table td {
    font-family: var(--modal-narrow-font);
    font-size: 0.84rem !important;
    line-height: 1.25 !important;
    letter-spacing: -0.015em;
    padding: 0.35rem 0.4rem !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    overflow-wrap: break-word;
    word-break: break-word;
    vertical-align: top;
    max-height: calc(1.25em * 2 + 0.7rem);
  }
  .modal-content table.order-sheet-table th,
  .modal-content table.order-sheet-table td {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    word-wrap: normal !important;
    max-height: none !important;
    vertical-align: middle !important;
    padding: 0.14rem 0.12rem !important;
    font-size: 0.7rem !important;
    line-height: 1.15 !important;
  }
  .modal-footer .btn,
  .modal-footer button {
    flex: 1 1 calc(50% - 0.35rem);
    min-height: 2.75rem;
    font-family: var(--modal-narrow-font);
    font-size: 0.9rem !important;
    letter-spacing: -0.01em;
    padding: 0.5rem 0.55rem;
    white-space: normal;
    line-height: 1.2;
  }
  .modal-content .form-group label {
    font-family: var(--modal-narrow-font);
    font-size: 0.82rem !important;
    letter-spacing: -0.01em;
  }
  .modal-content .form-group input,
  .modal-content .form-group select,
  .modal-content .form-group textarea {
    font-family: var(--modal-narrow-font);
    font-size: 0.92rem !important;
    letter-spacing: -0.01em;
    min-height: 2.55rem;
    padding: 0.4rem 0.5rem;
  }
  .modal-content .badge {
    font-family: var(--modal-narrow-font);
    font-size: 0.78rem;
    padding: 0.15rem 0.4rem;
    letter-spacing: -0.01em;
    white-space: normal;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    display: inline-block;
  }
  .modal-content .muted,
  .modal-content .small {
    font-family: var(--modal-narrow-font);
    font-size: 0.8rem !important;
    line-height: 1.3;
    letter-spacing: -0.01em;
    white-space: normal;
  }
  /* Notas / bloques largos: hasta 2 líneas visibles con scroll del modal */
  .modal-content .det-notes,
  .modal-content .alert,
  .modal-content [class*="note"] {
    font-family: var(--modal-narrow-font);
    letter-spacing: -0.015em;
    white-space: normal;
    overflow-wrap: break-word;
  }
}

tr.mov-row-clickable { cursor: pointer; }
tr.mov-row-clickable:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* === 06-desktop-compact.css === */
/* Listas compactas de detalle en modales (OCI, facturas, salidas, etc.) */
.modal-summary,
.order-detail-summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin: 0 0 0.65rem;
  border: 1px solid var(--google-blue-light);
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #fafcff 100%);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.08);
}
.modal-summary-line,
.order-detail-line {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  gap: 0.4rem 0.6rem;
  align-items: start;
  min-width: 0;
  width: 100%;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid #dbeafe;
  box-sizing: border-box;
}
.modal-summary-line:last-child,
.order-detail-line:last-child {
  border-bottom: none;
}
.modal-summary-label,
.order-detail-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #455a64;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.modal-summary-value,
.order-detail-value {
  font-size: 0.9rem;
  color: #0d1b2a;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}
.invoice-detail-grid,
.report-detail-grid,
.sal-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.65rem;
  border: 1px solid var(--google-blue-light);
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #fafcff 100%);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.08);
}
.invoice-detail-field {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  gap: 0.4rem 0.6rem;
  align-items: start;
  margin: 0;
  line-height: 1.3;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid #dbeafe;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.invoice-detail-field:last-child { border-bottom: none; }
.invoice-detail-label { font-weight: 700; color: #455a64; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.02em; }
.invoice-detail-value { color: #0d1b2a; font-size: 0.88rem; overflow-wrap: break-word; word-break: normal; }
.order-detail-section-title,
.invoice-detail-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(90deg, var(--google-blue-tint) 0%, var(--bg-base) 100%);
  border-left: 4px solid var(--link);
  border-radius: 6px;
}
.modal-content .detail-table th {
  background: var(--table-head-bg);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: none;
}
.modal-content .detail-table td {
  border-bottom: 1px solid var(--sheet-border-row);
  line-height: var(--bodega-row-lh);
  padding: var(--bodega-row-py) var(--bodega-row-px) !important;
  font-size: var(--bodega-row-fs);
  color: var(--text-primary);
}
.modal-content .detail-table tbody tr:nth-child(odd) td {
  background: var(--table-row-base);
}
.modal-content .detail-table tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}
.modal-content .detail-table tbody tr:hover td {
  background: var(--table-row-hover);
}
.filter-badge { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }
.filter-badge a { color: var(--blue); text-decoration: none; }
.filter-badge a:hover { text-decoration: underline; }
.detail-table { width: 100%; font-size: 0.85rem; margin-top: 0.5rem; }
.detail-table th, .detail-table td { padding: var(--bodega-row-py) var(--bodega-row-px); color: var(--text-primary); }
.detail-table th { background: var(--table-head-bg); color: var(--table-head-text); font-weight: 700; }

/* Escritorio (Windows / monitores ≥25"): legibilidad al nivel del menú lateral */
@media (min-width: 769px) {
  :root {
    --bodega-row-fs: 0.8rem;
    --bodega-row-lh: 1.15;
    --bodega-row-py: 0.28rem;
    --bodega-row-px: 0.45rem;
    --bodega-field-fs: 0.8rem;
    --bodega-field-h: 2.1rem;
    --bodega-field-py: 0.28rem;
    --bodega-field-px: 0.45rem;
    --bodega-form-gap: 0.4rem;
  }

  body.audit-density {
    font-size: 0.8rem;
    line-height: 1.25;
  }
  body.audit-density .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
  }
  body.audit-density th {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.15;
  }
  body.audit-density td {
    font-size: 0.8rem;
    line-height: 1.15;
  }
  body.audit-density .muted,
  body.audit-density .small {
    font-size: 0.78rem;
  }

  .modal-summary,
  .order-detail-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.18rem 0.7rem;
    padding: 0.2rem 0 0.35rem;
    border: none;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid #e8eaed;
    overflow: visible;
    margin-bottom: 0.5rem;
  }
  .modal-summary-line,
  .order-detail-line {
    grid-template-columns: minmax(4.6rem, 5.4rem) minmax(0, 1fr);
    gap: 0.15rem 0.4rem;
    padding: 0;
    border-bottom: none;
    align-items: baseline;
  }
  .invoice-detail-grid,
  .report-detail-grid,
  .sal-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.18rem 0.7rem;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    margin-bottom: 0.5rem;
  }
  .invoice-detail-field {
    grid-template-columns: minmax(4.6rem, 5.4rem) minmax(0, 1fr);
    gap: 0.15rem 0.4rem;
    padding: 0;
    border-bottom: none;
    align-items: baseline;
  }
  .invoice-detail-label { font-size: 0.68rem; font-weight: 650; letter-spacing: 0.015em; }
  .invoice-detail-value,
  .order-detail-value { font-size: 0.8rem; line-height: 1.2; }
  .order-detail-section-title,
  .invoice-detail-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--blue);
    margin: 0.35rem 0 0.3rem;
    padding: 0.3rem 0.5rem;
  }
  .modal-summary-label,
  .order-detail-label {
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.015em;
    line-height: 1.15;
  }
  .modal-summary-value,
  .order-detail-value {
    line-height: 1.2;
  }
  .order-detail-value {
    font-size: 0.8rem;
  }
  .app-bar {
    height: 52px;
    padding: 0 0.75rem;
  }
  .content {
    padding: 0.7rem 1.1rem;
    max-width: none;
    font-size: 0.8rem;
    line-height: 1.25;
  }
  .content h2 {
    margin: 0.75rem 0 0.5rem;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  .content > h2:first-of-type,
  .content .calidad-page > h2:first-of-type {
    margin: 0 0 0.75rem;
    padding: 0.9rem 1.15rem;
    font-size: 1.52rem;
    font-weight: 700;
  }
  .flex-between {
    margin-bottom: 0.5rem;
    gap: 0.35rem;
  }
  .cards {
    gap: 0.4rem;
    margin-bottom: 0.85rem;
  }
  .card {
    padding: 0.42rem 0.55rem;
    border-radius: 8px;
  }
  .card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
  }
  .card .big {
    font-size: 1.55rem;
    font-weight: 700;
  }
  .card-hint {
    font-size: 0.78rem;
    margin-top: 0.15rem;
  }
  .cards.dashboard-cards.dashboard-cards-narrow {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
  }
  .dashboard-cards-narrow a.card-link {
    flex: 1 1 0;
    min-width: 4rem;
    min-height: 2.5rem;
    max-height: none;
    height: auto;
    padding: 0.24rem 0.36rem;
    gap: 0.28rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .dashboard-cards-narrow .card h3 {
    font-size: 0.68rem;
    line-height: 1.1;
    font-weight: 600;
    -webkit-line-clamp: 4;
    letter-spacing: -0.01em;
  }
  .dashboard-cards-narrow .card .big {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 0 0 auto;
    min-width: 1.15rem;
    text-align: right;
  }
  table th,
  table td {
    padding: var(--bodega-row-py) var(--bodega-row-px);
    font-size: var(--bodega-row-fs);
    line-height: var(--bodega-row-lh);
  }
  .modal-content table th,
  .modal-content table td {
    padding: 0.28rem 0.45rem;
    line-height: 1.15;
  }
  /* Tablas en escritorio: ancho completo, columnas auto y texto visible */
  .content .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .content table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
  }
  .content table th,
  .content table td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
  }
  .content #hubMovTable th,
  .content #hubMovTable td {
    overflow-wrap: normal;
    word-break: normal;
    word-wrap: normal;
  }
  .content #hubMovTable th,
  .content #hubMovTable td.hub-mov-prod,
  .content #hubMovTable td.hub-mov-dea {
    white-space: nowrap;
  }
  .content table .col-nowrap,
  .content table .col-num,
  .content table td .btn,
  .content table td .badge,
  .content table .actions,
  .content table td.actions-cell {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }
  /* Movimientos internos (restaurante): hoja electrónica con columnas fijas */
  .content #miListTable.mi-sheet-table {
    table-layout: fixed !important;
    width: 100% !important;
  }
  .content #miListTable.mi-sheet-table th,
  .content #miListTable.mi-sheet-table td {
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    white-space: normal;
  }
  body.page-mi-staff .content #miListTable.mi-sheet-table th,
  body.page-mi-staff .content #miListTable.mi-sheet-table td {
    overflow: hidden !important;
    text-overflow: ellipsis;
  }
  body.page-mi-staff .content #miListTable.mi-sheet-table .mi-c-act {
    overflow: visible !important;
  }
  .content #miListTable.mi-sheet-table .mi-c-num,
  .content #miListTable.mi-sheet-table .mi-c-type,
  .content #miListTable.mi-sheet-table .mi-c-del,
  .content #miListTable.mi-sheet-table .mi-c-qty,
  .content #miListTable.mi-sheet-table .mi-c-stock,
  .content #miListTable.mi-sheet-table .mi-c-st {
    white-space: nowrap !important;
  }
  .content #miListTable.mi-sheet-table .mi-c-act {
    white-space: nowrap !important;
    max-width: none !important;
  }
  .content #miListTable.mi-sheet-table .mi-c-prod,
  .content #miListTable.mi-sheet-table .mi-c-route {
    white-space: normal !important;
    word-break: break-word;
  }
  /* OCI: listado con columnas fijas y texto truncado */
  .content #ordersTable.orders-table {
    table-layout: fixed !important;
    width: 100% !important;
  }
  .content #ordersTable.orders-table th,
  .content #ordersTable.orders-table td {
    overflow: hidden;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }
  .content #ordersTable.orders-table .col-truncate,
  .content #ordersTable.orders-table .col-proveedor,
  .content #ordersTable.orders-table .col-creado,
  .content #ordersTable.orders-table .col-aprobado,
  .content #ordersTable.orders-table .col-oci,
  .content #ordersTable.orders-table .col-fecha-hora {
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    max-width: 0;
  }
  .content #ordersTable.orders-table .col-nowrap,
  .content #ordersTable.orders-table .col-estado,
  .content #ordersTable.orders-table .col-acciones {
    white-space: nowrap !important;
  }
  /* Columna de casilla: ancho mínimo para que sea visible */
  .content table th:first-child:has(input[type="checkbox"]),
  .content table td:first-child:has(input[type="checkbox"]) {
    min-width: 2rem;
    width: 2rem;
  }
  .content table th:last-child,
  .content table td:last-child {
    max-width: none;
    min-width: 0;
  }
  .content table .actions,
  .content table td.actions-cell,
  .content table td:last-child .btn {
    white-space: nowrap;
  }
  /* Filas de filtros y formularios en una sola línea en escritorio */
  .content .filter-row {
    flex-wrap: nowrap;
  }
  /* OCI: Registrar + Desde, Hasta, Estado, Proveedor y Filtrar en la misma fila */
  .content .orders-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.5rem 0.65rem;
  }
  .content .orders-filters .filter-row {
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .content .orders-filters .filter-register {
    flex: 0 0 auto;
    align-self: flex-end;
  }
  .content .orders-filters .filter-date {
    flex: 0 0 9.5rem;
    max-width: 10.5rem;
  }
  .content .orders-filters .filter-status {
    flex: 0 0 11rem;
    max-width: 13rem;
  }
  .content .orders-filters .filter-supplier {
    flex: 1 1 12rem;
    min-width: 9rem;
  }
  .content .orders-filters .filter-actions {
    flex: 0 0 auto;
    align-self: flex-end;
  }
  .content .orders-filters .filter-row input,
  .content .orders-filters .filter-row select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .form-group {
    margin-bottom: 0.28rem;
  }
  .form-group label {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
  }
  .form-group input,
  .form-group select {
    padding: 0.28rem 0.45rem;
    font-size: 0.8rem;
  }
  .mb1 {
    margin-bottom: 0.5rem;
  }
  .sidebar {
    padding: 0.85rem;
  }
  .sidebar .user-info {
    margin: 0 0 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.85rem;
  }
  .sidebar-nav a {
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
  }
  .sidebar-nav a .material-icons {
    font-size: 20px;
  }
  .sidebar-group-summary {
    font-size: 0.9rem;
  }
  .sidebar-group-links a {
    font-size: 0.875rem;
    padding: 0.45rem 0.6rem;
  }
  button,
  .btn {
    padding: 0.38rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
  }
  .btn-sm {
    padding: 0.28rem 0.5rem;
    font-size: 0.78rem;
  }
  .modal-content {
    padding: 0.6rem;
  }
  .modal-header {
    margin-bottom: 0.45rem;
  }
  .modal-header h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .modal-footer {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
  }
  .modal-close {
    font-size: 1.15rem;
  }
  .valorizacion-bar-wrap {
    margin-bottom: 0.5rem;
  }
  .valorizacion-bar {
    height: 18px;
    margin-bottom: 0.3rem;
  }
  .valorizacion-bar-leyenda {
    font-size: 0.85rem;
    gap: 0.5rem 1rem;
  }
  .valorizacion-dot {
    width: 8px;
    height: 8px;
  }
  .msg {
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
  }
  .dropdown-item {
    padding: 0.32rem 0.48rem;
    font-size: 0.8rem;
  }
  .list-simple li {
    padding: 0.22rem 0;
    font-size: 0.8rem;
  }
  .filter-tab {
    padding: 0.32rem 0.65rem !important;
    font-size: 0.8rem;
    font-weight: 500;
  }
  .filter-badge {
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
  }
  .dashboard-links {
    margin-top: 0.5rem;
    font-size: 0.8rem;
  }
  .bar-row {
    margin-bottom: 0.32rem;
    font-size: 0.8rem;
  }
  .bar-track {
    height: 16px;
  }
  .detail-table th,
  .detail-table td {
    padding: 0.28rem 0.42rem;
    font-size: 0.8rem;
    line-height: 1.15;
  }
  .detail-table th {
    font-weight: 700;
  }
  .form-grid-2 {
    gap: 0.28rem 0.6rem;
  }
  .form-actions {
    margin-top: 0.15rem;
  }
  .global-search-input {
    padding: 0.32rem 0.48rem 0.32rem 1.75rem;
    font-size: 0.8rem;
  }
  .app-bar-title {
    font-size: 1.15rem;
    font-weight: 600;
  }
  .app-bar-user .user-name {
    font-size: 0.8rem;
  }
  .content h3,
  .content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  .content label,
  .content .filter-row label {
    font-size: 0.78rem;
    font-weight: 600;
  }
  .list-simple li + li {
    margin-top: 0;
  }
}

@media (min-width: 769px) and (max-width: 959px) {
  .modal-summary,
  .order-detail-summary,
  .invoice-detail-grid,
  .report-detail-grid,
  .sal-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* === 07-mobile-responsive.css === */
/* ========== Responsive: móviles (todo el sitio) ========== */
@media (max-width: 768px) {
  /* App bar y navegación */
  .app-bar {
    height: auto;
    min-height: 52px;
    padding: 0.45rem 0.65rem;
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
    flex-wrap: nowrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
  }
  .menu-toggle {
    order: 0;
    flex-shrink: 0;
  }
  .app-bar-title {
    order: 1;
    margin-left: 0;
    flex-shrink: 0;
  }
  .app-bar-user {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
  }
  .global-search-mobile-toggle {
    display: inline-flex;
    order: 1;
    flex-shrink: 0;
  }
  .global-search-wrap {
    display: none !important;
    margin-left: 0;
    max-width: none;
  }
  body.gs-mobile-open .global-search-wrap {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 2500;
    flex-direction: column;
    align-items: stretch;
    padding: max(2.85rem, calc(env(safe-area-inset-top, 0px) + 2.35rem)) max(0.65rem, env(safe-area-inset-right, 0px)) max(0.65rem, env(safe-area-inset-bottom, 0px)) max(0.65rem, env(safe-area-inset-left, 0px));
    background: var(--bg-base);
    gap: 0.5rem;
  }
  body.gs-mobile-open .global-search-mobile-close {
    display: inline-flex;
    position: absolute;
    top: max(0.55rem, env(safe-area-inset-top, 0px));
    left: max(0.55rem, env(safe-area-inset-left, 0px));
    z-index: 2;
  }
  body.gs-mobile-open .global-search-input {
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.75rem 0.55rem 2.75rem;
    color: #1a2332;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.08);
  }
  body.gs-mobile-open .global-search-input::placeholder {
    color: #78909c;
  }
  body.gs-mobile-open .global-search-wrap .global-search-icon {
    left: 2.85rem;
    color: #546e7a;
  }
  body.gs-mobile-open .global-search-results {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.1);
  }
  body.gs-mobile-open .global-search-results.gs-has-nav {
    min-width: 0;
    max-height: none;
  }
  body.gs-mobile-open .global-search-results.gs-has-elevator,
  body.gs-mobile-open .global-search-results.gs-has-nav.gs-has-elevator {
    max-height: none;
  }
  body.gs-mobile-open .gs-nav {
    width: 7.5rem;
    max-width: 34%;
  }
  .app-bar-title span:not(.material-icons) { display: none; }
  .app-bar-user .user-name { display: none; }
  .audit-density-toggle-header { display: none; }
  .sidebar { width: 100%; max-width: 300px; }

  /* Contenido móvil: tablas compactas (menos altura de fila) */
  :root {
    --bodega-row-fs: 0.84rem;
    --bodega-row-lh: 1.08;
    --bodega-row-py: 0.16rem;
    --bodega-row-px: 0.35rem;
    --bodega-field-fs: 0.9rem;
    --bodega-field-h: 2rem;
    --bodega-field-py: 0.28rem;
    --bodega-form-gap: 0.32rem;
  }
  body { font-size: 16px; }
  .content {
    padding: 0.75rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }
  .content h2 {
    font-size: 1.0625rem;
    margin: 0.75rem 0 0.45rem;
    color: var(--text-primary);
    font-weight: 600;
  }
  /* Móvil: sin barra azul de título — mismo texto, estilo de encabezado plano */
  .content > h2:first-of-type,
  .content .calidad-page > h2:first-of-type {
    margin: 0 0 0.65rem;
    padding: 0.35rem 0;
    font-size: 1.265625rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    background: none;
    box-shadow: none;
    border-radius: 0;
  }
  .content > h2:first-of-type a,
  .content .calidad-page > h2:first-of-type a {
    color: var(--link);
  }
  .content > h2:first-of-type a:hover,
  .content .calidad-page > h2:first-of-type a:hover {
    color: var(--link-hover);
  }
  .content h3 {
    font-size: 1.1125rem;
    margin: 0 0 0.4rem;
    color: var(--text-primary);
  }
  .content h4 {
    font-size: 1.0125rem;
    margin: 0.5rem 0 0.35rem;
    color: var(--text-secondary);
  }
  .muted,
  .filter-badge,
  .card-hint {
    font-size: 0.8625rem;
    color: var(--text-secondary);
  }

  .filter-tabs {
    gap: 0.45rem;
    padding: 0.45rem 0.5rem;
  }
  a.filter-tab,
  .filter-tabs a.filter-tab {
    font-size: 0.9825rem;
    padding: 0.45rem 0.75rem;
    font-weight: 500;
  }

  /* Grids: una columna o columnas más estrechas para mejor lectura */
  .cards {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
  }
  .cards.dashboard-cards.dashboard-cards-narrow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    gap: 0.35rem;
  }
  /* Indicadores dashboard: título izquierda, número derecha, sin fila de acción */
  .dashboard-cards-narrow a.card-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex: unset;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 3.15rem;
    max-height: none;
    overflow: hidden;
    padding: 0.32rem 0.42rem;
    gap: 0.35rem;
  }
  .dashboard-cards-narrow .card h3 {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.16;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dashboard-cards-narrow .card .big {
    flex: 0 0 auto;
    order: 2;
    display: block;
    min-height: 0;
    font-size: 1.38rem;
    font-weight: 700;
    line-height: 1;
    text-align: right;
    margin: 0;
  }
  .form-grid-2,
  .orders-filters {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .perm-grid {
    grid-template-columns: 1fr;
  }
  .restaurantes-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .valorizacion-bar-leyenda {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.8125rem;
  }

  /* Tablas */
  table th,
  table td {
    font-size: 0.84rem;
    padding: 0.16rem 0.35rem;
    line-height: 1.08;
  }
  /* Tablas en movil (global):
     - evita texto montado/entreverado
     - permite lectura completa
     - habilita scroll horizontal cuando haya muchas columnas */
  .content .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .content table {
    width: max-content;
    min-width: 100%;
    table-layout: auto !important;
    border-collapse: collapse;
  }
  .content table th,
  .content table td {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: var(--bodega-row-lh) !important;
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    vertical-align: middle;
    max-width: none !important;
  }
  .content #hubMovTable th,
  .content #hubMovTable td,
  .content #hubMovTable td.hub-mov-prod,
  .content #hubMovTable td.hub-mov-dea {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    word-wrap: normal !important;
  }
  .content table .col-truncate,
  .content table .col-nowrap {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  /* Facturas, recepciones, precios: proveedor en una línea — altura fila = LOTES */
  .content table.bodega-auto-skip.facturas-table th,
  .content table.bodega-auto-skip.facturas-table td,
  .content table.bodega-compact-rows th,
  .content table.bodega-compact-rows td,
  .content table.recep-table th,
  .content table.recep-table td {
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    line-height: var(--bodega-row-lh) !important;
    font-size: var(--bodega-row-fs) !important;
  }
  .content table.bodega-auto-skip.facturas-table .col-f-prov,
  .content table.bodega-compact-rows .col-proveedor,
  .content table.bodega-compact-rows .col-plazo,
  .content table.recep-table .col-proveedor {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }
  .content table.bodega-auto-skip.facturas-table .col-f-prov,
  .content table.bodega-compact-rows .col-proveedor,
  .content table.recep-table .col-proveedor {
    max-width: 0 !important;
  }
  .content table.recep-table .col-proveedor a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  /* OCI móvil — columnas fijas, proveedor truncado, filas diferenciadas */
  #ordersTableWrap .orders-table {
    border-collapse: separate;
    border-spacing: 0 0.05rem;
    background: transparent;
    font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
  }
  #ordersTableWrap .orders-table thead th {
    background: var(--sheet-head-bg);
    border-bottom: 2px solid var(--sheet-border-head) !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    line-height: var(--bodega-row-lh) !important;
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    font-size: var(--bodega-row-fs) !important;
  }
  #ordersTableWrap .orders-table tbody tr.order-row {
    background: var(--sheet-row-base);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }
  #ordersTableWrap .orders-table tbody tr.order-row:nth-child(even) {
    background: var(--sheet-row-alt);
  }
  #ordersTableWrap .orders-table tbody tr.order-row td {
    border-top: 1px solid var(--sheet-border-row);
    border-bottom: 1px solid var(--sheet-border-row);
    border-bottom-color: var(--sheet-border-row) !important;
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    line-height: var(--bodega-row-lh) !important;
    font-size: var(--bodega-row-fs) !important;
  }
  #ordersTableWrap .orders-table tbody tr.order-row td:first-child {
    border-left: 1px solid #b8c5d4;
    border-radius: 6px 0 0 6px;
  }
  #ordersTableWrap .orders-table tbody tr.order-row td:last-child {
    border-right: 1px solid #b8c5d4;
    border-radius: 0 6px 6px 0;
  }
  #ordersTableWrap .orders-table .col-proveedor,
  #ordersTableWrap .orders-table .oci-row-sup-mobile {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    max-width: 0 !important;
  }
  #ordersTableWrap .orders-table .oci-row-sup-mobile {
    display: none !important;
  }
  .content table .col-num {
    white-space: nowrap !important;
    text-align: right;
  }
  /* Mov. internos restaurante: mantener hoja fija en móvil (no table-layout auto) */
  .content #miListTable.mi-sheet-table {
    width: auto !important;
    min-width: 652px !important;
    max-width: none !important;
    table-layout: fixed !important;
  }
  .content #miListTable.mi-sheet-table th,
  .content #miListTable.mi-sheet-table td {
    line-height: 1.08 !important;
    padding: 0.12rem 0.2rem !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }
  .content #miListTable.mi-sheet-table .mi-c-act,
  .content #miListTable.mi-sheet-table td.mi-c-act {
    overflow: visible !important;
    text-overflow: clip !important;
    max-height: none !important;
    min-width: 6.75rem !important;
  }
  .content #miListTable.mi-sheet-table .mi-c-act .mi-act-compact {
    overflow: visible !important;
    text-overflow: clip !important;
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    min-width: max-content;
  }
  .content #miListTable.mi-sheet-table .mi-act-pdf,
  .content #miListTable.mi-sheet-table .mi-act-pdf .bodega-brand-icon {
    flex-shrink: 0;
  }
  /* Bodeguero / gerencia: tabla mov. internos legible en móvil (no comprimir como restaurante) */
  body.page-mi-staff .content #miListTable.mi-list-table--staff {
    width: max-content !important;
    min-width: 728px !important;
    max-width: none !important;
    table-layout: fixed !important;
  }
  body.page-mi-staff .content #miListTable.mi-list-table--staff th,
  body.page-mi-staff .content #miListTable.mi-list-table--staff td {
    padding: 0.2rem 0.32rem !important;
    line-height: 1.1 !important;
    max-height: none !important;
    height: auto !important;
    font-size: 0.84rem !important;
  }
  body.page-mi-staff .content #miListTable.mi-list-table--staff thead th {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  body.page-mi-staff .content #miListTable.mi-list-table--staff td.mi-c-act {
    overflow: visible !important;
    text-overflow: clip !important;
    min-width: 9.5rem !important;
  }
  .content table td .btn,
  .content table td .badge,
  .content table .actions,
  .content table td.actions-cell {
    white-space: nowrap !important;
  }
  .detail-table th,
  .detail-table td {
    font-size: 0.84rem;
    padding: 0.16rem 0.35rem;
    line-height: 1.08;
  }
  body.audit-density table th,
  body.audit-density table td {
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    line-height: var(--bodega-row-lh) !important;
  }
  body.audit-density table .btn-sm,
  body.audit-density table .btn-act-icon {
    min-height: 1.55rem;
    min-width: 1.55rem;
    padding: 0.06rem 0.18rem !important;
    line-height: 1;
  }

  /* Formularios */
  .form-group label { font-size: 0.9125rem; color: var(--text-secondary); }
  .form-group input,
  .form-group select {
    font-size: 0.9625rem;
    padding: 0.4rem 0.5rem;
  }
  .form-group input[type="number"],
  .form-group input[type="tel"],
  .form-group input[type="email"] {
    max-width: 100%;
  }

  /* Login móvil: mismo estilo claro que escritorio (gris-azul suave + tarjeta blanca) */
  .login-page {
    align-items: center;
    justify-content: center;
    padding: max(1.25rem, env(safe-area-inset-top, 12px)) 1rem max(1.5rem, env(safe-area-inset-bottom, 12px));
    min-height: 100dvh;
    background: var(--gradient-page-bg);
  }
  .login-box {
    background: var(--bg-card);
    border: var(--border-card);
    box-shadow: var(--shadow-card-hover);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-shell);
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
  }
  .login-box h1 {
    color: var(--text-primary);
    text-shadow: none;
    margin-bottom: 1.35rem;
    font-size: 1.25rem;
  }
  .login-box .form-group label {
    color: var(--text-secondary);
    font-weight: 500;
  }
  .login-box .form-group input[type="email"],
  .login-box .form-group input[type="password"] {
    width: 100%;
    max-width: none;
    background: var(--white);
    border: 1px solid rgba(189, 189, 189, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
  }
  .login-box .form-group input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(227, 27, 35, 0.25);
  }
  .login-logo-wrap {
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-card);
  }
  .login-box .error {
    color: var(--danger);
    background: #ffebee;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-input);
    margin-bottom: 0.85rem;
    font-size: 0.88rem;
    border: 1px solid rgba(198, 40, 40, 0.2);
  }
  .login-box .hint {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.78rem;
    line-height: 1.45;
  }
  .login-box button[type="submit"] {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(227, 27, 35, 0.35);
  }

  /* Cards y modales */
  .card {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
  }
  .card h3 { font-size: 0.85rem; }

  /* Modales — angostos también en móvil (márgenes laterales) */
  .modal:not(:has(.lightbox-content)) {
    padding: 3vh 0.65rem;
    align-items: center;
    overflow: hidden;
  }
  .modal:has(.lightbox-content) {
    align-items: center;
    padding: 0.5rem;
    overflow: auto;
  }
  .modal-content {
    width: min(var(--modal-max, 96vw), calc(100vw - 1.3rem)) !important;
    max-width: min(var(--modal-max, 96vw), calc(100vw - 1.3rem)) !important;
    height: auto !important;
    max-height: 88dvh !important;
    margin: 0 auto;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 18px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-content.product-info-modal-content {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
  }
  .modal .product-info-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal .pinfo-modal-head {
    flex-shrink: 0;
  }
  .modal .pinfo-edit-btn,
  .modal .pinfo-modal-head-actions .btn-act-icon {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 2.75rem !important;
    min-height: 2.75rem !important;
  }
  #productInfoModal .pinfo-edit-btn,
  body.pangu-next #productInfoModal .pinfo-edit-btn.btn.primary,
  body.pangu-next #productInfoModal .pinfo-edit-btn.btn-act-icon {
    background: #1d4ed8 !important;
    color: #fff !important;
    border: 1px solid #1e40af !important;
    box-shadow: 0 2px 10px rgba(29, 78, 216, 0.5) !important;
  }
  #productInfoModal .pinfo-edit-btn .material-icons {
    font-size: 1.5rem !important;
    color: #fff !important;
  }
  .modal-content.modal-lg,
  .invoice-modal-scroll,
  .order-detail-modal-scroll,
  .sal-detail-modal-content,
  .detalle-content,
  .facturas-detail-modal,
  .mi-detail-modal-content,
  .op-order-modal-content {
    width: min(var(--modal-max, 700px), calc(100vw - 1.3rem)) !important;
    max-width: min(var(--modal-max, 700px), calc(100vw - 1.3rem)) !important;
    height: auto !important;
    max-height: 88dvh !important;
    margin: 0 auto;
    border-radius: 12px !important;
  }
  .modal-header {
    flex-shrink: 0;
    margin: 0;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(180deg, var(--google-blue-tint) 0%, var(--bg-base) 100%);
    border-bottom: 2px solid var(--border);
    flex-wrap: nowrap;
    align-items: flex-start;
    min-width: 0;
  }
  .modal-header h3 {
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
  }
  .modal-close {
    font-size: 1.25rem;
    padding: 0.12rem 0.4rem;
    line-height: 1;
    background: #fff;
    border: 1px solid var(--google-blue-light);
    border-radius: 8px;
    color: var(--text-secondary);
  }
  .modal-body,
  .modal-content > form,
  .modal-content [id$="Body"] {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.65rem 0.85rem 0.85rem !important;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0.55rem 0.85rem;
    background: var(--bg-base);
    border-top: 1px solid var(--border);
  }
  .modal-footer .btn,
  .modal-footer button {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.92rem;
    justify-content: center;
  }
  .modal-content p {
    margin: 0.22rem 0;
    line-height: 1.35;
    font-size: 0.9rem;
  }
  .modal-content h4,
  .modal-body h4 {
    margin: 0.35rem 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 700;
  }
  .modal-content strong,
  .modal-body strong {
    font-weight: 600;
  }
  .modal-content .form-group {
    margin-bottom: 0.4rem;
  }
  .modal-content .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }
  .modal-content .form-group input,
  .modal-content .form-group select,
  .modal-content .form-group textarea {
    font-size: 0.95rem;
    min-height: 2.6rem;
    padding: 0.45rem 0.55rem;
  }
  .modal-content .form-grid-2 {
    gap: 0.35rem 0.5rem;
  }
  .modal-content .form-actions {
    margin-top: 0.35rem;
    gap: 0.25rem;
  }
  .modal-content table {
    min-width: 520px;
  }
  .modal-content .detail-table th,
  .modal-content .detail-table td {
    padding: 0.35rem 0.4rem !important;
    font-size: 0.84rem;
    line-height: 1.25;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: calc(1.25em * 2 + 0.7rem);
    overflow: hidden;
  }

  /* Paneles de detalle en modales — mantener contraste azul en móvil */
  .modal-summary-line,
  .order-detail-line,
  .invoice-detail-field {
    padding: 0.38rem 0.55rem;
  }
  /* OCI móvil — resumen compacto, sin franja «Ítems de este proveedor» */
  #orderDetailModal .order-detail-line {
    padding: 0.22rem 0.55rem !important;
    align-items: center;
  }
  #orderDetailModal .order-detail-label {
    line-height: 1.1;
  }
  #orderDetailModal .order-detail-value {
    line-height: 1.15;
  }
  #orderDetailModal .order-detail-section {
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  #orderDetailModal .order-detail-section-title {
    display: block !important;
  }
  .order-detail-section {
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
  }
  .review-alert {
    margin: 0 0 0.35rem;
    padding: 0.35rem 0.45rem;
    gap: 0.35rem;
  }
  .review-alert strong { font-size: 0.8rem; }
  .review-alert span { font-size: 0.74rem; }
  .report-detail-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 0.25rem;
    margin-bottom: 0.35rem;
    gap: 0.35rem;
  }
  .report-detail-title { font-size: 0.88rem; line-height: 1.2; }
  .report-detail-subtitle { font-size: 0.76rem; margin-top: 0.05rem; word-break: break-word; }
  .report-detail-chip {
    align-self: flex-start;
    white-space: normal;
    max-width: 100%;
    line-height: 1.25;
  }
  /* OCI móvil — lista con scroll horizontal; modales a pantalla completa */
  #ordersTableWrap .orders-table {
    min-width: 36rem !important;
    width: max-content !important;
    table-layout: auto !important;
  }
  #ordersTableWrap .orders-table .col-oci,
  #ordersTableWrap .orders-table .col-fecha-hora,
  #ordersTableWrap .orders-table .col-proveedor,
  #ordersTableWrap .orders-table .col-estado,
  #ordersTableWrap .orders-table .col-acciones {
    max-width: none !important;
  }
  .orders-table-scroll-hint { display: block; }
  #orderDetailModal.modal,
  #ociApproveModal.modal,
  #ociCatalogModal.modal {
    padding: 2vh 0.65rem !important;
    align-items: center !important;
    overflow: hidden !important;
  }
  #orderDetailModal .modal-content.modal-lg,
  #receptionDetailModal .modal-content.modal-lg,
  #lotDetailModal .modal-content.modal-lg,
  #lotDetailModal .lot-detail-modal,
  .bodega-trace-modal .modal-content,
  .facturas-detail-modal,
  #orderDetailModal .order-detail-modal-scroll,
  #ociApproveModal .oci-approve-modal {
    width: min(var(--modal-max, 700px), calc(100vw - 1.3rem)) !important;
    max-width: min(var(--modal-max, 700px), calc(100vw - 1.3rem)) !important;
    height: auto !important;
    max-height: 92dvh !important;
    box-sizing: border-box;
    border-radius: 12px !important;
  }
  #orderDetailModal #orderDetailBody,
  #ociApproveModal .oci-approve-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #orderDetailModal .order-detail-section-title {
    display: block !important;
  }
  .modal-header {
    flex-wrap: nowrap;
    align-items: flex-start;
    min-width: 0;
  }
  .modal-header h3,
  .modal-header .facturas-detail-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
    padding-right: 0.25rem;
  }
  .modal-header .modal-close {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: -0.1rem;
  }
  .det-meta {
    gap: 0.15rem 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
  }
  .det-traza {
    margin-bottom: 0.35rem;
    padding-left: 0.5rem;
  }
  .det-traza-row {
    padding: 0.15rem 0;
    font-size: 0.76rem;
  }
  .det-notes {
    margin-bottom: 0.35rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.76rem;
  }
  .det-grid .dg-head {
    padding: 0.22rem 0.4rem;
    font-size: 0.72rem;
  }
  .det-grid > div:not(.dg-head) {
    padding: 0.2rem 0.4rem;
    font-size: 0.74rem;
  }
  .lightbox-content {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 100%;
  }

  .order-detail-items th,
  .order-detail-items td {
    padding: 0.16rem 0.32rem;
    font-size: 0.84rem;
    line-height: 1.08;
  }

  /* Botones y mensajes — móvil: texto e iconos más legibles */
  button, .btn { padding: 0.52rem 1rem; font-size: 1.0125rem; }
  .btn-sm { padding: 0.42rem 0.7rem; font-size: 0.9625rem; }
  .btn .material-icons,
  .btn-sm .material-icons,
  button > .material-icons {
    font-size: 24px;
    vertical-align: middle;
    line-height: 1;
  }
  .msg { font-size: 0.9125rem; padding: 0.45rem 0.6rem; }

  /* Menú lateral móvil */
  .sidebar-nav a { font-size: 0.9625rem; }
  .sidebar .user-info { font-size: 0.9125rem; }
  .sidebar-group-summary { font-size: 0.9625rem; }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .content {
    padding: 0.5rem 0.65rem;
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  }
  .content h2 { font-size: 1.0125rem; margin: 0.65rem 0 0.4rem; }
  .content > h2:first-of-type,
  .content .calidad-page > h2:first-of-type {
    font-size: 1.1725rem;
    padding: 0.3rem 0;
    margin-bottom: 0.5rem;
    background: none;
    box-shadow: none;
    border-radius: 0;
    color: var(--text-primary);
  }
  .content h3 { font-size: 1.045rem; }
  .cards { gap: 0.5rem; }
  .cards.dashboard-cards.dashboard-cards-narrow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    gap: 0.3rem;
  }
  .dashboard-cards-narrow a.card-link {
    flex: unset;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 3rem;
    max-height: none;
    padding: 0.28rem 0.36rem;
    gap: 0.3rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .dashboard-cards-narrow .card h3 {
    font-size: 0.86rem;
    line-height: 1.14;
    -webkit-line-clamp: 3;
    flex: 1 1 auto;
    min-width: 0;
  }
  .dashboard-cards-narrow .card .big {
    font-size: 1.28rem;
    flex: 0 0 auto;
    text-align: right;
  }
  table th, table td { font-size: 0.82rem; padding: 0.14rem 0.3rem; line-height: 1.08; }
  .form-group input, .form-group select { font-size: 0.9125rem; padding: 0.35rem 0.45rem; }
  .card { padding: 0.5rem 0.6rem; }
  .modal { padding: 3vh 0.65rem; }
  .modal-content {
    padding: 0 !important;
    width: min(var(--modal-max, 96vw), calc(100vw - 1.3rem)) !important;
    max-width: min(var(--modal-max, 96vw), calc(100vw - 1.3rem)) !important;
    height: auto !important;
    max-height: 88dvh !important;
    border-radius: 12px !important;
  }
  .modal-header {
    margin-bottom: 0;
    padding: 0.55rem 0.75rem;
  }
  .modal-footer {
    margin-top: 0;
    padding: 0.5rem 0.75rem;
  }
  .modal-summary-line,
  .order-detail-line,
  .invoice-detail-field {
    grid-template-columns: 5rem minmax(0, 1fr);
    padding: 0.36rem 0.55rem;
  }
  button, .btn { padding: 0.35rem 0.7rem; font-size: 0.8825rem; }
  .order-detail-value.recepcion-ok { color: var(--success); }
  .order-detail-value.recepcion-parcial { color: #e65100; }
  .restaurantes-grid { gap: 0.5rem; }
  .rest-card { padding: 0.6rem 0.8rem; }
  .rest-card-title { font-size: 1.0125rem; }
  .rest-card-meta, .rest-card-stats { font-size: 0.8425rem; }
}
.kardex-link,
.kardex-lot-link,
.kardex-ref-link {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}
.kardex-lot-link:hover,
.kardex-ref-link:hover { color: var(--accent-hover); }
.kardex-highlight { background: #fff9c4 !important; }
.perm-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.perm-access-summary {
  flex: 1 1 220px;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.4rem 1.2rem;
  margin-top: 0.25rem;
  flex: 1 1 260px;
}
.checkbox-inline {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.checkbox-inline input[type="checkbox"] {
  margin: 0;
}
@media (max-width: 768px) {
  .perm-layout {
    flex-direction: column;
  }
  .perm-grid {
    grid-template-columns: 1fr;
  }
}

/* Restaurantes: tarjetas minimizadas con movimiento */
.restaurantes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.rest-card {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* Tarjetas restaurante: mismo tratamiento visual que el hub (van con .card) */
.card.rest-card {
  transition: box-shadow .2s, transform .15s, border-color .15s;
}
.card.rest-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(227, 27, 35, 0.22);
  transform: translateY(-1px);
}
.rest-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.rest-code-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}
.rest-code {
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: 0.25rem;
}
.rest-card-meta {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.3;
}
.rest-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.rest-stat {
  white-space: nowrap;
}
.rest-stat strong {
  color: var(--text-primary);
  margin-right: 0.2rem;
}
.rest-card .btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.dashboard-bars { margin-top: 0.5rem; }
.bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-primary); }
.bar-label { min-width: 100px; }
.bar-track { flex: 1; height: 20px; background: rgba(189, 189, 189, 0.45); border-radius: 10px; overflow: hidden; }
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--link) 0%, #4285f4 100%);
  border-radius: 10px;
  transition: width 0.3s;
}
.bar-value { min-width: 2rem; text-align: right; color: var(--text-secondary); }
.muted { color: var(--text-secondary) !important; }
.list-simple { list-style: none; padding: 0; margin: 0; }
.list-simple a { color: var(--blue); text-decoration: none; }
.list-simple a:hover { text-decoration: underline; }
.list-simple li { color: var(--text-secondary); border-bottom: 1px solid var(--border); padding: 0.4rem 0; }
.content a:not(.btn) { color: var(--blue); text-decoration: none; }
.content a:not(.btn):hover { text-decoration: underline; }
.card-hint a { color: var(--blue); }
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  background: var(--white);
  border-radius: var(--radius-card);
  border: var(--border-card);
  box-shadow: var(--shadow-card);
}
.filter-tabs a { color: var(--text-secondary); }
.filter-tabs a.active { background: var(--blue); color: var(--white); }
.filter-tab { background: var(--gray-medium) !important; color: var(--text-primary) !important; }
.filter-tab:hover { background: var(--gray-light) !important; color: var(--blue) !important; }
.filter-tab.active { background: var(--blue) !important; color: var(--white) !important; }
.btn-sm { font-family: "Roboto", sans-serif; }
.actions .btn { margin: 0 0.15rem; }

/* Botones de acción solo ícono (tooltip = title / aria-label) */
.btn-act-icon,
a.link-act-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.22rem 0.38rem !important;
  line-height: 1;
  vertical-align: middle;
}
.btn-act-icon .material-icons,
.link-act-icon .material-icons {
  font-size: 1.2rem !important;
  margin: 0;
  vertical-align: middle;
}
.bodega-brand-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 5px;
}
.btn-act-icon--brand {
  padding: 0.18rem 0.32rem !important;
  min-width: 2.1rem;
}
.content table td .btn-act-icon,
.content table td .link-act-icon,
.content table .actions .btn-act-icon {
  margin: 0 0.12rem;
}
.content table td:last-child .btn-act-icon {
  padding: 0.2rem 0.32rem !important;
}
.content .export-toolbar,
.content .filter-row .btn-act-icon {
  margin: 0 0.1rem;
}
.content .export-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

/* Barras de filtro / selección: botones solo ícono, en línea compacta */
.content .filter-row,
.content .recep-date-filters,
.content .orders-filters,
.content .filter-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.content .filter-row .btn-act-icon,
.content .recep-date-filters .btn-act-icon,
.content .orders-filters .btn-act-icon,
.content .filter-tabs .btn-act-icon,
.content .filter-tabs a.btn-act-icon {
  flex-shrink: 0;
}
.content .filter-row .btn-act-icon.btn.danger,
.content .filter-row .btn-act-icon.btn.danger:hover {
  background: linear-gradient(180deg, #ef5350 0%, #c62828 50%, #b71c1c 100%) !important;
  color: #fff !important;
  border: none !important;
}
/* Casillas de selección en tablas: columna estrecha */
.content table th.col-check,
.content table td.col-check,
.content table th:has(input[type="checkbox"]),
.content table td:has(input[type="checkbox"]) {
  width: 2.25rem;
  min-width: 2.25rem;
  max-width: 2.5rem;
  text-align: center;
  vertical-align: middle;
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}
.content table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
/* Enlaces de acción en tablas → solo ícono */
a.link-detail.link-act-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
  text-decoration: none !important;
  color: var(--blue);
}
a.link-detail.link-act-icon:hover {
  background: var(--table-row-hover);
}

/* Móvil: íconos de acción (Editar, etc.) siempre visibles en tablas y modales */
@media (max-width: 768px) {
  .content table td:last-child,
  .content table td.actions,
  .content table td.col-f-acc,
  .content table td[class*="col-acc"],
  .content table td[class*="-acc"] {
    overflow: visible !important;
    text-overflow: clip !important;
    min-width: 2.75rem;
    vertical-align: middle !important;
  }
  .content table td .btn-act-icon,
  .content table td .link-act-icon,
  .modal .btn-act-icon,
  .modal .link-act-icon {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 1.85rem;
    min-height: 1.85rem;
    flex-shrink: 0;
    padding: 0.14rem 0.28rem !important;
  }
  .content table td .btn-act-icon .material-icons,
  .content table td .link-act-icon .material-icons,
  .modal .btn-act-icon .material-icons,
  .modal .link-act-icon .material-icons {
    font-size: 1.15rem !important;
  }

}

/* Pedido restaurante: planilla siempre a pantalla completa */
#modalNewOrder.modal {
  padding: 0 !important;
  align-items: stretch !important;
  overflow: hidden !important;
}
#modalNewOrder .modal-content.order-sheet-modal {
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: none !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 0 !important;
}


/* === 08-hub-operaciones.css === */
/* Hub Operaciones (vista compacta) */
.hub-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-bottom: 2rem;
}
.hub-page.home-unified {
  max-width: none;
  width: 100%;
}
.content .hub-page h2.home-section-title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.content .hub-page h2.home-section-title .material-icons {
  font-size: 22px;
  color: var(--text-secondary);
}
/* Indicadores a ancho completo; stock y paneles debajo */
.home-unified-stats-full {
  width: 100%;
  min-width: 0;
  margin-bottom: 0.35rem;
}
.home-unified-below {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
}
.home-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 0.85rem;
}
.home-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(227, 27, 35, 0.25);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.home-shortcut .material-icons {
  font-size: 18px;
}
.home-shortcut:hover {
  background: var(--google-blue-tint);
  border-color: rgba(227, 27, 35, 0.45);
}
/* Indicadores Inicio unificado — escritorio: forzar fila (supera grid .cards si CSS vino de caché vieja) */
@media (min-width: 769px) {
  .hub-page.home-unified .home-unified-stats-full .cards.dashboard-cards.dashboard-cards-narrow {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: unset !important;
    overflow-x: visible;
  }
  .hub-page.home-unified .home-unified-stats-full .dashboard-cards-narrow a.card-link {
    min-width: 0;
    flex: 1 1 0;
    padding: 0.24rem 0.36rem;
    gap: 0.28rem;
  }
  .hub-page.home-unified .home-unified-stats-full .dashboard-cards-narrow a.card-link h3 {
    font-size: 0.68rem;
    line-height: 1.1;
    -webkit-line-clamp: 4;
    letter-spacing: -0.01em;
  }
  .hub-page.home-unified .home-unified-stats-full .dashboard-cards-narrow a.card-link .big {
    font-size: 1.1rem;
    min-width: 1.15rem;
  }
}
@media (max-width: 768px) {
  /* Inicio unificado: más contenido visible en móvil */
  .hub-page.home-unified {
    padding-bottom: 0.5rem;
  }
  .hub-page.home-unified .hub-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    margin-top: 0;
  }
  .hub-page.home-unified .hub-tile {
    padding: 0.42rem 0.28rem;
    font-size: 0.8825rem;
    gap: 0.22rem;
    border-radius: 10px;
    min-height: 3.45rem;
    font-weight: 600;
    line-height: 1.2;
  }
  .hub-page.home-unified .hub-tile .material-icons {
    font-size: 26px;
  }
  .content .hub-page h2.home-section-title {
    font-size: 1.0825rem;
    margin-bottom: 0.35rem;
  }
  .content .hub-page h2.home-section-title .material-icons {
    font-size: 24px;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple > .hub-panel {
    width: 100%;
    min-width: 0;
    flex: none;
    padding: 0.45rem 0.55rem;
    overflow: hidden;
    box-sizing: border-box;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-panel-head {
    margin-bottom: 0.28rem;
    padding-bottom: 0.22rem;
    flex-shrink: 0;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-panel-h {
    font-size: 0.8125rem;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-list,
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo,
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo-scroll {
    max-height: 5.25rem !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    min-width: 0;
    flex: none;
    margin: 0;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-list li {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.28rem 0;
    font-size: 0.78rem;
    white-space: nowrap;
    min-width: min-content;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-list li a,
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-low-main {
    min-width: 0;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: visible;
    word-break: normal;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-meta {
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: visible;
    word-break: normal;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo > li {
    flex-wrap: nowrap;
    padding: 0.28rem 0.4rem;
    font-size: 0.78rem;
    white-space: nowrap;
    min-width: min-content;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo-name {
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: visible;
    word-break: normal;
  }
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo-qty {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .hub-page.home-unified .home-hub-stock,
  .hub-page.home-unified .home-hub-movements {
    overflow: visible;
    margin-top: 0.5rem;
  }
  .hub-page.home-unified .hub-panel-wide {
    margin-top: 0.35rem;
    clear: both;
    padding: 0.42rem 0.48rem 0.48rem;
    overflow: hidden;
  }
  .hub-page.home-unified .hub-panel-wide .hub-panel-head {
    padding-left: 0.05rem;
    padding-right: 0.05rem;
  }
  .hub-page.home-unified .hub-panel-wide .hub-table-wrap {
    width: calc(100% + 0.96rem);
    max-width: calc(100% + 0.96rem);
    margin-left: -0.48rem;
    margin-right: -0.48rem;
    margin-bottom: -0.48rem;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0 0 var(--radius-card, 10px) var(--radius-card, 10px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hub-page.home-unified .hub-panel-wide #hubMovTable {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  .hub-page.home-unified .hub-panel-wide #hubMovTable th,
  .hub-page.home-unified .hub-panel-wide #hubMovTable td {
    padding: 0.28rem 0.32rem;
    font-size: 0.74rem;
  }
  .hub-page.home-unified .hub-panel-wide #hubMovTable td.hub-mov-dea {
    max-width: none;
    min-width: 0;
    white-space: nowrap;
  }
  .hub-page.home-unified .hub-panel:not(.hub-panel-wide) {
    padding: 0.42rem 0.48rem;
  }
  .hub-page.home-unified .hub-panel-head {
    margin-bottom: 0.3rem;
    padding-bottom: 0.28rem;
    gap: 0.25rem;
  }
  .hub-page.home-unified .hub-panel-head .hub-panel-h {
    font-size: 0.8825rem;
  }
  .hub-page.home-unified .hub-panel-link {
    font-size: 0.8125rem;
  }
  .hub-page.home-unified .hub-hint {
    font-size: 0.7125rem;
  }
  .hub-page.home-unified .hub-table th,
  .hub-page.home-unified .hub-table td {
    padding: 0.16rem 0.28rem;
    font-size: 0.7625rem;
    line-height: 1.08;
  }
  /* Indicadores móvil: dos columnas con espacio reservado para el conteo. */
  .hub-page.home-unified .home-unified-stats-full .cards.dashboard-cards.dashboard-cards-narrow {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.28rem;
    overflow-x: visible;
  }
}
.hub-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.35rem;
  background: var(--gradient-page-hero);
  border-radius: var(--radius-shell);
  color: #fff;
  box-shadow: var(--shadow-hero);
}
.hub-hero-text { flex: 1 1 200px; }
.hub-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hub-sub {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  opacity: 0.92;
  line-height: 1.35;
}
.hub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.hub-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.52rem 0.42rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.2;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.hub-tile .material-icons {
  font-size: 22px;
  color: var(--blue);
}
.hub-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(227, 27, 35, 0.15);
  border-color: rgba(227, 27, 35, 0.35);
  color: var(--blue);
}
.hub-tile-warn {
  border-color: rgba(245, 124, 0, 0.45);
  background: linear-gradient(180deg, #fff8e1 0%, #fff 100%);
}
.hub-tile-warn .material-icons { color: var(--warning); }
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
/* Inicio unificado: tres columnas iguales (bajo mínimo · caduca 14d · reposición) */
.hub-page.home-unified .hub-grid.hub-grid-stock-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple > .hub-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0.38rem 0.48rem;
  min-height: 9.25rem;
  height: 100%;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-panel-head {
  margin-bottom: 0.22rem;
  padding-bottom: 0.18rem;
  gap: 0.2rem;
  flex-shrink: 0;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-panel-h {
  font-size: 0.78rem;
  gap: 0.2rem;
  line-height: 1.15;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-panel-h .material-icons {
  font-size: 17px;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-panel-link {
  font-size: 0.72rem;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-hint-compact {
  font-size: 0.62rem;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-list,
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo-scroll {
  flex: 1 1 auto;
  min-height: 4.75rem;
  max-height: 4.75rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-list li {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  padding: 0.14rem 0;
  font-size: 0.72rem;
  line-height: 1.18;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-list li a {
  font-size: inherit;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-meta {
  font-size: 0.65rem;
  line-height: 1.15;
  flex-shrink: 0;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-low-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-oci-icon {
  width: 1.42rem;
  height: 1.42rem;
  border-radius: 4px;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-oci-icon .material-icons {
  font-size: 0.88rem !important;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo {
  gap: 0.18rem;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo > li {
  padding: 0.2rem 0.32rem;
  font-size: 0.72rem;
  line-height: 1.18;
  gap: 0.22rem 0.35rem;
  border-radius: 5px;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo-qty {
  font-size: 0.72rem;
  white-space: nowrap;
}
.hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-repo .btn.btn-sm {
  padding: 0.14rem 0.38rem !important;
  font-size: 0.66rem !important;
  line-height: 1.1;
  min-height: 0;
}
.hub-repo-scroll {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.hub-panel-replenish .hub-panel-h .material-icons { color: var(--text-secondary); }
.hub-hint-compact {
  font-size: 0.72rem;
  line-height: 1.2;
  max-width: 7.5rem;
  text-align: right;
}
@media (max-width: 1150px) and (min-width: 769px) {
  .hub-page.home-unified .hub-grid.hub-grid-stock-triple .hub-hint-compact {
    display: none;
  }
}
.hub-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: var(--border-card);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-card);
}
.hub-panel-wide { margin-bottom: 0.85rem; }
.hub-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-light);
}
.hub-panel-head h2,
.hub-panel-head .hub-panel-h {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.hub-panel-head h2 .material-icons,
.hub-panel-head .hub-panel-h .material-icons {
  font-size: 22px;
  color: var(--blue);
}
.hub-panel-alert h2 .material-icons,
.hub-panel-alert .hub-panel-h .material-icons { color: var(--warning); }
.hub-panel-expire h2 .material-icons,
.hub-panel-expire .hub-panel-h .material-icons { color: #e65100; }
.hub-panel-link {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.hub-hint { font-size: 0.8rem; }
.hub-hint-inline { font-size: 0.74rem; margin-right: auto; }
.hub-panel-wide .hub-panel-head:has(.hub-hint-inline) {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.hub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.hub-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--gray-light);
  font-size: 0.88rem;
}
.hub-list li:last-child { border-bottom: none; }
.hub-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.hub-low-main {
  flex: 1 1 140px;
  min-width: 0;
}
.hub-oci-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  color: var(--btn-primary);
  background: rgba(227, 27, 35, 0.08);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.hub-oci-icon:hover {
  background: rgba(227, 27, 35, 0.16);
  color: var(--blue);
}
.hub-oci-icon .material-icons {
  font-size: 1.05rem !important;
}
.hub-repo {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.hub-repo > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.65rem;
  background: var(--gray-light);
  border-radius: 8px;
  font-size: 0.88rem;
}
.hub-repo-name { flex: 1 1 160px; }
.hub-repo-qty {
  font-weight: 600;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.hub-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--gray-light);
}
.hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.hub-table th,
.hub-table td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  text-align: left;
  border-bottom: 1px solid var(--table-border);
  line-height: var(--bodega-row-lh);
  font-size: var(--bodega-row-fs);
  vertical-align: middle;
}
.hub-table th {
  background: var(--table-head-bg);
  font-weight: 700;
  color: var(--table-head-text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hub-table tbody tr:nth-child(even) { background: var(--table-row-alt); }
.hub-table tbody tr:hover { background: var(--table-row-hover); }
.hub-mov-clickable { cursor: pointer; }
.hub-table tbody tr.hub-mov-clickable:hover { background: #e8f4fd; }
.hub-table td.hub-mov-dea {
  max-width: none;
  min-width: 14rem;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
  word-wrap: normal;
}
.hub-mov-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #374151;
}
.hub-mov-type {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.38rem 0.12rem 0.28rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 100%;
}
.hub-mov-type-ico {
  font-size: 0.95rem !important;
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}
.hub-mov-type-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-mov--ingreso { color: #1b5e20; background: #e8f5e9; border-color: #81c784; }
.hub-mov--salida { color: #b71c1c; background: #ffebee; border-color: #e57373; }
.hub-mov--traslado { color: var(--blue); background: var(--google-blue-tint); border-color: var(--google-blue-light); }
.hub-mov--ajuste { color: #4a148c; background: #f3e5f5; border-color: #ba68c8; }
.hub-mov--prod { color: #00695c; background: #e0f2f1; border-color: #4db6ac; }
.hub-mov--consumo { color: #e65100; background: #fff3e0; border-color: #ffb74d; }
.hub-mov--merma { color: #bf360c; background: #fbe9e7; border-color: #ff8a65; }
.hub-mov--otro { color: #455a64; background: #eceff1; border-color: #b0bec5; }
.hub-mov-qty {
  display: inline-block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.06rem 0.3rem;
  border-radius: 4px;
}
.hub-mov-qty--pos { color: #1b5e20; background: #f1f8e9; }
.hub-mov-qty--neg { color: #c62828; background: #ffebee; }
.hub-mov-qty--zero { color: #616161; }
.hub-mov-type-cell,
.hub-mov-qty-cell {
  white-space: nowrap;
}
/* Modal detalle movimiento (dashboard) — flotante compacto sobre la página */
#hubMovDetailModal.modal {
  padding: 0.75rem;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: rgba(11, 25, 40, 0.52);
}
#hubMovDetailModal .modal-content {
  width: auto !important;
  max-width: min(680px, calc(100vw - 1.5rem)) !important;
  height: auto !important;
  max-height: min(88dvh, calc(100dvh - 1.5rem)) !important;
  min-height: 0;
  margin: auto;
  border-radius: 12px;
  border: 1px solid var(--google-blue-light);
  border-top: 3px solid var(--accent);
  border-bottom: none;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), 0 4px 14px rgba(21, 101, 192, 0.18);
  overflow: hidden;
  flex-shrink: 0;
}
#hubMovDetailModal .modal-header {
  padding: 0.32rem 0.45rem;
  border-bottom-width: 1px;
  gap: 0.35rem;
  border-radius: 12px 12px 0 0;
}
#hubMovDetailModal .modal-header h3 {
  font-size: 0.82rem;
  line-height: 1.15;
  font-weight: 700;
}
#hubMovDetailModal .modal-close {
  min-width: 1.65rem;
  min-height: 1.65rem;
  padding: 0.1rem 0.28rem;
  font-size: 1.1rem;
  line-height: 1;
}
#hubMovDetailModal .modal-body {
  padding: 0.28rem 0.4rem 0.35rem;
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(88dvh - 5.5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#hubMovDetailModal .modal-footer {
  padding: 0.28rem 0.4rem;
  gap: 0.3rem;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  border-radius: 0 0 12px 12px;
}
#hubMovDetailModal .modal-footer .btn {
  padding: 0.22rem 0.45rem;
  font-size: 0.74rem;
  line-height: 1.1;
}
.hub-mov-detail-section {
  margin-bottom: 0.38rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid #e2e8f0;
}
.hub-mov-detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.hub-mov-detail-section-title {
  margin: 0 0 0.18rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.hub-mov-detail-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid #cfe0f5;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
@media (min-width: 480px) {
  .hub-mov-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hub-mov-detail-line {
  display: grid;
  grid-template-columns: minmax(4.6rem, 40%) 1fr;
  border-bottom: 1px solid #e8eef5;
  min-width: 0;
}
@media (min-width: 480px) {
  .hub-mov-detail-line:nth-child(odd) {
    border-right: 1px solid #e8eef5;
  }
}
.hub-mov-detail-label {
  padding: 0.12rem 0.32rem;
  font-size: 0.64rem;
  font-weight: 600;
  color: #546e7a;
  background: var(--bg-base);
  border-right: 1px solid var(--google-blue-tint);
  line-height: 1.08;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.hub-mov-detail-value {
  padding: 0.12rem 0.32rem;
  font-size: 0.72rem;
  color: #1e293b;
  line-height: 1.1;
  word-break: break-word;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.hub-mov-detail-table-wrap {
  margin-top: 0.22rem;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hub-mov-detail-table-wrap--related {
  width: 100%;
  overflow-x: visible;
}
.hub-mov-detail-table {
  width: 100%;
  min-width: 0;
  font-size: 0.68rem;
  line-height: 1.1;
  table-layout: fixed;
  border-collapse: collapse;
}
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) th,
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) td {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  max-width: 0;
}
.hub-mov-detail-table th {
  background: var(--table-head-bg);
  color: var(--text-primary);
  font-size: 0.64rem;
  padding: 0.18rem 0.28rem;
  line-height: 1.08;
}
.hub-mov-detail-table td {
  padding: 0.16rem 0.28rem;
  vertical-align: middle;
  line-height: 1.1;
}
/* Tabla ítems OCI / pedido (4–5 columnas) */
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) th:nth-child(1),
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) td:nth-child(1) { width: 26%; }
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) th:nth-child(2),
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) td:nth-child(2) { width: 9%; }
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) th:nth-child(3),
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) td:nth-child(3) { width: 11%; }
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) th:nth-child(4),
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) td:nth-child(4) { width: 11%; }
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) th:nth-child(5),
#hubMovDetailModal .hub-mov-detail-table:not(.hub-mov-detail-table--related) td:nth-child(5) { width: 43%; }
/* Otros movimientos misma transacción — filas al ancho completo de la franja azul */
#hubMovDetailModal .hub-mov-detail-table--related {
  width: 100%;
  table-layout: fixed;
  font-size: 0.68rem;
  line-height: 1.1;
}
#hubMovDetailModal .hub-mov-detail-table--related th,
#hubMovDetailModal .hub-mov-detail-table--related td {
  display: table-cell !important;
  max-width: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
#hubMovDetailModal .hub-mov-detail-table--related td:nth-child(3),
#hubMovDetailModal .hub-mov-detail-table--related td:nth-child(6) {
  white-space: normal;
  word-break: break-word;
  line-height: 1.12;
}
.hub-mov-detail-table tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}
/* Últimos movimientos (Inicio): misma altura de fila que LOTES */
.hub-page.home-unified #hubMovTable th,
.hub-page.home-unified #hubMovTable td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  font-size: var(--bodega-row-fs);
  line-height: var(--bodega-row-lh);
  vertical-align: middle;
}
.hub-page.home-unified #hubMovTable th {
  font-size: 0.78rem;
}

/* Pixel / landscape: overflow-wrap:anywhere encoge PRODUCTO y DE/A a 1 letra */
.hub-page.home-unified .hub-panel-wide .hub-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.hub-page.home-unified #hubMovTable {
  width: 100%;
  min-width: 64rem;
  table-layout: fixed;
}
.hub-page.home-unified #hubMovTable th,
.hub-page.home-unified #hubMovTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
  word-wrap: normal;
}
.hub-page.home-unified #hubMovTable th {
  white-space: nowrap;
}
.hub-page.home-unified #hubMovTable th:nth-child(1),
.hub-page.home-unified #hubMovTable td.hub-mov-date {
  width: 8.3rem;
  white-space: nowrap;
}
.hub-page.home-unified #hubMovTable th:nth-child(2),
.hub-page.home-unified #hubMovTable td.hub-mov-type-cell {
  width: 10.5rem;
  white-space: nowrap;
  padding-left: 0.28rem;
  padding-right: 0.28rem;
}
.hub-page.home-unified #hubMovTable td.hub-mov-prod,
.hub-page.home-unified #hubMovTable th:nth-child(3) {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
.hub-page.home-unified #hubMovTable th:nth-child(4),
.hub-page.home-unified #hubMovTable td.hub-mov-qty-cell {
  width: 9rem;
  white-space: nowrap;
  text-align: right;
}
.hub-page.home-unified #hubMovTable td.hub-mov-dea,
.hub-page.home-unified #hubMovTable th:nth-child(5) {
  width: 13%;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
}
.hub-page.home-unified #hubMovTable th:nth-child(6),
.hub-page.home-unified #hubMovTable td.hub-mov-user {
  width: 13rem;
  min-width: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .hub-page.home-unified #hubMovTable { min-width: 0; }
  .hub-page:not(.home-unified) .hub-hero { padding: 1rem; }
  .hub-page:not(.home-unified) .hub-title { font-size: 1.25rem; }
  .hub-page:not(.home-unified) .hub-tiles { grid-template-columns: repeat(2, 1fr); }
  .hub-page.home-unified .hub-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .hub-page.home-unified .hub-tile {
    font-size: 0.78rem;
    padding: 0.4rem 0.22rem;
    min-height: 3.35rem;
  }
  .hub-page.home-unified .hub-tile .material-icons {
    font-size: 24px;
  }
  .hub-page.home-unified #hubMovTable th:nth-child(5),
  .hub-page.home-unified #hubMovTable td:nth-child(5),
  .hub-page.home-unified #hubMovTable th:nth-child(6),
  .hub-page.home-unified #hubMovTable td:nth-child(6) {
    display: none;
  }
  .hub-page.home-unified #hubMovTable th:nth-child(1),
  .hub-page.home-unified #hubMovTable td.hub-mov-date { width: 5.2rem; }
  .hub-page.home-unified #hubMovTable th:nth-child(2),
  .hub-page.home-unified #hubMovTable td.hub-mov-type-cell { width: 6.2rem; }
  .hub-page.home-unified #hubMovTable th:nth-child(4),
  .hub-page.home-unified #hubMovTable td.hub-mov-qty-cell { width: 5.8rem; }
}
@media (max-width: 430px) {
  .hub-page.home-unified .home-unified-stats-full .cards.dashboard-cards.dashboard-cards-narrow {
    grid-template-columns: 1fr !important;
  }
  .hub-page.home-unified .dashboard-cards-narrow a.card-link {
    min-height: 3.25rem;
    padding: .42rem .55rem;
  }
  .hub-page.home-unified .dashboard-cards-narrow .card h3 { -webkit-line-clamp: 2; }
}

/* —— Inicio operativo: ruta de pasos (todos excepto admin/gerencia) —— */
.ops-home-flow {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem 1rem;
  background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 55%, #fff 100%);
  border: 1px solid #cfe2ff;
  border-radius: 14px;
}
.ops-home-flow-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0d47a1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ops-home-flow-title .material-icons {
  font-size: 1.35rem;
  color: #1565c0;
}
.ops-home-flow-sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}
.ops-flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.ops-flow-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 7.5rem;
  padding: 0.7rem 0.65rem 0.65rem;
  background: #fff;
  border: 1px solid #bbdefb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  position: relative;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.08);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.ops-flow-card:hover {
  border-color: #1976d2;
  box-shadow: 0 6px 16px rgba(21, 101, 192, 0.16);
  transform: translateY(-1px);
}
.ops-flow-num {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: #1565c0;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ops-flow-icon {
  font-size: 2rem !important;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 10px;
  padding: 0.35rem;
}
.ops-flow-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}
.ops-flow-text strong {
  font-size: 0.92rem;
  line-height: 1.2;
  color: #0d1b2a;
}
.ops-flow-text small {
  font-size: 0.75rem;
  color: #546e7a;
  line-height: 1.25;
}
.ops-flow-chevron {
  align-self: flex-end;
  color: #90caf9;
  font-size: 1.25rem !important;
}
.ops-home-flow .home-shortcuts {
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .ops-flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .ops-flow-steps {
    grid-template-columns: 1fr;
  }
  .ops-flow-card {
    flex-direction: row;
    align-items: center;
    min-height: 0;
    gap: 0.65rem;
    padding: 0.75rem 0.8rem;
  }
  .ops-flow-num {
    position: static;
    flex-shrink: 0;
  }
  .ops-flow-icon {
    flex-shrink: 0;
  }
  .ops-flow-chevron {
    margin-left: auto;
  }
}

/* —— Stock visual (bodegas / camión) —— */
.stock-visual-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}
.stock-loc-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.8rem;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.stock-loc-card:hover,
.stock-loc-card.is-active {
  border-color: #1976d2;
  box-shadow: 0 4px 14px rgba(25, 118, 210, 0.14);
}
.stock-loc-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.stock-loc-card-head .material-icons {
  font-size: 1.65rem;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 8px;
  padding: 0.25rem;
}
.stock-loc-card-head strong {
  font-size: 0.9rem;
  line-height: 1.2;
  color: #0d1b2a;
}
.stock-loc-card-meta {
  font-size: 0.75rem;
  color: #607d8b;
}
.stock-loc-bar {
  height: 8px;
  border-radius: 999px;
  background: #eceff1;
  overflow: hidden;
}
.stock-loc-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #42a5f5, #1565c0);
}
.stock-loc-card--camion .stock-loc-card-head .material-icons {
  color: #ef6c00;
  background: #fff3e0;
}
.stock-loc-card--camion .stock-loc-bar > span {
  background: linear-gradient(90deg, #ffb74d, #ef6c00);
}
.stock-loc-card--cocina .stock-loc-card-head .material-icons {
  color: #2e7d32;
  background: #e8f5e9;
}
.stock-loc-card--restaurante .stock-loc-card-head .material-icons {
  color: #6a1b9a;
  background: #f3e5f5;
}
.stock-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: auto;
}
.stock-view-toggle .btn.is-active {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
.stock-camion-visual {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.55rem;
  margin: 0.65rem 0 0.85rem;
}
.stock-camion-tile {
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #ffe0b2;
  background: linear-gradient(180deg, #fff8e1 0%, #fff 100%);
  min-height: 5.5rem;
}
.stock-camion-tile.is-reject {
  border-color: #f87171;
  background: linear-gradient(180deg, #fee2e2 0%, #fff 100%);
}
.stock-camion-tile strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  color: #0d1b2a;
}
.stock-camion-tile .qty {
  font-size: 1.05rem;
  font-weight: 800;
  color: #e65100;
  font-variant-numeric: tabular-nums;
}
.stock-camion-tile .meta {
  font-size: 0.72rem;
  color: #78909c;
  margin-top: 0.2rem;
}
.stock-camion-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 50%, #fff 100%);
  border: 1px solid #ffe0b2;
}
.stock-camion-hero .material-icons {
  font-size: 2.75rem;
  color: #ef6c00;
}
.stock-camion-hero strong {
  display: block;
  font-size: 1.1rem;
  color: #e65100;
}
.stock-camion-pedidos-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.stock-camion-pedido-card {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 7.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  text-decoration: none;
  color: inherit;
}
.stock-camion-pedido-card.is-reject {
  background: #fee2e2;
  border-color: #f87171;
}
.stock-camion-pedido-card strong {
  font-size: 0.85rem;
  color: #0d47a1;
}
.stock-camion-pedido-card.is-reject strong {
  color: #991b1b;
}
.stock-camion-pedido-card small {
  font-size: 0.72rem;
  color: #546e7a;
}
@media (max-width: 640px) {
  .stock-visual-board {
    grid-template-columns: 1fr 1fr;
  }
  .stock-camion-visual {
    grid-template-columns: 1fr 1fr;
  }
}

/* —— Alertas visuales (inicio operativo) —— */
.ops-alerts {
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem 1rem;
  background: linear-gradient(180deg, #fff8e1 0%, #fffef8 55%, #fff 100%);
  border: 1px solid #ffe0b2;
  border-radius: 14px;
}
.ops-alerts-title {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e65100;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ops-alerts-title .material-icons {
  font-size: 1.35rem;
  color: #ef6c00;
}
.ops-alerts-sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}
.ops-alerts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.ops-alert-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 0.8rem;
  background: #fff;
  border: 1px solid #ffe0b2;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(239, 108, 0, 0.08);
  transition: border-color .15s, box-shadow .15s;
}
.ops-alert-card:hover {
  border-color: #ef6c00;
  box-shadow: 0 6px 16px rgba(239, 108, 0, 0.14);
}
.ops-alert-card--exp {
  border-color: #ffcdd2;
}
.ops-alert-card--exp:hover {
  border-color: #c62828;
}
.ops-alert-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ops-alert-head .material-icons {
  font-size: 1.75rem;
  color: #ef6c00;
  background: #fff3e0;
  border-radius: 10px;
  padding: 0.3rem;
}
.ops-alert-card--exp .ops-alert-head .material-icons {
  color: #c62828;
  background: #ffebee;
}
.ops-alert-head strong {
  display: block;
  font-size: 0.9rem;
  color: #0d1b2a;
}
.ops-alert-count {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #e65100;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ops-alert-card--exp .ops-alert-count {
  color: #c62828;
}
.ops-alert-chart-wrap {
  height: 140px;
  position: relative;
}
.ops-alert-chart-wrap--donut {
  max-width: 200px;
  margin: 0 auto;
}
.ops-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ops-alert-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.45rem;
  font-size: 0.78rem;
  align-items: center;
}
.ops-alert-name {
  font-weight: 600;
  color: #263238;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-alert-meta {
  color: #78909c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ops-alert-bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: #eceff1;
  overflow: hidden;
}
.ops-alert-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffb74d, #ef6c00);
  border-radius: 999px;
}
@media (max-width: 720px) {
  .ops-alerts-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Mapa esquemático camión ↔ locales —— */
.ops-route-map,
.stock-camion-route {
  margin: 0 0 0.85rem;
  padding: 0.85rem 0.9rem 1rem;
  background: linear-gradient(180deg, #e8f5e9 0%, #f7fbf7 55%, #fff 100%);
  border: 1px solid #c8e6c9;
  border-radius: 14px;
}
.ops-route-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.ops-route-map-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1b5e20;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ops-route-map-title .material-icons {
  font-size: 1.35rem;
  color: #2e7d32;
}
.ops-route-map-sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}
.truck-route-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}
.truck-route-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.75rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff3e0, #fff8e1);
  border: 2px solid #ffb74d;
  min-width: 10rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(239, 108, 0, 0.12);
}
.truck-route-hub .material-icons {
  font-size: 2.4rem;
  color: #ef6c00;
}
.truck-route-hub strong {
  color: #e65100;
  font-size: 0.95rem;
}
.truck-route-hub small {
  color: #78909c;
  font-size: 0.72rem;
}
.truck-route-spokes {
  width: 2px;
  height: 18px;
  background: linear-gradient(#ffb74d, #81c784);
  border-radius: 2px;
}
.truck-route-dests {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}
.truck-route-dest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 8.5rem;
  max-width: 12rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .15s;
}
.truck-route-dest:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.14);
}
.truck-route-dest .material-icons {
  font-size: 1.4rem;
  color: #1565c0;
}
.truck-route-dest strong {
  font-size: 0.88rem;
  color: #0d47a1;
}
.truck-route-dest small {
  font-size: 0.72rem;
  color: #546e7a;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.truck-route-dest.is-arrive {
  background: #e8f5e9;
  border-color: #81c784;
}
.truck-route-dest.is-arrive .material-icons,
.truck-route-dest.is-arrive strong {
  color: #2e7d32;
}
.truck-route-dest.is-reject {
  background: #fee2e2;
  border-color: #f87171;
}
.truck-route-dest.is-reject .material-icons,
.truck-route-dest.is-reject strong {
  color: #991b1b;
}
.truck-route-empty {
  text-align: center;
  margin: 0.25rem 0 0;
}

/* —— Pedidos / movimientos: tarjetas operativas —— */
.ops-orders-board,
.ops-mi-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}
.ops-order-card,
.ops-mi-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.8rem;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  transition: border-color .15s, box-shadow .15s;
}
.ops-order-card:hover,
.ops-mi-card:hover {
  border-color: #1976d2;
  box-shadow: 0 4px 14px rgba(25, 118, 210, 0.12);
}
.ops-order-card-head,
.ops-mi-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.ops-order-card-head .material-icons,
.ops-mi-card-head .material-icons {
  font-size: 1.65rem;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 8px;
  padding: 0.25rem;
  flex-shrink: 0;
}
.ops-order-card-head strong,
.ops-mi-card-head strong {
  display: block;
  font-size: 0.95rem;
  color: #0d1b2a;
}
.ops-order-card-head small,
.ops-mi-card-head small {
  display: block;
  font-size: 0.75rem;
  color: #607d8b;
}
.ops-order-card-status .badge,
.ops-mi-card-meta {
  font-size: 0.78rem;
}
.ops-order-card-actions,
.ops-mi-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.ops-mi-card-route {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #37474f;
  flex-wrap: wrap;
}
.ops-mi-card-route .material-icons {
  font-size: 1rem;
  color: #90a4ae;
}
.ops-mi-card-prod {
  font-size: 0.85rem;
}
.ops-mi-card-chk {
  margin-left: auto;
  font-size: 0.72rem;
  color: #546e7a;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.ops-order-card--pendiente .ops-order-card-head .material-icons,
.ops-mi-card--pendiente_contraparte .ops-mi-card-head .material-icons {
  color: #f57c00;
  background: #fff3e0;
}
.ops-order-card--en_transito .ops-order-card-head .material-icons,
.ops-mi-card--en_transito .ops-mi-card-head .material-icons {
  color: #ef6c00;
  background: #fff3e0;
}
.ops-order-card--recibido .ops-order-card-head .material-icons,
.ops-mi-card--completada .ops-mi-card-head .material-icons {
  color: #2e7d32;
  background: #e8f5e9;
}
.ops-order-card--rechazado_devolucion .ops-order-card-head .material-icons,
.ops-mi-card--rechazada .ops-mi-card-head .material-icons {
  color: #c62828;
  background: #ffebee;
}
@media (max-width: 520px) {
  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: 1fr;
  }
}



/* —— Toast global —— */
.bodega-toast-host {
  position: fixed;
  z-index: 12000;
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  bottom: max(4.75rem, calc(env(safe-area-inset-bottom, 0px) + 4.25rem));
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  pointer-events: none;
}
.bodega-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #0d1b2a;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  font-size: 0.88rem;
}
.bodega-toast.is-in { opacity: 1; transform: none; }
.bodega-toast.is-out { opacity: 0; transform: translateY(6px); }
.bodega-toast--success { background: #1b5e20; }
.bodega-toast--error { background: #b71c1c; }
.bodega-toast--info { background: #0d47a1; }
.bodega-toast-msg { flex: 1; min-width: 0; }
.bodega-toast-action {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.bodega-toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}

/* —— Barra inferior móvil —— */
.ops-bottom-nav {
  display: none;
}
@media (max-width: 900px) {
  body:has(.ops-bottom-nav) .content,
  body:has(.ops-bottom-nav) main.content {
    padding-bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem)) !important;
  }
  .ops-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    background: #fff;
    border-top: 1px solid #e3e8ef;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
    padding: 0.35rem 0.25rem max(0.35rem, env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    gap: 0.15rem;
  }
  .ops-bottom-nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.35rem 0.2rem;
    text-decoration: none;
    color: #607d8b;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 10px;
  }
  .ops-bottom-nav-item .material-icons {
    font-size: 1.45rem;
  }
  .ops-bottom-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .ops-bottom-nav-item.is-active,
  .ops-bottom-nav-item.is-primary {
    color: #1565c0;
    background: #e3f2fd;
  }
  .ops-bottom-nav-item.is-primary .material-icons {
    color: #0d47a1;
  }
}

/* —— Chips / pipeline / empty —— */
.ops-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
}
.ops-chip {
  border: 1px solid #cfd8dc;
  background: #fff;
  color: #455a64;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.ops-chip.is-active {
  background: #1565c0;
  border-color: #1565c0;
  color: #fff;
}
.ops-chip-count {
  display: inline-block;
  min-width: 1.1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}
.ops-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
}
.ops-pipeline-col {
  background: #f5f7fa;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
}
.ops-pipeline-col header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e3e8ef;
  font-size: 0.82rem;
}
.ops-pipeline-col-body {
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.ops-pipeline-col .ops-order-card.is-compact {
  padding: 0.55rem;
  min-width: 0;
}
.ops-pipeline-empty {
  margin: 0.5rem 0.25rem;
}
.ops-empty-state {
  padding: 1rem 0.5rem 1.25rem;
}
.ops-empty-inner {
  text-align: center;
  max-width: 22rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.ops-empty-inner .material-icons {
  font-size: 2.5rem;
  color: #90a4ae;
}
.ops-empty-inner .btn {
  margin-top: 0.35rem;
}
@media (max-width: 900px) {
  .ops-pipeline {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
  }
}

/* —— Hero acciones (inventario / cocina) —— */
.ops-page-hero {
  margin: 0 0 0.85rem;
}
.ops-page-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.ops-page-hero-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #bbdefb;
  background: #fff;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.06);
}
.ops-page-hero-card .material-icons {
  font-size: 1.6rem;
  color: #1565c0;
}
.ops-page-hero-card strong {
  font-size: 0.88rem;
}
.ops-page-hero-card small {
  font-size: 0.72rem;
  color: #607d8b;
}
.ops-page-hero-card--primary {
  background: linear-gradient(180deg, #e3f2fd, #fff);
  border-color: #64b5f6;
}
.ops-step-guide--page {
  margin: 0 0 0.75rem;
}

/* —— Notificaciones CTA —— */
.notif-item-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.2rem;
}
.notif-item-cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1565c0;
}
.notif-toast-cta {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  font-weight: 700;
  font-size: 0.8rem;
}

/* —— Mapa geo camión —— */
.truck-geo-map {
  height: 220px;
  border-radius: 12px;
  margin-bottom: 0.65rem;
  border: 1px solid #c8e6c9;
  overflow: hidden;
  z-index: 1;
}

/* —— Escritorio grande (monitores ~25"+ / ≥1400px): más tarjetas visibles —— */
@media (min-width: 1400px) {
  .ops-pipeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .ops-pipeline-col {
    min-height: 10rem;
    border-radius: 10px;
  }
  .ops-pipeline-col header {
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
  }
  .ops-pipeline-col-body {
    padding: 0.35rem;
    gap: 0.3rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact {
    padding: 0.4rem 0.45rem;
    gap: 0.25rem;
    border-radius: 8px;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head {
    gap: 0.35rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head .material-icons {
    font-size: 1.2rem;
    padding: 0.15rem;
    border-radius: 6px;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head strong {
    font-size: 0.82rem;
    line-height: 1.15;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head small {
    font-size: 0.68rem;
    line-height: 1.15;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-status .badge,
  .ops-pipeline-col .ops-order-card.is-compact .badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-actions {
    gap: 0.25rem;
    margin-top: 0.1rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact .btn-sm {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
    line-height: 1.2;
  }

  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.45rem;
  }
  .ops-order-card,
  .ops-mi-card {
    padding: 0.5rem 0.55rem;
    gap: 0.28rem;
    border-radius: 10px;
  }
  .ops-order-card-head .material-icons,
  .ops-mi-card-head .material-icons {
    font-size: 1.3rem;
    padding: 0.18rem;
  }
  .ops-order-card-head strong,
  .ops-mi-card-head strong {
    font-size: 0.85rem;
  }
  .ops-order-card-head small,
  .ops-mi-card-head small {
    font-size: 0.7rem;
  }
  .ops-order-card-status .badge,
  .ops-mi-card-meta {
    font-size: 0.72rem;
  }
  .ops-order-card-actions .btn-sm,
  .ops-mi-card-actions .btn-sm {
    font-size: 0.72rem;
    padding: 0.22rem 0.45rem;
  }

  .stock-visual-board {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.45rem;
  }
  .stock-loc-card {
    padding: 0.55rem 0.6rem;
    gap: 0.3rem;
  }
  .stock-loc-card-head .material-icons {
    font-size: 1.35rem;
    padding: 0.18rem;
  }
  .stock-loc-card-head strong {
    font-size: 0.82rem;
  }
  .stock-camion-visual {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.4rem;
  }
  .stock-camion-tile {
    padding: 0.45rem 0.5rem;
    min-height: 4.5rem;
  }
  .stock-camion-tile strong {
    font-size: 0.75rem;
  }
  .stock-camion-tile .qty {
    font-size: 0.95rem;
  }
}

/* Ultra-wide / 25"+ a 1920px o más */
@media (min-width: 1800px) {
  .ops-pipeline {
    gap: 0.5rem;
  }
  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-meta {
    display: none;
  }
  .stock-visual-board {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .stock-camion-visual {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* === 09-mobile-sheet-tables.css === */
/* Tablas tipo hoja de cálculo — sitio completo (altura fila = LOTES, zebra reforzado) */

.content table th,
.content table td,
.hub-table th,
.hub-table td,
.detail-table th,
.detail-table td,
.modal-content .detail-table th,
.modal-content .detail-table td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  line-height: var(--bodega-row-lh);
  font-size: var(--bodega-row-fs);
  vertical-align: middle;
}

.content table tbody tr:nth-child(odd) td,
.hub-table tbody tr:nth-child(odd) td,
.detail-table tbody tr:nth-child(odd) td,
.modal-content .detail-table tbody tr:nth-child(odd) td {
  background: var(--table-row-base);
}

.content table tbody tr:nth-child(even) td,
.hub-table tbody tr:nth-child(even) td,
.detail-table tbody tr:nth-child(even) td,
.modal-content .detail-table tbody tr:nth-child(even) td {
  background: var(--table-row-alt);
}

.content table tbody tr:hover td,
.hub-table tbody tr:hover td,
.detail-table tbody tr:hover td,
.modal-content .detail-table tbody tr:hover td {
  background: var(--table-row-hover) !important;
}

/* Móvil: scroll horizontal, cabecera fija, celdas en una línea */
@media (max-width: 768px) {
  :root {
    --bodega-row-py: 0.16rem;
    --bodega-row-px: 0.35rem;
    --bodega-row-lh: 1.08;
  }

  .recep-table-wrap,
  .mi-list-wrap,
  .facturas-table-wrap,
  .facturas-table-scroll,
  .facturas-table-card,
  .hub-page.home-unified .hub-panel-wide .hub-table-wrap,
  .content .card:has(.table-lotes),
  .content .card:has(.sal-table-compact),
  .content .card:has(table),
  .content .orders-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.1rem 0;
  }

  .content table.facturas-detail-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed !important;
  }

  .content table.recep-table,
  .content #miListTable.mi-sheet-table,
  .content #miListTable.mi-list-table,
  .content table.table-lotes,
  .content table.sal-table-compact,
  .content table.orders-main-table,
  .content table.hub-table,
  .content table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 520px;
    table-layout: fixed;
    font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
  }

  .content table thead th,
  .hub-table thead th {
    background: var(--sheet-head-bg);
    border-bottom: 2px solid var(--sheet-border-head) !important;
    white-space: nowrap !important;
    line-height: var(--bodega-row-lh) !important;
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .content table tbody tr:nth-child(odd) td,
  .hub-table tbody tr:nth-child(odd) td {
    background: var(--sheet-row-base);
  }

  .content table tbody tr:nth-child(even) td,
  .hub-table tbody tr:nth-child(even) td {
    background: var(--sheet-row-alt);
  }

  .content table tbody tr:hover td,
  .hub-table tbody tr:hover td {
    background: var(--sheet-row-hover) !important;
  }

  .content table tbody tr td,
  .hub-table tbody tr td {
    border-bottom: 1px solid var(--sheet-border-row) !important;
    padding: var(--bodega-row-py) var(--bodega-row-px) !important;
    line-height: var(--bodega-row-lh) !important;
    font-size: var(--bodega-row-fs) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* LOTES: misma altura de fila; producto puede envolver si hace falta */
  .content table.table-lotes tbody tr td.col-producto {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word;
  }

  /* Modales móvil: letra angosta + hasta 2 filas (no truncar a 1) */
  .modal-content table,
  .modal-content .detail-table {
    font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.015em;
  }
  .modal-content table tbody tr td,
  .modal-content .detail-table tbody tr td,
  .modal-content table thead th,
  .modal-content .detail-table thead th {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.25 !important;
    max-height: none;
    vertical-align: top;
  }
  /* Planilla de pedido: no partir Unidad letra a letra */
  .modal-content table.order-sheet-table thead th,
  .modal-content table.order-sheet-table tbody td {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
    max-height: none !important;
    vertical-align: middle !important;
  }
  .modal-content table.order-sheet-table tbody td.os-td-unit {
    overflow: visible !important;
    text-overflow: unset !important;
  }
  /* Líder: permitir wrap del producto para caber sin scroll horizontal */
  #modalNewOrder.order-sheet-leader .order-sheet-table tbody td.os-td-product,
  #modalNewOrder.order-sheet-leader .order-sheet-table tbody td.os-td-product .os-product-name {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
}

/* Orden por columna y paginación en hojas de cálculo */
.bodega-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.bodega-sortable::after {
  content: '↕';
  opacity: 0.35;
  margin-left: 0.2em;
  font-size: 0.85em;
}
.bodega-sort-asc::after {
  content: '↑';
  opacity: 0.9;
}
.bodega-sort-desc::after {
  content: '↓';
  opacity: 0.9;
}
.bodega-sheet-pagination-bar,
.pagination-bar {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e8eaed);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bodega-sheet-pagination-info,
.bodega-sheet-page-label {
  font-size: 0.85rem;
  color: var(--text-muted, #5f6368);
}
.bodega-sheet-page-label {
  margin: 0 0.25rem;
}

/* === 10-calidad.css === */
/* Módulo Calidad — encuestas, mesas, dashboard */
.calidad-page { width: 100%; max-width: 1280px; margin: 1rem auto 2rem; padding: 0; box-sizing: border-box; }
.calidad-back-row { margin-bottom: 0.85rem; }
.calidad-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 0.75rem; }
.calidad-card { background:#fff; border-radius:10px; padding:0.8rem 1rem; box-shadow:0 1px 3px rgba(0,0,0,0.08); min-width: 0; }
.calidad-card h3 { margin:0 0 0.4rem; font-size:0.95rem; }
.calidad-metric { font-size:1.2rem; font-weight:600; }
.calidad-sub { font-size:0.8rem; color:#5f6368; }
.calidad-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 0.5rem; }
.calidad-table {
  width: 100%;
  min-width: 730px;
  border-collapse: collapse;
  font-size: 0.8rem;
  table-layout: fixed;
}
.calidad-table th,
.calidad-table td {
  border: 1px solid #e0e0e0;
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.calidad-table th { background: #f5f5f5; font-weight: 600; white-space: nowrap; }
.calidad-table .col-fecha { width: 150px; white-space: nowrap; }
.calidad-table .col-sucursal { width: 95px; }
.calidad-table .col-mesa { width: 55px; }
.calidad-table .col-q { width: 38px; text-align: center; }
.calidad-table .col-nps { width: 52px; text-align: center; white-space: nowrap; }
.calidad-table .col-comentario { min-width: 180px; }
.calidad-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.calidad-filters > div { min-width: 0; }
.calidad-filters label { font-size:0.8rem; display:block; margin-bottom:0.15rem; }
.calidad-filters input[type="date"], .calidad-filters select { width: 100%; max-width: 100%; box-sizing: border-box; font-size:0.8rem; padding:0.25rem 0.35rem; }
.calidad-filters .btn { font-size:0.8rem; padding:0.25rem 0.6rem; }
.calidad-filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  align-content: flex-end;
  min-height: 100%;
  box-sizing: border-box;
}
.calidad-summary-card { background:#fff; border-radius:10px; padding:1rem 1.2rem; box-shadow:0 1px 3px rgba(0,0,0,0.08); margin-bottom:0; width:100%; min-width:0; box-sizing:border-box; }
.calidad-summary-card h3 { margin:0 0 0.25rem; font-size:1rem; }
.calidad-summary-range { font-size:0.8rem; color:#5f6368; margin:0 0 0.5rem; }
.calidad-summary-card .calidad-metric { font-size:1.1rem; font-weight:600; margin-bottom:0.6rem; }
.calidad-summary-table { width:100%; max-width:100%; border-collapse:collapse; font-size:0.82rem; table-layout:fixed; }
.calidad-summary-table th,
.calidad-summary-table td { padding:0.28rem 0.35rem 0.28rem 0; border:none; vertical-align:middle; }
.calidad-summary-table th { font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:0.04em; color:#5f6368; padding-bottom:0.35rem; border-bottom:1px solid #eee; white-space:nowrap; }
.calidad-summary-table td:first-child { word-wrap:break-word; overflow-wrap:break-word; }
.calidad-summary-table th.col-promedio,
.calidad-summary-table td.col-promedio { text-align:right; white-space:nowrap; }
.calidad-summary-table col.col-indicador { width:auto; }
.calidad-summary-table col.col-promedio { width:3.25rem; }
.calidad-summary-table col.col-minmax { width:4.5rem; }
.calidad-summary-table .lbl-short { display:none; }
.calidad-detail { min-width:0; overflow:hidden; }
.calidad-summary-table .calidad-nps-row td { padding-top:0.35rem; border-top:1px solid #eee; }
.calidad-nps-breakdown { font-size:0.78rem; color:#5f6368; padding-top:0.25rem !important; }
.calidad-charts-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; min-width: 0; }
.calidad-chart-box { background:#fff; border-radius:10px; padding:1rem; box-shadow:0 1px 3px rgba(0,0,0,0.08); }
.calidad-chart-box h4 { margin:0 0 0.75rem; font-size:1rem; }
.calidad-chart-box canvas { width:100% !important; height:380px !important; }
.calidad-layout-top {
  display: grid;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  grid-template-columns: 1fr;
}
.calidad-layout {
  display: grid;
  grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}
.calidad-card form { margin-bottom:0.6rem; }
.calidad-card label { font-size:0.8rem; display:block; margin-bottom:0.15rem; }
.calidad-card input[type="text"], .calidad-card select { width:100%; max-width:100%; box-sizing:border-box; padding:0.28rem 0.4rem; font-size:0.82rem; }
.calidad-card .btn { font-size:0.8rem; padding:0.25rem 0.6rem; }
.calidad-form-panel { margin-bottom:0.6rem; padding:0.5rem 0.65rem; background:#f8fafc; border-radius:8px; }
.calidad-form-panel .calidad-field-gap { margin-top:0.28rem; }
.calidad-form-panel .calidad-form-actions { margin-top:0.45rem; display:flex; flex-wrap:wrap; gap:0.35rem; }
.calidad-mesa-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}
.calidad-mesa-form-row > div { min-width: 0; }
.calidad-mesa-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  align-content: flex-end;
  min-height: 100%;
}
.calidad-list { list-style:none; padding:0; margin:0; font-size:0.8rem; }
.calidad-list li { display:flex; justify-content:space-between; align-items:flex-start; padding:0.35rem 0; border-bottom:1px solid #eee; gap:0.65rem; }
.calidad-list li:last-child { border-bottom:none; }
.calidad-list li > div:first-child { min-width: 0; word-wrap: break-word; }
.calidad-list small { color:#6b7280; }
.mesa-table { width:100%; border-collapse:collapse; font-size:0.8rem; table-layout: fixed; }
.mesa-table th,.mesa-table td { border:1px solid #e0e0e0; padding:0.35rem 0.5rem; text-align:left; vertical-align: top; word-wrap: break-word; }
.mesa-table th { background:#f5f5f5; }
.mesa-table th:nth-child(1) { width: 22%; }
.mesa-table th:nth-child(2) { width: 38%; }
.mesa-table th:nth-child(3) { width: 18%; }
.mesa-table th:nth-child(4) { width: 22%; }
.mesa-actions { display:flex; gap:0.25rem; flex-wrap:wrap; }
.calidad-page .badge { display:inline-block; padding:0.05rem 0.4rem; border-radius:999px; background:#e0f2fe; color:#0369a1; font-size:0.7rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; margin-bottom: 0.25rem; }

@media (max-width: 768px) {
  .calidad-summary-card { padding:0.7rem 0.55rem; }
  .calidad-summary-table { font-size:0.76rem; }
  .calidad-summary-table th,
  .calidad-summary-table td { padding:0.22rem 0.15rem 0.22rem 0; }
  .calidad-summary-table th.col-indicador {
    color:transparent;
    font-size:0;
    line-height:0;
    padding-bottom:0.25rem;
    overflow:hidden;
  }
  .calidad-summary-table col.col-indicador { width:auto; }
  .calidad-summary-table col.col-promedio { width:2.35rem; }
  .calidad-summary-table col.col-minmax { width:0; }
  .calidad-summary-table td:first-child {
    padding-right:0.25rem;
    line-height:1.2;
    white-space:nowrap;
  }
  .calidad-summary-table .lbl-long { display:none; }
  .calidad-summary-table .lbl-short { display:inline; }
  .calidad-summary-table .col-minmax { display:none; }
  .calidad-summary-table th.col-promedio {
    font-size:0.62rem;
    letter-spacing:0;
    text-align:right;
    padding-right:0;
  }
  .calidad-summary-table td.col-promedio {
    font-size:0.76rem;
    padding-right:0;
  }
  .calidad-nps-breakdown {
    font-size:0.68rem;
    line-height:1.3;
    padding-top:0.2rem !important;
    word-break:break-word;
    white-space:normal;
  }
}

@media (min-width: 769px) {
  .calidad-chart-nps-pair { min-width: 0; }
  .calidad-chart-nps-pair canvas { height: 340px !important; }
}

@media (max-width: 991px) {
  .calidad-charts-wrap {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }
  .calidad-chart-box {
    width: 100%;
    min-width: 0;
  }
  .calidad-chart-box canvas { height: 280px !important; }
}

@media (min-width: 900px) {
  .calidad-layout-top:not(:has(.calidad-charts-wrap)) .calidad-summary-table { font-size: 0.88rem; }
  .calidad-layout-top:has(.calidad-charts-wrap) {
    grid-template-columns: minmax(280px, 34%) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .calidad-layout { grid-template-columns: 1fr; }
}

/* === 11-google-theme.css === */
/* RRHH: íconos y botones sin rojo (asistencia.css refuerza) */
.rrhh-module .btn-act-icon,
.rrhh-module .link-act-icon {
  background: linear-gradient(180deg, #edf4ff 0%, var(--google-blue-tint) 100%) !important;
  color: var(--btn-primary) !important;
  border: 1px solid var(--google-blue-light) !important;
}
.rrhh-module .btn:not(.danger):not(.warning) .material-icons {
  color: inherit;
}


/* Alertas / peligro (rojo reservado) */
.content .filter-row .btn-act-icon.btn.danger,
.content .filter-row .btn-act-icon.btn.danger:hover,
button.danger,
.btn.danger {
  background: linear-gradient(180deg, #e53935 0%, var(--danger) 100%) !important;
  color: var(--white) !important;
  border: 1px solid #9a0007 !important;
  box-shadow: 0 2px 6px rgba(197, 34, 31, 0.35) !important;
}

/* App bar — Google Classic Blue */
.app-bar {
  background: var(--gradient-app-bar);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.app-bar-user .badge-role {
  background: rgba(255, 255, 255, 0.22);
  color: var(--white);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Títulos de página — gradiente azul más vivo */
.content > h2:first-of-type,
.content .calidad-page > h2:first-of-type {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0d2d6b;
  background: var(--gradient-page-hero);
  border: 1px solid var(--google-blue-mid);
  border-left: 5px solid var(--btn-primary);
  box-shadow: var(--shadow-hero);
}

.hub-hero {
  color: #0d2d6b;
  background: var(--gradient-page-hero);
  border: 1px solid var(--google-blue-mid);
  border-left: 5px solid var(--btn-primary);
  box-shadow: var(--shadow-hero);
}
.hub-sub {
  color: var(--text-secondary);
  opacity: 1;
}

/* Cards y paneles */
.card {
  background: var(--gradient-card);
  border: var(--border-card);
  box-shadow: var(--shadow-card);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--google-blue-mid);
}

.content h2:not(:first-of-type) {
  padding-left: 0.65rem;
  border-left: 4px solid var(--google-blue-mid);
  color: #0d2d6b;
}

.content h3 {
  color: #0d2d6b;
}

/* Enlaces */
.content a:not(.btn) { color: var(--link); font-weight: 500; }
.content a:not(.btn):hover { color: var(--link-hover); }
.list-simple a { color: var(--link); }
.card-hint a { color: var(--link); }

/* Íconos de acción — fondo azul suave, no blanco plano */
.btn-act-icon,
button.btn-act-icon,
a.link-act-icon,
.btn.btn-act-icon,
.btn.primary.btn-act-icon,
.btn.secondary.btn-act-icon {
  background: linear-gradient(180deg, #edf4ff 0%, var(--google-blue-tint) 100%) !important;
  color: var(--btn-primary) !important;
  border: 1px solid var(--google-blue-light) !important;
  box-shadow: 0 1px 3px rgba(21, 101, 216, 0.18) !important;
}
.btn-act-icon:hover,
button.btn-act-icon:hover,
a.link-act-icon:hover,
.btn.btn-act-icon:hover {
  background: linear-gradient(180deg, #c5d9f8 0%, #aecbfa 100%) !important;
  color: var(--link-hover) !important;
  border-color: var(--google-blue-mid) !important;
}
.btn-act-icon .material-icons,
.link-act-icon .material-icons {
  color: inherit !important;
}

.content .hub-page h2.home-section-title .material-icons {
  color: var(--btn-primary);
}
.hub-panel-h .material-icons {
  color: var(--btn-primary);
}
.hub-tile .material-icons {
  color: var(--btn-primary);
}
.hub-panel-alert .material-icons,
.hub-panel-expire .material-icons,
.hub-tile-warn .material-icons {
  color: var(--warning);
}

/* Filtros y barras de herramientas */
.filter-tabs,
.content .filter-row,
.content .recep-date-filters,
.content .orders-filters {
  background: var(--gradient-filter);
  border: 1px solid var(--google-blue-light);
  box-shadow: 0 1px 4px rgba(21, 101, 216, 0.12);
}

.filter-tab.active,
.filter-tabs a.active {
  background: linear-gradient(180deg, #4a8af4 0%, var(--btn-primary) 100%) !important;
  color: var(--white) !important;
  border-color: var(--btn-primary-hover) !important;
}

/* Pestañas operaciones */
.op-tab.active {
  background: linear-gradient(180deg, #d4e4fc 0%, #b8d0f7 100%);
  color: #0d2d6b;
  border-color: var(--google-blue-mid);
  font-weight: 600;
}

/* Barras de progreso */
.bar-fill {
  background: linear-gradient(90deg, var(--btn-primary) 0%, #42a5f5 55%, #7baaf7 100%);
  border-radius: 4px;
}

/* Badges con más color */
.badge.aprobada {
  background: linear-gradient(180deg, var(--success-tint) 0%, #b7e1cd 100%);
  color: var(--success);
  border: 1px solid #81c995;
  font-weight: 600;
}

/* Navegación lateral */
.sidebar {
  background: linear-gradient(180deg, #f8fbff 0%, #e8f0fc 100%);
  border-right: 2px solid var(--google-blue-light);
  box-shadow: 6px 0 24px rgba(21, 101, 216, 0.18);
}

.sidebar-nav a.nav-active,
.sidebar-group-links a.nav-active {
  background: linear-gradient(90deg, #c5d9f8 0%, #d4e4fc 100%);
  color: #0d2d6b;
  border-left: 4px solid var(--btn-primary);
  font-weight: 600;
}
.sidebar-nav a:hover,
.sidebar-group-links a:hover {
  background: var(--google-blue-tint);
}

.gs-nav-item:hover {
  background: var(--google-blue-tint);
}
.gs-nav-item.is-active {
  background: linear-gradient(90deg, #c5d9f8 0%, #d4e4fc 100%);
  font-weight: 600;
}
.gs-nav-icon {
  color: var(--btn-primary);
}
.gs-nav-item.is-active .gs-nav-count {
  background: linear-gradient(180deg, #4a8af4 0%, var(--btn-primary) 100%);
  color: var(--white);
}

/* Modales */
.modal-header {
  background: linear-gradient(180deg, #b8d0f7 0%, #d4e4fc 55%, #e8f0fe 100%);
  border-bottom: 2px solid var(--google-blue-mid);
}
.modal-header h3 {
  color: #0d2d6b;
  font-weight: 600;
}
.modal-footer {
  background: var(--gradient-filter);
  border-top: 1px solid var(--google-blue-light);
}
.modal-content .detail-table th,
.hub-mov-detail-table th,
.content table thead th,
.hub-table thead th {
  background: linear-gradient(180deg, #b0c4dc 0%, var(--table-head-bg) 100%);
  color: var(--table-head-text);
  border-bottom: 2px solid var(--sheet-border-head);
  font-weight: 600;
}

/* Formularios */
.form-group input,
.form-group select,
.form-group textarea {
  background: #fafcff;
  border-color: var(--border);
}
.form-group input:focus,
.form-group select:focus {
  background: var(--white);
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 2px rgba(21, 101, 216, 0.28);
}

/* Botón secundario */
button.secondary:hover,
.btn-secondary:hover,
.btn.secondary:hover {
  background: var(--google-blue-tint);
  border-color: var(--google-blue-light);
  color: var(--link-hover);
}


/* Móvil */
@media (max-width: 768px) {
  body.gs-mobile-open .global-search-wrap {
    background: linear-gradient(180deg, #dce8f7 0%, #e8eef6 100%);
  }
  .modal-header {
    background: linear-gradient(180deg, #b8d0f7 0%, #d4e4fc 100%);
    border-bottom: 2px solid var(--google-blue-mid);
  }
  .modal-footer {
    background: var(--gradient-filter);
    border-top: 1px solid var(--google-blue-light);
  }
}

/* === 12-pangu-next.css === */
/*
 * PANGU Visual Refresh
 * Capa final y reversible. Mantiene la lógica y permisos existentes;
 * solo redefine el sistema visual y su comportamiento responsive.
 */

:root {
  --pn-navy-950: #081727;
  --pn-navy-900: #0b1f33;
  --pn-navy-800: #123554;
  --pn-blue-700: #1d4ed8;
  --pn-blue-600: #2563eb;
  --pn-blue-500: #3b82f6;
  --pn-blue-100: #dbeafe;
  --pn-blue-50: #eff6ff;
  --pn-slate-950: #101828;
  --pn-slate-700: #344054;
  --pn-slate-600: #475467;
  --pn-slate-500: #667085;
  --pn-slate-300: #d0d5dd;
  --pn-slate-200: #e4e7ec;
  --pn-slate-100: #f2f4f7;
  --pn-slate-50: #f8fafc;
  --pn-white: #ffffff;

  --text-primary: var(--pn-slate-950);
  --text-secondary: var(--pn-slate-600);
  --text-muted: var(--pn-slate-500);
  --link: var(--pn-blue-700);
  --link-hover: #173ea5;
  --blue: var(--pn-blue-600);
  --accent: var(--pn-blue-600);
  --accent-hover: var(--pn-blue-700);
  --accent-pressed: #1e40af;
  --btn-primary: var(--pn-blue-600);
  --btn-primary-hover: var(--pn-blue-700);
  --btn-primary-pressed: #1e40af;

  --bg-base: #f3f6fa;
  --bg-surface: var(--pn-slate-50);
  --bg-card: var(--pn-white);
  --bg-elevated: var(--pn-white);
  --white: var(--pn-white);
  --gray-light: var(--pn-slate-100);
  --gray-medium: var(--pn-slate-300);
  --border: #d9e1ec;
  --border-strong: #b8c4d4;
  --border-accent: #93b4f4;
  --table-head-bg: #f4f7fb;
  --table-head-text: var(--pn-slate-700);
  --table-row-base: var(--pn-white);
  --table-row-alt: #fafbfd;
  --table-row-hover: var(--pn-blue-50);
  --table-border: #e3e8ef;
  --sheet-row-base: var(--pn-white);
  --sheet-row-alt: #f8fafc;
  --sheet-row-hover: var(--pn-blue-50);
  --sheet-head-bg: #eef2f7;
  --sheet-border-row: #e3e8ef;
  --sheet-border-head: #c7d1df;

  --success: #15803d;
  --success-tint: #dcfce7;
  --warning: #b45309;
  --warning-tint: #fef3c7;
  --danger: #c62828;
  --danger-tint: #fee2e2;

  --gradient-page-bg: linear-gradient(180deg, #f7f9fc 0%, #f1f5f9 100%);
  --gradient-app-bar: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
  --gradient-page-hero: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
  --gradient-filter: linear-gradient(180deg, #f8fafc 0%, #f8fafc 100%);

  --radius-shell: 18px;
  --radius-card: 16px;
  --radius-input: 10px;
  --border-card: 1px solid #e0e7f0;
  --shadow-hero: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-card: 0 1px 3px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-card-hover: 0 10px 24px rgba(16, 24, 40, 0.09), 0 2px 6px rgba(16, 24, 40, 0.04);

  --bodega-field-h: 2.5rem;
  --bodega-field-py: 0.48rem;
  --bodega-field-px: 0.7rem;
  --bodega-field-fs: 0.88rem;
  --bodega-form-gap: 0.75rem;
}

html {
  background: var(--bg-base);
  color-scheme: light;
}

body.pangu-next {
  background: var(--gradient-page-bg);
  color: var(--text-primary);
  font-family: "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.pangu-next .layout {
  background: radial-gradient(circle at 84% -10%, rgba(37, 99, 235, 0.08), transparent 29rem), var(--gradient-page-bg);
}

/* Barra superior */
body.pangu-next .app-bar {
  height: 72px;
  padding-inline: 1.25rem;
  background: #ffffff;
  color: var(--pn-slate-950);
  border-bottom: 1px solid #e6ebf2;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.05);
}

body.pangu-next .app-bar-title {
  order: 0;
  gap: 0.55rem;
  margin: 0 1.5rem 0 0;
  min-width: max-content;
}

body.pangu-next .app-bar-logo-wrap {
  width: 108px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.pangu-next .app-bar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

body.pangu-next .app-bar-brand-copy,
body.pangu-next .sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

body.pangu-next .app-bar-brand-copy strong {
  color: var(--pn-navy-900);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body.pangu-next .app-bar-brand-copy small {
  margin-top: 0;
  color: var(--pn-slate-500);
  font-size: 0.7rem;
  font-weight: 500;
}

body.pangu-next .environment-badge,
body.pangu-next .login-preview-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0.28rem 0.55rem;
  border: 1px solid #f1c16d;
  border-radius: 999px;
  background: #fff7e8;
  color: #8a4b08;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.pangu-next .global-search-wrap {
  order: 1;
  max-width: 620px;
  margin: 0;
}

body.pangu-next .global-search-input {
  height: 42px;
  padding-left: 2.45rem;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  background: #f5f7fa;
  color: var(--pn-slate-950);
  box-shadow: none;
}

body.pangu-next .global-search-input::placeholder { color: #7b8798; }

body.pangu-next .global-search-input:focus {
  border-color: #8bb1f8;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

body.pangu-next .global-search-wrap .global-search-icon {
  left: 0.78rem;
  color: #667085;
}

body.pangu-next .app-bar-user { order: 2; gap: 0.45rem; }
body.pangu-next .app-bar-user .user-name { color: var(--pn-slate-700); font-weight: 600; }

body.pangu-next .app-bar-user .badge-role {
  border: 1px solid #d8e4fb;
  border-radius: 999px;
  background: var(--pn-blue-50);
  color: var(--pn-blue-700);
  font-weight: 700;
}

body.pangu-next .user-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--pn-navy-900);
  color: #ffffff;
}

body.pangu-next .user-avatar .material-icons { font-size: 1.15rem; }

body.pangu-next .user-avatar--photo {
  padding: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #dbe4ee;
}

body.pangu-next .presence-led {
  background: #eef2f7;
}
body.pangu-next .presence-led.is-on {
  background: #ecfdf3;
}
body.pangu-next .presence-led-count {
  color: var(--pn-navy-900);
}

body.pangu-next .btn-icon,
body.pangu-next .notif-bell-btn,
body.pangu-next .global-search-mobile-toggle,
body.pangu-next .menu-toggle {
  color: var(--pn-slate-600);
  background: transparent;
}

body.pangu-next .btn-icon:hover,
body.pangu-next .notif-bell-btn:hover,
body.pangu-next .global-search-mobile-toggle:hover,
body.pangu-next .menu-toggle:hover {
  background: #eef2f7;
  color: var(--pn-navy-900);
}

body.pangu-next .notif-bell-btn .material-icons,
body.pangu-next .menu-toggle .material-icons,
body.pangu-next .global-search-mobile-toggle .material-icons,
body.pangu-next .btn-icon .material-icons {
  color: inherit;
  text-shadow: none;
}

body.pangu-next .app-bar-ia {
  border: 1px solid #b9cdf8;
  background: #eef4ff;
  color: var(--pn-blue-700);
  box-shadow: none;
}

/* Navegación lateral */
body.pangu-next .sidebar {
  width: 248px;
  padding: 1rem 0.8rem;
  background: linear-gradient(180deg, var(--pn-navy-900) 0%, var(--pn-navy-950) 100%);
  border-right: 0;
  box-shadow: 8px 0 28px rgba(8, 23, 39, 0.18);
}

body.pangu-next .sidebar-header { gap: 0.75rem; min-height: 48px; margin-bottom: 0.85rem; }

body.pangu-next .sidebar-header-controls {
  justify-content: flex-end;
  min-height: 0;
  margin-bottom: 0.5rem;
}

body.pangu-next .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

body.pangu-next .sidebar-logo-wrap {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 3px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
}

body.pangu-next .sidebar-logo { width: 100%; height: 100%; object-fit: contain; }

body.pangu-next .sidebar-brand-copy strong {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body.pangu-next .sidebar-brand-copy small { margin-top: 0.2rem; color: #aebdce; font-size: 0.66rem; }
body.pangu-next .sidebar-close { color: #c5d1df; }
body.pangu-next .sidebar-close:hover { background: rgba(255,255,255,0.1); color: #ffffff; }

body.pangu-next .sidebar .user-info {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.11);
  color: #d8e1ec;
  line-height: 1.45;
}

body.pangu-next .sidebar .badge {
  display: inline-flex;
  margin-top: 0.25rem;
  border: 1px solid rgba(147,180,244,0.28);
  background: rgba(37,99,235,0.18);
  color: #dce8ff;
}

body.pangu-next .sidebar-nav { gap: 0.3rem; }

body.pangu-next .sidebar-nav a {
  min-height: 44px;
  padding: 0.65rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #c7d3e1;
  font-weight: 500;
}

body.pangu-next .sidebar-nav a .material-icons { color: #8fa4ba; }

body.pangu-next .sidebar-nav a:hover {
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

body.pangu-next .sidebar-nav a:hover .material-icons { color: #cfe0ff; }

body.pangu-next .sidebar-nav a.nav-active,
body.pangu-next .sidebar-group-links a.nav-active {
  padding-left: 0.78rem;
  border: 1px solid rgba(125,165,247,0.25);
  background: linear-gradient(135deg, rgba(37,99,235,0.94), rgba(59,130,246,0.8));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(13,56,137,0.28);
  font-weight: 700;
}

body.pangu-next .sidebar-nav a.nav-active .material-icons { color: #ffffff; }

body.pangu-next .sidebar-logout {
  min-height: 42px;
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: #d6e0eb;
}

body.pangu-next .sidebar-logout:hover {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

body.pangu-next .sidebar-overlay { background: rgba(8,23,39,0.52); backdrop-filter: blur(3px); }

/* Contenido y jerarquía */
body.pangu-next .content { padding: 1.6rem 1.75rem 2.25rem; }

body.pangu-next .content > h2:first-of-type,
body.pangu-next .content .calidad-page > h2:first-of-type,
body.pangu-next .hub-hero {
  padding: 1.1rem 1.25rem;
  border: 1px solid #e1e7ef;
  border-left: 1px solid #e1e7ef;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  color: var(--pn-navy-900);
  box-shadow: var(--shadow-hero);
  font-weight: 750;
  letter-spacing: -0.02em;
}

body.pangu-next .content h2:not(:first-of-type) { padding-left: 0; border-left: 0; color: var(--pn-navy-900); font-weight: 700; }
body.pangu-next .content h3 { color: var(--pn-navy-900); }

body.pangu-next .hub-sub,
body.pangu-next .page-sub,
body.pangu-next .subtitle,
body.pangu-next .card-hint { color: var(--pn-slate-500); }

/* Superficies */
body.pangu-next .card,
body.pangu-next .hub-panel,
body.pangu-next .hub-tile,
body.pangu-next .ops-flow-card {
  border: 1px solid #e0e7f0;
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

body.pangu-next .card:hover,
body.pangu-next .hub-tile:hover { border-color: #cbd7e6; box-shadow: var(--shadow-card-hover); }
body.pangu-next .dashboard-cards { gap: 0.9rem; }

body.pangu-next .dashboard-cards .card .big,
body.pangu-next .hub-kpi-value { color: var(--pn-navy-900); font-weight: 800; letter-spacing: -0.03em; }

body.pangu-next .card-semaforo-ok { border-left: 4px solid #22a45d; }
body.pangu-next .card-semaforo-alerta { border-left: 4px solid #e19b26; }

/* Botones y formularios */
body.pangu-next button,
body.pangu-next .btn {
  min-height: 38px;
  padding: 0.46rem 0.9rem;
  border-radius: 10px;
  font-weight: 650;
}

body.pangu-next button.primary,
body.pangu-next .btn.primary,
body.pangu-next .btn:not(.secondary):not(.btn-secondary):not(.danger):not(.warning):not(.success):not(.btn-act-icon):not(.link-act-icon) {
  border: 1px solid var(--pn-blue-600);
  background: var(--pn-blue-600);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(29,78,216,0.16);
}

body.pangu-next button.primary:hover,
body.pangu-next .btn.primary:hover,
body.pangu-next .btn:hover:not(.secondary):not(.btn-secondary):not(.warning):not(.danger):not(.btn-act-icon):not(.link-act-icon) {
  border-color: var(--pn-blue-700);
  background: var(--pn-blue-700);
  color: #ffffff;
}

body.pangu-next button.secondary,
body.pangu-next .btn.secondary,
body.pangu-next .btn-secondary {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--pn-slate-700);
}

body.pangu-next button.secondary:hover,
body.pangu-next .btn.secondary:hover,
body.pangu-next .btn-secondary:hover {
  border-color: #9fb0c4;
  background: #f8fafc;
  color: var(--pn-navy-900);
}

body.pangu-next .btn-act-icon,
body.pangu-next button.btn-act-icon,
body.pangu-next a.link-act-icon,
body.pangu-next .btn.btn-act-icon,
body.pangu-next .btn.primary.btn-act-icon,
body.pangu-next .btn.secondary.btn-act-icon {
  border: 1px solid #d5deea !important;
  background: #ffffff !important;
  color: var(--pn-blue-700) !important;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04) !important;
}

body.pangu-next #productInfoModal .pinfo-edit-btn,
body.pangu-next #productInfoModal .pinfo-edit-btn.btn.primary,
body.pangu-next #productInfoModal .pinfo-edit-btn.btn-act-icon {
  border: 1px solid #1e40af !important;
  background: #1d4ed8 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.45) !important;
}

body.pangu-next #productInfoModal .pinfo-edit-btn:hover {
  border-color: #1e3a8a !important;
  background: #1e40af !important;
  color: #fff !important;
}

body.pangu-next #productInfoModal .pinfo-edit-btn .material-icons {
  color: #fff !important;
}

body.pangu-next .btn-act-icon:hover,
body.pangu-next button.btn-act-icon:hover,
body.pangu-next a.link-act-icon:hover,
body.pangu-next .btn.btn-act-icon:hover {
  border-color: #a8c1f4 !important;
  background: var(--pn-blue-50) !important;
  color: #163d9c !important;
}

body.pangu-next .form-group label {
  margin-bottom: 0.35rem;
  color: var(--pn-slate-700);
  font-size: 0.78rem;
  font-weight: 700;
}

body.pangu-next .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.pangu-next .form-group select,
body.pangu-next .form-group textarea {
  border: 1px solid #cfd8e5;
  border-radius: 10px;
  background: #ffffff;
  color: var(--pn-slate-950);
  box-shadow: 0 1px 2px rgba(16,24,40,0.03);
}

body.pangu-next .form-group input:focus,
body.pangu-next .form-group select:focus,
body.pangu-next .form-group textarea:focus {
  border-color: #7ca4f5;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}

/* Filtros y tablas */
body.pangu-next .filter-tabs,
body.pangu-next .content .filter-row,
body.pangu-next .content .recep-date-filters,
body.pangu-next .content .orders-filters {
  border: 1px solid #e0e7f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

body.pangu-next .filter-tab.active,
body.pangu-next .filter-tabs a.active,
body.pangu-next .op-tab.active {
  border-color: var(--pn-blue-600) !important;
  background: var(--pn-blue-600) !important;
  color: #ffffff !important;
  font-weight: 700;
}

body.pangu-next .table-wrap,
body.pangu-next .table-responsive,
body.pangu-next .hub-table-wrap {
  border: 1px solid #e0e7f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

body.pangu-next .content table thead th,
body.pangu-next .hub-table thead th,
body.pangu-next .modal-content .detail-table th,
body.pangu-next .hub-mov-detail-table th {
  border-bottom: 1px solid #d8e1ec;
  background: #f3f6fa;
  color: var(--pn-slate-700);
  box-shadow: none;
  font-weight: 750;
}

body.pangu-next .content table tbody tr:nth-child(even),
body.pangu-next .hub-table tbody tr:nth-child(even) { background: #fbfcfe; }

body.pangu-next .content table tbody tr:hover,
body.pangu-next .hub-table tbody tr:hover { background: var(--pn-blue-50); }

body.pangu-next .badge { border-radius: 999px; font-weight: 700; }

/* Módulos */
body.pangu-next .modules-page { max-width: 1180px; margin: 0 auto; }

body.pangu-next .modules-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #e0e7f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

body.pangu-next .modules-heading-main { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }

body.pangu-next .modules-heading-icon,
body.pangu-next .module-card-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--pn-blue-700);
  background: var(--pn-blue-50);
}

body.pangu-next .modules-heading-icon { width: 3.25rem; height: 3.25rem; border-radius: 14px; }
body.pangu-next .modules-heading-icon .material-icons { font-size: 1.7rem; }

body.pangu-next .modules-heading h2 {
  margin: 0;
  color: var(--pn-navy-900);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

body.pangu-next .modules-heading p { margin: 0.28rem 0 0; color: var(--pn-slate-500); }

body.pangu-next .modules-overview,
body.pangu-next .modules-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 0.9rem;
}

body.pangu-next .module-overview-card,
body.pangu-next .module-action-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 5.65rem;
  padding: 1rem;
  border: 1px solid #e0e7f0;
  border-radius: 16px;
  background: #ffffff;
  color: var(--pn-slate-950);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

body.pangu-next .module-overview-card:hover,
body.pangu-next .module-overview-card:focus-visible,
body.pangu-next .module-action-card:hover,
body.pangu-next .module-action-card:focus-visible {
  border-color: #aac2ef;
  background: #ffffff;
  color: var(--pn-slate-950);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

body.pangu-next .module-card-icon { width: 2.8rem; height: 2.8rem; border-radius: 12px; }
body.pangu-next .module-card-copy { min-width: 0; flex: 1; }

body.pangu-next .module-card-copy strong {
  display: block;
  color: var(--pn-navy-900);
  font-size: 0.96rem;
  font-weight: 750;
  line-height: 1.25;
}

body.pangu-next .module-card-copy small {
  display: block;
  margin-top: 0.24rem;
  color: var(--pn-slate-500);
  font-size: 0.76rem;
  line-height: 1.35;
}

body.pangu-next .module-card-arrow { flex: 0 0 auto; color: #98a6b7; }
body.pangu-next .module-overview-card--inventario .module-card-icon { background: #ecfdf3; color: #15803d; }
body.pangu-next .module-overview-card--reportes .module-card-icon,
body.pangu-next .module-overview-card--contabilidad .module-card-icon { background: #f4f0ff; color: #6d4bc3; }
body.pangu-next .module-overview-card--rrhh .module-card-icon,
body.pangu-next .module-overview-card--personal .module-card-icon { background: #fff4e5; color: #b45309; }
body.pangu-next .module-overview-card--administracion .module-card-icon { background: #f1f5f9; color: #475467; }

body.pangu-next .modules-section { margin-top: 1.35rem; }
body.pangu-next .modules-section h3 { margin: 0 0 0.2rem; color: var(--pn-navy-900); font-size: 1.03rem; }
body.pangu-next .modules-section > p { margin: 0 0 0.7rem; color: var(--pn-slate-500); }

/* Paneles flotantes — ventana mate; fondo (overlay) iOS aparte */
body.pangu-next .modal,
body.pangu-next .seller-modal {
  background: rgba(15, 23, 42, 0.28);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}
body.pangu-next .notif-panel,
body.pangu-next .global-search-results {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 18px 40px rgba(16,24,40,0.14), 0 4px 12px rgba(16,24,40,0.06);
}
body.pangu-next .modal-content,
body.pangu-next .seller-modal-panel {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: 0 18px 48px rgba(16,24,40,0.22);
}
body.pangu-next .modal-header,
body.pangu-next .seller-modal-head {
  border-bottom: 1px solid #e5e7eb;
  border-radius: 16px 16px 0 0;
  background: #f8fafc;
}
body.pangu-next .modal-footer {
  border-top: 1px solid #e5e7eb;
  border-radius: 0 0 16px 16px;
  background: #f8fafc;
}
@media (prefers-reduced-transparency: reduce) {
  body.pangu-next .modal,
  body.pangu-next .seller-modal,
  .modal,
  .seller-modal {
    background: rgba(15, 23, 42, 0.55) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* Login */
body.login-page.pangu-next {
  padding: 1.25rem;
  background: radial-gradient(circle at 18% 18%, rgba(59,130,246,0.32), transparent 28rem), radial-gradient(circle at 88% 85%, rgba(14,165,164,0.18), transparent 26rem), linear-gradient(145deg, #081727 0%, #0b1f33 52%, #123554 100%);
}

body.pangu-next .login-box {
  position: relative;
  max-width: 420px;
  padding: 2.25rem 2.3rem 2.4rem;
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 24px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 28px 70px rgba(4,15,28,0.34);
}

body.pangu-next .login-preview-badge { position: absolute; top: 1rem; right: 1rem; }

body.pangu-next .login-logo-wrap {
  width: min(250px, 76%);
  height: 126px;
  margin: 0 auto 0.7rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.pangu-next .login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.pangu-next .login-box h1 {
  margin-bottom: 0.35rem;
  color: var(--pn-navy-900);
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

body.pangu-next .login-subtitle {
  max-width: 18rem;
  margin: 0 auto 1.45rem;
  color: var(--pn-slate-500);
  font-size: 0.83rem;
  line-height: 1.4;
  text-align: center;
}

body.pangu-next .login-box button[type="submit"] {
  min-height: 44px;
  margin-top: 0.55rem;
  border-radius: 11px;
  background: var(--pn-blue-600);
  font-weight: 750;
}

body.pangu-next .login-box button[type="submit"]:hover { background: var(--pn-blue-700); }

/* Accesibilidad */
body.pangu-next :focus-visible { outline: 3px solid rgba(37,99,235,0.38); outline-offset: 2px; }

@media (min-width: 1024px) {
  body.pangu-next .menu-toggle { display: none; }
  body.pangu-next .app-bar { z-index: 300; }

  body.pangu-next .sidebar {
    top: 72px;
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    transform: translateX(0);
    box-shadow: 4px 0 18px rgba(8,23,39,0.12);
    z-index: 190;
  }

  body.pangu-next .sidebar-close,
  body.pangu-next .sidebar-overlay { display: none; }

  body.pangu-next .sidebar-header-controls { display: none; }

  body.pangu-next .sidebar-nav {
    min-height: 0;
    overflow-y: auto;
  }

  body.pangu-next .content { width: calc(100% - 248px); margin-left: 248px; }
}

@media (max-width: 1023px) {
  body.pangu-next .app-bar { height: 64px; padding-inline: 0.55rem; }
  body.pangu-next .menu-toggle { order: 0; }
  body.pangu-next .app-bar-title { order: 1; margin: 0 auto 0 0.25rem; }
  body.pangu-next .global-search-wrap { order: 4; }
  body.pangu-next .global-search-mobile-toggle { order: 2; }
  body.pangu-next .app-bar-user { order: 3; margin-left: 0; }
  body.pangu-next .sidebar { top: 0; height: 100vh; height: 100dvh; }
}

@media (max-width: 768px) {
  :root { --radius-card: 14px; --bodega-field-h: 2.75rem; }
  body.pangu-next .content { padding: 1rem 0.85rem calc(5.8rem + env(safe-area-inset-bottom, 0px)); }
  body.pangu-next .app-bar-logo-wrap { width: 82px; height: 42px; border-radius: 0; }

  body.pangu-next .app-bar-brand-copy small,
  body.pangu-next .app-bar-user .user-name,
  body.pangu-next .app-bar-user .badge-role,
  body.pangu-next .user-avatar:not(.user-avatar--photo) { display: none; }

  body.pangu-next .environment-badge { padding: 0.2rem 0.4rem; font-size: 0.58rem; }

  body.pangu-next .app-bar-ia,
  body.pangu-next .btn-icon,
  body.pangu-next .notif-bell-btn,
  body.pangu-next .global-search-mobile-toggle,
  body.pangu-next .menu-toggle { width: 40px; height: 40px; }

  body.pangu-next .modules-heading { flex-direction: column; align-items: stretch; padding: 1rem; }
  body.pangu-next .modules-heading-main { align-items: flex-start; }
  body.pangu-next .modules-heading-icon { width: 2.8rem; height: 2.8rem; }
  body.pangu-next .modules-heading h2 { font-size: 1.2rem; }

  body.pangu-next .modules-overview,
  body.pangu-next .modules-card-grid { grid-template-columns: 1fr; gap: 0.7rem; }

  body.pangu-next .module-overview-card,
  body.pangu-next .module-action-card { min-height: 4.9rem; padding: 0.85rem; border-radius: 14px; }

  body.pangu-next .module-overview-card:hover,
  body.pangu-next .module-action-card:hover { transform: none; }

  body.pangu-next .filter-tabs,
  body.pangu-next .content .filter-row,
  body.pangu-next .content .recep-date-filters,
  body.pangu-next .content .orders-filters { border-radius: 12px; }

  body.pangu-next button,
  body.pangu-next .btn { min-height: 44px; }

  body.pangu-next .login-box { padding: 2rem 1.35rem 1.7rem; border-radius: 20px; }
  body.pangu-next .login-preview-badge { position: static; margin: 0 auto 0.9rem; }
}

@media (max-width: 420px) {
  body.pangu-next .app-bar-title { gap: 0.4rem; }
  body.pangu-next .app-bar-logo-wrap { width: 68px; height: 36px; }
  body.pangu-next .app-bar-brand-copy { display: none; }
  body.pangu-next .environment-badge { margin-left: 0; }
  body.pangu-next .app-bar-ia { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.pangu-next *,
  body.pangu-next *::before,
  body.pangu-next *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* PANGU shell refinements v286 */
body.pangu-next .sidebar-collapse-toggle {
  display: none;
  position: fixed;
  top: calc(72px + 16px);
  left: calc(220px - 17px);
  z-index: 305;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #c9d5e4;
  border-radius: 999px;
  background: #ffffff;
  color: var(--pn-slate-600);
  box-shadow: 0 4px 12px rgba(8, 23, 39, 0.16);
  transition: left 0.2s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
body.pangu-next .sidebar-collapse-toggle .material-icons {
  font-size: 1.25rem;
}
body.pangu-next .sidebar-collapse-toggle:hover {
  border-color: #9db9ee;
  background: var(--pn-blue-50);
  color: var(--pn-blue-700);
  box-shadow: 0 6px 16px rgba(8, 23, 39, 0.2);
}
body.pangu-next .global-search-wrap { order: 2; }
body.pangu-next .app-bar-user { order: 3; }

body.pangu-next .sidebar-module-group {
  margin: 0.12rem 0;
  border-radius: 10px;
}
body.pangu-next .sidebar-module-group > .sidebar-group-summary {
  min-height: 38px;
  padding: 0.5rem 0.62rem;
  gap: 0.55rem;
  color: #9fb0c2;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.015em;
}
body.pangu-next .sidebar-module-group > .sidebar-group-summary .material-icons:first-child {
  color: #7f96ad;
}
body.pangu-next .sidebar-module-group > .sidebar-group-summary:hover,
body.pangu-next .sidebar-module-group.is-active > .sidebar-group-summary {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}
body.pangu-next .sidebar-module-group.is-active > .sidebar-group-summary .material-icons:first-child {
  color: #cfe0ff;
}
body.pangu-next .sidebar-module-group .sidebar-group-chevron {
  color: #71869d !important;
}
body.pangu-next .sidebar-module-group .sidebar-group-links {
  margin: 0.05rem 0 0.25rem 0.72rem;
  padding: 0.08rem 0 0.18rem 0.42rem;
  gap: 0.08rem;
  border-left: 1px solid rgba(174,196,220,0.22);
}
body.pangu-next .sidebar-module-group .sidebar-group-links a {
  min-height: 38px;
  padding: 0.48rem 0.58rem;
  gap: 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
}
body.pangu-next .sidebar-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.pangu-next .dashboard-indicator-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -0.15rem 0 0.7rem;
}
body.pangu-next .dashboard-indicator-summary {
  color: var(--pn-slate-500);
  font-size: 0.78rem;
  font-weight: 600;
}
body.pangu-next button.dashboard-indicator-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.38rem 0.65rem;
  border: 1px solid #cbd7e6;
  border-radius: 9px;
  background: #ffffff;
  color: var(--pn-blue-700);
  box-shadow: none;
  font-size: 0.78rem;
}
body.pangu-next button.dashboard-indicator-toggle:hover {
  border-color: #9db9ee;
  background: var(--pn-blue-50);
}
body.pangu-next button.dashboard-indicator-toggle .material-icons { font-size: 1.05rem; }

body.pangu-next .cards.dashboard-cards.dashboard-cards-narrow {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  overflow: visible;
}
body.pangu-next .dashboard-cards-narrow a.card-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title value"
    "hint hint";
  align-content: center;
  align-items: center;
  min-width: 0;
  min-height: 84px;
  padding: 0.72rem 0.8rem;
  gap: 0.32rem 0.65rem;
  border-left: 4px solid #cbd5e1;
  border-radius: 13px;
  overflow: hidden;
}
body.pangu-next .dashboard-cards-narrow .card h3 {
  grid-area: title;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: visible;
  color: var(--pn-navy-900);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: 0;
  white-space: normal;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}
body.pangu-next .dashboard-cards-narrow .card .big {
  grid-area: value;
  min-width: 1.8rem;
  margin: 0;
  color: var(--pn-navy-900);
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1;
  text-align: right;
}
body.pangu-next .dashboard-cards-narrow .card .card-hint {
  grid-area: hint;
  margin: 0;
  overflow: hidden;
  color: var(--pn-slate-500);
  font-size: 0.7rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.pangu-next .dashboard-cards-narrow .dashboard-status-critical {
  border-left-color: #dc2626;
  background: #fff8f8;
}
body.pangu-next .dashboard-cards-narrow .dashboard-status-critical .big { color: #b42318; }
body.pangu-next .dashboard-cards-narrow .dashboard-status-warning {
  border-left-color: #d97706;
  background: #fffbf2;
}
body.pangu-next .dashboard-cards-narrow .dashboard-status-warning .big { color: #9a4c05; }
body.pangu-next .dashboard-cards-narrow .dashboard-status-ok {
  border-left-color: #22a45d;
  background: #fbfefc;
}
body.pangu-next .dashboard-cards-narrow .dashboard-status-ok .big { color: #18743d; }

body.pangu-next .hub-table-wrap {
  max-height: min(58vh, 560px);
  overflow: auto;
}
body.pangu-next .hub-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
body.pangu-next .hub-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0.58rem 0.68rem;
  box-shadow: 0 1px 0 #d8e1ec;
}
body.pangu-next .hub-table tbody td {
  padding: 0.5rem 0.68rem;
  font-size: 0.82rem;
  line-height: 1.22;
}
body.pangu-next .hub-table th:nth-child(1),
body.pangu-next .hub-table td:nth-child(1) { width: 8.5rem; }
body.pangu-next .hub-table th:nth-child(2),
body.pangu-next .hub-table td:nth-child(2) { width: 11.5rem; }
body.pangu-next .hub-table th:nth-child(3),
body.pangu-next .hub-table td:nth-child(3),
body.pangu-next .hub-table td.hub-mov-prod {
  min-width: 12.5rem;
  width: auto;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
body.pangu-next .hub-table th:nth-child(4),
body.pangu-next .hub-table td:nth-child(4) { width: 5rem; text-align: right; }
body.pangu-next .hub-table th:nth-child(5),
body.pangu-next .hub-table td:nth-child(5),
body.pangu-next .hub-table td.hub-mov-dea {
  min-width: 14rem;
  max-width: none;
  width: auto;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
body.pangu-next .hub-table th:nth-child(6),
body.pangu-next .hub-table td:nth-child(6) { min-width: 13rem; }
body.pangu-next .hub-page.home-unified #hubMovTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
body.pangu-next .hub-page.home-unified #hubMovTable th,
body.pangu-next .hub-page.home-unified #hubMovTable td {
  min-width: 0;
  max-width: none;
}
body.pangu-next .hub-page.home-unified #hubMovTable th:nth-child(1),
body.pangu-next .hub-page.home-unified #hubMovTable td:nth-child(1) { width: 6.8rem; }
body.pangu-next .hub-page.home-unified #hubMovTable th:nth-child(2),
body.pangu-next .hub-page.home-unified #hubMovTable td:nth-child(2) { width: 8.1rem; }
body.pangu-next .hub-page.home-unified #hubMovTable th:nth-child(3),
body.pangu-next .hub-page.home-unified #hubMovTable td:nth-child(3),
body.pangu-next .hub-page.home-unified #hubMovTable td.hub-mov-prod {
  min-width: 0;
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.pangu-next .hub-page.home-unified #hubMovTable th:nth-child(4),
body.pangu-next .hub-page.home-unified #hubMovTable td:nth-child(4) { width: 4.4rem; text-align: right; }
body.pangu-next .hub-page.home-unified #hubMovTable th:nth-child(5),
body.pangu-next .hub-page.home-unified #hubMovTable td:nth-child(5),
body.pangu-next .hub-page.home-unified #hubMovTable td.hub-mov-dea {
  min-width: 0;
  width: 22%;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.pangu-next .hub-page.home-unified #hubMovTable th:nth-child(6),
body.pangu-next .hub-page.home-unified #hubMovTable td:nth-child(6) {
  min-width: 0;
  width: 8.5rem;
}
body.pangu-next .table-wrap thead th,
body.pangu-next .table-responsive thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

body.pangu-next button.ops-bottom-nav-item {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  cursor: pointer;
}

@media (min-width: 1400px) {
  body.pangu-next .cards.dashboard-cards.dashboard-cards-narrow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) and (max-width: 1399px) {
  body.pangu-next .cards.dashboard-cards.dashboard-cards-narrow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  body.pangu-next .sidebar-collapse-toggle { display: grid; }
  body.pangu-next .sidebar {
    width: 220px;
    padding: 0.72rem 0.62rem;
    transition: width 0.2s ease, padding 0.2s ease;
  }
  body.pangu-next .content {
    width: calc(100% - 220px);
    margin-left: 220px;
    transition: width 0.2s ease, margin-left 0.2s ease;
  }
  html.sidebar-collapsed body.pangu-next .sidebar {
    width: 72px;
    padding-inline: 0.48rem;
  }
  html.sidebar-collapsed body.pangu-next .sidebar-collapse-toggle {
    left: calc(72px - 17px);
  }
  html.sidebar-collapsed body.pangu-next .content {
    width: calc(100% - 72px);
    margin-left: 72px;
  }
  html.sidebar-collapsed body.pangu-next .sidebar-group-summary,
  html.sidebar-collapsed body.pangu-next .sidebar-nav-label {
    display: none;
  }
  html.sidebar-collapsed body.pangu-next .sidebar-module-group .sidebar-group-links {
    display: flex !important;
    margin: 0;
    padding: 0;
    border: 0;
  }
  html.sidebar-collapsed body.pangu-next .sidebar-nav a {
    justify-content: center;
    min-height: 44px;
    padding: 0.62rem;
    gap: 0;
  }
  html.sidebar-collapsed body.pangu-next .sidebar-nav a .material-icons {
    margin: 0;
    font-size: 1.25rem;
  }
}
@media (min-width: 769px) and (max-width: 1023px) {
  body.pangu-next .cards.dashboard-cards.dashboard-cards-narrow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  body.pangu-next .dashboard-indicator-toolbar {
    margin-top: 0;
  }
  body.pangu-next .dashboard-indicator-summary { font-size: 0.72rem; }
  body.pangu-next button.dashboard-indicator-toggle {
    min-height: 38px;
    padding: 0.42rem 0.58rem;
  }
  body.pangu-next .cards.dashboard-cards.dashboard-cards-narrow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  body.pangu-next .dashboard-cards-narrow a.card-link {
    min-height: 78px;
    padding: 0.62rem 0.68rem;
  }
  body.pangu-next .dashboard-cards-narrow .card h3 {
    font-size: 0.82rem;
  }
  body.pangu-next .dashboard-cards-narrow .card .big {
    font-size: 1.45rem;
  }
  body.pangu-next .dashboard-cards-narrow .card .card-hint {
    display: none;
  }
  body.pangu-next .hub-table-wrap { max-height: none; }
}
@media (max-width: 600px) {
  body.pangu-next .cards.dashboard-cards.dashboard-cards-narrow {
    grid-template-columns: 1fr;
  }
  body.pangu-next .dashboard-cards-narrow a.card-link {
    min-height: 68px;
  }
}

/* Returns use the shared dashboard status palette (04-dashboard-cards.css).
   Indicator cards inherit the same title/count colors as their neighbors.
   Warehouse action cards need dark text on these light status backgrounds. */
body.pangu-next .content a.home-role-task.home-returns-button { color: var(--pn-navy-900); }
body.pangu-next .content a.home-returns-button:focus-visible {
  outline: 3px solid var(--pn-blue-700);
  outline-offset: 3px;
}
body.pangu-next .content a.home-role-task.home-returns-button :is(strong, small, .material-icons) {
  color: inherit;
  opacity: 1;
}
body.pangu-next .content a.home-role-task.home-returns-button .home-role-count {
  background: #fff;
  color: #15803d;
  opacity: 1;
}
body.pangu-next .content a.home-role-task.home-returns-button.has-pending .home-role-count { color: #a64b00; }

/* === 14-location-picker.css === */
/* Selector visual de bodegas — compacto (2 filas en Conteo / Stock) */

.loc-picker-board {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.loc-picker-board--compact {
  gap: 0.32rem;
}
.loc-picker-loading { margin: 0.25rem 0; }

/* Exactamente 2 filas: operativas(+TODAS) y restaurantes */
.loc-picker-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.32rem;
  min-width: 0;
}
.loc-picker-row .loc-picker-tile {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
}

.loc-picker-tile {
  position: relative;
}
.loc-picker-check {
  position: absolute;
  top: 0.12rem;
  right: 0.12rem;
  font-size: 0.85rem !important;
  color: #0f766e;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.loc-picker-tile.is-active .loc-picker-check {
  opacity: 1;
  transform: scale(1);
}
.stock-loc-card.loc-picker-tile .loc-picker-check {
  color: #7c3aed;
}

.loc-picker-board .stock-zone-tile {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-areas:
    "icon name"
    "icon meta";
  align-items: center;
  gap: 0 0.28rem;
  min-width: 0;
  min-height: 44px;
  height: 100%;
  padding: 0.28rem 0.7rem 0.28rem 0.32rem;
  border: 1px solid color-mix(in srgb, var(--zone-color, #1565c0) 48%, #d9e3ef);
  border-left: 3px solid var(--zone-color, #1565c0);
  border-radius: 8px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--zone-color, #1565c0) 8%, #fff), #fff 62%);
  cursor: pointer;
  text-align: left;
  transition: transform .12s, border-color .15s, box-shadow .15s, outline-color .15s;
}
.loc-picker-board .stock-zone-tile:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--zone-color, #1565c0) 65%, #d9e3ef);
  box-shadow: 0 3px 10px rgba(15, 43, 76, 0.1);
}
.loc-picker-board .stock-zone-tile.is-active {
  outline: 2px solid color-mix(in srgb, var(--zone-color, #1565c0) 70%, #fff);
  outline-offset: 1px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--zone-color, #1565c0) 16%, #fff), #fff 58%);
}
.loc-picker-board .stock-zone-icon {
  grid-area: icon;
  font-size: 1rem !important;
  color: var(--zone-color, #1565c0);
  line-height: 1;
}
.loc-picker-board .stock-zone-name {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  color: #102a43;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.55rem;
}
.loc-picker-board .stock-zone-meta {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  color: #667085;
  font-size: 0.54rem;
  font-weight: 650;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Restaurantes: mismo footprint compacto que operativas */
.loc-picker-board .stock-loc-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-areas:
    "icon name"
    "icon meta";
  align-items: center;
  gap: 0 0.28rem;
  min-width: 0;
  min-height: 44px;
  height: 100%;
  padding: 0.28rem 0.7rem 0.28rem 0.32rem;
  border: 1px solid #ddd5ed;
  border-left: 3px solid #7c3aed;
  border-radius: 8px;
  background: linear-gradient(145deg, #fbf8ff, #fff 65%);
  cursor: pointer;
  text-align: left;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.loc-picker-board .stock-loc-card:hover {
  transform: translateY(-1px);
  border-color: #b39ddb;
  box-shadow: 0 3px 10px rgba(76, 29, 149, 0.1);
}
.loc-picker-board .stock-loc-card.is-active {
  outline: 2px solid rgba(124, 58, 237, 0.38);
  outline-offset: 1px;
  background: linear-gradient(145deg, #f3eaff, #fff 60%);
}
.loc-picker-board .stock-loc-card-head {
  grid-area: name;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  margin: 0;
  padding-right: 0.55rem;
}
.loc-picker-board .stock-loc-card-head .material-icons {
  display: none; /* icono va fuera del head en markup compacto; fallback si no */
}
.loc-picker-board .stock-loc-card > .material-icons:not(.loc-picker-check) {
  grid-area: icon;
  color: #7c3aed;
  font-size: 1rem;
  line-height: 1;
}
.loc-picker-board .stock-loc-card-head strong {
  min-width: 0;
  overflow: hidden;
  color: #281454;
  font-size: 0.64rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loc-picker-board .stock-loc-card-meta {
  grid-area: meta;
  color: #6b7280;
  font-size: 0.54rem;
  font-weight: 650;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Legacy section titles (ocultos en layout compacto) */
.loc-picker-section-title { display: none; }
.loc-picker-grid,
.stock-principal-floor.loc-picker-grid,
.stock-restaurant-grid.loc-picker-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.32rem;
  min-width: 0;
}

@media (max-width: 768px) {
  .loc-picker-row,
  .loc-picker-grid,
  .stock-principal-floor.loc-picker-grid,
  .stock-restaurant-grid.loc-picker-grid {
    flex-wrap: wrap;
  }
  .loc-picker-row .loc-picker-tile,
  .loc-picker-grid .loc-picker-tile {
    flex: 1 1 calc(25% - 0.32rem);
    min-width: 4.5rem;
  }
  .loc-picker-board .stock-zone-tile,
  .loc-picker-board .stock-loc-card {
    min-height: 48px;
  }
}

/* === 15-auto-fullscreen-modals.css === */
/* Planillas extensas: aprovechar todo el viewport en teléfonos. */
@media (max-width: 768px) {
  .modal-auto-fullscreen {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
  }

  .modal-auto-fullscreen > .is-auto-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-auto-fullscreen > .is-auto-fullscreen > .modal-header,
  .modal-auto-fullscreen > .is-auto-fullscreen > .pinfo-modal-head,
  .modal-auto-fullscreen > .is-auto-fullscreen > .seller-modal-head {
    flex: 0 0 auto;
    padding-top: max(0.45rem, env(safe-area-inset-top, 0px)) !important;
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px)) !important;
  }

  .modal-auto-fullscreen > .is-auto-fullscreen > .modal-body,
  .modal-auto-fullscreen > .is-auto-fullscreen > .product-info-modal-scroll,
  .modal-auto-fullscreen > .is-auto-fullscreen > .seller-modal-body,
  .modal-auto-fullscreen > .is-auto-fullscreen > [id$="Body"],
  .modal-auto-fullscreen > .is-auto-fullscreen > form {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-auto-fullscreen > .is-auto-fullscreen > .modal-footer {
    flex: 0 0 auto;
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom, 0px)) !important;
  }

  .modal-content.is-auto-fullscreen .modal-resize-handle,
  .modal-content.is-auto-fullscreen .modal-max-btn {
    display: none !important;
  }
}

/* En computador, las ventanas con planillas o trazabilidad extensa deben abrir
   con espacio suficiente para leer las columnas sin maximizar manualmente. */
@media (min-width: 769px) {
  .modal-content.is-desktop-data-modal,
  .seller-modal-panel.is-desktop-data-modal,
  .modal-panel.is-desktop-data-modal,
  .if-modal-box.is-desktop-data-modal,
  .att-modal.is-desktop-data-modal {
    --modal-max: min(1180px, calc(100vw - 3rem));
    width: min(1180px, calc(100vw - 3rem)) !important;
    max-width: min(1180px, calc(100vw - 3rem)) !important;
    max-height: calc(100dvh - 3rem) !important;
  }
}

/* === 16-dispatch-history.css === */
.dispatch-history-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0 0 0.55rem;
}
.dispatch-history-tab {
    min-height: 2.55rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #cbd6e2;
    border-radius: 10px;
    background: #fff;
    color: #42566e;
    font-weight: 750;
    cursor: pointer;
}
.dispatch-history-tab.is-active {
    border-color: #1769c2;
    background: #1769c2;
    color: #fff;
}
.dispatch-history-panel { min-width: 0; }
.dispatch-wrap.is-history-view { max-width: none; }
.dispatch-history-filterbar {
    display: flex;
    align-items: end;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0.55rem;
    border: 1px solid #d9e1e8;
    border-radius: 12px;
    background: #f7f9fb;
}
.dispatch-history-filterbar label {
    display: grid;
    gap: 0.15rem;
    color: #526579;
    font-size: 0.72rem;
    font-weight: 700;
}
.dispatch-history-filterbar input[type="date"] {
    min-height: 2.25rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid #bac7d4;
    border-radius: 8px;
    background: #fff;
    color: #172b43;
}
.dispatch-history-exports {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}
.dispatch-history-export {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.52rem;
    border: 1px solid #c9d3dd;
    border-radius: 9px;
    background: #fff;
    color: #25384d;
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
}
.dispatch-history-export-icon { object-fit: contain; }
.dispatch-history-summary { margin: 0.55rem 0 0.35rem; font-size: 0.78rem; }
.dispatch-history-date-group { margin: 0 0 0.7rem; }
.dispatch-history-date-group > h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    padding: 0.42rem 0.55rem;
    border-bottom: 1px solid #d6dee7;
    color: #41566e;
    font-size: 0.78rem;
    text-transform: uppercase;
}
.dispatch-history-date-group > h3 span {
    color: #708196;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: none;
}
.dispatch-history-date-rows {
    overflow: hidden;
    border: 1px solid #dce3ea;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: #fff;
}
.dispatch-history-row {
    padding: 0.52rem 0.6rem;
    border-bottom: 1px solid #e7ebef;
}
.dispatch-history-row:last-child { border-bottom: 0; }
.dispatch-history-order-group {
    overflow: hidden;
    margin: 0 0 0.7rem;
    border: 1px solid #cfd9e4;
    border-radius: 12px;
    background: #fff;
}
.dispatch-history-order-title {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-bottom: 1px solid #dce5ee;
    background: #eef5fd;
    color: #123b69;
    text-align: left;
    cursor: pointer;
}
.dispatch-history-order-title:hover { background: #e1efff; }
.dispatch-history-order-title > .material-icons:first-child { color: #1769c2; }
.dispatch-history-order-copy { min-width: 0; display: grid; gap: 0.08rem; }
.dispatch-history-order-copy small { color: #5b718b; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; }
.dispatch-history-order-copy strong { overflow: hidden; color: #12345b; font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-history-order-copy span { color: #526a83; font-size: 0.7rem; }
.dispatch-history-order-count {
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    background: #fff;
    color: #385a7e;
    font-size: 0.68rem;
    font-weight: 750;
    white-space: nowrap;
}
.dispatch-history-order-open { color: #1769c2; font-size: 1.15rem; }
.dispatch-history-order-open[data-history-toggle-icon] { font-size: 1.5rem; font-weight: 800; min-width: 1.5rem; text-align: center; }
[data-history-order-rows][hidden] { display: none !important; }
.mi-kitchen-coverage { display:block; margin:0.3rem 0; color:#137333; font-size:0.78rem; line-height:1.4; }
.mi-receipt-order > summary { list-style: none; }
.mi-receipt-order > summary::-webkit-details-marker { display: none; }
.mi-receipt-toggle::before { content: '+'; font-size: 1.5rem; font-weight: 800; }
.mi-receipt-order[open] > summary .mi-receipt-toggle::before { content: '−'; }
.mi-receipt-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
#btnMiCards[hidden], #btnMiTable[hidden] { display: none !important; }
.dispatch-history-production-day > h3 { margin: 1rem 0 0.6rem; padding: 0.5rem; color: #12345b; border-bottom: 2px solid #dce5ee; font-size: 1rem; }
.history-category-cocina_caliente { --history-category-bg: #fde8e5; --history-category-color: #bd2626; }
.history-category-cocina_fria { --history-category-bg: #e0f0ff; --history-category-color: #1769aa; }
.history-category-panaderia { --history-category-bg: #fff0c2; --history-category-color: #986000; }
.history-category-restaurant { --history-category-bg: #eef5fd; --history-category-color: #1769c2; }
.dispatch-history-order-group[class*="history-category-"] { border-left: 5px solid var(--history-category-color, #718096); }
.dispatch-history-order-group[class*="history-category-"] > .dispatch-history-order-title { background: var(--history-category-bg, #f1f3f5); }
.dispatch-history-order-group[class*="history-category-"] .dispatch-history-order-copy small { color: var(--history-category-color, #526a83); }
.dispatch-history-order-group > .dispatch-history-date-rows { border: 0; border-radius: 0; }
.dispatch-history-row-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: baseline;
}
.dispatch-history-product { color: #18293e; font-size: 0.86rem; line-height: 1.2; }
.dispatch-history-qty { color: #145fae; font-size: 0.83rem; white-space: nowrap; }
.dispatch-history-row-meta {
    display: flex;
    gap: 0.28rem 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.24rem;
    color: #637489;
    font-size: 0.68rem;
}
.dispatch-history-row-meta span:not(:last-child)::after {
    content: "·";
    margin-left: 0.55rem;
    color: #a1adba;
}
.dispatch-history-requested { display: block; margin-top: 0.2rem; color: #738297; font-size: 0.66rem; }
.dispatch-history-notes { margin: 0.24rem 0 0; color: #785d20; font-size: 0.68rem; }
.dispatch-history-empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 1.5rem 0.75rem;
    color: #607286;
    text-align: center;
}
.dispatch-history-empty .material-icons { font-size: 2rem; color: #91a0af; }
.dispatch-history-empty p { margin: 0; font-size: 0.78rem; }

body.dispatch-history-modal-open { overflow: hidden; }
.dispatch-history-order-modal[hidden] { display: none !important; }
.dispatch-history-order-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5vh 2vw;
    background: rgba(13, 30, 50, 0.58);
    backdrop-filter: blur(3px);
}
.dispatch-history-order-dialog {
    width: min(1120px, 96vw);
    max-height: 95vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #cbd7e3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(5, 25, 48, 0.3);
}
.dispatch-history-order-dialog > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #dce4ec;
    background: #f7f9fc;
}
.dispatch-history-order-dialog > header small { color: #6c7f93; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; }
.dispatch-history-order-dialog > header h2 { margin: 0.08rem 0 0; color: #142b45; font-size: 1.05rem; }
.dispatch-history-order-close {
    width: 2.45rem;
    height: 2.45rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #cbd6e1;
    border-radius: 10px;
    background: #fff;
    color: #40566e;
    cursor: pointer;
}
.dispatch-history-order-body { overflow: auto; padding: 0.85rem; }
.dispatch-history-detail-loading { min-height: 12rem; display: grid; place-items: center; align-content: center; gap: 0.4rem; color: #536b83; }
.dispatch-history-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}
.dispatch-history-detail-code { color: #1769c2; font-size: 0.72rem; font-weight: 850; }
.dispatch-history-detail-heading h3 { margin: 0.1rem 0; color: #142b45; font-size: 1.1rem; }
.dispatch-history-detail-heading p { margin: 0; color: #64778c; font-size: 0.78rem; }
.dispatch-history-detail-status {
    padding: 0.32rem 0.58rem;
    border-radius: 999px;
    background: #eaf4ff;
    color: #145fae;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}
.dispatch-history-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.dispatch-history-detail-stat { min-width: 0; padding: 0.5rem 0.6rem; border: 1px solid #dde5ed; border-radius: 9px; background: #f8fafc; }
.dispatch-history-detail-stat span { display: block; color: #6b7d90; font-size: 0.63rem; }
.dispatch-history-detail-stat strong { display: block; overflow-wrap: anywhere; color: #1b334e; font-size: 0.78rem; }
.dispatch-history-detail-section { margin-top: 0.8rem; }
.dispatch-history-detail-section > h3 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.35rem;
    color: #1b3a5e;
    font-size: 0.84rem;
}
.dispatch-history-detail-section > h3 .material-icons { color: #1769c2; font-size: 1.05rem; }
.dispatch-history-detail-output { padding: 0.65rem; border: 1px solid #b8d9bf; border-radius: 11px; background: #f4fbf6; }
.dispatch-history-output-card { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.45rem; color: #315d3b; font-size: 0.73rem; }
.dispatch-history-output-card strong { margin-right: auto; color: #173d22; font-size: 0.85rem; }
.dispatch-history-detail-table-wrap { overflow-x: auto; border: 1px solid #dde5ed; border-radius: 9px; }
.dispatch-history-detail-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 0.7rem; }
.dispatch-history-detail-table th { padding: 0.38rem 0.45rem; background: #eef3f8; color: #40566d; text-align: left; }
.dispatch-history-detail-table td { padding: 0.4rem 0.45rem; border-top: 1px solid #e4e9ef; color: #2f4359; vertical-align: top; }
.dispatch-history-detail-table td small { display: block; margin-top: 0.08rem; color: #718297; font-size: 0.62rem; }
.dispatch-history-detail-table td small.is-note { color: #80631f; }
.dispatch-history-detail-empty { margin: 0; padding: 0.65rem; color: #708196; font-size: 0.72rem; }

@media (max-width: 768px) {
    .dispatch-history-tabs { margin-bottom: 0.35rem; }
    .dispatch-history-tab { min-height: 2.35rem; border-radius: 8px; padding: 0.38rem; }
    .dispatch-history-filterbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
        padding: 0.4rem;
        border-radius: 8px;
    }
    .dispatch-history-filterbar label,
    .dispatch-history-filterbar input[type="date"] { min-width: 0; width: 100%; }
    .dispatch-history-filterbar .btn { min-height: 2.25rem; padding: 0.35rem; }
    .dispatch-history-exports {
        grid-column: 1 / 3;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0;
    }
    .dispatch-history-export { justify-content: center; padding: 0.25rem; }
    .dispatch-history-summary { margin: 0.38rem 0.2rem 0.25rem; }
    .dispatch-history-date-group { margin-bottom: 0.55rem; }
    .dispatch-history-date-group > h3 { padding: 0.35rem 0.3rem; }
    .dispatch-history-date-rows { border-left: 0; border-right: 0; border-radius: 0; }
    .dispatch-history-row { padding: 0.48rem 0.35rem; }
    .dispatch-history-order-group { margin-bottom: 0.5rem; border-left: 0; border-right: 0; border-radius: 0; }
    .dispatch-history-order-title { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0.55rem 0.4rem; }
    .dispatch-history-order-count { display: none; }
    .dispatch-history-order-copy strong { white-space: normal; }
    .dispatch-history-order-modal { padding: 0; }
    .dispatch-history-order-dialog { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
    .dispatch-history-order-dialog > header { padding: 0.55rem 0.65rem; }
    .dispatch-history-order-body { padding: 0.55rem 0.4rem 1.2rem; }
    .dispatch-history-detail-heading { padding: 0 0.15rem; }
    .dispatch-history-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dispatch-history-detail-output { border-left: 0; border-right: 0; border-radius: 0; }
    .dispatch-history-detail-table-wrap { border-left: 0; border-right: 0; border-radius: 0; }
}
/* Historial de restaurantes: hoja de consulta, sin edición de movimientos. */
.dispatch-history-sheet {overflow:auto;max-height:65vh;border:1px solid #ccd8e5;background:#fff;border-radius:6px;}
.dispatch-history-sheet table {width:100%;min-width:1050px;border-collapse:collapse;table-layout:auto;font-size:12px;}
.dispatch-history-sheet th,.dispatch-history-sheet td {padding:7px 8px;border:1px solid #dce3eb;text-align:left;vertical-align:middle;white-space:normal;word-break:normal;}
.dispatch-history-sheet th {position:sticky;top:0;background:#e7eef7;color:#163753;z-index:1;}
.dispatch-history-sheet tbody tr:nth-child(even) {background:#f4f8fc;}
.dispatch-history-sheet tbody tr:hover {background:#e1efff;}
.dispatch-history-sheet .history-number {text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;}
.dispatch-history-sheet td:nth-child(4) {min-width:210px;}
.dispatch-history-order-sheet {max-height:none;border:0;border-radius:0;}
.dispatch-history-order-sheet table {min-width:820px;}
.dispatch-history-order-sheet td:nth-child(4) {min-width:145px;}
.dispatch-history-filterbar select {min-height:40px;max-width:100%;border:1px solid #b8cbe0;border-radius:8px;padding:7px;background:white;}
.dispatch-history-filterbar [hidden] {display:none!important;}

/* Restaurant history: compact expandable spreadsheet rows, not production cards. */
[data-history-type="restaurant"] .dispatch-history-register { overflow:auto; border:1px solid #d7e0e9; background:#fff; }
body.pangu-next .content .dispatch-history-register-table { width:100%; min-width:760px; border-collapse:collapse; border-radius:0; box-shadow:none; table-layout:auto; font-family:inherit; }
body.pangu-next .content .dispatch-history-register-table caption { text-align:left; padding:.4rem .6rem; color:var(--text-secondary,#526172); font-size:var(--bodega-row-fs,.82rem); }
body.pangu-next .content .dispatch-history-register-table th,
body.pangu-next .content .dispatch-history-register-table td { padding:.25rem .6rem !important; line-height:1.3; font-size:var(--bodega-row-fs,.82rem); font-family:inherit; height:auto; text-align:left; vertical-align:middle; border:0; border-bottom:1px solid #dfe5eb; white-space:normal; word-break:normal; overflow-wrap:normal; }
body.pangu-next .content .dispatch-history-register-table th { background:#f2f5f9; }
body.pangu-next .content .dispatch-history-register-table .history-number { text-align:right !important; white-space:nowrap; font-variant-numeric:tabular-nums; }
body.pangu-next .content .dispatch-history-register-row > td { background:#f7fafc !important; cursor:pointer; }
body.pangu-next .content .dispatch-history-register-row.is-partial > td { background:#fff2f0 !important; }
body.pangu-next .content .dispatch-history-register-row:hover > td,
body.pangu-next .content .dispatch-history-register-row:focus-within > td { background:#dfedff !important; }
body.pangu-next .content .dispatch-history-register-toggle { display:inline-flex; align-items:center; gap:.45rem; padding:0 !important; min-height:0 !important; height:auto; border:0; border-radius:0; box-shadow:none; background:transparent; color:var(--google-blue,#1565c0); font:inherit; text-align:left; white-space:nowrap; cursor:pointer; }
body.pangu-next .content .dispatch-history-register-toggle > span:last-child { text-decoration:underline; }
body.pangu-next .content .dispatch-history-register-toggle [data-history-toggle-icon] { display:inline-block; width:.75rem; text-align:center; }
body.pangu-next .content .dispatch-history-register-toggle:focus-visible { outline:2px solid #1565c0; outline-offset:2px; }
body.pangu-next .content .dispatch-history-register-detail > td { padding:0 !important; background:#fff !important; }
body.pangu-next .content .dispatch-history-register-detail .dispatch-history-order-sheet { border-left:3px solid #b6cde4; }
body.pangu-next .content .dispatch-history-register-detail table { min-width:760px; width:100%; border-radius:0; box-shadow:none; }
body.pangu-next .content .dispatch-history-register-detail table caption { background:#edf3fa; font-weight:600; }
body.pangu-next .content .dispatch-history-register-detail th { position:static; }
body.pangu-next .content .dispatch-history-register-detail td:nth-child(4) { min-width:0; }
@media (max-width:768px) {
    [data-history-type="restaurant"] .dispatch-history-filterbar select { min-width:0; width:100%; }
}
/* Partial receipt controls are outside the check button: editing is not confirmation. */
#modalChecklist .receipt-row { border:1px solid #d9e2ee; border-radius:10px; padding:8px; min-width:0; }
#modalChecklist .receipt-row .keep-item { width:100%; border:0; margin:0; padding:8px; min-height:0; }
#modalChecklist .receipt-quantity-fields { display:flex; flex-wrap:wrap; align-items:end; gap:10px; padding:6px 8px; }
#modalChecklist .receipt-quantity-fields label { display:flex; flex-direction:column; gap:3px; margin:0; font-size:.85rem; }
#modalChecklist .receipt-quantity-fields input { width:105px; }
#modalChecklist .receipt-quantity-fields select { max-width:160px; }
#modalChecklist .receipt-quantity-fields input, #modalChecklist .receipt-quantity-fields select { min-height:36px; padding:6px 8px; font:inherit; }
#modalChecklist .receipt-accepted { color:#166534; padding-bottom:8px; font-weight:600; }
#modalChecklist .receipt-qr-note { display:block; margin:4px 8px; color:#53657b; font-size:.8rem; overflow-wrap:anywhere; }
#receiptReturnReasonField { display:block; margin-top:12px; }
#receiptReturnReasonField[hidden] { display:none; }
#receiptReturnReason { display:block; width:100%; box-sizing:border-box; margin-top:5px; }
.receipt-returned-info { display:block; color:#b91c1c; }
#receiptReturnReason { font: inherit; }

/* Leader receiving only: compact rows, not large cards. Other checklists retain their layout. */
body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-header {
    min-height: 0; padding: 8px 10px; gap: 6px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-header h3 {
    font-size: 16px; line-height: 1.2; min-width: 0;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-header-actions { gap: 4px; flex-wrap: nowrap; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-header button {
    width: 34px; height: 34px; min-width: 34px; min-height: 34px; flex: 0 0 34px; padding: 3px; border-radius: 7px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-export-btn img {
    width: 24px !important; height: 24px !important; min-width: 24px !important; min-height: 24px !important; flex-basis: 24px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-body { padding: 8px 10px; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-dest {
    padding: 5px 7px; margin: 0 0 4px; border-radius: 4px; font-size: 13px; line-height: 1.25;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-hint {
    font-size: 12px; line-height: 1.3; margin: 0 0 5px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist { display: block; padding: 0; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-row {
    border: 0; border-bottom: 1px solid #d9e2ee; border-radius: 0; padding: 5px 0; margin: 0;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-row .keep-item {
    min-height: 40px; padding: 3px 2px; gap: 7px; border-radius: 4px; align-items: center;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-check {
    width: 24px; height: 24px; flex-basis: 24px; font-size: 14px; margin: 0;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-title { font-size: 14px; line-height: 1.2; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-meta {
    margin-top: 2px; font-family: inherit; font-size: 12px; line-height: 1.2;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-quantity-fields {
    display: grid; grid-template-columns: 106px 84px minmax(0,1fr); gap: 6px; padding: 3px 2px 0; align-items: center;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-quantity-fields label {
    flex-direction: row; align-items: center; min-width: 0; gap: 4px; font-size: 12px; line-height: 1.2;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-unit-label .receipt-field-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-quantity-fields input,
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-quantity-fields select {
    width: 100%; min-width: 0; max-width: 100%; min-height: 34px; height: 34px; box-sizing: border-box;
    padding: 3px 4px; border: 1px solid #b9c7d9; border-radius: 5px; font: inherit; font-size: 16px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-return-qty { appearance: textfield; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-return-qty::-webkit-inner-spin-button,
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-return-qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-accepted { padding: 0; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-qr-note { margin: 2px 2px 0 33px; font-size: 11px; line-height: 1.3; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-qr-note summary { cursor: pointer; min-height: 24px; display: list-item; padding: 4px 0; box-sizing: border-box; }
body.orders-simple-leader #modalChecklist.is-compact-receipt #receiptReturnReasonField { margin-top: 5px; font-size: 12px; }
body.orders-simple-leader #modalChecklist.is-compact-receipt #receiptReturnReason { margin-top: 3px; padding: 4px; font-size: 16px; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-progress { margin: 4px 0 0; font-size: 12px; line-height: 1.3; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-footer {
    display: grid; grid-template-columns: 36px 102px minmax(0,1fr); align-items: stretch; gap: 5px; padding: 6px 8px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-footer .btn {
    min-height: 36px; min-width: 0; width: 100%; margin: 0; padding: 5px; font-size: 12px; line-height: 1.2; border-radius: 6px;
}
body.orders-simple-leader #modalChecklist.is-compact-receipt #btnChecklistAll { grid-column: 2; grid-row: 1; }
body.orders-simple-leader #modalChecklist.is-compact-receipt #btnChecklistConfirm { grid-column: 3; grid-row: 1; }
body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-footer [data-dismiss] { grid-column: 1; grid-row: 1; }
@media (min-width: 701px) {
    body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-modal:not(.is-user-resized):not(.is-maximized) {
        --modal-max: 720px;
    }
    body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-row { display: grid; grid-template-columns: minmax(0,1fr) 308px; gap: 0 8px; align-items: center; }
    body.orders-simple-leader #modalChecklist.is-compact-receipt .receipt-qr-note { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    body.orders-simple-leader #modalChecklist.is-compact-receipt .modal-header { padding-top: max(6px,env(safe-area-inset-top,0px)) !important; }
    body.orders-simple-leader #modalChecklist.is-compact-receipt .keep-checklist-footer { padding-bottom: max(6px,env(safe-area-inset-bottom,0px)); }
}

/* === 17-desktop-density.css === */
/* Shared desktop density, deliberately LAST after the visual theme.
   No zoom/transform: keep pointer coordinates, scanners and resizable dialogs intact.
   Phones/tablets (including wide touch-only landscape screens) and print are unchanged. */
@media screen and (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  /* Self-hosted narrow face: no dependency on installed Windows fonts or Google.
     Roboto Condensed, SIL OFL; see assets/fonts/roboto-condensed-OFL.txt. */
  @font-face {
    font-family: 'Pangu Narrow';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('assets/fonts/roboto-condensed-latin.woff2') format('woff2');
  }
  body.pangu-next {
    --desktop-bar-height: 52px;
    --desktop-sidebar-width: 200px;
    --desktop-data-font: 'Pangu Narrow', 'Arial Narrow', sans-serif;
    --bodega-row-fs: 10px;
    --bodega-row-lh: 1.25;
    --bodega-row-py: 2px;
    --bodega-row-px: 4px;
    --bodega-field-h: 30px;
    --bodega-field-py: 0.25rem;
    --bodega-field-px: 0.5rem;
    --bodega-field-fs: 0.8125rem;
    --bodega-form-gap: 0.45rem;
    --radius-shell: 12px;
    --radius-card: 10px;
    --radius-input: 7px;
    font-size: 0.8125rem;
    line-height: 1.3;
  }

  body.pangu-next .app-bar {
    height: var(--desktop-bar-height);
    padding-inline: 0.85rem;
  }
  body.pangu-next .app-bar-title { margin-right: 1rem; gap: 0.5rem; }
  body.pangu-next .app-bar-logo-wrap { width: 88px; height: 40px; }
  body.pangu-next .global-search-wrap { max-width: 680px; min-width: 0; }
  body.pangu-next .global-search-input { height: 32px; border-radius: 8px; font-size: 0.8125rem; }
  body.pangu-next .user-avatar { width: 30px; height: 30px; }

  /* Header, sidebar, content and collapse button share the same dimensions. */
  body.pangu-next .sidebar {
    top: var(--desktop-bar-height);
    height: calc(100dvh - var(--desktop-bar-height));
    width: var(--desktop-sidebar-width);
    padding: 0.6rem 0.5rem;
  }
  body.pangu-next .content {
    margin-left: var(--desktop-sidebar-width);
    width: calc(100% - var(--desktop-sidebar-width));
    max-width: none;
    padding: 0.8rem 1rem 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.3;
  }
  body.pangu-next .sidebar-collapse-toggle {
    top: calc(var(--desktop-bar-height) + 12px);
    left: calc(var(--desktop-sidebar-width) - 16px);
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
  }
  html.sidebar-collapsed body.pangu-next { --desktop-sidebar-width: 60px; }
  html.sidebar-collapsed body.pangu-next .sidebar { width: var(--desktop-sidebar-width); }
  html.sidebar-collapsed body.pangu-next .content {
    margin-left: var(--desktop-sidebar-width);
    width: calc(100% - var(--desktop-sidebar-width));
  }
  html.sidebar-collapsed body.pangu-next .sidebar-collapse-toggle {
    left: calc(var(--desktop-sidebar-width) - 16px);
  }
  body.pangu-next .sidebar-nav a,
  html.sidebar-collapsed body.pangu-next .sidebar-nav a {
    min-height: 34px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8125rem;
  }
  body.pangu-next .sidebar-group-summary { min-height: 32px; padding: 0.4rem 0.5rem; }
  body.pangu-next .sidebar-group-links a { min-height: 32px; padding: 0.35rem 0.5rem; }
  body.pangu-next .sidebar-nav a .material-icons { font-size: 19px; }

  body.pangu-next .content h2 { font-size: 1.2rem; margin: 0.5rem 0; }
  body.pangu-next .content > h2:first-of-type,
  body.pangu-next .content .calidad-page > h2:first-of-type {
    font-size: 1.3rem;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.65rem;
  }
  body.pangu-next .content :is(h3, h4) { font-size: 0.95rem; }
  body.pangu-next .content .card { padding: 0.55rem 0.65rem; border-radius: 10px; }
  body.pangu-next .cards { gap: 0.6rem; margin-bottom: 0.65rem; }
  body.pangu-next .mb1 { margin-bottom: 0.6rem; }
  body.pangu-next .form-group { margin-bottom: 0.45rem; }
  body.pangu-next .form-group label { margin-bottom: 0.2rem; }
  body.pangu-next .form-grid-2 { gap: 0.45rem 0.75rem; }
  body.pangu-next :is(.content, .modal-content, .modal-panel, .seller-modal-panel, .if-modal-box, .att-modal)
    :is(input:not([type]), input[type="text"], input[type="search"], input[type="number"],
        input[type="date"], input[type="datetime-local"], input[type="time"], input[type="email"],
        input[type="tel"], input[type="password"], input[type="url"], select:not([multiple]):not([size])) {
    min-height: var(--bodega-field-h);
    height: var(--bodega-field-h);
    padding: var(--bodega-field-py) var(--bodega-field-px);
    font-size: var(--bodega-field-fs);
    line-height: 1.25;
    border-radius: var(--radius-input);
  }
  body.pangu-next .form-group textarea { font-size: var(--bodega-field-fs); padding: 0.4rem 0.5rem; }
  body.pangu-next button,
  body.pangu-next .btn {
    min-height: 30px;
    padding: 0.3rem 0.65rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    border-radius: 7px;
  }
  body.pangu-next :is(.content, .modal-content) table :is(th, td) {
    padding: var(--bodega-row-py) var(--bodega-row-px);
    font-size: var(--bodega-row-fs);
    line-height: var(--bodega-row-lh);
  }
  body.pangu-next .content .filter-row { flex-wrap: wrap; gap: 0.4rem 0.6rem; }
  body.pangu-next .report-export-actions .btn { display: inline-flex; align-items: center; gap: 0.3rem; }
  body.pangu-next .report-export-actions .btn img { width: 22px; height: 22px; }

  /* Navigation and role dashboards: denser cards, without changing actions or colors. */
  body.pangu-next .modules-page { max-width: none; }
  body.pangu-next .modules-heading { padding: 0.7rem 0.85rem; margin-bottom: 0.75rem; border-radius: 10px; }
  body.pangu-next .modules-heading h2 { font-size: 1.3rem; margin: 0; }
  body.pangu-next .modules-heading-icon { width: 36px; height: 36px; border-radius: 9px; }
  body.pangu-next :is(.modules-overview, .modules-card-grid) {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.6rem;
  }
  body.pangu-next :is(.module-overview-card, .module-action-card) {
    min-height: 58px; padding: 0.65rem 0.75rem; gap: 0.6rem; border-radius: 10px;
  }
  body.pangu-next .module-card-icon { width: 32px; height: 32px; border-radius: 8px; }
  body.pangu-next .module-card-copy strong { font-size: 0.85rem; }
  body.pangu-next .modules-section { margin-top: 0.8rem; }
  body.pangu-next .modules-section > p { margin-bottom: 0.5rem; }
  body.pangu-next .home-role-task-dash { max-width: 1100px; }
  body.pangu-next .home-role-task-head { padding: 0.6rem 0.8rem; margin-bottom: 0.65rem; border-radius: 10px; }
  body.pangu-next .home-role-task-head > .material-icons { width: 36px; height: 36px; flex-basis: 36px; font-size: 24px; }
  body.pangu-next .home-role-primary-grid { gap: 0.6rem; margin-bottom: 0.6rem; }
  body.pangu-next .content a.home-role-task { min-height: 76px; padding: 0.7rem 0.8rem; gap: 0.6rem; border-radius: 12px; }
  body.pangu-next .home-role-task strong { font-size: 0.95rem; }
  body.pangu-next .home-role-task > .material-icons:first-child { font-size: 26px; }
  body.pangu-next .content .home-role-secondary-grid a { min-height: 40px; padding: 0.45rem 0.65rem; border-radius: 8px; }

  /* Keep normal/scanner dialogs sized to their task; expand only data dialogs.
     User-resized and maximized windows retain their existing sizing behavior. */
  body.pangu-next :is(.modal-content, .seller-modal-panel, .modal-panel, .if-modal-box, .att-modal)
    .modal-header { padding: 0.5rem 0.7rem; margin-bottom: 0; }
  body.pangu-next .modal-header h3 { font-size: 1rem; white-space: normal; }
  body.pangu-next .modal-body { padding: 0.6rem 0.75rem; }
  body.pangu-next .modal-footer { padding: 0.5rem 0.7rem; margin-top: 0; gap: 0.45rem; }
  body.pangu-next :is(.modal-content, .seller-modal-panel, .modal-panel, .if-modal-box, .att-modal)
    .modal-close,
  body.pangu-next button.modal-max-btn,
  body.pangu-next button.modal-export-btn {
    width: 32px; height: 32px; min-width: 32px; min-height: 32px; flex-basis: 32px; padding: 0.2rem;
  }
  body.pangu-next .modal-export-btn :is(svg, img) {
    width: 24px !important; height: 24px !important;
    min-width: 24px !important; min-height: 24px !important; flex-basis: 24px;
  }
  body.pangu-next :is(.modal-content, .seller-modal-panel, .modal-panel, .if-modal-box, .att-modal).is-desktop-data-modal:not(.is-maximized):not(.is-user-resized) {
    --modal-max: min(1360px, calc(100vw - 32px));
    width: min(1360px, calc(100vw - 32px)) !important;
    max-width: min(1360px, calc(100vw - 32px)) !important;
    max-height: calc(100dvh - 24px) !important;
  }

  /* Product and warehouse filters side by side, with their labels kept visible. */
  body.pangu-next .kardex-filter-card:has(.kardex-warehouse-filter:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0.25rem 1rem;
  }
  body.pangu-next .kardex-filter-heading { margin-bottom: 0; }
  body.pangu-next .kardex-product-picker { width: 100%; grid-column: 1; }
  body.pangu-next .kardex-warehouse-filter:not([hidden]) { grid-column: 2; grid-row: 1 / 3; margin-top: 0; max-width: none; }
  body.pangu-next .kardex-warehouse-filter label { min-height: 30px; display: flex; align-items: center; margin-bottom: 0.25rem; }
  body.pangu-next .kardex-warehouse-filter p { margin: 0.25rem 0 0; font-size: 0.75rem; }
  body.pangu-next .kardex-scope-note { padding: 0.35rem 0.5rem; margin: 0.4rem 0; }

  /* Physical count: quantity and its unit share a single compact line.
     Keep the existing labels, input order, conversions and mobile layout. */
  body.pangu-next #countTable .count-entry-fields {
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    max-width: none;
  }
  body.pangu-next #countTable .count-entry-field {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 0.3rem;
    min-width: 0;
    margin: 0;
  }
  body.pangu-next #countTable .count-entry-field span { white-space: nowrap; }
  body.pangu-next #countTable .count-entry-field input {
    flex: 0 0 48px;
    width: 48px;
    height: 24px;
    min-height: 24px;
    padding: 2px 4px;
  }
  body.pangu-next #countTable th { white-space: nowrap; word-break: normal; }
  body.pangu-next #countTable :is(th, td):nth-child(4) { min-width: 6rem; }
  body.pangu-next #countTable td { vertical-align: middle; }

  /* Data density only: navigation, headings and scanning dialogs remain legible.
     IDs cover legacy page-owned rules with fixed/minimum column widths. Auto
     layout shares remaining space by content, including expanded/nested tables.
     Never crop data or suppress scrollbars to conceal an overflowing table. */
  body.audit-density.pangu-next :is(table, #miListTable, #hubMovTable, #ordersMainTable, #facturasTable) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
    font-family: var(--desktop-data-font) !important;
    font-size: 10px !important;
  }
  body.audit-density.pangu-next .content table#facturasTable.facturas-table {
    min-width: 0 !important;
  }
  body.audit-density.pangu-next :is(table, #miListTable, #hubMovTable, #ordersMainTable, #facturasTable) :is(col, th, td) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  body.audit-density.pangu-next :is(table, #miListTable, #hubMovTable, #ordersMainTable, #facturasTable) :is(th, td) {
    height: auto !important;
    padding: 2px 4px !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  body.audit-density.pangu-next :is(table, #miListTable, #hubMovTable, #ordersMainTable, #facturasTable) tr {
    height: auto !important;
  }
  body.audit-density.pangu-next :is(table, #miListTable, #hubMovTable, #ordersMainTable, #facturasTable)
    :is(th, td, a, button, input, select, textarea, span, div, small, strong, b, label, time, code, output, p):not(.material-icons):not(.material-icons-outlined) {
    font-family: var(--desktop-data-font) !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    letter-spacing: normal !important;
  }
  body.audit-density.pangu-next table :is(td, th) :is(a, span, div, strong, small, p):not(.material-icons):not(.material-icons-outlined) {
    min-width: 0 !important;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
  }
  body.audit-density.pangu-next :is(table, .det-grid) :is(button, .btn, .stock-lots-chip) {
    min-width: 0 !important;
    min-height: 24px !important;
    height: auto !important;
    padding: 2px 4px !important;
    gap: 2px !important;
    margin-block: 0 !important;
    border-radius: 4px;
    white-space: normal !important;
  }
  body.audit-density.pangu-next :is(table, .det-grid) :is(.btn-act-icon, .link-act-icon, .stock-expand-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 2px !important;
  }
  body.audit-density.pangu-next table .badge:not(button):not(a) {
    min-height: 0; padding: 1px 3px; gap: 2px;
  }
  body.audit-density.pangu-next table :is(.actions, .actions-cell, .table-actions, .mi-actions, .row-actions) {
    white-space: normal !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
  }
  body.audit-density.pangu-next :is(table, .det-grid) :is(.material-icons, .material-icons-outlined) {
    font-size: 12px !important;
    width: 12px !important;
    min-width: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
    flex: 0 0 12px !important;
    vertical-align: middle;
  }
  /* Keep real images/QR codes intact; shrink only identified action artwork. */
  body.audit-density.pangu-next :is(table, .det-grid) :is(.btn-act-icon, .link-act-icon, .btn-icon, .icon-only, .action-icon) :is(img, svg) {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    flex: 0 0 14px !important;
  }
  body.audit-density.pangu-next table :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 24px !important;
    padding: 2px 4px !important;
    margin-block: 0 !important;
  }
  body.audit-density.pangu-next table :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select:not([multiple]):not([size])) {
    height: 24px !important;
  }
  body.audit-density.pangu-next table :is(input[type="checkbox"], input[type="radio"]) {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    margin: 3px;
  }
  body.audit-density.pangu-next table :is(.col-expand, .col-select, .col-f-check) {
    width: 24px !important;
  }
  body.audit-density.pangu-next #countTable .count-entry-field input { width: 48px; }
  body.audit-density.pangu-next #countTable .count-entry-field span { white-space: nowrap !important; }
  body.audit-density.pangu-next #countTable th { white-space: nowrap !important; }

  /* Order detail is a CSS grid, not a table. Preserve its optional columns:
     4 base columns, up to 7 with stock/availability/OCI or delivered/difference. */
  body.audit-density.pangu-next .det-grid {
    --desktop-detail-columns: 3;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 2.4fr) repeat(var(--desktop-detail-columns), minmax(0, 1fr)) !important;
  }
  body.audit-density.pangu-next .det-grid:has(> .dg-head:nth-child(5)) { --desktop-detail-columns: 4; }
  body.audit-density.pangu-next .det-grid:has(> .dg-head:nth-child(6)) { --desktop-detail-columns: 5; }
  body.audit-density.pangu-next .det-grid:has(> .dg-head:nth-child(7)) { --desktop-detail-columns: 6; }
  body.audit-density.pangu-next .det-grid,
  body.audit-density.pangu-next .det-grid :is(div, span, a, button, small, strong):not(.material-icons) {
    font-family: var(--desktop-data-font) !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
  body.audit-density.pangu-next .det-grid > div {
    padding: 2px 4px !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    align-content: center;
  }

  /* Numbers outside tables: totals, stock summaries, amount inputs and KPIs. */
  body.audit-density.pangu-next :is(input[type="number"], .stat-value, .kpi-value, .hub-kpi-value,
    .home-role-count, .card .big, .stock-sistema, .qty-value, .amount, .money, .numeric,
    .kardex-product-info, .stock-consolidated-scope-badge),
  body.audit-density.pangu-next #dashboardIndicators .card .big {
    font-family: var(--desktop-data-font) !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    font-variant-numeric: tabular-nums;
  }
  body.audit-density.pangu-next .home-role-count {
    min-width: 24px; width: auto; height: 24px; flex-basis: 24px; padding: 3px;
  }
}

