/* ════════════════════════════════════════════════════════════
   Tarmal Portal v4 — FabricIQ-style theme
   Loaded AFTER erp.css: re-skins every old screen through the shared
   tokens, then styles the new shell, Home, Production, Lot, Products.
   ════════════════════════════════════════════════════════════ */
:root {
  /* zinc palette, light-blue page */
  --z-900:#18181b; --z-800:#27272a; --z-700:#3f3f46; --z-600:#52525b; --z-500:#71717a; --z-400:#a1a1aa;
  --z-300:#d4d4d8; --z-200:#e4e4e7; --z-100:#f4f4f5; --z-50:#fafafa;
  --page:#f5fafc;
  --blue:#2b8fd0; --blue-lt:#e8f4fb;
  --green:#16a34a; --green-lt:#e8f7ee;
  --amber:#d97706; --amber-lt:#fdf3e1;
  --red:#dc2626; --red-lt:#fdecec;
  --violet:#7c3aed; --violet-lt:#f1ebfd;
  --teal:#0d9488; --teal-lt:#e3f5f2;

  /* GarmentOS theme: denim primary + chalk highlight. --brand can be changed
     in Profile → Business profile → Theme colour (profile.js sets it inline). */
  --brand:#1b2747; --brand-2:#f0b429;
  --brand-hover:color-mix(in srgb, var(--brand) 82%, #000);
  --brand-lt:color-mix(in srgb, var(--brand) 9%, #fff);
  --card:#fff;

  /* old ERP tokens → new look */
  --ink:var(--z-900); --ink-2:var(--z-600); --ink-3:var(--z-500); --ink-4:var(--z-400);
  --rule:var(--z-200); --surface:var(--z-50); --white:var(--card);
  --accent:var(--brand); --accent-lt:var(--z-100); --accent-mid:var(--z-300);
  --ff-display:'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --ff-body:'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --rad-md:10px; --rad-lg:12px;
  --shadow-sm:0 1px 2px rgba(24,24,27,.04);
  --shadow-md:0 6px 18px rgba(24,24,27,.07);
  --shadow-lg:0 18px 40px rgba(24,24,27,.14);
  --card-border:0.8px solid rgba(212,212,216,.9);

  --st-CUTTING:#f59e0b; --st-STITCHING:#3b82f6; --st-WASHING:#14b8a6; --st-QC:#8b5cf6; --st-PACKING:#22c55e; --st-STOCK:#18181b; --st-extra:#ec4899;
}
body { background: var(--page); color: var(--z-900); font-family: var(--ff-body); }
.metric-value, .card-title, .topbar-title { font-family: var(--ff-body); }
th.num, td.num { text-align: right; }

/* ── OLD SCREENS, NEW SKIN ──────────────────────────────────── */
.card { border: var(--card-border); border-radius: 12px; box-shadow: none; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--z-100); }
.card-title { font-size: 14px; font-weight: 600; color: var(--z-500); text-transform: uppercase; letter-spacing: .35px; }
.metric-card { border: var(--card-border); border-radius: 12px; box-shadow: none; padding: 14px 16px; }
.metric-label { font-size: 10px; font-weight: 600; color: var(--z-400); letter-spacing: .25px; }
.metric-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.metric-accent { color: var(--z-900); }
.metric-amber { color: var(--amber); }
thead th { background: var(--z-50); color: var(--z-500); font-size: 11px; font-weight: 600; letter-spacing: .3px; border-bottom: 1px solid var(--z-100); }
tbody td { border-bottom: 1px solid var(--z-100); }
tbody tr:hover td { background: var(--z-50); }
.btn { border-radius: 10px; border-color: var(--z-200); font-weight: 600; font-size: 13px; color: var(--z-800); }
.btn:hover { background: var(--z-100); border-color: var(--z-300); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-danger { background: var(--red-lt); color: var(--red); border-color: #f6c9c9; }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.form-input { border-radius: 10px; border-color: var(--z-200); }
.form-input:focus { border-color: var(--z-400); box-shadow: 0 0 0 3px rgba(161,161,170,.18); }
.form-label { color: var(--z-500); font-weight: 600; }
.badge { font-weight: 600; }
.badge-green { background: var(--green-lt); color: var(--green); }
.badge-amber { background: var(--amber-lt); color: var(--amber); }
.badge-red { background: var(--red-lt); color: var(--red); }
.badge-blue { background: var(--blue-lt); color: var(--blue); }
.badge-gray { background: var(--z-100); color: var(--z-600); }
.tabs .tab.active { color: var(--z-900); border-bottom-color: var(--z-900); }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar { background: var(--card); width: 236px; border-right: 1px solid var(--z-200); }
.sb-brand { display: flex; align-items: center; gap: 8px; padding: 16px 16px 12px; }
.sb-brand .mark { width: 26px; height: 26px; border-radius: 7px; background: #000; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.sb-brand .name { font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--z-900); }
.sb-org { display: flex; align-items: center; gap: 10px; margin: 0 12px 6px; padding: 10px 8px; border-bottom: 1px solid var(--z-100); }
.sb-org svg { width: 16px; height: 16px; color: var(--z-600); flex-shrink: 0; }
.sb-org .o1 { font-size: 12.5px; font-weight: 700; color: var(--z-900); line-height: 1.2; }
.sb-org .o2 { font-size: 11px; color: var(--z-400); }
.nav-section-label { color: var(--z-400); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; padding: 14px 18px 4px; }
.nav-item { margin: 1px 10px; padding: 8px 10px; border-radius: 8px; border-left: none !important; font-size: 14px; font-weight: 500; color: var(--z-600); }
.nav-item:hover { background: var(--z-100); color: var(--z-900); }
.nav-item.active { background: var(--z-100); color: var(--z-900); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; opacity: .8; }
.nav-group-head .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.nav-group.closed .nav-group-head .chev { transform: rotate(-90deg); }
.nav-group.closed .nav-group-body { display: none; }
.nav-group-body { margin: 2px 0 4px 27px; border-left: 1px solid var(--z-200); padding-left: 2px; }
.nav-group-body .nav-item { font-size: 13px; padding: 6px 10px; margin: 1px 8px 1px 4px; }
.sidebar-bottom { border-top: 1px solid var(--z-100); padding: 12px 14px; display: flex; align-items: center; gap: 10px; color: var(--z-500); }
.sidebar-bottom .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar-bottom .side-user { display: flex; flex-direction: column; min-width: 0; }
.sidebar-bottom .side-user strong { color: var(--z-900); font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-bottom .side-user a { font-size: 11.5px; color: var(--z-500); cursor: pointer; }
.sidebar-bottom .side-user a:hover { color: var(--z-900); }
.sidebar-bottom .icon-btn { margin-left: auto; }
.sidebar-close-btn { background: var(--z-100); color: var(--z-900); }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.main { background: var(--page); }
.topbar { margin: 12px 20px 0; height: 56px; padding: 0 14px 0 16px; border: none; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(24,24,27,.04); gap: 12px; }
.topbar-search { position: relative; flex: 1; max-width: 340px; }
.topbar-search input { width: 100%; border: none; background: var(--z-100); border-radius: 99px; padding: 9px 14px 9px 36px; font-size: 13px; outline: none; color: var(--z-900); }
.topbar-search input::placeholder { color: var(--z-400); }
.topbar-search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--z-400); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--card); border: var(--card-border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 360px; overflow-y: auto; display: none; }
.search-results.open { display: block; }
.search-results .sr-item { padding: 9px 14px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.search-results .sr-item:hover { background: var(--z-50); }
.search-results .sr-type { font-size: 11px; color: var(--z-400); }
.topbar-right { gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; display: grid; place-items: center; color: var(--z-600); }
.icon-btn:hover { background: var(--z-100); color: var(--z-900); }
.icon-btn svg { width: 18px; height: 18px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--z-200); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-chip .uc-name { font-size: 13px; font-weight: 700; line-height: 1.15; }
.user-chip .uc-role { font-size: 11px; color: var(--z-400); }
.content { padding: 20px 20px 48px; }

/* ── SHARED BUILDING BLOCKS ─────────────────────────────────── */
.fx-card { background: var(--card); border: var(--card-border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.fx-card.flush { padding: 0; overflow: hidden; }
.fx-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.fx-h2 { font-size: 14px; font-weight: 600; color: var(--z-500); text-transform: uppercase; letter-spacing: .35px; }
.fx-sub { font-size: 12px; color: var(--z-400); margin-bottom: 12px; }
.fx-link { font-size: 12.5px; font-weight: 700; color: var(--z-900); cursor: pointer; white-space: nowrap; }
.fx-link:hover { text-decoration: underline; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--z-900); }
.page-head .ph-sub { font-size: 13px; color: var(--z-500); margin-top: 3px; max-width: 520px; }
.pill-tabs { display: inline-flex; gap: 2px; background: var(--card); border: 0.8px solid rgba(228,228,231,.9); border-radius: 16px; padding: 6px; flex-wrap: wrap; }
.pill-tabs button { border: none; background: transparent; padding: 6px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--z-600); }
.pill-tabs button:hover { color: var(--z-900); }
.pill-tabs button.active { background: var(--brand); color: #fff; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--brand); color: #fff; border-radius: 99px; padding: 8px 16px; font-size: 13px; font-weight: 700; }
.pill-btn:hover { background: var(--z-800); }
.pill-btn svg { width: 15px; height: 15px; }
.pill-btn.ghost { background: var(--z-100); color: var(--z-900); }
.pill-btn.ghost:hover { background: var(--z-200); }
.pill-btn.sm { padding: 6px 13px; font-size: 12.5px; }
.seg { display: inline-flex; background: var(--z-100); border-radius: 99px; padding: 3px; }
.seg button { border: none; background: transparent; border-radius: 99px; padding: 5px 13px; font-size: 12.5px; font-weight: 700; color: var(--z-600); }
.seg button.active { background: var(--card); color: var(--z-900); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; }
.tag.ok { background: var(--green-lt); color: var(--green); }
.tag.def { background: var(--red); color: #fff; }
.tag.due { background: var(--amber-lt); color: var(--amber); }
.tag.risk { background: var(--red-lt); color: var(--red); }
.tag.info { background: var(--blue-lt); color: var(--blue); }

/* KPI grid (Home): 4 columns, hairline dividers */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; overflow: hidden; }
.kpi-cell { padding: 14px 16px; border-right: 1px solid var(--z-100); border-bottom: 1px solid var(--z-100); cursor: pointer; display: block; }
.kpi-cell:hover { background: var(--z-50); }
.kpi-cell .k-l { font-size: 10px; font-weight: 600; color: var(--z-400); text-transform: uppercase; letter-spacing: .25px; }
.kpi-cell .k-v { font-size: 20px; font-weight: 700; margin-top: 6px; color: var(--z-900); letter-spacing: -.02em; }
.k-v.red { color: var(--red); } .k-v.green { color: var(--green); } .k-v.blue { color: var(--blue); } .k-v.amber { color: var(--amber); }

/* Icon tiles (Production) */
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: var(--card-border); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.tile .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--z-100); color: var(--z-700); flex-shrink: 0; }
.tile .ti svg { width: 15px; height: 15px; }
.tile .tl { font-size: 9.5px; font-weight: 600; color: var(--z-400); text-transform: uppercase; letter-spacing: .25px; }
.tile .tv { font-size: 17px; font-weight: 700; line-height: 1.2; }
.tile.red .ti { background: var(--red-lt); color: var(--red); } .tile.red .tv { color: var(--red); }
.tile.amber .ti { background: var(--amber-lt); color: var(--amber); } .tile.amber .tv { color: var(--amber); }
.tile.blue .ti { background: var(--blue-lt); color: var(--blue); } .tile.blue .tv { color: var(--blue); }
.tile.green .ti { background: var(--green-lt); color: var(--green); } .tile.green .tv { color: var(--green); }

/* Stage dots / chips */
.sdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--st-extra); margin-right: 6px; vertical-align: 1px; }
.stage-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--z-100); color: var(--z-700); white-space: nowrap; letter-spacing: .2px; }
.stage-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stage-line .arrow { color: var(--z-300); font-size: 12px; }
.kind-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; padding: 3px 9px; border-radius: 99px; border: 1px solid #f5d39b; color: #b45309; background: #fffaf0; }
.kind-tag.warehouse { border-color: #a7e3bd; color: #15803d; background: #f0fbf4; }

/* ── HOME ───────────────────────────────────────────────────── */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.home-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.home-head .ph-sub { font-size: 13px; color: var(--z-500); margin-top: 4px; max-width: 360px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.home-grid > .fx-card { margin-bottom: 16px; }
.trend-svg { width: 100%; height: auto; display: block; }
.mix { display: flex; gap: 6px; align-items: flex-end; height: 150px; padding-top: 4px; }
.mix-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.mix-col .mv { font-size: 12px; font-weight: 700; }
.mix-col .mbar { flex: 1; width: 100%; background: var(--z-100); border-radius: 4px; position: relative; overflow: hidden; }
.mix-col .mbar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px; }
.mix-col .ml { font-size: 10px; font-weight: 600; color: var(--z-500); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.need-list { list-style: none; }
.need-list li a { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--z-100); cursor: pointer; }
.need-list li:last-child a { border-bottom: none; }
.need-list .n-main { font-size: 15px; font-weight: 500; color: var(--z-800); }
.need-list .n-sub { font-size: 12px; color: var(--z-400); }
.need-list .n-right { margin-left: auto; font-size: 13px; color: var(--z-500); text-align: right; }

/* ── STAGE BOARD (Home + Production) ────────────────────────── */
.sboard { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.scol { background: rgba(250,250,250,.9); border-radius: 12px; padding: 10px; box-shadow: inset 0 0 0 1px rgba(228,228,231,.9); min-height: 180px; }
.scol-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.scol-head .cnt { color: var(--z-500); }
.scol-sub { font-size: 10.5px; color: var(--z-400); margin: 2px 0 8px; }
.scol-empty { font-size: 10px; font-weight: 500; color: rgba(161,161,170,.9); text-align: center; padding: 24px 2px; }
.bcard { background: var(--card); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; border: 0.8px solid var(--z-200); border-left: 3px solid var(--sc, var(--z-300)); transition: box-shadow .15s; }
.bcard:hover { box-shadow: var(--shadow-md); }
.bcard .b-no { font-size: 11.5px; font-weight: 800; letter-spacing: -.01em; }
.bcard .b-meta { font-size: 10.5px; color: var(--z-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard .b-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.bcard .b-pcs { font-size: 15px; font-weight: 800; }
.bcard .b-age { font-size: 10.5px; color: var(--z-400); }
.bcard .b-age.late { color: var(--red); font-weight: 700; }

/* ── PRODUCTION ─────────────────────────────────────────────── */
.stagebar { margin-bottom: 10px; }
.stagebar .sb-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.stagebar .sb-top span { font-size: 12px; color: var(--z-400); font-weight: 500; }
.stagebar .sb-top b { color: var(--z-900); font-size: 13px; margin-right: 2px; }
.stagebar .sb-track { height: 6px; border-radius: 99px; background: var(--z-100); overflow: hidden; }
.stagebar .sb-track i { display: block; height: 100%; border-radius: 99px; }
.prod-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-toolbar h3 { font-size: 17px; font-weight: 700; margin-right: 4px; }
.prod-toolbar .count { font-size: 12px; color: var(--z-400); font-weight: 500; margin-right: auto; }
.filter-box { background: var(--z-50); border-radius: 12px; padding: 12px; display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.filter-box .form-input { width: auto; min-width: 150px; padding: 7px 10px; font-size: 13px; background: var(--card); }
.lot-row { background: var(--card); border: var(--card-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.lot-row-top { display: flex; gap: 12px; align-items: flex-start; }
.lot-row-top .thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--z-100); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; border: 1px solid var(--z-200); }
.lot-row-top .lr-no { font-size: 16px; font-weight: 800; cursor: pointer; }
.lot-row-top .lr-meta { font-size: 13px; color: var(--z-500); margin-top: 2px; }
.lot-row-top .lr-meta .def { color: var(--red); font-weight: 700; }
.lot-row-top .lr-tags { margin-left: auto; display: flex; gap: 6px; }
.lot-row .lr-stages { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0 50px; }
.lot-row .lr-stage { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--z-100); color: var(--z-700); font-weight: 600; }
.lot-row .lr-actions { display: flex; gap: 8px; margin: 12px 0 0 50px; flex-wrap: wrap; }
.btn-black { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 700; }
.btn-black:hover { background: var(--z-800); }
.btn-soft { background: var(--z-100); color: var(--z-900); border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.btn-soft:hover { background: var(--z-200); }
.btn-soft.red { background: var(--red-lt); color: var(--red); }

/* ── LOT (BATCH) PAGE ───────────────────────────────────────── */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--z-800); cursor: pointer; margin-bottom: 14px; }
.back-link:hover { color: #000; }
.lot-label { font-size: 11px; font-weight: 800; letter-spacing: .6px; color: var(--z-500); text-transform: uppercase; }
.lot-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.lot-metaline { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13.5px; color: var(--z-500); flex-wrap: wrap; }
.lot-metaline img, .lot-metaline .ph { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; background: var(--z-100); display: grid; place-items: center; border: 1px solid var(--z-200); font-size: 15px; }
.lot-metaline b { color: var(--z-900); font-weight: 700; }
.lot-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.lot-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--z-100); border-bottom: 1px solid var(--z-100); margin: 18px -20px 0; }
.lot-kpis > div { padding: 12px 20px; border-right: 1px solid var(--z-100); }
.lot-kpis > div:last-child { border-right: none; }
.lot-kpis .k-l { font-size: 10px; font-weight: 600; color: var(--z-400); text-transform: uppercase; letter-spacing: .25px; }
.lot-kpis .k-v { font-size: 19px; font-weight: 700; margin-top: 4px; }
.variant-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.variant-chips span { font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--z-200); color: var(--z-600); background: var(--card); }
.variant-chips b { color: var(--z-900); margin: 0 3px; }
.variant-chips em { color: var(--red); font-style: normal; font-weight: 600; }
.flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.flow-head h3 { font-size: 15px; font-weight: 700; }
.flow-head .fh-sub { font-size: 12px; color: var(--z-500); margin-top: 2px; }
.flow-eq { font-size: 13px; color: var(--z-500); }
.flow-eq b { color: var(--z-900); } .flow-eq .g { color: var(--green); font-weight: 700; } .flow-eq .r { color: var(--red); font-weight: 700; }
.flow-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--z-100); margin: 12px 0 8px; }
.flow-bar i { display: block; height: 100%; }
.flow-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--z-500); flex-wrap: wrap; margin-bottom: 14px; }
.flow-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.stage-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 170px); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.scard { border-radius: 12px; border: 1px solid var(--z-200); background: var(--card); padding: 10px; font-size: 12px; }
.scard.current { border: 2px solid var(--z-400); box-shadow: var(--shadow-md); }
.scard .sc-name { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 8px; }
.scard .sc-vis { height: 62px; border-radius: 6px; background: var(--z-100); position: relative; overflow: hidden; margin-bottom: 8px; }
.scard .sc-vis i { position: absolute; left: 0; right: 0; bottom: 0; }
.scard .sc-vis u { position: absolute; left: 0; right: 0; bottom: 0; background: var(--red); text-decoration: none; }
.scard .sc-r { display: flex; justify-content: space-between; padding: 4px 2px; border-top: 1px solid var(--z-100); color: var(--z-600); }
.scard .sc-r b { color: var(--z-900); }
.scard .sc-r.red b { color: var(--red); }
.scard .sc-sub { display: flex; justify-content: space-between; padding: 0 2px 3px 10px; font-size: 10.5px; color: var(--z-400); }
.scard .sc-sub.red { color: var(--red); }
.lot-tabs { display: flex; gap: 4px; margin: 18px 0 14px; flex-wrap: wrap; }
.lot-tabs button { border: none; background: transparent; padding: 9px 22px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--z-600); }
.lot-tabs button.active { background: var(--brand); color: #fff; }
.lot-tabs button .n { font-size: 11px; background: var(--z-100); color: var(--z-600); border-radius: 99px; padding: 1px 6px; margin-left: 4px; }
.lot-tabs button.active .n { background: rgba(255,255,255,.2); color: #fff; }
.panel-title { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--z-700); }
.panel-desc { font-size: 12.5px; color: var(--z-500); margin: 4px 0 10px; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 7px 10px; text-align: center; border-bottom: 1px solid var(--z-100); }
.matrix th { font-size: 11px; color: var(--z-500); text-transform: uppercase; letter-spacing: .05em; background: var(--z-50); }
.matrix td.pn, .matrix th.pn { text-align: left; white-space: nowrap; }
.matrix td.pn .pn-wrap { display: flex; align-items: center; gap: 8px; }
.matrix td.pn img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; border: 1px solid var(--z-200); cursor: pointer; }
.matrix td.tot, .matrix th.tot { font-weight: 700; background: var(--z-50); }
.matrix td.zero { color: var(--z-300); }
.matrix tr.foot td { font-weight: 700; background: var(--z-50); }
.matrix input { width: 64px; padding: 5px 6px; text-align: center; border: 1px solid var(--z-200); border-radius: 7px; font-size: 13px; }
.matrix input:focus { outline: none; border-color: var(--z-500); }
.matrix .max-hint { display: block; font-size: 10.5px; color: var(--z-400); margin-top: 2px; }
/* stock count: difference badge under each box */
.sc-d { display: inline-block; margin-top: 2px; font-size: 11px; font-weight: 800; padding: 0 6px; border-radius: 99px; line-height: 17px; }
.sc-d.p { background: var(--green-lt); color: var(--green); }
.sc-d.m { background: var(--red-lt, #fde8e8); color: var(--red); }
.sc-d.ok { color: var(--green); }
.sc-matrix td { vertical-align: top; }
.matrix input.over { border-color: var(--red); background: var(--red-lt); }

/* ── STAGES SCREEN ──────────────────────────────────────────── */
.stages-table .form-input { max-width: 280px; padding: 7px 10px; }
.stages-table .key { font-weight: 700; letter-spacing: .02em; }
.stages-table .locked { font-size: 11px; color: var(--z-400); font-weight: 500; }
.stage-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.add-room-row { display: flex; gap: 10px; padding: 14px 18px; flex-wrap: wrap; }
.add-room-row .form-input { flex: 1; min-width: 180px; }

/* ── PRODUCTS ───────────────────────────────────────────────── */
.prod-table td { vertical-align: middle; }
.prod-table .pt-photo { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--z-100); display: grid; place-items: center; border: 1px solid var(--z-200); font-size: 18px; }
.prod-table .pt-name { font-weight: 700; cursor: pointer; }
.prod-table .pt-name:hover { text-decoration: underline; }
.row-menu { position: relative; display: inline-block; }
.row-menu-list { position: absolute; right: 0; top: 34px; background: var(--card); border: var(--card-border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 170px; z-index: 30; display: none; padding: 4px; }
.row-menu.open .row-menu-list { display: block; }
.row-menu-list button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--z-800); }
.row-menu-list button:hover { background: var(--z-100); }
.photo-drop { width: 140px; height: 140px; border: 1.5px dashed var(--z-300); border-radius: 14px; display: grid; place-items: center; cursor: pointer; overflow: hidden; background: var(--z-50); color: var(--z-500); font-size: 12px; text-align: center; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.lot-product-pick { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--z-200); border-radius: 12px; background: var(--z-50); }
.lot-product-pick img, .lot-product-pick .ph { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--card); display: grid; place-items: center; border: 1px solid var(--z-200); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.prod-card { background: var(--card); border: var(--card-border); border-radius: 12px; overflow: hidden; cursor: pointer; }
.prod-card:hover { box-shadow: var(--shadow-md); }
.prod-card .pc-img { aspect-ratio: 16/10; background: var(--z-100); display: grid; place-items: center; font-size: 30px; }
.prod-card .pc-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-card .pc-body { padding: 10px 12px; }
.prod-card .pc-code { font-size: 10.5px; font-weight: 700; color: var(--z-400); letter-spacing: .05em; }
.prod-card .pc-name { font-size: 14px; font-weight: 700; margin-top: 2px; }
.lot-card-thumbs { display: flex; gap: 4px; }
.lot-card-thumbs img, .lot-card-thumbs span { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; border: 1px solid var(--z-200); background: var(--z-50); display: grid; place-items: center; font-size: 10px; color: var(--z-500); }
.ph { display: grid; place-items: center; }

