/* Global Root Containment */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ==========================================================================
   EDEL Elevator Documentation System — Design System & Stylesheet
   ========================================================================== */

:root {
  /* Color Tokens - Dark Mode Default */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(31, 41, 55, 0.75);
  --bg-card-hover: rgba(55, 65, 81, 0.85);
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(6, 182, 212, 0.6);
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;
  --font-lcd: 'Share Tech Mono', monospace;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: rgba(241, 245, 249, 1);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(6, 182, 212, 0.8);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  height: 64px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

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

.logo-badge {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-glow);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.brand-version {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Search Bar */
.search-container {
  position: relative;
  width: 440px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

#searchInput {
  width: 100%;
  height: 38px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 40px 0 38px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

#searchInput:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tasks-badge-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tasks-badge-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(239, 68, 68, 0.35));
  border-color: #f59e0b;
  transform: translateY(-1px);
}

/* --- PWA OFFLINE STATUS BADGE & INSTALL BUTTON --- */
.pwa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: #10b981;
  transition: all 0.25s ease;
  user-select: none;
  backdrop-filter: blur(8px);
}

.pwa-status-badge.offline {
  border-color: rgba(245, 158, 11, 0.5);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.pwa-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pwaPulse 2.5s infinite;
}

.pwa-status-badge.offline .pwa-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: none;
}

@keyframes pwaPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(14, 165, 233, 0.3));
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: var(--radius-md);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-install-btn:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(14, 165, 233, 0.45));
  border-color: #38bdf8;
  transform: translateY(-1px);
  color: #ffffff;
}

.pwa-install-btn.hidden {
  display: none !important;
}


.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   Role Selector Bar
   ========================================================================== */
.role-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  max-width: 1560px;
  margin: 0 auto;
}

@media (max-width: 1380px) {
  .role-selector {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .role-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .role-selector {
    grid-template-columns: 1fr;
  }
}

.role-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.role-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.role-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(99, 102, 241, 0.15));
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.role-icon {
  font-size: 1.6rem;
  background-color: var(--bg-secondary);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.role-info {
  display: flex;
  flex-direction: column;
}

.role-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.role-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Main Workspace Layout — Independent Sidebar & Content Scroll
   ========================================================================== */
.main-container {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Sidebar — Independent Scroll Container */
.sidebar {
  width: 325px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 130px;
  height: calc(100vh - 130px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.3) transparent;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.25);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  color: var(--accent-rose);
  border-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.12);
}

/* Sidebar Tree Actions (Expand/Collapse All) */
.sidebar-tree-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background-color: rgba(15, 23, 42, 0.35);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 48px;
  z-index: 9;
}

.tree-action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  text-align: center;
}

.tree-action-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background-color: var(--accent-cyan-glow);
}

.sidebar-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Collapsible Nav Groups */
.nav-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
}

.nav-group-header {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-group-header:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent-cyan);
}

.nav-group-header.active {
  background-color: var(--accent-cyan-glow);
  color: var(--accent-cyan);
  font-weight: 700;
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}

.nav-group-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  padding: 2px 4px;
  display: inline-block;
}

.nav-group.open > .nav-group-header .nav-group-chevron {
  transform: rotate(90deg);
  color: var(--accent-cyan);
}

.nav-sub-list {
  display: none;
  flex-direction: column;
  padding-left: 8px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.1);
  margin-left: 18px;
  margin-top: 2px;
  margin-bottom: 4px;
  gap: 2px;
}

.nav-group.open > .nav-sub-list {
  display: flex;
}

/* Individual Nav Items */
.nav-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-item.active {
  color: var(--accent-cyan);
  background-color: var(--accent-cyan-glow);
  font-weight: 600;
}

.nav-item.level-1 {
  font-size: 0.83rem;
  padding: 6px 10px;
}

.nav-item.level-2 {
  font-size: 0.79rem;
  padding: 5px 8px 5px 14px;
  color: var(--text-muted);
  border-left: 1px dashed rgba(255, 255, 255, 0.12);
}

.nav-item.level-2:hover {
  color: var(--text-primary);
}

.nav-item.level-2.active {
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}

.nav-item-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Content Area — Clean Max-Width Layout */
.content-area {
  flex: 1;
  min-width: 0 !important;
  padding: 32px 40px;
  max-width: 1180px;
  width: 100%;
  box-sizing: border-box;
}

/* Content Typography */
.doc-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease-in-out;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100%;
  box-sizing: border-box;
}

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

.doc-header h1 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.doc-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Grid Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

/* Code Blocks */
.code-block {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #e2e8f0;
  overflow-x: auto;
  position: relative;
  margin: 12px 0;
  line-height: 1.55;
}

/* Interactive LCD Console Widget */
.lcd-widget {
  background: linear-gradient(145deg, #0d1b2a, #1b263b);
  border: 2px solid #415a77;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 620px;
  margin: 20px 0;
}

.lcd-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #e0e1dd;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.lcd-screen-bezel {
  background-color: #030712;
  border: 4px solid #1b263b;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

.lcd-screen {
  background-color: #002b36;
  border-radius: 4px;
  padding: 14px 18px;
  font-family: var(--font-lcd);
  font-size: 1.25rem;
  color: #00ffcc;
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.6);
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  letter-spacing: 1px;
}

.lcd-line {
  white-space: pre;
  overflow: hidden;
}

