:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-light: #f1f5f9;
  
  --emerald: #059669;
  --emerald-light: #ecfdf5;
  
  --amber: #d97706;
  --amber-light: #fffbeb;
  
  --rose: #dc2626;
  --rose-light: #fef2f2;
  
  --purple: #7c3aed;
  --purple-light: #faf5ff;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Navbar (Frosted Crystal Apple / Stripe Style) */
.navbar-custom {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  color: #0f172a;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.nav-link-custom {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-link-custom:hover {
  color: var(--text-main);
  background-color: #f1f5f9;
}

.nav-link-custom.active {
  color: #0f172a;
  background-color: #f1f5f9;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

/* Cards (High-Trust Crisp Surface) */
.wms-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  box-sizing: border-box;
}

.wms-card-hover:hover {
  border-color: #cbd5e1;
  box-shadow: 0 20px 40px -4px rgba(15, 23, 42, 0.08), 0 8px 16px -2px rgba(15, 23, 42, 0.03);
  transform: translateY(-2px);
}

/* Stat Cards */
.stat-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', -apple-system, monospace;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Badges (Crisp Soft Pastels) */
.badge-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-emerald {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-blue {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-amber {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-rose {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-purple {
  background-color: #faf5ff;
  color: #6d28d9;
  border: 1px solid #e9d5ff;
}

/* Buttons (Tactile Stripe / Linear Standard) */
.btn-wms-primary {
  background-color: #0f172a;
  color: #ffffff;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease-in-out;
}

.btn-wms-primary:hover {
  background-color: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-wms-primary:active {
  transform: scale(0.98);
}

.btn-wms-outline {
  background-color: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease-in-out;
}

.btn-wms-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-wms-outline:active {
  transform: scale(0.98);
}

.btn-wms-emerald {
  background-color: #059669;
  color: #ffffff;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px 0 rgba(5, 150, 105, 0.1);
  transition: all 0.15s ease-in-out;
}

.btn-wms-emerald:hover { 
  background-color: #047857; 
  color: #ffffff; 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-wms-emerald:active {
  transform: scale(0.98);
}

/* Button Group Responsive Wrapper */
.btn-group-responsive {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
}

@media (max-width: 640px) {
  .btn-group-responsive {
    width: 100%;
  }
  .btn-group-responsive > * {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }
}

/* Tables (Linear / Stripe Table Standard) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wms-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 640px;
}

.wms-table th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.wms-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: var(--text-main);
  vertical-align: middle;
}

.wms-table tr:last-child td {
  border-bottom: none;
}

.wms-table tr:hover td {
  background-color: #f8fafc;
}

.wms-table td.actions-cell {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.sku-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  color: #1d4ed8;
  font-weight: 600;
  white-space: nowrap;
}

/* Forms (Crisp Clean Ergonomics) */
.wms-input {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wms-input:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.wms-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

/* Form Layout Responsive Utilities */
.form-actions-responsive {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .form-actions-responsive {
    flex-direction: column-reverse;
    width: 100%;
  }
  .form-actions-responsive > * {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.cards-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
}

.details-grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (max-width: 1024px) {
  .details-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Alert Banners */
.alert-banner-rose {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.alert-banner-emerald {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Quick Action Button Pill */
.quick-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1.15rem;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-action-pill:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -2px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   Tactile & Micro-Interactions Standard (Linear / Apple / Stripe Style)
   ========================================================================== */

/* 1. Interactive Clickable Stat Cards */
a.stat-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.stat-card.interactive {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.2s ease;
}

.stat-card.interactive:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  border-color: #cbd5e1;
}

.stat-card.interactive:active {
  transform: translateY(-1px);
}

.stat-card.interactive .stat-arrow {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
  color: #64748b;
}

.stat-card.interactive:hover .stat-arrow {
  opacity: 1;
  transform: translateX(0);
  color: #0f172a;
}

/* 2. Interactive Clickable Table Rows */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.clickable-row:hover {
  background-color: #f8fafc !important;
}

.clickable-row:active {
  background-color: #f1f5f9 !important;
}

/* 3. Role Switcher for Authentication (SaaS Standard) */
.role-switcher-container {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.role-switcher-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1rem;
}

.role-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.role-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}

.role-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  border-color: #e2e8f0;
}

.role-tab-btn:active {
  transform: scale(0.97);
}

.role-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.copy-badge-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  user-select: none;
}

.copy-badge-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.copy-badge-btn:active {
  transform: scale(0.95);
}

/* 4. Quick Filter Chips */
.filter-pills-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 9999px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.filter-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.filter-pill:active {
  transform: scale(0.96);
}

/* 5. Floating Toast Notification */
#wms-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#wms-toast.show {
  opacity: 1;
  transform: translateY(0);
}