/* ── MODAL ──────────────────────────────────────────────────── */
.pm-overlay { position: fixed; inset: 0; background: rgba(24,24,27,.42); z-index: 1000; display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.pm-overlay.open { display: flex; }
.pm-card { background: var(--card); border-radius: 16px; width: 100%; max-width: 760px; box-shadow: var(--shadow-lg); }
.pm-card.narrow { max-width: 480px; }
.pm-head { padding: 16px 20px; border-bottom: 1px solid var(--z-100); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pm-title { font-size: 16px; font-weight: 700; }
.pm-sub { font-size: 12px; color: var(--z-500); margin-top: 2px; }
.pm-body { padding: 18px 20px; max-height: 64vh; overflow: auto; }
.pm-foot { padding: 14px 20px; border-top: 1px solid var(--z-100); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.pm-foot .pm-total { margin-right: auto; font-size: 13px; font-weight: 700; }
.pm-close { border: none; background: var(--z-100); width: 30px; height: 30px; border-radius: 50%; font-size: 14px; }

/* ── CAMERA SCANNER ─────────────────────────────────────── */
#cam-overlay { position: fixed; inset: 0; z-index: 1200; background: #0b0b0d; color: #fff; display: none; flex-direction: column; }
#cam-overlay.open { display: flex; }
.cam-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px calc(10px); padding-top: calc(14px + env(safe-area-inset-top)); }
.cam-title { font-size: 17px; font-weight: 800; }
.cam-sub { font-size: 12.5px; opacity: .7; margin-top: 2px; }
.cam-x { width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; }
#cam-reader { flex: 1; min-height: 0; width: 100%; max-width: 760px; margin: 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#cam-reader video { width: 100% !important; height: auto !important; max-height: 100%; object-fit: cover; border-radius: 14px; }
#cam-reader img[alt="Info icon"], #cam-reader #qr-shaded-region ~ div { display: none !important; }
.cam-feedback { margin: 10px 16px 0; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 14px; text-align: center; min-height: 46px; }
.cam-feedback.ok { background: rgba(22,163,74,.25); color: #bbf7d0; }
.cam-feedback.bad { background: rgba(220,38,38,.25); color: #fecaca; }
.cam-feedback b { color: #fff; }
.cam-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.cam-btn { border: none; border-radius: 99px; padding: 11px 16px; font-size: 14px; font-weight: 700; background: rgba(255,255,255,.14); color: #fff; }
.cam-btn.cam-done { background: var(--card); color: #000; }
.cam-launch { display: inline-flex; align-items: center; gap: 6px; }

.setup-note { padding: 14px 18px; background: var(--amber-lt); color: #92400e; border: 1px solid #f5d9a8; border-radius: 12px; font-size: 13px; margin-bottom: 16px; }
.setup-note code { background: var(--card); padding: 1px 6px; border-radius: 4px; }
.mobile-header { background: var(--card); border-bottom: 1px solid var(--z-200); }
.mobile-header-title { color: var(--z-900); }
.hamburger-btn span { background: var(--z-900); }

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; }
  .lot-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lot-kpis > div:nth-child(3n) { border-right: none; }
  .lot-kpis > div { border-bottom: 1px solid var(--z-100); }
}
@media (max-width: 768px) {
  .topbar { margin: 8px 10px 0; height: auto; padding: 8px 10px; }
  .topbar-search { max-width: none; }
  .user-chip .uc-text, .topbar .hide-sm { display: none; }
  .content { padding: 14px 12px 40px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot-row .lr-stages, .lot-row .lr-actions { margin-left: 0; }
  .matrix { min-width: 0; }
}

/* ── LOOM (AI assistant) ───────────────────────────────────── */
#screen-loom.active { display: block; }
.loom { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 520px; background: var(--card); border: 1px solid var(--z-200); border-radius: 14px; overflow: hidden; }
.loom-side { border-right: 1px solid var(--z-100); display: flex; flex-direction: column; min-height: 0; background: var(--z-50); }
.loom-brand, .loom-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; }
.loom-brand div div, .loom-live { font-size: 11.5px; color: var(--z-500); }
.loom-live { color: var(--green); }
.loom-ico { width: 30px; height: 30px; border-radius: 9px; background: #0f172a; color: #7dd3fc; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.loom-ico.big { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; margin: 0 auto 10px; }
.loom-new { margin: 0 12px 10px; padding: 9px; border-radius: 10px; border: 1px solid var(--z-200); background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; }
.loom-new:hover { border-color: var(--z-900); }
.loom-list { overflow: auto; padding: 0 8px 10px; flex: 1; }
.loom-item { position: relative; padding: 8px 28px 8px 10px; border-radius: 9px; cursor: pointer; margin-bottom: 2px; }
.loom-item:hover, .loom-item.on { background: var(--card); box-shadow: 0 0 0 1px var(--z-200); }
.loom-item .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loom-item .d { font-size: 11px; color: var(--z-400); }
.loom-item .x { position: absolute; right: 8px; top: 9px; font-size: 11px; color: var(--z-400); display: none; }
.loom-item:hover .x { display: block; }
.loom-empty-list { font-size: 12px; color: var(--z-400); padding: 8px 10px; }
.loom-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.loom-head { border-bottom: 1px solid var(--z-100); }
.loom-thread { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.loom-hello { margin: auto; text-align: center; max-width: 560px; }
.loom-hello h2 { margin: 0 0 6px; }
.loom-hello p { color: var(--z-500); font-size: 13.5px; margin: 0 0 16px; }
.loom-sugg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; text-align: left; }
.loom-sugg button { display: flex; gap: 8px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--z-200); border-radius: 11px; background: var(--card); font-size: 13px; cursor: pointer; line-height: 1.35; }
.loom-sugg button:hover { border-color: var(--z-900); }
.loom-msg { display: flex; }
.loom-msg.me { justify-content: flex-end; }
.loom-msg .b { max-width: min(760px, 88%); padding: 10px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.loom-msg.me .b { background: #0f172a; color: #fff; border-bottom-right-radius: 4px; }
.loom-msg.ai .b { background: var(--z-50); border: 1px solid var(--z-100); border-bottom-left-radius: 4px; }
.loom-msg.ai p { margin: 0 0 6px; } .loom-msg.ai p:last-child { margin-bottom: 0; }
.loom-msg.ai ul, .loom-msg.ai ol { margin: 4px 0 6px 18px; padding: 0; }
.loom-msg.ai code { background: var(--card); border: 1px solid var(--z-200); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.loom-h { font-weight: 800; margin: 6px 0 4px; }
.loom-tbl { overflow-x: auto; margin: 6px 0; }
.loom-tbl table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.loom-tbl th, .loom-tbl td { border: 1px solid var(--z-200); padding: 5px 8px; text-align: left; white-space: nowrap; }
.loom-tbl th { background: var(--card); font-weight: 700; }
.loom-tool { font-size: 11.5px; color: var(--z-400); padding-left: 4px; }
.loom-err { font-size: 13px; color: var(--red); background: #fdecec; border: 1px solid #f5c2c2; border-radius: 10px; padding: 9px 12px; }
.loom-typing { display: flex; gap: 4px; }
.loom-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--z-400); animation: loomdot 1s infinite ease-in-out; }
.loom-typing i:nth-child(2) { animation-delay: .15s; } .loom-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes loomdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.loom-input { display: flex; gap: 8px; align-items: flex-end; margin: 0 16px; padding: 8px 8px 8px 14px; border: 1px solid var(--z-200); border-radius: 14px; }
.loom-input:focus-within { border-color: var(--z-900); }
.loom-input textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; font-size: 14px; padding: 6px 0; max-height: 140px; background: transparent; }
.loom-input button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #0f172a; color: #fff; cursor: pointer; }
.loom-input button:disabled { opacity: .4; cursor: default; }
.loom-foot { font-size: 11px; color: var(--z-400); text-align: center; padding: 6px 0 10px; }
@media (max-width: 760px) {
  .loom { grid-template-columns: 1fr; height: calc(100vh - 90px); }
  .loom-side { display: none; }
  .loom-sugg { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .loom-typing i { animation: none; } }

/* ── PHONES — everything usable at 360–430 px ─────────────────
   Wide tables / size grids scroll sideways inside their own box (never
   cut off, never the whole page); modals become full-screen sheets with
   the buttons always visible; inputs at 16 px so iPhones don't zoom. */
.m-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
@media (max-width: 768px) {
  .content { overflow-x: hidden; }
  .card, .fx-card { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table-wrap, .m-scroll { -webkit-overflow-scrolling: touch; }
  .table-wrap > table th, .table-wrap > table td { white-space: nowrap; }
  .card-header > div, .card-header .flex { flex-wrap: wrap; }
  .kpi-grid, .lot-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .kpi-grid > *, .lot-kpis > * { min-width: 0; overflow-wrap: anywhere; }
  .pm-body [style*="grid-column:span"], .content [style*="grid-column:span"], .pm-body [style*="grid-column: span"] { grid-column: 1 / -1 !important; }
  .stage-row { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; overflow-x: visible; }
  .print-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .seg { max-width: 100%; flex-wrap: wrap; border-radius: 16px; }
  .seg button { white-space: nowrap; }
  .bit-breakdown-table th, .bit-breakdown-table td, .bit-grand-table th, .bit-grand-table td { padding: 6px 7px; white-space: nowrap; }

  input.form-input, select.form-input, textarea.form-input, .form-input, .form-select, .form-textarea { font-size: 16px; }

  .pm-overlay { padding: 0; align-items: stretch; }
  .pm-card, .pm-card.narrow { max-width: none; border-radius: 0; min-height: 100%; display: flex; flex-direction: column; }
  .pm-head { position: sticky; top: 0; background: var(--card); z-index: 2; padding: 12px 14px; }
  .pm-body { max-height: none; flex: 1; padding: 14px; overflow-x: auto; }
  .pm-foot { position: sticky; bottom: 0; background: var(--card); z-index: 2; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .pm-close { width: 36px; height: 36px; }

  .dispatch-modal { padding: 0; align-items: stretch; }
  .dispatch-modal-card { max-width: none; max-height: none; border-radius: 0; }
}
/* list tables as cards (labels set by mobileCardTables in portal.js) */
@media (max-width: 600px) {
  .table-wrap > table.m-cards { min-width: 0 !important; width: 100% !important; display: block; border: 0; }
  table.m-cards td input:not([type=checkbox]):not([type=radio]), table.m-cards td select { max-width: 62%; }
  table.m-cards td input[data-lf="desc"], table.m-cards td input[data-lf="sizes"] { width: 62% !important; }
  table.m-cards thead { display: none; }
  table.m-cards tbody, table.m-cards tfoot { display: block; }
  table.m-cards tr { display: block; border: 1px solid var(--z-200); border-radius: 12px; margin: 0 0 10px; padding: 6px 12px; background: var(--card); }
  table.m-cards tfoot tr { background: var(--z-50); }
  table.m-cards td, .table-wrap > table.m-cards td { display: block; padding: 7px 0; border: 0; border-bottom: 1px dashed var(--z-100); text-align: right; white-space: normal; min-height: 0; width: auto !important; overflow-wrap: anywhere; }
  table.m-cards td::after { content: ""; display: table; clear: both; }
  table.m-cards td:last-child { border-bottom: 0; }
  table.m-cards td::before { content: attr(data-label); float: left; margin-right: 12px; padding-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--z-500); text-align: left; max-width: 42%; }
  table.m-cards td[data-label=""] { text-align: left; }
  table.m-cards td[data-label=""]::before { display: none; }
  table.m-cards td:empty { display: none; }
  table.m-cards td > .flex, table.m-cards td > div[style*="flex"] { justify-content: flex-end; flex-wrap: wrap; }
  table.m-cards td > .row-menu { margin-top: 4px; }
  table.m-cards td img { max-width: 64px; max-height: 64px; }
  .card > .table-wrap, .fx-card > .table-wrap { padding: 10px; }
}

/* ════════════════════════════════════════════════════════════
   MY PROFILE (profile.js) — header chip "Edit profile" + profile page
   ════════════════════════════════════════════════════════════ */
.user-chip { cursor: pointer; text-decoration: none; color: inherit; border-radius: 99px; padding: 2px 8px 2px 12px; transition: background .15s; }
.user-chip:hover { background: var(--z-100); }
.uc-photo { position: relative; flex-shrink: 0; }
.user-chip .avatar, .sidebar-bottom .avatar { background: var(--brand, var(--blue)); overflow: hidden; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.12); }
.avatar.has-photo { background: var(--z-100); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uc-edit { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(24,24,27,0); opacity: 0; transition: .15s; }
.uc-edit svg { width: 15px; height: 15px; }
.user-chip:hover .uc-edit { background: rgba(24,24,27,.45); opacity: 1; }
.uc-sub { position: relative; height: 14px; overflow: hidden; min-width: 90px; max-width: 176px; }
.uc-sub > span { position: absolute; inset: 0; font-size: 11px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.user-chip .uc-sub .uc-role { color: var(--z-400); }
.uc-hover { color: var(--blue); font-weight: 600; opacity: 0; }
.user-chip:hover .uc-role { opacity: 0; }
.user-chip:hover .uc-hover { opacity: 1; }
.uc-name { max-width: 176px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand .mark.has-logo { background: transparent; width: 30px; height: 30px; }
.sb-brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

#screen-profile { max-width: 900px; }
.pf-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.pf-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.pf-head p { color: var(--z-500); font-size: 14px; margin: 4px 0 14px; }
.pf-head p.pf-sub { font-size: 12.5px; margin-top: -10px; }
.pf-card { padding: 22px; margin-bottom: 14px; }
.pf-me, .pf-biz-top { display: flex; gap: 26px; align-items: flex-start; }
.pf-biz-top { margin-bottom: 4px; }
.pf-photo-col { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; width: 150px; }
.pf-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--brand, var(--blue)); color: #fff; display: grid; place-items: center; font-size: 36px; font-weight: 800; overflow: hidden; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-photo-btn { cursor: pointer; }
.pf-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pf-who { font-size: 12.5px; color: var(--z-500); margin: 2px 0 12px; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-biz-actions { border-top: 1px solid var(--z-200); margin-top: 16px; padding-top: 16px; }
.pf-note { font-size: 11.5px; color: var(--z-500); text-align: left; }
.pf-photo-col .pf-note { text-align: center; }
.pf-drop { width: 120px; height: 120px; border: 1.5px dashed var(--z-300); border-radius: 12px; display: grid; place-items: center; text-align: center; font-size: 12.5px; color: var(--z-500); cursor: pointer; overflow: hidden; background: var(--card); }
.pf-drop:hover { border-color: var(--z-500); }
.pf-drop img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pf-drop.pf-sign { width: 240px; height: 80px; }
.pf-color { display: flex; gap: 8px; }
.pf-color input[type=color] { width: 48px; height: 40px; padding: 3px; border: 1px solid var(--z-200); border-radius: 10px; background: var(--card); cursor: pointer; flex-shrink: 0; }
.pf-color .form-input { font-family: ui-monospace, monospace; }
.pf-section { font-size: 15px; font-weight: 800; margin: 18px 0 8px; padding-top: 16px; border-top: 1px solid var(--z-200); }
.pf-card > .pf-section:first-child { border-top: 0; padding-top: 0; }
.pf-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-prev { display: flex; gap: 12px; align-items: center; border: 1px solid var(--z-200); border-top: 4px solid #000; border-radius: 12px; padding: 14px; }
.pf-prev b { font-size: 16px; }
.pf-prev div div { font-size: 12px; color: var(--z-500); }
.pf-prev-logo { width: 38px; height: 38px; border-radius: 9px; background: #000; color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex-shrink: 0; }
.pf-prev-logo img { width: 100%; height: 100%; object-fit: contain; background: var(--card); }
.pf-signout { justify-content: center; }
@media (max-width: 768px) {
  .pf-me, .pf-biz-top { flex-direction: column; align-items: stretch; }
  .pf-photo-col { width: auto; }
  .pf-biz-top .pf-photo-col { align-items: flex-start; }
  .pf-grid3 { grid-template-columns: minmax(0, 1fr); }
  .user-chip { padding: 2px; }
}

/* ════════════════════════════════════════════════════════════
   GARMENTOS THEME — sidebar logo, theme colour, light / dark mode
   ════════════════════════════════════════════════════════════ */
.sb-brand .gos-mark { width: 30px; height: 30px; flex-shrink: 0; display: block; }
.sb-brand .name, .gos-word { font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--z-900); }
.sb-brand .name span, .gos-word span { color: #d99a12; }
.pf-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pf-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--z-300); cursor: pointer; padding: 0; }
.pf-swatch.on { box-shadow: 0 0 0 2px var(--z-900); }
#theme-toggle .ic-sun { display: none; }
[data-theme="dark"] #theme-toggle .ic-sun { display: block; }
[data-theme="dark"] #theme-toggle .ic-moon { display: none; }

/* dark mode = the same zinc scale turned around + dark surfaces */
[data-theme="dark"] {
  color-scheme: dark;
  --z-900:#f4f4f5; --z-800:#e4e4e7; --z-700:#d4d4d8; --z-600:#a1a1aa; --z-500:#8e8e98; --z-400:#71717a;
  --z-300:#45454d; --z-200:#2f2f35; --z-100:#25252a; --z-50:#1d1d21;
  --page:#0e0f12; --card:#17171b;
  --blue-lt:#10283a; --green-lt:#10301d; --amber-lt:#352611; --red-lt:#3b1616; --violet-lt:#2a1f45; --teal-lt:#0e2f2b;
  --brand-lt:color-mix(in srgb, var(--brand) 28%, #17171b);
  --card-border:0.8px solid #2f2f35;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4); --shadow-md:0 6px 18px rgba(0,0,0,.45); --shadow-lg:0 18px 40px rgba(0,0,0,.6);
}
[data-theme="dark"] body { background: var(--page); color: var(--z-900); }
[data-theme="dark"] .form-input, [data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background-color: var(--z-50); color: var(--z-900); border-color: var(--z-200); }
[data-theme="dark"] .btn { background-color: var(--z-100); color: var(--z-800); }
[data-theme="dark"] .btn:hover { background-color: var(--z-200); }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-primary:hover { color: #fff; background-color: color-mix(in srgb, var(--brand) 80%, #fff 20%); border-color: transparent; }
[data-theme="dark"] .btn-danger { background-color: var(--red-lt); color: #fca5a5; }
[data-theme="dark"] .pill-tabs button.active, [data-theme="dark"] .lot-tabs button.active, [data-theme="dark"] .pill-btn, [data-theme="dark"] .btn-black { background: color-mix(in srgb, var(--brand) 80%, #fff 20%); }
[data-theme="dark"] .toast-info { background: var(--z-200); }
[data-theme="dark"] .sidebar, [data-theme="dark"] .topbar, [data-theme="dark"] .mobile-header { background: var(--card); border-color: var(--z-200); }
[data-theme="dark"] .pm-card, [data-theme="dark"] .modal, [data-theme="dark"] .search-results { background: var(--card); color: var(--z-900); }
[data-theme="dark"] img { opacity: .96; }
[data-theme="dark"] .scol { background: var(--z-50); box-shadow: inset 0 0 0 1px var(--z-200); }
[data-theme="dark"] .kind-tag { background: var(--amber-lt); border-color: #6b4a14; color: #fbbf24; }
[data-theme="dark"] .kind-tag.warehouse { background: var(--green-lt); border-color: #1f5c38; color: #4ade80; }
/* WhatsApp inbox: WhatsApp's own dark colours */
[data-theme="dark"] #screen-whatsapp { --wa-line:#2a3942; --wa-text:#e9edef; --wa-muted:#8696a0; --wa-out:#005c4b; --wa-chat:#0b141a; --wa-warn:#3a2f0b; }
[data-theme="dark"] .wa-usage { background: var(--z-50); }
[data-theme="dark"] .wa-usage.over { background: var(--red-lt); }
[data-theme="dark"] #wa-search { background: var(--z-100); color: var(--z-900); }

/* ── USAGE page (usage.js) — FabricIQ "Billing" look ─────────── */
#screen-usage { max-width: 1000px; }
.us-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.us-grid .fx-card { margin-bottom: 0; }
#us-limits { margin-top: 16px; }
.us-pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--green-lt); color: var(--green); white-space: nowrap; }
.us-pill.warn { background: var(--amber-lt); color: var(--amber); }
.us-pill.over { background: var(--red-lt); color: var(--red); }
.us-pill.info { background: var(--blue-lt); color: var(--blue); }
.us-big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 10px; color: var(--z-900); }
.us-big small { font-size: 16px; font-weight: 500; color: var(--z-400); letter-spacing: 0; }
.us-bar { height: 10px; border-radius: 99px; background: var(--z-200); overflow: hidden; margin-bottom: 16px; }
.us-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.us-bar.warn i { background: var(--amber); } .us-bar.over i { background: var(--red); }
.us-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; padding-top: 14px; border-top: 1px solid var(--z-100); }
.us-stats.us-stats3 { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; padding-top: 0; }
.us-stat { background: var(--z-50); border-radius: 10px; padding: 8px 12px; }
.us-stat span { display: block; font-size: 12.5px; color: var(--z-500); }
.us-stat b { font-size: 16px; font-weight: 700; }
.us-box { background: var(--z-50); border: 1px solid var(--z-100); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.us-box-h { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--z-500); margin-bottom: 4px; }
.us-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; color: var(--z-600); }
.us-row b { font-weight: 500; color: var(--z-900); text-align: right; }
.us-row b.us-ok { color: var(--green); } .us-row b.us-warn { color: var(--amber); } .us-row b.us-muted { color: var(--z-400); }
.us-row code { font-size: 12px; }
.us-table { width: 100%; font-size: 13px; margin: 6px 0; }
.us-table th, .us-table td { padding: 6px 8px; }
.us-empty { font-size: 13px; color: var(--z-500); margin: 8px 0; }
.us-notes { margin: 10px 0 12px 16px; font-size: 12px; color: var(--z-500); line-height: 1.55; }
@media (max-width: 768px) {
  .us-grid { grid-template-columns: minmax(0, 1fr); }
  .us-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .us-stats.us-stats3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── LOTS list (Bit Register) — clean FabricIQ-style rows ────── */
.bit-reg-table.br-list { table-layout: auto; min-width: 860px; }
.br-list thead th { background: var(--z-50); color: var(--z-500); font-size: 11.5px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--z-200); white-space: nowrap; border-radius: 0 !important; }
.br-list tbody tr, .br-list tbody tr:nth-child(even) { background: var(--card); }
.br-list tbody tr:hover, .br-list tbody tr:hover td { background: var(--z-50); }
.br-list td { padding: 12px 14px; border-bottom: 1px solid var(--z-100); vertical-align: middle; font-size: 13.5px; }
.br-list th.num, .br-list td.num { text-align: right !important; white-space: nowrap; }
.br-lot { white-space: nowrap; }
.br-lotno { font-weight: 700; font-size: 14px; color: var(--z-900); cursor: pointer; }
.br-lotno:hover { color: var(--brand); text-decoration: underline; }
.br-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--z-500); }
.br-meta .badge { font-size: 10.5px; padding: 2px 8px; }
.br-style { min-width: 200px; max-width: 340px; }
.br-name { font-weight: 600; color: var(--z-800); line-height: 1.3; }
.br-sub { font-size: 11.5px; color: var(--z-400); margin-top: 2px; font-weight: 500; }
.br-qty { font-size: 15px; font-weight: 700; color: var(--z-900); }
.br-muted { color: var(--z-300); }
.br-good { color: var(--green); font-weight: 700; } .br-warn { color: var(--amber); font-weight: 700; } .br-bad { color: var(--red); font-weight: 700; }
.br-list .bit-row-actions { align-items: center; }
.br-list .row-menu > .btn { padding-left: 10px; padding-right: 10px; }
@media (max-width: 600px) {
  .bit-reg-table.br-list.m-cards { min-width: 0 !important; width: 100%; table-layout: auto; }
  .br-list.m-cards .br-style { min-width: 0; max-width: none; }
  .br-list.m-cards .bit-row-actions { justify-content: flex-end; }
}

/* ════════════════════════════════════════════════════════════
   LOGIN — "Sign in to GarmentOS" (FabricIQ layout, GarmentOS colours)
   Visible from the first paint; .checking shows "Opening GarmentOS…"
   until core.js has checked the saved login.
   ════════════════════════════════════════════════════════════ */
#login-screen.lg-screen, .lg-screen { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto;
  background: radial-gradient(1100px 520px at 12% -10%, rgba(27,39,71,.10), transparent 60%), radial-gradient(900px 480px at 100% 110%, rgba(240,180,41,.16), transparent 60%), #f5f8fc;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif; color: #18181b; }
.lg-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid #e4e7ee; border-radius: 16px; padding: 34px 32px 22px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 18px 48px rgba(27,39,71,.10); text-align: center; }
.lg-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.lg-mark { width: 40px; height: 40px; display: block; }
.lg-word { font-family: 'Archivo', 'Plus Jakarta Sans', system-ui, sans-serif; font-stretch: 125%; font-size: 25px; font-weight: 800; letter-spacing: -.02em; color: #1b2747; }
.lg-word span { color: #d99a12; }
.lg-title { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 0; color: #18181b; }
.lg-sub { font-size: 14px; color: #6b7280; margin: 6px 0 24px; }
.lg-checking { display: none; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: #6b7280; padding: 26px 0 30px; }
.lg-card.checking .lg-checking { display: flex; }
.lg-card.checking .lg-form { display: none; }
.lg-form { text-align: left; }
.lg-field { margin-bottom: 14px; }
.lg-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.lg-field input { width: 100%; box-sizing: border-box; height: 46px; border: 1px solid #d6dbe4; border-radius: 10px; padding: 0 14px; font: inherit; font-size: 15px; color: #18181b; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.lg-field input:focus { border-color: #1b2747; box-shadow: 0 0 0 4px rgba(27,39,71,.12); }
.lg-pass { position: relative; }
.lg-pass input { padding-right: 46px; }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: #9ca3af; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.lg-eye:hover, .lg-eye.on { color: #1b2747; background: #f1f4f9; }
.lg-eye svg { width: 18px; height: 18px; }
.lg-btn { width: 100%; height: 48px; margin-top: 6px; border: 0; border-radius: 10px; background: #1b2747; color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(27,39,71,.22); transition: background .15s, transform .05s; }
.lg-btn:hover { background: #24345e; }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:disabled { opacity: .65; cursor: wait; }
.lg-err { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: #b42318; font-size: 13px; line-height: 1.45; }
.lg-link { margin-top: 12px; font-size: 13px; color: #4b5563; text-align: center; }
.lg-link a { color: #1b2747; font-weight: 700; cursor: pointer; text-decoration: underline; }
.lg-help { margin-top: 18px; font-size: 13px; color: #6b7280; text-align: center; }
.lg-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid #f0f2f6; font-size: 12px; color: #9ca3af; }
.lg-foot a { color: #6b7280; text-decoration: none; }
.lg-foot a:hover { color: #1b2747; text-decoration: underline; }
@media (max-width: 480px) { .lg-card { padding: 28px 20px 18px; } .lg-title { font-size: 21px; } }
/* dark mode */
[data-theme="dark"] #login-screen.lg-screen { background: radial-gradient(1100px 520px at 12% -10%, rgba(240,180,41,.08), transparent 60%), #0e0f12; color: #f4f4f5; }
[data-theme="dark"] .lg-card { background: #17171b; border-color: #2f2f35; box-shadow: 0 18px 48px rgba(0,0,0,.5); }
[data-theme="dark"] .lg-word, [data-theme="dark"] .lg-title { color: #f4f4f5; }
[data-theme="dark"] .lg-field label { color: #d4d4d8; }
[data-theme="dark"] .lg-field input { background: #1d1d21; border-color: #2f2f35; color: #f4f4f5; }
[data-theme="dark"] .lg-btn { background: #3b4f86; }
[data-theme="dark"] .lg-foot { border-color: #25252a; }

/* wide popup (Packing check sheet) */
.pm-card.wide { max-width: 1100px; }

/* ── APP: "Install GarmentOS" banner (js/app.js) + installed-app tweaks ── */
.app-install { display: flex; align-items: center; gap: 12px; background: var(--card); border: var(--card-border); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.app-install img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.app-install .ai-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.app-install .ai-text span { color: var(--z-500); font-size: 12.5px; }
.app-install .ai-share { display: inline-block; padding: 0 4px; border: 1px solid var(--z-300); border-radius: 4px; font-size: 11px; }
.app-install .ai-close { border: 0; background: transparent; color: var(--z-400); font-size: 15px; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.app-install .ai-close:hover { background: var(--z-100); color: var(--z-900); }
/* installed app: respect the phone's notch / gesture bar */
.is-app .mobile-header { padding-top: env(safe-area-inset-top); }
.is-app .content { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }

/* ════════════════════════════════════════════════════════════
   EXPORT SHIPMENTS (js/shipments.js)
   ════════════════════════════════════════════════════════════ */
.ship-sub { font-size: 13.5px; color: var(--z-500); margin: 2px 0 12px; }
.ship-kinds { font-size: 11.5px; color: var(--z-500); margin-top: 2px; }
.lot-kpis .k-v small { font-size: 12px; color: var(--z-500); font-weight: 600; }
.ship-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
.ship-info div span, .ship-notes span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--z-400); }
.ship-info div b { font-size: 14px; font-weight: 600; color: var(--z-900); }
.ship-notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--z-100); font-size: 14px; white-space: pre-wrap; }
.ship-carton.ship-focus { box-shadow: 0 0 0 3px var(--brand-2); }
.ship-c-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: var(--z-900); }
.ship-c-title span { font-size: 13px; font-weight: 600; color: var(--z-400); }
.ship-c-meta { font-size: 12.5px; color: var(--z-500); margin-top: 2px; }
.ship-c-pcs { font-size: 13px; color: var(--z-500); white-space: nowrap; }
.ship-c-pcs b { font-size: 20px; color: var(--z-900); }
.ship-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--z-100); }
.ship-item img, .ship-noimg { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--z-100); display: grid; place-items: center; font-size: 26px; cursor: zoom-in; }
.ship-item-main { flex: 1; min-width: 0; }
.ship-item-name { font-weight: 700; font-size: 14.5px; color: var(--z-900); }
.ship-item-sub { font-size: 12px; color: var(--z-500); margin-top: 1px; }
.ship-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ship-sizes span { background: var(--z-100); border-radius: 8px; padding: 3px 9px; font-size: 13px; }
.ship-item-pcs { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 70px; }
.ship-item-pcs b { font-size: 20px; line-height: 1; }
.ship-item-pcs span { font-size: 11px; color: var(--z-500); }
.ship-item-pcs em { font-style: normal; font-size: 12px; color: var(--z-600); text-align: right; }
.ship-sum td, .ship-sum th { white-space: nowrap; }
.ship-sum .pn-wrap img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
/* edit */
.ship-prices { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--z-100); flex-wrap: wrap; }
.ship-switch { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
/* shipment types: Tarmal (from stock) / Indenting (typed items + commission) */
.ship-type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ship-type { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; border: 1.5px solid var(--z-200); border-radius: 12px; background: var(--card); color: var(--z-900); cursor: pointer; font: inherit; }
.ship-type:hover { border-color: var(--brand); background: var(--brand-lt); }
.ship-type b { font-size: 15px; }
.ship-type small { font-size: 12.5px; color: var(--z-500); line-height: 1.45; }
.ship-type-ic { font-size: 26px; }
@media (max-width: 600px) { .ship-type-pick { grid-template-columns: 1fr; } }
.ship-comm-box b { font-size: 14px; }
.ship-comm-note { font-size: 12px; color: var(--z-500); }
.ship-item-pcs em.ship-comm { color: var(--brand); font-weight: 600; }
.ship-photo { cursor: pointer; flex-shrink: 0; }
.ship-photo img, .ship-photo .ship-noimg { cursor: pointer; }
.ship-br { display: block; }   /* line break between "rate / pc" and the amount (inline " = " on phones) */
.ship-pcs-tot { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ship-pcs-tot b { font-size: 20px; line-height: 1; }
.ship-pcs-tot span { font-size: 11px; color: var(--z-500); }
.ship-unit { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--z-500); }
.ship-unit span { margin-right: 4px; }
.ship-unit button { font: inherit; font-weight: 600; padding: 3px 12px; border-radius: 99px; border: 1px solid var(--z-200); background: var(--card); color: var(--z-600); cursor: pointer; }
.ship-unit button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ship-indent-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
@media (max-width: 768px) { .ship-indent-row { grid-template-columns: 1fr; } }
.ship-kind { width: auto; font-weight: 700; padding-top: 6px; padding-bottom: 6px; }
.ship-c-fields { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0 4px; }
.ship-c-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--z-500); }
.ship-small { width: 92px; }
.ship-dims { display: flex; gap: 4px; }
.ship-dims .ship-small { width: 70px; }
.ship-marks { flex: 1; min-width: 180px; }
.ship-size-in { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ship-size-in label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--z-600); }
.ship-size-in input { width: 64px; text-align: center; padding: 6px 4px; }
.ship-size-in input.over { border-color: var(--red); background: var(--red-lt); }
.ship-size-in small { font-size: 10.5px; font-weight: 500; color: var(--z-400); }
.ship-size-in small.neg { color: var(--red); }
.ship-rate { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--z-500); }
.ship-rate input { width: 90px; padding: 5px 8px; }
.ship-c-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--z-100); font-size: 13px; color: var(--z-500); }
.ship-addrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.ship-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: var(--card-border); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-md); margin-bottom: 8px; }
.ship-tot { font-size: 13.5px; color: var(--z-600); }
.ship-pick-list { margin-top: 10px; max-height: 55vh; overflow-y: auto; }
.ship-pick { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--z-100); }
.ship-pick img, .ship-pick .ship-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; font-size: 18px; }
@media (max-width: 768px) {
  .ship-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ship-item img, .ship-noimg { width: 52px; height: 52px; }
}
/* ── shipments on phones: nothing wider than the screen, one tidy column ── */
@media (max-width: 600px) {
  /* header form: short fields side by side */
  .form-grid.ship-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 10px; }   /* beats erp.css one-column rule */
  .ship-form > .form-group { grid-column: 1 / -1; }
  .ship-form > .form-group.ship-half { grid-column: auto; }
  .ship-form .form-input { min-width: 0; }
  .ship-comm-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  .ship-comm-box b, .ship-comm-box .btn, .ship-comm-box .ship-comm-note { grid-column: 1 / -1; }
  .ship-comm-box input { width: 100% !important; }
  /* carton head + fields */
  .ship-carton .fx-head { flex-wrap: wrap; gap: 8px; }
  .ship-c-title { font-size: 16px; }
  .ship-c-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .ship-c-fields label { min-width: 0; }
  .ship-c-fields .ship-small { width: 100%; }
  .ship-c-fields label:nth-child(3), .ship-marks { grid-column: 1 / -1; }
  .ship-dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ship-dims .ship-small { width: 100%; }
  /* item: photo + text on top, numbers on a row underneath */
  .ship-item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .ship-item > img, .ship-item > .ship-noimg, .ship-photo { grid-column: 1; }
  .ship-item-pcs { grid-column: 1 / -1; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 4px 10px; text-align: left;
    background: var(--z-50, #fafafa); border-radius: 10px; padding: 8px 10px; }
  .ship-item-pcs em { text-align: left; }
  .ship-br { display: inline !important; }
  .ship-br::before { content: " = "; }
  .ship-item-pcs em::before { content: "· "; color: var(--z-400); }
  .ship-item.edit .ship-item-pcs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 8px; }
  .ship-pcs-tot { align-items: flex-start; gap: 2px; }
  .ship-pcs-tot b { font-size: 22px; }
  .ship-item.edit .ship-rate { min-width: 0; }
  .ship-item.edit .ship-rate input { width: 100%; }
  .ship-item.edit .ship-item-pcs .btn-danger { grid-column: 1 / -1; justify-self: end; }
  .ship-size-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px; }
  .ship-size-in label { min-width: 0; }
  .ship-size-in input { width: 100%; }
  .ship-size-in > .ship-comm-note { grid-column: 1 / -1; }
  .ship-c-foot { flex-wrap: wrap; }
  .ship-addrow .btn { flex: 1; }
  /* save bar: totals on one small line, buttons full width */
  .ship-savebar { padding: 8px 10px; gap: 6px; border-radius: 12px 12px 0 0; margin: 0 -4px; }
  .ship-tot { font-size: 12px; width: 100%; line-height: 1.4; }
  .ship-savebar > div:last-child { width: 100%; }
  .ship-savebar > div:last-child .btn, .ship-comm-box .btn { flex: 1; justify-content: center; text-align: center; }
  /* view page */
  .ship-c-pcs b { font-size: 17px; }
  .ship-sizes span { font-size: 12.5px; padding: 3px 8px; }
}

/* ── LOT COSTING SHEET (costsheet.js) ── */
.cs-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--amber-lt); color: var(--amber); margin-left: 4px; vertical-align: middle; }
.cs-chip.ok { background: var(--green-lt); color: var(--green); }
.cs-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--amber-lt); border: 1px solid #f3d29a; color: #7c4a03; border-radius: 12px; padding: 12px 16px; margin: 4px 0 14px; font-size: 13.5px; }
.cs-banner-miss { font-size: 12px; margin-top: 3px; opacity: .85; }
[data-theme="dark"] .cs-banner { border-color: #6b4a14; color: #fbbf24; }
.cs-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-status .cs-chip { font-size: 12.5px; padding: 4px 12px; margin: 0; }
.cs-missing { font-size: 12.5px; color: var(--z-500); }
.cs-table { width: 100%; }
.cs-table td { vertical-align: middle; padding: 6px 8px; }
.cs-table tr.done .cs-name { color: var(--green); }
.cs-name { font-weight: 700; white-space: nowrap; width: 130px; }
.cs-amt { width: 140px; }
.cs-na { white-space: nowrap; font-size: 13px; }
.cs-na label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cs-ok { width: 28px; color: var(--green); font-weight: 800; text-align: center; }
.cs-hint { font-size: 11.5px; color: var(--z-500); margin-top: 3px; white-space: nowrap; }
.cs-hint a { color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; }
.cs-other-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 6px; }
.cs-none { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cs-empty { font-size: 12.5px; color: var(--z-400); text-align: center; padding: 12px; }
.cs-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cs-sum div { background: var(--z-50); border: 1px solid var(--z-100); border-radius: 10px; padding: 10px 14px; }
.cs-sum span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--z-500); }
.cs-sum b { font-size: 18px; }
.cs-sum em { display: block; font-style: normal; font-size: 11px; color: var(--z-400); }
.cs-upd { font-size: 11.5px; color: var(--z-400); margin-top: 10px; }
.cs-foot-total { margin-right: auto; font-size: 13.5px; }
/* per-piece sheet (2026-11-04): "₹ … / pc" boxes, fabric = weight × ₹/kg */
.cs-inp-u { display: inline-flex; align-items: center; gap: 5px; }
.cs-inp-u em { font-style: normal; font-size: 12px; color: var(--z-500); white-space: nowrap; }
.cs-fab { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.cs-fab label { display: flex; flex-direction: column; gap: 3px; }
.cs-fab label > span:first-child { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--z-500); }
.cs-fab .form-input { width: 96px; }
.cs-fab .cs-amt { width: 110px; font-weight: 700; }
.cs-x { font-size: 16px; font-weight: 700; color: var(--z-400); padding-bottom: 8px; }
.cs-table .cs-hint { white-space: normal; }
@media (max-width: 600px) { .cs-sum { grid-template-columns: minmax(0, 1fr); } .cs-amt { width: 96px; } .cs-table th:nth-child(3), .cs-table td:nth-child(3) { display: none; } .cs-fab .form-input { width: 84px; } }

/* ── WHERE ARE LOTS (lotlocation.js) ── */
.ll-av { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.ll-big { font-size: 20px; font-weight: 800; color: var(--z-900); }
.ll-big small { font-size: 12px; font-weight: 600; color: var(--z-500); }
.ll-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ll-chip { display: inline-flex; gap: 4px; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: var(--z-100); color: var(--z-700); white-space: nowrap; }
.ll-chip.out { background: color-mix(in srgb, var(--brand) 12%, var(--card)); color: var(--z-900); }
.ll-chip.late { background: color-mix(in srgb, var(--red) 14%, var(--card)); color: var(--red); }
@media (max-width: 768px) { #screen-lot-location .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .ll-chip { white-space: normal; } }

/* ── Lot route (stages picked in the lot form, js/routes.js) ── */
.route-line { padding: 12px 14px; border: 1px solid var(--z-200); border-radius: 12px; background: var(--z-50); gap: 8px; }
.route-line .arrow { font-size: 18px; font-weight: 700; color: var(--z-400); }
.route-stage { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--z-200); border-radius: 999px; padding: 3px 8px; }
.route-mv a { cursor: pointer; font-weight: 800; color: var(--z-500); padding: 0 3px; user-select: none; }
.route-mv a:hover { color: var(--z-900); }
.route-preset { border-style: dashed; }
.route-preset.active { border-style: solid; }

/* ══ BUYER PROGRAMMES (programmes.js) ═══════════════════════ */
.mod-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.mod-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.mod-sub { font-size: 12.5px; color: var(--z-500); line-height: 1.55; margin-top: 3px; }
.prog-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.prog-card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.prog-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.prog-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--z-100); height: 92px; position: relative; }
.prog-thumbs span { position: relative; overflow: hidden; }
.prog-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prog-thumbs span.no img { opacity: .35; filter: grayscale(1); }
.prog-thumbs span i { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; font-style: normal; font-size: 11px; display: grid; place-items: center; }
.prog-thumbs em { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.prog-noprint { grid-column: 1 / -1; display: grid; place-items: center; font-size: 12px; color: var(--z-400); }
.prog-card-body { padding: 12px 14px 13px; }
.prog-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.prog-card-top b { font-size: 15px; line-height: 1.3; }
.prog-card-top .badge { flex: none; }
.prog-card-meta { font-size: 12px; color: var(--z-500); margin-top: 3px; }
.prog-card-qty { display: flex; gap: 10px; align-items: baseline; margin-top: 9px; flex-wrap: wrap; }
.prog-card-qty b { font-size: 16px; }
.prog-card-qty span { font-size: 12px; color: var(--z-600); }
.prog-card-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--z-500); flex-wrap: wrap; }
.prog-todo { color: var(--brand); font-weight: 800; }
[data-theme="dark"] .prog-todo { color: var(--brand-2); }

.pf-ratio { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.pf-ratio label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--z-600); text-align: center; }
.pf-ratio input { text-align: center; }
.pf-plan { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; margin: 2px 0 12px; }
.pf-plan-head { font-size: 13px; color: var(--z-700); }
.pf-plan-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pf-plan-sizes span { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 4px 9px; display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.pf-plan-sizes small { font-size: 10.5px; color: var(--z-500); font-weight: 700; }
.pf-plan-note { font-size: 12.5px; color: var(--z-600); margin: -4px 0 10px; }

.prog-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.prog-actions label.btn { cursor: pointer; }
.prog-steps { display: flex; gap: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.prog-steps > div { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--z-400); position: relative; }
.prog-steps > div + div::before { content: ''; flex: 0 0 18px; height: 2px; background: var(--rule); margin-right: 4px; }
.prog-steps span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--z-100); color: var(--z-500); font-size: 12px; flex: none; }
.prog-steps .done { color: var(--z-800); }
.prog-steps .done span { background: var(--green); color: #fff; }
.prog-steps .cur { color: var(--z-900); }
.prog-steps .cur span { background: var(--brand); color: #fff; }
.prog-banner { background: var(--amber-lt); color: var(--z-800); border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-bottom: 14px; }
.prog-banner.blue { background: var(--blue-lt); }
.prog-banner.green { background: var(--green-lt); }
.prog-cols { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.prog-plan { padding: 6px 18px 16px; }
.prog-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.prog-kpis div { background: var(--surface); border-radius: 10px; padding: 9px 10px; }
.prog-kpis small, .prog-notes small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--z-500); }
.prog-kpis b { font-size: 17px; }
.prog-kpis em { display: block; font-style: normal; font-size: 11.5px; color: var(--z-500); }
.prog-size-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prog-size-table th, .prog-size-table td { border: 1px solid var(--rule); padding: 6px 4px; text-align: center; }
.prog-size-table th:first-child, .prog-size-table td:first-child { text-align: left; color: var(--z-500); font-weight: 600; padding-left: 8px; }
.prog-size-table th { background: var(--surface); font-weight: 700; }
.prog-notes { margin-top: 12px; font-size: 13px; line-height: 1.5; }
.prog-counts { display: flex; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--z-500); margin-left: auto; }
.prog-counts .y { color: var(--green); }
.prog-counts .n { color: var(--red); }
.prog-prints { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 4px 18px 18px; }
.prog-print { border: 2px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--card); }
.prog-print.yes { border-color: var(--green); }
.prog-print.no { opacity: .55; }
.prog-print-img { position: relative; aspect-ratio: 3 / 4; background: var(--z-100); cursor: pointer; }
.prog-print-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-tag { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; color: #fff; }
.pp-tag.y { background: var(--green); }
.pp-tag.n { background: var(--red); }
.pp-tag.new { background: var(--amber); }
.prog-print-name { font-size: 12.5px; font-weight: 600; padding: 7px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-print-edit { display: flex; gap: 4px; padding: 6px; }
.prog-print-edit .form-input { padding: 5px 8px; font-size: 12.5px; min-width: 0; }
.prog-tip { font-size: 12px; color: var(--z-500); padding: 0 18px 14px; }

/* swipe screen */
#prog-swipe { position: fixed; inset: 0; z-index: 1300; background: #0e1424; color: #fff; display: none; flex-direction: column; user-select: none; }
#prog-swipe.open { display: flex; }
.sw-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.sw-head > div { flex: 1; min-width: 0; }
.sw-head b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-head small { font-size: 12px; opacity: .7; }
.sw-x { width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; cursor: pointer; }
.sw-sel { background: var(--green); padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 800; }
.sw-stack { flex: 1; position: relative; margin: 4px auto 0; width: min(92vw, 420px); }
.sw-card { position: absolute; inset: 0 0 10px; border-radius: 18px; overflow: hidden; background: #1c2440; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transform: translateY(calc(var(--k) * 10px)) scale(calc(1 - var(--k) * .04)); transition: transform .25s ease; touch-action: none; }
.sw-card.top { cursor: grab; }
.sw-card.top:active { cursor: grabbing; }
.sw-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.sw-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.sw-cap b { font-size: 18px; display: block; }
.sw-cap small { font-size: 12px; opacity: .8; }
.sw-stamp { position: absolute; top: 26px; font-size: 26px; font-weight: 900; letter-spacing: .08em; padding: 4px 12px; border: 4px solid; border-radius: 10px; opacity: 0; }
.sw-stamp.yes { left: 20px; color: #22c55e; transform: rotate(-14deg); }
.sw-stamp.no { right: 20px; color: #ef4444; transform: rotate(14deg); }
.sw-btns { display: flex; justify-content: center; align-items: center; gap: 22px; padding: 16px 0 6px; }
.sw-btn { width: 66px; height: 66px; border-radius: 50%; border: none; font-size: 28px; font-weight: 800; cursor: pointer; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.sw-btn.no { color: #ef4444; }
.sw-btn.yes { color: #16a34a; }
.sw-btn.undo { width: 46px; height: 46px; font-size: 20px; color: #f0b429; }
.sw-btn:disabled { opacity: .35; cursor: default; }
.sw-btn:active:not(:disabled) { transform: scale(.92); }
.sw-hint { text-align: center; font-size: 12px; opacity: .6; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.sw-done { flex: 1; overflow-y: auto; text-align: center; padding: 20px 18px 30px; }
.sw-done-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--green); display: grid; place-items: center; font-size: 30px; margin: 10px auto 12px; }
.sw-done h2 { font-size: 21px; margin: 0 0 6px; color: #fff; }
.sw-done p { opacity: .75; font-size: 13.5px; margin: 0 0 16px; }
.sw-done-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-width: 520px; margin: 0 auto 18px; }
.sw-done-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 2px solid var(--green); }
.sw-done-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* notification bell */
.notif-wrap { position: relative; }
.notif-wrap .icon-btn { position: relative; }
.notif-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; display: none; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); z-index: 900; display: none; overflow: hidden; }
.notif-panel.open { display: block; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.np-head button { border: none; background: none; color: var(--blue); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.np-list { max-height: 420px; overflow-y: auto; }
.np-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 13px; }
.np-item:hover { background: var(--surface); }
.np-item b { display: block; font-size: 13px; }
.np-item span { display: block; color: var(--z-600); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.np-item small { display: block; color: var(--z-400); font-size: 11px; margin-top: 3px; }
.np-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.np-item.unread .np-dot { background: var(--blue); }
.np-item.unread b { color: var(--z-900); }
.np-empty { padding: 26px; text-align: center; color: var(--z-400); font-size: 13px; }

@media (max-width: 768px) {
  .prog-cols { grid-template-columns: minmax(0, 1fr); }
  .prog-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prog-actions { justify-content: flex-start; width: 100%; }
  .prog-steps { padding: 10px; }
  .prog-steps > div { flex-direction: column; gap: 4px; font-size: 10.5px; text-align: center; }
  .prog-steps > div + div::before { display: none; }
  .prog-prints { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 4px 12px 14px; }
  .prog-grid { grid-template-columns: minmax(0, 1fr); }
  .prog-plan { padding: 6px 12px 14px; }
  .prog-kpis b { font-size: 14.5px; white-space: nowrap; }
  .notif-panel { position: fixed; top: 58px; right: 12px; left: 12px; width: auto; }
}

/* ══ QTY ROWS — move / stock / defect / give work / take back (qtyRowsHtml in floor.js) ══ */
.qr-list { display: flex; flex-direction: column; gap: 10px; }
.qr-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "print sizes" "unit sizes"; gap: 6px 14px; align-items: start; border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; background: var(--card); }
.qr-print { grid-area: print; display: flex; gap: 10px; align-items: center; min-width: 0; }
.qr-print img, .qr-noimg { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; flex: none; background: var(--z-100); display: grid; place-items: center; font-size: 20px; }
.qr-name { min-width: 0; }
.qr-name > b { display: block; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qr-name > span { font-size: 12px; color: var(--z-500); }
.qr-name > span b { color: var(--z-900); }
.qr-unit { grid-area: unit; display: flex; gap: 4px; align-items: center; font-size: 11.5px; color: var(--z-500); }
.qr-unit span { margin-right: 2px; }
.qr-unit button { border: 1px solid var(--rule); background: var(--card); color: var(--z-600); border-radius: 99px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.qr-unit button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.qr-sizes { grid-area: sizes; display: flex; flex-wrap: wrap; gap: 8px; }
.qr-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 78px; }
.qr-cell.empty { opacity: .45; }
.qr-sz { font-size: 12px; font-weight: 800; color: var(--z-700); }
.qr-cell input { width: 100%; text-align: center; font-size: 15px; font-weight: 700; padding: 7px 4px; border: 1px solid var(--z-300); border-radius: 8px; background: var(--card); color: var(--z-900); }
.qr-cell input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-lt); }
.qr-cell input.over { border-color: var(--red); background: var(--red-lt); }
.qr-none { height: 36px; display: grid; place-items: center; color: var(--z-300); }
.qr-hint { font-size: 10.5px; color: var(--z-500); white-space: nowrap; }
.qr-eq { font-size: 10.5px; color: var(--brand); font-weight: 700; min-height: 0; }
[data-theme="dark"] .qr-eq { color: var(--brand-2); }
.qr-eq:empty { display: none; }
.qr-cell:has(.qr-io) { width: 150px; }
.qr-cell .qr-io { display: flex; flex-direction: column; align-items: center; width: 100%; }
.qr-cell:has(.qr-io) { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 6px; justify-items: center; }
.qr-cell:has(.qr-io) .qr-sz, .qr-cell:has(.qr-io) .qr-hint { grid-column: 1 / -1; }
.qr-io em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .03em; }
.qr-io.def em { color: var(--red); }
@media (max-width: 768px) {
  .qr-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "print unit" "sizes sizes"; padding: 10px; }
  .qr-print img, .qr-noimg { width: 50px; height: 50px; }
  .qr-sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px; }
  .qr-cell { width: auto; }
  .qr-sizes:has(.qr-io) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qr-cell:has(.qr-io) { width: auto; }
  .qr-unit span { display: none; }
}

/* ── Share lots with a buyer (js/lotshare.js) ── */
.ls-pick{max-height:52vh;overflow:auto;border:1px solid var(--z-200);border-radius:10px}
.ls-pick-row{display:flex;gap:10px;align-items:center;padding:9px 12px;border-bottom:1px solid var(--z-100);cursor:pointer;font-size:13.5px}
.ls-pick-row:last-child{border-bottom:none}
.ls-pick-row:hover{background:var(--z-50)}
.ls-pick-row input{width:18px;height:18px;flex:none}
.ls-pick-row .thumb{width:36px;height:36px;border-radius:8px;flex:none}
.ls-pick-row small{display:block;font-size:11.5px;color:var(--z-500);margin-top:1px}
.ls-opt{display:flex;gap:10px;align-items:flex-start;padding:10px 0 2px;cursor:pointer}
.ls-opt input{width:18px;height:18px;margin-top:2px;flex:none}
.ls-opt b{font-size:14px}
.ls-opt small{display:block;font-size:12px;color:var(--z-500);margin-top:2px}
.ls-hint{font-size:12.5px;color:var(--z-500);margin-top:12px;line-height:1.5}
.ls-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--z-100);flex-wrap:wrap}
.ls-row:last-child{border-bottom:none}
.ls-row-b{min-width:0;flex:1 1 240px}
.ls-row-b b{font-size:13.5px}
.ls-row-b small{display:block;font-size:11.5px;color:var(--z-500);margin-top:2px}
.ls-row-a{display:flex;gap:6px;flex-wrap:wrap}
.ls-link input{font-size:13px}
.ls-link-btns{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.ls-buyer-bar{display:flex;justify-content:space-between;align-items:center;font-size:12.5px;color:var(--z-500);margin-bottom:10px}
#prog-lot-progress .lv-lot{border:none;padding:0}

/* ── GarmentOS logo = same as the marketing site (garmentos.html header, 2026-11-05) ──
   denim bar, lighter denim tile, Archivo 125% wide 800, "Garment" white + "OS" chalk gold.
   Sidebar: a denim band at the top · phones: the whole header bar is denim. */
.gos-word { font-family: 'Archivo', 'Plus Jakarta Sans', system-ui, sans-serif; font-stretch: 125%; font-weight: 800; letter-spacing: -0.02em; color: #eef1f8; white-space: nowrap; }
.gos-word b { color: #f0b429; font-weight: 800; }
.sidebar .sb-brand { background: #1b2747; margin: 10px 10px 4px; padding: 11px 12px; border-radius: 12px; gap: 10px; }
.sidebar .sb-brand .gos-mark { width: 34px; height: 34px; }
.sidebar .sb-brand .name.gos-word { font-size: 19px; color: #eef1f8; }
.mobile-header, [data-theme="dark"] .mobile-header { background: #1b2747; border-bottom-color: #1b2747; }
.mobile-header .hamburger-btn span { background: #eef1f8; }
.mobile-header .gos-brand { display: flex; align-items: center; gap: 9px; overflow: visible; }
.mobile-header .gos-brand .gos-mark { width: 30px; height: 30px; flex-shrink: 0; display: block; }
.mobile-header .gos-brand .gos-word { font-size: 19px; }
[data-theme="dark"] .sidebar .sb-brand { background: #121a31; }
[data-theme="dark"] .mobile-header { background: #121a31; border-bottom-color: #26304b; }
[data-theme="dark"] .gos-mark rect, [data-theme="dark"] .gos-mark ellipse { fill: #1b2645; }
[data-theme="dark"] .gos-word b { color: #f5c451; }

/* ── Master lot + cuts CT-1, CT-2 … (lotCutGroups in lotview.js, 2026-11-05) ── */
.br-list tr.br-master td { background: var(--z-50); border-top: 2px solid var(--z-200); }
.br-list tr.br-master .br-lotno { font-weight: 800; }
.br-caret { display: inline-block; width: 18px; color: var(--z-500); cursor: pointer; font-size: 12px; }
.br-list tr.br-child td.br-lot { padding-left: 30px; border-left: 3px solid var(--z-200); }
.br-list tr.br-child td { background: var(--card); }
.lot-master { border: 1px solid var(--z-200); border-radius: 12px; background: var(--z-50); padding: 12px 12px 4px; margin-bottom: 12px; }
.lm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 4px 10px; }
.lm-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--z-500); }
.lot-master .lm-head .lr-no { font-size: 18px; font-weight: 800; cursor: pointer; }
.lm-head .lr-meta { font-size: 13px; color: var(--z-500); margin-top: 2px; }
.lm-head .lr-meta .def { color: var(--red); font-weight: 700; }
.lm-head .lr-stages, #lm-body .lr-stages { display: flex; gap: 6px; flex-wrap: wrap; }
.lm-head .lr-stage, #lm-body .lr-stage { display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--z-100); color: var(--z-700); font-weight: 600; margin: 2px 0; white-space: nowrap; }
.lm-cuts .lot-row { background: var(--card); border: 1px solid var(--z-200); border-radius: 10px; margin-bottom: 8px; }
.lm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.lm-tabs span { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 99px; background: var(--z-100); color: var(--z-600); cursor: pointer; white-space: nowrap; }
.lm-tabs span:hover { background: var(--z-200); }
.lm-tabs span.on { background: var(--brand); color: #fff; cursor: default; }
@media (max-width: 600px) {
  .lm-head { flex-direction: column; }
  .br-list tr.br-child td.br-lot { padding-left: 12px; }
}

/* ── Lot view (viewBitLot) + lot form summary — neat layout (2026-11-05) ── */
.lv2-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lv2-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lv2-head { display: flex; gap: 18px; align-items: flex-start; }
.lv2-photo { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; flex: none; background: var(--z-100); cursor: zoom-in; }
.lv2-ph { display: grid; place-items: center; font-size: 30px; cursor: default; }
.lv2-hd { min-width: 0; flex: 1; }
.lv2-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--z-500); display: flex; gap: 8px; align-items: center; }
.lv2-no { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--z-900); margin-top: 2px; }
.lv2-style { font-size: 15px; color: var(--z-600); margin-top: 1px; }
.lv2-chips { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; }
.lv2-chips span { font-size: 13.5px; font-weight: 600; color: var(--z-900); }
.lv2-chips small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--z-400); margin-bottom: 1px; }
.lv2-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.lv2-kpi { background: var(--soft, var(--card)); border: 1px solid var(--soft-line, var(--z-200)); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.lv2-kpi small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--z-500); }
.lv2-kpi b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--z-900); margin-top: 4px; }
.lv2-kpi b em, .bs-box b em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--z-500); }
.lv2-kpi span { display: block; font-size: 12px; color: var(--z-500); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv2-kpi.main b { color: var(--brand); }
.lv2-kpi.bad b { color: var(--red); }
.lv2-sec-h { padding: 14px 18px 10px; font-size: 15px; font-weight: 600; color: var(--z-900); }
.lv2-sec-h small { font-size: 12px; font-weight: 500; color: var(--z-500); margin-left: 8px; }
.lv2-sizes { width: auto; min-width: 0 !important; border-collapse: collapse; }
.lv2-sizes th, .lv2-sizes td { padding: 9px 16px; text-align: center; font-size: 14px; white-space: nowrap; }
.lv2-sizes td:first-child, .lv2-sizes th:first-child { text-align: left; color: var(--z-500); font-weight: 600; font-size: 12.5px; }
.lv2-sizes tr.hl td { font-weight: 600; color: var(--z-900); }
.lv2-sizes th:last-child, .lv2-sizes td:last-child { border-left: 1px solid var(--z-200); }
.lv2-prints td, .lv2-prints th { white-space: nowrap; }
.lv2-prints th.sz, .lv2-prints td.sz { text-align: center; }
.lv2-prints th.sz { color: var(--z-700); }
.lv2-pn { display: flex; align-items: center; gap: 10px; white-space: normal; min-width: 170px; }
.lv2-pn img, .lv2-pn .lv2-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--z-100); font-size: 18px; cursor: zoom-in; }
.lv2-pn b { font-weight: 600; }
.lv2-warn { display: block; font-size: 11px; color: var(--amber); font-weight: 600; }
.lv2-prints tfoot td { font-weight: 700; background: var(--z-50); border-top: 1px solid var(--z-200); padding-top: 10px; padding-bottom: 10px; }
.lv2-note { font-size: 13.5px; color: var(--z-600); }
.lv2-recon { border-top: 1px solid var(--z-200); padding-top: 12px; margin-top: 12px; }
.lv2-recon-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.lv2-recon-h img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.lv2-recon-h span { font-size: 12.5px; color: var(--z-500); }
.lv2-recon .bit-recon-panel { border-top: none !important; padding-top: 6px !important; }
@media (max-width: 1100px) { .lv2-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .lv2-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lv2-head { gap: 12px; } .lv2-photo { width: 64px; height: 64px; } .lv2-no { font-size: 21px; }
}

/* lot form → summary boxes */
.bit-totals-box:has(.bs-group) { background: none; border: none; padding: 0; }
.bs-group { margin-bottom: 14px; }
.bs-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--z-500); margin-bottom: 8px; }
.bs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.bs-box { background: var(--card); border: 1px solid var(--z-200); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.bs-box small { display: block; font-size: 11.5px; font-weight: 600; color: var(--z-500); }
.bs-box b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--z-900); margin-top: 3px; }
.bs-box span { display: block; font-size: 12px; color: var(--z-400); margin-top: 2px; }
.bs-box.main { border-color: color-mix(in srgb, var(--brand) 35%, transparent); background: var(--brand-lt); }
.bs-box.main b { color: var(--brand); }
[data-theme="dark"] .bs-box.main b { color: var(--z-900); }
.bs-note { font-size: 12.5px; color: var(--amber); font-weight: 600; margin: -4px 0 12px; }
.bs-sizes { border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--z-200); border-radius: 12px; overflow: hidden; min-width: 0 !important; width: auto; }
.bs-sizes th, .bs-sizes td { padding: 8px 16px; text-align: center; font-size: 14px; }
.bs-sizes th { background: var(--z-50); color: var(--z-600); font-size: 12px; }
.bs-sizes th:last-child, .bs-sizes td:last-child { border-left: 1px solid var(--z-200); }

