/* === 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 — compacta (más filas visibles) */
  --bodega-row-py: 0.14rem;
  --bodega-row-px: 0.38rem;
  --bodega-row-fs: 0.78rem;
  --bodega-row-lh: 1.06;
  --bodega-field-h: 1.72rem;
  --bodega-field-py: 0.16rem;
  --bodega-field-px: 0.38rem;
  --bodega-field-fs: 0.78rem;
  --bodega-form-gap: 0.28rem;
}

* { 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: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  transform: translateZ(0);
  -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.28rem 0.65rem;
  border-radius: var(--radius-input);
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  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;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.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: 48px;
  height: 48px;
  border-radius: 50%;
  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;
}
.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;
}
.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);
  z-index: 10200;
}
.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;
  z-index: 10190;
}

.content {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 0.65rem 0.9rem;
  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 0.5rem;
  padding: 0.5rem 0.8rem;
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  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.35rem;
  margin-bottom: 0.45rem;
}

.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.45rem 0.6rem;
  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 {
  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 {
  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 {
  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 {
  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.72rem;
  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 === */
/* 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 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-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; }
.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-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-recipe-req-banner {
  font-size: 0.76rem;
  line-height: 1.25;
  padding: 0.28rem 0.45rem;
  margin: 0.2rem 0 0.28rem;
  background: #f1f8ff;
  border: 1px solid #cfe3fc;
  border-radius: 4px;
}
.po-recipe-req-banner strong { color: var(--text-primary); }
.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-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-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-detail { padding:0.35rem 0 0.15rem; }
.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: flex-start; gap: 0.4rem; padding: 0.4rem 0.55rem; margin-bottom: 0.45rem; background: var(--google-blue-tint); border: 1px solid var(--google-blue-light); border-radius: 6px; font-size: 0.82rem; line-height: 1.25; }
.po-order-goal .material-icons { color: var(--text-primary); font-size: 1.15rem; flex-shrink: 0; }
.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: 22%; }
.po-data-table--supplies col.po-col-ref { width: 11%; }
.po-data-table--supplies col.po-col-st { width: 9%; }
.po-data-table--supplies col.po-col-qty { width: 9%; }
.po-data-table--supplies col.po-col-unit { width: 10%; }
.po-data-table--supplies col.po-col-act { width: 3.5rem; }
.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;
}
@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: column; font-size: 0.8425rem; padding: 0.38rem 0.45rem; margin-bottom: 0.35rem; }
  .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-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: wrap;
    align-items: stretch;
    gap: 0.5rem;
  }
  .po-workspace-head-main { flex: 1 1 100%; }
  .po-workspace-head-actions {
    flex: 1 1 100%;
    justify-content: stretch;
  }
  .po-workspace-head-actions .btn { flex: 1 1 calc(50% - 0.2rem); justify-content: center; min-width: 0; }
  .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-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: column; }
  .po-workspace-head-actions .btn { flex: 1 1 auto; width: 100%; }
  .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;
  background: rgba(11, 25, 40, 0.78);
  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);
  align-items: center;
  overflow: auto;
}
/* Ventanas flotantes angostas por defecto (lectura cómoda en escritorio). */
.modal-content {
  --modal-max: 520px;
  background: var(--white);
  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: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  border: none;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  box-sizing: border-box;
}
.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: 700px;
  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: 860px;
  width: min(var(--modal-max), calc(100vw - 2rem)) !important;
  max-width: min(var(--modal-max), calc(100vw - 2rem)) !important;
}
.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: linear-gradient(180deg, var(--google-blue-tint) 0%, var(--bg-base) 100%);
  border-bottom: 2px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}
.modal-close {
  background: #fff;
  border: 1px solid var(--google-blue-light);
  border-radius: 8px;
  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: var(--google-blue-tint); border-color: var(--google-blue-light); }
.modal-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.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; }

/* 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-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.78rem;
    --bodega-row-lh: 1.06;
    --bodega-row-py: 0.14rem;
    --bodega-row-px: 0.38rem;
    --bodega-field-fs: 0.78rem;
    --bodega-field-h: 1.72rem;
    --bodega-field-py: 0.16rem;
    --bodega-field-px: 0.38rem;
    --bodega-form-gap: 0.28rem;
  }

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

  .modal-summary,
  .order-detail-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 0.85rem;
    padding: 0.35rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
    border-bottom: 1px solid #e8eaed;
    overflow: visible;
  }
  .modal-summary-line,
  .order-detail-line {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    padding: 0;
    border-bottom: none;
    align-items: baseline;
  }
  .invoice-detail-grid,
  .report-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 0.85rem;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
  .invoice-detail-field {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    padding: 0;
    border-bottom: none;
    align-items: baseline;
  }
  .invoice-detail-label { font-size: 0.78rem; font-weight: 700; }
  .invoice-detail-value,
  .order-detail-value { font-size: 0.8rem; }
  .order-detail-section-title,
  .invoice-detail-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--blue);
  }
  .modal-summary-label,
  .order-detail-label {
    font-size: 0.78rem;
  }
  .modal-summary-value,
  .order-detail-value {
    font-size: 0.8rem;
  }
  .app-bar {
    height: 46px;
    padding: 0 0.65rem;
  }
  .content {
    padding: 0.4rem 0.7rem;
    max-width: none;
    font-size: 0.78rem;
    line-height: 1.15;
  }
  .content h2 {
    margin: 0.4rem 0 0.3rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  .content > h2:first-of-type,
  .content .calidad-page > h2:first-of-type {
    margin: 0 0 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 1.08rem;
    font-weight: 700;
  }
  .flex-between {
    margin-bottom: 0.35rem;
    gap: 0.28rem;
  }
  .cards {
    gap: 0.3rem;
    margin-bottom: 0.5rem;
  }
  .card {
    padding: 0.32rem 0.45rem;
    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.14rem 0.38rem;
    line-height: 1.06;
  }
  /* 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 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: 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-row:nth-child(1),
  .content .orders-filters .filter-row:nth-child(2) {
    flex: 0 0 9.5rem;
    max-width: 10.5rem;
  }
  .content .orders-filters .filter-row:nth-child(3) {
    flex: 0 0 11rem;
    max-width: 13rem;
  }
  .content .orders-filters .filter-row:nth-child(4) {
    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.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
  }
  .btn-sm {
    padding: 0.18rem 0.42rem;
    font-size: 0.74rem;
  }
  .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.2rem 0.5rem !important;
    font-size: 0.76rem;
    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.14rem 0.36rem;
    font-size: 0.78rem;
    line-height: 1.06;
  }
  .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;
  }
}


/* === 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.8rem;
    --bodega-row-lh: 1.06;
    --bodega-row-py: 0.12rem;
    --bodega-row-px: 0.32rem;
    --bodega-field-fs: 0.84rem;
    --bodega-field-h: 1.75rem;
    --bodega-field-py: 0.18rem;
    --bodega-form-gap: 0.26rem;
  }
  body { font-size: 16px; }
  .content {
    padding: 0.55rem 0.75rem;
    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.4rem;
    padding: 0.25rem 0;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.12;
    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.28rem;
    padding: 0.28rem 0.38rem;
  }
  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 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, 520px), calc(100vw - 1.3rem)) !important;
    max-width: min(var(--modal-max, 520px), calc(100vw - 1.3rem)) !important;
    height: auto !important;
    max-height: 88dvh !important;
    margin: 0 auto;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !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;
  }
  .modal .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, 520px), calc(100vw - 1.3rem)) !important;
    max-width: min(var(--modal-max, 520px), 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.22rem 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.28rem;
  align-items: center;
  padding: 0.28rem 0.38rem;
  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;
  min-height: 2rem;
  padding: 0.22rem 0.36rem !important;
  line-height: 1;
  vertical-align: middle;
}
.btn-act-icon .material-icons,
.link-act-icon .material-icons {
  font-size: 1.15rem !important;
  margin: 0;
  vertical-align: middle;
}
.bodega-brand-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.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.2rem;
}
.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;
  }
}


/* === 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: 100%;
    table-layout: auto;
  }
  .hub-page.home-unified .hub-panel-wide #hubMovTable th,
  .hub-page.home-unified .hub-panel-wide #hubMovTable td {
    padding: 0.28rem 0.35rem;
    font-size: 0.74rem;
  }
  .hub-page.home-unified .hub-panel-wide #hubMovTable td.hub-mov-dea {
    max-width: none;
    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: rejilla 3 cols (gana sobre flex !important de escritorio en este viewport) */
  .hub-page.home-unified .home-unified-stats-full .cards.dashboard-cards.dashboard-cards-narrow {
    display: grid !important;
    grid-template-columns: repeat(3, 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: 10rem;
  white-space: normal;
  font-size: 0.72rem;
  line-height: 1.2;
  word-wrap: break-word;
}
.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) — más ancho para leer tablas de productos */
#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: min(960px, calc(100vw - 1.5rem)) !important;
  max-width: min(960px, calc(100vw - 1.5rem)) !important;
  height: auto !important;
  max-height: min(90dvh, calc(100dvh - 1.25rem)) !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;
  display: flex;
  flex-direction: column;
}
#hubMovDetailModal .modal-header {
  padding: 0.45rem 0.65rem;
  border-bottom-width: 1px;
  gap: 0.35rem;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}
