/* ============================================================
   MN+LA Master Access – Dark Premium ERP Dashboard
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Surfaces */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #181818;
  --bg-card-hover: #202020;
  --bg-elevated: #242424;

  /* Text */
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #555555;

  /* Accent — pure white */
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, .08);
  --accent-glow: rgba(255, 255, 255, .18);

  /* Status */
  --badge-red: #c47a5a;
  --badge-red-bg: rgba(196, 122, 90, .14);
  --badge-amber: #f5a623;
  --badge-green: #34d399;

  /* Misc */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .6);
  --transition: .2s cubic-bezier(.4, 0, .2, 1);

  --nav-height: 60px;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ---------- TOP NAV ---------- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(10, 10, 15, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: var(--transition);
  position: relative;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--text-primary);
}

.mobile-menu-btn {
  display: flex;
  min-width: 48px;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 42px;
  width: 160px;
  display: block;
}


/* Notification bell badge */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: var(--badge-red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 0 2px var(--bg-primary);
}

/* Profile */
.profile-wrapper {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.profile-btn:hover {
  background: rgba(255, 255, 255, .06);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
}

.profile-chevron {
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.profile-wrapper.open .profile-chevron {
  transform: rotate(180deg);
}

/* Profile dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: var(--transition);
}

.profile-wrapper.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 12px 16px;
}

.dropdown-header strong {
  display: block;
  font-size: .9rem;
}

.dropdown-header small {
  color: var(--text-secondary);
  font-size: .75rem;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, .06);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.dropdown-item .material-icons-round {
  font-size: 1.1rem;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--text-primary);
}

.dropdown-item--danger:hover {
  color: var(--badge-red);
}


/* ---------- MAIN CONTENT ---------- */
.main-content {
  padding: calc(var(--nav-height) + 24px) 16px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- SECTION ---------- */
.section {
  margin-bottom: 36px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-icon {
  font-size: 1.2rem;
  color: var(--accent);
}


/* ---------- NOTIFICATION CARDS (Section 1) ---------- */
.notif-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.notif-card {
  flex: 0 0 auto;
  width: 180px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius);
  padding: 18px;
  scroll-snap-align: start;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}

.notif-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.notif-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.notif-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.notif-card--alert .notif-card__icon {
  background: var(--badge-red-bg);
  color: var(--badge-red);
}

.notif-card__count {
  min-width: 26px;
  height: 26px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  padding: 0 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
}

.notif-card--alert .notif-card__count {
  background: rgba(196, 122, 90, .22);
  color: #c47a5a;
}

.notif-card__title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.notif-card__desc {
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1.4;
}


/* ---------- MODULE GRID (Section 2) ---------- */
.module-group {
  margin-bottom: 32px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

.group-icon {
  font-size: 1.15rem;
  color: var(--accent);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.module-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, .2);
}

.module-card:active {
  transform: scale(.98);
}

.module-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  transition: var(--transition);
}

.module-card:hover .module-card__icon {
  background: #fff;
  color: #000;
}

.module-card__label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.module-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--badge-red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 77, 106, .4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(255, 77, 106, 0);
  }
}


/* ---------- OWNER FACTORY & JOB ORDERS GRID ---------- */
.owner-factory-section {
  margin-bottom: 36px;
}
.owner-factory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.owner-factory-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(168, 147, 92, 0.25);
  border-radius: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.owner-factory-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: rgba(168, 147, 92, 0.5);
}
.owner-factory-icon {
  font-size: 28px;
  color: #a8935c;
}
.owner-factory-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}
.owner-factory-count {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bg-primary, #0f0f0f);
  background: #a8935c;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ---------- PENDING ACTIONS (Section 3) ---------- */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: var(--transition);
}

.pending-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.pending-item__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.pending-item--urgent .pending-item__icon {
  background: rgba(168, 147, 92, .13);
  color: #a8935c;
}

.pending-item__info {
  flex: 1;
}

.pending-item__title {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.pending-item__subtitle {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pending-item__badge {
  min-width: 28px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .1);
}

.pending-item__badge--low {
  background: rgba(255, 255, 255, .08);
  color: var(--text-secondary);
}

.pending-item__arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition);
}

.pending-item:hover .pending-item__arrow {
  color: var(--accent);
}


/* ---------- MOBILE SIDEBAR ---------- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition);
}

.mobile-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(255, 255, 255, .06);
  z-index: 250;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}

.mobile-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, .05);
  color: var(--text-primary);
}

.sidebar-link.active {
  color: var(--accent);
}

.sidebar-link .material-icons-round {
  font-size: 1.2rem;
}

.sidebar-link--danger:hover {
  color: var(--badge-red);
}


/* ---------- RESPONSIVE ---------- */
@media (min-width: 600px) {
  .mobile-menu-btn {
    display: none;
  }

  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .module-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .notif-card {
    width: 180px;
  }
}

