/* =============================================
   BEAM EVENT TRACKING SYSTEM
   Design System — Light Mode Premium
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* === Light Mode Palette === */
  --bg-primary:    #f5f7fa;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #f0f2f5;
  --surface:       #ffffff;
  --surface-hover: #f5f7fa;
  --surface-active:#eef1f6;

  /* Borders */
  --border:        rgba(0,0,0,0.08);
  --border-subtle: rgba(0,0,0,0.04);
  --border-focus:  rgba(67,97,238,0.50);

  /* Text */
  --text-primary:  #1a1d2e;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;

  /* Brand Colors */
  --accent:        #4361ee;
  --accent-hover:  #3451d1;
  --accent-light:  rgba(67,97,238,0.10);

  /* Semantic Colors */
  --success:       #22c55e;
  --success-bg:    rgba(34,197,94,0.10);
  --success-dark:  #16a34a;
  --warning:       #f59e0b;
  --warning-bg:    rgba(245,158,11,0.10);
  --danger:        #ef4444;
  --danger-bg:     rgba(239,68,68,0.10);
  --purple:        #8b5cf6;
  --purple-bg:     rgba(139,92,246,0.10);
  --info:          #3b82f6;
  --info-bg:       rgba(59,130,246,0.10);

  /* Status Colors */
  --status-active:     var(--accent);
  --status-transport:  var(--warning);
  --status-warehouse:  var(--purple);
  --status-mall:       var(--info);
  --status-done:       var(--success);
  --status-late:       var(--danger);

  /* Shadows — Light mode */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.15);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);

  /* Spacing */
  --sp-1: 4px;   --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* Radius */
  --r-sm:  6px;  --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-full: 9999px;

  /* Animation */
  --dur-fast:    150ms;
  --dur-normal:  250ms;
  --dur-slow:    400ms;
  --ease-out-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring:     cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h:  64px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Plus Jakarta Sans', 'Sarabun', sans-serif;
  /* Subtle mesh gradient for modern glassmorphism background */
  background: radial-gradient(at 0% 0%, hsla(253,16%,7%,0) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow: hidden;
}

/* ==========================================
   GLASSMORPHISM UTILITIES
   ========================================== */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
}

/* ==========================================
   LAYOUT
   ========================================== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
  grid-row: 1 / -1;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(67,97,238,0.30);
}

.sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  margin-top: 8px;
}
.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out-expo);
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

/* SVG icons for nav */
.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
  min-width: 20px;
  text-align: center;
}

/* Sidebar bottom — Create Event button */
.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-normal);
  box-shadow: 0 4px 14px rgba(67,97,238,0.35);
}

.sidebar-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(67,97,238,0.45);
}

.sidebar-create-btn:active { transform: scale(0.98); }

.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-normal);
}

.sidebar-settings-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ==========================================
   TOPBAR
   ========================================== */
.topbar {
  grid-column: 2;
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: none;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search .search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  background: var(--bg-tertiary);
  border: 1.5px solid transparent;
  border-radius: var(--r-full);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--dur-normal);
}

.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:focus {
  background: #fff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.08);
}

/* Shortcut hint */
.search-kbd {
  position: absolute;
  right: 12px;
  font-size: 0.65rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  background: #fff;
  font-family: monospace;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User profile pill */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-full);
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--dur-normal);
  position: relative;
}

.topbar-user:hover {
  background: var(--surface-hover);
  border-color: rgba(67,97,238,0.25);
}

.topbar-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user-caret {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Dropdown logout */
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 6px;
  animation: scaleIn 0.15s var(--ease-out-back) both;
}

.topbar-user.open .user-dropdown { display: block; }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.user-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--danger);
}

/* Notification bell */
.topbar-bell {
  width: 36px; height: 36px;
  border: none;
  background: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
  position: relative;
}

