@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --page: #f3f3f5;
  --side: #f9f9f9;
  --hover: #ececec;
  --soft: #f4f4f4;
  --line: #e5e5e5;
  --line-2: #d9d9d9;
  --text: #0d0d0d;
  --muted: #8f8f8f;
  --primary: #0d0d0d;
  --on-primary: #ffffff;
  --ok: #10a37f;
  --warn: #d97706;
  --err: #e02e2a;
  --info: #2f7bf5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121;
    --page: #181818;
    --side: #171717;
    --hover: #2f2f2f;
    --soft: #2a2a2a;
    --line: #333333;
    --line-2: #424242;
    --text: #ececec;
    --muted: #9b9b9b;
    --primary: #ececec;
    --on-primary: #0d0d0d;
    color-scheme: dark;
  }
}

/* sem animações em lugar nenhum */
*, *::before, *::after { box-sizing: border-box; transition: none !important; animation: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13.5px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- estrutura */
.shell { display: flex; height: 100vh; height: 100dvh; }
.sidebar {
  width: 260px; flex: none; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 8px; overflow-y: auto;
}
.side-top { display: none; justify-content: flex-end; padding: 4px 4px 10px; }
.sidebar > .side-nav:first-of-type { margin-top: 6px; }
.wordmark { font-size: 18.5px; font-weight: 600; letter-spacing: -0.01em; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: 8px; font-size: 15px; color: var(--text);
}
.side-nav a:hover { background: var(--hover); }
.side-nav a.active { background: var(--hover); font-weight: 500; }
.side-nav a .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.side-nav a .dot { margin-left: auto; }
.side-section { color: var(--muted); font-size: 14px; padding: 20px 10px 6px; }
.side-bottom {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-top: 1px solid var(--line);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #3b3b3b; color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex: none;
}
.who { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.who b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.main-top {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 28px;
  border-bottom: 1px solid var(--line);
}
.main-top h2 { margin: 0; font-size: 18.5px; font-weight: 600; letter-spacing: -0.01em; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.page { padding: 24px 28px 40px; width: 100%; display: flex; flex-direction: column; gap: 16px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.only-mobile { display: none; }
.scrim { display: none; }

/* ---------------------------------------------------------------- blocos */
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); min-width: 0; }
.panel.pad { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head a { color: var(--muted); font-size: 14px; }
.panel-head a:hover { color: var(--text); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.tile:hover { background: var(--soft); }
.tile-k { color: var(--muted); font-size: 13.5px; }
.tile-v { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.tile-v > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-v.num { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--soft); cursor: pointer; border: 0; text-align: left; min-width: 0;
}
.step:hover { background: var(--hover); }
.step .n {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--muted); flex: none;
}
.step.done { background: transparent; border: 1px solid var(--line); cursor: default; }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done span:last-child { color: var(--muted); }
.step span:last-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- tabela */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 13.5px; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--soft); }
.table td.b { font-weight: 500; }
.table td.clip { max-width: 1px; width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.m { color: var(--muted); white-space: nowrap; }
.table td.r { text-align: right; white-space: nowrap; }
.table .err-text { display: block; color: var(--err); font-size: 13px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  font-weight: 500; font-size: 14.5px; white-space: nowrap;
}
.btn:hover { background: var(--soft); }
.btn:disabled, .btn.loading { opacity: 0.55; cursor: default; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary); opacity: 0.85; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13.5px; }
.btn-link { border: 0; background: none; color: var(--muted); height: auto; padding: 4px 6px; }
.btn-link:hover { background: none; color: var(--text); }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.field > span { font-size: 14px; font-weight: 500; display: flex; gap: 8px; align-items: baseline; }
.field small { color: var(--muted); font-size: 13.5px; font-weight: 400; }
.input, select.input {
  height: 40px; padding: 0 14px; border-radius: 12px; width: 100%;
  border: 1px solid var(--line-2); background: var(--bg); outline: none;
}
.input::placeholder { color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .input { flex: 1; min-width: 0; }
.inline .x { color: var(--muted); }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--soft); align-self: flex-start; max-width: 100%; overflow-x: auto; }
.tabs.full { display: flex; align-self: stretch; }
.tabs.full button { flex: 1; }
.tabs button {
  border: 0; background: transparent; height: 32px; padding: 0 16px; border-radius: 99px;
  cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; height: 30px; padding: 0 12px; cursor: pointer; font-family: "Geist Mono", monospace; font-size: 13px; }
