/* ==========================================================================
   MSOperator - Stylesheet (Replicating exact video UI and interactions)
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  --text-light: #cbd5e1;
  
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-border: #bbf7d0;
  --danger: #dc2626;
  --warning: #d97706;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 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-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-window: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-main);
  background-color: var(--bg-app);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ==========================================================================
   Demo Workflow Floating Control Bar
   ========================================================================== */
.demo-controller {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  color: #fff;
  transition: all 0.3s ease;
}

.demo-controller.collapsed {
  transform: translateX(-50%) translateY(-70px);
  opacity: 0.2;
}

.demo-ctrl-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.ctrl-title {
  font-weight: 600;
  font-size: 12px;
  color: #f8fafc;
}

.ctrl-desc {
  font-size: 11px;
  color: #94a3b8;
}

.demo-step-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 4px;
  border-radius: 16px;
}

.pill-step {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-step:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.pill-step.active {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.demo-ctrl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-demo {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-demo:hover {
  background: #1d4ed8;
}

.btn-demo.secondary {
  background: rgba(255, 255, 255, 0.12);
}

.btn-demo.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-demo-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 50%;
}

.btn-demo-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Page View Switcher
   ========================================================================== */
.view-container {
  width: 100vw;
  height: 100vh;
  display: none;
  flex-direction: column;
}

.view-container.active {
  display: flex;
}

/* ==========================================================================
   Scenario 1: Project Hub
   ========================================================================== */
.hub-header {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.hub-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-app {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--primary-border);
}

.hub-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.hub-workspace-path {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-workspace-path code {
  font-family: var(--font-mono);
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-main);
}

.hub-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  width: 240px;
}

.icon-search {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-sub);
}

.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-dark);
}

.btn-primary {
  height: 34px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.hub-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: #f8fafc;
}

.hub-empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.hub-projects-list {
  width: 100%;
  max-width: 800px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.project-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.project-icon {
  width: 42px;
  height: 42px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-info {
  flex: 1;
}

.p-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.p-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.file-count {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.btn-open-project {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
}

.btn-open-project:hover {
  background: var(--primary);
  color: #fff;
}

.hub-footer {
  height: 48px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-rows {
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 12px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-num {
  width: 26px;
  height: 26px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.page-arrow {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: not-allowed;
  opacity: 0.5;
}

/* ==========================================================================
   macOS Window & Modal Universal Styles
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mac-window {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-window);
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.mac-titlebar {
  height: 38px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  user-select: none;
}

.mac-traffic-lights {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}

.dot.close { background: #ff5f56; border: 1px solid #e0443e; }
.dot.minimize { background: #ffbd2e; border: 1px solid #dea123; }
.dot.maximize { background: #27c93f; border: 1px solid #1aab29; }

.mac-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.titlebar-placeholder {
  width: 50px;
}

/* Modal: Create New Project */
.modal-window {
  width: 440px;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: #fff;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-secondary {
  height: 32px;
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-dark);
}

/* ==========================================================================
   Workspace Top Navigation Bar (WS Header)
   ========================================================================== */
.ws-header {
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  user-select: none;
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.ws-brand:hover {
  background: var(--bg-hover);
}

.brand-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.2px;
}

.ws-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.ws-tab {
  height: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.ws-tab:hover {
  color: var(--text-main);
  background: rgba(241, 245, 249, 0.6);
}

.ws-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.ws-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-assistant-toggle {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-assistant-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-dark);
}

.user-pill-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
}

.user-status-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
}

.ws-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-app);
}

.tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TAB 1: Sample Selection Layout
   ========================================================================== */
.sample-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.sample-sidebar {
  width: 320px;
  min-width: 320px;
  background: #fff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
}

.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.sample-count-badge {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.sidebar-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn {
  width: 25px;
  height: 25px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}

.sidebar-header-bottom {
  width: 100%;
}

.view-switch-mini {
  display: flex;
  background: #f1f5f9;
  padding: 2.5px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  width: 100%;
  box-sizing: border-box;
}

.view-switch-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-switch-btn:hover {
  color: #1e293b;
}

.view-switch-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.samples-list-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.samples-empty {
  padding: 40px 20px;
  text-align: center;
}

.empty-icon-box {
  margin-bottom: 12px;
}

.samples-empty h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.samples-empty p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.btn-import-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-import-primary:hover {
  background: var(--primary);
  color: #fff;
}

.sample-file-items {
  list-style: none;
  padding: 4px 0;
}

.sample-item {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-main);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sample-item:hover {
  background: var(--bg-hover);
}

.sample-item.selected {
  background: var(--primary-light);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.sample-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
}

.datatype-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.datatype-row select {
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 11.5px;
}

.sample-status-text {
  font-size: 11px;
  color: var(--text-muted);
}

.sample-main-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow-y: auto;
}

.sample-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sample-main-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.sample-main-title h2 {
  font-size: 15px;
  font-weight: 600;
}

.sample-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.chrom-preview-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  height: 220px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.card-empty-placeholder {
  flex: 1;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-size: 12.5px;
  background: #fafafa;
}

.sample-bottom-bar {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-sub);
  font-family: var(--font-mono);
}

/* ==========================================================================
   TAB 2: Method Workflow Layout
   ========================================================================== */
.method-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.method-sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
}

.method-sidebar-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  padding: 4px 8px 12px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.method-subnav {
  list-style: none;
  flex: 1;
}

.method-subnav li {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 3px;
  transition: all 0.15s;
}

.method-subnav li:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.method-subnav li.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.method-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.btn-subaction {
  height: 30px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
}

.btn-subaction:hover {
  background: var(--bg-hover);
}

.w-full {
  width: 100%;
}

.method-main-content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #fff;
}

.method-subpane {
  display: none;
  height: 100%;
  flex-direction: column;
}

.method-subpane.active {
  display: flex;
}

.method-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tool-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.select-field, .input-field {
  padding: 5px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12px;
}