.lcd-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lcd-lang-select {
  background-color: #1b263b;
  border: 1px solid #415a77;
  color: #e0e1dd;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.lcd-keypad {
  display: flex;
  gap: 10px;
}

.lcd-btn {
  background: linear-gradient(180deg, #415a77, #1b263b);
  border: 1px solid #778da9;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #0d1b2a;
  transition: all 0.1s ease;
}

.lcd-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #0d1b2a;
}

.lcd-btn.btn-ok { background: linear-gradient(180deg, #10b981, #047857); border-color: #34d399; }
.lcd-btn.btn-esc { background: linear-gradient(180deg, #ef4444, #b91c1c); border-color: #f87171; }

/* Tables & Matrices — Clear High-Contrast Gridlines & Overflow Protection */
.table-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  background-color: var(--bg-secondary);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.4) rgba(15, 23, 42, 0.6);
}

.table-container::-webkit-scrollbar {
  height: 8px;
}
.table-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.4);
  border-radius: 4px;
}
.table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.7);
}

.doc-table,
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  margin: 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
}

.table-container table,
.table-container .doc-table {
  margin: 0;
  border: none;
  min-width: 620px;
}

.card .table-container {
  margin: 14px 0;
  max-width: 100% !important;
}

.doc-table th,
table th,
.doc-table td,
table td {
  overflow-wrap: break-word;
  word-break: normal;
}

.doc-table th,
table th {
  background: linear-gradient(180deg, #1e293b, #111827);
  color: #f1f5f9;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 2px solid var(--accent-cyan);
}

.doc-table td,
table td {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  vertical-align: middle;
  line-height: 1.5;
}

.doc-table tr:nth-child(even),
table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.03);
}

.doc-table tr:hover,
table tbody tr:hover {
  background-color: rgba(6, 182, 212, 0.08);
}

.doc-table td strong,
table td strong {
  color: #f8fafc;
}

.doc-table code,
table code {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #38bdf8;
  font-family: var(--font-mono);
}

/* Light Mode Overrides for Clear Table Lines */
[data-theme="light"] .table-container {
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

[data-theme="light"] .doc-table,
[data-theme="light"] table {
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .doc-table th,
[data-theme="light"] table th {
  background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-bottom: 2px solid var(--accent-cyan);
}

[data-theme="light"] .doc-table td,
[data-theme="light"] table td {
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .doc-table tr:nth-child(even),
[data-theme="light"] table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

[data-theme="light"] .doc-table tr:hover,
[data-theme="light"] table tbody tr:hover {
  background-color: #f0fdf4;
}

[data-theme="light"] .doc-table td strong,
[data-theme="light"] table td strong {
  color: #0f172a;
}

[data-theme="light"] .doc-table code,
[data-theme="light"] table code {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0284c7;
}

/* Callouts / Alerts */
.callout {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-cyan);
  background-color: var(--bg-tertiary);
  margin: 18px 0;
  display: flex;
  gap: 16px;
}

.callout-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.callout-content p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.callout-human {
  border-left-color: var(--accent-indigo);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-left-width: 4px;
}

.callout-relationship {
  border-left-color: var(--accent-emerald);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left-width: 4px;
}

.callout-code {
  border-left-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(30, 41, 59, 0.3));
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-left-width: 4px;
}

.callout-warning {
  border-left-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
}

.callout-danger {
  border-left-color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
}

.callout-blue {
  border-left-color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-left-width: 4px;
}


/* Search Overlay */
.search-results-overlay {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-results-overlay.hidden {
  display: none;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-item:hover {
  border-color: var(--accent-cyan);
  background-color: var(--bg-card-hover);
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 1200px;
  margin: 0 auto;
}

/* Wishlist Badge Button */
.wishlist-badge-btn {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.wishlist-badge-btn:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(59, 130, 246, 0.35));
  border-color: #06b6d4;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
  transform: translateY(-1px);
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  border-color: var(--accent-cyan);
  background-color: var(--bg-card-hover);
}

.hamburger-bar {
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99990;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Breakpoints & Mobile Drawer */
@media (max-width: 900px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 310px !important;
    max-width: 85vw !important;
    z-index: 99999 !important;
    transform: translateX(-105%) !important;
    box-shadow: 14px 0 45px rgba(0, 0, 0, 0.85);
    background-color: #0d1424 !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .role-selector {
    grid-template-columns: 1fr;
  }

  .content-area {
    padding: 20px 16px;
    max-width: 100%;
  }

  .search-container {
    width: 190px;
  }

  .nav-brand .brand-titles {
    display: none;
  }

  .wishlist-badge-btn span:not(.wishlist-icon),
  .tasks-badge-btn span:not(.tasks-icon) {
    display: none;
  }
}

/* Language Switcher Pill */
.lang-switch-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}



/* ==========================================================================
   Security Access Gate (Password/PIN Protected Screen)
   ========================================================================== */
body.auth-locked {
  overflow: hidden !important;
  height: 100vh !important;
}

body.auth-locked > *:not(#authOverlay) {
  filter: blur(25px) !important;
  pointer-events: none !important;
  user-select: none !important;
}

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999999;
  background: radial-gradient(circle at 50% 35%, rgba(15, 23, 42, 0.97) 0%, rgba(2, 6, 23, 0.99) 100%);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 18px;
  box-shadow: 0 25px 70px -12px rgba(0, 0, 0, 0.95), 0 0 45px rgba(6, 182, 212, 0.18);
  padding: 38px 32px 30px;
  text-align: center;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 9999px;
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.auth-lock-icon {
  font-size: 1rem;
}

.auth-logo {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  padding: 5px 14px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  margin-bottom: 14px;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.auth-prompt {
  font-size: 0.93rem;
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.pin-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.pin-input {
  width: 100%;
  padding: 14px 48px 14px 20px;
  font-family: var(--font-mono);
  font-size: 1.7rem;
  letter-spacing: 8px;
  text-align: center;
  background: rgba(2, 6, 23, 0.85);
  border: 2px solid rgba(6, 182, 212, 0.4);
  border-radius: 12px;
  color: #38bdf8;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.pin-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.4), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.pin-toggle-visibility {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.pin-toggle-visibility:hover {
  opacity: 1;
}

.auth-error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.12);
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: fadeIn 0.2s ease;
}

.auth-error-msg.hidden {
  display: none;
}

.auth-submit-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4);
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

