:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #0284c7;
  --brand-hover: #0369a1;
  --accent: #38bdf8;
  --brand-red: #ef4444;
  --brand-blue: #38bdf8;
  --danger: #ef4444;
  --border: #e2e8f0;
  --warn: #d97706;
  --success: #10b981;
  --radius: 14px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
  transition: all 0.2s ease;
}

.top-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  line-height: 1;
}

.brand-icon-img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.brand-link:hover .brand-icon-img {
  transform: scale(1.06);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-title-abdullah {
  color: #ef4444;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.brand-title-mobile {
  color: #38bdf8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.brand-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #94a3b8;
  text-transform: uppercase;
}

.top-mobile-actions {
  display: none;
  align-items: center;
  gap: 10px;
}

.btn-receive-quick {
  background: #0284c7;
  color: #ffffff !important;
  font-weight: 800 !important;
  padding: 6px 10px !important;
  border-radius: 8px;
  font-size: 12px !important;
  border: 1px solid #38bdf8;
}

/* Hamburger toggle button */
.nav-toggle {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #cbd5e1;
  border-radius: 2px;
  transition: all 0.2s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Navigation Links */
.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.user-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #0284c7 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.user-profile-link {
  transition: transform 0.15s ease;
  border-radius: 6px;
  padding: 2px 6px;
}

.user-profile-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.user-profile-link.active {
  background: rgba(239, 68, 68, 0.2);
  outline: 1px solid #ef4444;
}

.fin-masked-val {
  font-family: monospace;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}


.nav-receive-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  padding: 6px 12px !important;
  border-radius: 8px;
  border: 1px solid #38bdf8;
  white-space: nowrap;
}

.nav-receive-btn:hover {
  background: #0369a1 !important;
}

.nav-receive-btn.active {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5) !important;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
  padding-left: 12px;
  border-left: 1px solid #334155;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-info strong {
  color: #f1f5f9;
}

.role-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
}

