/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-tertiary: rgba(22, 32, 59, 0.45);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(52, 211, 153, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  /* Accent Colors */
  --color-green: #10b981; /* Allowed */
  --color-green-glow: rgba(16, 185, 129, 0.25);
  
  --color-amber: #f59e0b; /* In analysis */
  --color-amber-glow: rgba(245, 158, 11, 0.25);
  
  --color-red: #ef4444; /* Blocked */
  --color-red-glow: rgba(239, 68, 68, 0.25);

  --color-blue: #3b82f6; /* SAP / Info */
  --color-blue-glow: rgba(59, 130, 246, 0.25);
  
  /* Fonts */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-tertiary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.glass-hover:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header & Nav */
header {
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  background: linear-gradient(135deg, var(--color-green), var(--color-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--color-green), var(--color-blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.btn {
  font-family: var(--font-display);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 13px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-green), #059669);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 20px var(--color-green-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--color-red);
  color: #fff;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

/* Main Layout */
main {
  max-width: 1400px;
  margin: 30px auto;
  padding: 0 20px;
}

/* Search Bar (Centered sequence) */
.search-bar {
  position: relative;
  width: 100%;
}

.search-bar input {
  width: 100%;
  padding: 14px 20px 14px 45px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.search-bar input:focus {
  border-color: var(--color-green);
  box-shadow: 0 0 15px var(--border-glow);
}

.search-bar i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Autocomplete suggestion styles */
.suggestion-item {
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

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

.suggestion-item span.project-code {
  font-weight: 700;
  color: var(--color-green);
  font-family: var(--font-display);
}

.suggestion-item span.project-name {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Search summary card styles */
.summary-card {
  padding: 25px;
  background: linear-gradient(135deg, var(--bg-secondary), rgba(26, 36, 61, 0.7));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-green), var(--color-blue));
}

.summary-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
}

.summary-card .subtitle {
  font-size: 11px;
  color: var(--color-green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  display: block;
}

.summary-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 25px;
  margin-bottom: 25px;
}

.summary-info-item {
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-info-item strong {
  color: #fff;
}

.summary-info-item span.label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 3px;
  font-weight: 500;
}

/* Project Detail Layout */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
}

.back-link:hover {
  color: #fff;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.detail-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.project-id {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-open { background: rgba(16, 185, 129, 0.15); color: var(--color-green); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-locked { background: rgba(239, 68, 68, 0.15); color: var(--color-red); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); border: 1px solid rgba(245, 158, 11, 0.2); }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
}

.detail-card {
  padding: 20px 25px;
  margin-bottom: 25px;
}

.sim-card {
  padding: 25px;
  height: fit-content;
}

/* Collapsible sections styles */
.collapsible-section {
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 10px 0;
}

.section-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-chevron {
  font-size: 14px;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.toggle-chevron.collapsed {
  transform: rotate(-90deg);
}

.section-content {
  margin-top: 15px;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

/* Dynamic folding tree CSS */
.tree-view-root {
  background: rgba(10, 15, 25, 0.3);
  border-radius: 12px;
  padding: 15px 20px;
  max-height: 450px;
  overflow-y: auto;
}

.tree-node-item {
  margin-left: 15px;
  position: relative;
}

.tree-node-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
}

.tree-node-item:last-child::before {
  height: 16px;
}

.tree-node-item::after {
  content: '';
  position: absolute;
  top: 16px;
  left: -10px;
  width: 8px;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.tree-node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  transition: background 0.15s ease;
}

.tree-node-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tree-branch-icon {
  font-size: 11px;
  color: var(--text-muted);
  width: 12px;
  transition: transform 0.2s ease;
}

.tree-branch-icon.expanded {
  transform: rotate(90deg);
}

.tree-node-desc {
  font-weight: 500;
  color: #fff;
}

.tree-node-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

.tree-node-comp-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-blue);
  padding: 2px 6px;
  border-radius: 4px;
}

.tree-node-comp-badge.cc-1210 {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-green);
}

.tree-node-comp-badge.cc-12CC {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber);
}

.tree-node-children {
  display: block;
  transition: all 0.3s ease;
}

/* Modals overlays popup styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 12, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--color-red);
}

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

/* Table styles */
.heatmap-table {
  width: 100%;
  border-collapse: collapse;
}

.heatmap-table th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.heatmap-table td {
  padding: 14px 16px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Tab buttons and headers */
.tab-headers {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 10px 15px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
}

.sub-tab-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sub-tab-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}

