/**
 * SMARTDIGIT Backoffice — sistema visual v2 (Fase 0 + 1).
 *
 * Carregado DEPOIS de ds.css, bo.css e ds-normalize.css.
 * 1) Redefine os tokens --ds-* com a paleta da marca (todo o CSS legado que usa tokens herda-a).
 * 2) Estiliza a nova moldura: .app-side (menu lateral), .app-top (barra superior), .app-cmd (pesquisa global).
 *
 * Não usa @layer de propósito: estilos sem camada ganham sempre às camadas, e o legado não tem camadas.
 * Quando bo.css / ds-normalize.css forem removidos (Fase 5), este ficheiro passa a @layer.
 */

:root {
  /* Marca (extraída do logótipo) */
  --app-brand: #3e7ae3;
  --app-accent: #2b62c4;          /* azul de ação com contraste AA em branco */
  --app-accent-hover: #2453a8;
  --app-accent-active: #1e468d;
  --app-accent-soft: #e9f0fc;
  --app-accent-fg: #ffffff;

  /* Neutros com o tom do grafite do logótipo */
  --app-bg: #f5f6f6;
  --app-surface: #ffffff;
  --app-surface-2: #f0f2f2;
  --app-line: #e3e6e6;
  --app-line-2: #cfd4d4;
  --app-fg: #1d2122;
  --app-fg-2: #454c4e;
  --app-muted: #6c7476;

  --app-ok: #17845a;
  --app-ok-soft: #e5f4ec;
  --app-warn: #a76407;
  --app-warn-soft: #fbf1df;
  --app-bad: #c2372f;
  --app-bad-soft: #fbe9e7;

  --app-f-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --app-f-ui: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --app-f-mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --app-side-w: 248px;
  --app-side-w-collapsed: 64px;
  --app-top-h: 64px;
  --app-radius: 8px;
  --app-shadow-pop: 0 1px 2px rgba(29, 33, 34, 0.06), 0 12px 32px rgba(29, 33, 34, 0.14);

  /* Tokens do design system existente → nova paleta */
  --ds-font: var(--app-f-ui);
  --ds-font-mono: var(--app-f-mono);
  --ds-bg: var(--app-bg);
  --ds-surface: var(--app-surface);
  --ds-surface-muted: var(--app-surface-2);
  --ds-text: var(--app-fg);
  --ds-text-secondary: var(--app-fg-2);
  --ds-muted: var(--app-muted);
  --ds-border: var(--app-line);
  --ds-border-strong: var(--app-line-2);
  --ds-accent: var(--app-accent);
  --ds-accent-hover: var(--app-accent-hover);
  --ds-accent-active: var(--app-accent-active);
  --ds-accent-soft: var(--app-accent-soft);
  --ds-danger: var(--app-bad);
  --ds-danger-soft: var(--app-bad-soft);
  --ds-success: var(--app-ok);
  --ds-success-soft: var(--app-ok-soft);
  --ds-warning: var(--app-warn);
  --ds-warning-soft: var(--app-warn-soft);
  --ds-sidebar: var(--app-surface);
  --ds-sidebar-mid: var(--app-surface-2);
  --ds-sidebar-text: var(--app-fg);
  --ds-sidebar-muted: var(--app-muted);
  --ds-focus: 0 0 0 3px rgba(43, 98, 196, 0.22);
  --bo-heading-font: var(--app-f-display);
}

/* Tema escuro: activado por data-theme="dark" no <html> (lib/layout.php + bo_shell.js).
   As regras escuras do CSS legado estão em *-dark.css (gerados por tools/bo_gen_dark_css.py). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --app-brand: #6b9bf0;
  --app-accent: #6b9bf0;
  --app-accent-hover: #86aef4;
  --app-accent-active: #9dbdf6;
  --app-accent-soft: #1d2b44;
  --app-accent-fg: #0d1420;
  --app-bg: #121516;
  --app-surface: #1a1e1f;
  --app-surface-2: #22272a;
  --app-line: #2c3234;
  --app-line-2: #3a4144;
  --app-fg: #e9eced;
  --app-fg-2: #c3c9cb;
  --app-muted: #8b9496;
  --app-ok: #4cc38a;
  --app-ok-soft: #163327;
  --app-warn: #e3a54a;
  --app-warn-soft: #352813;
  --app-bad: #f07a70;
  --app-bad-soft: #3a1c1a;
  --app-shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
  --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --ds-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --ds-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --ds-focus: 0 0 0 3px rgba(107, 155, 240, 0.35);
}

/* Botão primário: texto escuro sobre azul claro no tema escuro */
:root[data-theme="dark"] .ds-btn--primary,
:root[data-theme="dark"] .bo-btn--primary {
  color: var(--app-accent-fg);
}

/* Blocos <pre> de registos em Definições (estilo inline) */
:root[data-theme="dark"] .zswms-main pre[style*="#f6f8fa"] {
  background: var(--app-surface-2) !important;
  border-color: var(--app-line) !important;
  color: var(--app-fg-2);
}

/* Imagens de marca com fundo transparente pensadas para fundo claro */
:root[data-theme="dark"] .bo-store-logo-card img,
:root[data-theme="dark"] img[src*="Logo_Black"],
:root[data-theme="dark"] img[src*="BannerH_Black"] {
  background: #f5f6f6;
  border-radius: 6px;
}

html, body.zswms-body {
  font-family: var(--app-f-ui);
}

body.zswms-body {
  background: var(--app-bg);
  color: var(--app-fg);
  font-feature-settings: "ss01" on, "cv11" on;
}

/* Títulos de secções legadas passam a usar a fonte de títulos */
.zswms-main h1,
.zswms-main h2,
.bo-card h2,
.bo-modal__title,
.bo-chart-card__title {
  font-family: var(--app-f-display);
  letter-spacing: -0.01em;
}

/* ─────────────────────────────────────────────
 * Menu lateral
 * ───────────────────────────────────────────── */
.app-side {
  position: sticky;
  top: 0;
  flex: 0 0 var(--app-side-w);
  width: var(--app-side-w);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  border-right: 1px solid var(--app-line);
  color: var(--app-fg-2);
  z-index: 40;
  transition: width 0.18s ease, flex-basis 0.18s ease, transform 0.22s ease;
}

.app-side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--app-top-h);
  padding: 0 16px;
  flex: none;
  text-decoration: none;
  color: var(--app-fg);
}

.app-side__brand img {
  width: 26px;
  height: 26px;
  flex: none;
}

.app-side__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.app-side__brand-name {
  font-family: var(--app-f-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.app-side__brand-sub {
  font-size: 0.72rem;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-side__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-side__section {
  font-family: var(--app-f-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-muted);
  padding: 14px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-side__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--app-radius);
  color: var(--app-fg-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-side__link svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--app-muted);
}

.app-side__link:hover {
  background: var(--app-surface-2);
  color: var(--app-fg);
}

.app-side__link.is-active {
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

.app-side__link.is-active svg {
  color: var(--app-accent);
}

.app-side__link:focus-visible,
.app-side__toggle:focus-visible,
.app-top__btn:focus-visible,
.app-top__search:focus-visible,
.app-account__btn:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
}

.app-side__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-side__foot {
  flex: none;
  border-top: 1px solid var(--app-line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-side__toggle {
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.app-side__toggle svg {
  transition: transform 0.18s ease;
}

/* Recolhido (desktop) */
@media (min-width: 901px) {
  .app-side-collapsed .app-side {
    flex-basis: var(--app-side-w-collapsed);
    width: var(--app-side-w-collapsed);
  }
  .app-side-collapsed .app-side__brand {
    padding: 0;
    justify-content: center;
  }
  .app-side-collapsed .app-side__brand-text,
  .app-side-collapsed .app-side__label {
    display: none;
  }
  .app-side-collapsed .app-side__section {
    font-size: 0;
    padding: 10px 0 4px;
    margin: 0 12px;
    border-top: 1px solid var(--app-line);
  }
  .app-side-collapsed .app-side__section:first-child {
    border-top: 0;
  }
  .app-side-collapsed .app-side__link {
    justify-content: center;
    padding: 0;
  }
  .app-side-collapsed .app-side__toggle svg {
    transform: rotate(180deg);
  }
}

/* Gaveta (telemóvel / tablet) */
.app-scrim {
  display: none;
}

@media (max-width: 900px) {
  body.zswms-body {
    flex-direction: row;
  }
  .app-side {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(84vw, 300px);
    transform: translateX(-100%);
    box-shadow: var(--app-shadow-pop);
  }
  .app-side-open .app-side {
    transform: none;
  }
  .app-side-open .app-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(18, 21, 22, 0.35);
    z-index: 35;
  }
  .app-side__toggle {
    display: none;
  }
}

/* ─────────────────────────────────────────────
 * Barra superior
 * ───────────────────────────────────────────── */
.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--app-top-h);
  padding: 8px 24px;
  background: color-mix(in srgb, var(--app-surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--app-line);
}

.app-top__btn.app-top__menu {
  display: none;
}

@media (max-width: 900px) {
  .app-top {
    padding: 8px 14px;
  }
  .app-top__btn.app-top__menu {
    display: inline-grid;
  }
}

.app-top__heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
}

.app-crumbs a {
  color: inherit;
  text-decoration: none;
}

.app-crumbs a:hover {
  color: var(--app-accent);
}

.app-crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--app-line-2);
}

