/* =====================================================================
   PrintDeck — visual "Hub" (menu escuro, conteúdo claro)
   ===================================================================== */
:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --top-bg: rgba(244, 243, 239, .88);
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --surface-3: #e9e8e2;
  --border: #e0ded7;
  --border-2: #eae8e2;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7d7c77;
  --accent: #2a78d6;
  --accent-hover: #2468bd;
  --accent-ink: #ffffff;
  --accent-soft: #e4eefb;
  --filamento: #eb6834;
  --ok: #0f6b3a; --ok-bg: #e3f4ea; --ok-dot: #1baf7a;
  --err: #a1261f; --err-bg: #fbe6e5; --err-line: #d64541;
  --warn: #855700; --warn-bg: #fdf1d8;
  --side-bg: #ecebe6;
  --side-line: #e0ded7;
  --side-text: #52514e;
  --side-strong: #0b0b0b;
  --side-muted: #8a8984;
  --side-hover: rgba(0, 0, 0, .05);
  --side-active: #fcfcfb;
  --side-card: rgba(255, 255, 255, .55);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .03);
  --gap: 18px;
  --side-w: 236px;
  --top-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --top-bg: rgba(17, 17, 16, .88);
    --surface: #1a1a19; --surface-2: #20201f; --surface-3: #2a2a28;
    --border: #33332f; --border-2: #292927;
    --text: #ffffff; --text-2: #c3c2b7; --muted: #8f8e86;
    --accent: #3987e5; --accent-hover: #4c95ea; --accent-ink: #ffffff; --accent-soft: #1b2a3d;
    --filamento: #f07a45;
    --ok: #7fdca6; --ok-bg: #12301f; --ok-dot: #1baf7a;
    --err: #f3a19c; --err-bg: #3a1716; --err-line: #e5534b;
    --warn: #f0c46a; --warn-bg: #352710;
    --side-bg: #0c0c0b; --side-line: #262624; --side-text: #c3c2b7; --side-strong: #ffffff; --side-muted: #7f7e77;
    --side-hover: rgba(255, 255, 255, .05); --side-active: #1a1a19; --side-card: rgba(255, 255, 255, .03);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .2);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --top-bg: rgba(17, 17, 16, .88);
  --surface: #1a1a19; --surface-2: #20201f; --surface-3: #2a2a28;
  --border: #33332f; --border-2: #292927;
  --text: #ffffff; --text-2: #c3c2b7; --muted: #8f8e86;
  --accent: #3987e5; --accent-hover: #4c95ea; --accent-ink: #ffffff; --accent-soft: #1b2a3d;
  --filamento: #f07a45;
  --ok: #7fdca6; --ok-bg: #12301f; --ok-dot: #1baf7a;
  --err: #f3a19c; --err-bg: #3a1716; --err-line: #e5534b;
  --warn: #f0c46a; --warn-bg: #352710;
  --side-bg: #0c0c0b; --side-line: #262624; --side-text: #c3c2b7; --side-strong: #ffffff; --side-muted: #7f7e77;
  --side-hover: rgba(255, 255, 255, .05); --side-active: #1a1a19; --side-card: rgba(255, 255, 255, .03);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); } .ink { color: var(--text); } .small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
.txt-err { color: var(--err); } .txt-warn { color: var(--warn); } .txt-ok { color: var(--ok); }

