@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-400.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-500.woff2) format("woff2"); font-weight: 500; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-600.woff2) format("woff2"); font-weight: 600; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-400.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-600.woff2) format("woff2"); font-weight: 600; }

/* Três planos: barra de título (mais escura), bancada à esquerda (azulada, é onde se trabalha)
   e a lista (neutra). O azul Speedbird marca foco, seleção e a vista ativa; o resto é cinzento. */
:root {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f7fa; --field: #ffffff;
  --side: #eef2f8; --side-rule: #d8e0eb;
  --rule: #e3e8ee; --rule-strong: #cdd5df;
  --ink: #141b24; --ink-2: #4b5768; --ink-3: #6c788a;
  --bar: #0f151d; --bar-ink: #aab4c2; --bar-hover: #1d2631; --bar-rule: #2a3440;
  --accent: #1e50c0; --accent-ink: #1e50c0; --accent-bg: #e8effc; --accent-h: #2a5fd4;
  --cta: #18202b; --cta-ink: #ffffff; --cta-h: #2c3644;
  --btn-h: #eef1f5; --pop: #ffffff;
  --temp: #b45309; --temp-bg: #fef3e2;
  --assy: #1d4ed8; --assy-bg: #e6edfd;
  --week: #047857; --week-bg: #e3f5ee;
  --void: #b91c1c; --void-bg: #fdecec;
  --sel: #e8effc; --sel-rule: #c5d5f4; --hover: #f4f6f9;
  --focus: #2563eb;
  --shadow: 0 10px 30px rgba(15, 23, 35, .16), 0 1px 3px rgba(15, 23, 35, .08);
  --sans: "Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Plex Mono", Consolas, monospace;
  --t: 140ms ease-out;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1217; --surface: #0d1217; --surface-2: #121920; --field: #0a0f14;
    --side: #111925; --side-rule: #1d2836;
    --rule: #1c242e; --rule-strong: #2b3644;
    --ink: #e6ebf2; --ink-2: #a2adbc; --ink-3: #758195;
    --bar: #080b0f; --bar-ink: #98a3b3; --bar-hover: #161d26; --bar-rule: #222b36;
    --accent: #3a6df0; --accent-ink: #8eaeff; --accent-bg: rgba(58, 109, 240, .16); --accent-h: #4d7cf5;
    --cta: #e6eaf0; --cta-ink: #11161d; --cta-h: #ffffff;
    --btn-h: #18212b; --pop: #16202b;
    --temp: #fbbf24; --temp-bg: rgba(251, 191, 36, .12);
    --assy: #93b4ff; --assy-bg: rgba(147, 180, 255, .13);
    --week: #34d399; --week-bg: rgba(52, 211, 153, .12);
    --void: #f87171; --void-bg: rgba(248, 113, 113, .12);
    --sel: rgba(58, 109, 240, .14); --sel-rule: rgba(58, 109, 240, .32); --hover: #121a22;
    --focus: #6b9bff;
    --shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .04) inset;
  }
}
@media (prefers-reduced-motion: reduce) { :root { --t: 0ms; } * { animation: none !important; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans);
  font-variant-numeric: tabular-nums; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
input, select, button { font: inherit; color: inherit; }
/* texto selecionável (para copiar nomes, códigos…); botões e cabeçalhos não */
button, th, .menu, nav, .combo-btn { user-select: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* campos e listas já mostram o foco pela borda: sem contorno extra por cima */
input:focus-visible, select:focus-visible, .combo-btn:focus-visible, .scroll:focus-visible { outline: none; }
svg.i { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- barra de topo */
.top { background: var(--bar); display: flex; align-items: center; gap: 22px; height: 44px; padding-left: 16px; user-select: none; border-bottom: 1px solid var(--bar-rule); }
.top .brand { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: var(--bar-ink); white-space: nowrap; }
.top .brand img { height: 18px; display: block; pointer-events: none; }
.top .brand span { padding-left: 12px; border-left: 1px solid var(--bar-rule); line-height: 16px; }
/* vistas como separadores: a ativa fica sublinhada a azul */
.views { display: flex; align-self: stretch; gap: 4px; }
.views button { position: relative; border: 0; background: none; color: var(--bar-ink); padding: 0 12px; font-size: 13.5px; font-weight: 500; transition: color var(--t); }
.views button:hover { color: #fff; }
.views button[aria-pressed="true"] { color: #fff; }
.views button[aria-pressed="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent-h); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.top nav button { display: inline-flex; align-items: center; gap: 7px; height: 30px; background: none; color: var(--bar-ink); border: 0; padding: 0 10px; border-radius: 6px; font-size: 13px; transition: background var(--t), color var(--t); }
.top nav button:hover, .top nav button[aria-expanded="true"] { background: var(--bar-hover); color: #fff; }
.top nav .chev { width: 10px; height: 10px; opacity: .7; }
/* ---------------------------------------------------------------- botões
   .btn: secundário com contorno · .btn.primary: azul · .btn.ghost: sem contorno · .btn.danger: vermelho */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--rule-strong); border-radius: 8px; background: transparent; color: var(--ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background var(--t), border-color var(--t), color var(--t);
}
.btn:hover:not(:disabled) { background: var(--btn-h); border-color: var(--ink-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-h); border-color: var(--accent-h); }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); border-color: transparent; }
.btn.danger { color: var(--void); }
.btn.danger:hover:not(:disabled) { background: var(--void-bg); border-color: color-mix(in srgb, var(--void) 45%, transparent); }
.btn.warn { background: var(--temp-bg); border-color: transparent; color: var(--temp); font-weight: 600; }
.btn.warn:hover:not(:disabled) { background: var(--temp-bg); border-color: color-mix(in srgb, var(--temp) 45%, transparent); }
.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-3); transition: background var(--t), color var(--t); }
.icon-btn:hover:not(:disabled) { background: var(--btn-h); color: var(--ink); }
.icon-btn:disabled { opacity: .45; cursor: progress; }
.icon-btn.spin { opacity: 1; color: var(--accent-ink); }
.icon-btn.spin svg { animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.link { border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 4px; color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- campos */
input, select {
  height: 36px; width: 100%; min-width: 0; padding: 0 11px; outline: none;
  border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--field);
  transition: border-color var(--t), box-shadow var(--t);
}
select { appearance: none; padding-right: 30px; cursor: pointer;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5' fill='none' stroke='%23808b9b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; }
input::placeholder { color: var(--ink-3); opacity: .8; }
input:hover, select:hover { border-color: var(--ink-3); }
input:focus, select:focus { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 14%, transparent); }
input:disabled { opacity: .45; cursor: not-allowed; }
.help { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span, .f > label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.span2 { grid-column: span 2; }

/* lista própria (substitui o <select> nativo, que fica escondido e continua a ser a fonte do valor) */
select.native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combo { position: relative; min-width: 0; }
.combo-btn {
  width: 100%; height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 6px; text-align: left;
  border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--field); transition: border-color var(--t), box-shadow var(--t);
}
.combo-btn:hover { border-color: var(--ink-3); }
.combo-btn:focus-visible { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 14%, transparent); }
.combo-btn[aria-expanded="true"] { border-color: var(--focus); box-shadow: none; }
.combo-btn .v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; overflow: hidden; }
.combo-btn .v span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-btn .v.plain { padding-left: 5px; }
.combo-btn > svg { width: 10px; height: 10px; flex: none; color: var(--ink-3); transition: rotate var(--t); }
.combo-btn[aria-expanded="true"] > svg { rotate: 180deg; }
.chip { font: 600 12px/1 var(--mono); letter-spacing: .3px; padding: 5px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--rule); flex: none; }
.combo-pop {
  position: fixed; z-index: 70; background: var(--pop); border: 1px solid var(--rule-strong); border-radius: 10px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: pop 120ms ease-out;
}
@keyframes pop { from { translate: 0 -4px; } }
.combo-pop .q { display: flex; align-items: center; gap: 8px; padding: 2px 12px; border-bottom: 1px solid var(--rule); color: var(--ink-3); }
.combo-pop .q input { height: 38px; border: 0; padding: 0; background: none; }
.combo-pop .q input:focus { box-shadow: none; }
.combo-pop ul { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.combo-pop li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.combo-pop li.plain { grid-template-columns: 1fr; }
.combo-pop li small { grid-column: 2; color: var(--ink-3); font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-pop li.plain small { grid-column: 1; }
.combo-pop li[aria-selected="true"] { color: var(--accent-ink); font-weight: 500; }
.combo-pop li[aria-selected="true"] .chip { border-color: var(--sel-rule); color: var(--accent-ink); }
.combo-pop li.on { background: var(--sel); }
.combo-pop li.act { color: var(--accent-ink); border-top: 1px solid var(--rule); border-radius: 0 0 6px 6px; margin-top: 4px; grid-template-columns: 1fr; }
.combo-pop .none { padding: 14px 10px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- disposição */
main { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 0; }
.panel { background: var(--surface); min-height: 0; }

/* bancada (Novo PN): plano próprio, com a etiqueta e o botão sempre à vista em baixo */
.compose { background: var(--side); border-right: 1px solid var(--side-rule); display: flex; flex-direction: column; }
.compose-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; }
.compose-body > * { flex-shrink: 0; }
.compose h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.1px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-3); }
.group + .group { padding-top: 14px; border-top: 1px solid var(--side-rule); }
.compose-foot { padding: 16px 22px 18px; border-top: 1px solid var(--side-rule); display: flex; flex-direction: column; gap: 12px; background: color-mix(in srgb, var(--side) 70%, var(--bar)); }
@media (prefers-color-scheme: light) { .compose-foot { background: color-mix(in srgb, var(--side) 92%, #8fa3c0); } }

/* bloco do meio: controlo segmentado */
.mid { display: grid; grid-template-columns: 1fr 1fr 1fr 70px; gap: 0; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--field); padding: 3px; }
.mid button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 30px; padding: 0 8px;
  border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-weight: 500; transition: background var(--t), color var(--t);
}
.mid button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .8; }
.mid button:hover { color: var(--ink); }
.mid button[aria-pressed="true"] { background: var(--cbg); color: var(--c); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.mid .temp { --c: var(--temp); --cbg: var(--temp-bg); }
.mid .assy { --c: var(--assy); --cbg: var(--assy-bg); }
.mid .week { --c: var(--week); --cbg: var(--week-bg); }
.mid input { height: 30px; border: 0; border-left: 1px solid var(--rule); border-radius: 0 6px 6px 0; background: none; text-align: center; font-family: var(--mono); text-transform: uppercase; padding: 0 4px; }
.mid input:focus { box-shadow: none; background: var(--accent-bg); }
.mid:focus-within { border-color: var(--focus); }
.mid input:disabled { opacity: .35; }

/* A etiqueta: o único elemento com destaque. É branca também no modo escuro, como a etiqueta real. */
.label {
  margin: 0; background: #fff; color: #10151c; border-radius: 8px; padding: 14px 16px 12px;
  border: 1px solid #c3cad4; position: relative;
}
@media (prefers-color-scheme: dark) { .label { border-color: #fff; } }
.label .head { display: flex; justify-content: space-between; font-size: 12px; color: #596273; }
.label .head b { color: #10151c; font-weight: 600; }
.label .pn { font: 600 27px/1.15 var(--mono); letter-spacing: .3px; margin: 8px 0 6px; white-space: nowrap; }
.label .pn .ph { color: #a9b1bd; }
.label .pn .bad { color: #b91c1c; }
.label svg { display: block; width: 100%; height: 46px; }
.label .desc { margin-top: 6px; font-size: 13px; min-height: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .desc.blank { color: #a9b1bd; }

.cta {
  height: 46px; border: 0; border-radius: 8px; background: var(--cta); color: var(--cta-ink);
  font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: background var(--t);
}
.cta:hover { background: var(--cta-h); }
.cta:disabled { opacity: .5; cursor: progress; }
kbd { font: 12px var(--sans); padding: 1px 6px; border-radius: 4px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); opacity: .8; }

.made h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-3); }
.made ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.made li button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  border: 1px solid var(--side-rule); background: var(--field); border-radius: 7px; padding: 6px 10px; transition: border-color var(--t);
}
.made li button:hover { border-color: var(--ink-3); }
.made code { font: 13px var(--mono); }
.made small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.made .btn { width: 100%; margin-top: 8px; }

/* ---------------------------------------------------------------- lista */
.browse { display: flex; flex-direction: column; overflow: hidden; }
.tools { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--rule); min-height: 61px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; min-width: 180px; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 34px; padding-right: 32px; background: var(--surface-2); border-color: transparent; }
.search input:hover { border-color: var(--rule-strong); }
.search input:focus { background: var(--field); }
.search button { position: absolute; right: 5px; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border: 0; border-radius: 5px; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; }
.search button:hover { background: var(--btn-h); color: var(--ink); }
.tools .filter { flex: 0 1 240px; min-width: 150px; }
.count { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.tools .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.vsep { width: 1px; height: 22px; background: var(--rule-strong); margin: 0 2px; }
/* ações sobre a seleção: barra flutuante em baixo da lista, só quando há linhas selecionadas */
.browse { position: relative; }
.selbar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 12px;
  background: var(--pop); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); animation: rise 140ms ease-out;
}
.selbar .n { font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-right: 8px; white-space: nowrap; }
.selbar .icon-btn { margin-left: 2px; }
.sync { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 1500px) { .sync { display: none; } .tools .count { display: none; } }

.scroll { flex: 1; overflow: auto; position: relative; }
body.arrastar, body.arrastar * { user-select: none; cursor: default; }
table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1150px; table-layout: fixed; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--rule-strong); padding: 0; text-align: left; }
th button {
  width: 100%; border: 0; background: none; text-align: left; padding: 10px 12px 9px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); display: flex; gap: 6px; align-items: center;
}
th button:hover { color: var(--ink); }
th[aria-sort] button { color: var(--accent-ink); }
th .ar { font-size: 9px; }
td { padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tbody tr { transition: background var(--t); }
tbody tr:hover { background: var(--hover); }
tbody tr.sel { background: var(--sel); }
tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.pad, tbody tr.pad:hover { background: none; }
tr.pad td { padding: 0; border: 0; }
tbody tr.sel td { border-bottom-color: var(--sel-rule); }
td.pn { font: 13.5px var(--mono); }
td.pn .TEMP { color: var(--temp); }
td.pn .ASSY { color: var(--assy); }
td.pn .WEEK { color: var(--week); }
td.pn .s { font-weight: 600; }
td.dim { color: var(--ink-3); }
tr.void td { color: var(--ink-3); }
tr.void td.pn { text-decoration: line-through; }
tr.void td.pn span { color: inherit; }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 4px; background: var(--void-bg); color: var(--void); margin-left: 8px; font-weight: 500; }
.empty { padding: 56px 24px; text-align: center; color: var(--ink-2); }
.empty p { margin: 0 0 12px; }