.app-top .app-top__title.zswms-topbar__title {
  margin: 0;
  font-family: var(--app-f-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--app-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-top__end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-top__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: clamp(180px, 26vw, 320px);
  height: 36px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-bg);
  color: var(--app-muted);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  text-align: left;
}

.app-top__search:hover {
  border-color: var(--app-line-2);
  color: var(--app-fg-2);
}

.app-top__search svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.app-top__search span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-kbd {
  font-family: var(--app-f-mono);
  font-size: 0.68rem;
  line-height: 1;
  padding: 3px 5px;
  border: 1px solid var(--app-line-2);
  border-radius: 4px;
  color: var(--app-muted);
  background: var(--app-surface);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .app-top__search {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .app-top__search span,
  .app-top__search .app-kbd {
    display: none;
  }
}

.app-top__btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-fg-2);
  cursor: pointer;
  text-decoration: none;
}

.app-top__btn:hover {
  background: var(--app-surface-2);
  color: var(--app-fg);
}

.app-top__btn svg {
  width: 17px;
  height: 17px;
}

/* Conta */
.app-account {
  position: relative;
}

.app-account__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 4px;
  border: 1px solid transparent;
  border-radius: var(--app-radius);
  background: none;
  font: inherit;
  color: var(--app-fg);
  cursor: pointer;
}

.app-account__btn:hover,
.app-account__btn[aria-expanded="true"] {
  background: var(--app-surface-2);
}

.app-account__btn > svg {
  width: 14px;
  height: 14px;
  color: var(--app-muted);
}

.app-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-account__name {
  font-size: 0.84rem;
  font-weight: 500;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .app-account__name,
  .app-account__btn > svg {
    display: none;
  }
}

.app-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 260px;
  padding: 6px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  box-shadow: var(--app-shadow-pop);
  z-index: 60;
}

.app-menu__who {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--app-line);
  margin-bottom: 6px;
}

.app-menu__who div {
  min-width: 0;
  line-height: 1.3;
}

.app-menu__who strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-menu__who small {
  display: block;
  font-size: 0.75rem;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-menu__label {
  font-family: var(--app-f-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  padding: 6px 8px 4px;
}

.app-menu__langs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 0 4px 6px;
}

.app-menu__lang {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--app-line);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--app-fg-2);
  text-decoration: none;
}

.app-menu__lang:hover {
  border-color: var(--app-line-2);
  color: var(--app-fg);
}

.app-menu__lang.is-active {
  border-color: var(--app-accent);
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

.app-menu__themes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 4px 6px;
}

.app-menu__theme {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 46px;
  border-radius: 6px;
  border: 1px solid var(--app-line);
  background: none;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--app-fg-2);
  cursor: pointer;
}

.app-menu__theme svg {
  width: 16px;
  height: 16px;
}

.app-menu__theme:hover {
  border-color: var(--app-line-2);
  color: var(--app-fg);
}

.app-menu__theme[aria-pressed="true"] {
  border-color: var(--app-accent);
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

.app-menu__theme:focus-visible,
.app-menu__lang:focus-visible,
.app-menu__item:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
}

.app-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--app-fg-2);
  text-decoration: none;
}

.app-menu__item:hover {
  background: var(--app-surface-2);
  color: var(--app-fg);
}

.app-menu__item svg {
  width: 16px;
  height: 16px;
  color: var(--app-muted);
}

.app-menu__sep {
  height: 1px;
  background: var(--app-line);
  margin: 6px 0;
}

/* Área de conteúdo */
.zswms-shell {
  min-width: 0;
}

.zswms-main {
  padding: 24px 28px 40px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .zswms-main {
    padding: 16px 16px 32px;
  }
}

/* Página de empresas: a moldura nova já é sticky, o legado bloqueava a altura do body */
.zswms-body:has(#bo-partner-companies-root[data-company-page="1"]) .app-side {
  max-height: 100dvh;
}

/* ─────────────────────────────────────────────
 * Painel: cartões de KPI neutros (substituem os gradientes)
 * ───────────────────────────────────────────── */
.bo-stat-card,
.bo-stat-card[class*="bo-stat-card--"] {
  background: var(--app-surface);
  color: var(--app-fg);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  box-shadow: none;
  min-height: 0;
  padding: 16px 18px;
  gap: 4px;
  justify-content: flex-start;
}

a.bo-stat-card:hover,
.bo-stat-card--action:hover {
  transform: none;
  border-color: var(--app-line-2);
  box-shadow: 0 1px 2px rgba(29, 33, 34, 0.06);
  cursor: pointer;
}

a.bo-stat-card:focus-visible,
.bo-stat-card--action:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
}

.bo-stat-card .bo-stat-card__label {
  order: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--app-muted);
  opacity: 1;
}

.bo-stat-card .bo-stat-card__value {
  font-family: var(--app-f-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--app-fg);
  font-variant-numeric: tabular-nums;
}

.bo-stat-card .bo-stat-card__hint {
  font-size: 0.76rem;
  color: var(--app-muted);
  opacity: 1;
}

.bo-stat-card--online .bo-stat-card__label::after,
.bo-stat-card--pwa-online .bo-stat-card__label::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--app-ok);
  box-shadow: 0 0 0 3px var(--app-ok-soft);
  vertical-align: 1px;
}

.bo-dashboard-lead {
  color: var(--app-fg-2);
}

.bo-dashboard-lead__accent {
  color: var(--app-muted);
}

.bo-chart-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  box-shadow: none;
}

/* ─────────────────────────────────────────────
 * Mensagens: erros ficam até serem fechados
 * ───────────────────────────────────────────── */
.bo-flash:not(.bo-flash--embedded):not(.bo-flash--inline),
.bo-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 10px;
  font-family: var(--app-f-ui);
  font-weight: 500;
}

.bo-flash--ok:not(.bo-flash--embedded):not(.bo-flash--inline),
.bo-toast--ok {
  background: var(--app-fg);
  color: var(--app-surface);
  border: 1px solid var(--app-fg);
}

.bo-flash--err:not(.bo-flash--embedded):not(.bo-flash--inline),
.bo-toast--err {
  background: var(--app-bad);
  color: #fff;
  border: 1px solid var(--app-bad);
}

.bo-flash.is-sticky:not(.bo-flash--embedded):not(.bo-flash--inline),
.bo-toast.is-sticky {
  pointer-events: auto;
}

.app-dismiss {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  flex: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.app-dismiss:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ─────────────────────────────────────────────
 * Pesquisa global (Ctrl K)
 * ───────────────────────────────────────────── */
.app-cmd {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
  background: rgba(18, 21, 22, 0.38);
}

.app-cmd[hidden] {
  display: none;
}

.app-cmd__panel {
  width: min(600px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  border: 1px solid var(--app-line-2);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(18, 21, 22, 0.28);
  overflow: hidden;
}

.app-cmd__q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--app-line);
}

.app-cmd__q svg {
  width: 17px;
  height: 17px;
  color: var(--app-muted);
  flex: none;
}

.app-cmd__input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--app-fg);
}

.app-cmd__list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  margin: 0;
  list-style: none;
}

.app-cmd__group {
  font-family: var(--app-f-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
  padding: 10px 10px 4px;
}

.app-cmd__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--app-fg);
  text-decoration: none;
  font-size: 0.88rem;
  cursor: pointer;
}

.app-cmd__item.is-active {
  background: var(--app-accent-soft);
}

.app-cmd__item svg {
  width: 16px;
  height: 16px;
  color: var(--app-muted);
  flex: none;
}

