/* ===========================
   ASM - AUTOMATED STOCK MONITOR
   Global Design System – Light Theme
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  /* Colors – Light Theme */
  --bg-base: #f0f4f8;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f7fafd;
  --bg-modal: #ffffff;

  --accent: #0ea5e9;
  --accent-dim: rgba(14, 165, 233, 0.10);
  --accent-glow: rgba(14, 165, 233, 0.25);
  --accent-dark: #0284c7;

  --warning: #d97706;
  --warning-dim: rgba(217, 119, 6, 0.10);
  --danger: #dc2626;
  --danger-dim: rgba(220, 38, 38, 0.10);
  --success: #16a34a;
  --success-dim: rgba(22, 163, 74, 0.10);
  --info: #2563eb;
  --info-dim: rgba(37, 99, 235, 0.10);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(14, 165, 233, 0.35);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows – light theme uses softer shadows */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --glow-accent: 0 0 0 3px rgba(14, 165, 233, 0.2);

  /* Sidebar */
  --sidebar-width: 240px;
  --topnav-height: 60px;

  /* Transitions */
  --transition: 0.2s ease;
}

/* ===== RESET & BASE ===== */
*,
*::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-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
}

h2 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
}

h3 {
  font-size: clamp(15px, 2.5vw, 18px);
  font-weight: 600;
}

h4 {
  font-size: 15px;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--glow-accent);
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: .5px;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-sm) var(--space-xs);
  margin-top: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: var(--bg-card);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP NAV ===== */
.topnav {
  height: var(--topnav-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.topnav-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.topnav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.notif-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: var(--space-lg);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.page-header-left {
  flex: 1;
  min-width: 200px;
}

.page-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: var(--shadow-sm);
}

.card-accent {
  border-color: var(--border-accent);
  box-shadow: var(--glow-accent);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-icon.teal {
  background: var(--accent-dim);
}

.stat-icon.yellow {
  background: var(--warning-dim);
}

.stat-icon.red {
  background: var(--danger-dim);
}

.stat-icon.green {
  background: var(--success-dim);
}

.stat-icon.blue {
  background: var(--info-dim);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-delta {
  font-size: 11px;
  font-weight: 600;
}

.stat-delta.up {
  color: var(--success);
}

.stat-delta.down {
  color: var(--danger);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  min-height: 38px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--glow-accent);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: var(--warning);
  color: #ffffff;
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  background: var(--success);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 30px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  min-height: 46px;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-teal {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-green {
  background: var(--success-dim);
  color: var(--success);
}

.badge-yellow {
  background: var(--warning-dim);
  color: var(--warning);
}

.badge-red {
  background: var(--danger-dim);
  color: var(--danger);
}

.badge-blue {
  background: var(--info-dim);
  color: var(--info);
}

.badge-gray {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody td {
  padding: 10px 14px;
  font-size: 13px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select option {
  background: var(--bg-card);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ===== QR SCANNER MODAL ===== */
.qr-scanner-area {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  border: 2px dashed var(--border);
  margin: var(--space-md) 0;
  transition: border-color var(--transition);
}

.qr-scanner-area.scanning {
  border-color: var(--accent);
  animation: pulseGlow 1.2s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 0 12px transparent;
  }
}

.qr-icon {
  font-size: 56px;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 0 12px var(--accent));
}

.qr-result {
  background: var(--success-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-md);
  color: var(--success);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin-top: var(--space-md);
  word-break: break-all;
}

.qr-error {
  background: var(--danger-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-md);
  color: var(--danger);
  font-size: 13px;
  margin-top: var(--space-md);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  cursor: pointer;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.3);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.3);
}

.toast.info {
  border-color: rgba(59, 130, 246, 0.3);
}

/* ===== STEP WIZARD ===== */
.steps-bar {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-xl);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
}

.step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.step.active .step-circle {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.step.done .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.step-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
  white-space: nowrap;
  font-weight: 500;
}

.step.active .step-label {
  color: var(--accent);
  font-weight: 600;
}

.step.done .step-label {
  color: var(--success);
}

.step-connector {
  flex: 1;
  min-width: 32px;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}

.step-connector.done {
  background: var(--accent);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  background: var(--bg-base);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 20px;
  transition: width 0.5s ease;
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--space-md);
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-body {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-success {
  background: var(--success-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.alert-warning {
  background: var(--warning-dim);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.alert-danger {
  background: var(--danger-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.alert-info {
  background: var(--info-dim);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--info);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.tab-btn {
  flex: 1;
  min-width: fit-content;
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
}

/* ===== WAREHOUSE MAP ===== */
.wh-map {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-lg);
}

.wh-zone-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.wh-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.rack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  min-width: 100px;
  transition: all var(--transition);
  cursor: pointer;
}

.rack-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rack-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}

.rack-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-indicator {
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.slot-empty {
  background: var(--bg-base);
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

.slot-partial {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.slot-full {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.slot-ok {
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  color: var(--accent);
}

/* ===== SCAN LIST ===== */
.scan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all var(--transition);
}

.scan-item.scanned {
  border-color: rgba(34, 197, 94, 0.3);
  background: var(--success-dim);
}

.scan-item.current {
  border-color: var(--border-accent);
  background: var(--accent-dim);
  animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {

  0%,
  100% {
    border-color: var(--border-accent);
  }

  50% {
    border-color: var(--accent);
  }
}

.scan-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
}

.scan-item.scanned .scan-dot {
  background: var(--success);
  border-color: var(--success);
}

.scan-item.current .scan-dot {
  background: var(--accent);
  border-color: var(--accent);
  animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .page-content {
    padding: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 100%;
    max-height: 95vh;
  }

  .topnav {
    padding: 0 var(--space-md);
  }

  .topnav-btn span {
    display: none;
  }

  .steps-bar {
    gap: 4px;
  }

  .wh-row {
    gap: var(--space-xs);
  }

  .rack-card {
    min-width: 80px;
    padding: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-value {
    font-size: 20px;
  }

  h1 {
    font-size: 20px;
  }
}

/* ===== UTILS ===== */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-sm {
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.fw-700 {
  font-weight: 700;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
}

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 600px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ===== TASK CARD ===== */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all var(--transition);
}

.task-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: var(--shadow-md);
}

.task-card.inbound {
  border-left: 3px solid var(--info);
}

.task-card.outbound {
  border-left: 3px solid var(--warning);
}

.task-card.completed {
  border-left: 3px solid var(--success);
  opacity: 0.7;
}

.flow-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.flow-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

/* ===== LOCATION TAG ===== */
.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Custom scrollbar for modals */
.modal::-webkit-scrollbar {
  width: 4px;
}

/* Animated loading dots */
.loading-dots span {
  display: inline-block;
  animation: dotBounce 1.2s infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }

  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Pulse animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}