.chips button:hover { background: var(--soft); }
.chips button.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.panel-title + .row-toggle { border-top: 0; padding-top: 0; }
.row-toggle b { font-weight: 500; }
.switch {
  appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 99px; flex: none;
  background: var(--line-2); position: relative; cursor: pointer; margin: 0;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.switch:checked { background: var(--ok); }
.switch:checked::after { left: 19px; }

.copy-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--soft); }
.copy-box code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.copy-box code::-webkit-scrollbar { display: none; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--soft); color: var(--muted); }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.chip.err { color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }
.chip.info { color: var(--info); background: color-mix(in srgb, var(--info) 10%, transparent); }

.note { padding: 12px 16px; border-radius: 12px; font-size: 14.5px; background: var(--soft); }
.note.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.note.err { color: var(--err); background: color-mix(in srgb, var(--err) 8%, transparent); }

/* ---------------------------------------------------------------- etiqueta */
.stage {
  display: grid; place-items: center; padding: 48px 24px; min-height: 280px; background: var(--soft);
  border: 0;
}
.label {
  width: 100%; max-width: 360px; background: #fff; color: #000; border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.06);
  container-type: inline-size; font-family: "Geist", sans-serif;
}
/* mesmas proporções da térmica 80mm: 15mm em cima e embaixo, ~4mm nas laterais (cqw = largura da etiqueta) */
.label-pad { padding: 20.8cqw 5.5cqw; text-align: center; }
.label-block { display: inline-block; text-align: left; max-width: 100%; }
.label-block div { font-size: 5.67cqw; line-height: 7.33cqw; overflow-wrap: anywhere; }
.label-block .l-name { font-size: 8.33cqw; line-height: 8.33cqw; margin-bottom: 1.2cqw; white-space: nowrap; }