td.num, th.num button { text-align: right; justify-content: flex-end; }
td.num { font-variant-numeric: tabular-nums; }
td.now { font-weight: 600; }
td.now.neg { color: var(--void); }
td.now.zero { color: var(--ink-3); }
td.now.low { color: var(--temp); }
td.code { font: 13px var(--mono); }
.pnlist { font: 12.5px var(--mono); color: var(--ink-2); }

td.ph { padding: 3px 6px 3px 12px; }
.thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; display: block; background: var(--surface-2);
  border: 1px solid var(--rule); cursor: zoom-in; }
.thumb.vazio { cursor: pointer; display: grid; place-items: center; color: var(--ink-3); font-size: 15px; }
.thumb.vazio:hover { border-color: var(--ink-3); color: var(--ink); }
.thumb.vazio { border-style: dashed; background: none; opacity: 0; transition: opacity var(--t); }
tbody tr:hover .thumb.vazio, .thumb.vazio:focus-visible { opacity: 1; }
.thumb.todo { outline: 2px solid var(--temp); outline-offset: -2px; }

/* estoque */
.stockview { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.setup { max-width: 640px; margin: 40px auto; padding: 0 24px; display: flex; flex-direction: column; gap: 12px; }
.setup h2 { margin: 0; font-size: 18px; }
.setup ol { margin: 0; padding-left: 20px; color: var(--ink-2); line-height: 1.6; }
.movs { width: 100%; min-width: 0; table-layout: auto; }
.movs td, .movs th { padding: 6px 8px; font-size: 13px; position: static; text-align: left; }
.movs th { font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); }
.movs td { white-space: normal; overflow-wrap: anywhere; }
.itemrow { display: grid; grid-template-columns: 120px 1fr 80px 28px; gap: 6px; align-items: center; }
.itemrow button { height: 36px; border: 0; background: none; color: var(--ink-3); font-size: 18px; border-radius: 6px; }
.itemrow button:hover { background: var(--btn-h); color: var(--void); }

