/* ===================================================================
   DOE INDUSTRIAL ANALYTICS - RG LOGISTICS AND SUPPLY CHAIN
   Estilo Institucional y Ergonomía Desktop (Puerto 8006)
   =================================================================== */

:root {
  --industrial-navy: #003366;
  --industrial-navy-dark: #001f3f;
  --industrial-navy-light: #004c99;
  --corporate-blue: #0054a6;
  --industrial-accent: #e67e22;
  --industrial-gold: #f39c12;
  
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-info: #17a2b8;
  
  --bg-app: #f4f6f9;
  --bg-card: #ffffff;
  --bg-sidebar: #002244;
  --bg-session: #ffffff;
  --bg-header: #003366;
  
  --border-light: #dee2e6;
  --border-subtle: #e9ecef;
  --border-dark: #ced4da;
  
  --text-dark: #212529;
  --text-muted: #6c757d;
  --text-light: #f8f9fa;
  
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "Cascadia Code", "Monaco", "Courier New", monospace;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-app);
  color: var(--text-dark);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===================================================================
   INSTITUTIONAL HEADER INDUSTRIAL (2 NIVELES DESKTOP)
   =================================================================== */
.inst-header-industrial {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 26, 51, 0.25);
}

/* NIVEL SUPERIOR: BARRA INSTITUCIONAL (h-14 / 56px, #002244) */
.header-top-bar {
  height: 56px;
  min-height: 56px;
  background-color: #002244;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  box-sizing: border-box;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-sq {
  width: 38px;
  height: 38px;
  background-color: #f59e0b;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  user-select: none;
  flex-shrink: 0;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-main-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.6px;
  margin: 0;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
  font-family: var(--font-mono);
  margin: 2px 0 0 0;
  line-height: 1.2;
}

/* Derecha: Acciones Institucionales (gap 8px) */
.header-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.badge-status-port {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: rgba(51, 65, 85, 0.4);
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.4px;
  user-select: none;
  box-sizing: border-box;
}

.btn-top-item {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #334155;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-top-item:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #64748b;
  color: #ffffff;
}

.btn-switcher-sigma {
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.7);
  color: #f8fafc;
}