.app-cmd__title {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-cmd__title mark {
  background: none;
  color: var(--app-accent);
  font-weight: 600;
}

.app-cmd__meta {
  max-width: 45%;
  font-size: 0.76rem;
  color: var(--app-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-cmd__off {
  font-size: 0.68rem;
  color: var(--app-muted);
  border: 1px solid var(--app-line);
  border-radius: 99px;
  padding: 1px 7px;
  flex: none;
}

.app-cmd__empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.app-cmd__foot {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .app-cmd {
    padding-top: 8px;
  }
  .app-cmd__foot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-side,
  .app-side__toggle svg {
    transition: none;
  }
}

/* ─────────────────────────────────────────────
 * Componentes de página (v2): cabeçalho, cartões, KPIs, tabelas, pills
 * ───────────────────────────────────────────── */
.app-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.app-phead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.app-phead__text {
  min-width: 0;
}

.zswms-main .app-phead__title {
  margin: 0;
  font-family: var(--app-f-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--app-fg);
  text-wrap: balance;
}

.app-phead__sub {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--app-muted);
}

.app-phead__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-muted {
  color: var(--app-muted);
}

.app-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app-muted);
  flex: none;
}

.app-dot--ok,
.app-dot--live {
  background: var(--app-ok);
}

.app-dot--live {
  box-shadow: 0 0 0 3px var(--app-ok-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .app-dot--live {
    animation: app-pulse 2.4s ease-in-out infinite;
  }
  @keyframes app-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--app-ok-soft); }
    50% { box-shadow: 0 0 0 6px var(--app-ok-soft); }
  }
}

/* Precisa de atenção */
.app-attn {
  border: 1px solid color-mix(in srgb, var(--app-warn) 35%, transparent);
  background: var(--app-warn-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.app-attn__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-warn);
  margin-bottom: 6px;
}

.zswms-main .app-attn__head h3 {
  margin: 0;
  font-family: var(--app-f-ui);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--app-warn);
}

.app-attn__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.app-attn__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  color: var(--app-fg);
  text-decoration: none;
  font-size: 0.88rem;
}

.app-attn__list a:hover {
  background: color-mix(in srgb, var(--app-warn) 10%, transparent);
}

.app-attn__go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--app-warn);
  white-space: nowrap;
}

.app-allclear {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.86rem;
  color: var(--app-muted);
}

/* KPIs */
.app-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.app-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  color: var(--app-fg);
  text-decoration: none;
  min-width: 0;
  transition: border-color 0.12s ease;
}

a.app-kpi:hover {
  border-color: var(--app-line-2);
}

a.app-kpi:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
}

.app-kpi__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--app-muted);
}

.app-kpi__label svg {
  color: var(--app-muted);
}

.app-kpi__value {
  font-family: var(--app-f-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.app-kpi__hint {
  font-size: 0.76rem;
  color: var(--app-muted);
}

/* Cartões */
.app-grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 1100px) {
  .app-grid2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.app-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  min-width: 0;
  overflow: hidden;
}

.app-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-line);
}

.zswms-main .app-card__head h3 {
  margin: 0;
  font-family: var(--app-f-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--app-fg);
}

.app-card__head > a,
.app-linkbtn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--app-accent);
  text-decoration: none;
  cursor: pointer;
}

.app-card__head > a:hover,
.app-linkbtn:hover {
  text-decoration: underline;
}

.app-card__links {
  display: flex;
  gap: 14px;
}

.app-card__sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--app-muted);
  max-width: 70ch;
}

.app-card__total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.75rem;
  color: var(--app-muted);
}

.app-card__total strong {
  font-family: var(--app-f-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--app-fg);
  font-variant-numeric: tabular-nums;
}

.app-card__empty {
  margin: 0;
  padding: 28px 18px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--app-muted);
  list-style: none;
}

/* Barras horizontais (sem biblioteca) */
.app-bars {
  list-style: none;
  margin: 0;
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
}

.app-bars__row {
  display: grid;
  grid-template-columns: minmax(90px, 200px) 1fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
}

.app-bars__name {
  color: var(--app-fg-2);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bars__name:hover {
  color: var(--app-accent);
}

.app-bars__track {
  height: 8px;
  border-radius: 4px;
  background: var(--app-surface-2);
  overflow: hidden;
}

.app-bars__fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--app-accent);
}

.app-bars__val {
  text-align: right;
  font-family: var(--app-f-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--app-fg);
}

/* Feed (online agora) */
.app-feed {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.app-feed__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--app-line);
}

.app-feed__row:last-child {
  border-bottom: 0;
}

.app-feed__who {
  min-width: 0;
  line-height: 1.3;
}

.app-feed__who strong,
.app-feed__who small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-feed__who strong {
  font-size: 0.86rem;
  font-weight: 500;
}

.app-feed__who small {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.app-feed__time {
  font-family: var(--app-f-mono);
  font-size: 0.75rem;
  color: var(--app-muted);
}

/* Pills de estado */
.app-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--app-surface-2);
  color: var(--app-fg-2);
}

.app-pill .app-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
}

.app-pill--ok { background: var(--app-ok-soft); color: var(--app-ok); }
.app-pill--off { background: var(--app-surface-2); color: var(--app-muted); }
.app-pill--blue { background: var(--app-accent-soft); color: var(--app-accent); }
.app-pill--warn { background: var(--app-warn-soft); color: var(--app-warn); }
.app-pill--bad { background: var(--app-bad-soft); color: var(--app-bad); }

/* Tabelas v2 */
.app-table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.app-table th {
  position: sticky;
  top: 0;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--app-muted);
  background: var(--app-surface);
  padding: 9px 18px;
  border-bottom: 1px solid var(--app-line);
  white-space: nowrap;
}

.app-table td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--app-line);
  vertical-align: middle;
  color: var(--app-fg);
}

.app-table tbody tr:last-child td {
  border-bottom: 0;
}

.app-table tr[data-href] {
  cursor: pointer;
}

.app-table tbody tr:hover td {
  background: var(--app-surface-2);
}

.app-table td a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.app-table td a:hover {
  color: var(--app-accent);
}

.app-table th.is-num {
  text-align: right;
}

.app-table td.is-num {
  text-align: right;
  font-family: var(--app-f-mono);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────
 * Listas (tabela de dados v2)
 * ───────────────────────────────────────────── */
.app-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-phead__sub--lead {
  margin: 0;
  font-size: 0.92rem;
  color: var(--app-fg-2);
}

.app-dt__toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--app-line);
}

.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 380px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--app-line-2);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-muted);
}

.app-search:focus-within {
  border-color: var(--app-accent);
  box-shadow: var(--ds-focus);
}

.app-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  color: var(--app-fg);
}

.app-seg {
  display: inline-flex;
  height: 36px;
  border: 1px solid var(--app-line-2);
  border-radius: var(--app-radius);
  overflow: hidden;
  background: var(--app-surface);
}

.app-seg button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--app-line);
  background: none;
  padding: 0 12px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--app-fg-2);
  cursor: pointer;
}

.app-seg button:last-child {
  border-right: 0;
}

.app-seg button:hover {
  color: var(--app-fg);
  background: var(--app-surface-2);
}

.app-seg button[aria-pressed="true"] {
  background: var(--app-surface-2);
  color: var(--app-fg);
  font-weight: 600;
}

.app-seg button:focus-visible {
  outline: none;
  box-shadow: inset var(--ds-focus);
}

.app-select {
  height: 36px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--app-line-2);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-fg);
  font: inherit;
  font-size: 0.84rem;
  max-width: 240px;
}

.app-select:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: var(--ds-focus);
}

.app-dt__count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.app-dt__pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--app-line);
}

.app-dt__pager[hidden] {
  display: none;
}

.app-dt__pageinfo {
  font-size: 0.8rem;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
}

.app-th-sort {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.app-th-sort svg {
  opacity: 0.35;
}

.app-th-sort:hover {
  color: var(--app-fg);
}

.app-table th[aria-sort="ascending"] .app-th-sort,
.app-table th[aria-sort="descending"] .app-th-sort {
  color: var(--app-fg);
}

.app-table th[aria-sort="ascending"] svg path:last-child,
.app-table th[aria-sort="descending"] svg path:first-child {
  opacity: 0;
}

.app-table th[aria-sort="ascending"] svg,
.app-table th[aria-sort="descending"] svg {
  opacity: 1;
}

.app-th-sort:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
  border-radius: 4px;
}

.app-table td.app-td-actions,
.app-table th.app-th-actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.app-table__empty td {
  padding: 28px 18px;
  text-align: center;
  color: var(--app-muted);
}

.app-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-person__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.app-table .app-person__name,
.app-person__name {
  font-weight: 500;
  color: var(--app-fg);
  text-decoration: none;
}

.app-person__meta {
  font-size: 0.76rem;
  color: var(--app-muted);
}

.app-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.app-stack small {
  font-size: 0.76rem;
}

.app-cell-clip {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-code {
  font-family: var(--app-f-mono);
  font-size: 0.78rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--app-surface-2);
  color: var(--app-fg-2);
}

.app-table a.app-strong-link {
  font-weight: 500;
}

.app-rowlink {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--app-muted);
}

