/* ==========================================================================
   TECNVIRONS MARSHAL — 14 STAGE CARD-BASED WORKFLOW SYSTEM
   File: styles/workflow_14stages.css
   ========================================================================== */

:root {
  --wf-bg: #060918;
  --wf-bg-card: rgba(14, 21, 48, 0.72);
  --wf-bg-card-hover: rgba(22, 33, 72, 0.88);
  --wf-card-border: rgba(255, 255, 255, 0.09);
  --wf-card-border-active: rgba(99, 102, 241, 0.6);
  --wf-text-primary: #ffffff;
  --wf-text-secondary: rgba(255, 255, 255, 0.72);
  --wf-text-muted: rgba(255, 255, 255, 0.44);
  
  /* Category Colors */
  --wf-procure: #6366f1;
  --wf-procure-glow: rgba(99, 102, 241, 0.28);
  --wf-receive: #10b981;
  --wf-receive-glow: rgba(16, 185, 129, 0.28);
  --wf-sell: #f59e0b;
  --wf-sell-glow: rgba(245, 158, 11, 0.28);
  --wf-dispatch: #06b6d4;
  --wf-dispatch-glow: rgba(6, 182, 212, 0.28);
  --wf-bill: #a855f7;
  --wf-bill-glow: rgba(168, 85, 247, 0.28);
  --wf-growth: #ec4899;
  --wf-growth-glow: rgba(236, 72, 153, 0.28);
  
  --wf-radius-card: 20px;
  --wf-radius-sm: 10px;
  --wf-transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Workflow Section */
.workflow-14stages-section {
  background: radial-gradient(circle at 50% 0%, #151b3d 0%, #060918 65%, #03050d 100%);
  position: relative;
  overflow: hidden;
  padding: 100px 0 120px;
  color: var(--wf-text-primary);
  font-family: var(--body, 'Inter', sans-serif);
}

.workflow-14stages-section::before {
  content: "";
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 450px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.18), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.workflow-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Header & Intro */
.wf-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 48px;
}

.wf-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 100px;
  color: #a5b4fc;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

.wf-badge-dot {
  width: 7px;
  height: 7px;
  background: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 10px #6366f1;
  animation: wfPulse 2s infinite;
}

.wf-title {
  font-family: var(--display, 'Manrope', sans-serif);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 16px;
}

.wf-title em {
  font-style: normal;
  background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wf-subtitle {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--wf-text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* Stats Ribbon */
.wf-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: rgba(14, 21, 48, 0.5);
  border: 1px solid var(--wf-card-border);
  border-radius: 16px;
  padding: 16px 24px;
  margin-bottom: 40px;
  backdrop-filter: blur(12px);
}

.wf-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.wf-stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 15%;
  height: 70%;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.wf-stat-num {
  font-family: var(--display, 'Manrope', sans-serif);
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wf-stat-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--wf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Controls Toolbar (Filter Pills + AutoPlay Button) */
.wf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.wf-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(10, 15, 36, 0.6);
  padding: 6px;
  border-radius: 100px;
  border: 1px solid var(--wf-card-border);
}

.wf-filter-btn {
  background: transparent;
  border: none;
  color: var(--wf-text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--wf-transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wf-filter-btn .count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 20px;
}

.wf-filter-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.wf-filter-btn.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.wf-filter-btn.active .count {
  background: rgba(255, 255, 255, 0.25);
}

/* Action Controls (Play/Pause, Progress) */
.wf-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wf-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--wf-transition);
  backdrop-filter: blur(8px);
}

.wf-play-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.wf-play-btn.playing {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
}

.wf-progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--wf-text-muted);
  font-weight: 600;
  background: rgba(14, 21, 48, 0.6);
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--wf-card-border);
}

.wf-progress-bar {
  width: 90px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.wf-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* ==========================================================================
   CARDS GRID & CARDS DESIGN
   ========================================================================== */
.wf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  position: relative;
}

/* Card Component */
.wf-card {
  background: var(--wf-bg-card);
  border: 1px solid var(--wf-card-border);
  border-radius: var(--wf-radius-card);
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  backdrop-filter: blur(14px);
  transition: var(--wf-transition);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.wf-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color, var(--wf-procure));
  opacity: 0.7;
  transition: height 0.3s ease, opacity 0.3s ease;
}