/* ================= estrutura ================= */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side-bg); color: var(--side-text); overflow: visible; z-index: 20; border-right: 1px solid var(--side-line);
}
.side-brand { height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--side-line); text-decoration: none; color: var(--side-strong); }
.side-brand .logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.side-brand .logo .i { width: 17px; height: 17px; }
.side-brand b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.side-brand small { color: var(--side-muted); font-weight: 500; font-size: 13px; margin-left: 2px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 14px 10px; }
.side-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--side-muted); padding: 14px 10px 8px; text-transform: uppercase; white-space: nowrap; }
.side-sec:first-child { padding-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 7px;
  color: var(--side-text); text-decoration: none; font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: background .12s, color .12s;
}
.side-nav a .i { width: 17px; height: 17px; opacity: .8; }
.side-nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.side-nav a.on { background: var(--side-active); color: var(--side-strong); box-shadow: 0 0 0 1px var(--side-line); }
.side-nav a.on .i { color: var(--accent); }
.side-nav a.on .i { opacity: 1; }
.side-nav a .qtd { margin-left: auto; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--side-strong); }
.side-status { margin: 10px; padding: 12px; border-radius: 10px; background: var(--side-card); border: 1px solid var(--side-line); font-size: 12.5px; }
.side-status-head { display: flex; align-items: center; gap: 8px; color: var(--side-strong); font-weight: 600; }
.ss-nome { color: var(--side-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 8px; }
.side-status .progress { background: var(--surface-3); }
.ss-linha { display: flex; justify-content: space-between; color: var(--side-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ss-linha span:first-child { color: var(--side-strong); font-weight: 700; }
.ss-fila { color: var(--side-muted); margin-top: 6px; }
.side-toggle {
  position: absolute; top: 50%; right: -12px; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 1px var(--border), 0 1px 3px rgba(0,0,0,.12); z-index: 30;
}
.side-toggle .i { width: 14px; height: 14px; transition: transform .2s; }
.side-toggle:hover { filter: none; color: var(--accent); }
/* menu recolhido */
:root[data-lateral="recolhida"] { --side-w: 68px; }
:root[data-lateral="recolhida"] .side-brand { justify-content: center; padding: 0; }
:root[data-lateral="recolhida"] .side-brand span,
:root[data-lateral="recolhida"] .side-nav a span,
:root[data-lateral="recolhida"] .side-nav a .qtd,
:root[data-lateral="recolhida"] .side-sec,
:root[data-lateral="recolhida"] .side-status { display: none; }
:root[data-lateral="recolhida"] .side-nav a { justify-content: center; padding: 0; }
:root[data-lateral="recolhida"] .side-toggle .i { transform: rotate(180deg); }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(16px, 2.2vw, 36px); background: var(--top-bg); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.workspace {
  display: inline-flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-size: 13px; white-space: nowrap;
}
.workspace .rot { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.workspace .rot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.workspace .sep { width: 1px; height: 18px; background: var(--border); }
.workspace b { font-weight: 600; }
.top-dir { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-link { color: var(--text-2); text-decoration: none; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); filter: none; }
.icon-btn .i { width: 18px; height: 18px; }
.atencao-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px;
  color: var(--err); background: var(--surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--err) 45%, transparent);
  font-size: 13px; font-weight: 550; cursor: pointer; list-style: none;
}
.atencao-btn::-webkit-details-marker { display: none; }
.atencao-btn .qtd { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--err-line); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.atencao-btn.zero { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.atencao-btn.zero .qtd { background: var(--surface-3); color: var(--muted); }
details.atencao { position: relative; }
.atencao-painel {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(420px, 90vw); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(16,24,40,.14);
}
.atencao-painel h3 { margin: 0; padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.aviso-item { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); text-decoration: none; color: var(--text); }
.aviso-item:last-child { border-bottom: 0; }
.aviso-item:hover { background: var(--surface-2); }
.aviso-item .i { width: 17px; height: 17px; margin-top: 1px; }
.aviso-item.grave .i { color: var(--err); } .aviso-item.aviso .i { color: var(--warn); }
.aviso-item b { font-weight: 600; font-size: 13.5px; display: block; }
.aviso-item span { font-size: 12.5px; color: var(--muted); }
.avatar-top {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--filamento)));
  color: #fff; font-size: 12px; font-weight: 700; text-decoration: none;
}
.wrap { padding: 24px clamp(16px, 2.2vw, 36px) 56px; flex: 1; }
.tabbar, header.top { display: none; }

