/* =====================================================================
   PrintSave — sistema visual
   Grafite/papel + 1 cor de sinal. Linhas de 1px. Dados em monoespaçada.
   Para trocar a cor de destaque, altere --accent (claro e escuro).
   ===================================================================== */

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f7f7f5;
  --panel: #ffffff;
  --panel-2: #f1f1ee;
  --side: #fbfbfa;
  --line: #e5e5e1;
  --line-2: #d5d5cf;
  --text: #141516;
  --text-2: #53565c;
  --text-3: #6c6f76;

  --accent: #f25c05;
  --on-accent: #111214;
  --accent-ink: #b84300;
  --accent-soft: rgba(242, 92, 5, .09);
  --ok: #15803d;
  --err: #c0262d;
  --err-soft: rgba(192, 38, 45, .08);

  --ring: 0 0 0 3px rgba(242, 92, 5, .30);
  --pop: 0 1px 0 rgba(0, 0, 0, .02), 0 18px 48px -12px rgba(20, 21, 22, .22);

  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --bar-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f11;
    --panel: #141518;
    --panel-2: #1b1c20;
    --side: #111214;
    --line: #23252a;
    --line-2: #31343b;
    --text: #ecedee;
    --text-2: #a4a7ae;
    --text-3: #80848d;
    --accent: #ff6b1a;
    --accent-ink: #ff8f52;
    --accent-soft: rgba(255, 107, 26, .12);
    --ok: #3dd68c;
    --err: #ff6363;
    --err-soft: rgba(255, 99, 99, .10);
    --ring: 0 0 0 3px rgba(255, 107, 26, .35);
    --pop: 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 60px -12px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f11;
  --panel: #141518;
  --panel-2: #1b1c20;
  --side: #111214;
  --line: #23252a;
  --line-2: #31343b;
  --text: #ecedee;
  --text-2: #a4a7ae;
  --text-3: #80848d;
  --accent: #ff6b1a;
  --accent-ink: #ff8f52;
  --accent-soft: rgba(255, 107, 26, .12);
  --ok: #3dd68c;
  --err: #ff6363;
  --err-soft: rgba(255, 99, 99, .10);
  --ring: 0 0 0 3px rgba(255, 107, 26, .35);
  --pop: 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 60px -12px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: -.01em; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent); font-weight: 600;
  padding: 10px 14px; border-radius: var(--r);
  transition: top .15s var(--ease);
}
.skip:focus { top: 12px; }

.eyebrow {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow .ic { width: 13px; height: 13px; }
.count {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--text-2);
  border: 1px solid var(--line); border-radius: var(--r-xs); padding: 0 5px; line-height: 18px;
}
kbd {
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; line-height: 1;
  color: var(--text-2); background: var(--panel); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: var(--r-xs); padding: 3px 5px 2px; white-space: nowrap;
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  font-size: 0.875rem; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-accent:hover { background: var(--accent); filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, var(--line-2)); }
.btn-danger-solid { background: var(--err); border-color: var(--err); color: #fff; font-weight: 600; }
.btn-danger-solid:hover { background: var(--err); filter: brightness(1.08); }
.btn-lg { height: 44px; padding: 0 18px; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; filter: none; }
.btn kbd { background: transparent; border-color: color-mix(in srgb, currentColor 30%, transparent); color: inherit; opacity: .75; }

.ibtn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background .12s, color .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.ibtn:hover { background: var(--panel-2); color: var(--text); }
.ibtn-line { border-color: var(--line-2); background: var(--panel); }
.ibtn.danger:hover { color: var(--err); background: var(--err-soft); }

/* ---------- barra superior ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px 0 20px; padding-left: max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: var(--r); }
.brand-mark { height: 28px; min-width: 28px; display: grid; place-items: center; }
.brand-mark img { height: 28px; width: auto; max-width: 140px; object-fit: contain; display: block; border-radius: 7px; }
.brand-mark.fallback { width: 28px; border-radius: 7px; background: var(--accent); color: var(--on-accent); }
.brand-name { display: flex; align-items: baseline; gap: 8px; font-size: 0.9375rem; white-space: nowrap; min-width: 0; }
.brand-name b { font-weight: 600; letter-spacing: -.015em; }
.brand-sep { color: var(--line-2); font-weight: 300; }
.brand-name span:last-child { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.bar-r { display: flex; align-items: center; gap: 8px; }

.status {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px;
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status[data-state="ok"] .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.status[data-state="err"] .dot { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.status[data-state="local"] .dot { background: var(--accent); }

.kbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--text-2);
  font-size: 0.8125rem; min-width: 190px;
}
.kbtn:hover { color: var(--text); border-color: var(--text-3); }
.kbtn-label { flex: 1; text-align: left; }

/* ---------- estrutura ---------- */
.shell {
  display: grid; grid-template-columns: 296px minmax(0, 1fr);
  min-height: calc(100dvh - var(--bar-h));
}
.side {
  position: sticky; top: var(--bar-h); height: calc(100dvh - var(--bar-h));
  display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line);
}
.side-head { padding: 20px 16px 10px; }
.side-search { padding: 0 12px 10px; }
.side-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.side-foot { padding: 12px; border-top: 1px solid var(--line); padding-bottom: max(12px, env(safe-area-inset-bottom)); }