.auth-footer-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

@keyframes shakeCard {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.auth-card.shake {
  animation: shakeCard 0.45s ease-in-out;
  border-color: #ef4444;
}

.lock-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lock-btn:hover {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
  background-color: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   INTERACTIVE ENGINEERING TOOLS (Section 5) & FIELD STYLES
   ========================================================================== */

/* Static Callout Link to Interactive Tools */
.interactive-tool-link-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid var(--accent-cyan);
  border-left: 5px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.1);
}

.interactive-tool-link-banner .banner-icon {
  font-size: 2rem;
  line-height: 1;
}

.interactive-tool-link-banner strong {
  color: var(--text-primary);
  font-size: 1rem;
}

.interactive-tool-link-banner a.inline-tool-link {
  color: var(--accent-cyan);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  transition: all 0.2s ease;
}

.interactive-tool-link-banner a.inline-tool-link:hover {
  color: #38bdf8;
  text-decoration: none;
}

/* Tool Header & Wrapper */
.tool-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-md);
}

/* 1. DIP SWITCH CALCULATOR */
.dip-calculator-card {
  background: #0f172a;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 1.5rem;
}

.dip-switch-bank {
  display: inline-flex;
  gap: 12px;
  background: #1e1b4b;
  padding: 16px 20px;
  border-radius: 10px;
  border: 2px solid #4338ca;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 1rem 0;
  flex-wrap: wrap;
}

.dip-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dip-unit-header {
  font-size: 0.72rem;
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-weight: 700;
}

.dip-body {
  width: 32px;
  height: 60px;
  background: #dc2626;
  border-radius: 4px;
  padding: 3px;
  position: relative;
  cursor: pointer;
  user-select: none;
  border: 1px solid #991b1b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: background-color 0.2s ease;
}

.dip-body.is-on {
  background: #16a34a;
  border-color: #15803d;
}

.dip-body .dip-slot {
  width: 100%;
  height: 100%;
  background: #1f2937;
  border-radius: 2px;
  position: relative;
}

.dip-body .dip-knob {
  width: 100%;
  height: 24px;
  background: #f8fafc;
  border-radius: 2px;
  position: absolute;
  left: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: top 0.15s ease-in-out;
}

.dip-body.is-on .dip-knob {
  top: 2px;
  background: #ffffff;
}

.dip-body:not(.is-on) .dip-knob {
  top: 30px;
  background: #cbd5e1;
}

.dip-unit-weight {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 600;
}

.dip-unit-state {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.dip-unit-state.on {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.dip-unit-state.off {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.dip-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 1.5rem;
}

.dip-res-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.dip-res-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dip-res-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-top: 4px;
}

.dip-res-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.dip-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.dip-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-mono);
}

.dip-preset-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* 2. LIVE FAULT DIAGNOSTICS ASSISTANT */
.fault-filter-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.fault-search-box {
  width: 100%;
  position: relative;
}

.fault-search-input {
  width: 100%;
  height: 44px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px 0 42px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.fault-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.fault-search-box .search-icon-faults {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.fault-chips-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fault-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.fault-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.fault-chip.active {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: var(--accent-cyan);
  font-weight: 700;
}

.fault-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fault-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.2s ease;
}

.fault-item-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fault-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.fault-code-badge {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.fault-title-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.multimeter-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.88rem;
  color: #a7f3d0;
}

.multimeter-box strong {
  color: #34d399;
}

.reset-step-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 0.88rem;
  color: #fde68a;
}

.reset-step-box strong {
  color: #fbbf24;
}

/* 3. INTERACTIVE TERMINAL & BORNA VISUALIZER */
.terminal-board-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-top: 1.5rem;
}

@media (max-width: 992px) {
  .terminal-board-layout {
    grid-template-columns: 1fr;
  }
}

.terminal-strip-block {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.terminal-strip-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.terminal-pins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 8px;
}