.app-table tr:hover .app-rowlink,
.app-rowlink:hover {
  color: var(--app-accent);
  background: var(--app-accent-soft);
}

.app-show-sm {
  display: none;
}

@media (max-width: 900px) {
  .app-hide-md {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-hide-sm {
    display: none;
  }
  .app-show-sm {
    display: block;
  }
  .app-dt__count {
    margin-left: 0;
    width: 100%;
  }
  .app-search {
    max-width: none;
  }
}

/* Botões ds-btn com ícone (uiButton) */
.ds-btn svg {
  flex: none;
}

.app-table .app-col-hidden {
  display: none;
}

/* Barra de abas com uma única aba e sem ações (ex.: Artigos, Vendas): o título já está na barra superior */
.bo-partner-tabbed__bar:has(> .bo-tabbar > :only-child):not(:has(.bo-partner-tabbed__bar-end)) {
  display: none;
}

/* ─────────────────────────────────────────────
 * Fichas e formulários (Fase 4)
 * ───────────────────────────────────────────── */

/* Lista lateral master-detail (empresas, lojas, parceiros, utilizadores) */
.bo-partner-side {
  background: var(--app-surface);
  border-color: var(--app-line);
}

.bo-partner-side__head-title {
  font-family: var(--app-f-display);
  font-weight: 600;
}

.bo-partner-side .bo-partner-side__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name badge" "meta meta";
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
}

.bo-partner-side .bo-partner-side__name {
  grid-area: name;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--app-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-partner-side .bo-partner-side__meta {
  grid-area: meta;
  font-size: 0.76rem;
  color: var(--app-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bo-partner-side .bo-partner-side__badge {
  grid-area: badge;
  justify-self: end;
  margin: 0;
  font-size: 0;
  width: 8px;
  height: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
}

.bo-partner-side .bo-partner-side__badge--on {
  background: var(--app-ok);
}

.bo-partner-side .bo-partner-side__badge--off {
  background: var(--app-line-2);
}

.bo-partner-side .bo-partner-side__link:hover {
  background: var(--app-surface-2);
}

.bo-partner-side .bo-partner-side__link.is-active {
  background: var(--app-accent-soft);
  border-color: color-mix(in srgb, var(--app-accent) 30%, transparent);
}

.bo-partner-side .bo-partner-side__link.is-active .bo-partner-side__name {
  color: var(--app-accent);
}

/* Barra de ferramentas da ficha: "Guardar" mostra sempre o texto */
.bo-partner-toolbar__btn--icon.bo-btn--primary[type="submit"] {
  gap: 0.4rem;
  padding-left: 0.7rem;
  padding-right: 0.85rem;
}

.bo-partner-toolbar__btn--icon.bo-btn--primary[type="submit"] .bo-partner-toolbar__text {
  max-width: 15rem;
  opacity: 1;
}

.app-has-changes .bo-partner-toolbar__btn--icon.bo-btn--primary[type="submit"] {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 25%, transparent);
}

/* Títulos de secção nas fichas */
.bo-panel-section__title,
.bo-partner-tab-panel-head h3,
.bo-collapsible__title {
  font-family: var(--app-f-display);
  letter-spacing: -0.01em;
}

/* Caixas de verificação e rádios com a cor de acção */
.zswms-main input[type="checkbox"],
.zswms-main input[type="radio"] {
  accent-color: var(--app-accent);
}

/* Lista de lojas adicionais (ficha de utilizador) */
.bo-store-extra-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
}

.bo-store-extra-checks .bo-store-extra-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: var(--app-surface);
  font-size: 0.86rem;
  color: var(--app-fg);
  cursor: pointer;
}

.bo-store-extra-checks .bo-store-extra-check:hover {
  border-color: var(--app-line-2);
}

.bo-store-extra-checks .bo-store-extra-check:has(input:checked) {
  border-color: var(--app-accent);
  background: var(--app-accent-soft);
}

.bo-store-extra-checks .bo-store-extra-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
}

/* Barra fixa de alterações por guardar (bo_unsaved_guard_st.inc.php) */
.app-savebar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  max-width: calc(100vw - 32px);
  background: var(--app-surface);
  border: 1px solid var(--app-line-2);
  border-radius: 12px;
  box-shadow: var(--app-shadow-pop);
  font-size: 0.86rem;
}

.app-savebar[hidden] {
  display: none;
}

.app-savebar__msg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  color: var(--app-fg);
  white-space: nowrap;
}

.app-savebar__msg::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app-warn);
  flex: none;
}

@media (min-width: 901px) {
  .app-savebar {
    left: calc(50% + var(--app-side-w) / 2);
  }
  .app-side-collapsed .app-savebar {
    left: calc(50% + var(--app-side-w-collapsed) / 2);
  }
}

@media (max-width: 520px) {
  .app-savebar__msg {
    display: none;
  }
}

/* Modais */
.bo-modal__dialog {
  border-radius: 12px;
  border: 1px solid var(--app-line);
  box-shadow: var(--app-shadow-pop);
}

.bo-modal__title {
  font-family: var(--app-f-display);
}

/* Ligações simples dentro de tabelas legadas: cor de acção, sem sublinhado até ao hover */
.zswms-main table a:not([class]) {
  color: var(--app-accent);
  text-decoration: none;
  font-weight: 500;
}

.zswms-main table a:not([class]):hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────
 * Fichas: sem lista lateral, com botão «Voltar à lista»
 * ───────────────────────────────────────────── */
.app-detail .bo-partner-shell > .bo-partner-side {
  display: none;
}

.app-detail .bo-partner-shell > .bo-partner-main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.app-top__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 10px;
  flex: none;
  border: 1px solid var(--app-line-2);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-fg-2);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.app-top__back:hover {
  background: var(--app-surface-2);
  color: var(--app-fg);
  border-color: var(--app-line-2);
}

.app-top__back:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
}

@media (max-width: 640px) {
  .app-top__back span {
    display: none;
  }
  .app-top__back {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}

/* ==========================================================================
   Gestão → Artigos (lista + ficha) — tmx-*
   ========================================================================== */
.tmx-sync { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tmx-sync__meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--app-muted); }
.tmx-sync__dot { opacity: .6; }
.tmx-sync__err { color: var(--app-bad); }
.tmx-spin {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid var(--app-line-2); border-top-color: var(--app-accent);
  border-radius: 50%; animation: tmx-spin .8s linear infinite;
}
@keyframes tmx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tmx-spin { animation-duration: 2.4s; } }

.tmx-list { padding: 0; overflow: hidden; }
.tmx-list .app-dt__toolbar { padding: 14px 16px; border-bottom: 1px solid var(--app-line); }
.tmx-table-wrap { overflow-x: auto; }
.tmx-table { width: 100%; }
.tmx-table th.is-num, .tmx-table td.is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tmx-table td.is-num { font-family: var(--app-f-mono); font-size: 13px; }
.tmx-table td.is-num.is-empty { color: var(--app-muted); }
.tmx-table .tmx-code { font-family: var(--app-f-mono); font-size: 13px; color: var(--app-accent); text-decoration: none; font-weight: 600; }
.tmx-table .tmx-desc { max-width: 420px; }
.tmx-table td.tmx-desc a { color: var(--app-fg); font-weight: 500; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmx-table tr[data-href] { cursor: pointer; }
.tmx-table tr[data-href]:hover td.tmx-desc a { color: var(--app-accent); }
.tmx-table .tmx-mono, .tmx-mono { font-family: var(--app-f-mono); font-size: .92em; }
.tmx-store-col { text-align: center; width: 1%; white-space: nowrap; }
th.tmx-store-col span { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.tmx-avail { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; }
.tmx-avail.is-on { background: var(--app-ok-soft); color: var(--app-ok); }
.tmx-avail.is-off { color: var(--app-line-2); }
.tmx-avail svg { width: 14px; height: 14px; }
.tmx-skel td { padding: 14px 16px; }
.tmx-skel span {
  display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--app-surface-2) 0%, var(--app-line) 50%, var(--app-surface-2) 100%);
  background-size: 200% 100%; animation: tmx-shimmer 1.2s ease-in-out infinite;
}
.tmx-skel:nth-child(odd) span { width: 82%; }
@keyframes tmx-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.tmx-list .app-dt__pager { padding: 12px 16px; border-top: 1px solid var(--app-line); }
.tmx-empty { padding: 40px 16px; text-align: center; color: var(--app-muted); }

