/* ═══════════════════════════════════════════════════════════════
   StockMate — Design System
   Single source of truth for all colours, spacing, components.
   All page JS files use these classes — no inline styles anywhere.
═══════════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; font-size: 14px; background: #F1EFE8; color: #1A1A18; }

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Brand */
  --teal:        #0F6E56;
  --teal-dark:   #085041;
  --teal-light:  #E1F5EE;
  --teal-border: #9FE1CB;

  /* Sidebar */
  --sb-bg:       #0A1A14;
  --sb-border:   rgba(255,255,255,0.06);
  --sb-muted:    rgba(255,255,255,0.25);
  --sb-text:     rgba(255,255,255,0.5);
  --sb-active:   #0F6E56;

  /* Surfaces */
  --bg:          #FFFFFF;
  --bg-2:        #F9F8F5;
  --bg-3:        #F1EFE8;
  --border:      #E5E2D9;
  --border-2:    #D3D1C7;

  /* Text */
  --text:        #1A1A18;
  --text-2:      #6B6A65;
  --text-3:      #9C9A95;

  /* Semantic */
  --green:       #0F6E56;
  --green-bg:    #E1F5EE;
  --green-border:#9FE1CB;
  --amber:       #BA7517;
  --amber-bg:    #FAEEDA;
  --amber-border:#FAC775;
  --red:         #A32D2D;
  --red-bg:      #FCEBEB;
  --red-border:  #F7C1C1;
  --blue:        #185FA5;
  --blue-bg:     #E6F1FB;
  --blue-border: #B5D4F4;
  --purple:      #534AB7;
  --purple-bg:   #EEEDFE;
  --purple-border:#AFA9EC;

  /* Layout */
  --sb-width:    210px;
  --tb-height:   50px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --shadow:      0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0;
  background: var(--sb-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.login-card {
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 56px; height: 56px;
  background: var(--teal);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  margin-bottom: 12px;
}
.login-logo-text {
  font-size: 22px; font-weight: 600; color: var(--text);
}
.login-logo-sub {
  font-size: 12px; color: var(--text-3); margin-top: 3px;
}
.login-error {
  background: var(--red-bg); border: 0.5px solid var(--red-border);
  border-radius: var(--radius-md); padding: 9px 12px;
  font-size: 13px; color: var(--red); margin-bottom: 14px;
}
.lf { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ll { font-size: 11px; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.li {
  padding: 10px 12px; font-size: 14px;
  border: 0.5px solid var(--border-2); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text);
  outline: none; font-family: inherit; width: 100%;
  transition: border-color .15s;
}
.li:focus { border-color: var(--teal); }
.login-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 16px; padding: 4px;
}
.login-btn {
  width: 100%; background: var(--teal); color: #fff;
  border: none; border-radius: var(--radius-md);
  padding: 12px; font-size: 14px; font-weight: 500;
  cursor: pointer; margin-top: 8px; font-family: inherit;
  transition: background .15s;
}
.login-btn:hover { background: var(--teal-dark); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════════ */
.app {
  display: flex; height: 100vh; overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sb-width); flex-shrink: 0;
  background: var(--sb-bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sb-top {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--sb-border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sb-logo {
  width: 32px; height: 32px;
  background: var(--teal); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff; flex-shrink: 0;
}
.sb-name { font-size: 14px; font-weight: 500; color: #fff; }
.sb-tagline { font-size: 10px; color: var(--sb-muted); }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sb-section {
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .08em; color: var(--sb-muted);
  padding: 10px 8px 4px; margin-top: 2px;
}
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-md);
  cursor: pointer; font-size: 13px; color: var(--sb-text);
  margin-bottom: 1px; text-decoration: none;
  transition: background .1s, color .1s;
  user-select: none;
}
.sb-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); }
.sb-item.active { background: var(--sb-active); color: #fff; }
.sb-item .ti { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; color: rgba(255,255,255,0.3); }
.sb-item.active .ti { color: rgba(255,255,255,0.9); }
.sb-item-label { flex: 1; }
.sb-badge {
  font-size: 10px; font-weight: 500; padding: 1px 7px;
  border-radius: 10px; white-space: nowrap;
}
.sb-badge-green { background: rgba(15,110,86,0.3); color: #5DCAA5; }
.sb-badge-red   { background: rgba(226,75,74,0.2);  color: #F09595; }
.sb-badge-amber { background: rgba(186,117,23,0.3); color: #FAC775; }
.sb-badge-blue  { background: rgba(24,95,165,0.35); color: #85B7EB; }
.sb-foot {
  border-top: 1px solid var(--sb-border);
  padding: 12px; display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.sb-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: #fff; flex-shrink: 0;
  overflow: hidden;
}
.sb-av img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-info { flex: 1; min-width: 0; }
.sb-username { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-role { font-size: 10px; color: rgba(255,255,255,0.3); }
.sb-logout {
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,0.07); border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3); font-size: 14px;
  transition: background .1s;
}
.sb-logout:hover { background: rgba(226,75,74,0.3); color: #F09595; }

/* ── Main area ───────────────────────────────────────────────── */
.main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; overflow: hidden;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: var(--tb-height); flex-shrink: 0;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 8px;
}
.tb-title {
  font-size: 14px; font-weight: 500; color: var(--text); flex: 1;
}
.tb-actions { display: flex; gap: 7px; align-items: center; }

/* ── Pages ───────────────────────────────────────────────────── */
#pages { flex: 1; overflow: hidden; position: relative; }
.page {
  display: none; height: 100%;
  overflow-y: auto; overflow-x: hidden;
}
.page.active { display: flex; flex-direction: column; }
.page-body { flex: 1; overflow-y: auto; padding: 14px; }

/* ═══════════════════════════════════════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════════════════════════════════════ */

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 13px;
  border-radius: var(--radius-md); border: 0.5px solid var(--border-2);
  background: var(--bg); color: var(--text-2);
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  transition: background .1s, border-color .1s, color .1s;
}
.btn:hover { background: var(--bg-2); border-color: var(--border-2); }
.btn .ti { font-size: 13px; }
.btn-primary   { background: var(--teal);   color: #fff; border-color: var(--teal-dark); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-red       { background: var(--red);    color: #fff; border-color: #791F1F; }
.btn-red:hover { background: #791F1F; }
.btn-amber     { background: var(--amber);  color: #fff; border-color: #854F0B; }
.btn-blue      { background: var(--blue);   color: #fff; border-color: #0C447C; }
.btn-purple    { background: var(--purple); color: #fff; border-color: #3C3489; }
.btn-ghost     { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ── KPI strip ───────────────────────────────────────────────── */
.kstrip {
  display: grid; gap: 8px;
  padding: 11px 16px;
  background: var(--bg-2);
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.kstrip-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.kstrip-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.kstrip-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.ks {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px 13px;
  position: relative; overflow: hidden;
}
.ks-accent {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.ks-val { font-size: 20px; font-weight: 500; line-height: 1; margin-top: 3px; }
.ks-lbl { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.ks-sub { font-size: 9px;  color: var(--text-3); margin-top: 2px; }

/* ── Tab bar ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex; border-bottom: 0.5px solid var(--border);
  background: var(--bg); flex-shrink: 0; padding: 0 16px;
  overflow-x: auto;
}
.tab-bar::-webkit-scrollbar { height: 0; }
.tab-item {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 12px; font-weight: 500;
  color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .15s;
}
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-item .ti { font-size: 14px; }
.tab-count {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: var(--bg-2); color: var(--text-3);
}
.tab-item.active .tab-count { background: var(--teal-light); color: var(--teal-dark); }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 0.5px solid var(--border);
}
.card-icon {
  width: 28px; height: 28px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon .ti { font-size: 14px; }
.card-title { font-size: 13px; font-weight: 500; color: var(--text); }
.card-sub   { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.card-right { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.card-body  { padding: 14px 16px; }

/* ── Section header ──────────────────────────────────────────── */
.sec-hd {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.sec-title { font-size: 13px; font-weight: 500; color: var(--text); }
.sec-sub   { font-size: 11px; color: var(--text-3); }
.sec-right { margin-left: auto; display: flex; gap: 7px; }

/* ── Form fields ─────────────────────────────────────────────── */
.ff   { display: flex; flex-direction: column; gap: 4px; }
.fl   { font-size: 10px; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.fl-req { color: var(--red); font-size: 11px; }
.fi {
  padding: 7px 10px; font-size: 13px;
  border: 0.5px solid var(--border-2); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text);
  outline: none; font-family: inherit; width: 100%;
  transition: border-color .15s;
}
.fi:focus { border-color: var(--teal); background: #F0FAF5; }
.fi.locked { background: #F4F2EE; color: var(--text-3); cursor: not-allowed; }
.fi-hint { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.fi-hint-ok     { color: var(--green); }
.fi-hint-warn   { color: var(--red); font-weight: 500; }
.fi-hint-after  { color: var(--blue); }
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fg3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.fg4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fg-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 10px; }
.ta {
  padding: 7px 10px; font-size: 13px;
  border: 0.5px solid var(--border-2); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text);
  outline: none; font-family: inherit; width: 100%;
  resize: vertical; min-height: 64px;
}
.ta:focus { border-color: var(--teal); }
.form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 6px; border-top: 0.5px solid var(--border); margin-top: 4px;
}
.from-master {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 500; padding: 1px 6px;
  border-radius: 6px; background: var(--green-bg);
  color: var(--teal-dark); border: 0.5px solid var(--green-border);
  margin-top: 2px; width: fit-content;
}
.autofill-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 500; padding: 1px 6px;
  border-radius: 6px; background: var(--amber-bg);
  color: #633806; border: 0.5px solid var(--amber-border);
  margin-top: 2px; width: fit-content;
}

/* ── Filter bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 7px; align-items: center;
  padding: 10px 16px; flex-wrap: wrap;
  background: var(--bg-2); border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.fsearch {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: var(--radius-md); padding: 6px 11px;
  font-size: 12px; color: var(--text-3); flex: 1; min-width: 160px;
  cursor: text;
}
.fsearch .ti { font-size: 13px; flex-shrink: 0; }
.fsearch input {
  border: none; outline: none; background: transparent;
  font-size: 12px; color: var(--text); font-family: inherit; flex: 1;
}
.fsel {
  padding: 6px 9px; font-size: 12px;
  border: 0.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg); color: var(--text-2);
  outline: none; font-family: inherit;
}
.fsel:focus { border-color: var(--teal); }
.fcount { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* ── Tables ──────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.tbl {
  width: 100%; border-collapse: collapse; font-size: 12px;
  min-width: 500px;
}
.tbl thead th {
  padding: 7px 12px; text-align: left;
  font-size: 10px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3);
  background: var(--bg-2); border-bottom: 0.5px solid var(--border);
  position: sticky; top: 0; white-space: nowrap;
}
.tbl tbody td {
  padding: 9px 12px; border-bottom: 0.5px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl tbody tr.row-active { background: var(--blue-bg); }
.tbl tbody tr.row-low { background: #FFF9F9; }
.tbl-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.tbl-muted { color: var(--text-2); font-size: 11px; }
.tbl-mono  { font-family: monospace; font-size: 11px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 500; padding: 2px 8px;
  border-radius: 20px; white-space: nowrap;
}
.badge-green  { background: var(--green-bg);  color: var(--teal-dark); border: 0.5px solid var(--green-border); }
.badge-red    { background: var(--red-bg);    color: #791F1F; border: 0.5px solid var(--red-border); }
.badge-amber  { background: var(--amber-bg);  color: #633806; border: 0.5px solid var(--amber-border); }
.badge-blue   { background: var(--blue-bg);   color: #0C447C; border: 0.5px solid var(--blue-border); }
.badge-purple { background: var(--purple-bg); color: #3C3489; border: 0.5px solid var(--purple-border); }
.badge-grey   { background: var(--bg-2);      color: var(--text-3); border: 0.5px solid var(--border); }
.badge .ti    { font-size: 10px; }

/* Category pills */
.cat-pill {
  font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 8px;
}

/* Stock state badges */
.stk-in    { background: var(--green-bg);  color: var(--teal-dark); }
.stk-low   { background: var(--amber-bg);  color: #633806; }
.stk-out   { background: var(--bg-2);      color: var(--text-3); }

/* Delete button in tables */
.tbl-del {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); margin: auto;
}
.tbl-del:hover { background: var(--red-bg); color: var(--red); }
.tbl-del .ti { font-size: 13px; }

/* ── Progress bars ───────────────────────────────────────────── */
.prg-track {
  height: 6px; background: var(--bg-2);
  border-radius: 3px; overflow: hidden;
}
.prg-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.prg-teal   { background: var(--teal); }
.prg-red    { background: var(--red); }
.prg-amber  { background: var(--amber); }
.prg-blue   { background: var(--blue); }
.prg-purple { background: var(--purple); }
.prg-green  { background: #3B6D11; }

/* Big progress (operator job view) */
.prg-big-track {
  height: 10px; background: var(--bg-2); border-radius: 5px; overflow: hidden;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; z-index: 500; overflow-y: auto;
}
.modal-box {
  background: var(--bg); border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  margin: auto; overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: modal-in .15s ease;
}
@keyframes modal-in { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 0.5px solid var(--border);
}
.modal-title { font-size: 14px; font-weight: 500; color: var(--text); }
.modal-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 16px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 16px; border-top: 0.5px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}
/* Coloured modal headers */
.modal-head-teal   { background: var(--teal);   }
.modal-head-teal   .modal-title, .modal-head-teal .modal-close { color: #fff; }
.modal-head-teal   .modal-close { background: rgba(255,255,255,0.2); }
.modal-head-red    { background: var(--red); }
.modal-head-red    .modal-title, .modal-head-red .modal-close { color: #fff; }
.modal-head-red    .modal-close { background: rgba(255,255,255,0.2); }
.modal-head-purple { background: var(--purple); }
.modal-head-purple .modal-title, .modal-head-purple .modal-close { color: #fff; }
.modal-head-purple .modal-close { background: rgba(255,255,255,0.2); }
.modal-head-blue   { background: var(--blue); }
.modal-head-blue   .modal-title, .modal-head-blue .modal-close { color: #fff; }
.modal-head-blue   .modal-close { background: rgba(255,255,255,0.2); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1A1A18; color: #fff;
  padding: 10px 18px; border-radius: var(--radius-lg);
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999; white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; pointer-events: auto; }

/* ── Notice boxes ────────────────────────────────────────────── */
.notice {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 14px; border-radius: var(--radius-md);
  font-size: 12px;
}
.notice .ti { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.notice-red    { background: var(--red-bg);   border: 0.5px solid var(--red-border);   color: #791F1F; }
.notice-amber  { background: var(--amber-bg); border: 0.5px solid var(--amber-border); color: #633806; }
.notice-blue   { background: var(--blue-bg);  border: 0.5px solid var(--blue-border);  color: #0C447C; }
.notice-green  { background: var(--green-bg); border: 0.5px solid var(--green-border); color: var(--teal-dark); }

/* ── Self-assign block (production modals) ───────────────────── */
.self-block {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 0.5px solid var(--green-border);
  border-radius: var(--radius-md); background: var(--green-bg);
}
.self-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.self-name { font-size: 13px; font-weight: 500; color: var(--teal-dark); flex: 1; }
.self-badge {
  font-size: 10px; font-weight: 500; padding: 2px 7px;
  border-radius: 7px; background: #fff; color: var(--teal-dark);
  border: 0.5px solid var(--green-border);
}

/* ── Catalog / custom toggle ─────────────────────────────────── */
.type-tog {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-2); border: 0.5px solid var(--border);
  border-radius: var(--radius-md); padding: 3px;
}
.type-tog-btn {
  padding: 8px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: none; background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-family: inherit; transition: background .1s;
}
.type-tog-btn .ti { font-size: 13px; }
.type-tog-btn.active {
  background: var(--bg); color: var(--text);
  border: 0.5px solid var(--border);
}

/* ── Product list (catalog search) ──────────────────────────── */
.prod-list {
  border: 0.5px solid var(--border); border-radius: var(--radius-md);
  margin-top: 5px; overflow: hidden; max-height: 200px; overflow-y: auto;
}
.prod-row {
  padding: 8px 11px; border-bottom: 0.5px solid var(--border);
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; gap: 8px;
  transition: background .1s;
}
.prod-row:last-child { border-bottom: none; }
.prod-row:hover { background: var(--bg-2); }
.prod-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-sku  { font-family: monospace; font-size: 11px; color: var(--text-3); }
.prod-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 500; margin-bottom: 4px;
}
.prod-chip-teal  { background: var(--teal);   color: #fff; }
.prod-chip-red   { background: var(--red);    color: #fff; }
.prod-chip-purple{ background: var(--purple); color: #fff; }
.chip-x { cursor: pointer; margin-left: auto; opacity: .8; font-size: 14px; }
.chip-x:hover { opacity: 1; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 24px;
  color: var(--text-3);
}
.empty-state .ti { font-size: 36px; display: block; margin-bottom: 10px; opacity: .4; }
.empty-state-title { font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
.empty-state-sub   { font-size: 12px; }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--text-3);
}
.spinner::after {
  content: ''; width: 24px; height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Greeting banner (operator) ──────────────────────────────── */
.greeting {
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
}
.gr-av {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 500; color: #fff; flex-shrink: 0;
}
.gr-name { font-size: 16px; font-weight: 500; color: #fff; }
.gr-sub  { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 3px; }
.gr-stats { margin-left: auto; display: flex; gap: 14px; }
.gr-sv { font-size: 20px; font-weight: 500; color: #fff; line-height: 1; }
.gr-sl { font-size: 10px; color: rgba(255,255,255,0.65); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Utility ─────────────────────────────────────────────────── */
.gap-8  { display: flex; gap: 8px; }
.gap-10 { display: flex; gap: 10px; }
.gap-12 { display: flex; gap: 12px; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.text-mono { font-family: monospace; }
.text-muted { color: var(--text-3); }
.text-red   { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-blue  { color: var(--blue); }

/* ── Extra utilities added in Phase 3 ──────────────────────── */
.cursor-pointer { cursor: pointer; }
.mb-14 { margin-bottom: 14px; }

/* Coloured button variants */
.btn-purple {
  background: var(--purple); color: #fff; border-color: #3C3489;
}
.btn-purple:hover { background: #3C3489; }

/* prod-chip variants for modal product picker */
.prod-chip-red    { background: var(--red);    color: #fff; }
.prod-chip-purple { background: var(--purple); color: #fff; }