.main { min-width: 0; padding: 32px clamp(16px, 4vw, 48px) 80px; outline: none; }
.main-inner { max-width: 1080px; margin: 0 auto; }

/* ---------- busca ---------- */
.search { position: relative; display: block; }
.search > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 36px; padding: 0 40px 0 34px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel); font-size: 0.875rem;
  transition: border-color .12s, box-shadow .12s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input:focus ~ kbd { opacity: 0; }
.search-lg input { height: 42px; font-size: 0.9375rem; }

/* ---------- lista de empresas ---------- */
.co-list { display: grid; gap: 1px; }
.co {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r); color: var(--text-2);
  transition: background .1s, color .1s;
}
.co:hover { color: var(--text); }
@media (hover: hover) { .co:hover { background: var(--panel-2); } }
.co[aria-current="page"] { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.co[aria-current="page"]::before {
  content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent);
}
.mono-badge {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: .02em;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
}
.co[aria-current="page"] .mono-badge { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.co-name { font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-meta { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); }
.co-meta .ic { width: 13px; height: 13px; }
.side-msg { padding: 10px 10px; font-size: 0.8125rem; color: var(--text-3); }

/* ---------- cabeçalho de página ---------- */
.back {
  display: none; align-items: center; gap: 4px; margin: -6px 0 14px -6px; padding: 6px;
  font-size: 0.8125rem; color: var(--text-2); border-radius: var(--r-sm);
}
.back:hover { color: var(--text); }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.ph-title { min-width: 0; display: grid; gap: 6px; }
.ph h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; word-break: break-word; }
.ph-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.ph-meta b { color: var(--text-2); font-weight: 500; }
.ph-actions { display: flex; align-items: center; gap: 6px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.toolbar .search { flex: 1; }

/* ---------- tabela/lista de impressoras ---------- */
.tbl { container: rows / inline-size; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.tbl-head { display: none; }
.rows > li + li { border-top: 1px solid var(--line); }

.row { animation: rowIn .25s var(--ease) both; }
.row.is-open { background: color-mix(in srgb, var(--panel-2) 55%, var(--panel)); }
.row-main {
  display: grid; gap: 10px 12px; padding: 14px 14px;
  grid-template-columns: minmax(0, 1fr);
}
.r-toggle {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  text-align: left; background: transparent; border: 0; padding: 0; margin: 0; width: 100%; border-radius: var(--r-sm);
}
.r-ico {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
}
.r-txt { min-width: 0; display: grid; gap: 1px; }
.r-name { font-weight: 600; font-size: 0.9375rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.r-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-name.is-muted > span:first-child { color: var(--text-3); font-weight: 500; font-style: italic; }
.r-sub { font-size: 0.8125rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-sub .mono { color: var(--text-3); font-size: 0.75rem; }
.r-chev { color: var(--text-3); transition: transform .18s var(--ease); }
.r-toggle[aria-expanded="true"] .r-chev { transform: rotate(90deg); color: var(--accent-ink); }
.tag {
  flex: none; font-family: var(--mono); font-size: 0.625rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft);
  padding: 1px 5px; border-radius: var(--r-xs);
}

.r-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.r-cell {
  display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 100%;
  font-size: 0.8125rem; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 8px; background: var(--panel);
}
.r-cell::before {
  content: attr(data-label); font-family: var(--mono); font-size: 0.625rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
}
.r-cell > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-cell.is-empty { display: none; }
.r-cell.mono > span { font-family: var(--mono); font-size: 0.8125rem; }

.r-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.r-actions .btn { height: 40px; }
.r-actions .ibtn { width: 40px; height: 40px; border-color: var(--line-2); background: var(--panel); }
.r-nolink { font-size: 0.8125rem; color: var(--text-3); font-style: italic; align-self: center; }

.row-detail { padding: 0 14px 16px; display: grid; gap: 12px; animation: fadeIn .2s var(--ease); }
.d-label { margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.url-full {
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.6; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; word-break: break-all; user-select: all; -webkit-user-select: all;
  max-height: 168px; overflow-y: auto;
}
.d-notes { font-size: 0.875rem; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.d-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.d-meta { font-family: var(--mono); font-size: 0.6875rem; color: var(--text-3); }
.d-btns { display: flex; gap: 6px; }

/* Layout de TABELA quando a área é larga (container query) */
@container rows (min-width: 760px) {
  .tbl-head {
    display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 9.5rem 6.75rem 13.5rem;
    gap: 16px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  }
  .tbl-head span { font-family: var(--mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
  .row-main {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 9.5rem 6.75rem 13.5rem;
    align-items: center; gap: 16px; padding: 12px 16px;
  }
  .row-main:hover { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
  .r-specs { display: contents; }
  .r-cell { border: 0; padding: 0; background: transparent; display: block; color: var(--text); }
  .r-cell::before { display: none; }
  .r-cell.is-empty { display: block; color: var(--text-3); }
  .r-cell > span { display: block; }
  .r-actions .btn { height: 34px; }
  .r-actions .ibtn { width: 34px; height: 34px; }
  .row-detail { padding: 0 16px 18px 62px; grid-template-columns: minmax(0, 1fr) minmax(0, .6fr); align-items: start; column-gap: 24px; }
  .row-detail .d-foot { grid-column: 1 / -1; }
}

/* ---------- estados vazios / home ---------- */
.empty {
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 48px 24px; text-align: center;
  display: grid; justify-items: center; gap: 10px; color: var(--text-2);
}
.empty h2, .empty h3 { color: var(--text); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; }
.empty p { max-width: 42ch; font-size: 0.875rem; }
.empty .btn { margin-top: 8px; }
.e-ico {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2);
}
.e-ico .ic { width: 20px; height: 20px; }
.e-ico.err { color: var(--err); }

.home { max-width: 720px; margin: 6vh auto 0; display: grid; gap: 28px; }
.home h1 { font-size: clamp(1.625rem, 3.2vw, 2.25rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
.home p { color: var(--text-2); max-width: 52ch; }
.home .kbd-line { line-height: 2; }
.home .kbd-line kbd { margin: 0 1px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.stat { padding: 16px 18px; display: grid; gap: 6px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b small { font-size: 0.75rem; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.shortcuts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.shortcuts li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--text-2); }
.shortcuts li span:last-child { display: inline-flex; gap: 4px; }

/* ---------- bloqueio ---------- */
.lock { min-height: 62vh; display: grid; place-items: center; }
.lock-panel {
  width: 100%; max-width: 380px; display: grid; gap: 18px; padding: 28px 24px 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.lock-panel h1 { font-size: 1.375rem; font-weight: 600; letter-spacing: -.02em; word-break: break-word; }
.lock-panel p { font-size: 0.875rem; color: var(--text-2); }
.lock-panel .eyebrow { color: var(--accent-ink); }
.lock-panel .field-err { color: var(--err); }
.shake { animation: shake .32s; }

/* ---------- formulários ---------- */
.form { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field .lbl {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 0.8125rem; font-weight: 500; color: var(--text);
}
.opt { font-family: var(--mono); font-size: 0.625rem; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.input, .field input, .field textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel); font-size: 0.9375rem;
  transition: border-color .12s, box-shadow .12s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.field textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.field textarea.mono, .field input.mono { font-family: var(--mono); font-size: 0.8125rem; }
.field textarea.url { min-height: 104px; word-break: break-all; }
.field-hint { font-size: 0.75rem; color: var(--text-3); min-height: 1em; }
.field-hint.warn { color: var(--accent-ink); }
.field-err { font-size: 0.8125rem; color: var(--err); font-weight: 500; min-height: 1.25em; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.input-wrap .ibtn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.mini-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-xs);
}
.mini-btn:hover { color: var(--text); border-color: var(--text-3); }
.mini-btn .ic { width: 12px; height: 12px; }
.form-foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; flex-wrap: wrap; }
.form-foot .spacer { flex: 1; }

/* ---------- diálogo ---------- */
dialog { color: var(--text); }
.dlg, .pal {
  padding: 0; border: 0; background: transparent; max-width: none; max-height: none;
  width: 100%; height: 100%; margin: 0; overflow: hidden;
}
.dlg::backdrop, .pal::backdrop { background: rgba(8, 9, 11, .55); backdrop-filter: blur(2px); }
.dlg[open] { display: grid; place-items: center; padding: 16px; }
.dlg-inner {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--pop);
  animation: dlgIn .16s var(--ease);
}
.dlg-inner.sm { max-width: 420px; }
.dlg-grip { display: none; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.dlg-body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.confirm-text { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 20px; }

/* ---------- busca rápida ---------- */
.pal[open] { display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pal-inner {
  width: 100%; max-width: 600px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--pop); overflow: hidden; animation: dlgIn .14s var(--ease);
  display: flex; flex-direction: column; max-height: 70dvh;
}
.pal-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.pal-search > .ic { color: var(--text-3); width: 18px; height: 18px; }
.pal-search input { flex: 1; height: 52px; border: 0; background: transparent; font-size: 1rem; min-width: 0; }
.pal-search input:focus-visible { outline: none; }
.pal-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.pal-group { padding: 10px 10px 4px; }
.pal-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r); cursor: pointer; color: var(--text-2);
}
.pal-item .pi-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel-2); }
.pal-item .pi-label { color: var(--text); font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pi-sub { font-family: var(--mono); font-size: 0.6875rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pi-hint { font-family: var(--mono); font-size: 0.6875rem; color: var(--text-3); }
.pal-item[aria-selected="true"] { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.pal-item[aria-selected="true"] .pi-ico { color: var(--accent-ink); }
.pal-item[aria-disabled="true"] { opacity: .5; cursor: default; }
.pal-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 0.875rem; }
.pal-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--text-3); background: var(--panel-2); }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 90;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  padding: 9px 14px 9px 12px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--pop); opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity .16s, transform .16s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { width: 15px; height: 15px; }
.toast[data-kind="ok"] .ic { color: var(--ok); }
.toast[data-kind="err"] .ic { color: var(--err); }

/* ---------- carregamento ---------- */
.sk { border-radius: var(--r-sm); background: var(--panel-2); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--panel) 70%, transparent), transparent);
  animation: sk 1.2s infinite;
}
.sk-row { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px; align-items: center; }
.sk-row + .sk-row { border-top: 1px solid var(--line); }

/* ---------- barra inferior (mobile) ---------- */
.mbar { display: none; }

/* ---------- animações ---------- */
@keyframes rowIn { from { opacity: 0; transform: translateY(3px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes sk { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- tablet / celular ---------- */
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; min-height: calc(100dvh - var(--bar-h)); border-right: 0; background: var(--bg); }
  body[data-view="home"] .main { display: none; }
  body[data-view="company"] .side { display: none; }
  .side-head { padding: 22px 16px 12px; }
  .side-head .eyebrow { font-size: 0.75rem; }
  .side-search { padding: 0 16px 12px; }
  .side-list { padding: 0 16px 16px; overflow: visible; }
  .co-list { gap: 8px; }
  .co { padding: 12px; min-height: 60px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
  .co[aria-current="page"]::before { display: none; }
  .mono-badge { width: 34px; height: 34px; }
  .co { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .co-name { font-size: 0.9375rem; }
  .side-foot { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .side-foot .btn { height: 46px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

  .main { padding: 18px 16px 120px; }
  .back { display: inline-flex; }
  .ph { align-items: flex-start; margin-bottom: 18px; }
  .ph-actions .btn-new { display: none; }
  .search input { height: 44px; font-size: 1rem; }
  .search kbd { display: none; }
  .kbtn { min-width: 0; padding: 0 10px; }
  .kbtn-label, .kbtn kbd { display: none; }
  .status { padding: 0; border: 0; width: 28px; justify-content: center; }
  .status #statusText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ibtn { width: 40px; height: 40px; }
  .btn { height: 40px; }

  .mbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent); border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .mbar .btn { width: 100%; height: 48px; font-size: 1rem; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }

  .dlg[open] { place-items: end center; padding: 0; }
  .dlg-inner, .dlg-inner.sm {
    max-width: none; max-height: 94dvh; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .24s var(--ease);
  }
  .dlg-grip { display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 8px auto 0; }
  .dlg-head { padding: 8px 12px 12px 20px; }
  .field input, .field textarea { font-size: 1rem; min-height: 46px; }
  .field textarea.mono, .field input.mono { font-size: 0.875rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-foot .btn { height: 46px; }
  .form-foot .btn-accent { flex: 1; }

  .pal[open] { padding: 8px; align-items: flex-start; }
  .pal-inner { max-height: 80dvh; }
  .pal-foot { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 380px) {
  .brand-sep, #brandSub { display: none; }
}

@media (hover: none) {
  .row-main:hover { background: transparent; }
}

@media print {
  .bar, .side, .mbar, .r-actions, .ph-actions, .toolbar { display: none !important; }
  .shell { display: block; }
}