.role-admin {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.role-helpdesk {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.role-technician {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.role-assistant {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.logout-btn {
  color: #f87171 !important;
  font-weight: 700 !important;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

/* User Profile Navbar Dropdown Menu */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.user-menu-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #334155;
  color: #ffffff;
  border-radius: 30px;
  padding: 4px 12px 4px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.user-menu-btn:hover,
.user-menu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: #64748b;
}

.user-profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 290px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  overflow: hidden;
  animation: popupFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s ease;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* ==========================================================================
   Responsive Grids & Cards
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.metric strong {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: var(--brand);
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-primary {
  background: var(--brand) !important;
  color: #ffffff !important;
  border: 1px solid var(--brand) !important;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25) !important;
}

.btn-primary:hover {
  background: var(--brand-hover) !important;
  border-color: var(--brand-hover) !important;
  color: #ffffff !important;
}

.btn-outline {
  background: transparent !important;
  color: #0284c7 !important;
  border: 1.5px solid #0284c7 !important;
  box-shadow: none !important;
}

.btn-outline:hover {
  background: rgba(2, 132, 199, 0.08) !important;
  color: #0369a1 !important;
  border-color: #0369a1 !important;
}

.btn.ghost,
.btn-ghost {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}

.btn.ghost:hover,
.btn-ghost:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Ghost buttons on dark container backgrounds */
#partRequestModal .btn.ghost,
.modal-content .btn.ghost {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

#partRequestModal .btn.ghost:hover,
.modal-content .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border-color: #64748b !important;
}

.btn.secondary,
.btn-secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  box-shadow: none !important;
  border: 1px solid var(--border) !important;
}

.btn.secondary:hover,
.btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.btn-danger {
  background: var(--danger) !important;
  color: #ffffff !important;
  border: 1px solid var(--danger) !important;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2) !important;
}

.btn-danger:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  margin-top: 4px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Tables & Responsive Wrappers
   ========================================================================== */
.table-wrap,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-received {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-in_repair {
  background: #fef3c7;
  color: #92400e;
}

.badge-repaired {
  background: #d1fae5;
  color: #065f46;
}

.badge-delivered {
  background: #e2e8f0;
  color: #334155;
}

.badge-unrepairable {
  background: #fee2e2;
  color: #991b1b;
}

/* Alerts */
.alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* ==========================================================================
   Repeating Customer Banner (Intake)
   ========================================================================== */
.repeating-banner {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: -6px;
  margin-bottom: 18px;
  animation: fadeIn 0.25s ease-out;
}

.repeating-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.repeating-title {
  font-weight: 800;
  color: #0369a1;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.repeating-count {
  background: #0284c7;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.repeating-devices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.device-chip {
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
  transition: all 0.15s ease;
}

.device-chip:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.past-repairs-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.past-repair-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
}

.past-repair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.past-repair-code {
  font-weight: 800;
  color: var(--brand);
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 75vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
  padding: 36px 32px;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.login-brand-header {
  margin-bottom: 24px;
}

.login-brand-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-brand-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.login-brand-subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brand);
  margin-top: 4px;
}

.login-heading {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}

.login-form {
  text-align: left;
  margin-top: 20px;
}

.login-btn {
  margin-top: 10px;
  padding: 12px 20px;
  font-size: 15px;
}

.demo-accounts-card {
  margin-top: 24px;
  padding: 16px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}

.demo-accounts-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.demo-accounts-grid {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.demo-badge {
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
}

.demo-password {
  font-size: 12px;
  color: var(--muted);
}

.kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

/* Default Base Display States */
.desktop-only {
  display: block !important;
}

table.desktop-only {
  display: table !important;
}

div.table-responsive.desktop-only {
  display: block !important;
}

tr.desktop-only {
  display: table-row !important;
}

a.desktop-only,
span.desktop-only {
  display: inline-flex !important;
}

.mobile-only {
  display: none !important;
}

.mobile-card-list.mobile-only {
  display: none !important;
}

.mobile-bottom-nav {
  display: none !important;
}

.drawer-backdrop,
.mobile-drawer {
  display: none !important;
}

/* ==========================================================================
   Mobile Breakpoints & Responsiveness (Strictly <= 768px for Mobile)
   ========================================================================== */
@media (max-width: 768px) {
  .top {
    padding: 10px 14px;
  }

  .top-brand-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .top-mobile-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  .top-nav {
    display: none !important;
    /* Managed via mobile drawer on small screens */
  }

  .form-grid,
  .split {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .wrap {
    padding: 12px 12px 85px 12px;
    /* Generous bottom padding for bottom nav */
  }

  .login-card {
    padding: 24px 18px;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric strong {
    font-size: 22px;
  }

  /* Desktop Elements strictly hidden on mobile */
  .desktop-only,
  table.desktop-only,
  div.table-responsive.desktop-only,
  tr.desktop-only,
  a.desktop-only,
  span.desktop-only {
    display: none !important;
  }

  /* Mobile Elements strictly visible on mobile */
  .mobile-only {
    display: block !important;
  }

  .mobile-card-list.mobile-only,
  .repair-card-list.mobile-only {
    display: flex !important;
    flex-direction: column !important;
  }

  button.mobile-only,
  a.mobile-only {
    display: inline-flex !important;
  }

  span.mobile-only {
    display: inline-block !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .drawer-backdrop {
    display: block !important;
  }

  .mobile-drawer {
    display: flex !important;
  }

  main.wrap {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Form Elements on Mobile */
  input,
  select,
  textarea {
    font-size: 16px !important;
    /* Prevents auto-zoom in iOS Safari */
  }
}

@media (min-width: 769px) {
  .desktop-only {
    display: block !important;
  }

  table.desktop-only {
    display: table !important;
  }

  div.table-responsive.desktop-only {
    display: block !important;
  }

  tr.desktop-only {
    display: table-row !important;
  }

  a.desktop-only,
  span.desktop-only {
    display: inline-flex !important;
  }

  .mobile-only,
  .mobile-card-list.mobile-only,
  .repair-card-list.mobile-only {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: none !important;
  }

  .drawer-backdrop,
  .mobile-drawer {
    display: none !important;
  }

  .top-mobile-actions {
    display: none !important;
  }

  .top-nav {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .brand-title-line {
    font-size: 15px;
  }

  .brand-icon-img {
    height: 32px;
    width: 32px;
  }

  .brand-kicker {
    font-size: 8px !important;
    letter-spacing: 1px !important;
    display: block !important;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Modern Native Mobile App Bottom Navigation Bar
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  z-index: 9999;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94a3b8;
  text-decoration: none;
  background: transparent;
  border: none;
  flex: 1;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.15s ease;
  user-select: none;
}

.mob-tab.active {
  color: #38bdf8;
}

.mob-tab:active {
  transform: scale(0.95);
}

.mob-tab-icon {
  font-size: 19px;
  line-height: 1;
}

.mob-tab-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mob-tab-center {
  position: relative;
}

.mob-center-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  margin-top: -22px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.5), 0 0 0 4px #0f172a;
  transition: transform 0.15s ease;
}

.mob-tab-center:active .mob-center-fab {
  transform: scale(0.92);
}

/* ==========================================================================
   Mobile Slide-Out App Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  right: -320px;
  top: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: #0f172a;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  border-left: 1px solid #1e293b;
}

.mobile-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 18px 16px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #0284c7 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.drawer-user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-user-meta strong {
  color: #f8fafc;
  font-size: 14px;
}

.drawer-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.drawer-menu {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.drawer-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
}

.drawer-item.active {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  font-weight: 800 !important;
  border-left: 4px solid #ef4444 !important;
}

.drawer-item-highlight {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.drawer-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.drawer-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
}

.drawer-logout-btn {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

/* ==========================================================================
   Modern Touch Cards for Repairs (Mobile Native Style)
   ========================================================================== */
.repair-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repair-touch-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.repair-touch-card:active {
  transform: scale(0.98);
  background: #f8fafc;
}

.touch-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.touch-card-code {
  font-size: 15px;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: 0.4px;
}

.touch-card-device {
  font-size: 14px;
  color: #1e293b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.touch-card-imei {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.touch-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

/* ==========================================================================
   Modern Status Pills (Consistent Colors)
   ========================================================================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-received {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

.status-diagnosis {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

.status-waiting-part,
.status-waiting-customer-decision {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1px solid #e9d5ff !important;
}

.status-repairing {
  background: #cffafe !important;
  color: #0e7490 !important;
  border: 1px solid #a5f3fc !important;
}

.status-testing {
  background: #e0e7ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

.status-ready-for-dispatch {
  background: #ccfbf1 !important;
  color: #0f766e !important;
  border: 1px solid #99f6e4 !important;
}

.status-delivered,
.status-closed {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

/* ==========================================================================
   Modern Metric Widgets (Overview & Finance)
   ========================================================================== */
.metric-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
}

.metric-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.metric-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metric-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-val {
  font-size: 22px;
  font-weight: 900;
  color: #0284c7;
  line-height: 1.1;
}

/* Financial Highlights */
.fin-card {
  border-radius: 14px;
  padding: 12px 14px;
}

.fin-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  display: block;
  margin-bottom: 2px;
}

.fin-val {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.text-emerald {
  color: #10b981 !important;
}

.text-amber {
  color: #f59e0b !important;
}

.text-rose {
  color: #f43f5e !important;
}

.text-primary {
  color: #0284c7 !important;
}

/* ==========================================================================
   Rapid Intake Chips & Accessories
   ========================================================================== */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-sm {
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.chip-sm:hover,
.chip-sm:active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.accessory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.acc-chip {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.acc-chip:hover,
.acc-chip:active {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}

.acc-chip.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.acc-chip.chip-none.active {
  background: #64748b;
  border-color: #64748b;
}

.btn-link-sm {
  background: none;
  border: none;
  color: #0284c7;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link-sm:hover {
  color: #0369a1;
}

/* AI Smart Loop & Cards */
.ai-loop-card {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
  border: 1px solid #e0e7ff;
}

.part-card,
.tool-card {
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.part-card:hover,
.tool-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Camera Barcode & IMEI Viewfinder Scanner Modal
   ========================================================================== */
.scanner-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.scanner-container {
  position: relative;
  width: min(94vw, 560px);
  height: 320px;
  background: #0f172a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Viewfinder Target Box Overlay (Matching user mobile screenshot) */
.viewfinder-target {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(88%, 340px);
  height: 76px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
  pointer-events: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewfinder-target.success {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65), 0 0 35px #10b981 !important;
}

.viewfinder-tag {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 12px;
  border-radius: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Green Center Laser Line exactly like user screenshot */
.scanner-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e, 0 0 16px #16a34a;
  border-radius: 2px;
}

/* IMEI Bypass Dropdown Menu Styles */
.dropdown-trigger-box {
  position: relative;
  display: inline-block;
}

.bypass-menu-card {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.18), 0 8px 12px -6px rgba(0, 0, 0, 0.1);
  z-index: 100;
  overflow: hidden;
  animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bypass-menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.bypass-menu-item:hover {
  background-color: #f1f5f9;
  color: #2563eb;
  padding-left: 18px;
}

/* ==========================================================================
   Production Technician Profile - Mobile & Cross-Device Responsive
   ========================================================================== */
.profile-header-card {
  margin-bottom: 20px;
  padding: 22px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #334155;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.profile-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.profile-user-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #0284c7 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
  border: 3px solid #1e293b;
  flex-shrink: 0;
}

.profile-quick-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #334155;
  padding: 8px 14px;
  border-radius: 10px;
  text-align: center;
  min-width: 90px;
}

.profile-tabs-scroll {
  margin-top: 20px;
  border-top: 1px solid #334155;
  padding-top: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.profile-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.profile-tab-item {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.profile-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.profile-presets-scroll {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.profile-date-range-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px dashed #334155;
  padding-top: 12px;
  margin: 0;
}

.profile-date-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.work-order-chips-scroll {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Mobile Responsive Rules (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .profile-header-card {
    padding: 16px 12px;
    margin-bottom: 16px;
    border-radius: 12px;
  }

  .profile-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .profile-user-identity {
    gap: 12px;
  }

  .profile-avatar-circle {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .profile-user-title h1 {
    font-size: 18px !important;
  }

  .profile-meta-row {
    font-size: 11px !important;
    gap: 8px !important;
  }

  /* 3 Equal Stat Badges on Mobile */
  .profile-quick-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .profile-stat-box {
    padding: 6px 4px !important;
    min-width: 0 !important;
  }

  .profile-stat-box span {
    font-size: 9px !important;
  }

  .profile-stat-box strong {
    font-size: 13px !important;
  }

  /* Smooth Native-feel Horizontal Scrolling Tabs */
  .profile-tabs-scroll {
    margin-top: 12px;
    padding-top: 10px;
    gap: 6px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .profile-tab-item {
    padding: 7px 11px;
    font-size: 12px;
  }

  /* 1-column layout on mobile for profile forms and cards */
  .profile-grid-responsive {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* KPI Grid: 2-column on mobile phones */
  .profile-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .profile-kpi-grid .card.metric {
    padding: 12px 10px !important;
  }

  .profile-kpi-grid .card.metric strong {
    font-size: 18px !important;
  }

  /* Calendar Presets Scrollable Horizontally */
  .profile-presets-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 8px !important;
    scrollbar-width: none !important;
  }

  .profile-presets-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .profile-presets-scroll a {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
    padding: 5px 12px !important;
  }

  /* Date Range Form Stacking */
  .profile-date-range-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .profile-date-input-group {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .profile-date-input-group input[type="date"] {
    flex: 1 !important;
    margin-left: 8px !important;
    font-size: 13px !important;
    padding: 7px 10px !important;
  }

  .profile-date-apply-btn {
    width: 100% !important;
    padding: 9px 14px !important;
    font-size: 13px !important;
    justify-content: center !important;
    display: flex !important;
  }

  /* Work Order Filters */
  .work-order-filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .work-order-filter-row input {
    width: 100% !important;
  }

  .work-order-chips-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
  }

  .work-order-chips-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .work-order-chips-scroll button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
  }

  /* User Menu Dropdown on Mobile */
  .user-profile-dropdown {
    position: fixed !important;
    top: 56px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: 380px !important;
    margin: 0 auto !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
  }
}

/* Smallest phone screens (<= 380px) */
@media (max-width: 380px) {
  .profile-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Inventory Page - Mobile & Cross-Device Responsive
   ========================================================================== */
.inv-top-tabs-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.inv-tabs-scroll {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inv-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.inv-chips-scroll {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.part-card,
.mypart-card,
.damaged-card,
.usage-card {
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

@media (max-width: 768px) {

  #partsMobileList,
  .mobile-card-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .inv-top-tabs-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .inv-tabs-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    width: 100% !important;
  }

  .inv-tabs-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .inv-tabs-scroll button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 7px 12px !important;
  }

  .inv-action-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .inv-action-bar button {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
  }

  .inv-filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .inv-filter-row input {
    width: 100% !important;
  }

  .inv-chips-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    width: 100% !important;
  }

  .inv-chips-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .inv-chips-scroll button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
  }

  /* Search headers inside sections on mobile */
  .section-header-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .section-header-flex input {
    width: 100% !important;
  }

  /* Add part card mobile grid */
  #addPartCard .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* ==========================================================================
   Lenis Smooth Scroll, Password Eye Toggle & Modern Motion System Polish
   ========================================================================== */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

/* Password Show / Hide Eye Toggle */
.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-field-wrap input {
  width: 100%;
  padding-right: 42px !important;
  box-sizing: border-box;
}

.pw-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.pw-eye-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pw-eye-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header, Card & Mobile Dock Visual Polish */
.top {
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
}

.card {
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.metric-card {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -6px rgba(15, 23, 42, 0.12);
}

.repair-touch-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.repair-touch-card:active {
  transform: scale(0.985);
}

.login-wrapper {
  background: radial-gradient(circle at top right, rgba(2, 132, 199, 0.08), transparent 55%),
    radial-gradient(circle at bottom left, rgba(239, 68, 68, 0.06), transparent 50%);
}

.login-card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.12);
}

.mobile-bottom-nav {
  background: rgba(11, 17, 32, 0.96) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(51, 65, 85, 0.7) !important;
  padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important;
}

/* ==========================================================================
   Global Section-Only Print Isolation & Document Formatting
   ========================================================================== */
#sectionPrintArea {
  display: none !important;
}

@media print {
  @page {
    margin: 8mm;
    size: auto;
  }

  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* SECTION-ONLY PRINTING MODE (when user clicks any Print button or isolated document view) */
  body.printing-section-only {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11pt !important;
    line-height: 1.35 !important;
  }

  /* Completely HIDE every element in body EXCEPT the section print area */
  body.printing-section-only>*:not(#sectionPrintArea) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* SHOW ONLY the designated section print area */
  body.printing-section-only #sectionPrintArea {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }

  body.printing-section-only #sectionPrintArea * {
    visibility: visible !important;
  }

  /* Strip all interactive buttons, inputs, dropdowns from printed section */
  body.printing-section-only #sectionPrintArea .no-print,
  body.printing-section-only #sectionPrintArea button,
  body.printing-section-only #sectionPrintArea .btn,
  body.printing-section-only #sectionPrintArea input,
  body.printing-section-only #sectionPrintArea select,
  body.printing-section-only #sectionPrintArea textarea,
  body.printing-section-only #sectionPrintArea .status-filter-scroll {
    display: none !important;
  }

  /* Ensure tables stretch and avoid page breaks across rows */
  body.printing-section-only #sectionPrintArea .table-responsive,
  body.printing-section-only #sectionPrintArea .table-wrap {
    overflow: visible !important;
    display: block !important;
    width: 100% !important;
  }

  body.printing-section-only #sectionPrintArea table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 6px !important;
  }

  body.printing-section-only #sectionPrintArea tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body.printing-section-only #sectionPrintArea .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-bottom: 12px !important;
    background: #ffffff !important;
    padding: 12px !important;
    border-radius: 6px !important;
  }

  /* DEFAULT PRINT FALLBACK (when printing outside section-only mode) */
  header.top,
  nav.top-nav,
  .top-brand-row,
  .mobile-bottom-nav,
  .drawer-backdrop,
  #mobileDrawer,
  .user-menu-wrapper,
  .no-print,
  button,
  .btn,
  .nav-toggle,
  .user-menu-btn-mobile,
  .search-card,
  .status-filter-scroll,
  #sectionPrintIframe {
    display: none !important;
  }

  body,
  html {
    background: #fff !important;
    color: #0f172a !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 11pt !important;
  }

  main.wrap {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
    margin-bottom: 12px !important;
  }
}