/* Opsryx Skills — app UI
   Brand matches the Opsryx Pallet Sheet Generator: Inter · teal #14b8a6 / #0d9488 / #0f766e · zinc-950 #09090b */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-var-latin.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --bg: #09090b; --panel: #111113; --card: #18181b; --line: #27272a; --line-2: #3f3f46;
  --text: #f4f4f5; --muted: #a1a1aa; --dim: #71717a;
  --brand: #14b8a6; --brand-300: #5eead4; --brand-400: #2dd4bf; --brand-600: #0d9488; --brand-700: #0f766e;
  --amber: #fbbf24; --red: #f87171; --blue: #60a5fa; --green: #4ade80;
  --radius: 14px; --top-h: 60px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: rgba(9,9,11,.86); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.topbar-sep { width: 1px; height: 22px; background: var(--line-2); }
.topbar-title { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-300);
  background: rgba(20,184,166,.12); border: 1px solid rgba(20,184,166,.35); padding: 3px 8px; border-radius: 999px; }
.pill.amber { color: #fcd34d; background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); }
.tabs { display: flex; gap: 4px; margin-left: 18px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: none;
  color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; position: relative; white-space: nowrap; }
.tab:hover { color: #fff; background: rgba(255,255,255,.05); }
.tab[aria-selected=true] { color: #fff; background: rgba(20,184,166,.12); border-color: rgba(20,184,166,.35); }
.tab .badge { background: var(--amber); color: #111; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.credit { color: var(--muted); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.credit b { color: var(--brand-400); font-weight: 600; }

/* Views */
.view { display: none; }
.view.on { display: block; }
.page { max-width: 1440px; margin: 0 auto; padding: 20px 22px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.split { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 18px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card h3 small { font-weight: 500; color: var(--dim); font-size: 12px; }
.step { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800;
  background: rgba(20,184,166,.14); color: var(--brand-300); border: 1px solid rgba(20,184,166,.3); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: #d4d4d8; }
.field-label small { font-weight: 500; color: var(--dim); margin-left: 4px; }
/* Bare <input> (no type) is text in HTML but NOT matched by [type=text] — style all text-like fields the same */
input:not([type]),
input[type=text], input[type=number], input[type=email], input[type=password], input[type=search],
input[type=url], input[type=tel], select, textarea {
  width: 100%; background: #0e0e10; color: var(--text); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 11px; outline: none; min-width: 0; -webkit-appearance: none; appearance: none; }
input:not([type]):focus,
input[type=text]:focus, input[type=number]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=search]:focus, input[type=url]:focus, input[type=tel]:focus,
select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20,184,166,.22); }
/* Keep autofill from painting a different background on some fields only */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #0e0e10 inset;
  transition: background-color 99999s ease-out; }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hint { margin: 0; color: var(--dim); font-size: 12px; }
.warn { margin: 0; color: #fcd34d; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3); padding: 9px 11px; border-radius: 10px; font-size: 12.5px; }
.note { margin: 0; color: #99f6e4; background: rgba(20,184,166,.07); border: 1px solid rgba(20,184,166,.28); padding: 9px 11px; border-radius: 10px; font-size: 12.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; padding: 9px 14px;
  font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--brand); color: #09090b; box-shadow: 0 8px 24px -10px rgba(20,184,166,.6); }
.btn-primary:hover { background: var(--brand-400); }
.btn-ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #e4e4e7; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-amber { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.4); color: #fde68a; }
.btn-danger { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.45); color: #fecaca; }
.btn-danger:hover { background: rgba(239,68,68,.22); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: transparent; color: #d4d4d8;
  border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #09090b; font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #d4d4d8; }
.toggle input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }

/* Tables */
.tbl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #141417; position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid #202024; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.tbl tr.sel td { background: rgba(20,184,166,.07); }
.tbl .pn { font-weight: 700; font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12.5px; color: #fff; white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: nowrap; }
.tbl .desc { color: #d4d4d8; max-width: 320px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tubs { display: inline-flex; gap: 3px; }
.tubs span { width: 16px; height: 12px; border-radius: 3px; background: var(--brand-600); }
.tubs span.empty { background: transparent; border: 1.5px dashed var(--amber); }
.tubs span.ord { background: transparent; border: 1.5px solid var(--blue); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.st-full { color: #99f6e4; background: rgba(20,184,166,.12); }
.st-empty { color: #fde68a; background: rgba(251,191,36,.12); }
.st-ordered { color: #bfdbfe; background: rgba(96,165,250,.14); }
.st-recv { color: #bbf7d0; background: rgba(74,222,128,.12); }
.row-btns { display: flex; gap: 6px; justify-content: flex-end; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.amber b { color: var(--amber); } .stat.blue b { color: var(--blue); } .stat.teal b { color: var(--brand-400); }

/* Label preview area */
.preview { background: radial-gradient(1200px 500px at 70% -10%, rgba(20,184,166,.10), transparent 60%), #0c0c0e;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 420px; overflow: auto; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; gap: 10px; flex-wrap: wrap; }
.sheets { display: flex; flex-direction: column; gap: 22px; align-items: center; }
.sheet-scale { transform-origin: top left; }
.sheet-holder { position: relative; }
.sheet-holder .sheet { box-shadow: 0 20px 50px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); }
.sheet-cap { color: var(--dim); font-size: 11.5px; margin-top: 6px; text-align: center; }

/* Scan view */
.scan-wrap { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 18px; padding: 20px 22px 40px; }
.scan-mode { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; background: #0e0e10; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; }
.scan-mode button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 10px 6px; border-radius: 9px; cursor: pointer; }
.scan-mode button[aria-pressed=true] { background: var(--brand); color: #09090b; }
.cam { position: relative; aspect-ratio: 16/9; max-height: 340px; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line-2); display: grid; place-items: center; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .reticle { position: absolute; inset: 22% 10%; border: 3px solid rgba(45,212,191,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.cam .reticle::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #f87171; box-shadow: 0 0 10px #f87171; }
.cam .cam-msg { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #e4e4e7; font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.cam .cam-idle { color: var(--muted); text-align: center; padding: 20px; font-size: 13px; }
.scan-input { display: flex; gap: 8px; }
.scan-input input { font-family: ui-monospace, Menlo, monospace; font-size: 16px; padding: 12px 13px; }
.result { border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line-2); background: var(--card); display: flex; gap: 14px; align-items: flex-start; }
.result .big { font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-family: ui-monospace, Menlo, monospace; }
.result .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 22px; font-weight: 900; }
.result.ok { border-color: rgba(74,222,128,.45); background: rgba(74,222,128,.07); } .result.ok .ico { background: rgba(74,222,128,.18); color: var(--green); }
.result.add { border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.07); } .result.add .ico { background: rgba(251,191,36,.18); color: var(--amber); }
.result.loc { border-color: rgba(96,165,250,.45); background: rgba(96,165,250,.07); } .result.loc .ico { background: rgba(96,165,250,.18); color: var(--blue); }
.result.err { border-color: rgba(248,113,113,.5); background: rgba(248,113,113,.07); } .result.err .ico { background: rgba(248,113,113,.18); color: var(--red); }
.result p { margin: 3px 0 0; color: #d4d4d8; font-size: 13px; }
.log { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow: auto; }
.log-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: #141417; border: 1px solid #202024; }
.log-row time { color: var(--dim); font-variant-numeric: tabular-nums; }
.log-row .mono { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }

/* Reorder */
.sup-group { margin-bottom: 18px; }
.sup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #141417; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.sup-head h3 { margin: 0; font-size: 15px; }
.sup-head .meta { color: var(--muted); font-size: 12px; }
.sup-group .tbl-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.po-in { width: 120px !important; padding: 6px 8px !important; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }
.empty-state { text-align: center; color: var(--muted); padding: 50px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* Integration */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.flow .card p { margin: 0; color: #d4d4d8; font-size: 13px; }
.flow .tag { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tag.live { color: var(--brand-300); } .tag.future { color: #fcd34d; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #18181b; border: 1px solid var(--brand-600);
  color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none; z-index: 99; box-shadow: 0 10px 30px -10px #000; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* Mobile */
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .flow { grid-template-columns: 1fr 1fr; } .credit { display: none; } }
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: #09090b; }
  .topbar-sep, .topbar-title .pill { display: none; }
  .topbar-right { display: flex; margin-left: auto; }
  .topbar-right .credit { display: none; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; background: rgba(12,12,14,.96); border-top: 1px solid var(--line);
    justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .tab { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 4px; flex: 1; }
  .tab svg.i { width: 20px; height: 20px; }
  .tab .badge { position: absolute; top: 0; right: 14%; }
  .tab[data-v=tubs] .tl, .tab[data-v=shelf] .tl, .tab[data-v=items] .tl, .tab[data-v=reorder] .tl, .tab[data-v=scan] .tl, .tab[data-v=floor] .tl, .tab[data-v=integrate] .tl { font-size: 10.5px; }
  .tab[data-v=integrate] { display: none; }
  body { padding-bottom: 76px; }
  .scan-wrap { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 30px; gap: 12px; }
  .scan-wrap > * { min-width: 0; }
  .scan-mode button { font-size: 12.5px; padding: 10px 4px; }
  html, body { overflow-x: hidden; }
  .page { padding: 14px 12px 30px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr; }
  .result .big { font-size: 17px; }
  .cam { aspect-ratio: 4/3; max-height: none; }
}
[hidden] { display: none !important; }
/* Opsryx Skills server edition: login, admin, menus, pager, modal. */
body.booting .tabs, body.booting .topbar-right { visibility: hidden; }
.auth-wrap { min-height: calc(100vh - var(--top-h)); display: grid; place-items: center; align-content: center; padding: 30px 16px; }
.auth-card { width: min(440px, 100%); gap: 14px; padding: 22px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.auth-brand img { width: 40px; height: 40px; }
.auth-brand b { display: block; font-size: 17px; }
.auth-brand span { color: var(--muted); font-size: 13px; }
.form-err { margin: 0; color: #fecaca; background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); padding: 9px 11px; border-radius: 10px; font-size: 12.5px; }
input.invalid { border-color: #f87171 !important; }

.usermenu { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #18181b; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 20px 40px -10px #000; z-index: 60; display: flex; flex-direction: column; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.menu-head b { display: block; color: #fff; font-size: 13px; }
.menu button { text-align: left; background: none; border: 0; color: #e4e4e7; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.menu button:hover { background: rgba(255,255,255,.06); }
.co-logo { height: 30px; max-width: 120px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px 4px; }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-400); box-shadow: 0 0 0 3px rgba(45,212,191,.18); }
.sync.off { background: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.18); }

.area-in { display: flex; gap: 6px; align-items: stretch; }
.area-in input[type=color] { width: 40px; flex: none; padding: 3px; border-radius: 10px; border: 1px solid var(--line-2); background: #0e0e10; cursor: pointer; height: auto; }
.area-in input[type=text] { flex: 1; }
.filterbar { display: flex; gap: 8px; }
.filterbar input { flex: 1; }
.filterbar select { width: 200px; flex: none; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; color: var(--muted); font-size: 12.5px; }
.pager:empty { display: none; }
.pick { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.pick .x { margin-left: auto; background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 13px; padding: 0 4px; }
.pick .x:hover { color: var(--red); }
.sup-rows { display: flex; flex-direction: column; gap: 8px; }
.sup-row { display: grid; grid-template-columns: 1.2fr 1.4fr 62px 28px; gap: 6px; align-items: center; }
.sup-row input { padding: 7px 9px; font-size: 12.5px; }
.sup-row .x, .area-row .x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; }
.sup-row .x:hover, .area-row .x:hover { color: var(--red); }
.area-row { display: grid; grid-template-columns: 40px 1fr auto 28px; gap: 8px; align-items: center; }
.area-row input[type=color] { width: 40px; height: 34px; padding: 3px; border-radius: 8px; border: 1px solid var(--line-2); background: #0e0e10; }
.area-row .cnt { color: var(--dim); font-size: 12px; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.logo-row { display: flex; gap: 14px; align-items: center; }
.logo-box { width: 140px; height: 70px; border-radius: 10px; border: 1px dashed var(--line-2); display: grid; place-items: center; background: #fff; color: #71717a; font-size: 12px; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

.admin-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.tbl tr.click { cursor: pointer; }
.tag-s { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.tag-s.on { color: #99f6e4; background: rgba(20,184,166,.14); }
.tag-s.off { color: #fecaca; background: rgba(248,113,113,.14); }
.tag-s.warn { color: #fde68a; background: rgba(251,191,36,.14); }
.tag-s.role { color: #bfdbfe; background: rgba(96,165,250,.14); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 18px; font-weight: 800; background: #0e0e10; border: 1px solid var(--brand-600); padding: 12px; border-radius: 10px; text-align: center; letter-spacing: .02em; user-select: all; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal-card h3 { font-size: 16px; }
.modal-card ul { margin: 0; padding-left: 18px; color: #d4d4d8; font-size: 13px; }
@media (max-width: 1100px) { .settings-grid, .admin-split { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .topbar-right:not([hidden]) { display: flex !important; margin-left: auto; }
  .topbar-right .sync, .topbar-right .co-logo { display: none; }
  #btnUser span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .filterbar { flex-direction: column; } .filterbar select { width: 100%; }
  .sup-row { grid-template-columns: 1fr 1fr 28px; } .sup-row input[data-f=lead] { display: none; }
  .kv { grid-template-columns: 1fr; }
}
@media print { .modal, .toast { display: none !important; } }
body.is-staff .mgr { display: none !important; }
body.is-staff #v-items .split { grid-template-columns: minmax(0, 1fr); }
.inline-row { display: flex; gap: 8px; align-items: center; }
.inline-row input { flex: 1; }
#coDetail .row-btns { flex-wrap: wrap; }
#coDetail .row-btns .btn { padding: 5px 8px; }

/* Install app (PWA) */
.install-btn { margin-left: auto; margin-right: 10px; white-space: nowrap; }
.install-btn:not([hidden]) + .topbar-right { margin-left: 0; }
.install-banner { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(45, 212, 191, .35); background: rgba(20, 184, 166, .08); border-radius: 12px; max-width: 420px; width: 100%; box-sizing: border-box; }
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 9px; flex: none; }
.install-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.install-text > b:first-child { display: block; font-size: 14px; margin-bottom: 2px; }
.install-text span { color: #a1a1aa; }
.install-text .i { width: 15px; height: 15px; vertical-align: -3px; }
.install-close { background: none; border: 0; color: #a1a1aa; font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 4px; align-self: flex-start; }
.install-close:hover { color: #fff; }
@media (max-width: 640px) { .install-btn { padding: 6px 9px; font-size: 12px; } }
@media print { .install-btn, .install-banner { display: none !important; } }

/* Label size picker */
.chips .chip-group { flex-basis: 100%; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #71717a; margin-top: 4px; }
.chips .chip-group:first-child { margin-top: 0; }
.chips .chip-group:empty { height: 2px; margin: 0; }
.custom-size { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.custom-size[hidden] { display: none; }
.custom-size .field { flex: 1; }
.custom-size .x-sep { padding-bottom: 10px; color: #71717a; }
.scan-note { font-size: 12.5px; line-height: 1.45; border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.scan-note[hidden] { display: none; }
.scan-note.ok { color: #5eead4; background: rgba(20, 184, 166, .08); }
.scan-note.warn { color: #fcd34d; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); }
.scan-note.bad { color: #fca5a5; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .4); }
.scan-note code { font-family: ui-monospace, monospace; }
.chip .chip-mark { margin-left: 5px; font-weight: 800; background: none !important; border: 0 !important; padding: 0 !important; width: auto !important; height: auto !important; display: inline !important; box-shadow: none !important; }
.chip .chip-mark.warn { color: #fbbf24; }
.chip .chip-mark.bad { color: #f87171; }
/* Per-label scan warning in the on-screen preview only (never printed: #printArea has no badges) */
#tubSheets .lab[data-scan="warn"], #shelfSheets .lab[data-scan="warn"] { box-shadow: inset 0 0 0 .5mm #f59e0b; }
#tubSheets .lab[data-scan="bad"], #shelfSheets .lab[data-scan="bad"] { box-shadow: inset 0 0 0 .6mm #ef4444; }
#tubSheets .lab[data-scan="warn"]::after, #shelfSheets .lab[data-scan="warn"]::after,
#tubSheets .lab[data-scan="bad"]::after, #shelfSheets .lab[data-scan="bad"]::after { position: absolute; top: .6mm; right: .6mm; font: 800 2.4mm/1 Inter, Arial, sans-serif; color: #fff; padding: .5mm .9mm; border-radius: .6mm; z-index: 2; }
#tubSheets .lab[data-scan="warn"]::after, #shelfSheets .lab[data-scan="warn"]::after { content: "300 dpi"; background: #d97706; }
#tubSheets .lab[data-scan="bad"]::after, #shelfSheets .lab[data-scan="bad"]::after { content: "won't scan"; background: #dc2626; }
.field-hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); }

/* Apps Host admin: companies list first; cards on phones */
.admin-co-cards, .admin-user-cards { display: none; }
.admin-co-card, .admin-user-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.admin-co-card.click { cursor: pointer; }
.admin-co-card.sel { border-color: rgba(20,184,166,.45); background: rgba(20,184,166,.07); box-shadow: 0 0 0 1px rgba(20,184,166,.2); }
.admin-co-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-co-card-head b { font-size: 15px; letter-spacing: -.01em; }
.admin-co-users { flex: none; color: var(--muted); font-size: 12.5px; text-align: right; white-space: nowrap; }
.admin-co-users b { color: #fff; font-size: 16px; display: block; line-height: 1.1; }
.admin-co-mods { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-co-actions { justify-content: flex-start; flex-wrap: wrap; }
.admin-user-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-user-meta { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.admin-user-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; background: #0e0e10; }
.picker label input { margin: 0; accent-color: var(--brand); }

@media (max-width: 760px) {
  .admin-stack { display: flex; flex-direction: column; gap: 16px; }
  .admin-stack .admin-list { order: 1; min-width: 0; }
  .admin-stack .admin-add { order: 2; min-width: 0; }
  .admin-co-table, .admin-user-table { display: none !important; }
  .admin-co-cards, .admin-user-cards { display: flex; flex-direction: column; gap: 10px; }
  .admin-topbar { height: auto; min-height: var(--top-h); flex-wrap: wrap; padding: 8px 12px; gap: 8px 10px; row-gap: 8px; }
  .admin-topbar .brand-text { display: none; }
  .admin-topbar .topbar-title { font-size: 13px; flex: 1; min-width: 0; }
  .admin-topbar .topbar-right { margin-left: 0; flex: none; gap: 6px; }
  .admin-topbar .topbar-right .btn-sm { padding: 7px 9px; font-size: 11.5px; }
  .admin-stack .row-btns { justify-content: flex-start; flex-wrap: wrap; }
  .admin-add .btn-primary { width: 100%; }
  #usersCard { margin-top: 12px !important; }
}
@media (max-width: 420px) {
  .admin-topbar .topbar-right #btnRefreshApp { padding-left: 8px; padding-right: 8px; }
  .admin-topbar .topbar-title { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
}


/* Admin ops console (v105) */
.admin-mod-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.admin-mod-ctl { display: inline-flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); min-width: 88px; }
.admin-mod-ctl select { font-size: 12px; padding: 5px 7px; border-radius: 8px; background: #141417; color: #e4e4e7; border: 1px solid var(--line-2); }
.admin-audit-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; margin-top: 10px; }
.admin-audit-row { display: grid; grid-template-columns: 140px 100px minmax(120px,1fr) minmax(0,1.4fr); gap: 8px; align-items: baseline; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid #202024; }
.admin-audit-row:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .admin-audit-row { grid-template-columns: 1fr; gap: 2px; }
  .admin-mod-ctl { min-width: 46%; flex: 1 1 46%; }
}