.sub-tab-btn.active {
  background: var(--color-green-glow);
  border-color: var(--color-green);
  color: #fff;
}

/* Interactive Mind Map styling */
.mindmap-node {
  cursor: pointer;
}

.mindmap-node circle {
  fill: var(--bg-secondary);
  stroke: var(--border-color);
  stroke-width: 1.5;
  transition: all 0.2s ease;
}

.mindmap-node:hover circle {
  stroke: var(--color-blue);
  fill: rgba(59, 130, 246, 0.1);
}

.mindmap-node.project circle {
  stroke: var(--color-blue);
  stroke-width: 2.5;
  fill: rgba(59, 130, 246, 0.15);
}

.mindmap-node.otp circle {
  stroke: var(--color-green);
  stroke-width: 2;
  fill: rgba(16, 185, 129, 0.15);
}

.mindmap-node.document circle {
  stroke: var(--color-amber);
  stroke-dasharray: 2, 2;
}

.mindmap-node.blocked circle {
  stroke: var(--color-red);
  stroke-dasharray: none;
}

.mindmap-node text {
  fill: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
}

.mindmap-node text.sub {
  fill: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: normal;
}

@keyframes flow {
  to {
    stroke-dashoffset: -20;
  }
}

.mindmap-link {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22); /* Highly visible light gray link */
  stroke-width: 2.5px; /* Thicker connection path */
  transition: stroke 0.3s ease;
}

.mindmap-link.active {
  stroke: #34d399; /* Vibrant emerald green */
  stroke-dasharray: 8, 4;
  stroke-width: 3.5px; /* Thicker active pipeline */
  animation: flow 1.5s linear infinite;
  filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.55));
}

/* Console logs dashboard styling */
.console-logs {
  background: #04060b;
  border: 1px solid #1a2238;
  border-radius: 8px;
  padding: 15px;
  font-family: monospace;
  font-size: 11px;
  color: #10b981;
  overflow-y: auto;
}

.console-logs div {
  margin-bottom: 6px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  padding-left: 6px;
}

