/* ==========================================================================
   나이스엘엠에스 제조AI플랫폼 (Nazare / Navis)
   Design System & Styling
   ========================================================================== */

:root {
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-panel: rgba(15, 23, 42, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: #1e293b;
  
  --border-color: rgba(148, 163, 184, 0.15);
  --border-hover: rgba(56, 189, 248, 0.4);
  --border-glow: rgba(56, 189, 248, 0.6);

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent-blue: #0284c7;
  --accent-cyan: #06b6d4;
  --accent-teal: #0d9488;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-orange: #ea580c;
  --accent-red: #ef4444;

  --gradient-brand: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #10b981 100%);
  --gradient-dark: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 15, 29, 0.98) 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.15) 0%, transparent 70%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 10%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* --------------------------------------------------------------------------
   App Container & Header
   -------------------------------------------------------------------------- */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Utility Bar */
.top-util-bar {
  background: rgba(10, 15, 29, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-sub);
}

.util-left, .util-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
}

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

.status-badge.alert {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.8s infinite;
}

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

/* Main Header */
.main-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-ingkle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.logo-icon {
  width: 26px;
  height: 26px;
  background: var(--gradient-brand);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 15px;
  box-shadow: var(--shadow-glow);
}

.brand-divider {
  color: var(--text-muted);
  font-weight: 300;
}

.logo-client {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.logo-client-img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.25));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo-client-img:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.45));
}

.project-tag {
  font-size: 11px;
  background: rgba(2, 132, 199, 0.18);
  border: 1px solid rgba(2, 132, 199, 0.4);
  color: #38bdf8;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Header Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: rgba(10, 15, 29, 0.75);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-width: 590px;
}

.nav-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 9px 16px;
  min-width: 105px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: var(--gradient-brand);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
}

.nav-tab-btn .badge-pill {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

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

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1720px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

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

/* Page Header Banner */
.page-header-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.page-header-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-brand);
}

.banner-left h2 {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.banner-left p {
  color: var(--text-sub);
  font-size: 14px;
}

.banner-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-chip {
  text-align: right;
}

.stat-chip .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-chip .value {
  font-size: 18px;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono);
}

/* Common Grid & Cards */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

/* --------------------------------------------------------------------------
   Search & Filter Panel (LOT, 도면, 레시피, 품목, 품질코드, 기간)
   -------------------------------------------------------------------------- */
.search-filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(14px);
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-filter-panel:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.filter-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-badge-info {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.filter-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 20px;
  margin-bottom: 16px;
}

.filter-field-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-input-control, .filter-select-control {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.filter-input-control:focus, .filter-select-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.filter-date-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-date-group .filter-input-control {
  flex: 1;
}

.filter-date-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.filter-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.quick-period-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-period-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 4px;
}

.period-chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.period-chip-btn:hover, .period-chip-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}

.filter-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-filter-search {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
  transition: all 0.2s;
}

.btn-filter-search:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.45);
}

.btn-filter-reset {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-filter-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: var(--text-sub);
}