.topbar-bell:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.topbar-bell-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
  grid-column: 2;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 28px 40px;
  background: var(--bg-primary);
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================
   KPI CARDS — Light, 3D-style
   ========================================== */
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 24px;
  transition: transform var(--dur-normal), box-shadow var(--dur-normal);
  animation: fadeUp 0.4s var(--ease-out-expo) both;
  cursor: default;
}

/* Custom Soft Colors for KPI Cards */
.kpi-total { background: #f8fbff; border-color: #e0f0ff; }
.kpi-completed { background: #f4fdf6; border-color: #dcfce7; }
.kpi-in-progress { background: #fffdf5; border-color: #fef3c7; }
.kpi-pending { background: #fff5f5; border-color: #fee2e2; }

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.kpi-card:nth-child(1) { animation-delay: 0ms; }
.kpi-card:nth-child(2) { animation-delay: 60ms; }
.kpi-card:nth-child(3) { animation-delay: 120ms; }
.kpi-card:nth-child(4) { animation-delay: 180ms; }

.kpi-icon-3d {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* subtle drop shadow for the transparent PNG images */
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.08)); 
}

.kpi-icon-3d img {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kpi-card:hover .kpi-icon-3d img {
  transform: translateY(-8px) scale(1.1) rotate(3deg);
}

.kpi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.kpi-label {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-value.blue   { color: #4361ee; }
.kpi-value.green  { color: #22c55e; }
.kpi-value.yellow { color: #f59e0b; }
.kpi-value.red    { color: #ef4444; }

/* ==========================================
   CARDS
   ========================================== */
.card {
  background: #ffffff;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: fadeUp 0.4s var(--ease-out-expo) both;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ==========================================
   TABLES
   ========================================== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead tr {
  background: #f8f9fc;
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--text-primary);
  font-weight: 500;
  vertical-align: middle;
}

.table tbody tr {
  transition: background var(--dur-fast);
}

.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: none; }

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out-expo);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 14px rgba(67,97,238,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(67,97,238,0.45);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #e8eaf0; color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.badge-success  { background: var(--success-bg); color: var(--success-dark); }
.badge-warning  { background: var(--warning-bg); color: #b45309; }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-accent   { background: var(--accent-light); color: var(--accent); }
.badge-purple   { background: var(--purple-bg);  color: var(--purple); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-muted    { background: var(--bg-tertiary); color: var(--text-muted); }

/* ==========================================
   INPUTS & FORMS
   ========================================== */
.input, .select {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--dur-normal);
  -webkit-appearance: none;
  box-shadow: var(--shadow-xs);
}

.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.08);
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; display: none; }
.form-error.visible { display: block; }

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #ffffff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.25s var(--ease-out-back) both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbfc;
}

/* ==========================================
   DETAIL DRAWER
   ========================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--dur-normal);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 420px;
  max-width: 95vw;
  background: #ffffff;
  box-shadow: var(--shadow-xl);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.drawer.open { transform: translateX(0); }

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  animation: slideInRight 0.35s var(--ease-out-back) both;
  min-width: 280px;
  max-width: 380px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger);  }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--accent);  }

/* ==========================================
   ACTION BUTTONS IN TABLE
   ========================================== */
.action-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ==========================================
   EMPTY STATES
   ========================================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text-secondary); }
.empty-desc  { font-size: 0.875rem; color: var(--text-muted); margin-top: 6px; }

/* ==========================================
   STEPPER (5-step pipeline)
   ========================================== */
.step-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}

.step-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  border: 2px solid;
  flex-shrink: 0;
  transition: all var(--dur-normal);
  position: relative;
  z-index: 1;
}

.step-circle.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-circle.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.step-circle.pending {
  background: #f5f7fa;
  border-color: #d1d5db;
  color: #9ca3af;
}

.step-circle.late {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.step-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}
.step-label.done { color: var(--success-dark); }
.step-label.active { color: var(--accent); }
.step-label.late { color: var(--danger); }

.step-connector {
  width: 20px;
  height: 2px;
  background: #e5e7eb;
  flex-shrink: 0;
  margin-bottom: 12px;
  transition: background var(--dur-normal);
}
.step-connector.done { background: var(--success); }

/* ==========================================
   ALERT BAR
   ========================================== */
.alert-bar { display: flex; flex-direction: column; gap: 10px; }

.alert-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--dur-normal);
  border: 1px solid transparent;
}
.alert-item:hover { transform: translateY(-2px); }