/* ---------- Ficha ---------- */
.tmx-form { display: flex; flex-direction: column; gap: 16px; }
.tmx-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 24px; align-items: center; padding: 20px 24px; }
.tmx-head__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; }
.tmx-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: var(--app-surface-2); border: 1px solid var(--app-line); color: var(--app-fg-2); font-size: 12px; }
.tmx-head__barcode { font-size: 12px; color: var(--app-muted); padding-left: 4px; }
.tmx-head__title { margin: 0; font-family: var(--app-f-display); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--app-fg); overflow-wrap: anywhere; }
.tmx-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--app-muted); }
.tmx-head__prices { display: flex; gap: 8px; margin: 0; }
.tmx-head__prices > div { min-width: 110px; padding: 10px 14px; border-radius: var(--app-radius); background: var(--app-surface-2); border: 1px solid var(--app-line); }
.tmx-head__prices dt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--app-muted); }
.tmx-head__prices dd { margin: 2px 0 0; font-family: var(--app-f-mono); font-size: 18px; font-weight: 600; color: var(--app-fg); font-variant-numeric: tabular-nums; }
.tmx-head__actions { display: flex; gap: 8px; }

.tmx-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--app-radius); font-size: 13px; border: 1px solid transparent; }
.tmx-banner[hidden] { display: none; }
.tmx-banner--info { background: var(--app-accent-soft); color: var(--app-fg); border-color: color-mix(in srgb, var(--app-accent) 25%, transparent); }
.tmx-banner--warn { background: var(--app-warn-soft); color: var(--app-warn); border-color: color-mix(in srgb, var(--app-warn) 25%, transparent); }
.tmx-banner .ds-btn { margin-left: auto; }

.tmx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.tmx-main { padding: 0; overflow: hidden; }
.tmx-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--app-line); overflow-x: auto; scrollbar-width: none; }
.tmx-tab {
  appearance: none; border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 14px 12px 12px; font: 500 14px/1 var(--app-f-ui); color: var(--app-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px;
}
.tmx-tab:hover { color: var(--app-fg); }
.tmx-tab.is-active, .tmx-tab[aria-selected="true"] { color: var(--app-accent); border-bottom-color: var(--app-accent); }
.tmx-tab:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -4px; border-radius: 6px; }
.tmx-tab__count { display: inline-flex; min-width: 20px; height: 18px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 9px; background: var(--app-surface-2); color: var(--app-fg-2); font-size: 11px; font-weight: 600; }
.tmx-panel { padding: 8px 24px 24px; }
.tmx-panel[hidden] { display: none; }

.tmx-section { padding: 18px 0; border-bottom: 1px solid var(--app-line); }
.tmx-section:last-child { border-bottom: 0; }
.tmx-section__head { margin-bottom: 14px; }
.tmx-section__head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--app-fg-2); }
.tmx-section__head p { margin: 4px 0 0; font-size: 13px; color: var(--app-muted); }
.tmx-section__head--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.tmx-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.tmx-span-3 { grid-column: span 3; }
.tmx-span-4 { grid-column: span 4; }
.tmx-span-6 { grid-column: span 6; }
.tmx-span-12 { grid-column: span 12; }
.tmx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tmx-label { font-size: 13px; font-weight: 500; color: var(--app-fg-2); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; min-width: 0; min-height: 18px; }
.tmx-label__key { display: none; }
.tmx-form.show-keys .tmx-label__key { display: inline; font-family: var(--app-f-mono); font-size: 11px; font-weight: 400; color: var(--app-muted); }
.tmx-field { justify-content: flex-end; }
.tmx-input {
  width: 100%; min-height: 38px; padding: 8px 11px; box-sizing: border-box;
  border: 1px solid var(--app-line-2); border-radius: var(--app-radius);
  background: var(--app-surface); color: var(--app-fg); font: 400 14px/1.4 var(--app-f-ui);
  transition: border-color .12s, box-shadow .12s;
}
textarea.tmx-input { resize: vertical; min-height: 76px; }
.tmx-input:hover { border-color: var(--app-muted); }
.tmx-input:focus { outline: none; border-color: var(--app-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 22%, transparent); }
.tmx-input.tmx-num { text-align: right; font-family: var(--app-f-mono); font-variant-numeric: tabular-nums; }
.tmx-input.tmx-mono { font-family: var(--app-f-mono); }
.tmx-input[readonly], .is-readonly .tmx-input { background: var(--app-surface-2); color: var(--app-muted); border-color: var(--app-line); cursor: default; box-shadow: none; }
.tmx-input.is-dirty { border-color: var(--app-warn); }
[data-theme="dark"] .tmx-input[type="date"] { color-scheme: dark; }
/* Campos com lista de opções (família, unidades, IVA, …) */
select.tmx-input.tmx-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
select.tmx-input.tmx-select:disabled { cursor: progress; color: var(--app-muted); background-color: var(--app-surface-2); }
[data-theme="dark"] select.tmx-input.tmx-select { color-scheme: dark; }
.tmx-select option.is-unknown { color: var(--app-warn); }
.tmx-lookup-code { font-family: var(--app-f-mono); font-size: 11px; font-weight: 400; color: var(--app-muted); }
.tmx-lookups-status { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; color: var(--app-muted); }
.tmx-lookups-status.is-error { color: var(--app-warn); }
.tmx-lookups-status[hidden] { display: none; }
.tmx-color { display: flex; gap: 8px; align-items: stretch; }
.tmx-color .tmx-input { flex: 1 1 auto; font-family: var(--app-f-mono); }
.tmx-color__swatch { flex: 0 0 42px; width: 42px; min-height: 38px; padding: 3px; border: 1px solid var(--app-line-2); border-radius: var(--app-radius); background: var(--app-surface); cursor: pointer; }


.tmx-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.tmx-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "t l" "t k"; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--app-radius); cursor: pointer; }
.tmx-switch:hover { background: var(--app-surface-2); }
.tmx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tmx-switch__track { grid-area: t; position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--app-line-2); transition: background .15s; }
.tmx-switch__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.tmx-switch input:checked + .tmx-switch__track { background: var(--app-accent); }
.tmx-switch input:checked + .tmx-switch__track .tmx-switch__thumb { transform: translateX(14px); }
.tmx-switch input:focus-visible + .tmx-switch__track { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.tmx-switch input:disabled + .tmx-switch__track { opacity: .5; }
.tmx-switch__label { grid-area: l; font-size: 14px; color: var(--app-fg); }
.tmx-switch { grid-template-areas: "t l"; }
.tmx-form.show-keys .tmx-switch { grid-template-areas: "t l" "t k"; }
.tmx-switch__key { display: none; }
.tmx-form.show-keys .tmx-switch__key { display: block; grid-area: k; font-family: var(--app-f-mono); font-size: 11px; color: var(--app-muted); }

.tmx-pricetable { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--app-line); border-radius: var(--app-radius); overflow: hidden; }
.tmx-pricetable th, .tmx-pricetable td { padding: 6px 8px; border-bottom: 1px solid var(--app-line); text-align: left; }
.tmx-pricetable thead th { background: var(--app-surface-2); font-size: 12px; font-weight: 600; color: var(--app-muted); text-transform: uppercase; letter-spacing: .04em; padding: 9px 10px; }
.tmx-pricetable tbody tr:last-child > * { border-bottom: 0; }
.tmx-pricetable tbody th { font-family: var(--app-f-mono); font-size: 13px; font-weight: 600; color: var(--app-fg-2); width: 72px; padding-left: 12px; }
.tmx-pricetable tr.is-main th { color: var(--app-accent); }
.tmx-pricetable tr.is-main { background: color-mix(in srgb, var(--app-accent-soft) 45%, transparent); }
.tmx-pricetable .tmx-input { min-height: 34px; padding: 6px 9px; }
.tmx-pricetable .tmx-extra-level { display: none; }
.tmx-pricetable.show-all .tmx-extra-level { display: table-row; }
.tmx-barcodes td:last-child { width: 44px; text-align: center; }
.tmx-linkbtn { appearance: none; background: none; border: 0; padding: 10px 0 0; color: var(--app-accent); font: 500 13px var(--app-f-ui); cursor: pointer; }
.tmx-linkbtn:hover { text-decoration: underline; }
.tmx-iconbtn { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--app-muted); cursor: pointer; }
.tmx-iconbtn:hover { background: var(--app-bad-soft); color: var(--app-bad); }

.tmx-details { border: 1px solid var(--app-line); border-radius: var(--app-radius); margin-bottom: 10px; overflow: hidden; }
.tmx-details > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; background: var(--app-surface-2); font-size: 13px; }
.tmx-details[open] > summary { border-bottom: 1px solid var(--app-line); }
.tmx-details > div { overflow-x: auto; }
.tmx-details__empty { padding: 12px 14px; margin: 0; }
.tmx-nested { font-size: 13px; }