.btn-switcher-sigma:hover {
  background: #003366;
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

/* NIVEL INFERIOR: RIBBON DE TRABAJO Y HUB SCM (h-12 / 48px, #003366, borde #001a33) */
.header-toolbar-ribbon {
  height: 48px;
  min-height: 48px;
  background-color: #003366;
  border-bottom: 2px solid #001a33;
  display: flex;
  align-items: center;
  padding: 0 18px;
  box-sizing: border-box;
}

.toolbar-block-project {
  display: flex;
  align-items: center;
}

.btn-ribbon-project {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.btn-ribbon-project:hover,
.btn-ribbon-project.active {
  background: rgba(255, 255, 255, 0.26);
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

.toolbar-ribbon-divider {
  border-right: 1px solid rgba(148, 163, 184, 0.4);
  height: 24px;
  margin: 0 14px;
  flex-shrink: 0;
}

.toolbar-block-scm {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.toolbar-label-scm {
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  user-select: none;
}

.toolbar-select-scm {
  width: 380px;
  max-width: 380px;
  height: 32px;
  background-color: #ffffff;
  color: #0f172a;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
}

.toolbar-select-scm:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.toolbar-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-action-hub {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-action-hub:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-action-hub:active {
  transform: translateY(0);
}

.btn-case-amber {
  background-color: #d97706;
}
.btn-case-amber:hover {
  background-color: #b45309;
}

.btn-xlsx-green {
  background-color: #15803d;
}
.btn-xlsx-green:hover {
  background-color: #166534;
}

.btn-csv-cyan {
  background-color: #0284c7;
}
.btn-csv-cyan:hover {
  background-color: #0369a1;
}

.btn-direct-blue {
  background-color: #2563eb;
}
.btn-direct-blue:hover {
  background-color: #1d4ed8;
}

/* SCM Case Modal Detail View */
.scm-case-detail {
  font-size: 12.5px;
  line-height: 1.5;
}

.table-mini-scm {
  width: 100%;
  border-collapse: collapse;
}

.table-mini-scm th {
  padding: 6px 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
}

.table-mini-scm td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.table-mini-scm tr:hover td {
  background-color: #f8fafc;
}

.badge-unit {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.badge-goal {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 3px;
}

/* Modal layout utilities */
.space-y-4 > * + * {
  margin-top: 1rem;
}
.bg-slate-50 {
  background-color: #f8fafc;
}
.border-slate-200 {
  border: 1px solid #e2e8f0;
}
.text-slate-700 {
  color: #334155;
}
.text-slate-800 {
  color: #1e293b;
}
.text-slate-900 {
  color: #0f172a;
}
.text-slate-600 {
  color: #475569;
}
.text-slate-500 {
  color: #64748b;
}
.text-blue-700 {
  color: #1d4ed8;
}
.text-blue-800 {
  color: #1e40af;
}
.text-blue-900 {
  color: #1e3a8a;
}
.bg-blue-100 {
  background-color: #dbeafe;
}
.border-blue-200 {
  border: 1px solid #bfdbfe;
}
.bg-amber-50\/70,
.bg-amber-50 {
  background-color: rgba(254, 243, 199, 0.7);
}
.border-amber-200 {
  border: 1px solid #fde68a;
}
.text-amber-900 {
  color: #78350f;
}
.bg-emerald-50\/70,
.bg-emerald-50 {
  background-color: rgba(236, 253, 245, 0.7);
}
.border-emerald-200 {
  border: 1px solid #a7f3d0;
}
.text-emerald-900 {
  color: #064e3b;
}
.rounded-lg {
  border-radius: 8px;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded {
  border-radius: 4px;
}
.p-3 {
  padding: 12px;
}
.pt-1 {
  padding-top: 4px;
}
.mb-1 {
  margin-bottom: 4px;
}
.mb-1\.5 {
  margin-bottom: 6px;
}
.m-0 {
  margin: 0;
}
.flex {
  display: flex;
}
.justify-between {
  justify-content: space-between;
}
.items-center {
  align-items: center;
}
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}
.gap-3 {
  gap: 12px;
}
.gap-1\.5 {
  gap: 6px;
}
.max-h-48 {
  max-height: 12rem;
}
.overflow-y-auto {
  overflow-y: auto;
}
.w-full {
  width: 100%;
}
.text-left {
  text-align: left;
}
.font-bold {
  font-weight: 700;
}
.font-semibold {
  font-weight: 600;
}
.font-mono {
  font-family: var(--font-mono);
}
.text-xs {
  font-size: 12px;
}
.text-base {
  font-size: 15px;
}
.leading-relaxed {
  line-height: 1.625;
}
.divide-y > * + * {
  border-top: 1px solid #f1f5f9;
}

/* ===================================================================
   TABS NAVIGATION BAR (CERO MÓDULOS OCULTOS - 2 FILAS VISIBLES)
   =================================================================== */
.tabs-navigation-bar,
.tab-navigation,
.module-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
  align-items: center !important;
  background: #ffffff !important;
  padding: 10px 14px !important;
  border-bottom: 2px solid #003366 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  overflow-x: visible !important;
}

.tabs-navigation-bar::-webkit-scrollbar,
.tab-navigation::-webkit-scrollbar,
.module-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn,
.tab-btn {
  padding: 8px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #003366 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: normal !important;
  flex: 1 1 calc(25% - 8px) !important;
  min-width: 170px !important;
  box-sizing: border-box !important;
  justify-content: center;
  text-align: center;
}

.nav-tab-btn:hover,
.tab-btn:hover {
  background: #e2e8f0 !important;
  color: #001f3f !important;
  border-color: #94a3b8 !important;
}

.nav-tab-btn.active,
.tab-btn.active {
  background: #003366 !important;
  color: #ffffff !important;
  border-color: #002244 !important;
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.25);
}

/* Minitab 22 Monospace Output Tables */
.minitab-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin: 6px 0;
}

.minitab-table thead tr {
  background: #003366 !important;
  color: #ffffff !important;
}

.minitab-table th {
  padding: 6px 10px;
  font-weight: 700;
  border: 1px solid #002244;
  color: #ffffff !important;
  white-space: nowrap;
}

.minitab-table td {
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  white-space: nowrap;
}

.minitab-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.minitab-table tbody tr:hover {
  background: #f1f5f9;
}

.p-val-sig {
  font-weight: 700 !important;
  color: #b02a37 !important;
  background-color: #fff3cd !important;
}

/* DOE 3-Group Variable Mapping Layout (Benchmarking Minitab 22, Statgraphics & SPSS) */
.doe-mapping-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.doe-mapping-group {
  background: #fbfcfe;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doe-mapping-header {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--industrial-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
}

.doe-mapping-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}



/* ===================================================================
   MAIN WORKSPACE CONTAINER
   =================================================================== */
.workspace-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px 20px;
  gap: 15px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

/* ===================================================================
   CARDS AND PANELS
   =================================================================== */
.card-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.card-header-bar h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--industrial-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===================================================================
   LIVE WORKSHEET (3-TIER STICKY HEADERS & DESKTOP ERGONOMICS)
   =================================================================== */
.worksheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #eaeff5;
  border: 1px solid var(--border-dark);
  border-bottom: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-tool {
  background-color: #fff;
  border: 1px solid var(--border-dark);
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-tool:hover {
  background-color: #f8f9fa;
  border-color: var(--corporate-blue);
  color: var(--corporate-blue);
}

.btn-tool-primary {
  background-color: var(--industrial-navy);
  color: #fff;
  border-color: var(--industrial-navy-dark);
}
.btn-tool-primary:hover {
  background-color: var(--industrial-navy-light);
  color: #fff;
}

.btn-tool-danger {
  background-color: #fff;
  color: var(--color-danger);
  border-color: #f5c6cb;
}
.btn-tool-danger:hover {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-tool-success {
  background-color: var(--color-success);
  color: #fff;
  border-color: #1e7e34;
}
.btn-tool-success:hover {
  background-color: #218838;
  color: #fff;
}

.worksheet-scroll-container {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border-dark);
  background-color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.live-worksheet-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-family: var(--font-mono);
  font-size: 13.5px;
}

/* 3-Tier Headers Sticky */
.live-worksheet-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.live-worksheet-table th {
  background-color: #e6ecf2;
  border-right: 1px solid #bdc9d7;
  border-bottom: 1px solid #bdc9d7;
  padding: 4px 6px;
  font-weight: 700;
  color: var(--industrial-navy);
  text-align: center;
  user-select: none;
  white-space: nowrap;
  min-width: 130px;
  resize: horizontal;
  overflow: hidden;
}

.live-worksheet-table th.row-select-cell,
.live-worksheet-table td.row-select-cell {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  resize: none !important;
  text-align: center;
  padding: 0;
  position: sticky;
  left: 0;
  z-index: 15;
  background-color: #e6ecf2;
}

.live-worksheet-table td.row-select-cell {
  background-color: #f9fbfd;
}

.live-worksheet-table th.row-index-cell,
.live-worksheet-table td.row-index-cell {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  resize: none !important;
  text-align: center;
  font-weight: 700;
  position: sticky;
  left: 36px;
  z-index: 15;
  background-color: #e6ecf2;
  color: #495057;
  border-right: 2px solid #a4b7cc;
}

.live-worksheet-table td.row-index-cell {
  background-color: #f1f4f8;
}

.var-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef3f8;
  border: 1px solid #c0d1e6;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 3px;
  font-size: 12px;
  user-select: none;
}
.var-badge-name {
  font-weight: 700;
  color: #003366;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.var-badge-name:hover {
  background-color: #dbe7f4;
}
.var-badge-input-edit {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #003366;
  border: 1px solid #0054a6;
  border-radius: 2px;
  padding: 1px 4px;
  width: 110px;
  outline: none;
  background: #fff;
}


/* Tier 1 Header */
.header-row-c th {
  background-color: #003366;
  color: #ffffff;
  border-color: #002244;
  height: 28px;
}

.header-col-c {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px;
}

.btn-type-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 2px;
}

.type-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.type-tag.num {
  background-color: #28a745;
  color: #fff;
}

.type-tag.cat {
  background-color: #e67e22;
  color: #fff;
}

/* Tier 2 & 3 Input headers */
.header-tier-name input,
.header-tier-unit input,
.var-name-input,
.input-header-varname {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--industrial-navy-dark);
  font-weight: 700;
  text-align: center;
  cursor: text !important;
  pointer-events: auto !important;
  user-select: text !important;
}