.btn-action {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-action:hover {
  background: var(--bg-hover);
}

.btn-action.text-red {
  color: var(--danger);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.table-responsive-container {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Universal Table Styles (Data Tables)
   ========================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  z-index: 10;
}

.data-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background: rgba(241, 245, 249, 0.6);
}

.data-table.small {
  font-size: 11.5px;
}

.data-table.mini {
  font-size: 11px;
}

.data-table.mini td, .data-table.mini th {
  padding: 5px 8px;
}

.levels-grid td {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.settings-card {
  max-width: 680px;
}

.settings-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.setting-item label {
  font-weight: 500;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qc-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qc-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.rule-name {
  font-weight: 500;
}

.rule-val {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   TAB 3: Data Process & Quantitation Core Styles
   ========================================================================== */
.dataproc-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.dataproc-topbar {
  height: 44px;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-badge-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.clean-select {
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.btn-start-analysis {
  background: var(--primary);
  color: #fff;
  border: none;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-start-analysis:hover {
  background: var(--primary-hover);
}

.dropdown-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu-pill-btn {
  background: transparent;
  border: none;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.menu-pill-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.menu-pill-btn:active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  transform: scale(0.96);
}

.compound-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.target-select {
  border: 1px solid var(--border-color);
  background: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--primary);
}

.analysis-status-pill {
  font-size: 11px;
  color: var(--text-sub);
}

.analysis-status-pill.done {
  color: var(--success);
  font-weight: 600;
}

.dataproc-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.compounds-sidebar {
  width: 140px;
  background: #fff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.compounds-header {
  height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.badge-count {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
}

.compounds-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.compound-nav-item {
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.compound-nav-item:hover {
  background: var(--bg-hover);
}

.compound-nav-item.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.status-icon-ok {
  color: var(--success);
}

.dataproc-main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* The table and charts fill the panel exactly, so anything opened below them
     (the molecular profile card) needs somewhere to go rather than being
     squeezed to nothing on a short laptop screen. */
  overflow-y: auto;
  scroll-behavior: smooth;
  /* Clears the fixed project-path tag pinned to the bottom-right. */
  padding-bottom: 20px;
}

/* Results Data Table Area (Top Half) */
.results-table-section {
  height: 52%;
  flex: 0 0 auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
}

.results-table-toolbar {
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.rt-tool-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-label {
  font-size: 11px;
  color: var(--text-muted);
}

.view-select {
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 11px;
}

.rt-tool-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-icon-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.table-icon-btn:hover {
  background: #fff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.results-table-scroll {
  flex: 1;
  overflow: auto;
}

.result-grid tbody tr {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  /* Reserve the accent rail up front so hovering never nudges the columns. */
  box-shadow: inset 0 0 0 0 transparent;
}

.result-grid tbody tr:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.065) 0%, rgba(37, 99, 235, 0.02) 40%, rgba(37, 99, 235, 0) 100%);
  box-shadow: inset 3px 0 0 0 #93c5fd;
}

.result-grid tbody tr.selected {
  background: #eff6ff !important;
  box-shadow: inset 3px 0 0 0 #2563eb;
}

.result-grid tbody tr.selected:hover {
  background: #e6f0ff !important;
}

/* Numeric columns lift out of the background on the active row. */
.result-grid tbody tr:hover td,
.result-grid tbody tr.selected td {
  color: #0f172a;
}

.result-grid td {
  font-family: var(--font-mono);
  font-size: 11px;
  transition: color 0.15s ease;
}

/* Rows fade in as a batch is rendered rather than snapping into place. */
.result-grid tbody tr.row-enter {
  animation: gridRowIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes gridRowIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sticky header gets a hairline shadow once the body scrolls under it. */
.results-table-scroll .data-table thead th {
  box-shadow: 0 1px 0 0 var(--border-color);
}

@media (prefers-reduced-motion: reduce) {
  .result-grid tbody tr.row-enter {
    animation: none;
  }
}

.badge-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-status.success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-status.blank {
  background: #f1f5f9;
  color: var(--text-muted);
}

.badge-status.sample-pill {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* ==========================================================================
   Professional Analytical Chemistry Data Styling (EPA 533 / 1633 Compliance)
   ========================================================================== */

/* Pro QC & Quick Filter Bar above Table */
.pro-qc-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
  flex-wrap: wrap;
}

.pro-filter-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pro-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.pro-filter-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.pro-filter-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.25);
}

.pro-filter-btn .dot-alert {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
}

.pro-filter-btn .dot-mcl {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
}

.pro-legend-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #64748b;
}

.pro-legend-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 9px;
  color: #475569;
}

/* Professional S/N Quality Tiers (EPA 533 / 1633 Compliance) */
.sn-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: -0.2px;
}

.sn-tag.sn-high {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sn-tag.sn-mid {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.sn-tag.sn-low {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.sn-tag.sn-fail {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Retention Time Shifts & Fidelity Indicator */
.rt-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.rt-tag.rt-normal {
  color: #1e293b;
}

.rt-tag.rt-shift {
  background: #fff7ed;
  color: #c2410c;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #fed7aa;
  font-weight: 700;
}

.rt-tag.rt-shift .shift-delta {
  font-size: 9px;
  padding: 0 3px;
  border-radius: 2px;
  background: #ffedd5;
  color: #9a3412;
  margin-left: 2px;
}

/* Matrix Ionization Effect (MI% / ISTD Recovery) */
.mi-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.mi-tag.mi-normal {
  background: #f1f5f9;
  color: #334155;
}

.mi-tag.mi-pass {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.mi-tag.mi-boost {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 700;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.2);
}

.mi-tag.mi-suppr {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  font-weight: 700;
}

/* Concentration Tags & EPA Maximum Contaminant Level (MCL) Alerts */
.conc-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conc-tag-mcl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 4px;
  font-size: 10px;
  animation: pulse-mcl 2s infinite ease-in-out;
}

@keyframes pulse-mcl {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
  50% { box-shadow: 0 0 5px 1px rgba(225, 29, 72, 0.25); }
}

.conc-tag-acc {
  font-size: 9.5px;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 600;
}

.conc-tag-nd {
  color: #64748b;
  font-style: italic;
  font-size: 10.5px;
}

/* ISTD Area Breakdown in Table */
.istd-cell-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.istd-count {
  font-weight: 600;
  color: #1e293b;
}

.istd-perc {
  font-size: 9.5px;
  font-weight: 600;
}

.istd-perc.pass {
  color: #16a34a;
}

.istd-perc.boost {
  color: #d97706;
}

.istd-perc.suppr {
  color: #9333ea;
}

/* ============================================================
   Qualifier Ion Ratio (QIR) Tag — EPA 533/1633 Identity Check
   ============================================================ */
.qir-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.qir-tag.qir-pass {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.qir-tag.qir-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.qir-tag.qir-fail {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  animation: pulse-mcl 2s infinite ease-in-out;
}

/* ============================================================
   Statistics Card Layout Extensions
   ============================================================ */
.stat-card-wide {
  grid-column: 1 / -1;
  width: 100%;
}

.stat-card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.stat-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.heatmap-legend-item {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  letter-spacing: 0.02em;
  white-space: nowrap;
}



/* Chart Titlebar Pro Status Pill */
.chrom-qc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
}

.chrom-qc-badge.pass {
  background: #dcfce7;
  color: #166534;
}

.chrom-qc-badge.warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Chart Area (Bottom Half) */
.charts-section {
  height: 48%;
  min-height: 292px;
  flex: 0 0 auto;
  display: flex;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
}

.chrom-charts-container {
  width: 50%;
  min-width: 0;
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 4px 6px 6px 6px;
  gap: 5px;
  background: #ffffff;
  /* If the toolbar wraps on a narrow window the panes can no longer fit at
     their floor height; scrolling beats clipping the x-axis title. */
  overflow-x: hidden;
  overflow-y: auto;
}

/* Each chromatogram box shares the leftover height evenly, so the plot canvas
   grows and shrinks with the pane instead of being clipped at a fixed size. */
.chrom-chart-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 4px 3px 4px;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

.chart-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 0 4px;
  margin-bottom: 0;
  flex: 0 0 auto;
}

/* Dedicated Chromatography Toolbar Strip */
.chrom-toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  margin-bottom: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.chrom-tool-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  row-gap: 4px;
}

/* Divides the strip into integrate / view / navigate / process / inspect. */
.chrom-tool-sep {
  width: 1px;
  height: 17px;
  background: #e2e8f0;
  margin: 0 3px;
  flex: 0 0 auto;
}

.chrom-icon-btn {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  color: #334155;
}

.chrom-icon-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.chrom-icon-btn:active,
.chrom-icon-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  box-shadow: inset 0 1px 2px rgba(2, 132, 199, 0.2);
}

.chrom-icon-btn.active {
  transform: none;
}

.chrom-icon-btn:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

@media (max-width: 1280px) {
  .chrom-icon-btn {
    width: 23px;
    height: 23px;
  }

  .chrom-tool-group {
    gap: 2px;
  }

  .chrom-tool-sep {
    margin: 0 2px;
  }
}

.chrom-header-title {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chrom-header-meta {
  font-size: 10.5px;
  color: #475569;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  white-space: pre;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.canvas-wrap {
  width: 100%;
  flex: 1 1 auto;
  /* Floor = 16px top margin + plot + 34px axis label and title band. */
  min-height: 92px;
  position: relative;
}

.canvas-wrap canvas {
  width: 100%;
  height: 100%;
}

/* ECharts reads the element box, so the chart div has to fill its wrapper. */
.canvas-wrap .echart-box,
.calib-canvas-wrap .echart-box {
  width: 100%;
  height: 100%;
}

/* Manual integration mode reads as an armed tool on the plot itself. */
.echart-box.manual-integration-armed {
  outline: 2px dashed #0284c7;
  outline-offset: -2px;
  border-radius: 3px;
}

/* Calibration Curve Area */
.calib-chart-container {
  width: 50%;
  min-width: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 4px 10px 6px 10px;
  overflow: hidden;
}

.calib-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #334155;
  margin-bottom: 3px;
  padding-bottom: 2px;
  flex: 0 0 auto;
}

.calib-params {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.calib-params span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #334155;
}

.calib-select-mini {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.calib-select-mini:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}

.calib-select-mini:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

.calib-select-mini:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.calib-mini-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.calib-mini-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.calib-mini-btn:focus-visible,
.btn-apply-reg:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

.btn-apply-reg {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  /* Stays flush right even when the parameter row wraps it to its own line. */
  margin-left: auto;
  flex: 0 0 auto;
}

.btn-apply-reg:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.calib-equation {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11.5px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
  flex: 0 0 auto;
}

/* Chip on the equation line naming the model the curve was fitted with. */
.calib-model-tag {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0;
  vertical-align: 1px;
}

.calib-canvas-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 180px;
  position: relative;
}

.calib-canvas-wrap canvas {
  width: 100%;
  height: 100%;
}

.project-path-tag {
  position: fixed;
  bottom: 1px;
  right: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  font-size: 9.5px;
  color: #64748b;
  opacity: 0.8;
  pointer-events: none;
  z-index: 10;
}

/* ==========================================================================
   TAB 4 & 5: Statistics and Tools Card Grid Interface
   ========================================================================== */
.cards-view-layout {
  padding: 24px 30px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.cards-view-header {
  margin-bottom: 24px;
}

.cards-title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 4px 0;
}

.cards-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.utility-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.utility-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.utility-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.utility-card:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
  transition: all 0.05s;
}

.u-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.u-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.badge-pill {
  font-size: 10.5px;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.u-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.cards-view-footer {
  font-size: 11.5px;
  color: var(--text-sub);
}

/* ==========================================================================
   Modal 1: Analysis Progress Animation (Progress Dialog)
   ========================================================================== */
.progress-dialog {
  width: 380px;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius-lg);
}

.progress-dialog-body {
  text-align: center;
}

.progress-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-main);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.15s linear;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ==========================================================================
   Modals 2 & 3: Auto Fill and Success Dialog
   ========================================================================== */
.autofill-modal {
  width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.autofill-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0 16px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.af-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.af-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.autofill-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  max-height: 380px;
}

.alert-dialog {
  width: 320px;
}

