/* Symtraflow - Trafo Production System Design System */

:root {
  --font-primary: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Brand Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0b132b;
  --bg-sidebar-hover: #1c2541;
  --bg-sidebar-active: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-text: #047857;
  
  --color-process: #f59e0b;
  --color-process-bg: #fffbe6;
  --color-process-text: #b45309;
  
  --color-waiting: #64748b;
  --color-waiting-bg: #f8fafc;
  --color-waiting-text: #475569;

  --color-primary: #2563eb;
  --color-primary-bg: #eff6ff;
  --color-primary-text: #1d4ed8;

  --color-purple: #8b5cf6;
  --color-purple-bg: #f5f3ff;
  --color-purple-text: #6d28d9;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sidebar Layout */
.sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width var(--transition-normal);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
}

.sidebar-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

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

.brand-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-menu {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.menu-item:hover {
  color: #ffffff;
  background-color: var(--bg-sidebar-hover);
}

.menu-item.active {
  background-color: var(--bg-sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.menu-item i {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.menu-item .arrow {
  margin-left: auto;
  font-size: 11px;
}

.badge-count {
  margin-left: auto;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Sidebar Footer User Info */
.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.2);
}

.shift-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #38bdf8;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.user-profile-sm {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-wrapper {
  position: relative;
}

.avatar-img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid #3b82f6;
}

.status-dot-online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border: 2px solid var(--bg-sidebar);
  border-radius: 50%;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.2;
}

.user-role {
  font-size: 10px;
  color: #94a3b8;
}

/* Main Content Area */
.main-wrapper {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Navbar */
.top-navbar {
  height: 60px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.toggle-sidebar-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.toggle-sidebar-btn:hover {
  background-color: var(--bg-main);
  color: var(--text-primary);
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.realtime-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-success-text);
  background-color: var(--color-success-bg);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.time-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-main);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-icon-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.nav-icon-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-main);
}

.nav-icon-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-nav-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.user-nav-profile:hover {
  background-color: var(--bg-main);
}

.user-nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-nav-info {
  display: flex;
  flex-direction: column;
}

.user-nav-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-nav-role {
  font-size: 10px;
  color: var(--text-muted);
}

/* Secondary Sub-header / View Tabs */
.view-mode-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-tabs {
  display: flex;
  gap: 6px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
}

.view-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.view-tab-btn.active {
  background-color: #ffffff;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast);
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

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

/* Page Body Content */
.content-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* View Sections Toggle */
.view-section {
  display: none;
  flex-direction: column;
  gap: 20px;
}

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

/* Top KPI Cards Grid */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kpi-icon.blue {
  background-color: #eff6ff;
  color: #2563eb;
}

.kpi-icon.green {
  background-color: #ecfdf5;
  color: #10b981;
}

.kpi-icon.amber {
  background-color: #fffbe6;
  color: #f59e0b;
}

.kpi-icon.purple {
  background-color: #f5f3ff;
  color: #8b5cf6;
}

.kpi-icon.cyan {
  background-color: #ecfeff;
  color: #06b6d4;
}

.kpi-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-unit {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-subtext {
  font-size: 10px;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kpi-subtext:hover {
  text-decoration: underline;
}

.trend-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-success-text);
  background-color: var(--color-success-bg);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* FLOW PRODUKSI TRAFO - 11 STEPPER PIPELINE */
.section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

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

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.finished { background-color: var(--color-success); }
.legend-dot.process { background-color: var(--color-process); }
.legend-dot.waiting { background-color: var(--text-muted); }

/* Horizontal Stepper Grid (11 Columns) */
.flow-stepper-wrapper {
  overflow-x: auto;
  padding-bottom: 6px;
}

.flow-stepper-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(110px, 1fr));
  gap: 8px;
  position: relative;
}

.step-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.step-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.step-card.active-process {
  border: 2px solid var(--color-process);
  background-color: #fffdf5;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.step-number {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.step-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-secondary);
  background-color: var(--bg-main);
}