.header-tier-name input:hover,
.header-tier-unit input:hover,
.header-tier-name input:focus,
.header-tier-unit input:focus,
.var-name-input:hover,
.var-name-input:focus,
.input-header-varname:hover,
.input-header-varname:focus {
  background-color: #ffffff;
  border-color: #0054a6;
  outline: none;
}

.header-tier-unit input {
  font-weight: 400;
  font-size: 11px;
  color: #666;
}

/* Data Cells */
.live-worksheet-table td {
  border-right: 1px solid #e1e7ed;
  border-bottom: 1px solid #e1e7ed;
  padding: 6px 10px;
  background-color: #ffffff;
  outline: none;
  white-space: nowrap;
}

.live-worksheet-table td.cell-numeric {
  text-align: right;
}

.live-worksheet-table td.cell-categorical {
  text-align: left;
}

.live-worksheet-table tr:hover td {
  background-color: #f3f7fb;
}

.live-worksheet-table tr.row-selected td {
  background-color: #e2effd !important;
}

.col-disabled {
  opacity: 0.45;
  background-color: #f5f5f5 !important;
}

/* ===================================================================
   SESSION WINDOW & MONOSPACE TABLES
   =================================================================== */
.session-window-container {
  background-color: #ffffff;
  border: 1px solid #ced4da;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #212529;
  max-height: 520px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.45;
}

