/* ============================================================
   Garment QC — Frontend Design Tokens & Signature Components
   Grounded in the tech-pack / spec-sheet world: dimension lines,
   pattern-notch corners, and rubber-stamp status badges.

   Palette:
   --blueprint  #24405c  (chrome: top bar, bottom nav, primary actions)
   --paper      #eff1ee  (page background — cool, not cream)
   --ink        #1b2430  (primary text)
   --slate      #647482  (secondary text)
   --tape       #e2a63b  (signature accent — measuring-tape amber)
   --pass       #2f7d5c  (QC approved)
   --pending    #b7791f  (QC pending review)
   --flag       #b14a34  (QC rejected)
   --line       rgba(27,36,48,0.14)

   Type:
   Display  — 'Space Grotesk'   (technical, geometric, a little blueprint)
   Body     — 'IBM Plex Sans'   (built for technical/engineering contexts)
   Utility  — 'IBM Plex Mono'   (style numbers, measurements, callouts)
============================================================ */

:root {
  --blueprint: #24405c;
  --blueprint-deep: #182c40;
  --paper: #eff1ee;
  --card: #ffffff;
  --ink: #1b2430;
  --slate: #647482;
  --tape: #e2a63b;
  --pass: #2f7d5c;
  --pending: #b7791f;
  --flag: #b14a34;
  --line: rgba(27, 36, 48, 0.14);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #d8dbd6;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
}
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  margin: 0;
}
button,
input,
textarea,
select {
  font-family: inherit;
}
button {
  border: none;
  background: none;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Phone frame chrome ---------- */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.phone {
  width: 100%;
  max-width: 420px;
  height: 860px;
  max-height: 92vh;
  background: var(--paper);
  border-radius: 32px;
  box-shadow:
    0 30px 60px rgba(20, 28, 38, 0.35),
    0 0 0 10px #0e1116;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 26px;
  background: #0e1116;
  border-radius: 0 0 16px 16px;
  z-index: 40;
}
.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 86px;
}
.screen::-webkit-scrollbar {
  display: none;
}
@media (max-width: 480px) {
  .stage {
    padding: 0;
  }
  .phone {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .notch {
    display: none;
  }
}

/* ---------- Signature: dimension-line divider ---------- */
.dim-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 20px 16px;
}
.dim-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  position: relative;
}
.dim-line:first-child::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 1px;
  height: 7px;
  background: var(--tape);
}
.dim-line:last-child::after {
  content: "";
  position: absolute;
  top: -3px;
  right: 0;
  width: 1px;
  height: 7px;
  background: var(--tape);
}
.dim-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  white-space: nowrap;
}

/* ---------- Signature: pattern-notch card corner ---------- */
.notch-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.notch-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  width: 10px;
  height: 10px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}

/* ---------- Signature: QC stamp badge ---------- */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  transform: rotate(-2deg);
  background: rgba(255, 255, 255, 0.4);
}
.stamp.pass {
  color: var(--pass);
}
.stamp.pending {
  color: var(--pending);
}
.stamp.flag {
  color: var(--flag);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blueprint);
  color: #fff;
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar h1 {
  font-size: 1.1rem;
  color: #fff;
}
.topbar .sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: "IBM Plex Mono", monospace;
  margin-top: 2px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-btn.on-dark {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.icon-btn.on-light {
  background: var(--card);
  color: var(--blueprint);
  border: 1px solid var(--line);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tape);
  border: 2px solid var(--blueprint);
}

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 9px 8px 14px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #9aa5ab;
  padding: 4px 12px;
  border-radius: 8px;
}
.nav-item.active {
  color: var(--blueprint);
}
.nav-item svg {
  width: 20px;
  height: 20px;
}
.nav-item span {
  font-size: 0.6rem;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 20px 0;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 10px;
  text-align: left;
}
.stat-card .num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--blueprint);
  line-height: 1;
}
.stat-card .lbl {
  font-size: 0.62rem;
  color: var(--slate);
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

/* ---------- Card list (specs, activity, reports) ---------- */
.list-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  margin: 0 20px 10px;
}
.list-row .thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--blueprint);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
}
.list-row .body {
  flex: 1;
  min-width: 0;
}
.list-row .top-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.list-row h4 {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
}
.list-row .style-no {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  color: var(--slate);
  margin-top: 2px;
}
.list-row .meta-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.tag {
  font-size: 0.68rem;
  color: var(--slate);
  background: var(--paper);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "IBM Plex Mono", monospace;
}

/* ---------- Search + chips ---------- */
.search-bar {
  margin: 14px 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
}
.search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--slate);
  flex-shrink: 0;
}
.search-bar input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.86rem;
  width: 100%;
  color: var(--ink);
}
.chip-row {
  display: flex;
  gap: 8px;
  padding: 14px 20px 2px;
  overflow-x: auto;
}
.chip-row::-webkit-scrollbar {
  display: none;
}
.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--blueprint);
  font-family: "IBM Plex Mono", monospace;
}
.chip.active {
  background: var(--blueprint);
  color: #fff;
  border-color: var(--blueprint);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 13px 20px;
  border-radius: 8px;
  background: var(--blueprint);
  color: #fff;
  font-family: "IBM Plex Sans", sans-serif;
}
.btn.block {
  width: 100%;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn.accent {
  background: var(--tape);
  color: var(--blueprint-deep);
}
.btn.outline {
  background: transparent;
  color: var(--blueprint);
  border: 1.5px solid var(--blueprint);
}

/* ---------- Bottom sheet ---------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 38, 0.45);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  max-height: 82%;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0.35, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}
.sheet.open {
  transform: translateY(0);
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  margin: 12px auto 4px;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h3 {
  font-size: 1rem;
  color: var(--blueprint);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

/* ---------- Form fields ---------- */
.field {
  margin-bottom: 14px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 0.7rem;
  color: var(--slate);
  margin-bottom: 6px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font-size: 0.86rem;
  color: var(--ink);
  outline: none;
  background: var(--card);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--tape);
}
.field-row {
  display: flex;
  gap: 10px;
}
.field-row .field {
  flex: 1;
}

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  padding: 26px 16px;
  text-align: center;
  background: var(--card);
}
.dropzone svg {
  width: 30px;
  height: 30px;
  color: var(--slate);
  margin: 0 auto 10px;
}
.dropzone p {
  font-size: 0.8rem;
  color: var(--slate);
  margin: 0;
}
.dropzone .file-name {
  margin-top: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  color: var(--blueprint);
}

/* ---------- Empty state ---------- */
.empty-state {
  padding: 50px 24px;
  text-align: center;
}
.empty-state svg {
  width: 44px;
  height: 44px;
  color: var(--slate);
  margin: 0 auto 14px;
}
.empty-state h3 {
  font-size: 0.98rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 0.82rem;
  color: var(--slate);
}

/* ---------- Section label ---------- */
.section-label {
  padding: 18px 20px 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-label h2 {
  font-size: 0.98rem;
  color: var(--ink);
}
.section-label span,
.section-label a {
  font-size: 0.7rem;
  color: var(--slate);
  font-family: "IBM Plex Mono", monospace;
}