.alert-dialog-body {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.alert-icon-check {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-message {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

/* ==========================================================================
   Modal 4: Peak Quality Audit (Video 01:55 - 02:00)
   ========================================================================== */
.peak-quality-modal {
  width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.pq-tabs {
  display: flex;
  overflow-x: auto;
  padding: 6px 12px 0 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.pq-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 10px;
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--text-muted);
  cursor: pointer;
}

.pq-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.pq-modal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  max-height: 460px;
}

.pq-subtab-pane {
  display: none;
}

.pq-subtab-pane.active {
  display: block;
}

.quality-pass-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.banner-text h3 {
  font-size: 13.5px;
  color: #15803d;
  font-weight: 700;
}

.banner-text p {
  font-size: 11px;
  color: #166534;
}

.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.accordion-header {
  background: #f8fafc;
  padding: 8px 12px;
  cursor: pointer;
}

.acc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.acc-chevron {
  transition: transform 0.2s;
}

.accordion-item.open .acc-chevron {
  transform: rotate(90deg);
}

.acc-badge {
  font-size: 10.5px;
  font-weight: 500;
  margin-left: auto;
}

.acc-badge.success {
  color: var(--success);
}

.accordion-content {
  padding: 8px 12px;
  border-top: 1px solid var(--border-color);
  background: #fff;
}

.overview-keyval-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 11.5px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.kv-row .k {
  color: var(--text-muted);
}

.kv-row .v {
  font-weight: 500;
  font-family: var(--font-mono);
}

.kv-row .v.code {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.json-code-block {
  background: #0f172a;
  color: #38bdf8;
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
}

/* ==========================================================================
   Modal 5: AI Assistant Side Drawer (Video 02:15 - 02:29)
   ========================================================================== */
.assistant-drawer {
  position: fixed;
  top: 58px;
  right: 20px;
  bottom: 20px;
  width: 580px;
  z-index: 500;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.assistant-window {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.titlebar-settings-btn {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.assistant-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.assistant-sidebar {
  width: 170px;
  background: #1e293b;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
}

.as-bot-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.as-avatar {
  width: 28px;
  height: 28px;
  background: #3b82f6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

.as-bot-meta strong {
  display: block;
  font-size: 12px;
}

.as-bot-meta small {
  font-size: 10px;
  color: #94a3b8;
}

.btn-new-conv {
  background: #334155;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 12px;
}

.btn-new-conv:hover {
  background: #475569;
}

.chat-threads-list {
  flex: 1;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  color: #94a3b8;
}

.thread-item.active {
  background: #334155;
  color: #fff;
}

.thread-info {
  flex: 1;
}

.t-name {
  display: block;
  font-weight: 500;
}

.t-count {
  font-size: 9.5px;
  color: #94a3b8;
}

.btn-del-thread {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
}

.btn-del-thread:hover {
  color: #ef4444;
}

.as-sidebar-footer {
  font-size: 9.5px;
  color: #64748b;
  line-height: 1.4;
}

.assistant-chat-main {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.chat-main-header {
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-main-header h3 {
  font-size: 12.5px;
  font-weight: 600;
}

.context-pill {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chat-messages-scroll {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-empty-intro {
  margin: auto;
  text-align: center;
  max-width: 300px;
}

.ai-symbol-badge {
  width: 48px;
  height: 48px;
  background: #eff6ff;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.chat-empty-intro h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.chat-empty-intro p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.prompt-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.chip {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary-border);
  color: var(--primary);
}

.messages-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
}

.msg-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.msg-bubble.ai {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.chat-input-container {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
}

.chat-input-container textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  resize: none;
}

.chat-input-container textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.key-hint {
  font-size: 10px;
  color: var(--text-sub);
}

/* ==========================================================================
   Right-Click Context Menu
   ========================================================================== */
.context-menu {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  min-width: 130px;
}

.context-item {
  padding: 5px 12px;
  font-size: 11.5px;
  cursor: pointer;
}

.context-item:hover {
  background: var(--primary);
  color: #fff;
}

.context-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ==========================================================================
   Quick Start & Sample Manager Styles
   ========================================================================== */
.btn-secondary.highlight {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.btn-secondary.highlight:hover {
  background: #dbeafe;
}

.hub-quick-start-box {
  margin-top: 24px;
  width: 100%;
  max-width: 820px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 20px 24px;
  text-align: left;
}

.quick-start-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.quick-start-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: #dbeafe;
  color: #1e40af;
  padding: 3px 8px;
  border-radius: 4px;
}

.quick-start-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quick-start-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fafbfc;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.quick-start-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
  background: #fff;
}

.quick-start-card.featured {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f0f7ff 0%, #fff 100%);
}

.qs-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.qs-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.qs-icon-box.demo {
  background: #fee2e2;
  color: #b91c1c;
}

.qs-icon-box.sample {
  background: #e0e7ff;
  color: #4338ca;
}

.qs-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
}

.qs-badge.outline {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border-color);
}

.quick-start-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.quick-start-card p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 14px;
}

.qs-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qs-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-qs-primary:hover {
  background: #1d4ed8;
}

.btn-qs-secondary {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-qs-secondary:hover {
  background: var(--bg-hover);
}

.btn-qs-secondary.highlight {
  border-color: #93c5fd;
  color: #2563eb;
  background: #eff6ff;
}

.empty-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.empty-sub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.btn-link {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 11.5px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: #1d4ed8;
}

.sep {
  color: #cbd5e1;
}

.sample-current-tag {
  font-size: 11.5px;
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  font-weight: 600;
  margin-left: 10px;
}

.sample-main-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.card-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chrom-legend-badge {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.chrom-legend-badge.highlight {
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
}

.btn-table-action {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-table-action:hover {
  background: #dbeafe;
}

.btn-table-action.secondary {
  border-color: var(--border-color);
  background: #fff;
  color: var(--text-main);
}

.btn-table-action.secondary:hover {
  background: var(--bg-hover);
}

/* Sample Manager Large Modal */
.modal-window.modal-lg {
  width: 1060px;
  max-width: 96vw;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.sample-manager-body {
  padding: 16px 22px 20px;
}

.sm-topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.sm-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.sm-meta-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
}

.sm-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
}

.sm-meta-item .meta-label {
  color: #64748b;
  font-weight: 500;
}

.sm-meta-item code {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #0f172a;
}

.sm-counter {
  font-size: 12px;
  color: #475569;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.sm-action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.sm-action-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sm-btn-import {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sm-btn-import:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.sm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 500;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sm-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.sm-btn.highlight {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 600;
}

.sm-btn.highlight:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.status-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  margin-right: 4px;
}

.sm-table-wrap {
  max-height: 440px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sm-table {
  width: 100%;
  border-collapse: collapse;
}

.sm-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 10;
  box-shadow: 0 1px 0 #e2e8f0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.sm-table td {
  padding: 7px 10px;
  font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.sm-table tr:hover td {
  background: #f8fafc;
}

/* Drag & Drop Indicator State */
.samples-list-container.drag-over {
  background: #eff6ff;
  border: 2px dashed #3b82f6;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   16. Universal Floating Dropdown Menu & Enhanced Modals
   ========================================================================== */
.app-dropdown-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 6px;
  min-width: 220px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFadeIn 0.15s ease-out;
}

.app-dropdown-menu.hidden {
  display: none !important;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #334155;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-item.danger {
  color: #ef4444;
}

.dropdown-item.danger:hover {
  background: #fef2f2;
}

.d-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}

.d-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.15));
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.dropdown-item:active {
  background: #e2e8f0;
  transform: scale(0.98);
}

.dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

.dropdown-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 4px 12px 2px;
}

.table-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.table-search-input {
  flex: 1;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  background: #fff;
}

.table-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Statistics & Tools Detail Containers */
.stat-detail-container, .tool-detail-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f8fafc;
  overflow-y: auto;
  padding: 16px 24px;
  gap: 16px;
}

.detail-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.detail-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-title-group h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #0f172a;
}

.stat-grid-2col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.stat-grid-3col {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}

.stat-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card-box h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.canvas-wrap-stat {
  position: relative;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.canvas-wrap-donut {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
}

.qc-stat-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
}

.dot-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot-color.success { background: #22c55e; }
.dot-color.warning { background: #f59e0b; }
.dot-color.danger { background: #ef4444; }

/* Tools Layouts */
.tool-reader-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.reader-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.reader-card.status-connected {
  border-color: #86efac;
  background: #f0fdf4;
}

.rc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rc-meta {
  font-size: 11px;
  color: #64748b;
}

.reader-test-console {
  background: #0f172a;
  color: #38bdf8;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  margin-top: 16px;
}

.rtc-header {
  display: flex;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 11px;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.converter-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  max-width: 800px;
}

.converter-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.converter-desc {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.conv-progress-area {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
  transition: width 0.2s ease;
}

.method-utils-grid, .export-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.mu-card, .export-tile {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.et-icon {
  font-size: 28px;
}

.validation-result-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #166534;
  margin-top: 10px;
}

.lab-report-preview-box {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-top: 20px;
}

.lr-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.lr-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  font-size: 12px;
  margin-top: 8px;
  color: #475569;
}

.lr-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* Fullscreen Chart Modal */
.modal-fullscreen {
  width: 94vw !important;
  max-width: 1400px !important;
  height: 90vh !important;
}

.fs-chart-body {
  display: flex;
  flex-direction: column;
  height: calc(100% - 44px);
  padding: 16px;
}

.fs-chart-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.fs-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #334155;
}

.fs-canvas-wrap {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 12px;
  overflow: hidden;
}

.chart-crosshair-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
  z-index: 10;
  transform: translate(12px, -50%);
}

/* Modals & Settings Tabs */
.settings-tabs, .prep-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.settings-tab, .prep-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.settings-tab:hover, .prep-tab:hover {
  color: #0f172a;
}

.settings-tab.active, .prep-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.settings-modal-body, .sample-prep-body, .vc-modal-body, .method-json-body {
  padding: 16px 20px;
}

/* Version Control timeline */
.vc-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.vc-commit-input-group {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 500px;
}

.vc-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-left: 12px;
  border-left: 2px solid #e2e8f0;
}

.vc-commit-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.vc-dot {
  position: absolute;
  left: -19px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
}

.vc-commit-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vc-commit-meta strong {
  font-size: 13px;
  color: #0f172a;
}

.vc-commit-meta small {
  color: #64748b;
  font-size: 11px;
}

/* Dilution Calculator */
.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit .form-input {
  padding-right: 70px;
}

.unit-addon {
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: #64748b;
  pointer-events: none;
}

.calc-result-card {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

/* Method JSON Editor */
.json-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: #64748b;
}

.json-editor-area {
  width: 100%;
  height: 380px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  resize: vertical;
}

/* Interactive EIC Canvas cursor */
.canvas-wrap canvas {
  cursor: crosshair;
}



/* ==========================================================================
   New Extended Features: Autosampler Plate, Overlay EIC, SST, Regulatory HI
   ========================================================================== */

/* 1. Autosampler View Switcher & Plate Tray */
.view-switch-mini {
  display: flex;
  background: #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.view-switch-btn {
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-switch-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.autosampler-rack-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  background: #f8fafc;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.rack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 4px;
}

.rack-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
}

.rack-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #64748b;
}

