/* WorkFlow Corporate ERP / SaaS Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --wf-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wf-body-bg: #f8fafc;
  --wf-card-bg: #ffffff;
  --wf-sidebar-bg: #0f172a;
  --wf-sidebar-text: #94a3b8;
  --wf-sidebar-hover: #1e293b;
  --wf-sidebar-active-bg: #3b82f6;
  --wf-sidebar-active-text: #ffffff;
  --wf-border-color: #e2e8f0;
  --wf-primary: #3b82f6;
  --wf-primary-dark: #2563eb;
  --wf-success: #10b981;
  --wf-warning: #f59e0b;
  --wf-danger: #ef4444;
  --wf-info: #06b6d4;
  --wf-purple: #8b5cf6;
  --wf-text-main: #1e293b;
  --wf-text-muted: #64748b;
  --wf-radius: 10px;
  --wf-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --wf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

body {
  font-family: var(--wf-font);
  background-color: var(--wf-body-bg);
  color: var(--wf-text-main);
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--wf-sidebar-bg);
  color: var(--wf-sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 1040;
}

.sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
  border-bottom: 1px solid #1e293b;
  letter-spacing: -0.025em;
}

.sidebar-brand i {
  font-size: 1.4rem;
  color: var(--wf-primary);
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-menu-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  color: var(--wf-sidebar-text);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-link:hover {
  background-color: var(--wf-sidebar-hover);
  color: #f8fafc;
}

.sidebar-link.active {
  background-color: var(--wf-sidebar-active-bg);
  color: var(--wf-sidebar-active-text);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Topbar */
.main-layout {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--wf-border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar-search {
  max-width: 380px;
  width: 100%;
}

.topbar-search .form-control {
  background-color: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 20px;
  padding-left: 2.5rem;
  font-size: 0.85rem;
}

.topbar-search .form-control:focus {
  background-color: #ffffff;
  border-color: var(--wf-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Cards & Components */
.card-wf {
  background: var(--wf-card-bg);
  border: 1px solid var(--wf-border-color);
  border-radius: var(--wf-radius);
  box-shadow: var(--wf-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-wf:hover {
  box-shadow: var(--wf-shadow-md);
}

.card-wf-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--wf-border-color);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-wf-body {
  padding: 1.25rem;
}

/* KPI Cards */
.kpi-card {
  padding: 1.25rem;
  border-radius: var(--wf-radius);
  background: #ffffff;
  border: 1px solid var(--wf-border-color);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.kpi-primary::before { background-color: var(--wf-primary); }
.kpi-card.kpi-warning::before { background-color: var(--wf-warning); }
.kpi-card.kpi-success::before { background-color: var(--wf-success); }
.kpi-card.kpi-danger::before { background-color: var(--wf-danger); }
.kpi-card.kpi-purple::before { background-color: var(--wf-purple); }

.kpi-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--wf-text-main);
}

.kpi-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 290px;
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 0.85rem;
  min-height: 500px;
  border: 1px solid var(--wf-border-color);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding: 0.25rem 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 400px;
}

.kanban-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--wf-border-color);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--wf-shadow-md);
  border-color: #cbd5e1;
}

.kanban-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.kanban-card.overdue-card {
  border-left: 4px solid var(--wf-danger);
}

/* Timer Widget */
.timer-widget {
  background: #0f172a;
  color: #ffffff;
  border-radius: 30px;
  padding: 0.35rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.timer-digits {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse-ring 1.5s infinite;
}

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

/* Badges & Utilities */
.bg-purple-subtle { background-color: #f3e8ff !important; }
.text-purple { color: #7e22ce !important; }
.border-purple-subtle { border-color: #d8b4fe !important; }

/* Timeline History */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid #e2e8f0;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--wf-primary);
  border: 2px solid #ffffff;
}

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -250px;
    height: 100vh;
  }
  .sidebar.show {
    left: 0;
  }
}