@media (min-width: 900px) {
  .main-content {
    padding-left: 32px;
    padding-right: 32px;
  }

  .module-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .notif-card {
    width: 190px;
  }

  .pending-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (min-width: 1200px) {
  .module-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}


/* ============================================================
   LOGIN PAGE
   ============================================================ */

/* Full-viewport centered layout */
.login-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Logo block */
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-logo svg {
  width: 180px;
  height: auto;
}

.login-tagline {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Card */
.login-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.login-card__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-card__subtitle {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ---- Inline error strip ---- */
.login-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 77, 106, .12);
  border: 1px solid rgba(255, 77, 106, .25);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  font-size: .82rem;
  color: var(--badge-red);
  margin-bottom: 20px;
  line-height: 1.45;
}

.login-error .material-icons-round {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.login-error--success {
  background: rgba(52, 211, 153, .1);
  border-color: rgba(52, 211, 153, .25);
  color: #34d399;
}

/* ---- Form ---- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- Form field ---- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---- Universal input style ---- */
.input {
  width: 100%;
  height: 46px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .9rem;
  padding: 0 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  border-color: rgba(255, 255, 255, .3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
}

/* Input with show/hide toggle */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input {
  padding-right: 48px;
}

.input-toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  transition: color var(--transition);
}

.input-toggle-pw:hover {
  color: var(--text-secondary);
}

.input-toggle-pw .material-icons-round {
  font-size: 1.1rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: #fff;
  color: #000;
}

.btn--primary:hover {
  background: #e8e8e8;
}

.btn--primary:active {
  transform: scale(.98);
}

.btn--primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background: rgba(255, 255, 255, .07);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, .08);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, .12);
}

.btn--full {
  width: 100%;
}

/* ---- Demo entry button ---- */
.btn--demo {
  background: rgba(251, 191, 36, .10);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, .25);
  font-weight: 600;
}

.btn--demo:hover {
  background: rgba(251, 191, 36, .18);
  border-color: rgba(251, 191, 36, .5);
}

.btn--demo:active {
  transform: scale(.98);
}

/* ---- "or" divider ---- */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: .75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .08);
}


/* ---- Login links (e.g. forgot password) ---- */
.login-links {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.link {
  font-size: .8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.link:hover {
  color: var(--text-primary);
}

/* Footer */
.login-footer {
  font-size: .72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---- Demo password modal ---- */
.demo-password-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.demo-password-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.demo-password-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.demo-password-hint {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.demo-password-form .form-field {
  margin-bottom: 12px;
}
.demo-password-error {
  font-size: .8rem;
  color: var(--badge-red);
  margin-bottom: 12px;
  min-height: 1.2em;
}
.demo-password-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.demo-password-actions .btn {
  min-width: 90px;
}


/* ============================================================
   USER CHIP  (in dashboard nav)
   ============================================================ */
.user-chip {
  display: none;
  /* shown by auth.js after load */
  align-items: center;
  align-self: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  cursor: default;
  max-width: min(220px, 50vw);
  min-height: 36px;
  line-height: 1.3;
}

.user-chip__name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip__role {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .1);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--success {
  background: var(--bg-elevated);
  border: 1px solid rgba(52, 211, 153, .3);
  color: #34d399;
}

.toast--error {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 77, 106, .3);
  color: var(--badge-red);
}

.toast--info {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text-primary);
}


/* ============================================================
   LOGOUT BUTTON  (in nav)
   ============================================================ */
.logout-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: var(--transition);
}

.logout-btn:hover {
  background: rgba(255, 77, 106, .12);
  color: var(--badge-red);
}

.logout-btn .material-icons-round {
  font-size: 1.25rem;
}


/* ============================================================
   MODULE DASHBOARDS — Shared Components
   ============================================================ */

/* ---------- BACK NAV ---------- */
.back-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 24px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, .07);
  background: var(--bg-card);
  transition: var(--transition);
  text-decoration: none;
}

.back-nav:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, .18);
  background: var(--bg-card-hover);
}

.back-nav .material-icons-round {
  font-size: 1.1rem;
}

/* ---------- STAT METRIC CARDS ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

@media (min-width: 600px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, .1);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-card__value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -.03em;
}

.stat-card__label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.3;
}

.stat-card__delta {
  font-size: .72rem;
  font-weight: 500;
  color: var(--badge-green);
}

/* Accent line at top */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--stat-accent, rgba(255, 255, 255, .12));
  border-radius: var(--radius) var(--radius) 0 0;
}


/* ---------- STATUS BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge--green {
  background: rgba(52, 211, 153, .12);
  color: #34d399;
}

.badge--amber {
  background: rgba(245, 166, 35, .12);
  color: #f5a623;
}

.badge--red {
  background: rgba(255, 77, 106, .12);
  color: #ff4d6a;
}

.badge--blue {
  background: rgba(96, 165, 250, .12);
  color: #60a5fa;
}

.badge--purple {
  background: rgba(167, 139, 250, .12);
  color: #a78bfa;
}

.badge--gray {
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
}

/* ---------- DATA TABLE CARD ---------- */
.table-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.table-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.table-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.table-card__title .material-icons-round {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.table-card__count {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .06);
  padding: 3px 9px;
  border-radius: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.data-table thead th {
  padding: 10px 16px 10px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  white-space: nowrap;
}

.data-table thead th:last-child {
  text-align: right;
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  transition: var(--transition);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .025);
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table td:last-child {
  text-align: right;
}

.data-table td.muted {
  color: var(--text-secondary);
}

.table-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: .82rem;
}

/* sku pill */
.sku-pill {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 2px 8px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
  border-radius: 6px;
}

/* ---------- MODULE PAGE HEADER ---------- */
.module-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.module-header__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.module-header__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.module-header__subtitle {
  font-size: .78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---------- STORE PICKER ---------- */
.store-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.store-picker label {
  font-size: .8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.store-picker select {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.store-picker select:hover {
  border-color: rgba(255, 255, 255, .25);
}