﻿:root {
  --shell-bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #fafafa;
  --text: #252525;
  --muted: #6b7280;
  --line: #dfe3e8;
  --primary: #e30613;
  --primary-dark: #b9000d;
  --accent: #ffcc00;
  --sidebar: #d50000;
  --sidebar-soft: #b9000d;
  --sidebar-text: #ffffff;
  --success: #107e3e;
  --danger: #b00020;
}

body.theme-fiori {
  --shell-bg: #f5f6f7;
  --surface: #ffffff;
  --surface-strong: #f7f9fb;
  --text: #1d2d3e;
  --muted: #5b738b;
  --line: #d5dadd;
  --primary: #0a6ed1;
  --primary-dark: #085caf;
  --accent: #00a1e0;
  --sidebar: #354a5f;
  --sidebar-soft: #203b52;
  --sidebar-text: #ffffff;
}

body.theme-fiori-dark {
  --shell-bg: #12171c;
  --surface: #1d232a;
  --surface-strong: #26313a;
  --text: #eef3f8;
  --muted: #b7c4d0;
  --line: #35414c;
  --primary: #0a6ed1;
  --primary-dark: #0754a0;
  --accent: #64b5f6;
  --sidebar: #0f1f2d;
  --sidebar-soft: #183149;
  --sidebar-text: #ffffff;
}

body.theme-horizon-blue {
  --shell-bg: #f3f7fb;
  --surface: #ffffff;
  --surface-strong: #edf4fb;
  --text: #1b2f45;
  --muted: #5f7388;
  --line: #d9e4ee;
  --primary: #0070f2;
  --primary-dark: #0057bd;
  --accent: #1b90ff;
  --sidebar: #102a43;
  --sidebar-soft: #173b5c;
  --sidebar-text: #ffffff;
}

body.theme-belize-blue {
  --shell-bg: #eef3f8;
  --surface: #ffffff;
  --surface-strong: #f3f8fc;
  --text: #223548;
  --muted: #63788e;
  --line: #d7e0e8;
  --primary: #007cc0;
  --primary-dark: #005f95;
  --accent: #36a41d;
  --sidebar: #2b4055;
  --sidebar-soft: #1f3142;
  --sidebar-text: #ffffff;
}

body.theme-crimson {
  --primary: #c8102e;
  --primary-dark: #9f0d24;
  --accent: #ffd166;
  --sidebar: #a20b1f;
  --sidebar-soft: #7f0818;
}

body.theme-graphite {
  --primary: #e30613;
  --primary-dark: #b9000d;
  --accent: #ffcc00;
  --sidebar: #2b2f36;
  --sidebar-soft: #3a404a;
}

html {
  font-size: 15px;
}

body {
  background: var(--shell-bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
}

a {
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-soft));
  color: var(--sidebar-text);
  padding: 18px 14px;
}

.brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  padding: 6px 8px;
}

.brand:hover {
  color: #fff;
}

