/* WMS-FMCG global styles.
 *
 * Goals:
 *  - large touch targets for warehouse phones (44px+)
 *  - high-contrast badges for stock state
 *  - works fine on Desk and on portal/mobile pages
 */

:root {
  --wms-primary: #1f6feb;
  --wms-primary-dark: #0b4fd9;
  --wms-success: #138636;
  --wms-warning: #d97706;
  --wms-danger: #cf222e;
  --wms-near-expiry: #d97706;
  --wms-expired: #cf222e;
  --wms-dead-stock: #6e7781;
  --wms-touch: 48px;
}

.wms-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.wms-badge--ok       { background: #dafbe1; color: var(--wms-success); }
.wms-badge--near     { background: #fff1cc; color: var(--wms-warning); }
.wms-badge--expired  { background: #ffebe9; color: var(--wms-expired); }
.wms-badge--dead     { background: #eaeef2; color: var(--wms-dead-stock); }
.wms-badge--low      { background: #ffebe9; color: var(--wms-expired); }

/* Mobile portal */
.wms-mobile {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #fafbfc;
  min-height: 100vh;
  padding: 12px;
  color: #24292f;
}
.wms-mobile h1 { font-size: 22px; margin: 8px 0 16px; }
.wms-mobile-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wms-subtitle {
  color: #57606a;
  margin-top: -12px;
  margin-bottom: 10px;
}
.wms-menu-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #d0d7de;
  background: white;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
}
.wms-mobile .card {
  background: white;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(31,35,40,.04);
}
.wms-mobile .row-flex { display: flex; gap: 8px; align-items: center; }
.wms-mobile .row-flex > * { flex: 1; }

.wms-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 29;
  display: none;
}
.wms-overlay.is-open { display: block; }

.wms-side-menu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 260px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
  z-index: 30;
  transition: left 0.2s ease;
  padding: 14px 10px;
}
.wms-side-menu.is-open { left: 0; }
.wms-side-menu__head {
  font-weight: 700;
  color: #24292f;
  padding: 6px 10px 12px;
}
.wms-side-menu__item {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  padding: 10px;
}
.wms-side-menu__item:hover {
  background: #f6f8fa;
}

.wms-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.wms-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.wms-flow-step {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d8dee4;
  border-radius: 10px;
  padding: 10px;
}
.wms-flow-step__title {
  font-weight: 700;
}
.wms-flow-step__sub {
  color: #57606a;
  font-size: 12px;
}

.wms-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wms-kpi-grid--desktop .wms-kpi-card__value {
  font-size: 22px;
}
.wms-kpi-card {
  border: 1px solid #d8dee4;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}
.wms-kpi-card--wide {
  grid-column: 1 / -1;
}
.wms-kpi-card__label {
  font-size: 12px;
  color: #57606a;
}
.wms-kpi-card__value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}

.wms-desktop-dashboard {
  padding: 4px 2px;
}
.wms-desktop-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
}
.wms-desktop-card {
  border: 1px solid #d8dee4;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}
.wms-desktop-card__title {
  font-size: 14px;
  font-weight: 700;
}
.wms-desktop-flow-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.wms-desktop-flow-item {
  text-decoration: none;
  color: inherit;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  padding: 8px 10px;
  display: block;
}
.wms-desktop-flow-item:hover {
  background: #f6f8fa;
}
.wms-desktop-tip {
  margin-top: 8px;
  color: #57606a;
  font-size: 12px;
}
.wms-desktop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .wms-desktop-grid {
    grid-template-columns: 1fr;
  }
}

.wms-btn {
  display: block;
  width: 100%;
  min-height: var(--wms-touch);
  padding: 12px 16px;
  border-radius: 10px;
  border: 0;
  font-size: 16px;
  font-weight: 600;
  background: var(--wms-primary);
  color: white;
  cursor: pointer;
  text-align: center;
}
.wms-btn:hover, .wms-btn:focus { background: var(--wms-primary-dark); }
.wms-btn--secondary {
  background: white;
  color: var(--wms-primary);
  border: 1px solid var(--wms-primary);
}
.wms-btn--danger { background: var(--wms-danger); }
.wms-btn--success { background: var(--wms-success); }

.wms-input {
  width: 100%;
  min-height: var(--wms-touch);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #d0d7de;
  font-size: 18px;
  background: white;
}
.wms-input:focus {
  outline: 2px solid var(--wms-primary);
  outline-offset: -1px;
}

.wms-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-bottom: 1px solid #eaeef2;
  min-height: var(--wms-touch);
}
.wms-row:last-child { border-bottom: 0; }
.wms-row__title { font-weight: 600; }
.wms-row__sub { font-size: 12px; color: #57606a; }
.wms-row__qty { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 70px; text-align: right; }
.wms-row--done { background: #f0fbf2; }
.wms-row--current { background: #fff8e0; }

.wms-toolbar {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 10px;
  border-top: 1px solid #d0d7de;
  display: flex;
  gap: 8px;
}
.wms-toolbar > * { flex: 1; }

#wms-scanner-feedback {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--wms-success);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  z-index: 9999;
  display: none;
}
#wms-scanner-feedback.error { background: var(--wms-danger); }
#wms-scanner-feedback.warn  { background: var(--wms-warning); }

/* Modern desktop-like landing */
.wms-modern-page {
  min-height: 100vh;
  background: #1f1f22;
  color: #ececf1;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.wms-modern-sidebar {
  background: #26272d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 10px;
}
.wms-modern-brand {
  font-size: 28px;
  font-weight: 800;
  color: #b44cff;
  margin: 2px 8px 10px;
}
.wms-modern-nav-item {
  display: block;
  color: #f3f4f8;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 3px 0;
  font-size: 14px;
}
.wms-modern-nav-item:hover {
  background: rgba(180, 76, 255, 0.14);
}
.wms-modern-nav-item.is-active {
  background: linear-gradient(90deg, rgba(180, 76, 255, 0.45), rgba(93, 62, 255, 0.35));
}
.wms-modern-main {
  padding: 14px 24px 24px;
}
.wms-modern-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.wms-modern-menu-toggle {
  display: none;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #2b2c31;
  color: white;
  border-radius: 8px;
}
.wms-modern-user {
  font-size: 13px;
  color: #c9c9d3;
}
.wms-modern-hero {
  text-align: center;
  margin-top: 28px;
}
.wms-modern-hero h1 {
  margin: 0;
  font-size: 74px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 1px;
  color: #e8a3ff;
}
.wms-modern-hero p {
  margin: 12px 0 26px;
  font-size: 24px;
  color: #f4f5fb;
  letter-spacing: 0.12em;
}
.wms-modern-kpi-wrap {
  max-width: 980px;
  margin: 0 auto;
}
.wms-modern-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.wms-modern-kpi-card {
  background: #2a2b31;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}
.wms-modern-kpi-card--wide {
  grid-column: 1 / -1;
}
.wms-modern-kpi-label {
  color: #b8b8c8;
  font-size: 12px;
}
.wms-modern-kpi-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  color: #f4f5fb;
}

@media (max-width: 1024px) {
  .wms-modern-hero h1 { font-size: 56px; }
  .wms-modern-hero p { font-size: 18px; }
}

@media (max-width: 900px) {
  .wms-modern-page {
    grid-template-columns: 1fr;
  }
  .wms-modern-sidebar {
    position: fixed;
    left: -275px;
    top: 0;
    width: 260px;
    height: 100vh;
    z-index: 40;
    transition: left 0.2s ease;
  }
  .wms-modern-sidebar.is-open {
    left: 0;
  }
  .wms-modern-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .wms-modern-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .wms-modern-hero h1 {
    font-size: 42px;
  }
  .wms-modern-hero p {
    font-size: 14px;
  }
}
