/* =============================================
   SRT — Singh Railway Transportation
   Premium Dark Theme CSS
   ============================================= */
:root {
  --bg-base: #0a0e1a;
  --bg-card: #111827;
  --bg-card2: #1a2235;
  --bg-sidebar: #0d1526;
  --border: #1e2d45;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-glow: rgba(59,130,246,0.2);
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --gold: #f59e0b;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.2);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
  --bg-base: #f3f4f6;
  --bg-card: #ffffff;
  --bg-card2: #f9fafb;
  --bg-sidebar: #ffffff;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-glow: rgba(37,99,235,0.1);
  --text: #111827;
  --text-muted: #6b7280;
  --text-dim: #4b5563;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg-base); color: var(--text); min-height: 100vh; font-size: 14px; }

/* ---- Layout ---- */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left var(--transition); }
.content-area { flex: 1; padding: 1.5rem; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w); position: fixed; top: 0; left: 0; height: 100vh;
  background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; transition: transform var(--transition);
}
.sidebar-brand { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 1.5rem 1rem; border-bottom: 1px solid var(--border); text-align: center; }
.brand-logo-img { width: 80px; height: auto; margin-bottom: 0.5rem; }
.brand-logo-img img { width: 100%; height: auto; object-fit: contain; }
.brand-full-name { font-size: 0.75rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.sidebar-nav { flex: 1; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none;
  font-size: 0.875rem; font-weight: 500; transition: all var(--transition);
}
.nav-item:hover { background: var(--bg-card2); color: var(--text); }
.nav-item.active { background: var(--primary-glow); color: var(--primary); border-left: 3px solid var(--primary); }
.nav-item i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; }
.user-avatar { width: 34px; height: 34px; background: linear-gradient(135deg, var(--primary), #6366f1); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem; flex-shrink: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }
.logout-btn { margin-left: auto; color: var(--text-muted); text-decoration: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all var(--transition); }
.logout-btn:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1.5rem;
  background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.menu-toggle { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 0.25rem 0.5rem; display: flex; align-items: center; border-radius: 8px; transition: background .15s, color .15s; }
.menu-toggle:hover { color: var(--primary); background: rgba(59,130,246,0.08); }
.page-title { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.topbar-right { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 1rem; }
.theme-toggle { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 0.25rem; transition: color var(--transition); display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { color: var(--primary); }
.topbar-home-btn { color: var(--text-muted); font-size: 1.1rem; text-decoration: none; display: flex; align-items: center; justify-content: center; padding: 0.25rem 0.4rem; border-radius: 6px; transition: all var(--transition); }
.topbar-home-btn:hover { color: var(--primary); background: rgba(59,130,246,0.1); }

/* ---- Alerts ---- */
.messages-container { padding: 0 1.5rem; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.alert {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  border-radius: var(--radius-sm); font-size: 0.875rem; border-left: 4px solid;
}
.alert-success { background: rgba(16,185,129,0.1); border-color: var(--success); color: #6ee7b7; }
.alert-error { background: rgba(239,68,68,0.1); border-color: var(--danger); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: var(--warning); color: #fcd34d; }
.alert-close { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; }

/* ---- Cards ---- */
.section-card { 
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 1.5rem; 
  margin-bottom: 1.5rem; 
  animation: slideUp 0.5s ease-out forwards;
  transition: transform var(--transition), box-shadow var(--transition);
}
.section-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ---- Stats ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  border-radius: var(--radius);
  padding: 1.25rem; 
  display: flex; 
  align-items: center; 
  gap: 1rem;
  transition: all var(--transition);
  animation: scaleIn 0.4s ease-out forwards;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { 
  transform: translateY(-5px) scale(1.02); 
  box-shadow: 0 12px 32px rgba(0,0,0,0.4); 
  border-color: var(--primary);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.stat-card:hover::after { opacity: 1; }
.stat-icon { 
  width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; 
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(5deg); }
.stat-blue .stat-icon { background: rgba(59,130,246,0.15); color: var(--primary); }
.stat-orange .stat-icon { background: rgba(245,158,11,0.15); color: var(--accent); }
.stat-green .stat-icon { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-purple .stat-icon { background: rgba(99,102,241,0.15); color: #818cf8; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { background: var(--bg-card2); color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tbody tr:hover { background: var(--bg-card2); }
.empty-row { text-align: center; color: var(--text-muted); padding: 2rem !important; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.72rem; font-weight: 600; }
.badge-gold { background: rgba(245,158,11,0.15); color: var(--gold); border: 1px solid rgba(245,158,11,0.3); }
.badge-gray { background: rgba(100,116,139,0.15); color: var(--text-muted); border: 1px solid var(--border); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--primary); border: 1px solid rgba(59,130,246,0.3); }
.order-num { font-family: 'Courier New', monospace; font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.company-code-sm { background: var(--bg-card2); border: 1px solid var(--border); padding: 0.15rem 0.5rem; border-radius: 6px; font-family: monospace; font-size: 0.85rem; color: var(--primary); }
.status-chip { display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.status-done { background: rgba(16,185,129,0.15); color: var(--success); }
.status-active { background: rgba(59,130,246,0.15); color: var(--primary); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: all var(--transition); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-glow); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card2); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-outline-danger { background: transparent; color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-outline-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }
.order-actions-top { margin-top: 1rem; display: flex; gap: 0.75rem; }
.btn-full { width: 100%; justify-content: center; padding: 0.75rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; }
.flex-1 { flex: 1; }
.form-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); margin-bottom: 0.4rem; }
.form-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  transform: translateY(-1px);
}
.form-input::placeholder { color: var(--text-muted); }
select.form-input option { background: var(--bg-card2); }
select.form-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
textarea.form-input { resize: vertical; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.input-eye-wrap { position: relative; }
.eye-btn { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }

/* ---- Autocomplete ---- */
.autocomplete-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  z-index: 200; max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.autocomplete-dropdown .drop-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem;
  cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.autocomplete-dropdown .drop-item:hover { background: var(--bg-card2); }
.drop-code { background: var(--bg-card2); border: 1px solid var(--border); padding: 0.1rem 0.4rem; border-radius: 5px; font-family: monospace; font-size: 0.8rem; color: var(--primary); }
.drop-name { font-weight: 600; font-size: 0.875rem; }
.drop-meta { font-size: 0.75rem; color: var(--text-muted); }
.form-group { position: relative; }

/* ---- Order Steps ---- */
.order-step { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.step-header { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1rem; margin-bottom: 1rem; }
.step-num { width: 28px; height: 28px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 800; }

/* ---- Company Card ---- */
.company-card { background: var(--bg-card); border: 1px solid var(--primary); border-radius: var(--radius-sm); padding: 1rem; margin-top: 0.5rem; }
.company-card-inner { display: flex; align-items: center; gap: 1rem; }
.company-code-badge { background: linear-gradient(135deg, var(--primary), #6366f1); padding: 0.4rem 0.8rem; border-radius: 8px; font-family: monospace; font-weight: 800; font-size: 1rem; }
.company-card-name { font-weight: 700; font-size: 1rem; }
.company-card-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; font-size: 0.8rem; color: var(--text-muted); }

/* ---- Create Panel ---- */
.create-panel { background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.25rem; margin-top: 1rem; }
.create-panel-title { font-weight: 700; margin-bottom: 1rem; color: var(--primary); }

.tl-grid-info {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem; margin: 0.5rem 0; font-size: 0.8rem; color: var(--text-dim);
}
.tl-grid-info span { background: var(--bg-card2); padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); }
.checkbox-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; color: var(--text); font-weight: 500; }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--success); }
.timeline { display: flex; flex-direction: column; gap: 0; padding: 0.5rem 0; }
.timeline-item { display: flex; gap: 1rem; position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 14px; top: 28px; bottom: -4px; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; margin-top: 2px; }
.tl-done .tl-dot { background: var(--success); color: #fff; }
.tl-done .tl-dot::after { content: '✓'; }
.tl-current .tl-dot { background: var(--primary); color: #fff; animation: pulse 1.5s infinite; }
.tl-current .tl-dot::after { content: '●'; }
.tl-pending .tl-dot { background: var(--bg-card2); border: 2px solid var(--border); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); } 50% { box-shadow: 0 0 0 8px rgba(59,130,246,0); } }
.tl-content { flex: 1; }
.tl-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.3rem; }
.tl-label { font-weight: 700; font-size: 0.9rem; }
.tl-done .tl-label { color: var(--success); }
.tl-current .tl-label { color: var(--primary); }
.tl-pending .tl-label { color: var(--text-muted); }
.tl-time { font-size: 0.75rem; color: var(--text-muted); }
.tl-current-tag { background: var(--primary-glow); color: var(--primary); padding: 0.15rem 0.5rem; border-radius: 99px; font-size: 0.72rem; font-weight: 600; }
.tl-details { font-size: 0.82rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 0.25rem; }
.tl-by { color: var(--text-muted); font-size: 0.78rem; }
.mt-1 { margin-top: 0.5rem; }

/* ---- Order Detail Header ---- */
.order-detail-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.order-header-card { background: linear-gradient(135deg, var(--bg-card) 0%, #0f1f3a 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; display: flex; justify-content: space-between; align-items: center; }
.order-number-big { font-size: 1.75rem; font-weight: 900; font-family: monospace; color: var(--primary); }
.order-company { font-size: 1rem; font-weight: 700; margin: 0.3rem 0; }
.order-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.order-meta span { display: flex; align-items: center; gap: 0.35rem; }
.progress-ring-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.progress-ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray 0.5s ease; }
.progress-text { position: absolute; font-size: 0.9rem; font-weight: 800; color: var(--primary); }
.status-badge-big { margin-top: 0.75rem; text-align: center; font-weight: 700; font-size: 0.9rem; }
.badge-completed { color: var(--success); }
.badge-active { color: var(--primary); }
.ml-1 { margin-left: 0.3rem; }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 500; backdrop-filter: blur(4px); }
.modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.hidden { display: none !important; }

/* ---- Stars ---- */
.star-rating { display: flex; gap: 0.35rem; font-size: 1.4rem; margin-bottom: 0.5rem; }
.rating-star { cursor: pointer; color: var(--text-muted); transition: color var(--transition); }
.star-filled { color: var(--gold); }
.stars { display: flex; gap: 0.3rem; font-size: 1.2rem; margin-bottom: 0.75rem; }
.feedback-text { color: var(--text-dim); font-style: italic; }
.feedback-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }
.feedback-card { border-color: var(--gold); }

/* ---- Reports Filters ---- */
.filters-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ---- Track ---- */
.track-search-bar { display: flex; flex-direction: column; gap: 1rem; }
.track-type-toggle { display: flex; gap: 0.5rem; }
.toggle-btn { background: var(--bg-card2); border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 1rem; border-radius: 99px; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: all var(--transition); }
.toggle-btn.active { background: var(--primary-glow); color: var(--primary); border-color: var(--primary); }
.track-input-wrap { display: flex; gap: 0.75rem; }
.track-input { flex: 1; }
.track-result-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.track-order-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.track-progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.track-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #6366f1); border-radius: 99px; transition: width 0.5s ease; }
.track-mini-timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.track-step { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.ts-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ts-done { background: var(--success); }
.ts-pending { background: var(--border); }
.ts-info { color: var(--text-muted); font-size: 0.75rem; }

/* ---- Users ---- */
.two-col-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; }

/* ---- Misc ---- */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.loading-state { text-align: center; padding: 2rem; color: var(--text-muted); }
.result-count { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; margin-left: 0.5rem; }
.text-muted { color: var(--text-muted); }
.form-page { max-width: 780px; }

/* ---- Login ---- */
.login-body { background: var(--bg-base); }
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 60% 40%, rgba(59,130,246,0.12) 0%, transparent 60%), var(--bg-base); }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem; width: 420px; max-width: 95vw; box-shadow: 0 24px 64px rgba(0,0,0,0.5); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo-img { width: 100px; height: auto; margin: 0 auto 1.5rem; }
.login-logo-img img { width: 100%; height: auto; object-fit: contain; }
.login-title { font-size: 1.25rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; margin-bottom: 0.5rem; }
.login-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-footer { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 1.5rem; }


/* ---- Sidebar collapse (desktop) ---- */
.app-layout.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.app-layout.sidebar-collapsed .main-content { margin-left: 0; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .order-header-card { flex-direction: column; gap: 1rem; }
  .filters-grid { grid-template-columns: 1fr; }
}

/* ---- Activity Feed ---- */
.activity-feed { display: flex; flex-direction: column; gap: 1rem; }
.activity-item { display: flex; gap: 0.75rem; align-items: flex-start; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1.25rem; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-card2); border-radius: 8px; }
.activity-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.activity-title a { color: var(--primary); text-decoration: none; }
.activity-meta { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.2rem; }
.empty-state-sm { padding: 1rem; text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* ---- Dropdowns ---- */
.track-input-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  margin-top: 5px; max-height: 300px; overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.drop-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.drop-item:last-child { border-bottom: none; }
.drop-item:hover { background: var(--bg-card2); }
.drop-code { font-size: 1.1rem; }
.drop-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.drop-meta { font-size: 0.75rem; color: var(--text-dim); }

/* ---- Robust Growth Arrow Pipeline ---- */
.growth-pipeline-container {
  padding: 2rem 1rem 4rem;
  overflow-x: auto;
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
}

.status-markers-flex {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  width: 100% !important;
  min-width: 900px;
  margin-bottom: 2rem;
  padding: 0 50px;
}

.marker-item {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  position: relative !important;
  min-width: 100px;
}

.marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  margin-bottom: 12px;
  border: 3px solid var(--bg-card);
  z-index: 2;
  transition: all 0.3s ease;
}

.is-current .marker-dot { 
  background: var(--primary); 
  box-shadow: 0 0 15px var(--primary-glow);
  transform: scale(1.2);
}

.is-done .marker-dot { 
  background: var(--success); 
}

.marker-text {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  max-width: 85px;
  line-height: 1.3;
}

.is-current .marker-text { color: var(--primary); }
.is-done .marker-text { color: var(--success); }

.arrow-track-wrapper {
  padding: 0 50px;
  min-width: 900px;
  position: relative;
}

.arrow-main-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  position: relative;
  width: 100%;
}

.track-line {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 4px;
}

.growth-line-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  z-index: 2;
  width: 0%; /* Default if not set by JS */
}

.growth-arrow-head {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  z-index: 10;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-tip-shape {
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 32px solid var(--primary);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.arrow-grab-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  animation: arrow-grow-pulse 2s infinite;
  opacity: 0;
}

@keyframes arrow-grow-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.growth-arrow-head:active { cursor: grabbing; }

/* ---- Mini Growth Arrow for Lists ---- */
.list-status-wrapper {
  display: flex;
  align-items: center;
}

.mini-growth-arrow-track {
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  margin-right: 12px;
}

.mini-growt