.console-logs .log-error { color: #f87171; border-left-color: #ef4444; }
.console-logs .log-system { color: #60a5fa; border-left-color: #3b82f6; }
.console-logs .log-warn { color: #fbbf24; border-left-color: #f59e0b; }
.console-logs .log-success { color: #34d399; border-left-color: #10b981; }

/* Interactive Heatmap Section 5 Styles */
.heatmap-grid {
  margin-top: 15px;
}

.heatmap-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.heatmap-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: background 0.3s ease;
}

.heatmap-card.green::before { background: #10b981; }
.heatmap-card.orange::before { background: #f59e0b; }
.heatmap-card.red::before { background: #ef4444; }

.heatmap-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.heatmap-card.green:hover { box-shadow: 0 10px 25px rgba(16, 185, 129, 0.1); }
.heatmap-card.orange:hover { box-shadow: 0 10px 25px rgba(245, 158, 11, 0.1); }
.heatmap-card.red:hover { box-shadow: 0 10px 25px rgba(239, 68, 68, 0.1); }

.heatmap-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.heatmap-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.heatmap-card-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.heatmap-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

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

.heatmap-doc-checklist {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

.heatmap-doc-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  text-align: left;
}

.heatmap-doc-checklist li i {
  width: 14px;
}

.sim-verdict-card {
  border-radius: 8px;
  padding: 15px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(8px);
}

.sim-verdict-card.green {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.sim-verdict-card.orange {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.sim-verdict-card.red {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.financial-impact-dashboard {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 15px;
  margin-top: 15px;
}

.financial-metric-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.financial-metric-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

.financial-metric-variance {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.financial-metric-variance.positive { color: #34d399; }
.financial-metric-variance.negative { color: #f87171; }

/* ==========================================================
   SAP S/4HANA PUBLIC CLOUD NAV STYLING & HOME DASHBOARD
   ========================================================== */

/* 1. Header / Top Bar */
.sap-header {
  height: 52px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: 150;
}

.sap-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sap-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.sap-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sap-logo-img {
  height: 24px;
  display: block;
}

.sap-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
}

.sap-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
  background: linear-gradient(135deg, var(--color-green), var(--color-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.sap-nav-home {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.sap-nav-home:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

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

.sap-util-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

.sap-util-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sap-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-blue);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bg-secondary);
}

.sap-user-avatar {
  width: 32px;
  height: 32px;
  background: #3b82f6; /* SAP Classic Profile Blue */
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease;
}

.sap-user-avatar:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* 2. Sub-navigation Bar */
.sap-sub-nav {
  height: 54px; /* Taller to fit 2 lines cleanly */
  border-radius: 0;
  border-left: none;
  border-right: none;
  background: rgba(10, 15, 30, 0.45);
  display: flex;
  align-items: center;
  padding: 0 12px;
  position: sticky;
  top: 52px;
  z-index: 140;
}

.sap-sub-nav-links-wrapper {
  flex: 1;
  overflow-x: hidden; /* Hide scrollbar, scroll programmatically */
  height: 100%;
  display: block; /* Use block to allow child flex to expand beyond parent */
  scroll-behavior: smooth;
}

/* Hide scrollbar for Safari, Chrome, Opera, IE, Edge, Firefox */
.sap-sub-nav-links-wrapper::-webkit-scrollbar {
  display: none;
}
.sap-sub-nav-links-wrapper {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sap-sub-nav-links {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: center;
  width: max-content; /* Ensure container expands to hold all children at full width */
}

.sap-sub-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 11px; /* Slightly smaller font to fit 2 lines */
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  height: 42px; /* Taller button for 2 lines */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
  width: 160px; /* Wider buttons to wrap cleanly on exactly 2 lines */
  line-height: 1.25;
  white-space: normal; /* Enable wrapping */
  word-wrap: break-word;
}

.sap-sub-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.sap-sub-nav-btn.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-weight: 600;
}

/* Nav scroll arrow buttons */
.sap-nav-scroll-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 10;
  font-size: 11px;
}

.sap-nav-scroll-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.sap-nav-scroll-btn:active {
  transform: scale(0.95);
}

/* 3. Welcome Landing Page (Accueil) */
.sap-home-banner {
  padding: 20px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.sap-home-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.sap-home-banner-date {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--color-blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.sap-home-banner-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: #fff;
  position: relative;
  z-index: 1;
}

.sap-home-banner-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.sap-home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .sap-home-grid {
    grid-template-columns: 1fr;
  }
}

.sap-home-card {
  padding: 30px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sap-home-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
}

.sap-home-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.sap-home-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 25px;
}

.sap-home-card-link {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-blue);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

.sap-home-card:hover .sap-home-card-link {
  gap: 10px;
}

/* Sales Quotation Search Module Styles */
.suggestion-item span.client-code {
  font-weight: 700;
  color: var(--color-blue);
  font-family: var(--font-display);
}

.suggestion-item span.client-name {
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: 10px;
}

.quotation-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.quotation-toggle-btn:hover {
  color: #fff;
}

.quotation-toggle-btn.active {
  transform: rotate(90deg);
  color: var(--color-blue);
}

.quotation-items-row td {
  padding: 0 !important;
}

.quotation-items-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 25px 25px 25px;
}

.quotation-items-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Gantt Chart planning module styles */
.gantt-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.gantt-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.gantt-row.active {
  background: rgba(236, 72, 153, 0.05);
}
.gantt-grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1px;
}
.gantt-grid-line.weekend {
  fill: rgba(255, 255, 255, 0.015);
}
.gantt-grid-line.today {
  stroke: #f43f5e;
  stroke-width: 2px;
  stroke-dasharray: 4, 2;
}
.gantt-header-text {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-body);
}
.gantt-header-text.week-title {
  font-weight: 600;
  fill: var(--text-secondary);
}
.gantt-bar {
  rx: 6px;
  ry: 6px;
  cursor: grab;
  stroke-width: 1.5px;
  transition: filter 0.2s ease, stroke-width 0.2s ease;
}
.gantt-bar:hover {
  filter: brightness(1.15) drop-shadow(0 0 6px rgba(255,255,255,0.15));
}
.gantt-bar:active {
  cursor: grabbing;
}
.gantt-bar-handle {
  width: 6px;
  cursor: ew-resize;
  fill: transparent;
  transition: fill 0.15s ease;
}
.gantt-bar:hover ~ .gantt-bar-handle, .gantt-bar-handle:hover {
  fill: rgba(255, 255, 255, 0.4);
}
.gantt-milestone {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.gantt-milestone:hover {
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(255,255,255,0.3));
}
.gantt-dependency-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5px;
  marker-end: url(#gantt-arrow);
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}
.gantt-dependency-line:hover {
  stroke: #ec4899;
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.5));
}
.gantt-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-body);
  pointer-events: none;
}
.wbs-tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease;
}
.wbs-tree-node:hover {
  background: rgba(255, 255, 255, 0.03);
}
.wbs-tree-node.active {
  background: rgba(236, 72, 153, 0.06);
  border-left: 3px solid #ec4899;
  padding-left: 12px;
}
.wbs-tree-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}
.wbs-tree-badge.billing {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.wbs-tree-badge.milestone {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
  border: 1px solid rgba(236, 72, 153, 0.2);
}
.wbs-tree-indent {
  display: inline-block;
  height: 1px;
}

/* ==========================================
   INTERCOMPANY VALUE CHAIN DIAGRAM STYLES
   ========================================== */

.interco-swimlane-header {
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-display);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 8px 8px 0 0;
}