.leg-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 2px;
}

.leg-dot.blank { background: #94a3b8; }
.leg-dot.calib { background: #2563eb; }
.leg-dot.sample { background: #10b981; }

.rack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  width: 100%;
  box-sizing: border-box;
}

.vial-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  padding: 3px 2px;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.vial-slot:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
}

.vial-slot.active {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.vial-slot.empty {
  opacity: 0.35;
  cursor: default;
  background: #f8fafc;
  border-style: dashed;
}

.vial-slot.empty:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: none;
}

.vial-num {
  font-size: 10.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.vial-id-sub {
  font-size: 8.5px;
  color: #64748b;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  padding: 0 2px;
  box-sizing: border-box;
}

.vial-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.vial-slot.type-blank .vial-circle { background: #94a3b8; }
.vial-slot.type-calib .vial-circle { background: #2563eb; }
.vial-slot.type-soil .vial-circle { background: #d97706; }
.vial-slot.type-soil-shifted .vial-circle { background: #ef4444; }
.vial-slot.type-water .vial-circle { background: #06b6d4; }
.vial-slot.type-spas .vial-circle { background: #a855f7; }

.rack-footer-info {
  margin-top: 8px;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 11px;
  color: #1e40af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* 2. Calibration fit model select — styled once, near .calib-topbar. */

/* 3. Multi-Sample Overlay Modal */
.modal-overlay-window {
  width: 92%;
  max-width: 1200px;
  max-height: 90vh;
}

.overlay-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.overlay-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
}

.overlay-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overlay-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.overlay-sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.sample-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.sample-chip:hover {
  background: #f1f5f9;
}

.sample-chip.active {
  border-color: currentColor;
  background: rgba(37, 99, 235, 0.08);
}

.sample-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.overlay-canvas-wrapper {
  position: relative;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px;
}

.overlay-legend-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.legend-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* 4. Regulatory Health Index & EPA 2024 NPDWR Subview */
.stat-sub-text {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 12px 0;
}

.stat-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-card {
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.metric-card.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.metric-card.warn { background: #fefce8; border: 1px solid #fef08a; color: #854d0e; }
.metric-card.alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.metric-card .m-val {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.metric-card .m-label {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.hi-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 6px;
}

.hi-gauge-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

/* 5. System Suitability Test (SST) Subview */
.sst-dashboard-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sst-header-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.sst-badge-pass {
  background: #16a34a;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.sst-meta {
  font-size: 12px;
  color: #64748b;
  font-family: monospace;
}

.sst-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.sst-metric-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sst-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.sst-val {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.sst-spec {
  font-size: 10px;
  color: #475569;
}

.sst-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sst-chart-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
}

.sst-chart-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

/* 6. Manual Integration Banner */
.manual-int-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #92400e;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11.5px;
  margin-bottom: 6px;
}

.manual-int-banner button {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #f59e0b;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}


/* ==========================================================================
   Vibrant Color Icons & Dynamic Animation Suite
   ========================================================================== */

/* 1. Global Micro-Animation Keyframes */
@keyframes tabPaneFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalBackdropFade {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(4px);
  }
}

@keyframes modalWindowPop {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes buttonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

@keyframes alertBeacon {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

@keyframes sparkleTwinkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 2px rgba(236, 72, 153, 0.4));
  }
  50% {
    transform: scale(1.22) rotate(14deg);
    filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.8));
  }
}

@keyframes iconSpinHover {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

@keyframes progressStripes {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes cardHoverFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 2. Workspace Navigation Tabs: Vibrant Individual Icon Colors */
.ws-tab {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 6px 6px 0 0;
}

.ws-tab svg {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-tab[data-tab="tabSampleSelection"] svg {
  color: #0284c7; /* Vibrant Cyan */
}
.ws-tab[data-tab="tabMethod"] svg {
  color: #8b5cf6; /* Vibrant Violet */
}
.ws-tab[data-tab="tabDataProcess"] svg {
  color: #2563eb; /* Royal Sapphire */
}
.ws-tab[data-tab="tabStatistics"] svg {
  color: #f59e0b; /* Sunset Amber */
}
.ws-tab[data-tab="tabTools"] svg {
  color: #10b981; /* Mint Emerald */
}

.ws-tab:hover {
  background: rgba(241, 245, 249, 0.85);
  color: #0f172a;
}

.ws-tab:hover svg {
  transform: translateY(-2px) scale(1.15);
  filter: drop-shadow(0 2px 5px currentColor);
}

.ws-tab.active {
  color: #0f172a;
  border-bottom: 2.5px solid #2563eb;
  background: linear-gradient(to bottom, transparent 75%, rgba(37, 99, 235, 0.08) 100%);
  font-weight: 600;
}

.ws-tab.active svg {
  transform: scale(1.18);
  filter: drop-shadow(0 2px 6px currentColor);
}

/* 3. AI Assistant Button: Sparkling Multi-Color Glow */
.btn-assistant-toggle {
  background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
  border: 1px solid #f472b6;
  color: #db2777;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(219, 39, 119, 0.12);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-assistant-toggle svg {
  color: #ec4899;
  animation: sparkleTwinkle 2.8s infinite ease-in-out;
}

.btn-assistant-toggle:hover {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border-color: #ec4899;
  color: #be185d;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 14px rgba(219, 39, 119, 0.28);
}

/* 4. Project Hub Header Action Icons: Curated Color Accents */
#btnHubVersionControl {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#btnHubVersionControl:hover {
  background: rgba(124, 58, 237, 0.18);
  border-color: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(124, 58, 237, 0.25);
}

#btnHubSamplePrep {
  color: #059669;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#btnHubSamplePrep:hover {
  background: rgba(5, 150, 105, 0.18);
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(5, 150, 105, 0.25);
}

#btnHubSettings {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#btnHubSettings:hover {
  background: rgba(2, 132, 199, 0.18);
  border-color: #0284c7;
  transform: translateY(-2px) rotate(45deg);
  box-shadow: 0 6px 12px rgba(2, 132, 199, 0.25);
}

#btnHubSampleManager {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.25);
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}
#btnHubSampleManager svg {
  color: #2563eb;
  transition: transform 0.2s ease;
}
#btnHubSampleManager:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}
#btnHubSampleManager:hover svg {
  transform: scale(1.12);
}

#btnHubDemoProject {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}
#btnHubDemoProject svg {
  color: #fef08a; /* Golden Lightning */
  filter: drop-shadow(0 0 5px rgba(254, 240, 138, 0.9));
}
#btnHubDemoProject:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}

#btnOpenCreateProject {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}
#btnOpenCreateProject:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4);
}

/* 5. Sample Selection Sidebar Action Buttons: Vibrant Multi-Colors */
#btnImportSamples {
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
#btnImportSamples:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #047857;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

#btnBrowseFolder {
  color: #d97706;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
#btnBrowseFolder:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #b45309;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

#btnDownloadPackSidebar {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.22);
}
#btnDownloadPackSidebar:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #0284c7;
  color: #0369a1;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

#btnClearSamples {
  color: #e11d48;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.22);
}
#btnClearSamples:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #be123c;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.3);
}

#btnRefreshSamples {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
}
#btnRefreshSamples:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #4f46e5;
  transform: translateY(-1px) rotate(90deg);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* 6. Data Process Toolbar Icon Buttons */
.btn-table-action#btnExportCSVReport {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
  transition: all 0.2s ease;
}
.btn-table-action#btnExportCSVReport svg {
  color: #a7f3d0;
}
.btn-table-action#btnExportCSVReport:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

.btn-table-action.secondary#btnDownloadSampleZip3 {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-table-action.secondary#btnDownloadSampleZip3 svg {
  color: #2563eb;
}
.btn-table-action.secondary#btnDownloadSampleZip3:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

#btnExportQuantReport {
  color: #d97706;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  transition: all 0.2s ease;
}
#btnExportQuantReport:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  transform: translateY(-1px) scale(1.1);
}