.brand-logo {
  border-radius: 8px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.login-logo {
  border-radius: 10px;
  height: 96px;
  object-fit: cover;
  width: 96px;
}

.brand strong,
.brand small {
  color: #fff;
}

.brand small,
.topbar-kicker,
.section-heading span,
.kpi-card span,
.kpi-card small {
  display: block;
}

.topbar-kicker,
.section-heading span,
.kpi-card span,
.kpi-card small {
  color: var(--muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-group {
  border-top: 1px solid rgba(255,255,255,.22);
  margin-top: 10px;
  padding-top: 10px;
}

.side-group-title,
.side-link {
  align-items: center;
  display: flex;
  gap: 10px;
}

.side-group-title {
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 8px;
  text-transform: uppercase;
}

.side-link {
  border-radius: 6px;
  color: #fff;
  margin: 2px 0;
  min-height: 38px;
  padding: 8px 10px;
}

.side-link:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.side-link-child {
  font-size: .92rem;
  margin-left: 10px;
}

.app-main {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: var(--primary);
  border-bottom: 1px solid var(--primary-dark);
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 24px;
}

.topbar h1 {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.topbar .topbar-kicker {
  color: rgba(255,255,255,.78);
}

.env-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.env-banner-qas {
  color: #0c5460;
  background: #d1ecf1;
  border-color: #bee5eb;
}

.env-banner-prd {
  color: #721c24;
  background: #f8d7da;
  border-color: #f5c6cb;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.theme-picker,
.user-pill,
.icon-button {
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 6px;
  min-height: 36px;
}

.theme-picker {
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.user-pill {
  align-items: center;
  background: rgba(255,255,255,.16);
  color: #fff;
  display: inline-flex;
  gap: 8px;
  padding: 0 12px;
}

.icon-button {
  align-items: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  display: inline-flex;
  justify-content: center;
  min-width: 36px;
}

.icon-button:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.icon-button.danger {
  background: #fff;
  color: var(--danger);
}

.content {
  padding: 24px;
}

.kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.kpi-card,
.module-card,
.work-area,
.form-shell,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.kpi-card {
  border-top: 4px solid var(--primary);
  padding: 18px;
}

.kpi-card strong {
  display: block;
  font-size: 1.45rem;
  margin: 6px 0;
}

.reporte-ventas-etiqueta small {
  display: block;
  margin-bottom: 8px;
}

.reporte-ventas-unidades {
  font-size: 1.15rem;
}

.work-area,
.form-shell {
  padding: 20px;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 1.15rem;
  margin: 0;
}

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

.module-card {
  padding: 16px;
}

.module-header {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.module-header i {
  color: var(--primary);
}

.module-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module-card li {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 10px 0;
}

.login-page {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(227,6,19,.96), rgba(83,0,7,.9)),
    radial-gradient(circle at 82% 18%, rgba(255,204,0,.28), transparent 34%);
  background-size: cover;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: rgba(255,255,255,.98);
  margin-left: min(8vw, 90px);
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.login-brand {
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  color: #fff;
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px;
}

.login-brand strong,
.login-brand small {
  color: #fff;
}

.login-brand small {
  display: block;
  opacity: .84;
}

.login-env-banner {
  border-radius: 8px;
  border: 1px solid transparent;
  margin-bottom: 18px;
  padding: 10px 12px;
  text-align: center;
}

.login-env-banner-title {
  align-items: center;
  display: flex;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 0.45rem;
  justify-content: center;
  letter-spacing: 0.01em;
}

.login-env-banner-db {
  color: inherit;
  font-size: 0.78rem;
  margin-top: 4px;
  opacity: 0.92;
}

.login-env-banner-qas {
  background: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.login-env-banner-prd {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label,
.corporate-form label {
  color: var(--text);
  font-weight: 600;
}

.login-hint {
  background: #fff7f7;
  border: 1px solid #ffd7d7;
  border-radius: 6px;
  color: #6b1a1a;
  font-size: .9rem;
  margin-top: 16px;
  padding: 10px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.corporate-table {
  border-color: var(--line);
  margin: 0;
}

.corporate-table thead th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.pivot-comercial-table th,
.pivot-comercial-table td {
  white-space: nowrap;
  font-size: .78rem;
}

/* Scroll en grids / tablas (pantalla). Imprimir: sin recorte. */
:root {
  --intranet-grid-max-height: min(70vh, 42rem);
}

@media screen {
  .table-responsive {
    max-height: var(--intranet-grid-max-height);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .table-responsive > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--line);
  }

  .table-responsive > table.corporate-table > thead > tr > th {
    background: var(--surface-strong);
  }

  .table-responsive > table.table-striped > thead > tr > th,
  .table-responsive > table thead.table-light th {
    background: #f8f9fa;
  }

  .permissions-grid {
    max-height: var(--intranet-grid-max-height);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }

  .work-area .module-grid {
    max-height: var(--intranet-grid-max-height);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }
}

@media print {
  .table-responsive,
  .permissions-grid,
  .work-area .module-grid {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
  }

  .table-responsive > table > thead > tr > th {
    position: static !important;
    box-shadow: none !important;
  }
}

.status-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 10px;
}

.status-badge.ok {
  background: #e5f6eb;
  color: var(--success);
}

.status-badge.off {
  background: #fdeaea;
  color: var(--danger);
}

.status-badge.total {
  background: #e8eef5;
  color: #1d4f91;
}

a.status-badge {
  text-decoration: none;
}

.status-badge.action {
  cursor: pointer;
}

.status-badge.action.is-on {
  box-shadow: inset 0 0 0 2px currentColor;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.switch-row {
  align-items: center;
  display: flex !important;
  gap: 8px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.empty-state {
  align-items: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  padding: 24px;
  text-align: center;
}

.empty-state.compact {
  min-height: 220px;
}

.empty-state i {
  color: var(--primary);
  font-size: 2.4rem;
  margin-bottom: 12px;
}

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

  .app-sidebar {
    position: static;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .kpi-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
/* Login composition: form at left, KORES image at right. */
.login-page {
  justify-content: space-between;
  gap: clamp(32px, 7vw, 110px);
  padding: clamp(24px, 5vw, 72px);
}

.login-panel {
  flex: 0 0 430px;
  margin-left: min(4vw, 54px);
}

.login-brand {
  align-items: flex-start;
  background: transparent;
  border-bottom: 3px solid var(--primary);
  border-radius: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
  padding: 0 0 14px;
  text-align: left;
}

.login-brand strong {
  color: var(--text);
  font-size: 1.25rem;
}

.login-brand small {
  color: var(--muted);
  display: block;
  opacity: 1;
}

.login-visual {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 320px;
}

.login-hero-logo {
  border-radius: 0;
  box-shadow: 0 28px 80px rgba(68, 0, 6, .26);
  display: block;
  height: auto;
  max-height: min(68vh, 560px);
  max-width: min(42vw, 560px);
  object-fit: contain;
  width: 100%;
}

@media (max-width: 900px) {
  .login-page {
    align-items: center;
    flex-direction: column-reverse;
    justify-content: center;
  }

  .login-panel {
    flex: 0 1 auto;
    margin-left: 0;
  }

  .login-visual {
    min-width: 0;
    width: 100%;
  }

  .login-hero-logo {
    max-height: 220px;
    max-width: 220px;
  }
}

/* Force the KORES visual to the right side of the login screen. */
.login-page {
  overflow: hidden;
  position: relative;
}

.login-panel {
  position: relative;
  z-index: 2;
}

.login-visual {
  align-items: center;
  display: flex !important;
  height: 100vh;
  justify-content: center;
  min-width: 0;
  pointer-events: none;
  position: absolute;
  right: clamp(48px, 8vw, 150px);
  top: 0;
  width: min(38vw, 560px);
  z-index: 1;
}

.login-hero-logo {
  background: #e71919;
  border: 8px solid rgba(255,255,255,.18);
  border-radius: 2px;
  box-shadow: 0 28px 90px rgba(55, 0, 5, .34);
  display: block !important;
  height: auto;
  max-height: min(62vh, 540px);
  max-width: min(38vw, 540px);
  object-fit: contain;
  opacity: 1;
  visibility: visible;
  width: 100%;
}

@media (max-width: 1100px) {
  .login-visual {
    opacity: .28;
    right: 24px;
    width: 340px;
  }
}

@media (max-width: 900px) {
  .login-page {
    overflow: auto;
  }

  .login-visual {
    display: none !important;
  }
}

/* Inline KORES login artwork. */
.login-visual svg.login-hero-logo {
  background: #e71919;
  border: 8px solid rgba(255,255,255,.18);
  border-radius: 2px;
  box-shadow: 0 28px 90px rgba(55, 0, 5, .34);
  display: block !important;
  height: auto;
  max-height: min(62vh, 540px);
  max-width: min(38vw, 540px);
  opacity: 1;
  visibility: visible;
  width: 100%;
}

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

.permission-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  min-height: 42px;
  padding: 9px 0;
}

.permission-row input {
  height: 18px;
  width: 18px;
}

.role-filter {
  min-width: min(320px, 100%);
}

/* Collapsible sidebar menu groups. */
.side-group-title {
  background: transparent;
  border: 0;
  cursor: pointer;
  justify-content: flex-start;
  width: 100%;
}

.side-group-title:hover {
  background: rgba(255,255,255,.12);
  border-radius: 6px;
}

.side-group-title span {
  flex: 1;
  text-align: left;
}

.side-group-chevron {
  font-size: .72rem;
  margin-left: auto;
  transition: transform .18s ease;
}

.side-submenu {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows .2s ease, opacity .2s ease;
}

.side-group.is-collapsed .side-submenu {
  grid-template-rows: 0fr;
  opacity: 0;
}

.side-submenu > * {
  min-height: 0;
}

.side-group.is-collapsed .side-link-child {
  pointer-events: none;
}

.side-group.is-collapsed .side-group-chevron {
  transform: rotate(-90deg);
}

/* Compact collapsed sidebar: no empty gaps between menu groups. */
.side-nav {
  gap: 2px;
}

.side-group {
  margin-top: 2px;
  padding-top: 2px;
}

.side-submenu {
  display: block;
}

.side-group.is-collapsed .side-submenu {
  display: none;
  opacity: 1;
}

.side-link-child {
  margin-left: 0;
  padding-left: 28px;
}

/* Inline brand mark: no broken image fallback. */
.brand-logo {
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  height: 52px;
  width: 52px;
}

.role-inline-form {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 240px;
}

.role-inline-form .form-select {
  min-width: 190px;
}

.role-save-hint {
  color: var(--muted);
  display: block;
  font-size: .72rem;
  margin-top: 4px;
}

.role-inline-form .btn {
  min-height: 31px;
  white-space: nowrap;
}

/* Power BI (Recursos Humanos — Modulo/Index) */
.module-dashboard-page .module-powerbi-card .card-header {
  font-weight: 700;
}

.powerbi-frame-wrap {
  width: 100%;
  max-width: 100%;
  min-height: min(700px, 85vh);
  overflow: hidden;
  background: #f1f5f9;
  border-radius: 6px;
}

.powerbi-frame {
  display: block;
  width: 100%;
  height: min(700px, 85vh);
  min-height: 560px;
  border: 0;
}

.production-page {
  display: grid;
  gap: 14px;
  /* Espacio para la barra sticky inferior (Guardar / Autorizar) y poder usar eliminar en la última fila */
  padding-bottom: 100px;
}

.production-capture,
.production-body {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 240px;
}

.production-form-panel,
.production-summary,
.production-table-panel,
.production-info {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
  padding: 16px;
}

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

.field-block {
  display: grid;
  gap: 6px;
}

.field-block.wide {
  grid-column: span 2;
}

.field-block label {
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
}

.field-block small,
.production-table small {
  color: var(--muted);
}

.action-field {
  align-self: end;
}

.production-summary,
.production-info {
  align-self: start;
}

.production-summary h3,
.production-info h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.production-summary > div:not(.status-box) {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 26px 1fr auto;
  padding: 10px 0;
}

.production-summary i {
  color: var(--primary);
}

.status-box {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: .78rem;
  font-weight: 800;
  justify-content: center;
  margin-top: 12px;
  padding: 6px 12px;
}

.status-box.borrador { color: #8a5a00; }
.status-box.guardado { color: var(--primary); }
.status-box.autorizado { color: var(--success); }
.status-box.cerrado { color: #6c757d; }
.status-box.cancelado { color: var(--danger); }
.status-box.inline { margin: 0; }

.production-table-panel {
  min-width: 0;
}

.production-table th {
  white-space: nowrap;
}

/* Columna Empleado: ancho mínimo para que no quede fuera de vista con scroll horizontal del grid */
.production-table th:nth-child(5),
.production-table td:nth-child(5) {
  min-width: 14rem;
  max-width: 22rem;
  white-space: normal;
}

.production-footer-actions,
.sticky-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.sticky-actions {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  bottom: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  justify-content: flex-end;
  padding: 12px;
  position: sticky;
  z-index: 4;
}

.sticky-actions form {
  display: inline-flex;
}

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

.query-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.query-actions {
  align-self: end;
}

@media (max-width: 1100px) {
  .production-capture,
  .production-body,
  .query-grid {
    grid-template-columns: 1fr;
  }

  .production-form-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .production-form-panel {
    grid-template-columns: 1fr;
  }

  .field-block.wide {
    grid-column: auto;
  }
}

/* Rol de turnos alignment refinements. */
.production-capture {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 240px;
}

.production-form-panel {
  align-items: start;
  grid-template-columns: 320px 320px minmax(360px, 1fr) 320px;
}

.production-form-panel .form-control,
.production-form-panel .form-select {
  min-height: 50px;
}

.field-block {
  min-width: 0;
}

.field-block small {
  min-height: 18px;
}

.action-field {
  align-self: end;
}

.action-field .btn {
  min-height: 50px;
}

.production-summary {
  height: 100%;
}

@media (max-width: 1500px) {
  .production-form-panel {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
  }

  .field-block.wide {
    grid-column: span 1;
  }
}

@media (max-width: 1100px) {
  .production-form-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Rol de turnos: layout estable y búsqueda. */
.production-capture {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 240px);
}

.production-form-panel {
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-form-panel .field-block.wide {
  grid-column: span 2;
}

.production-form-panel .employee-field {
  grid-column: span 2;
}

.production-form-panel .form-control,
.production-form-panel .form-select,
.production-form-panel .btn {
  min-height: 50px;
}

.production-form-panel .searchable-input {
  width: 100%;
}

/* input-group + orden: evitar width:100% en el control (rompe flex del grupo y baja el botón ✕). */
.production-form-panel .input-group,
.notification-filter-panel .input-group,
.rotation-filter-grid .input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.production-form-panel .input-group .form-control.searchable-input,
.production-form-panel .input-group > .form-control,
.notification-filter-panel .input-group > .form-control,
.rotation-filter-grid .input-group > .form-control {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.production-form-panel .input-group > .btn,
.notification-filter-panel .input-group > .btn,
.rotation-filter-grid .input-group > .btn {
  flex: 0 0 auto;
}

.production-form-panel .action-field {
  align-self: end;
  min-width: 0;
}

.production-summary {
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.production-table .operation-list {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.production-table .operation-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.production-table .operation-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.production-table .operation-list small {
  display: block;
}

@media (max-width: 1500px) {
  .production-form-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .production-form-panel .field-block.wide,
  .production-form-panel .employee-field {
    grid-column: span 2;
  }
}

@media (max-width: 1200px) {
  .production-capture {
    grid-template-columns: 1fr;
  }

  .production-form-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .production-form-panel,
  .production-form-panel .field-block.wide,
  .production-form-panel .employee-field {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
}

.row-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.row-actions form {
  display: inline-flex;
}

.production-summary .summary-warning i,
.production-summary .summary-warning strong {
  color: #b45309;
}

.table-filter-bar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  margin: 12px 0;
}

.table-filter-bar label {
  color: var(--text);
  display: grid;
  font-size: .78rem;
  font-weight: 700;
  gap: 5px;
}

@media (max-width: 900px) {
  .table-filter-bar {
    grid-template-columns: 1fr;
  }
}

.rotation-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(150px, 1fr)) auto;
}

.rotation-filter-grid label,
.rotation-modal-body label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.rotation-row {
  cursor: pointer;
}

.rotation-row:hover {
  background: var(--surface-strong);
}

.rotation-modal-body {
  display: grid;
  gap: 12px;
}

.corporate-modal {
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

@media (max-width: 800px) {
  .rotation-filter-grid {
    grid-template-columns: 1fr;
  }
}

.production-table-panel {
  display: flex;
  flex-direction: column;
}

.production-table-panel .table-filter-bar {
  flex: 0 0 auto;
}

.production-table-panel .production-footer-actions {
  flex: 0 0 auto;
  padding-top: 10px;
}

.autocomplete-panel {
    position: absolute;
    z-index: 1060;
    display: none;
    width: min(100%, 520px);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d8dde6);
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
}

.autocomplete-panel.is-open {
    display: grid;
}

.autocomplete-panel button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 9px 12px;
    color: var(--text, #0f172a);
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border, #edf0f5);
}

.autocomplete-panel button span {
    color: var(--muted, #64748b);
    font-size: .82rem;
}

.autocomplete-panel button:hover,
.autocomplete-panel button:focus,
.autocomplete-panel button.is-active {
    background: var(--nav-hover, #f4f6fb);
}

.reporte-ventas-sugerir {
    position: relative;
}

.reporte-ventas-sugerir .autocomplete-panel {
    left: 0;
    width: 100%;
}

.reporte-ventas-sugerir-vacio {
    padding: 9px 12px;
    color: var(--muted, #64748b);
}

.analisis-ventas-tabla th,
.analisis-ventas-tabla td {
    white-space: nowrap;
    font-size: .78rem;
}

.analisis-ventas-tabla .analisis-mes { background: #fff3b0; }
.analisis-ventas-tabla .analisis-anterior { background: #d6e6f5; }
.analisis-ventas-tabla .analisis-acumulado { background: #d9f2d9; }
.analisis-ventas-tabla .analisis-acumulado-ant { background: #b7dfb9; }
.analisis-ventas-tabla .analisis-divisor td {
    background: #c8102e;
    color: #fff;
    font-weight: 700;
}
.analisis-ventas-tabla .analisis-subtotal td,
.analisis-ventas-tabla .analisis-total td {
    font-weight: 700;
    background: #f4f5f7;
}

.rotation-filter-grid label,
.rotation-modal-body label {
    position: relative;
}

.notification-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.notification-capture-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.notification-capture-grid .wide {
    grid-column: span 2;
}

.notification-capture-grid .check-line {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.notification-operations {
    margin: 0;
    max-height: 160px;
    overflow-y: auto;
}

@media (max-width: 1100px) {
    .notification-capture-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 700px) {
    .notification-capture-grid,
    .notification-capture-grid .wide {
        grid-template-columns: 1fr;
        grid-column: auto;
    }
}

.notification-filter-form {
    display: block;
}

.notification-filter-panel {
    display: grid;
    grid-template-columns: minmax(280px, 1.3fr) minmax(240px, 1fr) minmax(190px, .75fr) minmax(190px, .75fr);
    gap: 14px;
    align-items: start;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .08);
    padding: 16px;
}

.notification-filter-panel .form-control,
.notification-filter-panel .form-select {
    min-height: 50px;
}

@media (max-width: 1200px) {
    .notification-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .notification-filter-panel {
        grid-template-columns: 1fr;
    }
}

.notification-page .actividad-search-block {
    max-width: 36rem;
}

.notification-page .actividad-search-block .form-control {
    font-size: 0.9rem;
}

.notification-page .actividad-descripcion {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #6b7280;
}

.notification-page .actividad-descripcion .act-ref {
    display: block;
    font-size: 0.82rem;
    color: #6b7280;
    word-break: break-word;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
  align-items: start;
}

.report-main {
  min-width: 0;
}

.report-summary {
  position: sticky;
  top: 88px;
}

.report-filter-panel {
  grid-template-columns: minmax(280px, 1.3fr) minmax(260px, 1fr) minmax(190px, .6fr);
}

.report-actions {
  display: grid;
  gap: 8px;
}

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

  .report-summary {
    position: static;
  }
}

.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111827;
  padding: 22px;
}

.print-header {
  align-items: flex-start;
  border-bottom: 3px solid var(--primary);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
}

.print-header h1 {
  font-size: 1.45rem;
  margin: 0;
}

.print-header p,
.print-meta span,
.print-order-title span {
  color: #4b5563;
  display: block;
  margin: 2px 0 0;
}

.print-meta {
  text-align: right;
}

.print-summary-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.print-summary-line span {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
}

.print-order-block {
  break-inside: avoid;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-top: 12px;
  overflow: hidden;
}

.print-order-title {
  background: #f3f4f6;
  border-bottom: 1px solid #d1d5db;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
}

.print-table {
  border-collapse: collapse;
  font-size: .78rem;
  width: 100%;
}

.print-table th,
.print-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.print-table th {
  background: #fafafa;
  color: #374151;
  font-size: .72rem;
  text-transform: uppercase;
}

@media print {
  body {
    background: #fff !important;
  }

  .app-sidebar,
  .top-bar,
  .topbar,
  .no-print,
  .theme-picker,
  .theme-switcher,
  .sticky-actions {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .content,
  .content-wrapper {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .print-sheet {
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .print-summary-line {
    grid-template-columns: repeat(4, 1fr);
  }

  @page {
    size: landscape;
    margin: 10mm;
  }
}

.app-busy-overlay {
  align-items: center;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(4px);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 9999;
}

.app-is-busy .app-busy-overlay {
  display: flex;
}

.app-busy-card {
  align-items: center;
  background: var(--surface, #fff);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  color: var(--text, #111827);
  display: grid;
  gap: 16px;
  grid-template-columns: 128px minmax(0, 1fr);
  max-width: 480px;
  min-width: min(480px, 92vw);
  padding: 18px;
}

.app-busy-beaver {
  height: 128px;
  overflow: hidden;
  position: relative;
  width: 128px;
}

.app-busy-beaver-consult {
  animation: beaverType 0.7s ease-in-out infinite;
  height: 100%;
  position: relative;
  width: 100%;
}

.app-busy-beaver-frame {
  display: block;
  height: 100%;
  left: 0;
  object-fit: contain;
  position: absolute;
  top: 0;
  width: 100%;
}

.app-busy-beaver-frame.is-a {
  animation: beaverStrideA 0.55s steps(1, end) infinite;
}

.app-busy-beaver-frame.is-b {
  animation: beaverStrideB 0.55s steps(1, end) infinite;
}

.app-busy-screen-glow {
  animation: beaverScreen 0.9s ease-in-out infinite;
  background: radial-gradient(circle, rgba(10, 110, 209, .28) 0%, transparent 70%);
  border-radius: 50%;
  height: 36px;
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 28px;
  width: 36px;
}

.app-busy-card strong,
.app-busy-card span {
  display: block;
}

.app-busy-card strong {
  font-size: 1.05rem;
  margin-bottom: 3px;
}

.app-busy-card span {
  color: var(--muted, #4b5563);
  line-height: 1.35;
}

.app-is-busy .app-shell,
.app-is-busy main:not(.content) {
  pointer-events: none;
  user-select: none;
}

@keyframes beaverStrideA {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes beaverStrideB {
  0%, 49.9% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

@keyframes beaverType {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes beaverScreen {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: .8; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .app-busy-beaver-consult,
  .app-busy-beaver-frame,
  .app-busy-screen-glow {
    animation: none;
  }

  .app-busy-beaver-frame.is-b {
    opacity: 0;
  }
}

/* --- Ventas: documento de impresión formal (no captura de pantalla) --- */
@page ventas_pedido {
  size: A4 portrait;
  margin: 14mm;
}

.ventas-print-doc {
  background: #fff;
  color: #111827;
}

.ventas-print-doc.print-sheet {
  border: 1px solid #e5e7eb;
  border-radius: 0;
  box-shadow: none;
  max-width: 100%;
  padding: 0;
}

.ventas-print-doc-header {
  align-items: flex-start;
  border-bottom: 2px solid #1f2937;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
}

.ventas-print-doc-header .ventas-print-logo {
  display: block;
  height: 48px;
  object-fit: contain;
  width: auto;
  max-width: 180px;
}

.ventas-print-doc-title h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.ventas-print-doc-title p {
  color: #4b5563;
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.ventas-print-doc-meta {
  line-height: 1.4;
  text-align: right;
}

.ventas-print-doc-meta strong {
  display: block;
  font-size: 0.9rem;
}

.ventas-print-doc-meta span {
  color: #6b7280;
  display: block;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.ventas-print-doc-sub {
  color: #374151;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 0.9rem;
}

.ventas-print-doc-grid {
  display: grid;
  gap: 0.4rem 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.ventas-print-doc-field {
  border-bottom: 1px solid #e5e7eb;
  min-height: 2.4rem;
  padding: 0.3rem 0 0.45rem;
}

.ventas-print-doc-field .ventas-print-label {
  color: #6b7280;
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ventas-print-doc-field .ventas-print-value {
  display: block;
  font-size: 0.88rem;
  margin-top: 0.15rem;
  word-wrap: break-word;
}

.ventas-print-table-wrap {
  margin: 0.35rem 0 0.75rem;
}

.ventas-print-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  width: 100%;
}

.ventas-print-table th,
.ventas-print-table td {
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.5rem;
  vertical-align: top;
}

.ventas-print-table thead th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ventas-print-table td.num,
.ventas-print-table th.num {
  text-align: right;
  white-space: nowrap;
}

.ventas-print-table tfoot td {
  border-top: 2px solid #94a3b8;
  font-weight: 600;
}

.ventas-print-totals-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.ventas-print-totals {
  border-top: 2px solid #1f2937;
  margin-top: 0.25rem;
  min-width: 260px;
  padding-top: 0.5rem;
}

.ventas-print-totals .ventas-print-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.2rem 0;
}

.ventas-print-totals .ventas-print-sum-row.grand {
  border-top: 1px solid #e5e7eb;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
}

.ventas-print-footer {
  border-top: 1px solid #e5e7eb;
  color: #9ca3af;
  font-size: 0.68rem;
  margin-top: 1.25rem;
  padding-top: 0.65rem;
  text-align: center;
}

@media print {
  .ventas-print-doc {
    -webkit-print-color-adjust: exact;
    background: #fff !important;
    page: ventas_pedido;
    print-color-adjust: exact;
  }

  .ventas-print-doc-header .ventas-print-logo {
    height: 44px;
    max-width: 160px;
  }
}

.explosion-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.explosion-form-grid .wide {
  grid-column: span 2;
}

.explosion-form-grid .action-field {
  align-self: end;
}

.explosion-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.explosion-level-block {
  border-bottom: 1px solid var(--line);
}

.explosion-level-block > summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  font-weight: 600;
  list-style: none;
}

.explosion-level-block > summary::-webkit-details-marker {
  display: none;
}

.explosion-level-block > summary::before {
  content: "▸";
  color: #64748b;
  transition: transform .15s ease;
}

.explosion-level-block[open] > summary::before {
  transform: rotate(90deg);
}

.explosion-level-title {
  color: #0f172a;
}

.explosion-level-shortage {
  font-size: 0.82rem;
  font-weight: 600;
  color: #b45309;
}

.explosion-unit-subtotal td {
  border-top: 2px solid #dee2e6;
}

.explosion-unit-block > summary .explosion-level-shortage {
  margin-left: auto;
}

.explosion-level-virtual {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  margin-left: 1rem;
}

.explosion-level-virtual.is-negativo {
  color: #15803d;
}

.explosion-level-virtual.is-positivo {
  color: #b91c1c;
}

.semaforo-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}

.semaforo-rojo {
  background-color: #dc3545;
}

.semaforo-verde {
  background-color: #198754;
}

.reporte-factura-row {
  cursor: pointer;
}

.reporte-facturas-table {
  font-size: 0.78rem;
}

.reporte-facturas-table .reporte-th-compact {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: bottom;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.reporte-facturas-table .col-factura {
  min-width: 5.5rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.reporte-facturas-table .col-money,
.reporte-facturas-detalle-table .col-money,
.reporte-facturas-credito-table .col-money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.reporte-facturas-table .col-customer,
.reporte-facturas-detalle-table .col-customer {
  min-width: 5.5rem;
  white-space: nowrap;
}

.reporte-facturas-table .col-customer-name,
.reporte-facturas-detalle-table .col-customer-name {
  min-width: 12rem;
  max-width: 22rem;
  white-space: normal !important;
  line-height: 1.2;
}

.reporte-facturas-table .col-vkorg-desc,
.reporte-facturas-detalle-table .col-vkorg-desc,
.reporte-facturas-table .col-vkgrp-desc,
.reporte-facturas-detalle-table .col-vkgrp-desc {
  min-width: 9rem;
  max-width: 16rem;
  white-space: normal !important;
  line-height: 1.2;
}

.reporte-facturas-table tbody td {
  font-size: 0.76rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.reporte-factura-row.selected > td {
  background-color: #cfe2ff !important;
  box-shadow: inset 0 0 0 1px #0d6efd;
}

.reporte-factura-cancelada > td {
  background-color: #f8d7da !important;
  color: #842029;
}

.reporte-factura-cancelada.selected > td {
  background-color: #f1aeb5 !important;
  box-shadow: inset 0 0 0 1px #dc3545;
}

.reporte-facturas-detalle-table,
.reporte-facturas-credito-table {
  font-size: 0.78rem;
}

.reporte-facturas-detalle-table .detalle-th-compact,
.reporte-facturas-credito-table .detalle-th-compact {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: bottom;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.reporte-facturas-detalle-table .col-arktx {
  min-width: 14rem;
  max-width: 28rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
}

.reporte-facturas-detalle-table .col-matnr {
  min-width: 5.5rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.comisiones-page .comisiones-resumen-table,
.comisiones-page .comisiones-detalle-table,
.comisiones-page .comisiones-config-table {
  font-size: 0.78rem;
}

.comision-vendedor-row {
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.comision-vendedor-row > td {
  transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.comision-vendedor-row:hover:not(.selected) > td {
  background-color: #f4f6f9 !important;
}

.comision-vendedor-row:focus-visible {
  outline: 2px solid var(--brand-primary, #e71919);
  outline-offset: -2px;
}

.comision-vendedor-row.selected > td {
  background-color: #fff8f8 !important;
  border-top: 1px solid #f5c2c7;
  border-bottom: 1px solid #f5c2c7;
  box-shadow: none;
}

.comision-vendedor-row.selected > td:first-child {
  box-shadow: inset 4px 0 0 var(--brand-primary, #e71919);
  font-weight: 600;
  padding-left: calc(0.5rem + 2px);
}

.comision-recomendacion {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.5;
}

.comision-vendedor-row.selected > td:first-child::before {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.6rem;
  color: var(--brand-primary, #e71919);
  margin-right: 0.45rem;
  vertical-align: middle;
  opacity: 0.85;
}

.comision-vendedor-row.comision-candado:not(.selected) > td {
  background-color: #fff5f5 !important;
}

.comision-vendedor-row.comision-candado.selected > td {
  background-color: #ffe8ea !important;
  border-top-color: #f1aeb5;
  border-bottom-color: #f1aeb5;
}

.comision-vendedor-row.comision-candado.selected > td:first-child {
  box-shadow: inset 4px 0 0 #dc3545;
}

.comision-detalle-card {
  border-left: 4px solid var(--brand-primary, #e71919) !important;
  animation: comisionDetalleFadeIn 0.22s ease-out;
}

.comision-detalle-card .card-header {
  background: linear-gradient(90deg, #fff8f8 0%, #fff 40%);
  border-bottom: 1px solid #f1c0c0;
}

@keyframes comisionDetalleFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comision-candado > td {
  background-color: #f8d7da !important;
}

.comision-detalle-block > summary {
  cursor: pointer;
  list-style: revert;
}

.comision-config-block > summary {
  cursor: pointer;
}

.explosion-level-meta {
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
}

.explosion-result-table {
  font-size: 0.82rem;
}

.explosion-result-table tr.explosion-row-shortage > td {
  background-color: #fff3cd;
}

.explosion-result-table tr.explosion-row-roh-shortage > td {
  background-color: #d1e7dd;
}

.explosion-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.explosion-legend-shortage {
  background-color: #fff3cd;
  border: 1px solid #ffe69c;
}

.explosion-legend-roh {
  background-color: #d1e7dd;
  border: 1px solid #a3cfbb;
}

.explosion-result-table th {
  white-space: nowrap;
  font-size: 0.78rem;
}

.explosion-col-message {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

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

  .explosion-form-grid .wide {
    grid-column: auto;
  }
}

.visor-inventario-page .kpi-grid,
.visor-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.visor-inventario-leyenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.visor-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visor-charts {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.visor-chart-wide {
  grid-column: 1 / -1;
}

.visor-chart-body {
  height: 280px;
}

.visor-chart-body-wide {
  height: 360px;
}

.visor-inventario-table {
  font-size: 0.78rem;
}

.visor-inventario-table thead th {
  font-size: 0.65rem;
  white-space: nowrap;
}

.visor-inventario-table tbody td {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  white-space: nowrap;
}

.visor-col-maktx {
  min-width: 14rem;
  max-width: 22rem;
  white-space: normal !important;
}

.visor-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.visor-badge-muerto {
  background: #f8d7da;
  color: #842029;
}

.visor-badge-muy-lento {
  background: #ffe8d6;
  color: #9a3412;
}

.visor-badge-lento {
  background: #fef3c7;
  color: #854d0e;
}

.visor-badge-normal {
  background: #dbeafe;
  color: #1e40af;
}

.visor-badge-rapido {
  background: #d1e7dd;
  color: #0f5132;
}

.visor-badge-sin-stock {
  background: #e5e7eb;
  color: #374151;
}

.visor-badge-caducar {
  background: #f3e8ff;
  color: #6b21a8;
}

.visor-row-muerto > td {
  background-color: #fff5f5;
}

.visor-row-muy-lento > td {
  background-color: #fff7ed;
}

.visor-row-lento > td {
  background-color: #fffbeb;
}

.visor-kpi-muerto {
  border-top-color: #b00020;
}

.visor-kpi-muy-lento {
  border-top-color: #c2410c;
}

.visor-kpi-lento {
  border-top-color: #ca8a04;
}

.visor-kpi-caducar {
  border-top-color: #6b21a8;
}

.visor-kpi-rapido {
  border-top-color: #107e3e;
}

@media (max-width: 992px) {
  .visor-charts {
    grid-template-columns: 1fr;
  }

  .visor-chart-wide {
    grid-column: auto;
  }
}

.analisis-ventas-tabla th,
.analisis-ventas-tabla td {
  white-space: nowrap;
  font-size: .78rem;
}

.analisis-ventas-tabla .analisis-mes { background: #fff3b0; }
.analisis-ventas-tabla .analisis-anterior { background: #d6e6f5; }
.analisis-ventas-tabla .analisis-acumulado { background: #d9f2d9; }
.analisis-ventas-tabla .analisis-acumulado-ant { background: #b7dfb9; }
.analisis-ventas-tabla .analisis-divisor td {
  background: #c8102e;
  color: #fff;
  font-weight: 700;
}
.analisis-ventas-tabla .analisis-subtotal td,
.analisis-ventas-tabla .analisis-total td {
  font-weight: 700;
  background: #f4f5f7;
}