/* ---------------------------------------------------------------- avisos */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14.5px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.toast.err { background: var(--err); color: #fff; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1280px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .cols { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .only-mobile { display: grid; }
  .side-top { display: flex; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 280px; transform: translateX(-100%); }
  .shell.side-open .sidebar { transform: none; }
  .shell.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
  .main-top { padding: 8px 12px; min-height: 54px; }
  .top-actions .btn span { display: none; }
  .page { padding: 16px 16px 32px; gap: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(5), .table td:nth-child(5) { display: none; }
  .table th, .table td { padding: 10px 12px; }
  .table td.clip { width: auto; }
  .panel.pad { padding: 16px; }
  .stage { padding: 28px 16px; min-height: 180px; }
}
.panel.pad > .btn { align-self: flex-start; }

.muted { color: var(--muted); font-size: 13.5px; }
.printer { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.printer:last-child { border-bottom: 0; }
.printer:hover { background: var(--soft); }
.printer .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; flex: none; color: var(--muted); }
.printer.sel .ic { background: var(--text); color: var(--bg); }
.printer .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.printer .info b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.printer .tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- fila */
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats3 div { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.stats3 span { color: var(--muted); font-size: 13.5px; }
.stats3 b { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stats3 b.err { color: var(--err); }

.fila-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.show-tests { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; white-space: nowrap; }

.day { margin-top: 6px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.day-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.job { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; }
.job:hover { background: var(--soft); }
.job-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.job-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.job-title b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-num { font-family: "Geist Mono", monospace; font-size: 13.5px; color: var(--muted); flex: none; }
.job-products { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.job-products span { font-size: 13.5px; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 1px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-error { font-size: 13px; color: var(--err); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.job-time { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.job-actions { display: flex; gap: 4px; justify-content: flex-end; min-width: 96px; }

@media (max-width: 760px) {
  .stats3 { gap: 8px; }
  .stats3 div { padding: 10px 12px; }
  .stats3 b { font-size: 21.5px; }
  .fila-bar .tabs { order: 2; width: 100%; }
  .search { order: 1; }
  .show-tests { order: 1; }
  .job { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  .job-actions { grid-column: 1 / -1; justify-content: flex-start; min-width: 0; }
  .job-actions:empty { display: none; }
}

/* campos de texto: sem destaque de borda/contorno ao clicar ou passar o mouse */
.input, .input:hover, .input:focus, .search, .search:hover, .search:focus-within,
.search input, .search input:focus, input:focus, select:focus { outline: none; box-shadow: none; }
.input:focus, .input:hover { border-color: var(--line-2); }
.search:focus-within, .search:hover { border-color: var(--line-2); }

/* ---------------------------------------------------------------- navbar no topo */
.shell { display: block; height: auto; min-height: 100vh; }
.main { overflow: visible; }
.topnav {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  display: flex; align-items: stretch; gap: 16px; height: 56px; padding: 0 28px;
  border-bottom: 1px solid var(--line);
}
.topnav-tabs { display: flex; align-items: stretch; gap: 28px; }
.topnav-tabs a {
  position: relative; display: flex; align-items: center; gap: 8px;
  font-size: 15.5px; font-weight: 500; color: var(--muted);
}
.topnav-tabs a:hover { color: var(--text); }
.topnav-tabs a.active { color: var(--text); }
.topnav-tabs a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px 2px 0 0;
}
.topnav-tabs .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center;
}
.topnav .top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .topnav { padding: 0 16px; height: 52px; }
  .topnav-tabs { gap: 22px; }
  .topnav .top-actions .btn span { display: none; }
}

/* ---------------------------------------------------------------- tabela da fila */
.jtable { border: 1px solid var(--line); border-radius: 16px; }
.jhead, .jrow {
  display: grid; align-items: center; column-gap: 20px; padding: 0 18px;
  grid-template-columns: 120px minmax(150px, 1.1fr) minmax(200px, 2fr) 170px 76px 140px;
}
.jhead {
  position: sticky; top: 56px; z-index: 4; height: 42px; background: var(--bg);
  border-bottom: 1px solid var(--line); border-radius: 16px 16px 0 0;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.jrow { min-height: 56px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.jrow:last-child { border-bottom: 0; border-radius: 0 0 16px 16px; }
.jrow:hover { background: var(--soft); }
.jrow > div { min-width: 0; }
.c-num { font-family: "Geist Mono", monospace; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-prod { display: flex; gap: 6px; overflow: hidden; white-space: nowrap; }
.c-prod span { font-size: 13.5px; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.jrow:hover .c-prod span { background: var(--bg); }
.c-status { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-status .job-error { font-size: 13px; color: var(--err); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.c-time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-act { display: flex; justify-content: flex-end; gap: 4px; }

@media (max-width: 1100px) {
  .jhead, .jrow { grid-template-columns: 100px minmax(130px, 1fr) minmax(150px, 1.4fr) 120px 64px 124px; column-gap: 14px; }
  .c-status .job-error { display: none; }
}
@media (max-width: 760px) {
  .jhead { display: none; }
  .jrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; column-gap: 10px; padding: 12px 14px; }
  .c-name { grid-column: 1; grid-row: 1; }
  .c-status { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .c-num { grid-column: 1; grid-row: 2; }
  .c-time { grid-column: 2; grid-row: 2; text-align: right; }
  .c-prod { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; white-space: normal; }
  .c-act { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
  .c-act:empty { display: none; }
  .jhead + .jrow { border-radius: 16px 16px 0 0; }
}

/* ---------------------------------------------------------------- fundo cinza bem claro */
html, body { background: var(--page); }
.topnav { background: var(--page); }
.jtable, .jhead, .stats3 div, .panel, .search, #jobs-empty { background: var(--bg); }
#jobs-empty { border: 1px solid var(--line); border-radius: 16px; }
.tabs { background: #e8e8eb; }
@media (prefers-color-scheme: dark) { .tabs { background: var(--hover); } }
.jrow:hover { background: var(--page); }
.jrow:hover .c-prod span { background: var(--bg); }
.printer:hover { background: var(--page); }

/* produtos: uma linha só, cortada com "…" quando não couber (lista completa no title) */
.c-prod { display: block; overflow: hidden; white-space: nowrap; }
.c-prod span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
@media (max-width: 760px) { .c-prod { white-space: nowrap; } }

/* ---------------------------------------------------------------- altura total da tela */
/* a página não rola; o bloco principal vai até o fim da tela e rola por dentro */
.main { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.topnav { flex: none; }
.page:not([hidden]) { flex: 1; min-height: 0; }
.page { padding-bottom: 24px; }

[data-page="fila"] > * { flex: none; }
[data-page="fila"] > #jobs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#jobs:empty { display: none; }
[data-page="fila"] > #jobs-empty { flex: 1; min-height: 160px; display: grid; place-items: center; }
[data-page="fila"] > #jobs-empty[hidden] { display: none; }
.jtable { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.jhead { top: 0; }

/* impressoras direto no fundo da página, separadas por uma linha */
[data-page="impressora"] > .panel { flex: none; background: transparent; border: 0; border-radius: 0; overflow: visible; }
[data-page="impressora"] .printer { padding: 16px 4px; border-bottom: 1px solid var(--line-2); }
[data-page="impressora"] .printer:last-child { border-bottom: 1px solid var(--line-2); }
[data-page="impressora"] .printer:hover { background: transparent; }
[data-page="impressora"] .printer .ic { background: var(--bg); }
[data-page="impressora"] .printer.sel .ic { background: var(--text); }
[data-page="impressora"] #printers-empty:not([hidden]) { padding: 48px 4px; text-align: left; border-bottom: 1px solid var(--line-2); }

@media (max-width: 760px) {
  .page { padding-bottom: 16px; }
}

/* barra de rolagem dentro dos blocos: fina e discreta */
.jtable { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.jtable::-webkit-scrollbar { width: 10px; }
.jtable::-webkit-scrollbar-track { background: transparent; margin: 44px 0 12px; }
.jtable::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--bg); }
[data-page="impressora"] { overflow-y: auto; }

/* impressora: nome e tipo de conexão lado a lado */
[data-page="impressora"] .printer .info { flex-direction: row; align-items: center; gap: 10px; }
[data-page="impressora"] .printer .info b { flex: 0 1 auto; min-width: 0; }
[data-page="impressora"] .printer .tags { flex: none; flex-wrap: nowrap; }

/* aviso da impressora (sem papel, tampa aberta, papel acabando) */
.alert { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; font-size: 15px; flex: none; }
.alert svg { width: 20px; height: 20px; flex: none; }
.alert b { font-weight: 600; }
.alert.err { background: color-mix(in srgb, var(--err) 9%, var(--bg)); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 25%, transparent); }
.alert.warn { background: color-mix(in srgb, var(--warn) 10%, var(--bg)); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.alert span { color: var(--text); opacity: 0.75; }

/* status com ponto colorido (Na fila = amarelo, Imprimindo = azul, Impressa = verde, Falhou = vermelho) */
.dot-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot-chip { gap: 7px; }

/* fotos dos produtos: quadrado com as imagens empilhadas */
.c-prod { display: flex !important; align-items: center; gap: 12px; }
.c-prod > span:last-child { min-width: 0; }
.thumbs { position: relative; width: 44px; height: 40px; flex: none; }
.thumbs img {
  position: absolute; width: 36px; height: 36px; object-fit: cover; border-radius: 9px;
  background: var(--soft); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line);
}
.thumbs img.l0 { left: 0; top: 4px; z-index: 3; }
.thumbs img.l1 { left: 4px; top: 2px; z-index: 2; }
.thumbs img.l2 { left: 8px; top: 0; z-index: 1; }
.thumbs.n1 img.l0 { left: 2px; top: 2px; }
.thumbs.empty { display: grid; place-items: center; width: 36px; height: 36px; margin: 2px 6px 2px 2px; border-radius: 9px; background: var(--soft); color: var(--muted); box-shadow: 0 0 0 1px var(--line); }
.thumbs.empty svg { width: 16px; height: 16px; }
.jrow { min-height: 60px; }

/* Impressora sem nenhuma conectada: aviso e mensagem no centro da tela */
[data-page="impressora"].is-empty { justify-content: center; align-items: center; gap: 18px; text-align: center; }
[data-page="impressora"].is-empty > .alert { width: fit-content; max-width: min(820px, 100%); justify-content: center; text-align: left; }
[data-page="impressora"].is-empty > .panel { width: 100%; max-width: 640px; }
[data-page="impressora"].is-empty #printers-empty:not([hidden]) {
  border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-height: 0;
}
[data-page="impressora"].is-empty #printers-empty b { font-size: 17px; font-weight: 600; color: var(--text); }
[data-page="impressora"].is-empty #printers-empty span { color: var(--muted); }
#printers-empty b { display: block; }

/* aviso: título numa linha e a descrição logo abaixo */
.alert { align-items: flex-start; }
.alert svg { margin-top: 2px; }
.alert-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-text span { opacity: 1; color: var(--muted); }
[data-page="impressora"].is-empty > .alert { text-align: left; }

/* Impressora vazia com aviso: só o aviso, centralizado (título e uma descrição) */
[data-page="impressora"].is-empty.has-alert > .panel { display: none; }
[data-page="impressora"].is-empty > .alert { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 28px; }
[data-page="impressora"].is-empty > .alert svg { margin-top: 0; }
[data-page="impressora"].is-empty .alert-text { align-items: center; }

/* Impressora sem nenhuma conectada: só o texto, direto no fundo */
[data-page="impressora"].is-empty > .panel { background: transparent; border: 0; box-shadow: none; }
[data-page="impressora"].is-empty #printers-empty:not([hidden]) { background: transparent; border: 0; }