.tmx-aside { position: sticky; top: calc(var(--app-top-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.tmx-stores { padding: 18px; }
.tmx-stores h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--app-fg); }
.tmx-stores > p { margin: 4px 0 12px; font-size: 13px; color: var(--app-muted); }
.tmx-storelist { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; }
.tmx-store { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--app-radius); border: 1px solid var(--app-line); cursor: pointer; }
.tmx-store:hover { background: var(--app-surface-2); }
.tmx-store:has(input:checked) { border-color: var(--app-accent); background: var(--app-accent-soft); }
.tmx-store input { accent-color: var(--app-accent); width: 16px; height: 16px; margin: 0; }
.tmx-store__name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmx-store .app-pill { font-size: 11px; }
.tmx-stores__actions { display: flex; flex-direction: column; gap: 8px; }
.tmx-stores__actions .ds-btn { width: 100%; justify-content: center; }
.tmx-pushout:empty { display: none; }
.tmx-pushout { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.tmx-msg { margin: 0; padding: 8px 10px; border-radius: 6px; font-size: 13px; background: var(--app-surface-2); color: var(--app-fg-2); }
.tmx-msg--ok { background: var(--app-ok-soft); color: var(--app-ok); }
.tmx-msg--warn { background: var(--app-warn-soft); color: var(--app-warn); }
.tmx-msg--err { background: var(--app-bad-soft); color: var(--app-bad); }

@media (max-width: 1200px) {
  .tmx-head { grid-template-columns: minmax(0, 1fr) auto; }
  .tmx-head__actions { grid-column: 1 / -1; }
  .tmx-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 960px) {
  .tmx-layout { grid-template-columns: minmax(0, 1fr); }
  .tmx-aside { position: static; }
  .tmx-span-3 { grid-column: span 6; }
  .tmx-span-6, .tmx-span-4 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .tmx-head { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .tmx-head__prices > div { flex: 1; min-width: 0; }
  .tmx-panel { padding: 4px 16px 16px; }
  .tmx-span-3 { grid-column: span 12; }
  .tmx-pricetable { display: block; overflow-x: auto; }
}
.tmx-keys { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 12px; color: var(--app-muted); white-space: nowrap; cursor: pointer; }
.tmx-keys input { accent-color: var(--app-accent); margin: 0; }

/* ==========================================================================
   Editor de layouts PDF — pré-visualização fiel e painel de variáveis
   ========================================================================== */
.bo-pdf-layout-canvas__item {
  background: transparent;
  color: #1d2122;
  font-weight: 400;
  padding: 0 3px;
  outline: 1px dashed rgba(100, 116, 139, 0.32);
  outline-offset: 0;
  border-radius: 2px;
}
.bo-pdf-layout-canvas__item--line { outline: none; }
.bo-pdf-layout-canvas__item--column {
  border: 0;
  outline: none;
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.18), inset 0 -1px 0 rgba(15, 23, 42, 0.18);
  border-radius: 0;
}
.bo-pdf-layout-canvas__row-preview {
  color: #1d2122;
  border-color: rgba(15, 23, 42, 0.12);
  background: transparent;
}
.bo-pdf-layout-canvas__item.is-hovered { outline: 1.5px solid rgba(43, 98, 196, 0.75); }
.bo-pdf-layout-canvas__item.is-selected {
  outline: 2px solid #2b62c4;
  box-shadow: 0 0 0 4px rgba(43, 98, 196, 0.16);
}
.bo-pdf-layout-canvas__item.is-unknown-var {
  outline: 1.5px dashed #c2372f;
  background-color: rgba(194, 55, 47, 0.08) !important;
  color: #c2372f !important;
}
.bo-pdf-layout-canvas__item--shape:has(.bo-pdf-layout-canvas__grid-tag) { overflow: visible; }
.bo-pdf-layout-canvas__grid-tag {
  position: absolute;
  left: -1px;
  top: -18px;
  padding: 3px 7px;
  border-radius: 4px 4px 0 0;
  background: #2b62c4;
  color: #fff;
  font: 600 10px/1 var(--app-f-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.85;
}

.bo-pdf-layout-editor__toolbar-actions { align-items: center; }
.bo-pdf-layout-editor__preview-btn { gap: 6px; }

.bo-pdf-vars { flex: 0 0 auto; }
.bo-pdf-layout-canvas__item { white-space: nowrap; }
.bo-pdf-layout-canvas__item:not(.is-selected):not(.is-hovered) > .bo-pdf-layout-canvas__grid-tag { display: none; }
.bo-pdf-vars__hint { margin: 0 0 8px; font-size: 12px; line-height: 1.45; color: var(--app-muted); }
.bo-pdf-vars__search { width: 100%; margin-bottom: 8px; }
.bo-pdf-vars__list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.bo-pdf-vars__group { border: 1px solid var(--app-line); border-radius: var(--app-radius); background: var(--app-surface); }
.bo-pdf-vars__group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--app-fg-2);
}
.bo-pdf-vars__group > summary::-webkit-details-marker { display: none; }
.bo-pdf-vars__group[open] > summary { border-bottom: 1px solid var(--app-line); }
.bo-pdf-vars__count { min-width: 20px; padding: 1px 6px; border-radius: 9px; background: var(--app-surface-2); color: var(--app-muted); font-size: 11px; text-align: center; }
.bo-pdf-vars__group ul { list-style: none; margin: 0; padding: 4px; }
.bo-pdf-vars__group .bo-pdf-vars__hint { padding: 6px 8px 0; margin: 0; }
.bo-pdf-vars__item { display: flex; align-items: stretch; gap: 2px; }
.bo-pdf-vars__use {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 1px;
  padding: 6px 8px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; color: var(--app-fg);
  font: 400 13px/1.3 var(--app-f-ui);
}
.bo-pdf-vars__use:hover, .bo-pdf-vars__use:focus-visible { background: var(--app-accent-soft); outline: none; }
.bo-pdf-vars__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-pdf-vars__sample { grid-column: 2; grid-row: 1; color: var(--app-muted); font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-pdf-vars__code { grid-column: 1 / -1; font-family: var(--app-f-mono); font-size: 11px; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-pdf-vars__add {
  flex: none; width: 28px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--app-accent); font: 600 16px/1 var(--app-f-ui);
}
.bo-pdf-vars__add:hover, .bo-pdf-vars__add:focus-visible { background: var(--app-accent-soft); outline: none; }
/* Texto que não cabe na caixa transborda como no PDF (em vez de ficar cortado). */
.bo-pdf-layout-canvas__item:not(.bo-pdf-layout-canvas__item--shape):not(.bo-pdf-layout-canvas__item--image):not(.bo-pdf-layout-canvas__item--column) { overflow: visible; }

.app-api-test { display: grid; gap: 16px; padding: 18px; }
.app-api-test__row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) 148px minmax(180px, 1fr);
  gap: 12px 16px;
  align-items: end;
}
.app-api-test__hint { margin: 6px 0 0; font-size: var(--ds-text-sm); color: var(--ds-muted); }
.app-api-test__actions { display: flex; justify-content: flex-end; }
.app-api-test__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: var(--ds-text-sm);
  color: var(--app-muted);
}
.app-api-test__url {
  font-family: var(--app-f-mono);
  font-size: 12px;
  color: var(--app-fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(520px, 100%);
}
.app-api-test__code {
  font-family: var(--app-f-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--app-surface-2);
  color: var(--app-fg-2);
}
.app-api-test__code.is-ok { background: var(--app-ok-soft); color: var(--app-ok); }
.app-api-test__code.is-warn { background: var(--app-warn-soft); color: var(--app-warn); }
.app-api-test__code.is-bad { background: var(--app-bad-soft); color: var(--app-bad); }
.app-api-test__out {
  margin: 0;
  padding: 16px 18px;
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  font-family: var(--app-f-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--app-fg);
  background: var(--app-surface);
}
.app-api-test__out.is-empty { color: var(--app-muted); }
@media (max-width: 800px) {
  .app-api-test__row { grid-template-columns: 1fr; }
  .app-api-test__actions { justify-content: stretch; }
  .app-api-test__actions .ds-btn { width: 100%; }
}

/* ==========================================================================
   TesteAPI (api_tester.php)
   ========================================================================== */
.apit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.apit-card { padding: 0; overflow: hidden; }
.apit-card__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--app-line);
}
.apit-card__head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--app-fg); }
.apit-preset { margin-left: auto; }
.apit-preset .app-select { min-width: 230px; }
.apit-body { display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.apit-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.apit-field__head { display: flex; align-items: center; gap: 8px; }
.apit-field__tools { margin-left: auto; display: flex; gap: 12px; }
.apit-label { font-size: 13px; font-weight: 500; color: var(--app-fg-2); }
.apit-input {
  width: 100%; box-sizing: border-box; min-height: 40px; padding: 8px 11px;
  border: 1px solid var(--app-line-2); border-radius: var(--app-radius);
  background: var(--app-surface); color: var(--app-fg); font: 400 14px/1.4 var(--app-f-ui);
}
.apit-input:focus, .apit-endpoint:focus, .apit-method:focus {
  outline: none; border-color: var(--app-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 22%, transparent);
}
.apit-code { font-family: var(--app-f-mono); font-size: 13px; line-height: 1.55; min-height: 190px; resize: vertical; tab-size: 2; }
.apit-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--app-muted); }
.apit-kbd { white-space: nowrap; margin-left: 4px; }
.apit-kbd kbd {
  display: inline-block; padding: 1px 5px; border: 1px solid var(--app-line-2); border-bottom-width: 2px; border-radius: 4px;
  background: var(--app-surface-2); font: 500 11px/1.3 var(--app-f-mono); color: var(--app-fg-2);
}
.apit-bar { display: flex; align-items: stretch; min-width: 0; }
.apit-method {
  flex: none; width: 112px; padding: 0 10px; border: 1px solid var(--app-line-2); border-right: 0;
  border-radius: var(--app-radius) 0 0 var(--app-radius); background: var(--app-surface-2);
  font: 700 13px/1 var(--app-f-mono); cursor: pointer; color: var(--app-fg);
}
.apit-method[data-method="GET"], .apit-hist__m[data-method="GET"] { color: var(--app-ok); }
.apit-method[data-method="POST"], .apit-hist__m[data-method="POST"] { color: var(--app-accent); }
.apit-method[data-method="PUT"], .apit-method[data-method="PATCH"],
.apit-hist__m[data-method="PUT"], .apit-hist__m[data-method="PATCH"] { color: var(--app-warn); }
.apit-method[data-method="DELETE"], .apit-hist__m[data-method="DELETE"] { color: var(--app-bad); }
.apit-endpoint {
  flex: 1; min-width: 0; min-height: 42px; padding: 0 12px; border: 1px solid var(--app-line-2);
  background: var(--app-surface); color: var(--app-fg); font: 400 14px/1 var(--app-f-mono);
}
.apit-send { border-radius: 0 var(--app-radius) var(--app-radius) 0; min-width: 112px; min-height: 42px; justify-content: center; gap: 6px; }
.apit-json { font-size: 11px; }
.apit-link { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; color: var(--app-accent); font: 500 13px var(--app-f-ui); }
.apit-link:hover { text-decoration: underline; }

