/* ==========================================================================
   OMOS — Modul Setup Project & Master Konfigurasi Tambang (Isolated Data Plane)
   Design System: Industrial Mining Command Center (Taste Skill Refined)
   Palette: Obsidian Dark Slate + Heavy Equipment Amber & Telemetry Emerald
   ========================================================================== */

:root {
  /* Core Canvas & Surfaces */
  --sp-void: #090e17;
  --sp-surface-panel: #0d1522;
  --sp-surface-card: #111b2b;
  --sp-surface-card-hover: #162438;
  
  /* Hairline Precision Borders */
  --sp-hairline: #223246;
  --sp-hairline-strong: #334862;
  --sp-hairline-focus: rgba(242, 169, 59, 0.45);
  
  /* Semantic Accent Hierarchy */
  --sp-accent-amber: #f2a93b;        /* Mining / Equipment Action */
  --sp-accent-gold: #ffc467;         /* KTT Leadership / Highlight */
  --sp-accent-emerald: #10b981;      /* Operational Ready / Save Status */
  --sp-accent-cyan: #38bdf8;         /* Canvas Hierarchy / Telemetry Trace */
  --sp-accent-indigo: #818cf8;       /* Superintendent Management */
  --sp-accent-crimson: #e11d48;      /* Destructive Action / Warning */
  
  /* Typography Tokens */
  --sp-text-main: #f1f5f9;
  --sp-text-muted: #94a3b8;
  --sp-text-subtle: #64748b;
}

/* Base Wrapper */
.setup-project-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 56px;
  color: var(--sp-text-main);
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  user-select: text;
}

.setup-project-wrap * {
  box-sizing: border-box;
}

/* ==========================================================================
   1. TOP TELEMETRY HEADER CARD (COMMAND CENTER DOCK)
   ========================================================================== */
.sp-header {
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease;
}

.sp-header:hover {
  border-color: var(--sp-hairline-strong);
}

.sp-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sp-header__logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(242, 169, 59, 0.45);
  background: var(--sp-void);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.sp-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-header__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-header__title {
  margin: 0;
  font-size: 17.5px;
  font-weight: 800;
  color: var(--sp-text-main);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-header__badge {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  padding: 2.5px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--sp-accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sp-header__sub {
  margin: 3px 0 0 0;
  font-size: 12px;
  color: var(--sp-text-muted);
  font-weight: 500;
}

.sp-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-site-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 9px;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  color: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.sp-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sp-accent-emerald);
  box-shadow: 0 0 8px var(--sp-accent-emerald);
  animation: sp-pulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes sp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 4px var(--sp-accent-emerald)); }
  50% { opacity: 0.35; transform: scale(0.85); filter: drop-shadow(0 0 1px var(--sp-accent-emerald)); }
}

.sp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  background: linear-gradient(135deg, #f2a93b 0%, #e0921f 100%);
  color: #1a1205;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(242, 169, 59, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-btn-primary:hover {
  background: linear-gradient(135deg, #ffc467 0%, #f2a93b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(242, 169, 59, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sp-btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(242, 169, 59, 0.25);
}

.sp-btn-primary:focus-visible,
.sp-btn-secondary:focus-visible,
.sp-btn-danger:focus-visible,
.sp-tab-btn:focus-visible,
.sp-subnav-btn:focus-visible,
.sp-hud-btn:focus-visible,
.sp-dept-filter-btn:focus-visible {
  outline: 2px solid var(--sp-accent-amber);
  outline-offset: 2px;
}

/* ==========================================================================
   2. TOP TABS NAVIGATION DOCK (SEGMENTED CAPSULE)
   ========================================================================== */
.sp-tabs-nav {
  display: flex;
  gap: 4px;
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline);
  border-radius: 12px;
  padding: 5px;
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.sp-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sp-text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.sp-tab-btn:hover {
  color: #ffffff;
  background: var(--sp-surface-card-hover);
}

.sp-tab-btn.is-active {
  color: var(--sp-text-main);
  background: rgba(242, 169, 59, 0.12);
  border-color: rgba(242, 169, 59, 0.4);
  box-shadow: inset 3px 0 0 var(--sp-accent-amber), 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

.sp-badge-tab {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  padding: 2px 7px;
  border-radius: 5px;
  background: #1c2b40;
  color: var(--sp-text-muted);
  font-weight: 600;
}

.sp-tab-btn.is-active .sp-badge-tab {
  background: rgba(242, 169, 59, 0.22);
  color: var(--sp-accent-gold);
}

/* ==========================================================================
   3. TAB CONTENTS LAYOUT & GLASS PANELS
   ========================================================================== */
.sp-tab-pane {
  display: none;
  animation: sp-pane-fade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sp-pane-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sp-tab-pane.is-active {
  display: block;
}

.sp-grid-2 {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 18px;
}

@media (max-width: 960px) {
  .sp-grid-2 {
    grid-template-columns: 1fr;
  }
}

.sp-card {
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease;
}

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

.sp-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sp-hairline);
}

.sp-card__title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--sp-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

/* Form inputs & controls */
.sp-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

@media (max-width: 640px) {
  .sp-form-row {
    grid-template-columns: 1fr;
  }
}

.sp-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sp-text-muted);
  letter-spacing: 0.01em;
}