.minitab-table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 8px 0 16px 0;
}

.minitab-table th {
  background-color: #f4f6f9;
  color: var(--industrial-navy);
  border-bottom: 2px solid var(--industrial-navy);
  border-top: 1px solid #ced4da;
  padding: 6px 10px;
  font-weight: 700;
  text-align: right;
}

.minitab-table th:first-child {
  text-align: left;
}

.minitab-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #e9ecef;
  text-align: right;
}

.minitab-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.minitab-table tr:hover td {
  background-color: #f8f9fa;
}

.p-val-sig {
  color: #dc3545;
  font-weight: 700;
}

/* ===================================================================
   2x2 GRAPH GRID
   =================================================================== */
.plots-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 15px;
}

.plot-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.plot-card-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--industrial-navy);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plot-canvas-wrapper {
  flex: 1;
  position: relative;
  min-height: 250px;
  width: 100%;
}

/* ===================================================================
   FORMS, CHECKBOXES & BUTTONS
   =================================================================== */
.form-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #333;
}

.form-control {
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  outline: none;
  background-color: #fff;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--corporate-blue);
  box-shadow: 0 0 0 2px rgba(0, 84, 166, 0.15);
}

.stats-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px;
  margin: 10px 0;
  background-color: #fbfcfd;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
}

.chk-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.chk-item input[type="checkbox"] {
  accent-color: var(--industrial-navy);
  cursor: pointer;
}

.btn-action-primary {
  background: linear-gradient(135deg, var(--industrial-navy) 0%, var(--corporate-blue) 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.2);
  transition: all 0.2s ease;
}