.terminal-pin-cell {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.terminal-pin-cell:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.terminal-pin-cell.selected {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(99, 102, 241, 0.3));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.pin-num {
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.pin-name {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-volt {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 4px;
  display: inline-block;
}

.pin-volt.v110 {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.pin-volt.v24 {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.pin-volt.vcan {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.pin-volt.vgnd {
  background: rgba(107, 114, 128, 0.25);
  color: #d1d5db;
}

.terminal-inspector-panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 90px;
}

/* 4. EXPANDED LCD SIMULATOR */
.virtual-lcd-console-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1e1e24;
  border: 4px solid #334155;
  border-radius: 20px;
  padding: 24px;
  max-width: 480px;
  margin: 1.5rem auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.lcd-16x4-bezel {
  background: #2a3441;
  border: 3px solid #111827;
  border-radius: 8px;
  padding: 14px 18px;
  width: 100%;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.8);
}

.lcd-16x4-screen {
  background: #84a98c;
  color: #0d2818;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 1.5px;
  border-radius: 4px;
  padding: 10px 14px;
  text-shadow: 0 0 2px rgba(13, 40, 24, 0.3);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  min-height: 120px;
}

.lcd-16x4-line {
  white-space: pre;
  overflow: hidden;
  height: 1.5rem;
}

.lcd-4button-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

.lcd-tactile-btn {
  background: linear-gradient(180deg, #475569, #334155);
  border: 1px solid #64748b;
  border-bottom: 4px solid #1e293b;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 14px 6px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s ease;
  user-select: none;
}

.lcd-tactile-btn:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}

.lcd-tactile-btn.btn-enter {
  background: linear-gradient(180deg, #059669, #047857);
  border-color: #10b981;
  border-bottom-color: #064e3b;
}

.lcd-tactile-btn.btn-esc {
  background: linear-gradient(180deg, #dc2626, #b91c1c);
  border-color: #ef4444;
  border-bottom-color: #7f1d1d;
}

/* 5. PRINT MEDIA & CHEATSHEET STYLES */
.cheatsheet-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.print-btn-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-cyan);
  color: #0f172a;
  border: none;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.print-btn-field:hover {
  background: #38bdf8;
  transform: translateY(-1px);
}

.printable-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 2rem;
}

@media print {
  /* Hide non-printable web UI components */
  .header,
  .role-bar,
  .sidebar,
  .sidebar-backdrop,
  .mobile-menu-btn,
  .cheatsheet-toolbar,
  #authOverlay,
  .nav-actions,
  .search-container {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .main-container {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .content-area {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    height: auto !important;
  }

  .printable-sheet {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    page-break-after: always;
    box-shadow: none !important;
    padding: 15mm !important;
  }

  .printable-sheet h1, 
  .printable-sheet h2, 
  .printable-sheet h3 {
    color: #000000 !important;
  }

  .printable-sheet table, 
  .printable-sheet th, 
  .printable-sheet td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .printable-sheet th {
    background: #e2e8f0 !important;
  }
}

/* ==========================================================================
   INTERACTIVE TOOLS 5.6 TO 5.12 COMPONENT STYLES
   ========================================================================== */

/* 1. SHAFT MAGNET & SLOWDOWN CALCULATOR */
.shaft-calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .shaft-calc-container {
    grid-template-columns: 1fr;
  }
}

.shaft-form-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shaft-svg-panel {
  background: #090d16;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.shaft-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shaft-field-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.shaft-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.shaft-input-row input,
.shaft-input-row select {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.shaft-unit-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  min-width: 48px;
}

.shaft-calc-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.shaft-metric-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.shaft-metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shaft-metric-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: #38bdf8;
  margin-top: 4px;
}

/* 2. FUJI PARAMETER GENERATOR */
.fuji-calc-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

.fuji-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.fuji-table-responsive {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.fuji-code-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* 3. SAFETY CHAIN INTERACTIVE TRACER */
.safety-tracer-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

.safety-chain-schematic {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.safety-node-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  transition: all 0.2s ease;
}

.safety-node-item.node-open {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.safety-node-item.node-closed {
  border-color: #10b981;
}

.safety-node-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.safety-borna-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
}

.safety-switch-toggle-btn {
  background: #10b981;
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.safety-switch-toggle-btn.btn-tripped {
  background: #ef4444;
}

.multimeter-box-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #050b14;
  border: 2px solid #0284c7;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-top: 18px;
}

.multimeter-digits {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2.2rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 2px;
}

/* 4. K3 HYDRAULIC OPTIMIZER */
.hydraulic-opt-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

.waveform-svg-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 18px 0;
  overflow-x: auto;
}

/* 5. CAN BUS CHECKER */
.can-checker-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

.can-nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.can-node-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.can-meter-card {
  background: #050b14;
  border: 2px solid #10b981;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
}

.can-meter-card.meter-warn {
  border-color: #f59e0b;
}

.can-meter-card.meter-error {
  border-color: #ef4444;
}

/* 6. LOAD WEIGHER CALIBRATION */
.weigher-cal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

.weigher-bar-wrapper {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weigher-bar-track {
  width: 100%;
  height: 28px;
  background: #1e293b;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid #334155;
}

.weigher-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  transition: width 0.2s ease, background 0.2s ease;
}

.weigher-bar-fill.fill-80 {
  background: linear-gradient(90deg, #10b981, #f59e0b);
}

.weigher-bar-fill.fill-110 {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* 7. COMMISSIONING WIZARD */
.commissioning-wizard-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 1.5rem 0;
}

.commission-progress-track {
  width: 100%;
  height: 12px;
  background: #1e293b;
  border-radius: 6px;
  overflow: hidden;
  margin: 14px 0 24px 0;
}

.commission-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  transition: width 0.3s ease;
}

.commission-phase-block {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.commission-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.commission-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.commission-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.4);
  cursor: pointer;
  transition: background 0.15s ease;
}

.commission-check-item:hover {
  background: rgba(6, 182, 212, 0.08);
}

.commission-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #06b6d4;
  cursor: pointer;
  margin-top: 2px;
}

.commission-check-item.item-completed span {
  text-decoration: line-through;
  color: var(--text-muted);
}


/* ==========================================================================
   CONFIGURADOR DE PEDIDOS EDEL — ESTILOS COMPLETOS
   ========================================================================== */
.cfg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0 40px;
  animation: fadeIn 0.25s ease-out;
}

.cfg-hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.cfg-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.cfg-hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.cfg-hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 900px;
  margin-bottom: 24px;
}

.cfg-preset-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.cfg-preset-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.cfg-preset-icon {
  font-size: 1.6rem;
}

.cfg-preset-header h3 {
  font-size: 1.15rem;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.cfg-preset-header p {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0;
}

.cfg-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cfg-pill-btn {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cfg-pill-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.cfg-pill-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.cfg-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

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

.cfg-module-card {
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cfg-module-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.cfg-module-card.selected {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border-color: #0ea5e9;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.cfg-card-status {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #64748b;
}

.cfg-module-card.selected .cfg-card-status {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.cfg-card-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.cfg-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.cfg-card-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 14px;
}

.cfg-card-meta {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cfg-cta-bar {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.cfg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.cfg-action-btn.primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.cfg-action-btn.primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

.cfg-action-btn.secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cfg-action-btn.secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
}

/* FORMS */
.cfg-section-header {
  margin-bottom: 22px;
}

.cfg-section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
}

.cfg-section-header p {
  color: #94a3b8;
  font-size: 0.95rem;
}

.cfg-form-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cfg-card-legend {
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.cfg-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cfg-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 800px) {
  .cfg-grid-3, .cfg-grid-2 {
    grid-template-columns: 1fr;
  }
}

.cfg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cfg-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cfg-input, .cfg-select {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.92rem;
  color: #f8fafc;
  outline: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cfg-input:focus, .cfg-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  background: rgba(30, 41, 59, 0.95);
}

.cfg-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.cfg-segment {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}

.cfg-seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.cfg-seg-btn:hover {
  color: #f1f5f9;
}

.cfg-seg-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.cfg-matches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cfg-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cfg-match-row:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.cfg-match-row.selected {
  background: rgba(14, 165, 233, 0.15);
  border-color: #0ea5e9;
}

.cfg-match-ref {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #38bdf8;
  font-size: 0.9rem;
  width: 130px;
}

.cfg-match-info {
  flex: 1;
  padding: 0 16px;
}

.cfg-match-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.cfg-match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cfg-match-tags span {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #94a3b8;
}

.cfg-match-tags span.tag-rescate {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.cfg-select-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.cfg-match-row.selected .cfg-select-btn {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.cfg-counter-badge {
  font-size: 0.75rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

.cfg-table-container {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.cfg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.cfg-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.cfg-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.cfg-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cfg-table-input {
  width: 90px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 5px 8px;
  color: #38bdf8;
  font-weight: 700;
  font-family: inherit;
}

.cfg-total-hueco {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #38bdf8;
}

.cfg-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .cfg-checkbox-grid {
    grid-template-columns: 1fr;
  }
  .pwa-status-text {
    display: none;
  }
  .pwa-status-badge {
    padding: 6px 8px;
  }
}

.cfg-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.4);
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.cfg-check-label:hover {
  background: rgba(56, 189, 248, 0.08);
}

.cfg-check-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #0284c7;
  cursor: pointer;
}

.cfg-warnings-panel {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 16px 20px;
  color: #fbbf24;
}

.cfg-warn-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.88rem;
}

.cfg-warn-card.error {
  color: #f87171;
}

.cfg-warn-card.warning {
  color: #fbbf24;
}

.cfg-warn-card.info {
  color: #38bdf8;
}

.cfg-warn-code {
  font-weight: 700;
  font-family: monospace;
}

.cfg-cat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  padding: 3px 8px;
  border-radius: 4px;
  color: #94a3b8;
  display: inline-block;
}

.cfg-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cfg-export-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.cfg-export-btn.print {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
}

.cfg-nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

/* ==========================================================================
   Schematic Visual Cards & Sizing Control
   ========================================================================== */
.schematic-card {
  max-width: 680px !important;
  width: 100% !important;
  margin: 1.5rem auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.schematic-card img {
  max-width: 100% !important;
  max-height: 360px !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Strict Layout Containment */
.main-container {
  max-width: 100vw !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.content-area {
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

#docBody {
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.doc-section, .card {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Tables scroll ONLY within their own container */
.table-container {
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* Configurador 2026: Financial Summary Cards & ERP BOM */
.cfg-financial-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.cfg-fin-card {
  background: var(--bg-secondary, #1a2332);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 10px);
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cfg-fin-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.25));
}



/* ==========================================================================
   POWERBI 2026 DASHBOARD & DECISION MATRIX REVIEW STYLES
   ========================================================================== */

/* Navbar Quick Access Badge */
.bi-quick-badge-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(129, 140, 248, 0.2) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}
.bi-quick-badge-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35) 0%, rgba(129, 140, 248, 0.35) 100%) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

/* Security Access Gate Overlay for PIN 876321 */
.bi-gate-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 24px;
}
.bi-gate-card {
  background: linear-gradient(145deg, #111827 0%, #0b0f19 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  padding: 36px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.15);
  text-align: center;
}
.bi-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.bi-gate-logo {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bi-gate-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 10px;
}
.bi-gate-subtitle {
  font-size: 0.92rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 22px;
}
.bi-gate-prompt {
  font-size: 0.95rem;
  color: #f1f5f9;
  margin-bottom: 14px;
}
.bi-pin-input-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bi-pin-input {
  font-family: var(--font-mono, monospace);
  font-size: 1.8rem;
  letter-spacing: 12px;
  text-align: center;
  width: 220px;
  padding: 10px 14px;
  background: #030712;
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  color: #38bdf8;
  outline: none;
  transition: all 0.2s ease;
}
.bi-pin-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}
.bi-pin-toggle {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 1.2rem;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bi-pin-toggle:hover {
  background: #334155;
  color: #f8fafc;
}
.bi-pin-error {
  color: #ef4444;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.bi-gate-submit-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}
.bi-gate-submit-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}
.bi-gate-info-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  margin-top: 24px;
}
.bi-gate-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  font-size: 0.75rem;
  color: #64748b;
}

/* PowerBI Dashboard Layout */
.bi-content-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 0 40px;
}
.bi-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #090d16 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.bi-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 14px;
  margin-bottom: 8px;
}
.bi-live-dot {
  width: 7px;
  height: 7px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 2s infinite;
}
.bi-top-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 4px;
}
.bi-top-subtitle {
  font-size: 0.95rem;
  color: #94a3b8;
  margin: 0;
}
.bi-top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.bi-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.bi-action-btn.config-link {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.bi-action-btn.config-link:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}
.bi-action-btn.lock {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.bi-action-btn.lock:hover {
  background: rgba(239, 68, 68, 0.25);
}
.bi-action-btn.primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
}
.bi-action-btn.primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
}
.bi-action-btn.secondary {
  background: #1e293b;
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.1);
}
.bi-action-btn.secondary:hover {
  color: #f8fafc;
  background: #334155;
}