.interco-card {
  position: absolute;
  width: 220px;
  min-height: 105px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  cursor: grab;
  user-select: none;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  pointer-events: auto; /* Allow dragging actions */
}

.interco-card:active {
  cursor: grabbing;
  border-color: var(--color-blue);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.25);
  z-index: 100 !important;
}

.interco-card-header {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 5px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.interco-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.interco-card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.interco-card-status {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  display: inline-block;
  margin-top: 6px;
  width: fit-content;
}

/* Premium Interco Cards & Swimlanes styling updates */
.interco-card {
  width: 280px;
  min-width: 280px;
  max-width: 500px;
  resize: horizontal;
  min-height: 170px !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !important;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.interco-card:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.25) !important;
}

.interco-card-header-new {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-quotation {
  background: rgba(75, 85, 99, 0.45);
  color: #f3f4f6;
  border-left: 4px solid #9ca3af;
}

.header-quotation-draft {
  background: rgba(148, 163, 184, 0.35);
  color: #1e293b;
  border-left: 4px dashed #94a3b8;
}

.header-salesorder {
  background: rgba(47, 82, 51, 0.7);
  color: #ecfdf5;
  border-left: 4px solid #34d399;
}

.header-delivery {
  background: rgba(180, 83, 9, 0.4);
  color: #fffbeb;
  border-left: 4px solid #fbbf24;
}

.header-billing {
  background: rgba(109, 40, 217, 0.4);
  color: #f5f3ff;
  border-left: 4px solid #a78bfa;
}

.header-production {
  background: rgba(190, 24, 74, 0.4);
  color: #fff1f2;
  border-left: 4px solid #fda4af;
}

.company-badge {
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

.version-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}

.interco-card-body-new {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-row {
  display: flex;
  font-size: 11.5px;
  line-height: 1.4;
  justify-content: space-between;
  gap: 8px;
}

.detail-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.detail-val {
  color: #f3f4f6;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  margin-left: 12px;
}

.highlight-amount {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

.highlight-amount .detail-val {
  color: #60a5fa;
  font-size: 12px;
  font-weight: 700;
}

.interco-card-footer-new {
  padding: 0 14px 12px 14px;
  display: flex;
  justify-content: flex-end;
}

.btn-details-chain:hover {
  background: rgba(59, 130, 246, 0.35) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.btn-details-chain:active {
  transform: translateY(0);
}

.interco-swimlane-header-new {
  box-sizing: border-box;
}

.swimlane-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.brand-commercial {
  border-top: 3px solid #6366f1;
}

.brand-production {
  border-top: 3px solid #10b981;
}

.brand-services {
  border-top: 3px solid #f59e0b;
}

.swimlane-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.swimlane-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #f3f4f6;
  line-height: 1.2;
}

.swimlane-text small {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Document type borders and styles */
.interco-card.type-Quotation { border-color: rgba(59, 130, 246, 0.5); }
.interco-card.type-Quotation .interco-card-header { color: #60a5fa; }

.interco-card.type-SalesOrder { border-color: rgba(16, 185, 129, 0.5); }
.interco-card.type-SalesOrder .interco-card-header { color: #34d399; }

.interco-card.type-OutboundDelivery { border-color: rgba(245, 158, 11, 0.5); }
.interco-card.type-OutboundDelivery .interco-card-header { color: #fbbf24; }

.interco-card.type-BillingDocument { border-color: rgba(139, 92, 246, 0.5); }
.interco-card.type-BillingDocument .interco-card-header { color: #a78bfa; }

.interco-card.type-ProductionOrder { border-color: rgba(236, 72, 153, 0.5); }
.interco-card.type-ProductionOrder .interco-card-header { color: #f472b6; }

.interco-card.type-PlannedOrder { border-color: rgba(100, 116, 139, 0.5); border-style: dashed; }
.interco-card.type-PlannedOrder .interco-card-header { color: #94a3b8; }

.interco-card.type-PurchaseRequisition { border-color: rgba(14, 165, 233, 0.5); }
.interco-card.type-PurchaseRequisition .interco-card-header { color: #38bdf8; }

.interco-card.type-PurchaseOrder { border-color: rgba(245, 158, 11, 0.65); }
.interco-card.type-PurchaseOrder .interco-card-header,
.interco-card.type-PurchaseOrder .interco-card-header-new {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-left: 5px solid #f59e0b;
}

.interco-card.type-SupplierInvoice { border-color: rgba(180, 83, 9, 0.65); }
.interco-card.type-SupplierInvoice .interco-card-header,
.interco-card.type-SupplierInvoice .interco-card-header-new {
  background: rgba(180, 83, 9, 0.14);
  color: #fdba74;
  border-left: 5px solid #b45309;
}

/* Status Badges colors */
.status-badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.25); }
.status-badge-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.status-badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.status-badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }

/* SVG Connection lines */
.interco-connection-line {
  fill: none;
  stroke: #64748b;
  stroke-width: 2px;
  marker-end: url(#arrow);
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.interco-connection-line:hover {
  stroke: var(--color-blue);
  stroke-width: 3px;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.4));
}/* Dynamic folding tree CSS */
.tree-view-root {
  background: rgba(10, 15, 25, 0.3);
  border-radius: 12px;
  padding: 15px 20px;
  max-height: 500px;
  overflow-y: auto;
}

.tree-node-item {
  margin-left: 15px;
  position: relative;
}

.tree-node-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
}

.tree-node-item:last-child::before {
  height: 16px;
}

.tree-node-item::after {
  content: '';
  position: absolute;
  top: 16px;
  left: -10px;
  width: 8px;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.tree-node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  transition: background 0.15s ease;
}

.tree-node-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tree-branch-icon {
  font-size: 10px;
  color: var(--text-secondary);
  width: 12px;
  transition: transform 0.2s ease;
}

.tree-branch-icon.expanded {
  transform: rotate(90deg);
}

.tree-node-desc {
  font-weight: 600;
  color: #fff;
}

.tree-node-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

.tree-node-char-group {
  margin-left: 20px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 4px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.tree-node-char-line {
  margin-bottom: 4px;
  line-height: 1.4;
}

.tree-node-char-line:last-child {
  margin-bottom: 0;
}

.tree-node-char-name {
  color: var(--color-blue);
  font-weight: 600;
}

.tree-node-char-val {
  color: var(--color-green);
  font-weight: 500;
}

.tree-node-children {
  display: block;
}

/* Interco Card Subsequent Flow Toggle Button */
.interco-card-toggle-flow-btn {
  position: absolute;
  bottom: 12px;
  left: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s ease;
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.interco-card-toggle-flow-btn:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.interco-card-toggle-flow-btn.active-minus {
  background: #cbd5e1 !important;
  color: #475569 !important;
  border-color: #94a3b8 !important;
}

.interco-card-toggle-flow-btn.active-minus:hover {
  background: #94a3b8 !important;
  color: #1e293b !important;
}

/* Subsequent Cards Header & Body Styling */
.header-subsequent {
  background: rgba(30, 58, 138, 0.85) !important;
  color: #eff6ff !important;
  border-left: 4px solid #3b82f6 !important;
}

.interco-card.subsequent-card {
  min-height: 80px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.interco-card.subsequent-card:hover {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 15px 20px -3px rgba(0, 0, 0, 0.4), 0 0 12px rgba(59, 130, 246, 0.2) !important;
}

/* File Upload Zone styling */
.sap-file-upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 35px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 500px;
  margin: 0 auto;
}

.sap-file-upload-zone:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

/* ==========================================
   SAP Fiori Horizon theme alignment rules
   ========================================== */
body.sap-horizon-theme {
  --bg-primary: #edf0f2;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ffffff;
  --border-color: #d1d5db;
  --text-primary: #1d2d3d;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  background-color: #edf0f2 !important;
  background-image: none !important;
  color: #1d2d3d !important;
  font-family: -apple-system, BlinkMacSystemFont, "72", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

body.sap-horizon-theme .glass {
  background: #ffffff !important;
  border-color: #d1d5db !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sap-horizon-theme h1, 
body.sap-horizon-theme h2, 
body.sap-horizon-theme h3, 
body.sap-horizon-theme h4, 
body.sap-horizon-theme h5 {
  color: #1d2d3d !important;
  font-family: inherit !important;
}

body.sap-horizon-theme input[type="text"],
body.sap-horizon-theme select {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #1d2d3d !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme input[type="text"]::placeholder {
  color: #94a3b8 !important;
}

body.sap-horizon-theme input[type="text"]:focus,
body.sap-horizon-theme select:focus {
  border-color: #0a6ed1 !important;
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.2) !important;
}

body.sap-horizon-theme .heatmap-table th {
  background: #f4f6f8 !important;
  color: #1d2d3d !important;
  border-bottom: 2px solid #cbd5e1 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: none !important;
}

body.sap-horizon-theme .heatmap-table td {
  background: #ffffff !important;
  color: #1d2d3d !important;
  border-bottom: 1px solid #edf0f2 !important;
  font-size: 12px !important;
}

body.sap-horizon-theme .heatmap-table tr:hover td {
  background: #f4f6f8 !important;
}

body.sap-horizon-theme .btn-primary,
body.sap-horizon-theme button.btn-primary {
  background: #0a6ed1 !important;
  color: #ffffff !important;
  border: 1px solid #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  text-transform: none !important;
  font-weight: 500 !important;
}

body.sap-horizon-theme .btn-primary:hover,
body.sap-horizon-theme button.btn-primary:hover {
  background: #0854a0 !important;
  border-color: #0854a0 !important;
}

body.sap-horizon-theme .btn-secondary,
body.sap-horizon-theme button.btn-secondary {
  background: #ffffff !important;
  color: #0a6ed1 !important;
  border: 1px solid #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme .btn-secondary:hover,
body.sap-horizon-theme button.btn-secondary:hover {
  background: #f4f6f8 !important;
}

body.sap-horizon-theme #btn-generate-sales-proposals {
  background: #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme #btn-generate-sales-proposals:hover {
  background: #0854a0 !important;
}

/* Hide specific sections when embedded in SAP S/4HANA Assistant */
body.sap-horizon-theme #creation-welcome-section,
body.sap-horizon-theme #creation-search-form,
body.sap-horizon-theme #creation-sqlite-panel,
body.sap-horizon-theme #creation-delivery-update-container,
body.sap-horizon-theme #intercompany-welcome-section,
body.sap-horizon-theme #intercompany-search-form,
body.sap-horizon-theme #intercompany-sales-orders-results-container,
body.sap-horizon-theme #view-intercompany-chain .back-link {
  display: none !important;
}

/* ==========================================
   SAP Fiori Horizon theme alignment rules
   ========================================== */
body.sap-horizon-theme {
  --bg-primary: #edf0f2;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ffffff;
  --border-color: #d1d5db;
  --text-primary: #1d2d3d;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  background-color: #edf0f2 !important;
  background-image: none !important;
  color: #1d2d3d !important;
  font-family: -apple-system, BlinkMacSystemFont, "72", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

body.sap-horizon-theme .glass {
  background: #ffffff !important;
  border-color: #d1d5db !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sap-horizon-theme h1, 
body.sap-horizon-theme h2, 
body.sap-horizon-theme h3, 
body.sap-horizon-theme h4, 
body.sap-horizon-theme h5 {
  color: #1d2d3d !important;
  font-family: inherit !important;
}

body.sap-horizon-theme input[type="text"],
body.sap-horizon-theme select {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #1d2d3d !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme input[type="text"]::placeholder {
  color: #94a3b8 !important;
}

body.sap-horizon-theme input[type="text"]:focus,
body.sap-horizon-theme select:focus {
  border-color: #0a6ed1 !important;
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.2) !important;
}

body.sap-horizon-theme .heatmap-table th {
  background: #f4f6f8 !important;
  color: #1d2d3d !important;
  border-bottom: 2px solid #cbd5e1 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: none !important;
}

body.sap-horizon-theme .heatmap-table td {
  background: #ffffff !important;
  color: #1d2d3d !important;
  border-bottom: 1px solid #edf0f2 !important;
  font-size: 12px !important;
}

body.sap-horizon-theme .heatmap-table tr:hover td {
  background: #f4f6f8 !important;
}

body.sap-horizon-theme .btn-primary,
body.sap-horizon-theme button.btn-primary {
  background: #0a6ed1 !important;
  color: #ffffff !important;
  border: 1px solid #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  text-transform: none !important;
  font-weight: 500 !important;
}

body.sap-horizon-theme .btn-primary:hover,
body.sap-horizon-theme button.btn-primary:hover {
  background: #0854a0 !important;
  border-color: #0854a0 !important;
}

body.sap-horizon-theme .btn-secondary,
body.sap-horizon-theme button.btn-secondary {
  background: #ffffff !important;
  color: #0a6ed1 !important;
  border: 1px solid #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme .btn-secondary:hover,
body.sap-horizon-theme button.btn-secondary:hover {
  background: #f4f6f8 !important;
}

body.sap-horizon-theme #btn-generate-sales-proposals {
  background: #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme #btn-generate-sales-proposals:hover {
  background: #0854a0 !important;
}

/* Swimlane headers light styling */
body.sap-horizon-theme .swimlane-title-box {
  background: #ffffff !important;
  border-left: 1px solid #cbd5e1 !important;
  border-right: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

body.sap-horizon-theme .brand-commercial {
  border-top: 4px solid #8b5cf6 !important; /* violet for 12BB */
}

body.sap-horizon-theme .brand-production {
  border-top: 4px solid #10b981 !important; /* green for 1210 */
}

body.sap-horizon-theme .brand-services {
  border-top: 4px solid #f59e0b !important; /* orange for 12AA */
}

body.sap-horizon-theme .swimlane-text {
  color: #1d2d3d !important;
}

body.sap-horizon-theme .swimlane-text small {
  color: #475569 !important;
}

body.sap-horizon-theme .brand-commercial .swimlane-badge {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
}

body.sap-horizon-theme .brand-production .swimlane-badge {
  background: #e6f4ea !important;
  color: #137333 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

body.sap-horizon-theme .brand-services .swimlane-badge {
  background: #fef7e0 !important;
  color: #b06000 !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

body.sap-horizon-theme .swimlane-badge {
  background: rgba(0,0,0,0.06) !important;
  color: #475569 !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
}

/* Value Chain style cards alignment for SAP Horizon theme */
body.sap-horizon-theme .interco-card {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03) !important;
  color: #1d2d3d !important;
}

body.sap-horizon-theme .interco-card:hover {
  border-color: #0a6ed1 !important;
  box-shadow: 0 10px 15px -3px rgba(10, 110, 209, 0.1), 0 4px 6px -2px rgba(10, 110, 209, 0.05) !important;
}

body.sap-horizon-theme .interco-sap-link {
  color: inherit !important;
  text-decoration: underline !important;
  transition: color 0.2s ease !important;
}

body.sap-horizon-theme .interco-sap-link:hover {
  color: #0a6ed1 !important;
  text-decoration: underline !important;
}

body.sap-horizon-theme .interco-card-header-new {
  border-bottom: 1px solid #edf0f2 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

/* Let's style headers matching the green/orange status of Value Chain */
body.sap-horizon-theme .header-quotation,
body.sap-horizon-theme .header-quotation-draft {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-left: 5px solid #64748b !important;
}

body.sap-horizon-theme .header-salesorder,
body.sap-horizon-theme .header-default,
body.sap-horizon-theme .type-SalesOrder .interco-card-header-new {
  background: #e6f4ea !important; /* light green */
  color: #137333 !important; /* dark green */
  border-left: 5px solid #137333 !important;
}

body.sap-horizon-theme .type-PurchaseOrder .interco-card-header-new {
  background: #fff4df !important;
  color: #9a5200 !important;
  border-left: 5px solid #e9730c !important;
}

body.sap-horizon-theme .type-SupplierInvoice .interco-card-header-new {
  background: #fbe9dc !important;
  color: #8b3a0e !important;
  border-left: 5px solid #b45309 !important;
}

body.sap-horizon-theme .header-delivery,
body.sap-horizon-theme .type-OutboundDelivery .interco-card-header-new,
body.sap-horizon-theme .type-PlannedOrder .interco-card-header-new {
  background: #fef7e0 !important; /* light orange/amber */
  color: #b06000 !important; /* dark orange */
  border-left: 5px solid #f9ab00 !important;
}

body.sap-horizon-theme .header-billing,
body.sap-horizon-theme .type-BillingDocument .interco-card-header-new {
  background: #f3e8ff !important; /* light purple */
  color: #6b21a8 !important; /* dark purple */
  border-left: 5px solid #8b5cf6 !important;
}

body.sap-horizon-theme .header-production,
body.sap-horizon-theme .type-ProductionOrder .interco-card-header-new {
  background: #fce8e6 !important; /* light red */
  color: #c5221f !important; /* dark red */
  border-left: 5px solid #d93025 !important;
}

body.sap-horizon-theme .company-badge {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #475569 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.sap-horizon-theme .version-badge {
  background: #d1d5db !important;
  color: #1f2937 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.sap-horizon-theme .interco-card-body-new {
  background: #ffffff !important;
  padding: 14px 16px !important;
}

body.sap-horizon-theme .detail-label {
  color: #5f6368 !important; /* neutral gray */
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

body.sap-horizon-theme .detail-val {
  color: #1d2d3d !important;
  font-weight: 500 !important;
}

body.sap-horizon-theme .highlight-amount {
  border-top: 1px solid #f1f5f9 !important;
  padding-top: 6px !important;
}

body.sap-horizon-theme .highlight-amount .detail-val {
  color: #0a6ed1 !important; /* SAP Blue amount */
  font-size: 12.5px !important;
  font-weight: 700 !important;
}

body.sap-horizon-theme .btn-details-chain {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  padding: 4px 10px !important;
}

body.sap-horizon-theme .btn-details-chain:hover {
  background: #f4f6f8 !important;
  border-color: #cbd5e1 !important;
  color: #0854a0 !important;
}

body.sap-horizon-theme .interco-card-toggle-flow-btn {
  background: #0a6ed1 !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

body.sap-horizon-theme .interco-card-toggle-flow-btn:hover {
  background: #0854a0 !important;
}

body.sap-horizon-theme .interco-connection-line {
  stroke: #94a3b8 !important; /* slate color connection arrows */
  stroke-width: 2px !important;
  stroke-dasharray: none !important;
}

/* WBS Project structure light styling */
body.sap-horizon-theme #selected-project-wbs-container {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

body.sap-horizon-theme #selected-project-wbs-container h4 {
  color: #1d2d3d !important;
}

body.sap-horizon-theme .tree-view-root {
  background: #ffffff !important;
  border: 1px solid #edf0f2 !important;
  padding: 15px !important;
}

body.sap-horizon-theme .tree-node-desc {
  color: #1d2d3d !important;
  font-weight: 600 !important;
}

body.sap-horizon-theme .tree-node-meta {
  color: #475569 !important;
}

body.sap-horizon-theme .tree-node-item::before,
body.sap-horizon-theme .tree-node-item::after {
  background: #cbd5e1 !important;
}

body.sap-horizon-theme .tree-node-header {
  color: #334155 !important;
}

body.sap-horizon-theme .tree-node-header:hover {
  background: #f4f6f8 !important;
  border-radius: 4px !important;
}

/* Proposals Dialog styling overrides */
body.sap-horizon-theme .modal-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

body.sap-horizon-theme .modal-header h3 {
  color: #1d2d3d !important;
}

body.sap-horizon-theme .modal-header .modal-close-btn {
  color: #64748b !important;
}

body.sap-horizon-theme #proposals-list-container > div.glass {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.sap-horizon-theme #proposals-list-container h4 {
  color: #1d2d3d !important;
}

body.sap-horizon-theme #proposals-list-container table {
  background: #ffffff !important;
}

body.sap-horizon-theme #proposals-list-container tr {
  border-bottom: 1px solid #cbd5e1 !important;
}

body.sap-horizon-theme #proposals-list-container th {
  background: #f4f6f8 !important;
  color: #1d2d3d !important;
}

body.sap-horizon-theme #proposals-list-container td {
  background: #ffffff !important;
  color: #1d2d3d !important;
}

body.sap-horizon-theme #proposals-list-container td select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1d2d3d !important;
  padding: 4px 8px !important;
  font-size: 12.5px !important;
  border-radius: 4px !important;
}

body.sap-horizon-theme #proposals-list-container span.status-badge {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

body.sap-horizon-theme #proposals-list-container span.status-badge.badge-open {
  background: rgba(10, 110, 209, 0.1) !important;
  color: #0a6ed1 !important;
  border: 1px solid rgba(10, 110, 209, 0.2) !important;
}

body.sap-horizon-theme #proposal-creation-logs-container {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

body.sap-horizon-theme .glass-btn {
  background: #0a6ed1 !important;
  color: #ffffff !important;
  border: 1px solid #0a6ed1 !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  text-transform: none !important;
  font-weight: 500 !important;
}

body.sap-horizon-theme .glass-btn:hover {
  background: #0854a0 !important;
  border-color: #0854a0 !important;
}

body.sap-horizon-theme .glass-btn.btn-sec {
  background: #ffffff !important;
  color: #0a6ed1 !important;
  border: 1px solid #0a6ed1 !important;
  box-shadow: none !important;
}

body.sap-horizon-theme .glass-btn.btn-sec:hover {
  background: #f4f6f8 !important;
}

body.sap-horizon-theme .quotation-items-wrapper {
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  padding: 15px 25px 25px 25px !important;
}

body.sap-horizon-theme .quotation-items-title {
  color: #1e293b !important;
}