.alert-item.warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.15);
}
.alert-item.warning .alert-icon {
  color: #f59e0b;
}
.alert-item.warning .alert-title {
  color: #d97706;
}
.alert-item.warning .alert-arrow {
  color: #f59e0b;
}

.alert-item.danger {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.15);
}
.alert-item.danger .alert-icon {
  color: #ef4444;
}
.alert-item.danger .alert-title {
  color: #dc2626;
}
.alert-item.danger .alert-arrow {
  color: #ef4444;
}

.alert-item.info {
  background: rgba(47,129,247,0.08);
  border-color: rgba(47,129,247,0.15);
}
.alert-item.info .alert-icon {
  color: #2f81f7;
}
.alert-item.info .alert-title {
  color: #2f81f7;
}
.alert-item.info .alert-arrow {
  color: #2f81f7;
}

.alert-icon {
  width: 140px; height: 60px;
  display: flex; align-items: center; justify-content: flex-start;
  font-size: 1.5rem;
  font-weight: 800;
  position: relative;
}
.alert-icon img {
  position: absolute;
  height: 112px;
  width: auto;
  max-width: none;
  object-fit: contain;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.alert-item:hover .alert-icon img {
  transform: translateY(-50%) translateY(-8px) scale(1.08) rotate(2deg);
}
.alert-text {
  flex: 1;
}
.alert-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.alert-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}
.alert-icon { font-size: 1.2rem; flex-shrink: 0; }
.alert-text { flex: 1; }
.alert-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.alert-desc  { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ==========================================
   CALENDAR
   ========================================== */
.cal-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.cal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.cal-month { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.cal-leg { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-secondary); }
.cal-leg-dot { width: 10px; height: 10px; border-radius: 2px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.cal-day-name {
  padding: 8px 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}
.cal-day-name.weekend { color: var(--danger); }

.cal-cell {
  min-height: 90px;
  padding: 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  cursor: default;
  transition: background var(--dur-fast);
  vertical-align: top;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: #fafbfd; }
.cal-cell.other-month { background: #fafbfc; }
.cal-cell.today { background: rgba(67,97,238,0.04); }
.cal-cell.today .cal-date {
  background: var(--accent);
  color: #fff;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cal-date { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.cal-event-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--dur-fast);
}
.cal-event-pill:hover { opacity: 0.8; }
.cal-more { font-size: 0.65rem; color: var(--text-muted); cursor: pointer; }
.cal-more:hover { color: var(--accent); }

/* ==========================================
   DRAWER INTERNALS
   ========================================== */
.drawer-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.drawer-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg-primary);
}

.detail-section { margin-bottom: 20px; }

.detail-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
}

.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 0.8125rem; color: var(--text-muted); flex-shrink: 0; }
.detail-val { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); text-align: right; }

/* Drawer pipeline */
.drawer-pipeline {
  display: flex;
  align-items: flex-start;
  padding: 16px 0;
  overflow-x: auto;
  gap: 0;
}

.dp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 5px;
  min-width: 76px;
  position: relative;
}

.dp-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.dp-step.done:not(:last-child)::after { background: var(--success); }

.dp-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  border: 2px solid;
  background: #fff;
}