/* KPI Tiles Grid */
.bi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.bi-kpi-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.bi-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.bi-kpi-card.cyan::before { background: #38bdf8; }
.bi-kpi-card.emerald::before { background: #34d399; }
.bi-kpi-card.amber::before { background: #fbbf24; }
.bi-kpi-card.purple::before { background: #c084fc; }

.bi-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.bi-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.bi-kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}
.bi-kpi-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.bi-kpi-number {
  font-size: 2rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
  margin-bottom: 6px;
}
.bi-kpi-subtext {
  font-size: 0.78rem;
  color: #64748b;
}

/* Card & Grid */
.bi-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  margin-bottom: 20px;
}
.bi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.bi-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bi-card-icon {
  font-size: 1.5rem;
}
.bi-card-title-group h2, .bi-card-title-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}
.bi-card-title-group p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
}
.bi-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}

/* Tables in PowerBI */
.bi-table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.bi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}
.bi-table th {
  background: #0f172a;
  color: #cbd5e1;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bi-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}
.bi-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}
.bi-row-accent td {
  background: rgba(56, 189, 248, 0.08) !important;
}
.bi-highlight-number {
  color: #38bdf8;
  font-size: 1.15rem;
}

/* Category Pills */
.bi-cat-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bi-cat-pill.maniobra { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.bi-cat-pill.botonera { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.bi-cat-pill.iep { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.bi-cat-pill.mecanica { background: rgba(244, 114, 182, 0.2); color: #f472b6; }
.bi-cat-pill.complete { background: rgba(192, 132, 252, 0.2); color: #c084fc; }
.bi-cat-pill.catalog { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.bi-cat-pill.otros { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

/* Progress Bars */
.bi-progress-item {
  margin-bottom: 14px;
}
.bi-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.bi-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.bi-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Monthly Chart */
.bi-monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 220px;
  padding: 20px 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.bi-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  cursor: pointer;
}
.bi-chart-val {
  font-size: 0.7rem;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 4px;
}
.bi-chart-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bi-chart-bar {
  width: 70%;
  max-width: 32px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease, filter 0.2s ease;
}
.bi-chart-col:hover .bi-chart-bar {
  filter: brightness(1.25);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
.bi-chart-label {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 8px;
}

/* Client Leaderboard */
.bi-client-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bi-client-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.bi-client-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 50%;
}
.bi-client-info {
  flex: 1;
}
.bi-client-name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.88rem;
}
.bi-client-city {
  font-size: 0.75rem;
  color: #64748b;
}
.bi-client-amount {
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 0.9rem;
}

/* Filter Toolbar */
.bi-grid-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.bi-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.bi-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}
.bi-search-field {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f8fafc;
  outline: none;
  font-size: 0.88rem;
}
.bi-search-field:focus {
  border-color: #38bdf8;
}
.bi-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bi-chip {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bi-chip:hover {
  background: #334155;
  color: #f8fafc;
}
.bi-chip.active {
  background: #38bdf8;
  color: #030712;
  font-weight: 700;
  border-color: #38bdf8;
}

/* Project Cards */
.bi-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.bi-project-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  transition: all 0.2s ease;
}
.bi-project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.bi-project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.bi-project-num {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: #38bdf8;
}
.bi-project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 2px 0 0 0;
}
.bi-project-date {
  font-size: 0.75rem;
  color: #64748b;
}
.bi-project-client {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 10px;
}
.bi-project-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bi-project-financials {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.bi-fin-lbl {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
}
.bi-fin-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  font-family: var(--font-mono, monospace);
}
.bi-fin-val.total {
  color: #34d399;
  font-weight: 700;
  font-size: 1.05rem;
}

/* Decision Matrix Reviews in Configurator */
.cfg-matrix-status {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}
.cfg-matrix-status:focus {
  border-color: #38bdf8;
}
.bi-nav-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ----------------------------------------------------
   PowerBI Material Needs & Production Dashboard Styles
   ---------------------------------------------------- */
.bi-spinning {
  display: inline-block;
  animation: bi-spin 1s linear infinite;
}
@keyframes bi-spin {
  100% { transform: rotate(360deg); }
}

.bi-sync-notice {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  margin-top: 12px;
  display: none;
}
.bi-sync-notice.info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}
.bi-sync-notice.success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}
.bi-sync-notice.warning {
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.3);
  color: #fdba74;
}