#btnTableSearchToggle {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  transition: all 0.2s ease;
}
#btnTableSearchToggle:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  transform: translateY(-1px) scale(1.1);
}

#btnOpenOverlayModal {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 6px;
  transition: all 0.2s ease;
}
#btnOpenOverlayModal:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #0284c7;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
}

#btnToggleFullscreenChart {
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  transition: all 0.2s ease;
}
#btnToggleFullscreenChart:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* 7. Modal Windows: Silky Apple Pop-in Animation */
.modal-overlay:not(.hidden) {
  animation: modalBackdropFade 0.22s ease forwards;
}

.modal-overlay:not(.hidden) .modal-window {
  animation: modalWindowPop 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 8. Tab Panes: Smooth Cross-fade Animation */
.tab-pane.active {
  display: flex;
  animation: tabPaneFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 9. Autosampler Vial Slots: Interactive Hover Lift & Pulse */
.vial-slot {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.vial-slot:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
  border-color: #3b82f6;
  z-index: 2;
}

.vial-slot.type-soil-shifted .vial-circle {
  animation: alertBeacon 2.2s infinite ease-in-out;
}

/* 10. Quick-Start & Feature Cards: Smooth 3D Hover Lift */
.quick-start-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.quick-start-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -8px rgba(37, 99, 235, 0.2), 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.project-card {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px -6px rgba(15, 23, 42, 0.12);
  border-color: #93c5fd;
}

/* 11. Progress Bar Fill: Animated Moving Gradient Stripes */
.progress-bar-fill {
  background: linear-gradient(90deg, #2563eb, #38bdf8, #2563eb);
  background-size: 200% 100%;
  animation: progressStripes 1.8s linear infinite;
}

/* 12. Pulse Beacon on Live System Status */
.user-status-dot, .status-pulse {
  animation: pulseGlow 2.4s infinite ease-in-out;
}

/* 13. Mac Window Traffic Lights: Hover Zoom */
.mac-traffic-lights .dot {
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.mac-traffic-lights .dot:hover {
  transform: scale(1.2);
}

/* 14. Data Table Row Hover: Subtle Left Accent Bar */
.data-table tbody tr {
  transition: background-color 0.12s ease, border-left-color 0.12s ease;
  border-left: 2px solid transparent;
}
.data-table tbody tr:hover {
  background-color: #f8fafc;
  border-left-color: #3b82f6;
}
.data-table tbody tr.selected {
  background-color: #eff6ff;
  border-left-color: #2563eb;
}


/* ==========================================================================
   15. Enhanced Color Icons & Component Polish (User Request: More Color Icons & Animations)
   ========================================================================== */

/* Sample Sequence List: Rich Color Coding & Mini Tags */
.sample-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
}

.sample-item:hover {
  background-color: #f1f5f9 !important;
  transform: translateX(3px) !important;
}

.sample-item.selected {
  background: linear-gradient(90deg, #eff6ff, #f8fafc) !important;
  border-left: 3px solid #2563eb !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12) !important;
}

.sample-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sample-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
}

.sample-type-icon {
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sample-item:hover .sample-type-icon {
  transform: scale(1.18);
}

.sample-type-icon.icon-blank { color: #0284c7; }
.sample-type-icon.icon-calib { color: #d97706; }
.sample-type-icon.icon-soil { color: #059669; }
.sample-type-icon.icon-soil-alert { color: #dc2626; animation: alertBeacon 2s infinite ease-in-out; }
.sample-type-icon.icon-water { color: #2563eb; }
.sample-type-icon.icon-spas { color: #7c3aed; }

.sample-mini-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 5.5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.sample-mini-tag.tag-blank { background: #e0f2fe; color: #0369a1; }
.sample-mini-tag.tag-calib { background: #fef3c7; color: #b45309; }
.sample-mini-tag.tag-soil { background: #dcfce7; color: #15803d; }
.sample-mini-tag.tag-water { background: #dbeafe; color: #1e40af; }
.sample-mini-tag.tag-spas { background: #f3e8ff; color: #6b21a8; }
.sample-mini-tag.tag-alert { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* Carbon Chain Badges in Compound Sidebar */
.compound-item-main {
  display: flex;
  align-items: center;
  gap: 7px;
}

.carbon-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4.5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #475569;
  border: 1px solid #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.15s ease;
}

.compound-nav-item:hover .carbon-badge {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border-color: #93c5fd;
  transform: scale(1.05);
}

.compound-nav-item.active .carbon-badge {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.compound-nav-item {
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.compound-nav-item:hover {
  transform: translateX(3px) !important;
}

/* Method Subnav: Color Icons & Hover Bounce */
.method-subnav li {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 9px 12px !important;
  border-radius: 6px !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.method-subnav li:hover {
  background-color: #f1f5f9 !important;
  transform: translateX(3px) !important;
}

.method-subnav li.active {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 600 !important;
  border-left: 3px solid #2563eb !important;
}

.subnav-icon {
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.method-subnav li:hover .subnav-icon {
  transform: scale(1.22) rotate(-5deg);
}

.subnav-icon.icon-cyan { color: #0284c7; }
.subnav-icon.icon-violet { color: #8b5cf6; }
.subnav-icon.icon-blue { color: #2563eb; }
.subnav-icon.icon-amber { color: #f59e0b; }
.subnav-icon.icon-emerald { color: #10b981; }
.subnav-icon.icon-indigo { color: #6366f1; }
.subnav-icon.icon-rose { color: #f43f5e; }

/* Tools Tab: Vibrant Utility Cards */
.utility-card {
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  padding: 18px !important;
}

.utility-card:hover {
  transform: translateY(-5px) scale(1.01) !important;
  box-shadow: 0 16px 30px -8px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.15) !important;
  border-color: #93c5fd !important;
}

.u-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.u-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.utility-card:hover .u-icon-box {
  transform: scale(1.14) rotate(-6deg);
}

.icon-bg-indigo { background: #e0e7ff; color: #4338ca; }
.icon-bg-amber { background: #fef3c7; color: #b45309; }
.icon-bg-violet { background: #ede9fe; color: #6d28d9; }
.icon-bg-emerald { background: #d1fae5; color: #047857; }
.icon-bg-cyan { background: #e0f2fe; color: #0369a1; }

/* Status Flag in Quant Results Table */
.status-flag-pill.warning {
  background: #fee2e2;
  color: #b91c1c;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: alertBeacon 2.2s infinite ease-in-out;
}

.badge-status.sample-pill {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Button Active Press Animation */
button:active {
  transform: scale(0.96) !important;
  transition: transform 0.08s ease !important;
}

/* Modal Window Subtle Backdrop Glassmorphism */
.modal-overlay {
  backdrop-filter: blur(5px) !important;
  background: rgba(15, 23, 42, 0.45) !important;
}


/* ==========================================================================
   18. Responsive Design Suite (iPhone, iPad, Laptop, Desktop)
   ========================================================================== */

/* 1. Large Laptop & Medium Desktops (< 1366px) */
@media (max-width: 1366px) {
  .sample-sidebar {
    width: 280px !important;
  }
  .compounds-sidebar {
    width: 130px !important;
  }
  .hub-quick-start-box {
    max-width: 95% !important;
  }
  .dataproc-split {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* 2. Standard Laptop & Compact Screens (< 1200px) */
@media (max-width: 1200px) {
  .hub-header {
    padding: 12px 16px !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .ws-header {
    padding: 0 14px !important;
  }
  .ws-tabs {
    gap: 3px !important;
    overflow-x: auto !important;
    max-width: calc(100vw - 320px) !important;
  }
  .ws-tab {
    padding: 8px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
  .sample-layout {
    flex-direction: column !important;
  }
  .sample-sidebar {
    width: 100% !important;
    max-height: 280px !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .dataproc-split {
    grid-template-columns: 1fr !important;
  }
  .dataproc-main-panel {
    min-width: 0 !important;
  }
  .stat-grid-3col, .stat-grid-2col, .stat-grid-two {
    grid-template-columns: 1fr !important;
  }
  .modal-window, .mac-window {
    width: 88vw !important;
    max-width: 88vw !important;
  }
}

/* 3. iPad / Tablets (< 1024px) */
@media (max-width: 1024px) {
  .ws-header {
    height: auto !important;
    min-height: 54px !important;
    flex-wrap: wrap !important;
    padding: 8px 12px !important;
  }
  .ws-brand {
    order: 1 !important;
  }
  .ws-header-right {
    order: 2 !important;
    margin-left: auto !important;
  }
  .ws-tabs {
    order: 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 6px !important;
    border-top: 1px solid #e2e8f0 !important;
    padding-top: 4px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .dataproc-topbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .dataproc-topbar .topbar-left,
  .dataproc-topbar .topbar-right {
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    width: 100% !important;
  }
  .sample-cards-grid {
    grid-template-columns: 1fr !important;
  }
  .chrom-preview-card {
    height: 260px !important;
  }
  .utility-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .modal-window, .mac-window {
    width: 92vw !important;
    max-width: 92vw !important;
    max-height: 88vh !important;
  }
  .table-responsive-container,
  .results-table-section {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* 4. iPhone & Mobile Phones (< 768px) */
@media (max-width: 768px) {
  body {
    font-size: 13px !important;
  }
  .hub-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .hub-header-left {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }
  .hub-header-right {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .search-box {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .search-box input {
    width: 100% !important;
  }
  .hub-header-right button {
    flex: 1 1 auto !important;
  }
  .quick-start-grid {
    grid-template-columns: 1fr !important;
  }
  .method-layout {
    flex-direction: column !important;
  }
  .method-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .method-subnav {
    display: flex !important;
    overflow-x: auto !important;
    gap: 6px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .method-subnav li {
    white-space: nowrap !important;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    flex-shrink: 0 !important;
  }
  .method-subnav li.active {
    border-bottom-color: #2563eb !important;
    background: #eff6ff !important;
  }
  .dataproc-body {
    flex-direction: column !important;
  }
  .compounds-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .compounds-list {
    display: flex !important;
    overflow-x: auto !important;
    padding: 6px 10px !important;
    gap: 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .compound-nav-item {
    white-space: nowrap !important;
    padding: 6px 10px !important;
    flex-shrink: 0 !important;
  }
  .utility-cards-grid {
    grid-template-columns: 1fr !important;
  }
  .table-responsive-container,
  .results-table-section {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .data-table {
    min-width: 750px !important;
  }
  .dropdown-tool-group {
    flex-wrap: wrap !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .menu-pill-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }
  .modal-window, .mac-window {
    width: 96vw !important;
    max-width: 96vw !important;
    border-radius: 8px !important;
    max-height: 90vh !important;
  }
  .rack-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .user-name {
    display: none !important;
  }
  .assistant-drawer {
    width: 100% !important;
  }
  button, select, input {
    min-height: 38px !important;
  }
}

/* 5. High Contrast Laboratory Theme */
body.theme-high-contrast {
  background-color: #0b1329 !important;
  color: #f1f5f9 !important;
}
body.theme-high-contrast .hub-header,
body.theme-high-contrast .ws-header,
body.theme-high-contrast .sample-sidebar,
body.theme-high-contrast .compounds-sidebar,
body.theme-high-contrast .method-sidebar,
body.theme-high-contrast .sample-main-view,
body.theme-high-contrast .dataproc-main-panel,
body.theme-high-contrast .modal-window,
body.theme-high-contrast .mac-window,
body.theme-high-contrast .app-dropdown-menu,
body.theme-high-contrast .stat-card-box,
body.theme-high-contrast .utility-card,
body.theme-high-contrast .quick-start-card {
  background: #111e38 !important;
  color: #f8fafc !important;
  border-color: #1e3a8a !important;
}
body.theme-high-contrast .data-table th {
  background: #172554 !important;
  color: #93c5fd !important;
}
body.theme-high-contrast .data-table td {
  border-color: #1e3a8a !important;
  color: #e2e8f0 !important;
}
body.theme-high-contrast .data-table tbody tr:hover {
  background: #1e293b !important;
}
body.theme-high-contrast .ws-tab {
  color: #94a3b8 !important;
}
body.theme-high-contrast .ws-tab.active {
  color: #38bdf8 !important;
  border-bottom-color: #38bdf8 !important;
}
body.theme-high-contrast .dropdown-item {
  color: #e2e8f0 !important;
}
body.theme-high-contrast .dropdown-item:hover {
  background: #1e293b !important;
  color: #38bdf8 !important;
}

/* ======================================================== */
/* ADVANCED LABORATORY EXTENSIONS STYLING                   */
/* ======================================================== */

/* 1. Molecular Structure & Physicochemical Profile Card */
.molecular-profile-card {
  margin: 14px 10px 12px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  /* Never let the flex parent shrink this below its content. */
  flex: 0 0 auto;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  animation: molCardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.molecular-profile-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.09);
}

@keyframes molCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.molecular-profile-card.collapsed {
  display: none;
}

.mol-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.mol-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mol-badge-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #2563eb;
  text-transform: uppercase;
}

.mol-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.mol-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mol-cas-tag {
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
}

.mol-mcl-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.mol-mcl-tag.alert {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.mol-body {
  display: grid;
  /* minmax(0, ...) lets both columns shrink; without it the nowrap table forces
     the grid wider than the card and the right-hand values get clipped. */
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 16px;
  align-items: center;
}

/* Only stack once the two columns genuinely stop fitting; laptops at
   1150-1400px keep the compact side-by-side layout. */
@media (max-width: 1000px) {
  .mol-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.mol-structure-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mol-canvas-box {
  width: 100%;
  height: 120px;
  background:
    radial-gradient(circle at 50% 40%, #ffffff 0%, #f8fafc 70%);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.mol-canvas-box:hover {
  border-color: #93c5fd;
  border-style: solid;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.35);
}

.mol-canvas-box svg {
  width: 95%;
  height: 95%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gentle zoom so the fluorine labels stay readable on a laptop panel. */
.mol-canvas-box:hover svg {
  transform: scale(1.06);
}

.mol-chain-info {
  font-size: 11px;
  color: #475569;
  text-align: center;
}

.mol-properties-col {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.mol-table {
  border: 1px solid #eef2f7;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  table-layout: fixed;
  width: 100%;
}

.mol-table tbody td {
  padding: 7px 10px !important;
  font-size: 11px !important;
  /* Overrides .data-table's global nowrap so long transitions and class names
     wrap instead of overflowing off the right edge of the card. */
  white-space: normal;
  word-break: break-word;
  border-bottom: 1px solid #f1f5f9;
  transition: color 0.16s ease, background 0.16s ease;
}

.mol-table tbody tr:last-child td {
  border-bottom: none;
}

/* Label cells read as micro-headings; value cells carry the emphasis. */
.mol-table tbody td:nth-child(odd) {
  color: #64748b;
  font-weight: 600;
  width: 19%;
  background: #f8fafc;
  font-size: 10px !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mol-table tbody td:nth-child(even) strong {
  color: #0f172a;
  font-weight: 650;
}

/* Row highlight: accent rail on the left plus a soft wash across the row. */
.mol-table tbody tr {
  transition: background 0.18s ease, box-shadow 0.18s ease;
  animation: molRowIn 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mol-table tbody tr:nth-child(1) { animation-delay: 0.04s; }
.mol-table tbody tr:nth-child(2) { animation-delay: 0.09s; }
.mol-table tbody tr:nth-child(3) { animation-delay: 0.14s; }
.mol-table tbody tr:nth-child(4) { animation-delay: 0.19s; }

@keyframes molRowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.mol-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.07) 0%, rgba(37, 99, 235, 0.015) 55%, rgba(37, 99, 235, 0) 100%);
  box-shadow: inset 3px 0 0 0 #2563eb;
}

.mol-table tbody tr:hover td:nth-child(odd) {
  background: transparent;
  color: #1d4ed8;
}

.mol-table tbody tr:hover td:nth-child(even) strong {
  color: #1e3a8a;
}

/* Chemistry reads better in the mono face. */
.mol-table tbody td#molFormula strong,
.mol-table tbody td#molExactMass strong,
.mol-table tbody td#molQuantTr strong,
.mol-table tbody td#molQualTr strong,
.mol-table tbody td#molIstd strong {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: -0.1px;
}

/* Header chips lift slightly so they read as live status, not decoration. */
.mol-cas-tag,
.mol-mcl-tag {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mol-cas-tag:hover,
.mol-mcl-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .molecular-profile-card,
  .mol-table tbody tr {
    animation: none;
  }

  .mol-canvas-box:hover svg {
    transform: none;
  }
}

/* 2. Official Lab Certificate Modal & Printable Styling */
.certificate-printable {
  color: #0f172a;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media print {
  body * {
    visibility: hidden;
  }
  #modalOfficialReport, #modalOfficialReport * {
    visibility: visible;
  }
  #modalOfficialReport {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    box-shadow: none;
    border: none;
  }
  .mac-titlebar, .modal-footer, #demoController {
    display: none !important;
  }
  .certificate-printable {
    padding: 0 !important;
    width: 100% !important;
  }
}

/* 3. Dark Mode / High Contrast Support for New Components */
body.theme-high-contrast .molecular-profile-card,
body.theme-high-contrast .mol-canvas-box,
body.theme-high-contrast .msms-meta-bar {
  background: #0f172a !important;
  border-color: #1e3a8a !important;
  color: #f8fafc !important;
}

body.theme-high-contrast .mol-header {
  background: #1e293b !important;
  border-color: #1e3a8a !important;
}

body.theme-high-contrast .mol-header h3 {
  color: #f8fafc !important;
}

body.theme-high-contrast .mol-table td:nth-child(odd) {
  background: #172554 !important;
  color: #93c5fd !important;
}

body.theme-high-contrast .mol-table td {
  border-color: #1e3a8a !important;
}

body.theme-high-contrast .certificate-printable {
  background: #0f172a !important;
  color: #f8fafc !important;
}

/* Hardware Status Header Button & Live Pulse */
.btn-hardware-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hardware-status:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.live-pulse-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 rgba(22, 163, 74, 0.4);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.hw-model {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #2563eb;
}

.hw-status-text {
  font-size: 10px;
  background: #dcfce7;
  color: #166534;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
}


/* ==========================================================================
   20. Laboratory Loading Animation Page (Waiting Experience)
   ========================================================================== */
.lab-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(11, 17, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: labFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lab-loader-overlay.hidden {
  display: none !important;
}

@keyframes labFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.lab-loader-window {
  width: 900px;
  max-width: 95vw;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.97) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  box-shadow: 0 30px 90px -15px rgba(0, 0, 0, 0.85), 
              0 0 50px rgba(56, 189, 248, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lab-loader-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lab-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lab-engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 9999px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #38bdf8;
  font-weight: 600;
}

.lab-pulse-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseIndicator 1.5s infinite;
}

@keyframes pulseIndicator {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.lab-loader-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Visuals Split */
.lab-loader-visuals {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px;
  align-items: center;
}

/* Quadrupole Ion Core */
.quadrupole-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 180px;
}

.orbit-system {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ring-outer {
  width: 140px;
  height: 140px;
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  animation: spinSlow 14s linear infinite;
}

.ring-mid {
  width: 100px;
  height: 100px;
  border: 1.5px dotted rgba(99, 102, 241, 0.5);
  animation: spinReverse 9s linear infinite;
}

.ring-inner {
  width: 65px;
  height: 65px;
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  animation: spinSlow 5s linear infinite;
}

.core-emitter {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf8 0%, #2563eb 60%, #0f172a 100%);
  box-shadow: 0 0 25px #38bdf8, 0 0 50px rgba(56, 189, 248, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: emitterPulse 2s ease-in-out infinite;
  z-index: 2;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes emitterPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px #38bdf8, 0 0 40px rgba(56, 189, 248, 0.5); }
  50% { transform: scale(1.12); box-shadow: 0 0 35px #06b6d4, 0 0 60px rgba(6, 182, 212, 0.7); }
}

.orbit-particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.particle-cyan {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  top: -3px;
  left: calc(50% - 3.5px);
}

.particle-indigo {
  background: #818cf8;
  box-shadow: 0 0 8px #818cf8;
  bottom: -3px;
  left: calc(50% - 3.5px);
}

.particle-emerald {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  right: -3px;
  top: calc(50% - 3.5px);
}

.core-caption {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}

/* Chromatogram Sweep Canvas */
.chromatogram-sweep-box {
  position: relative;
  height: 180px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.sweep-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  z-index: 3;
}

.sweep-target-badge {
  color: #38bdf8;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.sweep-svg-wrap {
  position: relative;
  width: 100%;
  height: 120px;
}

.laser-scanner-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0) 0%, #38bdf8 50%, rgba(56, 189, 248, 0) 100%);
  box-shadow: 0 0 12px #38bdf8, 0 0 24px #38bdf8;
  animation: sweepMotion 3s ease-in-out infinite;
  z-index: 4;
}

@keyframes sweepMotion {
  0% { left: 5%; opacity: 0.2; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 95%; opacity: 0.2; }
}

.floating-ion-label {
  position: absolute;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  animation: floatIon 3.5s ease-in-out infinite;
  z-index: 5;
}

.ion-lbl-1 { top: 20px; left: 28%; animation-delay: 0s; }
.ion-lbl-2 { top: 10px; left: 54%; animation-delay: 1.2s; border-color: #34d399; color: #34d399; }
.ion-lbl-3 { top: 35px; left: 78%; animation-delay: 2.1s; border-color: #fbbf24; color: #fbbf24; }

@keyframes floatIon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Pipeline Flow */
.pipeline-flow-container {
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 18px;
}

.pipeline-flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  position: relative;
}

.pipeline-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.pipeline-step-item::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.pipeline-step-item:last-child::after {
  display: none;
}

.pipeline-step-item.completed::after {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.step-node-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  z-index: 2;
  transition: all 0.3s ease;
  margin-bottom: 6px;
}

.pipeline-step-item.active .step-node-bubble {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 14px #38bdf8;
  animation: pulseBubble 1.5s infinite;
}

.pipeline-step-item.completed .step-node-bubble {
  background: #10b981;
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

@keyframes pulseBubble {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.step-node-title {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 2px;
}

.step-node-desc {
  font-size: 9.5px;
  color: #64748b;
  line-height: 1.2;
}

/* Progress Bar Track & Ticker */
.loader-progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loader-stats-top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.loader-current-op {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loader-stage-name {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.loader-sample-target {
  font-size: 12px;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

.loader-pct-badge {
  font-size: 28px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.lab-progress-track {
  width: 100%;
  height: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lab-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 35%, #10b981 70%, #a855f7 100%);
  border-radius: 9999px;
  transition: width 0.15s ease-out;
  position: relative;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.7);
}

.lab-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  animation: shimmerLight 1.8s infinite;
}

@keyframes shimmerLight {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.loader-ticker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}

/* Telemetry Grid */
.loader-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.telemetry-item-box {
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.telemetry-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 600;
}

.telemetry-val {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions Footer */
.lab-loader-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.loader-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.loader-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-lab-fast {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
}

.btn-lab-fast:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-lab-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-lab-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Floating Minimized Widget */
.floating-mini-loader {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  cursor: pointer;
  animation: labFadeIn 0.3s ease;
  transition: transform 0.2s ease;
}

.floating-mini-loader:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spinSlow 0.8s linear infinite;
}

.mini-label {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.mini-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #38bdf8;
  font-weight: 700;
}

/* Responsiveness */
@media (max-width: 900px) {
  .lab-loader-visuals {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .quadrupole-stage {
    height: 130px;
  }
  .orbit-system {
    width: 110px;
    height: 110px;
  }
  .ring-outer { width: 105px; height: 105px; }
  .ring-mid { width: 75px; height: 75px; }
  .ring-inner { width: 50px; height: 50px; }
  .pipeline-flow-steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pipeline-step-item::after {
    display: none;
  }
  .pipeline-step-item {
    flex-direction: row;
    gap: 10px;
    text-align: left;
  }
  .loader-telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ==========================================================================
   21. Comprehensive Mobile & iPhone Specific Optimization (375px - 430px)
   ========================================================================== */
@media (max-width: 600px), (max-width: 430px) {
  /* Global Resets for Mobile Viewports */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    font-size: 13px !important;
    -webkit-text-size-adjust: 100% !important;
    background: #f8fafc !important;
  }

  .app-container,
  .view-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Natural Mobile Scrolling Flow for Workspace */
  .view-container#viewWorkspace {
    height: auto !important;
    min-height: 100vh !important;
    display: block !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .ws-body {
    height: auto !important;
    flex: none !important;
    overflow: visible !important;
    display: block !important;
    min-height: calc(100vh - 100px) !important;
    background: #f8fafc !important;
  }

  .tab-pane {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .tab-pane.active {
    display: block !important;
  }

  /* 1. Header & Mobile Navigation */
  .ws-header {
    height: auto !important;
    min-height: 84px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    padding: 8px 10px 4px 10px !important;
    gap: 6px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
  }

  .ws-brand {
    order: 1 !important;
    flex: 0 0 auto !important;
    gap: 6px !important;
    padding: 2px 4px !important;
  }

  .brand-name {
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
  }

  .ws-header-right {
    order: 2 !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  /* Compact header buttons for iPhone */
  .btn-hardware-status,
  .btn-assistant-toggle {
    padding: 4px 7px !important;
    font-size: 11px !important;
    height: 30px !important;
    border-radius: 6px !important;
    gap: 4px !important;
    white-space: nowrap !important;
  }

  .hw-model,
  #userProfileBadge {
    display: none !important;
  }

  /* Guaranteed Visible Tabs Horizontal Swipe Row */
  .ws-tabs {
    order: 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 5px !important;
    padding: 4px 2px !important;
    margin-top: 4px !important;
    border-top: 1px solid #f1f5f9 !important;
    box-sizing: border-box !important;
  }

  .ws-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .ws-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
  }

  .ws-tab.active {
    background: #eff6ff !important;
    color: #2563eb !important;
    border-color: #93c5fd !important;
    border-bottom: 2px solid #2563eb !important;
  }

  .ws-tab svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* 2. Project Hub Layout on Mobile */
  .hub-container {
    padding: 14px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .hub-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .hub-header-left {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .hub-header-right {
    width: 100% !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .hub-search-wrap,
  .search-box {
    width: 100% !important;
    max-width: 100% !important;
  }

  .search-box input {
    width: 100% !important;
    height: 40px !important;
    font-size: 13.5px !important;
  }

  .hub-header-right button {
    width: 100% !important;
    height: 40px !important;
    justify-content: center !important;
  }

  .quick-start-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .hub-project-card {
    padding: 14px !important;
    box-sizing: border-box !important;
  }

  .project-card-actions {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }

  .project-card-actions button {
    width: 100% !important;
    justify-content: center !important;
    height: 42px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  .hub-pagination {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    text-align: center !important;
    width: 100% !important;
    padding: 14px 0 !important;
  }

  /* 3. Sample Selection Tab */
  .sample-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
  }

  aside.sample-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 240px !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .sidebar-header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 6px 0 !important;
  }

  .sidebar-header-actions button {
    flex: 1 1 45% !important;
    height: 36px !important;
    justify-content: center !important;
    font-size: 11.5px !important;
  }

  .sample-main-content {
    width: 100% !important;
    padding: 10px 8px !important;
    box-sizing: border-box !important;
  }

  .sample-dropzone {
    padding: 14px 10px !important;
    margin: 8px 6px !important;
  }

  /* 4. Method Tab */
  .method-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
  }

  .method-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    max-height: none !important;
  }

  .method-subnav {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }

  .method-subnav li {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
  }

  .method-content-pane {
    width: 100% !important;
    padding: 10px 8px !important;
    box-sizing: border-box !important;
  }

  .table-scroll-container,
  .method-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 5. Data Process Tab - Natural Vertical Column Flow */
  .dataproc-topbar,
  .data-process-topbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    height: auto !important;
    padding: 10px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .topbar-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .method-select-group {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .method-select-group select {
    flex: 1 !important;
    margin-left: 6px !important;
  }

  .btn-start-analysis {
    width: 100% !important;
    height: 42px !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
  }

  .dropdown-tool-group {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 5px !important;
    width: 100% !important;
    padding-bottom: 3px !important;
  }

  .dropdown-tool-group::-webkit-scrollbar {
    display: none !important;
  }

  .menu-pill-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
  }

  .topbar-right,
  .compound-picker {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .target-select {
    flex: 1 !important;
    max-width: none !important;
    margin-left: 8px !important;
    height: 36px !important;
  }

  /* Data Process Body Split */
  .dataproc-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .compounds-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .compounds-list {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 6px 8px !important;
    gap: 4px !important;
  }

  .compounds-list::-webkit-scrollbar {
    display: none !important;
  }

  .compound-nav-item {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }

  .dataproc-main,
  .dataproc-main-panel {
    width: 100% !important;
    padding: 10px 8px !important;
    box-sizing: border-box !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Chromatogram & Calibration Card */
  .chromatogram-section {
    width: 100% !important;
    min-width: 0 !important;
  }

  .chromatogram-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }

  .chromatogram-toolbar button {
    padding: 4px 8px !important;
    font-size: 11px !important;
    height: 28px !important;
  }

  .chromatogram-chart {
    width: 100% !important;
    height: 260px !important;
  }

  .calib-card {
    width: 100% !important;
    height: 240px !important;
    margin-top: 10px !important;
  }

  /* Molecular Profile Card */
  .molecular-profile-card {
    margin-top: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mol-content-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Results Table with Horizontal Scroll */
  .results-table-section,
  .table-responsive-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-top: 10px !important;
    box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.1) !important;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap !important;
    padding: 7px 8px !important;
    font-size: 11px !important;
  }

  /* 6. Tools Tab Grid */
  .cards-view-layout {
    padding: 10px 8px !important;
    height: auto !important;
  }

  .utility-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .utility-card {
    padding: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tool-detail-container {
    padding: 10px 6px !important;
    height: auto !important;
  }

  .sst-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .sst-metric-box {
    padding: 10px 8px !important;
  }

  .sst-chart-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .sst-chart-card {
    height: 200px !important;
    width: 100% !important;
  }

  .export-options-grid,
  .method-utils-grid,
  .tool-reader-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 7. Statistics Tab */
  .stat-cards-overview,
  .stat-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .stat-grid-2col,
  .stat-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 8. Laboratory Loading Animation Page on iPhone */
  .lab-loader-window {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 94vh !important;
    overflow-y: auto !important;
    border-radius: 14px !important;
  }

  .lab-loader-titlebar {
    padding: 8px 12px !important;
  }

  .lab-title-group .mac-title {
    font-size: 11.5px !important;
  }

  .lab-engine-chip {
    display: none !important;
  }

  .lab-loader-body {
    padding: 12px 10px !important;
    gap: 12px !important;
  }

  .lab-loader-visuals {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
  }

  .quadrupole-stage {
    height: 100px !important;
  }

  .orbit-system {
    width: 85px !important;
    height: 85px !important;
  }

  .ring-outer { width: 80px !important; height: 80px !important; }
  .ring-mid { width: 58px !important; height: 58px !important; }
  .ring-inner { width: 38px !important; height: 38px !important; }
  .core-emitter { width: 26px !important; height: 26px !important; }
  .core-emitter svg { width: 14px !important; height: 14px !important; }

  .chromatogram-sweep-box {
    height: 125px !important;
    padding: 8px !important;
  }

  .pipeline-flow-steps {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .pipeline-step-item {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: left !important;
  }

  .pipeline-step-item::after {
    display: none !important;
  }

  .step-node-bubble {
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .step-node-title {
    font-size: 11px !important;
    margin-bottom: 0 !important;
  }

  .step-node-desc {
    font-size: 9.5px !important;
    margin-left: 4px !important;
  }

  .loader-telemetry-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .telemetry-item-box {
    padding: 6px 8px !important;
  }

  .telemetry-val {
    font-size: 11px !important;
  }

  .loader-pct-badge {
    font-size: 22px !important;
  }

  .lab-loader-footer {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  .loader-actions-left,
  .loader-actions-right {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }

  .loader-actions-left button,
  .loader-actions-right button {
    flex: 1 !important;
    height: 38px !important;
    justify-content: center !important;
    font-size: 11.5px !important;
  }

  /* 9. All Modals Optimization */
  .modal-window,
  .mac-window,
  .progress-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    margin: 8px auto !important;
    border-radius: 12px !important;
  }

  .modal-footer {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-footer button {
    width: 100% !important;
    height: 40px !important;
    justify-content: center !important;
  }

  /* Floating Mini Loader */
  .floating-mini-loader {
    bottom: 16px !important;
    right: 14px !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
  }
}


/* ==========================================================================
   22. Laboratory Login Portal (21 CFR Part 11 Secure Authentication)
   ========================================================================== */
.login-view-container {
  min-height: 100vh;
  width: 100%;
  position: relative;
  background: radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.28) 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.24) 0%, transparent 45%),
              radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
              #0b1120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

#viewLogin {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) #0b1120;
}

#viewLogin::-webkit-scrollbar {
  width: 6px;
}

#viewLogin::-webkit-scrollbar-track {
  background: #0b1120;
}

#viewLogin::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

/* Floating Ambient Glow Orbs */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.5;
  animation: orbFloat 8s ease-in-out infinite alternate;
}

.login-orb-1 {
  width: 320px;
  height: 320px;
  background: #0284c7;
  top: 5%;
  left: 10%;
}

.login-orb-2 {
  width: 380px;
  height: 380px;
  background: #6366f1;
  bottom: 5%;
  right: 10%;
  animation-delay: -4s;
}

@keyframes orbFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-30px) scale(1.08); }
}

/* Masthead Header */
.login-masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
  z-index: 2;
}

.login-brand-logo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-brand-title {
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-brand-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 10px 0;
  font-weight: 500;
}

.login-cert-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 9999px;
  font-size: 11px;
  color: #34d399;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* Login Card Window */
.login-window {
  width: 460px;
  max-width: 95vw;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  box-shadow: 0 30px 90px -15px rgba(0, 0, 0, 0.9),
              0 0 50px rgba(56, 189, 248, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  overflow: hidden;
  z-index: 2;
  transition: transform 0.2s ease;
}

.login-window.shake-error {
  animation: loginShake 0.45s ease-in-out;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.login-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-titlebar-text {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: #cbd5e1;
  font-weight: 600;
}

.login-sec-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}

.login-card-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Operator Switcher Tabs */
.login-operator-switcher {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-switcher-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', sans-serif;
}

.login-switcher-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.login-switcher-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
}

.switcher-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.2s ease;
}

.login-switcher-btn.active .switcher-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Operator Profile Card */
.login-operator-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.login-operator-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.login-avatar-orb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: 2px solid rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.operator-online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px #10b981;
  animation: pulseReady 2s infinite ease-in-out;
}

@keyframes pulseReady {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.15); }
}

.login-operator-info {
  flex: 1;
  min-width: 0;
}

.login-operator-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 2px;
}

.login-operator-name {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 2px 0;
  letter-spacing: -0.2px;
}

.login-operator-dept {
  font-size: 11.5px;
  color: #94a3b8;
}

.login-cert-chip {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.login-label-badge {
  font-size: 10.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 1px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.login-input-status-icon {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* Form Groups */
.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  height: 44px;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0 40px 0 42px;
  color: #f8fafc;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.login-input::placeholder {
  color: #64748b;
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.btn-toggle-eye:hover {
  color: #38bdf8;
}

/* Error Banner */
.login-error-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: labFadeIn 0.25s ease;
}

.login-error-alert.hidden {
  display: none !important;
}

/* Remember Row */
.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.login-checkbox-label input {
  accent-color: #0284c7;
  cursor: pointer;
}

/* Submit Button */
.btn-login-submit {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 50%, #06b6d4 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.4);
  margin-top: 4px;
}

.btn-login-submit:hover {
  filter: brightness(1.12);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 24px rgba(2, 132, 199, 0.55);
}

.btn-login-submit:active {
  transform: translateY(0);
}

/* Security Footer */
.login-footer-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: #64748b;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.login-footer-item span {
  display: block;
  color: #94a3b8;
  font-weight: 600;
}

/* Mobile Responsiveness for Login Page */
@media (max-width: 480px) {
  .login-window {
    width: 95vw !important;
    border-radius: 16px !important;
  }
  .login-card-body {
    padding: 18px 16px !important;
    gap: 14px !important;
  }
  .login-brand-title {
    font-size: 22px !important;
  }
  .login-footer-meta {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    text-align: center !important;
  }
}

/* Active Compound Status Pill Display matching Video 01:40 */
.active-compound-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: #475569;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin-right: 12px;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.active-compound-status-bar strong {
  color: #0f172a;
  font-weight: 700;
}