.step-card.finished .step-icon-box {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.step-card.active-process .step-icon-box {
  background-color: var(--color-process-bg);
  color: var(--color-process);
}

.step-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.step-status-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.step-card.finished .step-status-pill {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
}

.step-card.active-process .step-status-pill {
  background-color: var(--color-process-bg);
  color: var(--color-process-text);
}

.step-card.waiting .step-status-pill {
  background-color: #f1f5f9;
  color: #64748b;
}

.step-meta {
  font-size: 9px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-operator {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Two Column Layout (Table 2/3 + Detail 1/3) */
.grid-2-1 {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 16px;
}

/* Table Card */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 220px;
}

.search-box input {
  width: 100%;
  padding: 6px 12px 6px 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--color-primary);
}

.search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 11px;
}

/* Data Table */
.custom-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

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

.custom-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.custom-table tbody tr.selected {
  background-color: #eff6ff;
}

.order-code {
  font-weight: 700;
  color: var(--color-primary);
  font-family: monospace;
  font-size: 12px;
}

/* Status Badges */
.badge-status {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
}

.badge-assembly { background-color: #ffedd5; color: #c2410c; }
.badge-connection { background-color: #e0f2fe; color: #0369a1; }
.badge-tank { background-color: #dcfce7; color: #15803d; }
.badge-core { background-color: #f0fdf4; color: #166534; }
.badge-coil { background-color: #fef9c3; color: #a16207; }
.badge-final { background-color: #fae8ff; color: #86198f; }
.badge-internal { background-color: #e0e7ff; color: #3730a3; }
.badge-finishing { background-color: #f1f5f9; color: #334155; }
.badge-selesai { background-color: #d1fae5; color: #065f46; }
.badge-belum { background-color: #f1f5f9; color: #64748b; }

/* Progress bar inside table */
.table-progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-pct-label {
  font-size: 10px;
  font-weight: 700;
  width: 32px;
}

.progress-bar-bg {
  flex: 1;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #f59e0b, #d97706);
  transition: width 0.4s ease;
}

.progress-bar-fill.success {
  background: linear-gradient(90deg, #10b981, #059669);
}

.operator-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.operator-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.deadline-alert {
  color: #dc2626;
  font-weight: 600;
}

/* Detail Order Side Panel */
.detail-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.detail-order-id {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-primary);
  font-family: monospace;
}

.detail-spec-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  row-gap: 6px;
  column-gap: 8px;
  font-size: 11px;
  margin-bottom: 16px;
}

.spec-key {
  color: var(--text-muted);
  font-weight: 600;
}

.spec-val {
  color: var(--text-primary);
  font-weight: 600;
}

.spec-val.active-status {
  color: var(--color-process-text);
  font-weight: 700;
}

/* Progress Big Bar */
.detail-progress-wrapper {
  margin-bottom: 16px;
}

.detail-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-progress-pct {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.detail-progress-bg {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.detail-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* Vertical Timeline Process */
.timeline-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding-left: 14px;
  margin-bottom: 18px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.timeline-dot {
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  border: 2px solid #ffffff;
  z-index: 2;
}

.timeline-item.finished .timeline-dot {
  background-color: var(--color-success);
}

.timeline-item.process .timeline-dot {
  background-color: var(--color-process);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.timeline-stage-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 10px;
  width: 90px;
}

.timeline-stage-status {
  font-size: 10px;
  font-weight: 600;
}

.timeline-item.finished .timeline-stage-status { color: var(--color-success-text); }
.timeline-item.process .timeline-stage-status { color: var(--color-process-text); }
.timeline-item.waiting .timeline-stage-status { color: var(--text-muted); }

.timeline-meta {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

.btn-full-width {
  width: 100%;
  justify-content: center;
  padding: 9px;
}

/* Bottom Row Grid (Chart + Activity Log) */
.grid-chart-activity {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

.chart-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-container {
  height: 220px;
  position: relative;
  width: 100%;
}

.activity-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 220px;
  padding-right: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
}

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.activity-icon.amber { background-color: #fffbe6; color: #f59e0b; }
.activity-icon.green { background-color: #ecfdf5; color: #10b981; }
.activity-icon.blue { background-color: #eff6ff; color: #2563eb; }

.activity-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.activity-text {
  color: var(--text-primary);
  font-size: 11px;
}

.activity-bold {
  font-weight: 700;
}

.activity-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}

.activity-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* VIEW 2: MULTI-PROJECT GANTT MATRIX STYLING (IMAGE 2 REPLICA) */
.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.project-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-code-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
}

.project-unit-badge {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
}

.project-micro-kpi {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background-color: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.micro-kpi-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.micro-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.micro-kpi-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.micro-kpi-lbl {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.micro-kpi-pct {
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

/* Multi Project Split Layout: Left Unit Table + Right Gantt Flow Matrix */
.project-split-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 16px;
}

.project-table-gantt-box {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  background-color: #ffffff;
}

/* Gantt Header Matrix */
.gantt-header-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 2px;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.gantt-head-col {
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1.1;
}

.gantt-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gantt-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 2px;
  align-items: center;
  height: 24px;
  position: relative;
}

.gantt-track-bg {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background-color: #e2e8f0;
  z-index: 1;
}

.gantt-span-line {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  border-radius: 2px;
  z-index: 2;
}

.gantt-span-line.finished { background-color: var(--color-success); }
.gantt-span-line.process { background-color: var(--color-process); }
.gantt-span-line.blue { background-color: var(--color-primary); }

.gantt-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 2px solid var(--text-muted);
  margin: 0 auto;
  z-index: 3;
  position: relative;
}

.gantt-node-dot.active-node {
  width: 10px;
  height: 10px;
  border-width: 2px;
}

.gantt-node-dot.finished-node {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.gantt-node-dot.process-node {
  background-color: var(--color-process);
  border-color: var(--color-process);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-slide 0.25s ease;
}

@keyframes modal-slide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
}

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

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

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-primary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-message {
  background-color: var(--bg-sidebar);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--color-primary);
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ================= LOGIN SCREEN STYLING (EXACT REFERENCE REPLICA) ================= */
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0b0c10;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 940px;
  min-height: 520px;
  background: #ffffff;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Left Form Section */
.login-left {
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background-color: #ffffff;
}

.login-brand-logo {
  position: absolute;
  top: 28px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon-sm {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
}

.login-brand-title {
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.login-user-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff5f5;
  color: #ef4444;
  border: 1px solid #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 20px auto 14px auto;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.15);
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 24px;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.login-form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.login-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.login-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input-box:focus-within {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.login-input-icon {
  color: #94a3b8;
  font-size: 14px;
}

.login-input-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  font-family: inherit;
}

.login-submit-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.4);
  transition: all 0.2s ease;
}

.login-submit-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.5);
}

.login-submit-btn:active {
  transform: translateY(0);
}

/* Right Dark Crimson Banner */
.login-right {
  background: linear-gradient(145deg, #160204, #3a0608, #7a1b1c);
  padding: 44px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(220, 38, 38, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.4);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  width: fit-content;
}

.live-dot-red {
  width: 7px;
  height: 7px;
  background: #f87171;
  border-radius: 50%;
  box-shadow: 0 0 8px #f87171;
}

.login-hero-heading {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  margin: 18px 0 24px 0;
  letter-spacing: -0.5px;
}

.text-highlight-red {
  color: #f87171;
}

.login-features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
  font-size: 15px;
  flex-shrink: 0;
}

.feature-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.feature-desc {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.login-right-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 20px;
}

/* Responsive queries */
@media (max-width: 1200px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-2-1, .project-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .login-card {
    grid-template-columns: 1fr;
  }
  .login-right {
    display: none;
  }
}