.bi-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.bi-badge.critica {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.bi-badge.ok {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.bi-badge.retrasado {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.bi-badge.pendiente {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.bi-tabs-bar {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  padding-bottom: 2px;
}
.bi-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  border-radius: 6px 6px 0 0;
}
.bi-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}
.bi-tab-btn.active {
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.08);
}
.bi-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #38bdf8;
}

.bi-kpi-sub {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 4px;
}

/* ==========================================================================
   POWERBI 360° DRILL-DOWN MODAL & INTERACTIVE KPI STYLES
   ========================================================================== */

/* Clickable KPI Cards */
.bi-kpi-card.clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  user-select: none;
}
.bi-kpi-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(56, 189, 248, 0.2);
}
.bi-kpi-card.clickable:active {
  transform: translateY(0);
}
.bi-kpi-card.clickable.active {
  box-shadow: 0 0 0 2px #38bdf8, 0 8px 25px rgba(56, 189, 248, 0.3) !important;
  background: rgba(56, 189, 248, 0.08) !important;
}

/* Clickable Table Rows */
.bi-clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.bi-clickable-row:hover {
  background-color: rgba(56, 189, 248, 0.12) !important;
}

.bi-sku-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bi-zoom-icon {
  font-size: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.bi-clickable-row:hover .bi-zoom-icon {
  opacity: 1;
  transform: scale(1.2);
}

/* 360° Modal Backdrop & Container */
.bi-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: biFadeIn 0.2s ease-out;
}
@keyframes biFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bi-modal-container {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: biSlideUp 0.25s ease-out;
}
@keyframes biSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.bi-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.95);
}
.bi-modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 1.3rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.bi-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.bi-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Ribbon Stats */
.bi-modal-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.bi-ribbon-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
}
.bi-ribbon-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.bi-ribbon-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
}