/* ================= cabeçalho da página ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .6; }
.crumbs .atual { color: var(--text); font-weight: 550; }
h2 { font-size: 14.5px; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -.005em; }
h2 .i { width: 16px; height: 16px; color: var(--muted); }
.section-title { margin: 28px 0 12px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* barra de ferramentas: abas segmentadas + ação */
.toolbar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.seg button, .seg a {
  height: 30px; padding: 0 14px; border-radius: 7px; background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 550; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover, .seg a:hover { background: var(--surface-2); color: var(--text); filter: none; }
.seg .on { background: var(--accent-soft) !important; color: var(--accent) !important; }
.seg .qtd { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.toolbar .info { font-size: 13px; color: var(--muted); }
.toolbar .dir { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* faixa de status */
.strip {
  display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: var(--gap);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--muted);
}
.strip b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.strip .dir { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.strip .st { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; }

/* ================= cartões ================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: var(--gap); box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head .sub2 { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-head.linha { margin: -18px -20px 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.card-foot form { display: contents; }
.count { font-size: 11.5px; font-weight: 600; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); text-align: center; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }
.legenda { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.grade { display: grid; gap: var(--gap); align-items: stretch; }
.grade > .card { margin-bottom: 0; }
.grade.l-2-1 { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); margin-bottom: var(--gap); }
.grade.l-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: var(--gap); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-v { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-d { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-d a { color: var(--accent); text-decoration: none; }
.delta { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; letter-spacing: 0; }
.delta.sobe { background: var(--ok-bg); color: var(--ok); }
.delta.desce { background: var(--err-bg); color: var(--err); }
.delta.neutro { background: var(--surface-3); color: var(--muted); }

/* barra "ação agora" */
.acao {
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: var(--gap);
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--err-line); border-radius: var(--radius);
}
.acao .rot { display: inline-flex; align-items: center; gap: 7px; color: var(--err); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.acao .rot .i { width: 16px; height: 16px; }
.acao.aviso { border-left-color: var(--warn); } .acao.aviso .rot { color: var(--warn); }
.acao .txt { font-weight: 500; }
.acao .mais-txt { color: var(--muted); font-size: 12.5px; }
.acao .dir { margin-left: auto; }

/* ================= formulários e botões ================= */
label { display: block; font-weight: 600; font-size: 12.5px; margin: 0 0 5px; color: var(--text-2); }
label.check { display: flex; align-items: center; gap: 6px; font-weight: 400; margin-top: 8px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
select.compact { width: auto; padding: 5px 9px; font-size: 12.5px; }
textarea { resize: vertical; min-height: 44px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; font-size: 13.5px;
  height: 36px; padding: 0 16px; border-radius: 8px; text-decoration: none; white-space: nowrap;
  transition: background .12s, filter .12s, transform .05s;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button .i, .btn .i { width: 15px; height: 15px; vertical-align: 0; }
button.block { width: 100%; height: 42px; font-size: 14px; }
.btn.ghost, button.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); }
.btn.sm, button.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn.icon, button.icon { width: 30px; padding: 0; flex: none; }
button.danger { background: var(--surface); color: var(--err); box-shadow: inset 0 0 0 1px var(--border); }
button.danger:hover { background: var(--err-bg); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
form.inline { display: inline; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 16px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.tem { border-style: solid; border-color: var(--accent); }
.drop input { display: none; }
.drop strong { display: block; font-size: 14px; color: var(--text); word-break: break-all; }
.drop-ico .i { width: 26px; height: 26px; color: var(--accent); }

.flash { padding: 11px 14px; border-radius: 8px; margin: 0 0 14px; font-size: 13.5px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.erro { background: var(--err-bg); color: var(--err); }
.flash.aviso { background: var(--warn-bg); color: var(--warn); }
.flash a { color: inherit; font-weight: 600; }
.flash .i { margin-right: 4px; }

/* ================= quadro "imprimindo agora" ================= */
.now { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.now-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.now-head strong { font-size: 14px; font-weight: 650; }
.now-flash { margin: 14px 20px 0; }
.chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip b { color: var(--text); }
.chip .i { width: 13px; height: 13px; color: var(--muted); vertical-align: -2px; }
.now-grid { display: grid; grid-template-columns: minmax(330px, 5fr) 7fr; flex: 1; }
.now-left { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.now-right { padding: 14px; border-left: 1px solid var(--border); min-width: 0; display: flex; flex-direction: column; }
.now-body { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
.now-info { min-width: 0; }
.eyebrow { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.now-title { font-size: 17px; font-weight: 650; line-height: 1.3; margin: 3px 0 3px; overflow-wrap: break-word; }
.now-info .muted { font-size: 12.5px; }
.big-pct { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-pct small { font-size: 20px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.now-times { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 26px; margin-top: 12px; }
.now-times .k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.now-times b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.now-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.now-actions form { display: contents; }
.now-obs { margin-top: -4px; }
.now .octo-cam img { width: 100%; max-width: 420px; border-radius: 8px; }
.now-idle { display: flex; align-items: center; gap: 16px; padding: 22px 20px; flex-wrap: wrap; flex: 1; }
.now-idle-ico .i { width: 34px; height: 34px; color: var(--muted); }
.now-idle .now-actions { margin-top: 12px; }
.now-idle .octo-cam { margin-left: auto; }
.now-idle .octo-cam img { width: 260px; }
.viz { position: relative; flex: 1; min-height: 340px; border-radius: 8px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, var(--surface) 0%, var(--surface-2) 100%); box-shadow: inset 0 0 0 1px var(--border); touch-action: none; }
.viz canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.viz-play { position: absolute; inset: 0; width: 100%; height: 100%; flex-direction: column; gap: 6px; background: transparent; color: var(--text); border-radius: 0; font-size: 14px; white-space: normal; }
.viz-play:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.viz-play-ico .i { width: 44px; height: 44px; color: var(--accent); }
.viz-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 20px; text-align: center; }
.viz-nota { margin: 10px 4px 0; }

/* ================= elementos comuns ================= */
.thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.thumb.lg { width: 76px; height: 76px; border-radius: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .i { width: 42%; height: 42%; color: var(--muted); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); margin-left: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.imprimindo { background: var(--accent-soft); color: var(--accent); }
.pill.concluida { background: var(--ok-bg); color: var(--ok); }
.pill.falhou { background: var(--err-bg); color: var(--err); }
.pill.cancelada { text-decoration: line-through; }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s ease; min-width: 4px; }
.progress.lg { height: 10px; border-radius: 5px; margin-top: 12px; }
.progress.lg > div { border-radius: 5px; }
.meta { color: var(--text-2); font-size: 12.5px; display: flex; gap: 3px 14px; flex-wrap: wrap; }
.meta .i { width: 13px; height: 13px; color: var(--muted); vertical-align: -2px; margin-right: 2px; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }
.empty .i { width: 18px; height: 18px; color: var(--ok-dot); margin-right: 4px; vertical-align: -4px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.on { background: var(--ok-dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok-dot) 22%, transparent); }
.dot.off { background: var(--muted); }
.dot.err { background: var(--err-line); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--text-2); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border);
}

/* ================= tabela da fila ================= */
.fila-card { padding-bottom: 6px; }
.tq { --cols: 32px minmax(200px, 2.6fr) minmax(110px, 1fr) minmax(100px, .9fr) 84px 124px 124px 84px 96px; }
.tq-dono { --cols: 32px minmax(200px, 2.6fr) minmax(110px, 1fr) minmax(100px, .9fr) 84px 124px 124px 84px 222px; }
.tq-cab, .tq-row { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; }
.tq-cab { padding: 8px 20px; margin: 0 -20px; background: var(--surface-2); border-block: 1px solid var(--border); font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tq-cab .n { text-align: right; }
.tq-row { padding: 12px 20px; margin: 0 -20px; border-bottom: 1px solid var(--border-2); transition: background .12s; }
.tq-row:last-child { border-bottom: 0; }
.tq-row:hover { background: var(--surface-2); }
.tq-row.mine { background: var(--accent-soft); }
.tq-pos { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 700; }
.tq-row.mine .tq-pos { background: var(--accent); color: var(--accent-ink); }
.tq-peca { display: flex; gap: 12px; align-items: center; min-width: 0; }
.tq-thumb { width: 42px; height: 42px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.tq-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tq-thumb .i { width: 19px; height: 19px; color: var(--muted); }
.tq-nome { min-width: 0; }
.tq-nome .title { font-weight: 600; line-height: 1.3; display: flex; align-items: center; min-width: 0; }
.tq-nome .nome-arq { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tq-nome .title .tag { flex: none; }
.tq-nome .sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.tq-nome .sub .i { width: 13px; height: 13px; }
.tq-nome .nota { font-size: 12px; color: var(--text-2); margin-top: 4px; display: flex; gap: 5px; align-items: flex-start; }
.tq-nome .nota .i { width: 13px; height: 13px; color: var(--muted); margin-top: 2px; }
.tq-amigo { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.tq-amigo span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-amigo .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.tq-mat { font-size: 13.5px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mat-chip { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.tq-num { text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tq-custo { font-weight: 650; }
.tq-acoes { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.tq-acoes form { display: contents; }

/* ================= listas (amigos no mês, histórico) ================= */
.lst-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border-2); }
.lst-row:last-child { border-bottom: 0; }
.lst-row .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lst-row .s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lst-row .s em { font-style: normal; color: var(--filamento); }
.lst-row .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.lst-row .v small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.lst-foot { font-size: 12px; color: var(--muted); padding-top: 12px; }

.hist-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 170px 64px 96px auto; gap: 14px; align-items: center;
  padding: 10px 20px; margin: 0 -20px; border-bottom: 1px solid var(--border-2); transition: background .12s;
}
.hist-row:last-child { border-bottom: 0; }
.hist-row:hover { background: var(--surface-2); }
.doc-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.doc-ico .i { width: 16px; height: 16px; }
.doc-ico.st-falhou { background: var(--err-bg); color: var(--err); }
.doc-ico.st-cancelada { background: var(--surface-3); color: var(--muted); }
.doc-ico.st-concluida { background: var(--ok-bg); color: var(--ok); }
.hist-main { min-width: 0; }
.hist-main .t { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main .s { font-size: 12px; color: var(--muted); margin-top: 1px; display: flex; gap: 2px 12px; flex-wrap: wrap; }
.hist-status { display: flex; align-items: center; gap: 6px; }
.hist-total { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.hist-data { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.hist-acoes { display: flex; gap: 6px; justify-content: flex-end; }
.hist-acoes form { display: contents; }
.hist-cab { display: grid; grid-template-columns: 34px minmax(0, 1fr) 170px 64px 96px auto; gap: 14px; padding: 0 20px 8px; margin: 0 -20px; border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.fin-rot { display: none; }

/* interruptor */
button.toggle { width: 36px; height: 20px; padding: 0; border-radius: 999px; position: relative; flex: none; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
button.toggle span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
button.toggle.on { background: var(--accent); box-shadow: none; }
button.toggle.on span { transform: translateX(16px); background: #fff; }
button.toggle:hover { filter: none; }

/* menus "⋯" */
details.mais { position: relative; display: inline-block; }
details.mais > summary { list-style: none; }
details.mais > summary::-webkit-details-marker { display: none; }
details.mais .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.14); }
.now details.mais .menu { right: auto; left: 0; }
details.mais .menu form { display: block; }
details.mais .menu button, details.mais .menu .btn { width: 100%; justify-content: flex-start; box-shadow: none; background: transparent; color: var(--text); }
details.mais .menu button:hover, details.mais .menu .btn:hover { background: var(--surface-2); }
details.mais .menu .txt-err { color: var(--err); }

/* configurações */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--gap); align-items: start; }
.cfg-grid > .card { margin-bottom: 0; }
details.fold { padding: 0; }
details.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 15px 20px; cursor: pointer; list-style: none; font-weight: 650; }
details.fold > summary .i { color: var(--muted); margin-right: 6px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; color: var(--muted); transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold > summary > span:first-child { margin-right: auto; }
details.fold > :not(summary) { margin: 0 20px 18px; }
details.fold[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.link-box { display: flex; gap: 8px; }
.link-box input { font-weight: 600; font-size: 12.5px; padding: 7px 10px; min-width: 0; }
.estoque { display: flex; flex-direction: column; gap: 14px; }
.est-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.est-barra { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; }
.est-barra > div { height: 100%; border-radius: 4px; background: var(--accent); }
.est-barra.falta > div { background: var(--err-line); }
dl.info { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 13px; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-caixa { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.qr-lado { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.qr-img { width: 160px; height: 160px; padding: 8px; background: #fff; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-nota { flex-basis: 100%; margin: 0; text-align: center; }
ol.passos { padding-left: 20px; margin: 0 0 14px; }
ol.passos li { margin-bottom: 4px; }
table.mat input[type=text] { padding: 6px 9px; }

/* gráfico */
.grafico { position: relative; height: 260px; }

/* ================= dashboard (página de gastos) ================= */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.stat .k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 8px; }
.stat .d { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { flex: none; height: 16px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row:hover .bar { opacity: .85; }
.bar-val { color: var(--text-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
th { color: var(--muted); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); border-bottom: 1px solid var(--border); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 1px solid var(--border); }

/* ================= página da fila (amigos) ================= */
.fila-page { display: grid; gap: var(--gap); align-items: stretch; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); grid-template-areas: "now env" "fila fila" "rec rec"; }
.fila-page > .card { margin-bottom: 0; }
.a-now { grid-area: now; } .a-env { grid-area: env; } .a-fila { grid-area: fila; } .a-rec { grid-area: rec; }
@media (min-width: 2000px) { .fila-page { grid-template-columns: minmax(0, 1fr) 440px; grid-template-areas: "now env" "fila rec"; } .fila-page .a-rec { align-self: start; } }

/* ================= responsivo ================= */
@media (max-width: 1500px) {
  .hist-row, .hist-cab { grid-template-columns: 34px minmax(0, 1fr) 150px 56px 90px auto; }
  .hist-acoes .rotulo { display: none; }
}
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade.l-2-1 { grid-template-columns: 1fr; }
  .now-grid { grid-template-columns: 1fr; }
  .now-right { border-left: 0; border-top: 1px solid var(--border); }
  .viz { flex: none; min-height: 0; aspect-ratio: 16 / 9; max-height: 460px; }
  .fila-page { grid-template-columns: minmax(0, 1fr); grid-template-areas: "now" "env" "fila" "rec"; }
  .cfg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) { :root:not([data-lateral="aberta"]) { --side-w: 68px; }
  :root:not([data-lateral="aberta"]) .side-brand { justify-content: center; padding: 0; }
  :root:not([data-lateral="aberta"]) .side-brand span, :root:not([data-lateral="aberta"]) .side-nav a span,
  :root:not([data-lateral="aberta"]) .side-nav a .qtd, :root:not([data-lateral="aberta"]) .side-sec,
  :root:not([data-lateral="aberta"]) .side-status { display: none; }
  :root:not([data-lateral="aberta"]) .side-nav a { justify-content: center; padding: 0; }
  .workspace .rot, .workspace .sep, .top-link { display: none; }
}
@media (max-width: 900px) { .grid2, .grid3, .grade.l-3 { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } }

/* celular */
@media (max-width: 720px) {
  :root { --gap: 12px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px; height: 54px; }
  .workspace { height: 34px; padding: 0 12px; }
  .atencao-btn span.txt { display: none; }
  .wrap { padding: 16px 12px 24px; }
  .crumbs { display: none; }
  h1 { font-size: 20px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--top-bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: var(--side-muted); text-decoration: none; }
  .tabbar a .i { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--side-strong); background: var(--side-active); }
  .tabbar a.on .i { color: var(--accent); }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-v { font-size: 20px; flex-wrap: wrap; gap: 6px; }
  .card { padding: 16px; }
  .card-head.linha { margin: -16px -16px 14px; padding: 14px 16px; }
  .tq-cab, .tq-row, .hist-row, .hist-cab { margin: 0 -16px; }
  .tq-row { padding: 12px 16px; grid-template-columns: 30px repeat(3, minmax(0, 1fr)); grid-template-areas: "pos peca peca peca" ". amigo amigo mat" ". dur ini fim" ". custo custo custo" "acoes acoes acoes acoes"; }
  .tq-num { white-space: normal; font-size: 13px; }
  .tq-acoes { justify-content: stretch; }
  .tq-acoes > form:first-child button { flex: 1; }
  .hist-cab { display: none; }
  .hist-row { padding: 12px 16px; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "ico main total" ". status cobrar" "acoes acoes acoes"; gap: 8px 12px; }
  .hist-row > .doc-ico { grid-area: ico; } .hist-main { grid-area: main; } .hist-total { grid-area: total; }
  .hist-status { grid-area: status; } .hist-cobrar { grid-area: cobrar; justify-self: end; }
  .hist-acoes { grid-area: acoes; }
  .hist-acoes > form:first-of-type > button { flex: 1; }
  .hist-acoes .rotulo { display: inline; }
  .fin-rot { display: inline; color: var(--muted); font-size: 12.5px; margin-right: 6px; }
  .now-head { padding: 10px 14px; }
  .chips { margin-left: 0; width: 100%; }
  .now-left { padding: 16px; }
  .now-body { grid-template-columns: 60px 1fr; }
  .thumb.lg { width: 60px; height: 60px; }
  .big-pct { font-size: 38px; }
  .now-times { grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
  .now-actions { display: grid; grid-template-columns: 1fr 1fr auto; }
  .now-actions button { width: 100%; }
  .viz { aspect-ratio: 1 / 1; }
  .strip .dir { margin-left: 0; }
  .toolbar .dir { margin-left: 0; width: 100%; }
  .toolbar .dir > * { flex: 1; }
  details.mais .menu { position: fixed; left: 12px !important; right: 12px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr { padding: 10px 0; border-bottom: 1px solid var(--border-2); }
  table.resp tbody tr:last-child { border-bottom: 0; }
  table.resp td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.resp td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; }
  table.resp td.t { font-weight: 600; text-align: left; word-break: break-word; }
  table.resp td.t::before { display: none; }
  tbody tr:hover td { background: none; }
}
@media (prefers-reduced-motion: reduce) { .progress > div, .shell { transition: none; } html { scroll-behavior: auto; } }

.col-cards { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.col-cards > .card { margin-bottom: 0; }

/* rolos de filamento */
.rolo-linha { font-size: 12.5px; color: var(--text-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.rolo-linha .i { width: 14px; height: 14px; color: var(--muted); }
.rolo-aviso { font-size: 12.5px; color: var(--err); background: var(--err-bg); border-radius: 7px; padding: 6px 9px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.rolo-aviso .i { width: 15px; height: 15px; }
.rolo-card { padding: 12px 0; border-bottom: 1px solid var(--border-2); }
.rolo-card:last-child { border-bottom: 0; }
.rolo-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rolo-card .cod { font-weight: 700; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }
.rolo-form { display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px auto; gap: 8px; align-items: end; margin-top: 10px; }
.rolo-form label { font-size: 11.5px; }
.rolo-form input { padding: 6px 9px; }
.extrato { margin-top: 8px; font-size: 12.5px; }
.extrato summary { cursor: pointer; color: var(--accent); list-style: none; }
.extrato summary::-webkit-details-marker { display: none; }
.extrato table td { padding: 4px 6px; }
.rolo-novo { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.rolo-arq { opacity: .6; }
@media (max-width: 720px) { .rolo-form { grid-template-columns: 1fr 1fr; } }

/* filamentos no dashboard */
.filamentos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.filamento { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); min-width: 0; }
.filamento.em-uso { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.filamento .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.filamento .cod { font-weight: 700; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13.5px; }
.filamento .qtd { margin-top: 8px; font-size: 13px; }
.filamento .qtd b { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.filamento .est-barra { height: 10px; border-radius: 5px; margin: 8px 0 6px; }
.filamento .est-barra > div { border-radius: 5px; transition: width .6s ease; }

/* % do rolo em destaque */
.rolo-card .rolo-qtd { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.rolo-card .rolo-qtd b { font-size: 16px; font-variant-numeric: tabular-nums; }
.filamento .qtd { display: flex; align-items: baseline; gap: 6px; }
.filamento .qtd .pct { margin-left: auto; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ================= mesa conjunta (várias peças numa impressão) ================= */
.juntar-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 0 12px; }
.juntar-bar .i { width: 14px; height: 14px; vertical-align: -2px; }
.tq-sel { position: relative; display: block; width: 26px; height: 26px; cursor: pointer; }
.tq-sel input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tq-sel .tq-pos { transition: background .12s, box-shadow .12s; }
.tq-sel:hover .tq-pos { box-shadow: inset 0 0 0 2px var(--accent); }
.tq-sel input:checked + .tq-pos { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.tq-sel input:focus-visible + .tq-pos { outline: 2px solid var(--accent); outline-offset: 2px; }
.mesa-svg { width: 100%; height: 100%; display: block; }
.mesa-svg .m { fill: var(--surface-3); stroke: var(--border); stroke-width: 2; }
.mesa-svg .p { fill: var(--accent); opacity: .9; }
.mesa-svg .p1 { opacity: .65; } .mesa-svg .p2 { opacity: .45; } .mesa-svg .p3 { opacity: .78; }
.tq-thumb.mesa, .thumb.mesa { padding: 3px; }
.pecas-lote { list-style: none; margin: 4px 0 2px; padding: 0 0 0 10px; border-left: 2px solid var(--border); font-size: 12px; display: grid; gap: 2px; }
.pecas-lote li { display: flex; gap: 8px; min-width: 0; }
.pecas-lote .nome-arq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text-2); }
.pecas-lote .muted { flex: none; white-space: nowrap; }
.juntar-op { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: pointer; font-size: 13.5px; }
.juntar-op[hidden] { display: none; }
.juntar-op input { margin-top: 3px; flex: none; width: auto; }
.link-admin { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-2); display: grid; gap: 8px; }
.link-admin .rot { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.link-admin .rot .muted { font-weight: 400; }
.link-admin .rot .i { width: 14px; height: 14px; color: var(--muted); }
.link-admin p { margin: 0; }
.link-admin form { display: flex; }

/* nome da impressão em cima, arquivo pequeno embaixo */
.tq-nome .arq, .now-arq { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; min-width: 0; }
.tq-nome .arq span, .now-arq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tq-nome .arq .i, .now-arq .i { width: 12px; height: 12px; flex: none; }
.arq-hist { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= fila: o formato depende da largura do cartão, não da janela =================
   largo: tabela de uma linha por peça · médio: duas linhas (amigo ao lado do nome) · estreito: três linhas */
.fila-card { container-type: inline-size; container-name: fila; }
@container fila (max-width: 699px) {
  .tq .tq-cab { display: none; }
  .tq .tq-row { grid-template-columns: 32px repeat(3, minmax(0, 1fr)) auto; grid-template-areas: "pos peca peca peca acoes" ". amigo mat dur ." ". ini fim custo ."; gap: 8px 14px; }
  .tq .tq-pos, .tq .tq-sel { grid-area: pos; align-self: start; margin-top: 8px; }
  .tq .tq-sel .tq-pos { margin-top: 0; }
  .tq .tq-peca { grid-area: peca; } .tq .tq-amigo { grid-area: amigo; } .tq .tq-mat { grid-area: mat; align-self: end; }
  .tq .tq-dur { grid-area: dur; } .tq .tq-ini { grid-area: ini; } .tq .tq-fim { grid-area: fim; } .tq .tq-custo { grid-area: custo; }
  .tq .tq-num { text-align: left; }
  .tq .tq-num[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .tq .tq-acoes { grid-area: acoes; align-self: start; }
}
@container fila (min-width: 700px) and (max-width: 1059px) {
  .tq .tq-cab { display: none; }
  .tq .tq-row { grid-template-columns: 32px repeat(5, minmax(0, 1fr)) auto; grid-template-areas: "pos peca peca peca amigo amigo acoes" "pos mat dur ini fim custo acoes"; gap: 8px 14px; }
  .tq .tq-pos, .tq .tq-sel { grid-area: pos; align-self: start; margin-top: 8px; }
  .tq .tq-sel .tq-pos { margin-top: 0; }
  .tq .tq-peca { grid-area: peca; } .tq .tq-amigo { grid-area: amigo; } .tq .tq-mat { grid-area: mat; align-self: end; }
  .tq .tq-dur { grid-area: dur; } .tq .tq-ini { grid-area: ini; } .tq .tq-fim { grid-area: fim; } .tq .tq-custo { grid-area: custo; }
  .tq .tq-num { text-align: left; }
  .tq .tq-num[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .tq .tq-acoes { grid-area: acoes; align-self: center; }
}
/* o administrativo tem mais botões por linha: precisa de um cartão mais largo para caber em uma linha só */
@container fila (min-width: 1060px) and (max-width: 1189px) {
  .tq-dono .tq-cab { display: none; }
  .tq-dono .tq-row { grid-template-columns: 32px repeat(5, minmax(0, 1fr)) auto; grid-template-areas: "pos peca peca peca amigo amigo acoes" "pos mat dur ini fim custo acoes"; gap: 8px 14px; }
  .tq-dono .tq-pos, .tq-dono .tq-sel { grid-area: pos; align-self: start; margin-top: 8px; }
  .tq-dono .tq-sel .tq-pos { margin-top: 0; }
  .tq-dono .tq-peca { grid-area: peca; } .tq-dono .tq-amigo { grid-area: amigo; } .tq-dono .tq-mat { grid-area: mat; align-self: end; }
  .tq-dono .tq-dur { grid-area: dur; } .tq-dono .tq-ini { grid-area: ini; } .tq-dono .tq-fim { grid-area: fim; } .tq-dono .tq-custo { grid-area: custo; }
  .tq-dono .tq-num { text-align: left; }
  .tq-dono .tq-num[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .tq-dono .tq-acoes { grid-area: acoes; align-self: center; }
}

/* impressões feitas (reimprimir com um clique) */
.feita-acoes { display: flex; gap: 6px; align-items: center; }
.feita-acoes form { display: contents; }
@media (max-width: 720px) { .lst-row.feita { grid-template-columns: 32px minmax(0, 1fr); } .feita-acoes { grid-column: 2; } }

.link-btn { background: none; border: 0; box-shadow: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; height: auto; min-height: 0; }