#hubMovDetailModal .modal-header h3 {
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: 700;
}
#hubMovDetailModal .modal-close {
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0.1rem 0.28rem;
  font-size: 1.15rem;
  line-height: 1;
}
#hubMovDetailModal .modal-body {
  padding: 0.45rem 0.65rem 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#hubMovDetailModal .modal-footer {
  padding: 0.4rem 0.65rem;
  gap: 0.35rem;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  border-radius: 0 0 12px 12px;
}
#hubMovDetailModal .modal-footer .btn {
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.15;
}
.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 recepción / OCI / pedido — producto con más espacio */
#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: 44%;
  min-width: 10rem;
  white-space: normal;
  word-break: break-word;
}
#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: 14%; }
#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: 14%; }
#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: 28%; }
/* 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;
}
@media (max-width: 600px) {
  .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;
  }
}

/* —— 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;
  }
  body.role-transportista .ops-bottom-nav {
    top: calc(64px + env(safe-area-inset-top, 0px));
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid #e3e8ef;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    z-index: 90;
    padding: 0.3rem 0.25rem 0.35rem;
  }
  body.role-transportista:has(.ops-bottom-nav) .content,
  body.role-transportista:has(.ops-bottom-nav) main.content {
    padding-top: 4.85rem !important;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px)) !important;
  }
}

body.role-simple-shell .sidebar-nav > a {
  font-size: 1.02rem;
  padding: 0.72rem 0.9rem;
  font-weight: 600;
}
body.role-simple-shell .ops-home-flow-sub {
  display: none;
}

.home-driver-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (max-width: 900px) {
  body.role-transportista .home-driver-stack > .cards.dashboard-cards {
    order: -2;
  }
  body.role-transportista .home-driver-stack > .ops-home-flow {
    order: -1;
  }
}

/* —— 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 (≥1400px): aprovechar ancho, tarjetas legibles —— */
@media (min-width: 1400px) {
  .ops-pipeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .ops-pipeline-col {
    min-height: 11rem;
    border-radius: 10px;
  }
  .ops-pipeline-col header {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }
  .ops-pipeline-col-body {
    padding: 0.45rem;
    gap: 0.4rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact {
    padding: 0.55rem 0.6rem;
    gap: 0.3rem;
    border-radius: 8px;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head {
    gap: 0.4rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head .material-icons {
    font-size: 1.35rem;
    padding: 0.2rem;
    border-radius: 6px;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head strong {
    font-size: 0.9rem;
    line-height: 1.2;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head small {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  .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.75rem;
    padding: 0.12rem 0.4rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-actions {
    gap: 0.3rem;
    margin-top: 0.15rem;
  }
  .ops-pipeline-col .ops-order-card.is-compact .btn-sm {
    font-size: 0.8rem;
    padding: 0.28rem 0.55rem;
    line-height: 1.25;
  }

  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
  }
  .ops-order-card,
  .ops-mi-card {
    padding: 0.7rem 0.75rem;
    gap: 0.35rem;
    border-radius: 10px;
  }
  .ops-order-card-head .material-icons,
  .ops-mi-card-head .material-icons {
    font-size: 1.4rem;
    padding: 0.2rem;
  }
  .ops-order-card-head strong,
  .ops-mi-card-head strong {
    font-size: 0.95rem;
  }
  .ops-order-card-head small,
  .ops-mi-card-head small {
    font-size: 0.78rem;
  }
  .ops-order-card-status .badge,
  .ops-mi-card-meta {
    font-size: 0.78rem;
  }
  .ops-order-card-actions .btn-sm,
  .ops-mi-card-actions .btn-sm {
    font-size: 0.8rem;
    padding: 0.28rem 0.55rem;
  }

  .stock-visual-board {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.65rem;
  }
  .stock-loc-card {
    padding: 0.7rem 0.75rem;
    gap: 0.35rem;
  }
  .stock-loc-card-head .material-icons {
    font-size: 1.45rem;
    padding: 0.2rem;
  }
  .stock-loc-card-head strong {
    font-size: 0.92rem;
  }
  .stock-camion-visual {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.55rem;
  }
  .stock-camion-tile {
    padding: 0.55rem 0.6rem;
    min-height: 5rem;
  }
  .stock-camion-tile strong {
    font-size: 0.85rem;
  }
  .stock-camion-tile .qty {
    font-size: 1.1rem;
  }
}

/* Ultra-wide: más columnas fluidas (sin achicar tipografía ni tope fijo) */
@media (min-width: 1800px) {
  .ops-pipeline {
    gap: 0.65rem;
  }
  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  .stock-visual-board {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
  .stock-camion-visual {
    grid-template-columns: repeat(auto-fill, minmax(170px, 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,
  .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.facturas-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: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.25 !important;
    max-height: calc(1.25em * 2 + 0.7rem);
    vertical-align: top;
  }
}

/* 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.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border, #e8eaed);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  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-wide-desktop.css === */
/*
 * Pantallas anchas (≥1400px CSS — p.ej. monitor 25" a 1920×1080 con zoom 100%).
 * En laptops 13" la misma resolución suele ir con escalado 125–150% → viewport
 * CSS menor y estas reglas no aplican; el layout base ya se ve bien ahí.
 *
 * Objetivo: aprovechar el ancho (tarjetas/tablas legibles), no encoger ni
 * dejar huecos con max-width agresivos.
 */
@media (min-width: 1400px) {
  html {
    font-size: 16px;
  }

  :root {
    --bodega-row-fs: 0.82rem;
    --bodega-row-lh: 1.12;
    --bodega-row-py: 0.2rem;
    --bodega-row-px: 0.45rem;
    --bodega-field-fs: 0.82rem;
    --bodega-field-h: 1.85rem;
  }

  body.audit-density .content {
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .content {
    padding: 0.75rem 1.15rem;
  }

  .content > h2:first-of-type,
  .content .calidad-page > h2:first-of-type {
    font-size: 1.2rem;
    padding: 0.55rem 0.9rem;
  }

  .content h2:not(:first-of-type) {
    font-size: 1.08rem;
  }

  .content h3 {
    font-size: 1rem;
  }

  /* Tarjetas: llenan el ancho disponible */
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    justify-content: stretch;
    gap: 0.65rem;
  }

  .card {
    max-width: none;
  }

  .card h3 {
    font-size: 0.92rem;
  }

  .card .big {
    font-size: 1.45rem;
  }

  /* Indicadores del inicio: una fila que crece, sin cajitas minúsculas */
  .cards.dashboard-cards.dashboard-cards-narrow {
    flex-wrap: nowrap;
    overflow-x: auto;
    row-gap: 0.5rem;
    gap: 0.55rem;
  }

  .dashboard-cards-narrow a.card-link {
    flex: 1 1 0;
    max-width: none;
    min-width: 8.5rem;
    min-height: 3.1rem;
    padding: 0.45rem 0.65rem;
  }

  .dashboard-cards-narrow .card h3 {
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .dashboard-cards-narrow .card .big {
    font-size: 1.35rem;
  }

  .hub-page.home-unified .home-unified-stats-full .dashboard-cards-narrow a.card-link {
    flex: 1 1 0;
    max-width: none;
    min-width: 8.5rem;
  }

  .hub-page.home-unified .home-unified-stats-full .dashboard-cards-narrow a.card-link .big {
    font-size: 1.35rem;
  }

  /* Paneles hub / tiles: columnas fluidas */
  .hub-grid:not(.hub-grid-stock-triple) {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    justify-content: stretch;
    gap: 0.75rem;
  }

  .hub-page.home-unified .hub-tiles {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    justify-content: stretch;
    gap: 0.55rem;
  }

  .hub-page.home-unified .hub-tile {
    min-height: 3.75rem;
    font-size: 0.88rem;
  }

  /* Tablas: más aire en celdas; truncado solo en columnas muy largas */
  .content table .col-truncate {
    max-width: 36ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .content table.bodega-auto-skip .col-truncate {
    max-width: 36ch;
  }

  /* Pedidos / MI / stock visual: tarjetas más grandes y fluidas */
  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    justify-content: stretch;
    gap: 0.65rem;
  }

  .ops-order-card,
  .ops-mi-card {
    padding: 0.7rem 0.75rem;
    gap: 0.35rem;
  }

  .ops-order-card-head strong,
  .ops-mi-card-head strong {
    font-size: 0.95rem;
  }

  .ops-order-card-head small,
  .ops-mi-card-head small {
    font-size: 0.78rem;
  }

  /* Pedidos tabla: fila de una línea, columnas a todo el ancho */
  .content table.orders-main-table th.col-num,
  .content table.orders-main-table td.col-num { width: 6%; }
  .content table.orders-main-table th.col-rest,
  .content table.orders-main-table td.col-rest { width: 7%; }
  .content table.orders-main-table th.col-status,
  .content table.orders-main-table td.col-status { width: 36%; }
  .content table.orders-main-table th.col-date,
  .content table.orders-main-table td.col-date { width: 7%; }
  .content table.orders-main-table th.col-actions,
  .content table.orders-main-table td.col-actions { width: 44%; }
  .orders-main-table .order-status-line .badge {
    font-size: 0.92rem !important;
  }
  .orders-main-table .order-actions-stack,
  .orders-main-table .order-actions-receive {
    flex-wrap: nowrap;
  }

  .ops-pipeline {
    gap: 0.55rem;
  }

  .ops-pipeline-col .ops-order-card.is-compact {
    padding: 0.55rem 0.6rem;
  }

  .ops-pipeline-col .ops-order-card.is-compact .ops-order-card-head strong {
    font-size: 0.9rem;
  }

  .ops-pipeline-col .ops-order-card.is-compact .btn-sm {
    font-size: 0.8rem;
    padding: 0.28rem 0.55rem;
  }

  .stock-visual-board {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    justify-content: stretch;
    gap: 0.65rem;
  }

  .stock-loc-card {
    padding: 0.7rem 0.75rem;
  }

  .stock-loc-card-head strong {
    font-size: 0.92rem;
  }

  .stock-camion-visual {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    justify-content: stretch;
    gap: 0.55rem;
  }

  .stock-camion-tile {
    min-height: 5rem;
    padding: 0.55rem 0.6rem;
  }

  .stock-camion-tile strong {
    font-size: 0.85rem;
  }

  .stock-camion-tile .qty {
    font-size: 1.1rem;
  }
}

/* Ultra-ancho (≥1800px CSS): más columnas, sin achicar tipografía */
@media (min-width: 1800px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  }

  .hub-grid:not(.hub-grid-stock-triple) {
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  }

  .ops-orders-board,
  .ops-mi-board {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .stock-visual-board {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }

  .stock-camion-visual {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

/* === 13-global-compact.css === */
/*
 * Densidad global — más filas y controles visibles en pantalla.
 * Carga al final para unificar overrides dispersos en módulos.
 */

/* Espaciado vertical entre bloques */
.mb1 { margin-bottom: 0.45rem; }
.mb2 { margin-bottom: 0.65rem; }
.mt1 { margin-top: 0.45rem; }

.section-desc,
.page-sub,
.subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.filter-row {
  gap: 0.28rem 0.45rem;
  margin-bottom: 0.35rem;
}

.filter-row label {
  font-size: 0.74rem;
  margin-bottom: 0.06rem;
}

.filter-badge {
  margin-bottom: 0.35rem;
  font-size: 0.76rem;
}

/* Pestañas de filtro — incluye estilos inline en facturas.php */
.filter-tabs {
  gap: 0.25rem;
  padding: 0.24rem 0.32rem;
  margin-bottom: 0.35rem;
}

a.filter-tab,
.filter-tab {
  padding: 0.2rem 0.48rem !important;
  font-size: 0.76rem;
  line-height: 1.15;
  border-radius: 6px;
}

/* Tablas: filas más bajas */
body.audit-density th,
body.audit-density td {
  padding: var(--bodega-row-py) var(--bodega-row-px);
  line-height: var(--bodega-row-lh);
}

.content table + .pagination-bar,
.content .card + .pagination-bar,
.content .filter-tabs + table {
  margin-top: 0.35rem;
}

.bodega-sheet-pagination-info,
.bodega-sheet-page-label,
.pagination-bar .muted {
  font-size: 0.76rem;
  line-height: 1.1;
}

/* Badges y chips en tablas */
.badge {
  padding: 0 0.22rem;
  font-size: 0.62rem;
  line-height: 1.05;
}

body.audit-density table .badge {
  padding: 0 0.2rem;
  font-size: 0.6rem;
  line-height: 1.05;
}

/* Botones de acción en tablas */
body.audit-density table .btn-sm,
body.audit-density table .btn-act-icon {
  padding: 0.08rem 0.22rem;
  min-width: 0.95rem;
}

/* Formularios inline en tablas */
body.audit-density table input:not([type="checkbox"]):not([type="radio"]),
body.audit-density table select {
  min-height: 1.55rem;
  padding: 0.1rem 0.28rem;
  font-size: 0.76rem;
  line-height: 1.05;
}

/* Modales */
.modal-header {
  margin-bottom: 0.35rem;
  padding-bottom: 0.25rem;
}

.modal-content {
  padding: 0.5rem 0.65rem;
}

.modal-footer {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  gap: 0.35rem;
}

/* Mensajes y alertas */
.msg {
  padding: 0.32rem 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.76rem;
  line-height: 1.2;
}

.card-hint {
  font-size: 0.72rem;
  margin-top: 0.1rem;
  line-height: 1.15;
}

/* Hub / operaciones */
.hub-sub {
  font-size: 0.76rem;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

@media (min-width: 769px) {
  .content .card {
    margin-bottom: 0.35rem;
  }

  .content table {
    margin-bottom: 0.25rem;
  }

  .form-group {
    margin-bottom: var(--bodega-form-gap);
  }

  .form-group label {
    margin-bottom: 0.06rem;
  }
}

/* === 14-driver-route.css === */
/* Perfil transportista: dos entradas, origen→destino, checklist Keep */
body.driver-route-page {
  --driver-min-tap: 48px;
  --keep-paper: #fffdf6;
  --keep-line: #ece8dc;
  background: var(--bg-base);
}
body.driver-route-page .layout {
  min-height: 100vh;
  min-height: 100dvh;
}
body.driver-route-page .driver-app-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 56px;
  padding: 0.5rem 0.75rem;
  padding-top: max(0.5rem, env(safe-area-inset-top));
  background: var(--gradient-app-bar);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
body.driver-route-page .driver-app-bar .driver-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}
body.driver-route-page .driver-app-meta { flex: 1; min-width: 0; }
body.driver-route-page .driver-app-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.driver-route-page .driver-net {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
}
body.driver-route-page .driver-net .material-icons { font-size: 16px; }
body.driver-route-page .driver-net.is-off { color: var(--brand-yellow); }
body.driver-route-page .driver-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: var(--driver-min-tap);
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
body.driver-route-page .driver-exit:focus-visible,
body.driver-route-page .drv-btn:focus-visible,
body.driver-route-page .drv-route:focus-visible,
body.driver-route-page .drv-dest-head:focus-visible,
body.driver-route-page .drv-date:focus-visible,
body.driver-route-page .drv-check:focus-visible {
  outline: 3px solid var(--brand-yellow);
  outline-offset: 2px;
}
body.driver-route-page main.content.driver-route-main {
  padding: 1rem 0.9rem 2rem;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.drv-banner {
  display: none;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
}
.drv-banner.is-on { display: block; }
.drv-banner.is-offline { background: var(--warning-tint); color: #5c3b00; border: 1px solid #e37400; }
.drv-banner.is-ok { background: var(--success-tint); color: var(--success); border: 1px solid var(--success); }
.drv-banner.is-err { background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger); }
.drv-home {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.drv-home-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 88px;
  padding: 1.1rem 1.15rem;
  border: 0;
  border-radius: 14px;
  background: var(--google-chrome-blue);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.drv-home-btn + .drv-home-btn {
  background: #1557b0;
}
.drv-home-btn-history {
  background: #fff !important;
  color: #1a1a1a;
  border: 1px solid #c5cdd8;
  min-height: 72px;
}
.drv-home-btn-history span { opacity: 0.78; color: #444746; }
.drv-date-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.drv-date {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #8fa3b8;
  border-radius: 10px;
  background: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  box-sizing: border-box;
}
.drv-check.is-static {
  cursor: default;
}
.drv-home-btn strong {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}
.drv-home-btn span {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.92;
}
.drv-back {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 48px;
  margin: 0 0 0.5rem -0.35rem;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: var(--google-chrome-blue-darker);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.drv-title {
  font-size: 1.25rem;
  margin: 0 0 0.85rem;
  line-height: 1.3;
}
.drv-dest {
  margin: 0 0 0.65rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
  overflow: hidden;
}
.drv-dest-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 64px;
  padding: 0.85rem 0.9rem;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.drv-dest-head-text {
  flex: 1;
  min-width: 0;
}
.drv-dest-title {
  display: block;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}
.drv-ship {
  display: inline-block;
  margin-top: 0.28rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.drv-ship--pickup { color: #1a73e8; }
.drv-ship--transit { color: #b06000; }
.drv-ship--notify { color: #137333; }
.drv-ship--returned { color: #c5221f; }
.drv-dest-head .drv-route-meta {
  margin: 0.25rem 0 0;
}
.drv-dest-chevron {
  color: #5f6368;
  flex-shrink: 0;
}
.drv-dest.is-open .drv-dest-head {
  border-bottom: 1px solid var(--keep-line);
}
.drv-dest .drv-keep {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.drv-dest .drv-btn {
  margin: 0.75rem 0.9rem 0.9rem;
  width: calc(100% - 1.8rem);
}
.drv-route {
  display: block;
  width: 100%;
  margin: 0 0 0.65rem;
  padding: 1rem 0.9rem;
  border: 0;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}
.drv-route-label {
  display: block;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.drv-route-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.drv-empty {
  text-align: center;
  padding: 2rem 0.5rem;
  font-size: 1.125rem;
  color: var(--text-secondary);
}
.drv-keep {
  background: var(--keep-paper);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--keep-line);
  margin-bottom: 1rem;
}
.drv-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--keep-line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.drv-check:last-child { border-bottom: 0; }
.drv-box {
  width: 20px;
  height: 20px;
  margin-top: 0;
  border: 2px solid #5f6368;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drv-check.is-on .drv-box {
  background: var(--google-chrome-blue);
  border-color: var(--google-chrome-blue);
  color: #fff;
}
.drv-check.is-on .drv-check-name {
  text-decoration: line-through;
  color: var(--text-muted);
}
.drv-check-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.drv-check-name {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drv-check-qty {
  flex-shrink: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.25;
}
.drv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: var(--driver-min-tap);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  cursor: pointer;
  box-sizing: border-box;
}
.drv-btn-primary { background: var(--google-chrome-blue); color: #fff; }
.drv-btn-primary:disabled,
.drv-btn-primary.is-disabled {
  background: #c5cdd8;
  color: #5f6368;
  cursor: not-allowed;
}
.drv-sticky {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 0.25rem;
  background: linear-gradient(180deg, transparent, var(--bg-base) 28%);
}