/* -- Tasks (js/tasks.js) -- */
.task-tools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.task-tools .seg { margin: 0; }
.task-person { width: auto; min-width: 180px; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: flex; gap: 12px; align-items: flex-start; background: var(--soft, var(--card)); border: 1px solid var(--soft-line, var(--z-200)); border-radius: 14px; padding: 14px 16px; }
.task-row.late { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.task-row.done .task-desc { color: var(--z-500); text-decoration: line-through; }
.task-tick { width: 24px; height: 24px; flex: none; margin-top: 1px; border-radius: 8px; border: 2px solid var(--z-300); background: var(--card); color: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
.task-tick svg { width: 14px; height: 14px; }
.task-tick:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.task-tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.task-tick:disabled { cursor: not-allowed; opacity: .55; }
.task-b { flex: 1; min-width: 0; }
.task-desc { font-size: 14.5px; font-weight: 600; color: var(--z-900); white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--z-500); }
.task-meta b { color: var(--z-800); font-weight: 600; }
.task-pri { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.task-pri.high { background: var(--red-lt); color: var(--red); }
.task-pri.medium { background: var(--amber-lt); color: var(--amber); }
.task-pri.low { background: var(--z-100); color: var(--z-600); }
.nav-item[data-screen="tasks"] { position: relative; }
.task-navbadge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; }
.task-navbadge.late { background: var(--red); }
@media (min-width: 769px) { html:not(.sb-wide) .task-navbadge { position: absolute; top: -2px; right: -3px; margin: 0; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; font-size: 10px; } }

/* reminder popup: its own layer, above other popups, so an open form is not lost */
.tp-overlay { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(24,24,27,.45); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: moFade .24s ease both; }
.tp-card { background: var(--card); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: moPop .34s var(--mo-ease, ease) both; }
.tp-head { display: flex; gap: 12px; align-items: center; padding: 18px 20px 12px; }
.tp-head b { display: block; font-size: 18px; font-weight: 700; color: var(--z-900); }
.tp-head small { font-size: 13px; color: var(--z-500); }
.tp-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--red-lt); color: var(--red); display: grid; place-items: center; }
.tp-ico svg { width: 21px; height: 21px; }
.tp-list { padding: 0 20px; overflow-y: auto; flex: 1; min-height: 0; }
.tp-sec { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--z-400); padding: 10px 0 2px; }
.tp-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--z-100); }
.tp-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px 18px; }