/* Modal Sub-Tabs */
.bi-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}
.bi-modal-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  position: relative;
}
.bi-modal-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}
.bi-modal-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  font-weight: 700;
}
.bi-modal-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #38bdf8;
}

/* ==========================================================================
   Pricing Engine (Option A) & Client Selector Styles
   ========================================================================== */
.cfg-pricing-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.cfg-pricing-status-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cfg-pricing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.cfg-pricing-timestamp {
  font-size: 0.8rem;
  color: #94a3b8;
}
.cfg-pricing-timestamp strong {
  color: #e2e8f0;
}
.cfg-pricing-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(16, 185, 129, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cfg-pricing-refresh-btn:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(16, 185, 129, 0.35));
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}
.cfg-client-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.cfg-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.cfg-client-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}
.cfg-client-chip.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(16, 185, 129, 0.25));
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.cfg-client-chip .chip-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
}
.cfg-client-chip.active .chip-code {
  color: #a7f3d0;
  background: rgba(0, 0, 0, 0.4);
}
.cfg-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}
.cfg-tier-badge.t1 {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.cfg-tier-badge.t2 {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.cfg-tier-badge.t3 {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.4);
}
.cfg-tier-badge.t4 {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.cfg-tier-badge.t5 {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}





/* ==========================================================================
   TASK-12: RBAC GRANULAR ACCESS CONTROL & USER BADGE STYLING
   ========================================================================== */

/* User Navbar Badge */
.user-nav-badge {
  display: flex;
  align-items: center;
}

.user-badge-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.user-badge-pill:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.user-badge-icon {
  font-size: 1.1rem;
}

.user-badge-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-switch-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  cursor: pointer;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.user-badge-switch-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-color: #38bdf8;
  transform: rotate(180deg);
}

/* Modal Backdrop & Container */
.rbac-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.rbac-modal-content {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.rbac-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rbac-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
}

.rbac-modal-close:hover {
  color: #f8fafc;
}

.rbac-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.rbac-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

/* Role Selector Grid Card */
.rbac-role-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rbac-role-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.rbac-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rbac-role-icon {
  font-size: 1.6rem;
}




/* ==========================================================================
   TASK-12: UNIVERSAL ISOLATED SINGLE-PAGE MODE & FLOATING CONTROLS
   ========================================================================== */

/* Universal Section Isolated Action Bar */
.edel-section-isolated-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.75));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 10px 18px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}
.edel-section-isolated-bar:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.15);
}
.edel-sec-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.edel-sec-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  white-space: nowrap;
}
.edel-sec-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edel-sec-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-isolated-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}
.btn-isolated-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}
.btn-isolated-action.btn-isolated-primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(2, 132, 199, 0.4));
  border-color: #0284c7;
  color: #38bdf8;
}
.btn-isolated-action.btn-isolated-primary:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Floating Pill in Isolated Mode */
#isolatedFloatingPill {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.25);
  border-radius: 30px;
  padding: 6px 14px;
  backdrop-filter: blur(14px);
  color: #f8fafc;
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #38bdf8;
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
}
.pill-title {
  font-size: 0.82rem;
  color: #cbd5e1;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill-btn {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #ffffff;
}
.pill-btn.pill-btn-exit {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.pill-btn.pill-btn-exit:hover {
  background: #ef4444;
  color: #fff;
}

/* Toast feedback */
.edel-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000000;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.3);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUpToast 0.25s ease-out;
}
@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Isolated Mode Global Viewport Overrides */
body.isolated-mode {
  background: #090d16 !important;
}
body.isolated-mode .header,\	body.isolated-mode .navbar,\	body.isolated-mode header.navbar,
body.isolated-mode .role-selector,
body.isolated-mode .top-nav,
body.isolated-mode .sidebar,
body.isolated-mode #searchModal,
body.isolated-mode .sidebar-toggle,
body.isolated-mode .sidebar-backdrop,
body.isolated-mode .cfg-nav-footer,
body.isolated-mode .footer {
  display: none !important;
}
body.isolated-mode .main-container {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
}
body.isolated-mode .content-area {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 24px !important;
}
body.isolated-mode #docBody {
  max-width: 1600px;
  margin: 0 auto;
}
body.isolated-mode .btn-isolated-toggle {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fca5a5 !important;
}