/* galeria */
.gal { display: grid; grid-template-columns: 1fr 220px; gap: 16px; min-height: 0; }
.gal .big { width: 100%; max-height: 58vh; object-fit: contain; background: var(--surface-2); border-radius: 8px; }
.gal .none { display: grid; place-items: center; min-height: 260px; background: var(--surface-2); border-radius: 8px; color: var(--ink-3); text-align: center; padding: 20px; }
.gal ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow: auto; }
.gal li { border: 1px solid var(--rule); border-radius: 8px; padding: 6px; display: flex; gap: 8px; cursor: pointer; }
.gal li.on { border-color: var(--focus); }
.gal li img { width: 56px; height: 56px; object-fit: cover; border-radius: 5px; flex: none; }
.gal li small { display: block; color: var(--ink-3); font-size: 12px; }
.gal .meta { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.gal .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge-todo { font-size: 11.5px; padding: 0 6px; border-radius: 4px; background: var(--temp-bg); color: var(--temp); font-weight: 500; }

/* rodapé */
footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 18px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--rule); background: var(--surface-2); }
footer .db { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer .keys { display: flex; gap: 14px; white-space: nowrap; }
footer kbd { font-size: 11px; }

/* ---------------------------------------------------------------- menu, diálogo, avisos */
.menu { position: fixed; z-index: 50; background: var(--pop); border: 1px solid var(--rule-strong); border-radius: 10px; padding: 4px; min-width: 220px; box-shadow: var(--shadow); animation: pop 120ms ease-out; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; }
.menu button small { margin-left: auto; color: var(--ink-3); }
.menu button svg.i { color: var(--ink-3); }
.menu button:hover, .menu button:focus-visible { background: var(--sel); outline: none; }
.menu hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 12, .55); display: grid; place-items: center; padding: 24px; }
.dialog { background: var(--pop); border: 1px solid var(--rule-strong); border-radius: 12px; width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop 140ms ease-out; }
.dialog.wide { width: min(760px, 100%); }
.dialog h3 { margin: 0; padding: 20px 22px 0; font-size: 17px; font-weight: 600; }
.dialog .body { padding: 14px 22px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog .foot { padding: 6px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.dialog .cta { height: 36px; font-size: 14px; padding: 0 18px; }
.dialog .foot .btn { height: 36px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 600; }
.stat span { font-size: 12.5px; color: var(--ink-2); }
.stat.good b { color: var(--week); } .stat.bad b { color: var(--void); }
.list { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; max-height: 210px; overflow: auto; font: 12.5px/1.7 var(--mono); user-select: text; }
.list.bad { background: var(--void-bg); color: var(--void); border-color: transparent; }
.toasts { position: fixed; right: 20px; bottom: 44px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; max-width: 460px; box-shadow: var(--shadow); animation: rise 160ms ease-out; }
.toast.err { background: var(--void); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; padding: 0; }
@keyframes rise { from { translate: 0 6px; } }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); }
::-webkit-scrollbar-corner { background: transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