.wf-card:hover {
  background: var(--wf-bg-card-hover);
  border-color: var(--card-color, var(--wf-procure));
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 25px var(--card-glow, var(--wf-procure-glow));
}

.wf-card:hover::before {
  height: 5px;
  opacity: 1;
}

/* Active Highlight (in AutoPlay or Click) */
.wf-card.is-active {
  border-color: #ffffff;
  background: rgba(30, 45, 96, 0.9);
  box-shadow: 0 0 0 2px var(--card-color, #6366f1), 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 35px var(--card-glow, var(--wf-procure-glow));
  transform: translateY(-8px) scale(1.025);
  z-index: 2;
}

.wf-card.is-active::before {
  height: 6px;
  opacity: 1;
}

/* Card Header */
.wf-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.wf-card-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--display, 'Manrope', sans-serif);
  font-size: 15px;
  font-weight: 800;
  color: var(--card-color, #ffffff);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.04);
}

.wf-card.is-active .wf-card-num-badge {
  background: var(--card-color, #6366f1);
  color: #ffffff;
  box-shadow: 0 0 15px var(--card-color, #6366f1);
}

.wf-card-cat-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--card-color, #cbd5e1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card Content */
.wf-card-body {
  flex-grow: 1;
  margin-bottom: 20px;
}

.wf-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-glow, rgba(99, 102, 241, 0.15));
  color: var(--card-color, #6366f1);
  margin-bottom: 14px;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.3s ease;
}

.wf-card:hover .wf-card-icon-wrap {
  transform: scale(1.1) rotate(4deg);
}

.wf-card-title {
  font-family: var(--display, 'Manrope', sans-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 8px;
}

.wf-card-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--wf-text-secondary);
}

/* Card Footer / Output Module Pill */
.wf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
}

.wf-module-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--wf-text-muted);
}

.wf-module-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-color, #10b981);
}

.wf-card-status {
  font-weight: 700;
  color: var(--card-color, #a5b4fc);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   CATEGORY COLOR VARIATIONS
   ========================================================================== */
.wf-card[data-cat="procure"] {
  --card-color: var(--wf-procure);
  --card-glow: var(--wf-procure-glow);
}

.wf-card[data-cat="receive"] {
  --card-color: var(--wf-receive);
  --card-glow: var(--wf-receive-glow);
}

.wf-card[data-cat="stock"] {
  --card-color: #14b8a6;
  --card-glow: rgba(20, 184, 166, 0.28);
}

.wf-card[data-cat="sell"] {
  --card-color: var(--wf-sell);
  --card-glow: var(--wf-sell-glow);
}

.wf-card[data-cat="dispatch"] {
  --card-color: var(--wf-dispatch);
  --card-glow: var(--wf-dispatch-glow);
}

.wf-card[data-cat="bill"] {
  --card-color: var(--wf-bill);
  --card-glow: var(--wf-bill-glow);
}

.wf-card[data-cat="renew"] {
  --card-color: #f43f5e;
  --card-glow: rgba(244, 63, 94, 0.28);
}

.wf-card[data-cat="report"] {
  --card-color: var(--wf-growth);
  --card-glow: var(--wf-growth-glow);
}

/* ==========================================================================
   DETAIL MODAL / DRAWER
   ========================================================================== */
.wf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 20, 0.85);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wf-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.wf-modal-card {
  background: #0d1430;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  max-width: 640px;
  width: 100%;
  padding: 36px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.wf-modal-overlay.open .wf-modal-card {
  transform: translateY(0) scale(1);
}

.wf-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: var(--wf-transition);
}

.wf-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.wf-modal-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 12px;
}

.wf-modal-title {
  font-family: var(--display, 'Manrope', sans-serif);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 14px;
}

.wf-modal-desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--wf-text-secondary);
  margin-bottom: 24px;
}

.wf-modal-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 16px;
}

.wf-spec-box h6 {
  font-size: 11px;
  color: var(--wf-text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.wf-spec-box p {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

/* Animations */
@keyframes wfPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
  .wf-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .wf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wf-stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .wf-stat-item:nth-child(2)::after {
    display: none;
  }
  .wf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .wf-filter-tabs {
    justify-content: center;
  }
  .wf-actions {
    justify-content: center;
  }
}

@media (max-width: 580px) {
  .wf-grid {
    grid-template-columns: 1fr;
  }
  .wf-stats-ribbon {
    grid-template-columns: 1fr;
  }
  .wf-stat-item::after {
    display: none !important;
  }
}