/* Find a print (js/fabric.js) */
.ff-sub { margin-top: 3px; font-size: 12.5px; color: var(--z-500); }
.ff-pick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
#ff-status { margin-top: 10px; font-size: 12.5px; color: var(--z-500); min-height: 16px; }
.ff-result { margin-top: 12px; }
.ff-query { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.ff-query img { width: 110px; height: 110px; flex-shrink: 0; object-fit: cover; border-radius: 12px; border: 2px solid var(--brand); cursor: zoom-in; }
.ff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ff-card { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px; }
.ff-card span { color: var(--z-500); overflow-wrap: anywhere; }
.ff-card a { color: var(--brand); font-weight: 600; }
.ff-sup { margin-top: 6px; font-size: 14px; }
.ff-photo { position: relative; }
.ff-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--z-100); cursor: zoom-in; }
.ff-photo i { position: absolute; top: 6px; right: 6px; padding: 2px 7px; font-size: 12px; font-style: normal; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .68); border-radius: 999px; }
.ff-acts { display: flex; gap: 6px; margin-top: 6px; }

/* Fabric batches in the buyer portal (js/fabric.js) */
.fr-buyer-types { margin-bottom: 12px; }
.fr-batch { margin-bottom: 12px; }
.fr-batch-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.fr-batch-no { font-size: 11.5px; font-weight: 700; color: var(--z-500); }
.fr-batch-head b { font-size: 15px; }
.fr-batch-head span { display: block; font-size: 12px; color: var(--z-500); }
.fr-batch-sum { text-align: right; }
.fr-more { margin-top: 12px; }