/* White Theme Modifier for Search Filter Panel */
.search-filter-panel.theme-white {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.search-filter-panel.theme-white:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

.search-filter-panel.theme-white .filter-panel-header {
  border-bottom: 1px solid #e2e8f0;
}

.search-filter-panel.theme-white .filter-panel-title {
  color: #0f172a;
  font-weight: 800;
}

.search-filter-panel.theme-white .filter-badge-info {
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  font-weight: 600;
}

.search-filter-panel.theme-white .filter-field-label {
  color: #334155;
  font-weight: 700;
}

.search-filter-panel.theme-white .filter-input-control,
.search-filter-panel.theme-white .filter-select-control {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 500;
}

.search-filter-panel.theme-white .filter-input-control:focus,
.search-filter-panel.theme-white .filter-select-control:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.search-filter-panel.theme-white .filter-date-sep {
  color: #64748b;
  font-weight: bold;
}

.search-filter-panel.theme-white .filter-actions-bar {
  border-top: 1px solid #e2e8f0;
}

.search-filter-panel.theme-white .quick-period-label {
  color: #64748b;
  font-weight: 600;
}

.search-filter-panel.theme-white .period-chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.search-filter-panel.theme-white .period-chip-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.search-filter-panel.theme-white .period-chip-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.search-filter-panel.theme-white .btn-filter-reset {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.search-filter-panel.theme-white .btn-filter-reset:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.search-filter-panel.theme-white .btn-filter-search {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
}

.search-filter-panel.theme-white .btn-filter-search:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.5);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.grid-sidebar {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  position: relative;
}

.card:hover {
  border-color: var(--border-hover);
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
}

.card-title .icon {
  color: #38bdf8;
}

/* --------------------------------------------------------------------------
   MODULE 1: Drawing Similarity Engine Styles
   -------------------------------------------------------------------------- */
/* ==========================================================================
   MODULE 1: Dynamic 5-Stage Stepper with Animated Progress Rings
   ========================================================================== */
.m1-workflow-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(10, 15, 29, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.m1-workflow-stepper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5), rgba(16, 185, 129, 0.5), transparent);
}

.m1-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.55;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  user-select: none;
}

.m1-step-item:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.03);
}

.m1-step-item.active,
.m1-step-item.progressing {
  opacity: 1;
  background: rgba(56, 189, 248, 0.06);
}

.m1-step-item.done {
  opacity: 0.95;
}

/* Circle Wrapper & SVG Progress Ring */
.step-circle-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* 12시 방향부터 진행 */
  pointer-events: none;
}

.step-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 2.8;
}

.step-ring-bar {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 100.53;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s;
}

/* Inner Circle containing Number */
.step-num-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #94a3b8;
  transition: all 0.35s ease;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* PROGRESSING / ACTIVE STATE: Dynamic Spinning Conic Aura & Pulse Ring */
.m1-step-item.progressing .step-circle-wrapper::after,
.m1-step-item.active .step-circle-wrapper::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(56, 189, 248, 0.2) 120deg, #38bdf8 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 2.5px));
  animation: spinStepRing 1.2s linear infinite;
  z-index: 3;
}

@keyframes spinStepRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.m1-step-item.progressing .step-num-circle,
.m1-step-item.active .step-num-circle {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  animation: pulseStepCircle 1.4s ease-in-out infinite alternate;
}

@keyframes pulseStepCircle {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }
  100% { transform: scale(1.08); box-shadow: 0 0 22px rgba(56, 189, 248, 0.9); }
}

.m1-step-item.progressing .step-ring-bar,
.m1-step-item.active .step-ring-bar {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.9));
}

/* DONE STATE: Solid Emerald-Cyan Ring */
.m1-step-item.done .step-ring-bar {
  stroke: #10b981;
  stroke-dashoffset: 0 !important;
  filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.6));
}

.m1-step-item.done .step-num-circle {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Step Text */
.step-text .step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.3s;
}

.m1-step-item.progressing .step-title,
.m1-step-item.active .step-title {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.m1-step-item.done .step-title {
  color: #f1f5f9;
}

.step-text .step-desc {
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.3s;
}

.m1-step-item.progressing .step-desc,
.m1-step-item.active .step-desc {
  color: #7dd3fc;
}

/* Dynamic Flow Connector between steps */
.step-flow-connector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 65px;
  min-width: 28px;
  color: #475569;
  position: relative;
  transition: color 0.3s;
}

.connector-track {
  height: 2px;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.connector-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
  transition: width 0.35s ease;
}

.step-flow-connector.flowing .connector-fill {
  width: 100%;
}

.step-flow-connector.flowing .connector-arrow {
  color: #38bdf8;
}

.step-flow-connector.active .connector-arrow {
  color: #38bdf8;
  animation: pulseArrow 0.8s ease-in-out infinite alternate;
}