.dp-step.done    .dp-circle { border-color: var(--success); background: var(--success); color: #fff; }
.dp-step.active  .dp-circle { border-color: var(--accent);  color: var(--accent); }
.dp-step.pending .dp-circle { border-color: #d1d5db; color: #9ca3af; }
.dp-step.late    .dp-circle { border-color: var(--danger);  color: var(--danger); }

.dp-label { font-size: 0.68rem; font-weight: 700; text-align: center; color: var(--text-muted); }
.dp-dept  {
  font-size: 0.6rem; font-weight: 600; text-align: center;
  padding: 1px 5px; border-radius: 9999px; border: 1px solid;
  color: var(--text-muted); border-color: var(--border);
  background: var(--bg-tertiary); white-space: nowrap;
}

.dp-step.done   .dp-label { color: var(--success-dark); }
.dp-step.done   .dp-dept  { color: var(--success-dark); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); }
.dp-step.active .dp-label { color: var(--accent); }
.dp-step.active .dp-dept  { color: var(--accent);  border-color: rgba(67,97,238,0.35); background: rgba(67,97,238,0.08); }
.dp-step.late   .dp-label { color: var(--danger); }
.dp-step.late   .dp-dept  { color: var(--danger);  border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); }

.dp-time      { font-size: 0.62rem; color: var(--text-muted); text-align: center; }
.dp-time-date { font-size: 0.62rem; color: var(--text-secondary); font-weight: 600; }
.dp-time-hour { font-size: 0.68rem; color: var(--accent); font-weight: 700; }

/* ==========================================
   DASHBOARD CHART
   ========================================== */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 120px; font-size: 0.8125rem; color: var(--text-secondary); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; transition: width 1s var(--ease-out-expo); width: 0; }
.bar-val   { width: 40px; font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }

/* ==========================================
   DATA ITEMS TABLE
   ========================================== */
.data-items-table .table { min-width: 480px; }