.sp-label span {
  color: var(--sp-accent-amber);
}

.sp-input,
.sp-select,
.sp-textarea {
  width: 100%;
  padding: 9px 13px;
  border-radius: 9px;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  color: var(--sp-text-main);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sp-input::placeholder,
.sp-textarea::placeholder {
  color: #607188;
}

.sp-input:focus,
.sp-select:focus,
.sp-textarea:focus {
  border-color: var(--sp-accent-amber);
  box-shadow: 0 0 0 3px rgba(242, 169, 59, 0.14), inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sp-input[type="number"] {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.sp-textarea {
  resize: vertical;
  min-height: 72px;
}

.sp-file-upload-box,
.sp-upload-zone {
  border: 2px dashed var(--sp-hairline-strong);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: var(--sp-void);
  transition: all 0.18s ease;
}

.sp-file-upload-box:hover,
.sp-upload-zone:hover {
  border-color: var(--sp-accent-amber);
  background: rgba(242, 169, 59, 0.05);
}

/* Live Kop Surat Preview (Holographic Preview) */
.sp-preview-paper {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-family: 'Times New Roman', Times, serif;
  position: relative;
  overflow: hidden;
  user-select: text;
}

.sp-preview-paper__watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 38px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.04);
  letter-spacing: 0.15em;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sp-kop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  gap: 14px;
}

.sp-kop-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.sp-kop-text {
  flex: 1;
  text-align: center;
}

.sp-kop-company {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.sp-kop-site {
  font-size: 11px;
  font-weight: 700;
  margin: 2px 0 0 0;
  color: #334155;
}

.sp-kop-iup {
  font-size: 9.5px;
  font-family: 'Courier New', Courier, monospace;
  margin: 3px 0 0 0;
  color: #475569;
}

.sp-kop-address {
  font-size: 9px;
  margin: 2px 0 0 0;
  color: #64748b;
  font-style: italic;
}

/* ==========================================================================
   4. TAB 2: OPERASIONAL & SHIFT (TACTILE COCKPIT BUTTONS)
   ========================================================================== */
.sp-tz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sp-tz-card {
  padding: 14px;
  border-radius: 11px;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sp-tz-card:hover {
  border-color: rgba(242, 169, 59, 0.5);
  transform: translateY(-1px);
}

.sp-tz-card.is-active {
  border: 2px solid var(--sp-accent-amber);
  background: rgba(242, 169, 59, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.sp-tz-card__title {
  font-size: 13.5px;
  font-weight: 800;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sp-tz-card.is-active .sp-tz-card__title {
  color: var(--sp-accent-gold);
}

.sp-tz-card__sub {
  font-size: 11px;
  color: var(--sp-text-muted);
}

/* Shift Count Selector */
.sp-shift-count-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sp-shift-count-btn {
  padding: 14px;
  border-radius: 11px;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-shift-count-btn:hover {
  border-color: rgba(242, 169, 59, 0.5);
  transform: translateY(-1px);
}

.sp-shift-count-btn.is-active {
  border: 2px solid var(--sp-accent-amber);
  background: rgba(242, 169, 59, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.sp-shift-count-btn__num {
  font-size: 16px;
  font-weight: 900;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  color: #f8fafc;
}

.sp-shift-count-btn.is-active .sp-shift-count-btn__num {
  color: var(--sp-accent-gold);
}

.sp-shift-count-btn__sub {
  font-size: 11px;
  color: var(--sp-text-muted);
}

/* ==========================================================================
   5. TAB 3: MASTER PIT & AREA (TOPOGRAPHICAL CONTOUR)
   ========================================================================== */
.sp-pit-card {
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
}

.sp-pit-card:hover {
  border-color: var(--sp-hairline-strong);
}

.sp-pit-card__head {
  background: var(--sp-void);
  padding: 13px 20px;
  border-bottom: 1px solid var(--sp-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-pit-sub-grid {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.sp-sub-area-item {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease;
}

.sp-sub-area-item:hover {
  border-color: rgba(242, 169, 59, 0.4);
}

/* ==========================================================================
   6. TAB 4: STRUKTUR ORGANISASI & DOM INFINITE CANVAS (MATRIX DOT GRID)
   ========================================================================== */
.sp-subnav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sp-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sp-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-subnav-btn:hover {
  color: #ffffff;
  background: var(--sp-surface-card-hover);
}

.sp-subnav-btn.is-active {
  background: var(--sp-accent-amber);
  color: #1a1205;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(242, 169, 59, 0.35);
  font-weight: 800;
}

.sp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

.sp-search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border-radius: 9px;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  color: var(--sp-text-main);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.sp-search-input:focus {
  border-color: var(--sp-accent-amber);
  box-shadow: 0 0 0 2px rgba(242, 169, 59, 0.2);
}

.sp-search-icon {
  position: absolute;
  left: 10px;
  top: 9px;
  color: #64748b;
  pointer-events: none;
}

.sp-clear-search {
  position: absolute;
  right: 10px;
  top: 7px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
}

.sp-dept-filter-group {
  display: flex;
  align-items: center;
  background: var(--sp-void);
  border: 1px solid var(--sp-hairline);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  max-width: 560px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.sp-dept-filter-group::-webkit-scrollbar {
  height: 4px;
}

.sp-dept-filter-group::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.sp-dept-filter-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--sp-text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.sp-dept-filter-btn.is-active {
  background: rgba(242, 169, 59, 0.15);
  color: var(--sp-accent-gold);
  font-weight: 700;
}

/* DOM Infinite Canvas Workspace (Matrix Dot Grid) */
.grid-infinite-canvas {
  background-color: #0b1524;
  background-image:
    radial-gradient(rgba(145, 161, 181, 0.16) 1.2px, transparent 1.2px),
    radial-gradient(circle at center, rgba(6, 182, 212, 0.04) 0%, transparent 75%);
  background-size: 22px 22px, 100% 100%;
}

#infiniteViewport {
  width: 100%;
  height: 660px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--sp-hairline);
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.65);
  cursor: grab;
  user-select: none;
}

#infiniteViewport.is-panning {
  cursor: grabbing !important;
}

#worldContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  pointer-events: none;
}

#svgConnectors {
  position: absolute;
  top: -4000px;
  left: -4000px;
  width: 8000px;
  height: 8000px;
  pointer-events: auto;
  z-index: 10;
  overflow: visible;
}

#cardsLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: auto;
  z-index: 20;
}

/* Card Hierarchy Nodes */
.org-card {
  position: absolute;
  width: 260px;
  border-radius: 12px;
  background: #111e31;
  border: 1px solid #364b66;
  color: #f1f5f9;
  padding: 13px 15px;
  box-shadow: 0 10px 25px -4px rgba(4, 11, 20, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.2s ease;
}

.org-card:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 169, 59, 0.7);
  box-shadow: 0 14px 30px -4px rgba(4, 11, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.org-card.selected {
  border-color: var(--sp-accent-amber) !important;
  box-shadow: 0 0 0 2px rgba(242, 169, 59, 0.3), 0 14px 36px rgba(4, 11, 20, 0.6) !important;
}

.org-card.highlight-search {
  animation: sp-pulse-ring 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  border-color: var(--sp-accent-amber) !important;
}

@keyframes sp-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8); }
  70% { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.org-card.dimmed {
  opacity: 0.2;
  filter: grayscale(0.8);
  pointer-events: none;
}

.org-card.drop-target-valid {
  border-color: var(--sp-accent-emerald) !important;
  background: rgba(16, 185, 129, 0.2) !important;
  transform: scale(1.04);
}

/* Crisp & Contrasting Hierarchy Connector Lines */
.connector-path {
  fill: none;
  stroke: #4d94d4;
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.45));
}

/* Floating HUD Controls */
.sp-hud-stats {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 40;
  background: #111e31;
  border: 1px solid var(--sp-hairline);
  border-radius: 10px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.sp-hud-controls {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 40;
  background: #111e31;
  border: 1px solid var(--sp-hairline);
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.sp-hud-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #1c2b40;
  border: 1px solid var(--sp-hairline);
  color: #cbd5e1;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sp-hud-btn:hover {
  background: #253750;
  color: #ffffff;
  border-color: var(--sp-accent-amber);
}

/* FLOATING INSPECTOR DRAWER (3 FIELD: DEPARTEMEN, NAMA JABATAN, ATASAN LANGSUNG) */
.sp-inspector-drawer {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 40;
  width: 320px;
  background: #111e31;
  border: 1px solid rgba(242, 169, 59, 0.35);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 16px rgba(242, 169, 59, 0.1);
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: sp-drawer-slide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sp-drawer-slide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.sp-inspector-drawer.is-open {
  display: flex;
}

.sp-inspector-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sp-hairline);
}

.sp-drawer-badge {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(242, 169, 59, 0.12);
  color: var(--sp-accent-amber);
  border: 1px solid rgba(242, 169, 59, 0.3);
  font-weight: 700;
  text-transform: uppercase;
}

.sp-drawer-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin: 4px 0 0 0;
  letter-spacing: -0.01em;
}

.sp-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #1c2b40;
  border: 1px solid var(--sp-hairline);
  color: var(--sp-text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sp-close-btn:hover {
  background: #253750;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   7. SUB-TAB 3: CUSTOM MASTER (INLINE ADD-ROW)
   ========================================================================== */
.sp-inline-add-row {
  border-left: 3px solid var(--sp-accent-amber);
  transition: all 0.2s ease;
}

/* Toast Feedback */
.sp-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #163d32;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(54, 185, 135, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 185, 129, 0.25);
  font-weight: 700;
  font-size: 13px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-toast.is-show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   8. Custom In-App Modal Dialog System (Obsidian Glass Box)
   ========================================================================== */
.sp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 13, 24, 0.82);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: sp-fade-in 0.18s ease;
}

@keyframes sp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sp-modal-box {
  background: var(--sp-surface-panel);
  border: 1px solid var(--sp-hairline-strong);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: sp-scale-up 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sp-scale-up {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.sp-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sp-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--sp-text-main);
  letter-spacing: -0.01em;
}

.sp-modal-sub {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--sp-text-muted);
  line-height: 1.45;
}

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

.sp-btn-secondary {
  padding: 8px 16px;
  border-radius: 9px;
  background: #1c2b40;
  border: 1px solid var(--sp-hairline);
  color: var(--sp-text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sp-btn-secondary:hover {
  background: #253750;
  color: #ffffff;
  border-color: var(--sp-hairline-strong);
}

.sp-btn-danger {
  padding: 8px 16px;
  border-radius: 9px;
  background: #b84f58;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(184, 79, 88, 0.35);
  transition: all 0.15s ease;
}

.sp-btn-danger:hover {
  background: #d3606a;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(211, 96, 106, 0.45);
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS & ACCESSIBILITY
   ========================================================================== */
@media (max-width: 640px) {
  .setup-project-wrap { padding: 12px 12px 36px; }
  .sp-header { padding: 12px; }
  .sp-header__right { width: 100%; justify-content: space-between; }
  .sp-site-pill { max-width: calc(100vw - 148px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sp-card { padding: 16px; }
  #infiniteViewport { height: 540px; }
  .sp-inspector-drawer { top: auto; right: 10px; bottom: 10px; width: min(320px, calc(100% - 20px)); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-tab-pane,
  .sp-modal-overlay,
  .sp-modal-box,
  .sp-inspector-drawer,
  .org-card,
  .sp-btn-primary,
  .sp-btn-danger,
  .sp-pulse-dot {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   10. MASTER DATA: STATUS, SHIFT BERVERSI, PIT, BAGAN (Fase 1)
   ========================================================================== */
.sp-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(242, 169, 59, 0.14);
  color: var(--sp-accent-amber);
  border: 1px solid rgba(242, 169, 59, 0.35);
}

.sp-status-badge.is-active {
  background: rgba(16, 185, 129, 0.14);
  color: var(--sp-accent-emerald);
  border-color: rgba(16, 185, 129, 0.35);
}

.sp-banner {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--sp-hairline-strong);
  background: var(--sp-surface-card);
  color: var(--sp-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.sp-hint {
  font-size: 11px;
  color: var(--sp-text-subtle);
  line-height: 1.4;
}

.sp-tab-btn.is-dirty::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sp-accent-amber);
  margin-left: 6px;
}

button.sp-tz-card {
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}

.sp-time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 8px;
}

.sp-time-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--sp-text-muted);
}

.sp-mono-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #1e293b;
  color: #cbd5e1;
  font-family: 'IBM Plex Mono', monospace;
}

.sp-pit-card.is-inactive,
.org-card.is-inactive {
  opacity: 0.55;
}

.sp-flow-tree,
.sp-flow-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.sp-flow-tree ul {
  padding-top: 18px;
  border-top: 1px solid var(--sp-hairline-strong);
  margin-top: 18px;
}

.sp-flow-tree li {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sp-flow-node {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--sp-hairline-strong);
  background: #020617;
  text-align: center;
  min-width: 150px;
  max-width: 220px;
}

.sp-flow-node__dept {
  font-size: 9px;
  color: var(--sp-accent-amber);
  font-weight: 700;
  text-transform: uppercase;
}

.sp-flow-node__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sp-text-main);
}

@media (max-width: 640px) {
  .sp-time-grid { grid-template-columns: 1fr; }
}