@keyframes pulseArrow {
  0% { transform: translateX(0); opacity: 0.6; }
  100% { transform: translateX(3px); opacity: 1; }
}

/* Stepper Replay Button */
.stepper-action-wrap {
  margin-left: 6px;
  display: flex;
  align-items: center;
}

.stepper-replay-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.stepper-replay-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

/* Module 1 Layout */
.m1-main-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
}

/* CAD & Upload Panel */
.upload-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: rgba(2, 132, 199, 0.03);
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 20px;
}

.upload-dropzone:hover {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.08);
}

.dropzone-icon {
  font-size: 34px;
  color: #38bdf8;
  margin-bottom: 8px;
}

.supported-badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.file-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.file-type-badge.stp {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.file-type-badge.dxf {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* CAD Viewer Simulation */
.cad-viewer-container {
  background: radial-gradient(circle at 50% 20%, #0d1e38 0%, #050914 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.5), 0 4px 20px rgba(0, 0, 0, 0.25);
}

.cad-drawing-display {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cad-drawing-hero {
  background: #ffffff;
  border-bottom: 1px solid rgba(56, 189, 248, 0.35);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 12px;
}

.cad-hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  z-index: 2;
}

.cad-format-badge {
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  background: rgba(224, 242, 254, 0.95);
  border: 1px solid #7dd3fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.btn-cad-toggle-sm {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cad-toggle-sm:hover {
  background: #0284c7;
  color: #ffffff;
}

.cad-hero-img-box {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cad-hero-img {
  max-width: 90%;
  max-height: 175px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.cad-hero-img:hover {
  transform: scale(1.03);
}

.cad-details-panel {
  padding: 12px 14px;
  background: rgba(10, 15, 29, 0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cad-part-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.cad-part-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
}

.cad-part-alloy {
  font-size: 12px;
  font-weight: 500;
  color: #38bdf8;
  margin-left: 4px;
}

.cad-part-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
}

.cad-features-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.cad-chip {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.cad-chip.highlight {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  font-weight: 600;
}

.cad-specs-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  margin-top: 2px;
}

.spec-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spec-col .lbl {
  font-size: 10px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.spec-col strong {
  font-size: 11.5px;
  color: #f1f5f9;
  font-family: var(--font-mono);
}

.cad-mesh-display {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 310px;
  padding: 12px 16px;
  position: relative;
  background: #070b14;
}

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

.cad-canvas {
  flex: 1;
  width: 100%;
  height: 240px;
  display: block;
  cursor: grab;
}

.cad-canvas:active {
  cursor: grabbing;
}

.cad-drag-hint {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 10px;
  color: #64748b;
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
}

/* Extracted Feature Grid */
.feature-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.feature-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.feature-box .feat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.feature-box .feat-val {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* Top-N Result List */
.similarity-result-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
  cursor: pointer;
}

.similarity-result-item:hover {
  background: rgba(2, 132, 199, 0.06);
  border-color: #38bdf8;
  transform: translateX(4px);
}

.similarity-result-item.selected {
  background: rgba(2, 132, 199, 0.12);
  border-color: #0284c7;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.2);
}

.res-rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.res-rank-badge.rank-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.item-thumb-box {
  width: 60px;
  height: 60px;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.item-thumb-box img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.item-meta-group {
  flex: 1;
  margin-left: 16px;
}

.item-code {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-sub-desc {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

.similarity-score-bar-group {
  width: 150px;
  text-align: right;
}

.sim-score-num {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #34d399;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-top: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #34d399);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Staggered Cascade Drop-in Animation for Top-N Items */
@keyframes cascadeDropIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.008);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.similarity-result-item.cascade-in {
  animation: cascadeDropIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Searching Placeholder & Skeleton Styles */
.topn-searching-placeholder {
  padding: 24px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.searching-radar-wrap {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.searching-radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  animation: spinStepRing 1.2s linear infinite;
}

.searching-radar-core {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseStepCircle 1.2s ease-in-out infinite alternate;
}

.searching-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.searching-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.searching-skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.searching-skeleton-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0% { opacity: 0.35; }
  50% { opacity: 0.75; }
  100% { opacity: 0.35; }
}

.sk-rank {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.sk-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.sk-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sk-line {
  height: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.sk-line.lg { width: 55%; }
.sk-line.sm { width: 80%; }

.sk-score {
  width: 60px;
  height: 22px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.08);
}

/* --------------------------------------------------------------------------
   MODULE 2: Golden Batch Recipe Engine Styles
   -------------------------------------------------------------------------- */
.recipe-step-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.recipe-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.recipe-step-card .st-num-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  transition: all 0.3s ease;
}

.recipe-step-card.active {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.08);
}

.recipe-step-card.active .st-num-badge {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.recipe-step-card.progressing {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  animation: recipeStepPulse 1.2s infinite alternate;
}

.recipe-step-card.progressing .st-num-badge {
  color: #0284c7;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.recipe-step-card.done {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.08);
}

.recipe-step-card.done .st-num-badge {
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
}

@keyframes recipeStepPulse {
  0% { transform: translateY(0); box-shadow: 0 0 8px rgba(56, 189, 248, 0.2); }
  100% { transform: translateY(-2px); box-shadow: 0 0 18px rgba(56, 189, 248, 0.45); }
}

.recipe-step-card .st-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.recipe-step-card .st-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Recipe Comparison Table */
.recipe-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  margin-top: 10px;
}

.recipe-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 12px;
}

.recipe-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background-color 0.2s ease;
}

.recipe-table tbody tr {
  transition: all 0.2s ease;
}

.recipe-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}

/* Cascading Sequential Row Animation */
.recipe-table tbody tr.recipe-row-cascade {
  opacity: 0;
  transform: translateY(14px);
  animation: recipeRowSlideIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes recipeRowSlideIn {
  0% {
    opacity: 0;
    transform: translateY(14px);
    background: rgba(56, 189, 248, 0.16);
  }
  60% {
    background: rgba(56, 189, 248, 0.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    background: transparent;
  }
}

.recipe-table td.col-ai-sv {
  color: #38bdf8;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.2px;
  background: rgba(56, 189, 248, 0.03);
}

/* Skeleton Loading State for Recipe Rows */
.recipe-skeleton-row td {
  padding: 14px 14px;
}

.recipe-skeleton-bar {
  height: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeletonShimmer 1.4s infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.delta-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.quality-badge-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Staggered Pop-In for KPIs and Grade Card */
.golden-kpi-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.golden-kpi-card.pop-in {
  animation: goldenKpiPopIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes goldenKpiPopIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.grade-display-card.pop-in {
  animation: goldenGradePopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes goldenGradePopIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Confidence Grade Badge */
.grade-display-card {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.grade-circle-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.4);
}

/* Simulator Slider Controls */
.slider-group {
  margin-bottom: 18px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
}

.slider-val-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #38bdf8;
  font-size: 14px;
}

.slider-input {
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  cursor: pointer;
  border: 2px solid white;
}

/* Virtual Simulation Property Cards */
.prop-kpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.prop-kpi-card .prop-name {
  font-size: 12px;
  color: var(--text-muted);
}

.prop-kpi-card .prop-val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  margin: 4px 0;
}

.prop-kpi-card .prop-unit {
  font-size: 12px;
  color: var(--text-sub);
}

.prop-kpi-card .prop-status-tag {
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
}

/* --------------------------------------------------------------------------
   MODULE 3: xAI Defect Cause Diagnosis & Traceability Styles
   -------------------------------------------------------------------------- */
.genealogy-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.genealogy-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.3s ease;
}

.genealogy-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  margin-bottom: 6px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.genealogy-node.active .genealogy-icon-box {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.genealogy-node.scanning .genealogy-icon-box {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.8);
  transform: scale(1.12);
}

.genealogy-node.warning-node.active .genealogy-icon-box {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.4));
  color: #f87171;
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
  animation: warningNodePulse 1.4s infinite alternate;
}

@keyframes warningNodePulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
  100% { transform: scale(1.08); box-shadow: 0 0 22px rgba(239, 68, 68, 0.7); }
}

.genealogy-node .node-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
}

.genealogy-node .node-lot {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.genealogy-connector {
  flex: 1;
  height: 2px;
  background: rgba(148, 163, 184, 0.15);
  margin: 0 10px;
  position: relative;
  top: -12px;
  transition: all 0.35s ease;
}

.genealogy-connector.active {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* Correlation Heatmap Table */
.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
}

.heatmap-table th {
  font-size: 11px;
  color: var(--text-sub);
  padding: 6px;
  text-align: center;
}

.heatmap-row-cascade {
  opacity: 0;
  transform: translateY(12px);
  animation: heatmapRowSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heatmapRowSlideIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.heatmap-cell {
  height: 38px;
  border-radius: 4px;
  text-align: center;
  vertical-align: middle;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 5;
  outline: 2px solid white;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* Feature Importance Horizontal Bar */
.shap-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.shap-row-cascade {
  opacity: 0;
  transform: translateX(-14px);
  animation: shapRowSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shapRowSlideIn {
  0% { opacity: 0; transform: translateX(-14px); }
  100% { opacity: 1; transform: translateX(0); }
}

.shap-feat-name {
  width: 120px;
  font-size: 12px;
  color: var(--text-sub);
  text-align: right;
  white-space: nowrap;
}

.shap-bar-track {
  flex: 1;
  height: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.shap-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 4px;
  width: 0%;
  transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.shap-val-text {
  width: 85px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #38bdf8;
}

/* Root Cause Diagnosis Items Cascading */
.cause-item-cascade {
  opacity: 0;
  transform: translateY(12px);
  animation: causeItemSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes causeItemSlideIn {
  0% { opacity: 0; transform: translateY(12px); background: rgba(56, 189, 248, 0.1); }
  100% { opacity: 1; transform: translateY(0); }
}

.xai-guide-box {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.xai-guide-box.pop-in {
  animation: xaiGuidePopIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes xaiGuidePopIn {
  0% { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

/* Anomaly Alert Box */
.anomaly-alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.alert-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.alert-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.alert-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
  animation: pulse 1.5s infinite;
}

.alert-title {
  font-size: 15px;
  font-weight: 700;
  color: #fca5a5;
}

.alert-desc {
  font-size: 12px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   MODULE 4: Multimodal AI Agent Styles
   -------------------------------------------------------------------------- */
.agent-chat-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  height: calc(100vh - 210px);
}

.chat-conversation-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-row {
  display: flex;
  gap: 14px;
  max-width: 85%;
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.avatar-box.agent {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.avatar-box.user {
  background: #334155;
  color: #f1f5f9;
}

.message-bubble {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
}

.message-row.user .message-bubble {
  background: rgba(2, 132, 199, 0.25);
  border-color: rgba(2, 132, 199, 0.5);
  color: #ffffff;
}

/* Agent Tool Execution Badges */
.agent-tool-pills-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tool-exec-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.tool-exec-pill.done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-color);
}

.preset-chip-list {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}

.input-control-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-field:focus {
  border-color: #38bdf8;
}

/* --------------------------------------------------------------------------
   NAZARE / NAVIS Platform Overview Styles
   -------------------------------------------------------------------------- */
.platform-layer-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.platform-layer-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.platform-layer-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #38bdf8;
}

.layer-icon-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layer-icon {
  font-size: 20px;
}

.layer-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.layer-spec {
  font-size: 12px;
  color: var(--text-sub);
}

.badge-layer-tech {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* --------------------------------------------------------------------------
   Responsive Rules
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .m1-main-grid {
    grid-template-columns: 1fr;
  }
  .agent-chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .nav-tabs {
    flex-wrap: wrap;
  }
  .m1-workflow-stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* --------------------------------------------------------------------------
   Filter Input with Search Icon at End & Search Box Styles
   -------------------------------------------------------------------------- */
.filter-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.filter-search-input {
  width: 100%;
  padding-right: 36px !important;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.filter-search-input:hover {
  border-color: #38bdf8;
}

.filter-search-icon-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 6px;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
  padding: 0;
}

.filter-search-icon-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.filter-search-icon-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* White Theme Specific overrides for Filter Search Box */
.search-filter-panel.theme-white .filter-search-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 600;
}

.search-filter-panel.theme-white .filter-search-input:hover {
  background: #ffffff;
  border-color: #0284c7;
}

.search-filter-panel.theme-white .filter-search-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.search-filter-panel.theme-white .filter-search-icon-btn {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

.search-filter-panel.theme-white .filter-search-icon-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

/* --------------------------------------------------------------------------
   Filter Item Lookup Popup Modal Component
   -------------------------------------------------------------------------- */
.lookup-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.lookup-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.lookup-modal-dialog {
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 35px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
}

.lookup-modal-backdrop.active .lookup-modal-dialog {
  transform: scale(1) translateY(0);
}

.lookup-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px;
  background: linear-gradient(180deg, #1e293b 0%, #152033 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.lookup-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lookup-modal-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  letter-spacing: 0.3px;
}

.lookup-modal-title {
  margin: 4px 0 0 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lookup-modal-desc {
  margin: 3px 0 0 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.lookup-modal-close-btn {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
}

.lookup-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
  transform: rotate(90deg);
}

.lookup-modal-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.lookup-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.lookup-search-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  pointer-events: none;
}

.lookup-search-input {
  width: 100%;
  padding: 9px 34px 9px 38px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s;
}

.lookup-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.lookup-search-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
}

.lookup-search-clear-btn:hover {
  color: #f8fafc;
}

.lookup-search-btn {
  padding: 9px 16px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.lookup-search-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.lookup-reset-btn {
  padding: 9px 14px;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.lookup-reset-btn:hover {
  background: rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

.lookup-count-badge {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}

.lookup-modal-table-wrap {
  flex: 1;
  overflow-y: auto;
  max-height: 52vh;
  padding: 0;
  background: #0f172a;
}

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

.lookup-data-table thead {
  position: sticky;
  top: 0;
  background: #1e293b;
  z-index: 10;
  border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.lookup-data-table th {
  padding: 12px 14px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
}

.lookup-data-table th:last-child {
  border-right: none;
}

.lookup-data-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: background 0.15s ease;
  cursor: pointer;
}

.lookup-data-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.lookup-data-table tbody tr.selected-row {
  background: rgba(56, 189, 248, 0.15);
}

.lookup-data-table td {
  padding: 11px 14px;
  color: #cbd5e1;
  vertical-align: middle;
  border-right: 1px solid rgba(148, 163, 184, 0.07);
}

.lookup-data-table td:last-child {
  border-right: none;
}

.lookup-code-badge {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: inline-block;
}

.lookup-row-name {
  font-weight: 700;
  color: #ffffff;
  display: block;
}

.lookup-row-subtext {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.lookup-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}

.lookup-status-pill.standard {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.lookup-status-pill.golden {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.lookup-status-pill.all {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.lookup-select-action-btn {
  padding: 6px 14px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.lookup-select-action-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.lookup-current-indicator {
  font-size: 11px;
  color: #10b981;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.lookup-empty-row {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.lookup-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.lookup-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #1e293b;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.lookup-modal-tip {
  font-size: 12px;
  color: #94a3b8;
}

.lookup-modal-tip strong {
  color: #38bdf8;
}

.lookup-modal-cancel-btn {
  padding: 8px 18px;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.lookup-modal-cancel-btn:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #ffffff;
}

/* ==========================================================================
   CUSTOMER NAS SERVER INTEGRATION & FILE SEMANTIC SEARCH (MODULE 4)
   ========================================================================== */

/* File Extension Badges */
.ext-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.ext-badge.dwg {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.ext-badge.stp {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
}
.ext-badge.pdf {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.ext-badge.xlsx {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.ext-badge.docx {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* NAS Result Container in Chat */
.nas-result-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.nas-result-intro {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 2px;
}

.nas-file-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.nas-file-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
}

.nas-file-card:hover {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.18);
  transform: translateY(-2px);
}

.nas-file-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.nas-file-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.nas-file-link {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, text-shadow 0.15s ease;
  word-break: break-all;
}

.nas-file-link:hover {
  color: #7dd3fc;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  text-decoration: underline;
}

.nas-match-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}

.nas-file-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.nas-file-path-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 10px;
  gap: 10px;
}

.nas-file-path-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
  flex: 1;
}

.nas-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-family: var(--font-family);
}

.nas-copy-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.nas-file-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 12px;
}

.nas-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nas-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-family);
}

.nas-action-btn.primary {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.nas-action-btn.primary:hover {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.nas-action-btn.secondary {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.nas-action-btn.secondary:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #ffffff;
}

.nas-action-btn.accent {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.nas-action-btn.accent:hover {
  background: rgba(16, 185, 129, 0.28);
  color: #ffffff;
}

/* Preset chip styling for NAS */
.preset-chip.nas-chip {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}
.preset-chip.nas-chip:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}

/* Right Sidebar Tabs */
.agent-sidebar-tabs {
  display: flex;
  gap: 6px;
  background: rgba(10, 15, 29, 0.85);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}

.agent-sidebar-tab-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-sub);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.agent-sidebar-tab-btn.active {
  background: rgba(30, 41, 59, 0.9);
  color: #38bdf8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.agent-sidebar-tab-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

/* NAS Hub Panel */
.nas-hub-status-card {
  background: rgba(10, 15, 29, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 11px;
}

.nas-hub-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.nas-hub-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
  gap: 8px;
  transition: border-color 0.2s;
}

.nas-hub-search-box:focus-within {
  border-color: #38bdf8;
}

.nas-hub-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 12px;
  outline: none;
  font-family: var(--font-family);
}

.nas-hub-category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.nas-cat-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: var(--font-family);
}

.nas-cat-chip.active, .nas-cat-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}

.nas-hub-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.nas-hub-file-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s;
}

.nas-hub-file-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.4);
}

.nas-hub-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.nas-hub-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.nas-hub-item-name:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.nas-hub-item-meta {
  font-size: 10.5px;
  color: #94a3b8;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.nas-hub-item-btns {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* NAS Modal Dialog */
.nas-modal-dialog {
  max-width: 880px;
  width: 95vw;
}

.nas-modal-ribbon {
  background: rgba(10, 15, 29, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
}

.nas-modal-path-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cbd5e1;
  gap: 12px;
}

.nas-path-icon {
  font-size: 14px;
}

.nas-path-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.nas-modal-meta-chips {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 11.5px;
  color: #94a3b8;
}

.nas-modal-preview-wrap {
  padding: 20px 24px;
  max-height: 480px;
  overflow-y: auto;
  background: #090d16;
}

/* Preview Types: CAD, Report, Excel, SOP */
.cad-blueprint-view {
  background: #070e1b;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

.cad-blueprint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  color: #7dd3fc;
  font-weight: 700;
}

.cad-canvas-mock {
  width: 100%;
  height: 240px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cad-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.cad-spec-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
}

.cad-spec-label {
  font-size: 10.5px;
  color: #94a3b8;
}

.cad-spec-val {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 2px;
}

/* Document & Excel Preview */
.doc-report-view {
  background: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 20px;
}

.doc-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 12px;
}

.doc-sheet-table th, .doc-sheet-table td {
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.doc-sheet-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  text-align: left;
  font-weight: 700;
}

.doc-sheet-table td {
  background: rgba(15, 23, 42, 0.4);
  color: #f1f5f9;
}