.btn-action-primary:hover {
  background: linear-gradient(135deg, var(--industrial-navy-light) 0%, #0066cc 100%);
  box-shadow: 0 4px 8px rgba(0, 51, 102, 0.3);
}

/* ===================================================================
   MODALS
   =================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog-box {
  background-color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 580px;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header-bar {
  background-color: var(--industrial-navy);
  color: #fff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-bar h3 {
  font-size: 14px;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.modal-body-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer-bar {
  background-color: #f8f9fa;
  border-top: 1px solid var(--border-light);
  padding: 10px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Alert notifications */
.alert-banner {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.alert-banner.info {
  background-color: #e8f4fd;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-banner.success {
  background-color: #e8f8ec;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-banner.danger {
  background-color: #fde8e8;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ===================================================================
   SUB-NAV PILLS & MULTI-OPTION NAVIGATION (38.2 FUNCIONALIDADES)
   =================================================================== */
.sub-nav-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
  padding: 8px 12px;
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.sub-pill-btn {
  padding: 5px 11px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 20px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: var(--industrial-navy) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sub-pill-btn:hover {
  background-color: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #001f3f !important;
}

.sub-pill-btn.active {
  background-color: var(--industrial-navy) !important;
  color: #ffffff !important;
  border-color: var(--industrial-navy-dark) !important;
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.2);
}

/* Sub-pane container */
.sub-pane {
  display: none;
}
.sub-pane.active {
  display: block;
}

/* ===================================================================
   DYNAMIC FACTOR BUILDER TABLES (FACTORIAL, 2^k, RSM, MEZCLAS, DSD)
   =================================================================== */
.factors-builder-container {
  margin: 10px 0 14px 0;
  background: #fbfcfe;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.factors-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.factors-builder-header h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--industrial-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.factors-builder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 8px;
}

.factors-builder-table th {
  background: #e2e8f0;
  color: var(--industrial-navy-dark);
  font-weight: 700;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.factors-builder-table td {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  vertical-align: middle;
}

.factors-builder-table input[type="text"],
.factors-builder-table input[type="number"],
.factors-builder-table select {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  outline: none;
}

.factors-builder-table input:focus,
.factors-builder-table select:focus {
  border-color: var(--corporate-blue);
  box-shadow: 0 0 0 2px rgba(0, 84, 166, 0.15);
}

.btn-builder-action {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.btn-builder-add {
  background-color: #28a745;
  color: #fff;
  border-color: #1e7e34;
}
.btn-builder-add:hover {
  background-color: #218838;
}

.btn-builder-del {
  background-color: #dc3545;
  color: #fff;
  border-color: #bd2130;
}
.btn-builder-del:hover {
  background-color: #c82333;
}

/* Master Inject Button */
.btn-inject-worksheet {
  background: linear-gradient(135deg, #28a745, #1e7e34) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #1c7430 !important;
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3) !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-inject-worksheet:hover {
  background: linear-gradient(135deg, #218838, #19692c) !important;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4) !important;
  transform: translateY(-1px);
}

/* ===================================================================
   TEMPLATE HUB DUAL BUTTONS (.XLSX & .CSV)
   =================================================================== */
.template-hub-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-template-dl {
  background: #ffffff;
  color: var(--industrial-navy);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-template-dl:hover {
  background: #e2e8f0;
  color: var(--industrial-navy-dark);
}

.btn-template-dl.xlsx {
  border-left: 3px solid #28a745;
}

.btn-template-dl.csv {
  border-left: 3px solid #17a2b8;
}

.btn-template-dl.direct {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  color: #b45309;
}

.btn-template-dl.direct:hover {
  background: #fef3c7;
  color: #92400e;
}

.dropzone-box {
  background: #f8fafc;
  border: 2px dashed #003366;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
}

.dropzone-box:hover {
  background: #f1f5f9;
  border-color: #0055a5;
}

.dropzone-box.dragover {
  background: #e0f2fe;
  border-color: #0284c7;
  transform: scale(1.01);
}

/* ===================================================================
   MINITAB 22 DIALOGS & BENCHMARK STYLES (TAB 8 & SUITE)
   =================================================================== */
.disabled-pill {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

.minitab-window-frame {
  background: #f0f2f5;
  border: 1px solid #b0b8c4;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  padding: 16px;
  margin-bottom: 20px;
}

.minitab-window-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.minitab-dialog-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.minitab-dialog-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.minitab-side-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 190px;
}

.btn-minitab-action {
  background: #f8fafc;
  border: 1px solid #94a3b8;
  color: #1e293b;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-minitab-action:hover {
  background: #e2e8f0;
  border-color: #64748b;
  color: #0f172a;
}

.btn-minitab-action:active {
  background: #cbd5e1;
}

.minitab-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #cbd5e1;
  padding-top: 12px;
  margin-top: 16px;
}

.minitab-footer-right {
  display: flex;
  gap: 10px;
}

.btn-minitab-dialog-ok {
  background: #0054a6;
  color: #ffffff;
  border: 1px solid #003366;
  padding: 6px 20px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-minitab-dialog-ok:hover {
  background: #003e80;
}

.btn-minitab-dialog-cancel {
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #94a3b8;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-minitab-dialog-cancel:hover {
  background: #cbd5e1;
}

.btn-minitab-dialog-help {
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-minitab-dialog-help:hover {
  background: #f1f5f9;
}

/* Resolution Matrix Table */
.minitab-res-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: center;
  margin-top: 6px;
}

.minitab-res-matrix-table th, .minitab-res-matrix-table td {
  border: 1px solid #cbd5e1;
  padding: 5px 6px;
}

.minitab-res-matrix-table th {
  background: #f1f5f9;
  font-weight: 700;
}

.res-cell-green {
  background: #d1fae5;
  color: #065f46;
  font-weight: 700;
}

.res-cell-yellow {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.res-cell-red {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.res-cell-empty {
  background: #f8fafc;
  color: #cbd5e1;
}

/* Transfer box */
.minitab-transfer-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.minitab-listbox {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  min-height: 140px;
  max-height: 200px;
  overflow-y: auto;
  flex: 1;
  padding: 4px;
  font-family: 'Consolas', monospace;
  font-size: 12px;
}

.minitab-list-item {
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 2px;
  user-select: none;
}

.minitab-list-item:hover {
  background: #f1f5f9;
}

.minitab-list-item.selected {
  background: #0054a6;
  color: #ffffff;
}

.minitab-transfer-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-transfer {
  background: #f8fafc;
  border: 1px solid #94a3b8;
  padding: 4px 10px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.btn-transfer:hover {
  background: #e2e8f0;
}

/* Draggable Optimization Graph */
.minitab-opt-profile-container {
  display: flex;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  align-items: stretch;
}

.minitab-opt-sidebar-col {
  min-width: 140px;
  border-right: 2px solid #e2e8f0;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.minitab-opt-factor-col {
  min-width: 150px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 8px;
}

.opt-factor-header {
  font-weight: bold;
  font-size: 12px;
  color: #003366;
  margin-bottom: 4px;
}

.opt-factor-val-box {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #f87171;
  border-radius: 3px;
  padding: 2px 6px;
  font-weight: 700;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  margin-bottom: 6px;
  width: 65px;
  text-align: center;
}

.opt-factor-slider-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.opt-slider-input {
  width: 90%;
  cursor: pointer;
  accent-color: #dc2626;
}

/* ===================================================================
   MINITAB 22 FACTORIAL ANALYSIS DIALOG & SESSION WINDOW STYLING
   =================================================================== */

.minitab-window-frame {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 51, 102, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.minitab-window-title {
  background: linear-gradient(135deg, #003366 0%, #004c99 100%);
  color: #ffffff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.minitab-dialog-layout {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #f8fafc;
  align-items: stretch;
}

.minitab-dialog-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.minitab-side-actions {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-minitab-action {
  background: #ffffff;
  border: 1px solid #94a3b8;
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-minitab-action:hover {
  background: #eff6ff;
  border-color: #0054a6;
  color: #003366;
  transform: translateX(2px);
}

.btn-minitab-action:active {
  transform: scale(0.98);
}

.minitab-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
}

.minitab-footer-right {
  display: flex;
  gap: 10px;
}

.btn-minitab-dialog-ok {
  background: #003366;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 51, 102, 0.2);
}

.btn-minitab-dialog-ok:hover {
  background: #002244;
}

.btn-minitab-dialog-cancel {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-minitab-dialog-cancel:hover {
  background: #f1f5f9;
}

.btn-minitab-dialog-help {
  background: transparent;
  color: #0284c7;
  border: 1px solid #bae6fd;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-minitab-dialog-help:hover {
  background: #e0f2fe;
}

.session-window-container {
  background: #ffffff;
  color: #0f172a;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 520px;
  overflow-y: auto;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.session-window-container h4,
.session-window-container strong {
  color: #003366;
}

.residuals-4in1-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .residuals-4in1-grid {
    grid-template-columns: 1fr;
  }
  .minitab-dialog-layout {
    flex-direction: column;
  }
}

/* ===================================================================
   PESTAÑA 8: ESTILOS DE DESEABILIDAD Y OPTIMIZADOR GLOBAL
   =================================================================== */
#table-desirability-setup thead th,
.table-desirability th,
.table-desirability thead th {
  background: #003366 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  text-align: center !important;
  padding: 8px 10px !important;
  border: 1px solid #002244 !important;
}

#table-desirability-setup tbody td,
.table-desirability tbody td {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  padding: 6px 10px;
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
}

#table-desirability-setup tbody tr:nth-child(even) td,
.table-desirability tbody tr:nth-child(even) td {
  background: #f8fafc !important;
}

#table-desirability-setup input,
#table-desirability-setup select,
.table-desirability input,
.table-desirability select {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}

#table-desirability-setup input:focus,
#table-desirability-setup select:focus,
.table-desirability input:focus,
.table-desirability select:focus {
  border-color: #003366 !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.15);
}

/* Multicriteria Prediction Table Styles */
#table-multicriteria-setup thead th,
.table-prediction-minitab thead th {
  background: #003366 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-align: center !important;
  padding: 6px 8px !important;
  border: 1px solid #002244 !important;
}

#table-multicriteria-setup tbody td,
.table-prediction-minitab tbody td {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  padding: 5px 8px;
  font-size: 12px;
  text-align: center;
}

#table-multicriteria-setup tbody tr:nth-child(even) td,
.table-prediction-minitab tbody tr:nth-child(even) td {
  background: #f8fafc !important;
}

#table-multicriteria-setup input,
.table-prediction-minitab input {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}

.minitab-factor-sync-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.minitab-factor-sync-card .factor-name {
  font-size: 13px;
  font-weight: 700;
  color: #003366;
}

.minitab-factor-sync-card .factor-val-input {
  width: 90px;
  font-family: 'Consolas', monospace;
  font-weight: 700;
  color: #003366;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 6px;
  text-align: right;
  font-size: 12.5px;
}

/* Draggable Optimization Profiles */
.minitab-opt-profile-container {
  display: flex;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
  align-items: stretch;
}

.minitab-opt-sidebar-col {
  flex: 0 0 200px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.minitab-opt-factor-col {
  flex: 0 0 170px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.opt-factor-header {
  font-size: 12px;
  font-weight: 700;
  color: #003366;
  text-align: center;
  margin-bottom: 4px;
}

.opt-factor-val-box {
  background: #003366;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  font-family: 'Consolas', monospace;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.opt-factor-slider-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
}

.opt-slider-input {
  width: 90%;
  accent-color: #dc2626;
  cursor: ew-resize;
}

/* ===================================================================
   DESKTOP FILE MENU (.RGDOE) & SCM CASE HUB STYLES
   =================================================================== */

.desktop-menu-container {
  position: relative;
  display: inline-block;
  margin-left: 8px;
}

.menu-dropdown {
  position: relative;
  display: inline-block;
}

.btn-menu-file-trigger {
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-menu-file-trigger:hover,
.btn-menu-file-trigger.active {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.menu-dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #ffffff;
  min-width: 260px;
  box-shadow: 0 10px 25px rgba(0, 31, 63, 0.25);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 0;
  z-index: 3000;
  animation: fadeInDown 0.15s ease-out;
}

.menu-dropdown-content.show {
  display: block;
}

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

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  gap: 10px;
}

.menu-item:hover {
  background: #f1f5f9;
  color: #003366;
}

.menu-item-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.menu-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.menu-text {
  flex: 1;
}

.menu-arrow {
  font-size: 11px;
  color: #94a3b8;
}

.menu-separator {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Submenu for recent projects */
.menu-submenu-wrapper {
  position: relative;
}

.menu-submenu-content {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: #ffffff;
  min-width: 250px;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0, 31, 63, 0.25);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 0;
  z-index: 3100;
}

.menu-submenu-wrapper:hover .menu-submenu-content {
  display: block;
}

.menu-empty-recent {
  padding: 10px 16px;
  font-size: 11.5px;
  color: #94a3b8;
  font-style: italic;
}

.menu-recent-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
}

.menu-recent-item:last-child {
  border-bottom: none;
}

.menu-recent-item:hover {
  background: #eff6ff;
}

.menu-recent-name {
  font-size: 12px;
  font-weight: 700;
  color: #003366;
}

.menu-recent-time {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

/* Button Caso SCM */
.btn-template-dl.scm-case {
  background: linear-gradient(135deg, #e67e22 0%, #d97706 100%);
  color: #ffffff;
  border: 1px solid #f59e0b;
  font-weight: 700;
}

.btn-template-dl.scm-case:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* SCM Cards in Tab 1.4 */
.template-card.scm-card:hover {
  border-color: #003366 !important;
  box-shadow: 0 6px 16px rgba(0, 51, 102, 0.12) !important;
  transform: translateY(-2px);
}