.apit-history .apit-card__head .apit-link { margin-left: auto; }
.apit-hist { list-style: none; margin: 0; padding: 6px; max-height: 470px; overflow-y: auto; }
.apit-hist__empty { padding: 18px 12px; color: var(--app-muted); font-size: 13px; text-align: center; }
.apit-hist__item {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: center;
  padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; color: var(--app-fg);
}
.apit-hist__item:hover, .apit-hist__item:focus-visible { background: var(--app-surface-2); outline: none; }
.apit-hist__m { font: 700 11px/1 var(--app-f-mono); }
.apit-hist__ep { font: 400 13px/1.3 var(--app-f-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apit-hist__code { font-size: 11px; }
.apit-hist__sub { grid-column: 1 / -1; font-size: 12px; color: var(--app-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.apit-res { margin-top: 0; }
.apit-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--app-muted); }
.apit-meta[hidden] { display: none; }
.apit-status { font-family: var(--app-f-mono); font-weight: 600; }
.apit-res__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.apit-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--app-fg-2); cursor: pointer; margin-right: 6px; }
.apit-check input { accent-color: var(--app-accent); margin: 0; }
.apit-url {
  padding: 8px 18px; border-bottom: 1px solid var(--app-line); background: var(--app-surface-2);
  font: 400 12px/1.4 var(--app-f-mono); color: var(--app-fg-2); overflow-x: auto; white-space: nowrap;
}
.apit-url[hidden] { display: none; }
.apit-out {
  margin: 0; padding: 16px 18px; min-height: 220px; max-height: 65vh; overflow: auto;
  font: 400 13px/1.55 var(--app-f-mono); color: var(--app-fg); background: var(--app-surface); white-space: pre; tab-size: 2;
}
.apit-out.is-wrap { white-space: pre-wrap; word-break: break-word; }
.apit-out.is-empty { color: var(--app-muted); font-family: var(--app-f-ui); white-space: normal; }
.apit-jk { color: #2b62c4; }
.apit-js { color: #17845a; }
.apit-jn { color: #a76407; }
.apit-jb { color: #8a3ffc; }
.apit-jz { color: #6c7476; font-style: italic; }
:root[data-theme="dark"] .apit-jk { color: #86aef4; }
:root[data-theme="dark"] .apit-js { color: #4cc38a; }
:root[data-theme="dark"] .apit-jn { color: #e3a54a; }
:root[data-theme="dark"] .apit-jb { color: #c4a1ff; }
:root[data-theme="dark"] .apit-jz { color: #8b9496; }

@media (max-width: 1100px) {
  .apit-layout { grid-template-columns: minmax(0, 1fr); }
  .apit-hist { max-height: 240px; }
}
@media (max-width: 640px) {
  .apit-bar { flex-wrap: wrap; }
  .apit-method { width: 100%; min-height: 40px; border-right: 1px solid var(--app-line-2); border-radius: var(--app-radius) var(--app-radius) 0 0; }
  .apit-endpoint { border-radius: 0; }
  .apit-send { width: 100%; border-radius: 0 0 var(--app-radius) var(--app-radius); min-height: 40px; }
  .apit-preset { margin-left: 0; width: 100%; }
  .apit-preset .app-select { width: 100%; }
  .apit-res__tools { margin-left: 0; }
}

/* ===== Relatório de vendas (tm_rel_vendas.php) ===== */
.rv { display: flex; flex-direction: column; gap: 16px; }
.rv-filters { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.rv-filters__fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.rv-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--app-fg-2); min-width: 150px; }
.rv-field .tmx-input { min-height: 38px; }
.rv-field--store { min-width: 220px; }
.rv-apply { min-height: 38px; }
.rv-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-chip { appearance: none; border: 1px solid var(--app-line-2); background: var(--app-surface); color: var(--app-fg-2); border-radius: 999px; padding: 4px 12px; font: 500 12.5px var(--app-f-ui); cursor: pointer; }
.rv-chip:hover { border-color: var(--app-accent); color: var(--app-accent); }
.rv-chip.is-active { background: var(--app-accent-soft); border-color: var(--app-accent); color: var(--app-accent); }

.rv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rv-kpi { background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-height: 86px; }
.rv-kpi__label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--app-muted); }
.rv-kpi__value { font: 600 24px/1.15 var(--app-f-display); color: var(--app-fg); font-variant-numeric: tabular-nums; }
.rv-kpi__sub { font-size: 12.5px; color: var(--app-muted); }
.rv-kpi.is-main { background: var(--app-accent-soft); border-color: color-mix(in srgb, var(--app-accent) 30%, transparent); }
.rv-kpi.is-main .rv-kpi__value { color: var(--app-accent); }
.rv-kpi.is-neg .rv-kpi__value { color: var(--app-bad); }
.rv-kpis--ghost .rv-kpi { animation: rv-pulse 1.2s ease-in-out infinite; }

.rv-section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: calc(var(--app-top-h) + 12px); }
.rv-section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.rv-section__head h3 { margin: 0; font: 600 16px var(--app-f-display); color: var(--app-fg); }
.rv-section__head h3::first-letter { text-transform: uppercase; }
.rv-section__head p { margin: 0; font-size: 13px; color: var(--app-muted); }
.rv-loading { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--app-muted); }

.rv-grid { display: grid; gap: 10px; }
.rv-grid--days { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.rv-grid--stores { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rv-tile {
  appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; min-width: 0;
  background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 10px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.rv-tile:hover { border-color: var(--app-accent); box-shadow: 0 2px 10px rgba(29, 33, 34, .07); }
.rv-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 30%, transparent); }
.rv-tile.is-active { border-color: var(--app-accent); background: var(--app-accent-soft); box-shadow: inset 0 0 0 1px var(--app-accent); }
.rv-tile__top, .rv-tile__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--app-muted); min-width: 0; }
.rv-tile__date { font-weight: 600; color: var(--app-fg-2); text-transform: capitalize; }
.rv-tile__name { font-weight: 600; color: var(--app-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-tile__meta { flex: 0 0 auto; }
.rv-tile__value { font: 600 20px/1.2 var(--app-f-display); color: var(--app-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-tile.is-active .rv-tile__value { color: var(--app-accent); }
.rv-tile--ghost { cursor: default; pointer-events: none; min-height: 104px; animation: rv-pulse 1.2s ease-in-out infinite; }
.rv-tile--ghost span { display: block; height: 10px; border-radius: 5px; background: var(--app-surface-2); }
.rv-tile--ghost span:nth-child(2) { height: 18px; width: 70%; }
.rv-tile--ghost span:nth-child(3) { width: 45%; }
@keyframes rv-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .rv-tile--ghost, .rv-kpis--ghost .rv-kpi { animation: none; } }

.rv-bar { display: block; height: 4px; border-radius: 2px; background: var(--app-surface-2); overflow: hidden; }
.rv-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--app-accent); }
.rv-tile.is-active .rv-bar { background: color-mix(in srgb, var(--app-accent) 15%, var(--app-surface)); }
.rv-neg { color: var(--app-bad); }

.rv-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.rv-detail .rv-card { display: flex; flex-direction: column; }
.rv-detail .rv-card__foot { margin-top: auto; }
.rv-row__share { font-size: 12px; font-weight: 400; color: var(--app-muted); }
.rv-card__foot--meta > span { display: flex; flex-direction: column; gap: 2px; }
.rv-card__foot--meta small { font-size: 11.5px; font-weight: 400; color: var(--app-muted); }
.rv-card { padding: 0; overflow: hidden; }
.rv-card__head { padding: 12px 16px; border-bottom: 1px solid var(--app-line); }
.rv-card__head h4 { margin: 0; font: 600 14px var(--app-f-ui); color: var(--app-fg); }
.rv-card__empty { padding: 14px 16px; margin: 0; }
.rv-card__foot { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-top: 1px solid var(--app-line); background: var(--app-surface-2); font-size: 13px; font-weight: 600; color: var(--app-fg-2); }
.rv-card__foot strong { font: 600 17px var(--app-f-display); color: var(--app-fg); font-variant-numeric: tabular-nums; }
.rv-rows { list-style: none; margin: 0; padding: 4px 16px; }
.rv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--app-line); }
.rv-row:last-child { border-bottom: 0; }
.rv-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rv-row__label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--app-fg); }
.rv-row__meta { font-size: 12px; color: var(--app-muted); }
.rv-row__value { font: 600 15px var(--app-f-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-row__bar { grid-column: 1 / -1; }
.rv-split { display: flex; height: 8px; margin: 14px 16px 2px; border-radius: 4px; overflow: hidden; background: var(--app-surface-2); }
.rv-split__sales { background: var(--app-accent); }
.rv-split__ret { background: var(--app-bad); }
.rv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.rv-dot--sales { background: var(--app-accent); }
.rv-dot--ret { background: var(--app-bad); }

.rv-docs { padding: 0; }
.rv-docs > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.rv-docs[open] > summary { border-bottom: 1px solid var(--app-line); }
.rv-table .rv-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-table td { font-size: 13px; }
.rv-empty { padding: 28px 16px; text-align: center; color: var(--app-muted); }
.rv-empty p { margin: 0; }
.rv-fail .tmx-linkbtn { padding: 0; margin-left: auto; }

@media (max-width: 1200px) {
  .rv-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .rv-field, .rv-field--store { min-width: 0; flex: 1 1 100%; }
  .rv-grid--days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-kpi__value { font-size: 20px; }
}
#rv-out { display: flex; flex-direction: column; gap: 22px; }
#rv-out:empty { display: none; }
.rv-card--wide { grid-column: 1 / -1; }
.rv-vat th, .rv-vat td { padding: 10px 16px; }
.rv-vat tfoot th, .rv-vat tfoot td { background: var(--app-surface-2); border-top: 1px solid var(--app-line); font-weight: 600; }
.rv-vat__share { width: 26%; min-width: 140px; }
.rv-vat__share .rv-vat__pct { display: block; font-size: 12px; color: var(--app-muted); margin-bottom: 4px; }

/* Artigos: filtro "Sem referência" e ordenação por coluna */
.app-toggle { appearance: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--app-line-2); border-radius: var(--app-radius); background: var(--app-surface); color: var(--app-fg-2); font: inherit; font-size: 0.82rem; cursor: pointer; white-space: nowrap; }
.app-toggle:hover { color: var(--app-fg); border-color: var(--app-muted); }
.app-toggle:focus-visible { outline: none; box-shadow: var(--ds-focus); }
.app-toggle__box { width: 14px; height: 14px; border: 1.5px solid var(--app-line-2); border-radius: 4px; background: var(--app-surface); display: inline-grid; place-items: center; }
.app-toggle[aria-pressed="true"] { background: var(--app-accent-soft); border-color: var(--app-accent); color: var(--app-accent); font-weight: 600; }
.app-toggle[aria-pressed="true"] .app-toggle__box { background: var(--app-accent); border-color: var(--app-accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); background-size: 10px; background-repeat: no-repeat; background-position: center; }
th.tmx-store-col .app-th-sort { justify-content: center; }
th.tmx-store-col .app-th-sort > span { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
th.is-num .app-th-sort { flex-direction: row-reverse; }

.tmx-supplier { max-width: 260px; }
.app-select.is-active { border-color: var(--app-accent); background-color: var(--app-accent-soft); color: var(--app-accent); font-weight: 600; }

/* ===== Artigos sem movimentos / candidatos a descontinuar ===== */
.idle { display: flex; flex-direction: column; gap: 16px; padding-bottom: 72px; }
#idle-out { display: flex; flex-direction: column; gap: 16px; }
#idle-out:empty { display: none; }
.idle-rule { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 12.5px; color: var(--app-muted); }
.idle-rule svg { flex: 0 0 auto; }
.idle-progress { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.idle-progress__top { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--app-fg-2); }
.idle-progress__top strong { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--app-fg); }
.idle-progress__bar { height: 6px; border-radius: 3px; }
.idle-progress__bar > span { transition: width .3s ease; }
.idle-list { padding: 0; overflow: hidden; }
.idle-table th.idle-chk, .idle-table td.idle-chk { width: 1%; padding-right: 0; }
.idle-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--app-accent); cursor: pointer; vertical-align: middle; }
.idle-table tr.is-selected td { background: var(--app-accent-soft); }
.idle-table tr.is-done td { opacity: .55; }
.idle-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.idle-cell--idle { background: var(--app-warn-soft); color: var(--app-warn); }
.idle-cell--sold { background: var(--app-ok-soft); color: var(--app-ok); font-weight: 500; }
.idle-cell--stock { background: var(--app-accent-soft); color: var(--app-accent); }
.idle-cell--unknown { background: var(--app-surface-2); color: var(--app-muted); }
.idle-cell--absent { color: var(--app-line-2); }
.idle-bulk {
  position: fixed; left: calc(var(--app-side-w) + 24px); right: 24px; bottom: 16px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px;
  background: var(--app-surface); border: 1px solid var(--app-line-2); border-radius: 12px; box-shadow: var(--app-shadow-pop);
  transform: translateY(140%); transition: transform .18s ease;
}
.idle-bulk.is-on { transform: none; }
.idle-bulk .tmx-linkbtn { padding: 0; }
.idle-bulk__target { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--app-fg-2); margin-left: auto; }
.idle-bulk__target .app-select { max-width: 320px; }
.idle-bulk__log { flex-basis: 100%; font-size: 12.5px; color: var(--app-muted); }
.idle-bulk__log:empty { display: none; }
.app-side-collapsed .idle-bulk { left: calc(var(--app-side-w-collapsed) + 24px); }
@media (max-width: 900px) { .idle-bulk { left: 12px; right: 12px; } .idle-bulk__target { margin-left: 0; } }

.tmx-select.is-discontinued { border-color: var(--app-warn); color: var(--app-warn); font-weight: 600; }
.idle-cell--zero { background: var(--app-surface-2); color: var(--app-fg-2); }
.idle-table td.tmx-store-col { line-height: 1.2; }
.idle-cell__date { display: block; margin-top: 3px; font-size: 11px; color: var(--app-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.idle-found { font-size: 14px; color: var(--app-fg); }
.idle-table th.idle-storehead { text-align: center; border-bottom: 1px solid var(--app-line); white-space: nowrap; }
.idle-table th.idle-storehead span { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.idle-table th.idle-sub { font-size: 11px; font-weight: 500; text-align: center; white-space: nowrap; }
.idle-table td.idle-num, .idle-table td.idle-date { text-align: center; white-space: nowrap; font-size: 12.5px; }
.idle-table td.idle-num { border-left: 1px solid var(--app-line); }
.idle-more { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--app-line); }
.idle-more__busy { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--app-muted); }
.idle-diag { margin: 0; padding: 8px 16px; font-size: 12.5px; color: var(--app-muted); border-bottom: 1px solid var(--app-line); }
.idle-err { display: block; margin-top: 4px; font: 11.5px var(--app-f-mono); word-break: break-all; }