/* Export invoice (js/exportinvoice.js) */
.ei-form { display: flex; flex-direction: column; gap: 12px; }
.ei-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ei-grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ei-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.ei-tools label { display: flex; align-items: center; gap: 6px; color: var(--z-500); }
.ei-tools .form-input { width: 92px; padding: 6px 8px; }
.ei-tools .ei-cur { margin-left: auto; }
.ei-sizes { font-size: 11.5px; color: var(--z-500); }
.ei-hs, .ei-rate { width: 96px; padding: 6px 8px; }
.ei-rate { margin-left: auto; text-align: right; }

/* Fabric purchase by roll (js/fabric.js) */
#lightbox { z-index: 1200; }   /* photos opened from inside a popup must sit above it */
.fr-cam-btn { background: var(--brand); border: 1.5px solid var(--brand); color: #fff; }
.fr-cam-btn span { color: rgba(255, 255, 255, .78); }
.fr-cam-btn:hover { background: var(--brand-hover, var(--brand)); }
.frc { position: fixed; inset: 0; z-index: 1300; display: flex; flex-direction: column; height: 100vh; height: 100dvh; color: #fff; background: #0b0b0d; }
.frc [hidden] { display: none !important; }
.frc-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.frc-top #frc-flip { justify-self: end; }
.frc-top .frc-link:first-child { justify-self: start; }
.frc-link { padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 700; color: #fff; cursor: pointer; background: rgba(255, 255, 255, .13); border: 0; border-radius: 999px; }
#frc-info { display: flex; flex-direction: column; align-items: center; font-size: 15px; }
#frc-info span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.frc-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
#frc-video, #frc-still { width: 100%; height: 100%; object-fit: contain; }
#frc-msg { max-width: 340px; padding: 20px; text-align: center; font-size: 15px; line-height: 1.45; }
#frc-msg p { margin: 0 0 14px; }
.frc-bottom { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: #151518; }
#frc-shoot { display: flex; justify-content: center; }
#frc-shutter { width: 74px; height: 74px; padding: 0; cursor: pointer; background: #fff; border: 5px solid #151518; border-radius: 50%; box-shadow: 0 0 0 3px #fff; }
#frc-shutter:active { transform: scale(.93); }
#frc-shutter:focus-visible { box-shadow: 0 0 0 3px var(--brand-2); }
#frc-weigh { max-width: 560px; margin: 0 auto; }
.frc-label { margin-bottom: 8px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .72); }
#frc-rolls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.frc-w { width: 130px; padding: 10px; font: inherit; font-size: 28px; font-weight: 800; text-align: center; color: #18181b; background: #fff; border: 2px solid #fff; border-radius: 12px; }
.frc-w:focus { border-color: var(--brand-2); outline: none; }
.frc-w.odd { background: #fde9c4; border-color: #f0b429; }
#frc-err { min-height: 18px; margin-top: 6px; text-align: center; font-size: 13px; font-weight: 700; color: #fca5a5; }
.frc-actions { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 8px; margin-top: 6px; }
.frc-btn { padding: 13px 10px; font: inherit; font-size: 15px; font-weight: 700; color: #fff; cursor: pointer; background: rgba(255, 255, 255, .13); border: 0; border-radius: 12px; }
.frc-btn.primary { color: #1b2747; background: #f0b429; }
@media (max-height: 640px) { .frc-w { font-size: 22px; padding: 7px; } .frc-btn { padding: 10px; } .frc-bottom { padding-top: 8px; } }
.fr-choose { display: grid; gap: 10px; }
.fr-choose button { display: flex; flex-direction: column; gap: 3px; padding: 18px; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--card); border: 1px solid var(--z-200); border-radius: 12px; }
.fr-choose button:hover, .fr-choose button:focus-visible { border-color: var(--brand); }
.fr-choose b { font-size: 16px; }
.fr-choose span { font-size: 12.5px; color: var(--z-500); }
.pm-card.fr-card .pm-body { max-height: 70vh; }
.fr-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fr-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fr-drop { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 16px; font: inherit; color: inherit; cursor: pointer; background: var(--z-50); border: 1.5px dashed var(--z-300); border-radius: 12px; }
.fr-drop:hover, .fr-drop.over { border-color: var(--brand); }
.fr-drop span { font-size: 12px; color: var(--z-500); }
.fr-help { margin: 10px 0; font-size: 12px; color: var(--z-500); }
.fr-help kbd { font: inherit; font-weight: 700; padding: 0 5px; color: var(--z-700, inherit); background: var(--z-100); border-radius: 4px; }
.fr-row { display: grid; grid-template-columns: 26px 54px minmax(90px, 170px) 1fr auto 26px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--z-100); }
.fr-row.miss .fr-w { border-color: var(--red); }
.fr-no { font-size: 12px; color: var(--z-400); text-align: right; }
.fr-thumb { position: relative; width: 54px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--z-100); display: flex; align-items: center; justify-content: center; }
.fr-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.s-wait .fr-thumb img, .s-work .fr-thumb img { opacity: .55; }
.s-wait .fr-thumb::after, .s-work .fr-thumb::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-2); }
.fr-retry { position: absolute; inset: auto 0 0 0; padding: 2px 0; font: inherit; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--red); border: 0; cursor: pointer; }
.fr-namebox { min-width: 0; }
.fr-name { width: 100%; padding: 6px 2px; font: inherit; font-size: 13px; color: inherit; background: transparent; border: 0; border-bottom: 1px solid transparent; }
.fr-name:hover, .fr-name:focus { border-bottom-color: var(--z-300); outline: none; }
.fr-err { display: block; font-size: 11px; color: var(--red); }
.fr-err:empty { display: none; }
.fr-rolls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fr-w { width: 72px; padding: 7px 8px; font: inherit; font-weight: 700; text-align: right; color: inherit; background: var(--card); border: 1px solid var(--z-200); border-radius: 8px; }
.fr-w:focus { border-color: var(--brand); outline: 1px solid var(--brand); }
.fr-w.odd { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, var(--card)); }
.fr-add { padding: 5px 8px; font: inherit; font-size: 12px; color: var(--z-500); cursor: pointer; background: transparent; border: 1px dashed var(--z-300); border-radius: 8px; }
.fr-add:hover { color: var(--brand); border-color: var(--brand); }
.fr-sum { min-width: 74px; text-align: right; font-size: 13px; }
.fr-sum span { display: block; font-size: 11px; color: var(--z-500); }
.fr-del { padding: 4px; font: inherit; color: var(--z-400); cursor: pointer; background: transparent; border: 0; }
.fr-del:hover { color: var(--red); }
.fr-up { font-weight: 500; color: var(--z-500); }
.fr-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fr-card-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.fr-card-item img, .fr-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--z-100); }
.fr-card-item img { cursor: zoom-in; }
.fr-noimg { display: flex; align-items: center; justify-content: center; font-size: 26px; }
.fr-card-item > span { font-size: 12px; color: var(--z-500); }
.fr-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fr-chips i { padding: 1px 6px; font-size: 11px; font-style: normal; background: var(--z-100); border-radius: 6px; }
@media (max-width: 768px) {
  .fr-row { grid-template-columns: 54px minmax(0, 1fr) 26px; grid-template-areas: "thumb name del" "thumb sum del" "rolls rolls rolls"; row-gap: 4px; }
  .fr-no { display: none; }
  .fr-thumb { grid-area: thumb; }
  .fr-namebox { grid-area: name; }
  .fr-sum { grid-area: sum; text-align: left; }
  .fr-sum span { display: inline; margin-left: 6px; }
  .fr-del { grid-area: del; }
  .fr-rolls { grid-area: rolls; }
  .fr-w { font-size: 16px; }
}