/* Admin Multi-Page Tab Navigation (TASK-12) */
.admin-nav-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.admin-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #94a3b8;
  text-align: left;
}
.admin-tab-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  transform: translateY(-1px);
}
.admin-tab-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.25));
  border-color: #0284c7;
  color: #38bdf8;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.25);
}
.admin-tab-btn .tab-icon {
  font-size: 1.35rem;
}
.admin-tab-btn .tab-text strong {
  display: block;
  font-size: 0.92rem;
  color: inherit;
}
.admin-tab-btn .tab-text small {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
}


/* ========================================================
   POWERBI LIVE DASHBOARD STYLES (#bi-orders)
   ======================================================== */
.pbi-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 10px 0 40px 0;
  max-width: 1480px;
  margin: 0 auto;
}

.pbi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px 28px;
  backdrop-filter: blur(12px);
}

.pbi-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 9999px;
  margin-bottom: 8px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pbi-pulse 2s infinite;
}

@keyframes pbi-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.pbi-header-left h2 {
  font-size: 24px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.pbi-header-left p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.pbi-btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.pbi-btn-refresh:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* KPI CARDS GRID */
.pbi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.pbi-kpi-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pbi-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(30, 41, 59, 0.8);
}

.pbi-kpi-card.active {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.kpi-icon-box {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 12px;
  flex-shrink: 0;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.kpi-val {
  font-size: 32px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
  margin: 2px 0;
}

.kpi-sub {
  font-size: 12px;
  color: #64748b;
}

/* CHARTS ROW */
.pbi-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .pbi-charts-row {
    grid-template-columns: 1fr;
  }
}

.pbi-chart-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
}

.pbi-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.pbi-chart-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.pbi-chart-hint {
  font-size: 11px;
  color: #64748b;
}

/* DONUT */
.pbi-donut-container {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.pbi-donut-graphic {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
}

.donut-center-val {
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
}

.donut-center-lbl {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
}

.pbi-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 180px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.legend-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.legend-row.active-legend {
  background: rgba(59, 130, 246, 0.15);
  outline: 1px solid #3b82f6;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  font-size: 13px;
  color: #e2e8f0;
  flex: 1;
}

.legend-count {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

/* BARS */
.pbi-bars-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 0;
}

.pbi-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.pbi-bar-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pbi-bar-row.active-bar {
  background: rgba(139, 92, 246, 0.15);
  outline: 1px solid #8b5cf6;
}

.pbi-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.emp-name {
  font-weight: 700;
  color: #f1f5f9;
}

.emp-meta {
  color: #94a3b8;
  font-size: 12px;
}

.pbi-bar-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.pbi-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* FILTER & SEARCH BAR */
.pbi-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 20px;
}

.pbi-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  width: 100%;
  max-width: 420px;
}

.pbi-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 13px;
  width: 100%;
}

.pbi-filter-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pbi-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.pbi-tag:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.pbi-orders-counter {
  font-size: 13px;
  color: #94a3b8;
}

/* DATA GRID TABLE */
.pbi-table-container {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow-x: auto;
}

.pbi-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.pbi-table th {
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pbi-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.pbi-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.tramitado {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.gestion {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.incidencia {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.pbi-emp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.pbi-emp-badge.assigned {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.pbi-emp-badge.unassigned {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.pbi-mat-tag {
  color: #e2e8f0;
  font-weight: 500;
}


#bi-orders.portal-section {
  display: none;
  width: 100%;
}
#bi-orders.portal-section.active {
  display: block !important;
}