.brand-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand-CELINE { background: rgba(139,92,246,0.12); color: var(--purple); }
.brand-FENDI  { background: rgba(245,158,11,0.12); color: #b45309; }
.brand-LOEWE  { background: rgba(34,197,94,0.12);  color: var(--success-dark); }

/* ==========================================
   ACTION FORM (inside drawer)
   ========================================== */
.action-form {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 16px;
  animation: fadeUp 0.25s ease;
}

.action-form-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ==========================================
   ROW PIPELINE (table compact)
   ========================================== */
.row-pipeline { display: flex; align-items: flex-start; gap: 3px; }
.rp-step { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rp-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700;
  border: 1.5px solid;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.rp-dept { font-size: 0.55rem; font-weight: 700; text-align: center; white-space: nowrap; line-height: 1; color: var(--text-muted); max-width: 32px; overflow: hidden; text-overflow: ellipsis; }
.rp-line { width: 10px; height: 2px; background: #e5e7eb; flex-shrink: 0; margin-top: 10px; transition: background var(--dur-normal); }
.rp-line.done { background: var(--success); }
.rp-dot.done   { border-color: var(--success); background: var(--success); color: #fff; }
.rp-dot.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.rp-dot.pending{ border-color: #d1d5db; color: #9ca3af; background: #f5f7fa; }
.rp-dot.late   { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.rp-step.done   .rp-dept { color: var(--success-dark); }
.rp-step.active .rp-dept { color: var(--accent); font-weight: 800; }
.rp-step.late   .rp-dept { color: var(--danger); }

/* ==========================================
   ACCORDION
   ========================================== */
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--dur-fast);
  user-select: none;
}
.accordion-header:hover { background: var(--surface-hover); border-color: var(--accent); }
.accordion-header.open  { border-radius: var(--r-md) var(--r-md) 0 0; border-bottom-color: transparent; background: var(--accent-light); }
.accordion-left { display: flex; align-items: center; gap: 10px; }
.accordion-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.accordion-meta  { font-size: 0.75rem; color: var(--text-muted); }
.accordion-arrow { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.25s ease; display: inline-block; }
.accordion-header.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body {
  overflow: hidden; max-height: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 0;
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.accordion-body.open { max-height: 600px; opacity: 1; }
.accordion-body-inner { padding: 0; }

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.hidden   { display: none !important; }
.visible  { display: block !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }

.flex       { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.mb-4       { margin-bottom: 16px; }
.mb-6       { margin-bottom: 24px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.text-h4   { font-size: 1.125rem; font-weight: 700; }
.text-sm   { font-size: 0.875rem; }
.text-muted { color: var(--text-muted); }

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67,97,238,0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(67,97,238,0.08); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Stagger animation helpers */
.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 60ms; }
.stagger-3 { animation-delay: 120ms; }
.stagger-4 { animation-delay: 180ms; }

/* Tab panels */
.tab-panel         { display: none; }
.tab-panel.active  { display: block; animation: fadeUp 0.3s var(--ease-out-expo) both; }

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.20); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .topbar-search { display: none; }
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out-expo);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { grid-column: 1; height: calc(100vh - var(--topbar-h)); }
  .topbar { grid-column: 1; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}

@media (max-width: 768px) {
  .mockup-grid-5, .mockup-grid-3 { grid-template-columns: 1fr; }
  .alert-icon { width: 90px; }
  .alert-icon img { height: 90px; }
}

@media (max-width: 480px) {
  .grid-kpi { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .alert-item { flex-direction: column; align-items: flex-start; gap: 8px; position: relative; padding: 24px 16px 16px 16px; }
  .alert-icon { width: 100%; justify-content: flex-start; height: auto; margin-bottom: 8px; }
  .alert-icon img { position: relative; height: 80px; transform: none; top: auto; left: auto; }
  .alert-item:hover .alert-icon img { transform: translateY(-4px) scale(1.05); }
  .alert-text { padding-left: 0; }
  .alert-item .alert-arrow { position: absolute; right: 16px; top: 16px; }
}

/* Print */
@media print {
  .sidebar, .topbar, .btn { display: none !important; }
  .main-content { height: auto; overflow: visible; }
  body { background: #fff; color: #000; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Filter bar */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filter-bar .input, .filter-bar .select { height: 38px; }

/* Calendar inside accordion body */
.drawer .drawer-body { padding-bottom: 100px; }

/* ==========================================
   EVENT DETAILS MODAL (NEW DESIGN)
   ========================================== */
.mdl-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
  margin-bottom: -22px; /* Divider handles spacing */
}
.mdl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 20%;
  width: 20%;
  gap: 2px;
  position: relative;
  z-index: 2;
}
.mdl-step-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #D1D5DB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #9CA3AF;
  margin-bottom: 6px;
}
.mdl-step.done .mdl-step-icon {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.mdl-step.active .mdl-step-icon {
  background: #fff;
  border-color: #2f81f7;
  color: #2f81f7;
}
.mdl-step.late .mdl-step-icon {
  background: #fff;
  border-color: #ef4444;
  color: #ef4444;
}
.mdl-step-dept {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
}
.mdl-step.done .mdl-step-dept { color: #16a34a; }
.mdl-step.active .mdl-step-dept { color: #2f81f7; }
.mdl-step.late .mdl-step-dept { color: #ef4444; }
.mdl-step-date {
  font-size: 0.7rem;
  color: #6B7280;
  text-align: center;
}
.mdl-step-time {
  font-size: 0.7rem;
  color: #6B7280;
  text-align: center;
  font-weight: 500;
}
.mdl-step.active .mdl-step-date,
.mdl-step.active .mdl-step-time { color: #2f81f7; }
.mdl-step-line {
  position: absolute;
  top: 16px; /* Half of 34px icon */
  left: 50%;
  width: 100%;
  height: 2px;
  background: #D1D5DB;
  z-index: -1;
}
.mdl-step-line.done { background: #22c55e; }

/* Divider */
.mdl-divider {
  border: none !important;
  border-top: 1.5px solid #B0BAC8 !important;
  margin: 20px 0 !important;
  width: 100% !important;
  display: block !important;
  height: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Section layout */
.mdl-section { padding: 0; }
.mdl-sec-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.mdl-sec-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mdl-sec-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111827;
}

/* Key-value grid: label left, value right, side by side */
.mdl-sec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 12px;
  column-gap: 24px;
  padding-left: 40px;
}
.mdl-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: baseline;
  gap: 8px;
}
.mdl-kv .lbl {
  font-size: 0.8rem;
  color: #6B7280;
  white-space: nowrap;
}
.mdl-kv .val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111827;
}

/* =========================================================
   TIMELINE (GANTT CHART) & ACTIVE EVENTS STYLES
========================================================= */

/* Active Events */
.active-event-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}
.active-event-card:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}
.active-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  width: max-content;
}
.active-event-badge::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b5cf6;
}

/* Timeline Gantt Chart */
.gantt-header-col {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.gantt-header-col span {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.gantt-event-bar {
  position: relative;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s;
}
.gantt-event-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.gantt-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gantt-details {
  display: flex;
  flex-direction: column;
}
.gantt-title {
  font-weight: 700;
  color: var(--text-primary);
}
.gantt-time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mini Calendar */
.mini-cal-day {
  font-size: 0.8rem;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-primary);
}
.mini-cal-day:hover {
  background: rgba(0,0,0,0.05);
}
.mini-cal-day.text-muted {
  color: var(--text-muted);
}
.mini-cal-day.today {
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
}
.mini-cal-day.highlight {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  font-weight: 700;
}
.mini-cal-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Added for History Page KPIs */
.kpi-purple { background: #f9f5ff; border-color: #f3e8ff; }
.kpi-value.purple { color: #8b5cf6; }


/* =========================================
   MOCKUP DASHBOARD STYLES (Pastel Theme)
   ========================================= */

.mockup-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.mockup-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 20px;
}

@media(max-width: 1400px) {
  .mockup-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .mockup-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media(max-width: 900px) {
  .mockup-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .mockup-grid-3 { grid-template-columns: 1fr; }
}

.mockup-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.05);
  display: flex;
  flex-direction: column;
}

.mockup-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mockup-icon svg {
  width: 24px;
  height: 24px;
}

.mockup-icon img {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mockup-card:hover .mockup-icon img {
  transform: scale(1.4) translateY(-4px) rotate(3deg) !important;
}

/* Pastel Colors */
.bg-purple-light { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.bg-green-light { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.bg-red-light { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.bg-yellow-light { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.bg-pink-light { background: rgba(244, 114, 182, 0.1); color: #f472b6; }

.text-purple { color: #8b5cf6; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }
.text-yellow { color: #f59e0b; }
.text-pink { color: #f472b6; }

.mockup-title {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
}

.mockup-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.mockup-progress-bg {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #f1f5f9;
  overflow: hidden;
  margin: 16px 0 8px 0;
}

.mockup-progress-bar {
  height: 100%;
  border-radius: 4px;
}

.mockup-subtext {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}

/* Alerts */
.mockup-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mockup-alert:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.mockup-alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Pipeline Chart */
.mockup-chart-container {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-bottom: 40px;
  position: relative;
  border-bottom: 1px dashed #cbd5e1;
  margin-top: 36px;
}

.mockup-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mockup-bar {
  width: 50px;
  border-radius: 8px 8px 0 0;
}

.mockup-bar-label {
  position: absolute;
  bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

/* Upcoming Schedule */
.mockup-timeline-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  position: relative;
}

.mockup-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 65px;
  top: 36px;
  bottom: -22px;
  width: 2px;
  background: #f1f5f9;
}

.mockup-timeline-date {
  width: 40px;
  text-align: center;
  color: #8b5cf6;
  font-weight: 700;
}

.mockup-timeline-date span {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}
.mockup-timeline-date small {
  font-size: 0.75rem;
  text-transform: uppercase;
}

.mockup-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b5cf6;
  margin-top: 6px;
  position: relative;
  z-index: 2;
}

.mockup-timeline-content {
  flex: 1;
}

.mockup-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.mockup-timeline-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 1rem;
}

.mockup-timeline-brand {
  font-weight: 700;
  font-size: 0.85rem;
}

.mockup-timeline-details {
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mockup-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Filter controls */
.mockup-filter-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.mockup-filter-btn:hover {
  background: #f8fafc;
}
